• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Problem with a trigger

Status
Not open for further replies.
Hello guys,

This is the scenario of how the trigger should work; When the three wendigos are dead move to actions.

Yet the problem here, the Ancient wendigo has reincarnation. If the Ancient Wendigo dies and the two other wendigos die just after him and before he comes back to life from reincarnation's delay, the trigger moves to actions.
How can i fix that?

This is the trigger:
  • Events
    • Unit - Ancient Wendigo 0060 <gen> Dies
    • Unit - Wendigo 0062 <gen> Dies
    • Unit - Wendigo Shaman 0061 <gen> Dies
  • Conditions
    • GameOver Equal to False
    • (Wendigo 0062 <gen> is dead) Equal to True
    • (Wendigo Shaman 0061 <gen> is dead) Equal to True
    • (Ancient Wendigo 0060 <gen> is dead) Equal to True
  • Actions
    • Trigger - Turn off (This trigger)
    • ..............
Thank you.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Don't use "is unit dead" it only compares the unit's hp.
The native UnitAlive or checking for unit type UNIT_TYPE_DEAD should work just fine. Neither of those are GUI though.

The trigger runs whenever a wendigo dies. Increase a variable WendigosKilled and if it is 3, execute the actions you want.

  • Untitled Trigger 001
    • Events
      • Unit - Wendigo1 <gen> Dies
      • Unit - Wendigo2 <gen> Dies
      • Unit - Wendigo3 <gen> Dies
    • Conditions
      • GameOver Equal to False
    • Actions
      • Set WendigosKilled = (WendigosKilled + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WendigosKilled Equal to 3
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- ... --------
        • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Fwiw that allows you to get the trigger to run by killing the ancient, letting it revive, and waiting for its reincarnation to cool down before killing it again and repeating. Do that 3 times total and it will have increased WendigosKilled to 3 even though all of them are alive.
 
Last edited:
Don't use "is unit dead" it only compares the unit's hp.
The native UnitAlive or checking for unit type UNIT_TYPE_DEAD should work just fine. Neither of those are GUI though.

The trigger runs whenever a wendigo dies. Increase a variable WendigosKilled and if it is 3, execute the actions you want.

  • Untitled Trigger 001
    • Events
      • Unit - Wendigo1 <gen> Dies
      • Unit - Wendigo2 <gen> Dies
      • Unit - Wendigo3 <gen> Dies
    • Conditions
      • GameOver Equal to False
    • Actions
      • Set WendigosKilled = (WendigosKilled + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WendigosKilled Equal to 3
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- ... --------
        • Else - Actions
lol i actually thought of this trigger but i was too lazy to create it. :p
Thank you Jampion, it worked. :thumbs_up:
 
Status
Not open for further replies.
Top