Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Like every 2 seconds. Pick all Units of ur Type. Put the picked unit in a variable (guess it should do something, so u can refer do that specific unit). Then pick all units within range of that picked unit.
Lets say theres a hunter and a deer. The hunter comes near the deer and i want to know is there a way to refer to the deer with a condition? (like triggering unit, entering unit etc)
Like Kinglz said: put all deer into a variable (for example: Deer [1] = Deer 001; Deer [2] = Deer 002 and so on in Map Initialization.
Then do a trigger like this:
Events: Every 2 seconds of game time
Actions: Loop: for each Integer A from 1 to (thenumberofdeersonyourmap) do:
pick all units in 200 (any number) of Deer [Integer A] matching : picked unit is a Hunter and do actions:
Deer [Integer A] is the deer you're concerning.
Picked unit is the Hunter.
if there's only 1 deer, you don't need an array or a loop.
unscrewed magic look at my first post, and actually the thing i want to do is spawn more deer after some of them die and i want the unit within range to work on the respawned ones too
So you want to count all dears in range to ur hunter ?
Thats pretty easy.
Periodic Event.
Unit Group- Pick every of Type hunter.
do
pick every unit in X range of picked unit matching condition is type deer
do
** Set Temp_Count = Temp_Count +1
The Integer Temp_Count is increased everytime he finds a deer within range of the hunter.
after all that you should set Temp_Count back to 0.
** here u can set everything you want to do when a deer is picked...... it will be done for every deer in range....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.