HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

seeing if a unit is surrounded

01-02-2006, 04:13 PM#1
GosuSheep
how can i check if a unit is completely surrounded by other units or structures?

replies are greatly appreciated
01-02-2006, 05:09 PM#2
Vexorian
Count the units that are in X range of the position of the unit
01-02-2006, 05:36 PM#3
iNfraNe
that wouldnt be exactly count as surrounded... but itll come close enough.

I dont know if a unit stops his orders when he's surrounded by units, but when he cant get somewhere he will stop his order after some time.
01-02-2006, 05:40 PM#4
[niro]
I've needed this once before, i needed to have a computer player shockwave and or stomp, I used X units in the region as my trigger, and it works pretty well.
01-02-2006, 05:48 PM#5
Starcraftfreak
Quote:
Originally Posted by Vexorian
Count the units that are in X range of the position of the unit
Maybe counting ground units only will give better results.
01-02-2006, 05:51 PM#6
Vexorian
But what region? If you keep moving the region then counting the units in range would be the same but more efficient
01-02-2006, 05:53 PM#7
[niro]
Yeah, constantly keeping the region on the unit, and having it count the units in the region is the most effiecient I believe.
01-02-2006, 06:15 PM#8
Starcraftfreak
Vexorian is right. Moving the region around all the time and getting the units afterwards is slower than just getting units in range. Additionally a rect is squarish, while units in range will get units in a circular area.