How do i make it so that "All units" must leave near a certain "unit" inorder to allow my actions to occur?
None.
You could have a trigger keep track of how many units are in range of the unit (There is a unit enters range of unit event). And use that as a condition for your other actions. There is probably a better way but that is an easy solution.
None.
I did that but it doesnt give me a numberical value on how many units that can enter in.
None.
Hmm i think i have an idea but I need a little bit more info. Which would be the triggering event ? Or do you want something like When there's 0 units within 2 meters of Unit X do "these actions" ?
~TheFreak
None.
I did that but it doesnt give me a numberical value on how many units that can enter in.
You would need to keep track of that yourself. When a unit enters the area increase a variable and when it leaves decrease it.
None.
You could also use a unit group, add a unit if it is too close, and remove it if it gets far enough away or dies, and then just use the function "Number of units in Unit group".
None.
Hmm i think i have an idea but I need a little bit more info. Which would be the triggering event ? Or do you want something like When there's 0 units within 2 meters of Unit X do "these actions" ?
~TheFreak
Yea, I would like something like 0 units ear 2 meters of x unit.
You would need to keep track of that yourself. When a unit enters the area increase a variable and when it leaves decrease it.
~Temp
How do I use Varables ? XD
None.
Ok that is good enough.
So, what you need to do is set up a new Trigger and make the Event will be Any Unit Leaves a distance of (Whatever distance you want) from (Whatever unit you want)
Then you create 2 Local Variables. One of type Region and one of type Unit Group.
Set the local variable of type region to be Region from circle( (Poision of (Whatever unit you want to have no units around), (Whatever range you want))
Set the local variable of type Unit Group to be Any unit in The local variable you created for region.
Now add a comparison condition that checks; Number of units in unit group ( local variable of type unit group) == 1
and in actions add whatever actions you want to do when there is no one near your specified unit.
Note: this only works when units leave. If you want this to work EVERY time your unit has no other units around, replace the event for a periodic event of every 1 second or something.
Attached is a picture so everything is more clear.
Hope this is what you need.
~TheFreak
Attachments:
None.