When unit enters range of unit type

Status
Not open for further replies.
You can do this with a periodic event.

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.

Should work this way.
 
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.
 
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....
 
Status
Not open for further replies.
Back
Top