• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

A doubt about Array Unit Group Variable!

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2005
Messages
205
I am with a fatal doubt :? ! My problem is with an array variable unit group that I created! The trigger that I'm trying to do is this:
Event=>
-A unit begins casting an ability!
Condition=>
-Ability being cast equal to ... (It doesn't interest here :D )
Actions =>
-Set integer = integer + 1
-Set Spell_Target[integer] = target unit of ability...
-Add target unit of ability being cast to Spell Unit Group[integer]
-Create a dummy unit for owner of casting unit...
-Set Spell_Unit[integer] = Last Created Unit
-Order last created unit to attack Spell_Target[integer]
-Add last created unit to Spell Unit Group[integer]


Note:
integer is an integer variable, Spell Target and Spell unit are Unit Array variables both, Spell unit group is an array unit group variable. :lol:


everything OK in this trigger, but, my problem is with the other trigger that is:

Event=>
-A unit is attacked
Condition =>
-Attacked unit is in Spell unit group [...*]...

//Here is the problem! what I must to put at this [index]? I want this value checking all of the values from the Spell unit group variable, but I don't know exactly what function to use! :(

Thnx if u help me! :wink:
 
Level 7
Joined
May 6, 2005
Messages
390
Ensure that the index of the variable in variable editor is as high as the maximum number the integer variable could be.

And by the way, better use a unit starts the effects of an ability.
 
Level 6
Joined
Aug 12, 2005
Messages
205
integer and Spell Unit group variables, both was created with array 1, I don't know if this influences in anything. I think that has no limit to the unit group variable, because every time that the hero cast the ability, the value is increased by 1. :(
What i exactly need to know is what function to put at the [index] in the boolean condition:
Attacked unit is in Spell unit group [...]
I want this trigger happening if the attacked unit is from any value of the Spell unit group variable, ( I want this array variable working at this condition as if it isn't an array variable, but the variable must to be an array because some of other references that has about it at the map)
:arrow: I'm not from USA or from any other country that speak English, then, I do not speak very well, but I hope you can understand me :wink:
 
Level 6
Joined
Aug 12, 2005
Messages
205
Draqz, that is what I want to do, but, I also already tried to make this trigger with loop functions, but, when I make the trigger as this manner that you spoke, as this:

For each integer A 1 to 9999999, do actions:
If attacked unit is in Spell Unit group [integer A]
Then do...

But, it checks if the attacked unit is in all index numbers of the variable, i want it checking if the attacked unit is in any value from 1 to 9999999 per example. :wink:
 
Status
Not open for further replies.
Top