[Trigger] Combat Trigger

Status
Not open for further replies.
Level 12
Joined
Jul 5, 2014
Messages
556
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.
 
Yes, dead units do count when you perform unit group checks. Instead you can use a boolean like this

1719430633453.png
 
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.
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top