I created a trigger in my tps which basically shows blood on the screen for every point of damage. However, my trigger isn't really working: whenever i shoot something it displays an error for this trigger saying that its trying to access an element past the array (or something like that). Furthermore, nothing happens when my unit gets attacked. Here's my trigger:
Life
Events
Unit - PlayerUnit[1] Life changes
Unit - PlayerUnit[2] Life changes
Local Variables
Life = 0.0 <Real[2]>
Conditions
Actions
Variable - Set Life[(Triggering player)] = (PlayerUnit[(Triggering player)] Life (Current))
Dialog - Fade Life Indicator[(Triggering player)] to a transparency of (100.0 - Life[(Triggering player)]) over a period of 2.0 seconds for (Player group((Triggering player)))
And here's what's setting up the image: (its on a repeat twice action which runs through it for each player, hence the Modify Player +1 at the end)
Dialog - Create a Modal dialog of size (1000, 1000) at (0, 0) relative to Center of screen
Variable - Set Life Indicator (Box)[Player] = (Last created dialog)
Dialog - Create an image for dialog Life Indicator (Box)[Player] with the dimensions (1000, 1000) anchored to Center with an offset of (0, 0) setting the tooltip to "" using the image Assets\Textures\bloodsplat_6.dds as a Normal type with tiled set to true tint color White and blend mode Normal
Variable - Set Life Indicator[Player] = (Last created dialog item)
Variable - Modify Player: + 1
well for starters your using variables in the events which is ussually a no no
try this
Events
Any unit takes damage lethal or non-lethal
Conditions
Or
triggering unit = PlayerUnit[1]
triggering unit = PlayerUnit[2]
Actions
Variable - Set Life[(Triggering player)] = (PlayerUnit[(Triggering player)] Life (Current))
Dialog - Fade Life Indicator[(Triggering player)] to a transparency of (100.0 - Life[(Triggering player)]) over a period of 2.0 seconds for (Player group((Triggering player)))
make sure that these global arrays your using handle all players .... 0-15 and you should not get an out of bounds error
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
I created a trigger in my tps which basically shows blood on the screen for every point of damage. However, my trigger isn't really working: whenever i shoot something it displays an error for this trigger saying that its trying to access an element past the array (or something like that). Furthermore, nothing happens when my unit gets attacked. Here's my trigger:
Life
Events
Unit - PlayerUnit[1] Life changes
Unit - PlayerUnit[2] Life changes
Local Variables
Life = 0.0 <Real[2]>
Conditions
Actions
Variable - Set Life[(Triggering player)] = (PlayerUnit[(Triggering player)] Life (Current))
Dialog - Fade Life Indicator[(Triggering player)] to a transparency of (100.0 - Life[(Triggering player)]) over a period of 2.0 seconds for (Player group((Triggering player)))
And here's what's setting up the image: (its on a repeat twice action which runs through it for each player, hence the Modify Player +1 at the end)
Dialog - Create a Modal dialog of size (1000, 1000) at (0, 0) relative to Center of screen
Variable - Set Life Indicator (Box)[Player] = (Last created dialog)
Dialog - Create an image for dialog Life Indicator (Box)[Player] with the dimensions (1000, 1000) anchored to Center with an offset of (0, 0) setting the tooltip to "" using the image Assets\Textures\bloodsplat_6.dds as a Normal type with tiled set to true tint color White and blend mode Normal
Variable - Set Life Indicator[Player] = (Last created dialog item)
Variable - Modify Player: + 1
@Cbasz95: Go
well for starters your using variables in the events which is ussually a no no
try this
make sure that these global arrays your using handle all players .... 0-15 and you should not get an out of bounds error
woah works perfectly now, thanks! Just wondering, how come you can't use variables in events?
EDIT: Nvm just searched it on the forum, apparently events are registered on the map loadup so you can only use constant variables