• 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] Combat Trigger

Level 12
Joined
Jul 5, 2014
Messages
551
There's a problematic trigger between two fighting groups. The intention is that when all of a certain player's units are dead in the area, the winners move on to a different area. This is the trigger.

  • War
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Warzone <gen> owned by Player 11 (Dark Green))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in Fighters and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of Target <gen>)
        • Else - Actions
For some reason, the trigger doesn't work. Does the condition counts dead units as still being present? That's my only guess for the issue.
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
Yes, dead units do count when you perform unit group checks. Instead you can use a boolean like this

1719430633453.png
 
Level 12
Joined
Jul 5, 2014
Messages
551
Yes, dead units do count when you perform unit group checks. Instead you can use a boolean like this

View attachment 476884
Thanks, that did the trick. On a side note, I'm guessing the goblin tinker head turning issue remains a mystery? It's not particularly important for the game but it's just annoying that I don't know what's the problem.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
For some reason, the trigger doesn't work. Does the condition counts dead units as still being present? That's my only guess for the issue.
It's instructive to show how you could have checked this yourself, since you had an inkling what it might be. You can print information about the unit using the Game - Display Message (explicitly timed) action:
  • Loop - Actions
    • Game - Display to (All Players) for 9999 seconds the text: (Name of (Picked Unit))
    • Game - Display to (All Players) for 9999 seconds the text: (String((Picked Unit) current health))
    • //etc.
 
Level 12
Joined
Jul 5, 2014
Messages
551
It's instructive to show how you could have checked this yourself, since you had an inkling what it might be. You can print information about the unit using the Game - Display Message (explicitly timed) action:
  • Loop - Actions
    • Game - Display to (All Players) for 9999 seconds the text: (Name of (Picked Unit))
    • Game - Display to (All Players) for 9999 seconds the text: (String((Picked Unit) current health))
    • //etc.
I'll try it out when I next have a persistently disobedient trigger. It may help highlighting what to look for.
 
Top