Staredit Network > Forums > SC2 Assistance > Topic: All Unit Leave at this point.
All Unit Leave at this point.
Aug 16 2010, 7:28 pm
By: Septhiroth  

Aug 16 2010, 7:28 pm Septhiroth Post #1



How do i make it so that "All units" must leave near a certain "unit" inorder to allow my actions to occur?



None.

Aug 16 2010, 8:00 pm Temp Post #2



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.

Aug 16 2010, 8:22 pm Septhiroth Post #3



I did that but it doesnt give me a numberical value on how many units that can enter in.



None.

Aug 16 2010, 8:29 pm TheFreak Post #4



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.

Aug 16 2010, 9:05 pm Temp Post #5



Quote from Septhiroth
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.

Aug 16 2010, 9:14 pm shmeeps Post #6



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.

Aug 17 2010, 12:38 am Septhiroth Post #7



Quote from TheFreak
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.

Quote from Temp
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.

Aug 17 2010, 3:54 am TheFreak Post #8



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:
this.JPG
Hits: 1 Size: 31.61kb



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:43 am]
Symmetry -- I'm doing my best, damn it
[2026-9-28. : 4:46 pm]
Ultraviolet -- @:@
@:@ shouted: this community still going strong?
Still going.. strong is debatable though.
[2026-9-28. : 4:13 pm]
WeirdoX4857 -- I can't believe this is really been around since 2003 but it does look classic and old asf still better than talking to kids on discord ranting about skibidi toilet and sexuality or whatever mental illness is going on in their heads
[2026-9-28. : 4:11 pm]
WeirdoX4857 -- Nigga how you ask is it still going strong when you get a text every 3 miles per hour or something
[2026-9-28. : 4:10 pm]
WeirdoX4857 -- Where is everybody
[2026-9-28. : 1:21 pm]
@:@ -- this community still going strong?
[2026-9-27. : 4:30 pm]
Oh_Man -- yeah, probs
[2026-9-27. : 3:11 pm]
NudeRaider -- I bet it just needs another training session against pros instead of only against itself and nobody will be able to stop it anymore.
[2026-9-27. : 3:09 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
so it can be beaten by a prepared pro, even in macro games, if only barely. the muta micro in particular seems really hard to handle for protoss ground though. In the open goons can't catch them, in the base they trip over buildings, it just instantly flies out of storms and they fly circles around archons. Mass cannons do work, but can't cover the whole map with it. Probably need mass corsair to counter and hope you can outmaneuver all the scourge.
[2026-9-27. : 2:14 am]
Oh_Man -- pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
Please log in to shout.


Members Online: O)FaRTy1billion[MM]