• 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.

[Trigger] Execute low health units ability with a health check

Level 9
Joined
Mar 7, 2019
Messages
111
1749093441385.png

It's probably something stupid, but i can't seem to figure out why it's not working, and instead only glory kills critters and not 20% or less hp units.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,930
You aren't checking for Life percentage, you're checking for a flat value. Critters usually have 15.00 or less Life so they will always get executed.

The trigger should look like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Glory Kill
    • (Percentage life of (Target unit of ability being cast)) Less than or equal to 20.00
  • Actions
    • Set Variable GK_Target = (Target unit of ability being cast)
    • Set Variable Temp_point = (Position of GK_Target)
    • Special Effect - Create a special effect at Temp_point using Objects\Spawnmodels\Undead\...
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect at Temp_point using CorpseExplode...
    • Special Effect - Destroy (Last created special effect)
    • Unit - Create 1 Dummy at Temp_point...
    • Custom script: call RemoveLocation( udg_Temp_point )
    • Unit - Add Glory Kill Heal to (Last created unit)
    • Unit - Add 3.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Healing Wave (Triggering unit)
    • Unit - Kill GK_Target
I got rid of an unnecessary setting of Temp_point, it was being set twice at the same position. I added a Unit variable to safely track the target unit. I also made sure that (Unit - Kill) is the very last action to occur since it will cause "A unit Dies" Events to run, potentially overwriting variables like Temp_point and certain Event Responses. Everything is organized in a way to avoid conflicts with other triggers.

Please try to post your trigger in the future, it allows everyone to easily read, copy, and edit it, etc.
 
Last edited:
Level 9
Joined
Mar 7, 2019
Messages
111
You aren't checking for Life percentage, you're checking for a flat value. Critters usually have 15.00 or less Life so they will always get executed.

The trigger should look like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Glory Kill
    • (Percentage life of (Target unit of ability being cast)) Less than or equal to 20.00
  • Actions
    • Set Variable GK_Target = (Target unit of ability being cast)
    • Set Variable Temp_point = (Position of GK_Target)
    • Special Effect - Create a special effect at Temp_point using Objects\Spawnmodels\Undead\...
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect at Temp_point using CorpseExplode...
    • Special Effect - Destroy (Last created special effect)
    • Unit - Create 1 Dummy at Temp_point...
    • Custom script: call RemoveLocation( udg_Temp_point )
    • Unit - Add Glory Kill Heal to (Last created unit)
    • Unit - Add 3.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Healing Wave (Triggering unit)
    • Unit - Kill GK_Target
I got rid of an unnecessary setting of Temp_point, it was being set twice at the same position. I added a Unit variable to safely track to the target unit. I also made sure that (Unit - Kill) is the very last action to occur since it will cause "A unit Dies" Events to run, potentially overwriting variables like Temp_point and certain Event Responses. Everything is organized in a way to avoid conflicts with other triggers.

Please try to post your trigger in the future, it allows everyone to easily copy it and show you what's wrong:
Ohhh, i didn't notice that there's a percentage life check.
But hey, thank you, it works! Solved!
 
Last edited:
Top