HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Within Range

05-17-2006, 07:29 AM#1
StockBreak
Hi all, is there an event which is the opposite of this one? I mean, I can detect if a unit comes within xxx range of a SPECIFIC unit, but i cannot detect if a unit leaves the xxx range. I cannot use "Unit Leaves Region" (region centered at position of a specific unit with size xxx and zzz), because I tried it and if the specific unit moves the region will be still centered at the same point... Some ideas? Thanks.
05-17-2006, 07:32 AM#2
Tim.
Run a loop, when unit is in within range turn a boolean to true, else false.
05-17-2006, 07:46 AM#3
StockBreak
Quote:
Originally Posted by Tim.
Run a loop, when unit is in within range turn a boolean to true, else false.
Sorry I didn't understand, can you be more specific? I want to detect units within range but also units that are no more within range of that specific unit. Thanks.
05-17-2006, 08:44 AM#4
Tim.
Every .10 seconds, if a unit is within X of YourUnit, then set boolean InRange equal to True, else set boolean InRange equal to False.
05-17-2006, 08:54 AM#5
StockBreak
Yes, I used periodic events too. So that is the only solution... Thanks anyway.