Hi guys. I have a hero who shoots out a fireball. That fireball flies until it hits a unit, upon doing so, either hitting the target or an innocent bystander, deals "fake damage" then a trigger gets notified of that "fake damage" and dishes out "real damage" to that unit and all units around to resemble being hit by a ball of fire. The reason I did this is to be able to level up the skill for the hero.
My issue is that occasionally the game will spit out:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Negative array indexes not supported
I have the game say "fireball lev 1" just so i know that the trigger ran for that shot, but when this error pops up no damage or text is given.
Here is the code for my trigger that it's returning
ConjureFireballDamageEventsUnit-AnyUnittakesFatalorNon-FatalSpelldamage(fromEthereal-ConjureFireball(Level1)(FakeDamage)effects)LocalVariablesConditions(Triggeringdamageamount)==0.0ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Player(Ownerof(Damagingunit))fromHumanPlayers)]==1ThenUI-Display"Fireball is Level 01"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Player(Ownerof(Damagingunit))fromHumanPlayers)]==2ThenUI-Display"Fireball is Level 02"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElse
Any ideas? I can post the Fireball ability code if needed as well.
I changed: Level of Conjure Fireball[(Player (Owner of (Damaging unit)) from Human Players)] == 1
To: Level of Conjure Fireball[(Player (Owner of (Damaging unit)) from All Players)] == 1
And I no longer get the "Negative array indexes not supported" Error. Instead I now get:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Any ideas?
(Human players was a player group that was created with all active human players at the start of the map, I had a testing mode trigger that added player 1 to Human players at map initiation)
I tried your method (smart by the way, i don't know why i went around in a circle like that to get the player number)
However im still getting an error.
Now it says:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Here's my code edited, notice I added a line in the "else" to say that fireball is neither level 1 or level 2, Not level 1, or not level 2. The game occasionally returned a message saying "Fireball is not level 2" and that's when it does no damage (it gives the trigger error code at random times). I'm pretty much really lost on this one.
ConjureFireballDamageEventsUnit-AnyUnittakesFatalorNon-FatalSpelldamage(fromEthereal-ConjureFireball(Level1)(FakeDamage)effects)LocalVariablesConditions(Triggeringdamageamount)==0.0ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfOrConditionsLevelofConjureFireball[(Ownerof(Triggeringunit))]==1LevelofConjureFireball[(Ownerof(Triggeringunit))]==2ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Ownerof(Triggeringunit))]==1ThenUI-Display"Fireball is Level 01"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitleareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Ownerof(Triggeringunit))]==2ThenUI-Display"Fireball is Level 02"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitlearea
Also another thing to note: The integer "Level of Fireball" is an integer array of 13, and its default is set to 1
i noticed you changed it to Triggering Unit instead of Damaging Unit, was this on purpose? because if your using this ability on player 15, owner of Triggering Unit will return 15, and since the max of the array is 13 that will give an array overflow error
LinkD!! Good catch, geez', I'm glad i re-posted the trigger, there needs to be a point system of something here, good eye man!
As far as changing the trigger goes, just tried it with "damaging unit" and I get the same trigger error
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Here's the new code
ConjureFireballDamageEventsUnit-AnyUnittakesFatalorNon-FatalSpelldamage(fromEthereal-ConjureFireball(Level1)(FakeDamage)effects)LocalVariablesConditions(Triggeringdamageamount)==0.0ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfOrConditionsLevelofConjureFireball[(Ownerof(Damagingunit))]==1LevelofConjureFireball[(Ownerof(Damagingunit))]==2ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Ownerof(Damagingunit))]==1ThenUI-Display"Fireball is Level 01"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(2RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitleareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfLevelofConjureFireball[(Ownerof(Damagingunit))]==2ThenUI-Display"Fireball is Level 02"for(Allplayers)toSubtitleareaEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Triggeringunit)from(Damagingunit)with0.0extradamageUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),1.2))ownedbyplayer13matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsEnvironment-DealdamageusingEthereal-ConjureFireball(Level1)(5RealDamage)on(Pickedunit)from(Damagingunit)with0.0extradamageGeneral-Wait2.0GameTimesecondsUI-Display" "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitleareaElseUI-Display"FIREBALL IS <c "for(Allplayers)toSubtitlearea
I have a question, when the error pops up or when the shot doesn't give me a "fireball is level one" nothing actually happens. I mean, shouldn't my trigger cause the game to always say one of the following: "Fireball is level 1" "Fireball is not level 1" "Fireball is level 2" "Fireball is not level 2" "Fireball is neither level 1 or level 2" I mean I added those actions into the "else" categories yet i occasionally get a blank attack that does 0 damage and no chat message.
hm, i can't really see the issue now honestly, and about the error, when the error you got occurs, it completely stops the trigger so it doesn't get to do any more actions so it won't run the text message. (the trigger can still run again though)
and since the first action is the text message, that would mean the condition is still the source of the error, i just don't see the error
Hi guys. I have a hero who shoots out a fireball. That fireball flies until it hits a unit, upon doing so, either hitting the target or an innocent bystander, deals "fake damage" then a trigger gets notified of that "fake damage" and dishes out "real damage" to that unit and all units around to resemble being hit by a ball of fire. The reason I did this is to be able to level up the skill for the hero.
My issue is that occasionally the game will spit out:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Negative array indexes not supported
I have the game say "fireball lev 1" just so i know that the trigger ran for that shot, but when this error pops up no damage or text is given.
Here is the code for my trigger that it's returning
Any ideas? I can post the Fireball ability code if needed as well.
As always, thanks for the assistance.
Edit: I've been messing around with the trigger.
I changed:
Level of Conjure Fireball[(Player (Owner of (Damaging unit)) from Human Players)] == 1
To:
Level of Conjure Fireball[(Player (Owner of (Damaging unit)) from All Players)] == 1
And I no longer get the "Negative array indexes not supported" Error. Instead I now get:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Any ideas?
(Human players was a player group that was created with all active human players at the start of the map, I had a testing mode trigger that added player 1 to Human players at map initiation)
can't you just do (Owner of Unit)? you don't need to use the Player from player group function
Level of Conjure Fireball[(Owner of (Damaging unit)] == 1
Thanks for the reply LinkD
I tried your method (smart by the way, i don't know why i went around in a circle like that to get the player number)
However im still getting an error.
Now it says:
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Here's my code edited, notice I added a line in the "else" to say that fireball is neither level 1 or level 2, Not level 1, or not level 2. The game occasionally returned a message saying "Fireball is not level 2" and that's when it does no damage (it gives the trigger error code at random times). I'm pretty much really lost on this one.
Also another thing to note: The integer "Level of Fireball" is an integer array of 13, and its default is set to 1
Thanks
-ViG
i noticed you changed it to Triggering Unit instead of Damaging Unit, was this on purpose? because if your using this ability on player 15, owner of Triggering Unit will return 15, and since the max of the array is 13 that will give an array overflow error
@LinkD: Go
LinkD!! Good catch, geez', I'm glad i re-posted the trigger, there needs to be a point system of something here, good eye man!
As far as changing the trigger goes, just tried it with "damaging unit" and I get the same trigger error
TriggerErrorin
'gt_ConjureFireballDamage_Func':
Trying to access an element past the end of an array
Here's the new code
I have a question, when the error pops up or when the shot doesn't give me a "fireball is level one" nothing actually happens. I mean, shouldn't my trigger cause the game to always say one of the following: "Fireball is level 1" "Fireball is not level 1" "Fireball is level 2" "Fireball is not level 2" "Fireball is neither level 1 or level 2" I mean I added those actions into the "else" categories yet i occasionally get a blank attack that does 0 damage and no chat message.
Thanks for the continuing help,
hm, i can't really see the issue now honestly, and about the error, when the error you got occurs, it completely stops the trigger so it doesn't get to do any more actions so it won't run the text message. (the trigger can still run again though)
and since the first action is the text message, that would mean the condition is still the source of the error, i just don't see the error
@ViG01: Go
have you tried outputing the owner of damaging unit value to the screen?
then you can see which index it is trying to reach.