• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger Help Needed Please!

Status
Not open for further replies.
Level 2
Joined
May 19, 2008
Messages
18
I need a trigger that should activate when a unit has bellow 30% Health.
I don't need that trigger to do something right now, I just need it to work when a specific unit has bellow 30% health.
Please help.
Thank You.
 
  • Initial Register
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to HP Event <gen> the event (Unit - (Picked unit)'s life becomes Less than or equal to ((30.00 / 100.00) x (Max life of (Picked unit))))
  • Ingame Register
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to HP Event <gen> the event (Unit - (Triggering unit)'s life becomes Less than or equal to ((30.00 / 100.00) x (Max life of (Triggering unit))))
  • HP Event
    • Events
    • Conditions
    • Actions
      • -------- Use (Triggering unit) to refer to the unit --------
      • Unit - Kill (Triggering unit)
If you can give me the scope of the unit that is going to be affected by this system, it'll be more efficient.
Right now, I'm registering all units in the map.

Here's a test map.
 

Attachments

this trigger is needed for a specific hero, that an ally can have or an enemy, that over time will have a greater health. also the periodical check (0.50 ~ 1.00), with this frequency, it will be good.
 
If it is only needed for one or a few units, you can use this action:
  • Trigger - Add to trig the event (Unit - unit Takes damage)

It is a Unit - Specific unit event. Then in the actions of that trigger, check the percentage life.

Note that the damage isn't deal yet when a unit takes damage event triggers.

Therefore, you need to check if life-damage taken causes the unit to drop below 20% hp.
 
Status
Not open for further replies.
Back
Top