• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unselectable footmen and their behaviour.

Status
Not open for further replies.
Level 1
Joined
May 30, 2013
Messages
1
I'm attempting to make a sort of DotA clone, and want the footmen in one team to use defend once they hit 1/3hp or less, dropping it again once they hit 4/5hp or more.
No matter what I try, it can't be done. Does anyone else know what to do here?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
First off, defend is toggleable ability - so what do you want to do? If he uses Defend at 33% health, then defend will be still active even when he reaches 20% health.

If that Footman has Locust ability, you cannot pick him up via Pick every unit in region/range; you can try to "pick every unit owned by player matching condition" as that may work.
Or you should make a trigger
  • Untitled Trigger 002
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Unit Group - Add (Triggering unit) to YourGroup
This picks all footman once they are created and adds them to YourGroup. Then you can just pick every unit in YourGroup and order actions you want.

or you can do this:
  • Untitled Trigger 002
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Trigger - Add to Active Defend <gen> the event (Unit - (Triggering unit)'s life becomes Less than or equal to (0.33 x (Max life of (Triggering unit))))
and
  • Activate Defend
    • Events
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Human Footman - Defend
The first trigger will make that new footman trigger the second trigger - so whenever his life becomes 33% of his max health, he will activate defend.
 
Status
Not open for further replies.
Top