| 12-03-2003, 02:12 AM | #1 |
I tried to make a trigger for a spell that something happen if a unit comes within 200 of any unit within group, however there aren't any "any" in unit from group. Doing something like: Pick every unit from Group and do Set Picked unit = Group_unit won't work, because a unit variable can only be equal to 1 unit(which will be the last one picked) so if someone says I should do that, I whack him with a bat |
| 12-03-2003, 03:19 AM | #2 |
Sadly you can't use variables in the Events. perhaps you could give a little more detail? I don't need to know the spell, I just would like to know what you want it to do. A possible workaround is: when the spell is cast, turn on <trigger> that will check periodically <time> to see if anyone is range 200 from each unit. Trigger1 E: Spell is cast C: <the usual conditions> A: <your usual stuff> Turn on <Trigger2> Turn on TimerToTrigger2Off Trigger2 E: Every .5 seconds C: A: Pick all units in Unit-Group { if Unit in range 200 of Position of Picked Unit matching Unit is an enemy of owner of picked unit then <whatever> else DoNothing } Trigger3 E: TimerToTrigger2Off elapsed C: A: Turn off <Trigger2> |
| 12-03-2003, 04:35 AM | #3 |
Yes more detail would be nice. And most of all are you using ROC or TFT? Some detail on the units. Will The group be the same for the whole game? Will the units always be members of the same team? I ask because I think The TRIGGER- ADD event function could be used here in certain instances. |
| 12-03-2003, 01:53 PM | #4 |
I answered you on the ToB forums. ;) It is done by jass and creates a new trigger for every unit which is added, and destroys the trigger again when the unit is removed again. Max 99 units can be in the group at any given time, though (hardcoded upper limit). |
| 12-04-2003, 01:58 AM | #5 | |
Quote:
Hey Kolibri, could you put a link to that post, or if possible cnp it over here? I'd like to take a look at it. Thanks |
| 12-04-2003, 08:09 AM | #6 |
Actually I put it in the trigger vault here. Let me see... http://www.wc3campaigns.com/forums/s...threadid=39186 |
