Sajberhippie
New Member
- Reaction score
- 30
Units with the Locust ability can't be selected, is ignored by the AI, does not affect pathing, and isn't detected by certain things when triggering, including "Every unit in Region/Range". This is how I've understood locusts, but please correct me if I'm wrong in any way.
This last effect is causing real problems for me. I want to create locust creatures "attached" to a buildning, that are created when the building is erected and removed when the buildning dies. The units in question are attack-units, so the building has several attacks, each with a long cooldown and each from a different position.
Now, I've been using this trigger to remove them:
(Note: There's actually several more cases where this is a problem, so the building-with-archers problem is just an example).
Now, I have a problem. If the crossbowmen has Locust, this trigger won't work, since it can't pick the crossbowmen. If they don't, then the player can select them, and enemies will auto-attack them. The second problem can be solved through making them invulnerable, but how to solve the selection problem?
Thankful for any help, and of course +rep!
This last effect is causing real problems for me. I want to create locust creatures "attached" to a buildning, that are created when the building is erected and removed when the buildning dies. The units in question are attack-units, so the building has several attacks, each with a long cooldown and each from a different position.
Now, I've been using this trigger to remove them:
Trigger:
- Building Destroyed
- Events
- Unit - A unit Dies
- Conditions
- Unit-Type Comparision - Unit type is equal to My Unit
- Actions
- Set TempPoint = (Position of (Triggering unit))
- Set TempGroup = (Units within 200.00 of TempPoint)
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Picked unit)) Equal to Crossbowman
- Then - Actions
- Unit - Remove (Picked unit) from the game
- Else - Actions
- If - Conditions
- Custom script: call DestroyGroup (udg_TempGroup)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Events
(Note: There's actually several more cases where this is a problem, so the building-with-archers problem is just an example).
Now, I have a problem. If the crossbowmen has Locust, this trigger won't work, since it can't pick the crossbowmen. If they don't, then the player can select them, and enemies will auto-attack them. The second problem can be solved through making them invulnerable, but how to solve the selection problem?
Thankful for any help, and of course +rep!