• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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