HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting a unit with Aloc!

01-17-2004, 04:04 PM#1
Pesmerga
Ok, ok, I know I'm kinda of basing all my questions around Aloc and such, but this is the last one I would need. How do I detect a unit with the ability aloc? Because when I want to detect a unit within 60 of (last created unit), it doesn't detect the units with Aloc on them. This creates further complications, but being able to detect units with Aloc on them would make my life alot easier.

edit - if you didn't know, aloc is the code for Locust.
01-17-2004, 05:05 PM#2
Darimus
I thought i saw somewhere that if you remove aloc (hide unit and remove it or something to do with that, you should search) then you could find it I think... and also, after it is found with your trigger, it could readd Locust so it still can't be killed/selected
01-17-2004, 05:08 PM#3
Pesmerga
Hmm, so if I put the unit (before aloc has been added) in a unit group var, then the unit will still be in that unit group?
01-17-2004, 05:14 PM#4
35263526
Yep, giving or removing abilities doesn't change a unit's signiture (the thing that keeps it in a unit group).
01-17-2004, 05:57 PM#5
Sage the Mage
Integer Comparison - Level of Ability Locust for Unit not equal to 0.

Level of Ability for Unit works kinda as a boolean - 0 means the unit does not have the ability, and anything else means they have it.
01-17-2004, 07:46 PM#6
Grater
For most intents and purposes a Aloc'd unit is removed from the map, other units don't need to know where it is because they cant interact with it, as such you cannot get it with "Units in range/region" events.

Basically you need to do it backwards kinda, use "Units owned by player matching condition"
or
"Units of type matching condition"

Then for the condition you want:
Distance between (matching unit) and (last created unit) less than or equal to 60.

If you have lots of different types of Aloc'd units beloning to different players then another way is to add every aloc'd unit to a unit group variable then do:
Pick every unit in AlocGroup and do (Actions)
if (distance between (picked unit) and (last created unit) less than or equal to 60 then
....
01-17-2004, 07:50 PM#7
Pesmerga
eh well, yah, i guess that would work . . . but my sweet sweet friend Darimus has just showed me the light. thanks anyways . . . cough . . .