[Solved] What's wrong with this trigger?

Archian

Site Director
Level 50
Joined
Jan 1, 2006
Messages
2,510
Yeah, as the title says. What's wrong with this trigger? It doesn't work the way I intend. Nothing happens when all the units die.

Am I forgetting something here?

Thanks in advance!

  • MQ1 Skeletons Dies
    • Events
      • Unit - Returned Champion 0085 <gen> Dies
      • Unit - Fallen Warrior 0086 <gen> Dies
      • Unit - Fallen Warrior 0087 <gen> Dies
      • Unit - Skeleton Archer 0088 <gen> Dies
      • Unit - Skeleton Archer 0089 <gen> Dies
      • Unit - Skeleton Warrior 0090 <gen> Dies
      • Unit - Skeleton Warrior 0091 <gen> Dies
      • Unit - Skeleton Warrior 0092 <gen> Dies
      • Unit - Skeleton Warrior 0093 <gen> Dies
      • Unit - Skeleton Warrior 0094 <gen> Dies
      • Unit - Skeleton Warrior 0095 <gen> Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Returned Champion 0085 <gen> is Dead) Equal to (==) True
          • (Fallen Warrior 0086 <gen> is Dead) Equal to (==) True
          • (Fallen Warrior 0087 <gen> is Dead) Equal to (==) True
          • (Skeleton Archer 0088 <gen> is Dead) Equal to (==) True
          • (Skeleton Archer 0089 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0090 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0091 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0092 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0093 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0094 <gen> is Dead) Equal to (==) True
          • (Skeleton Warrior 0095 <gen> is Dead) Equal to (==) True
        • Then - Actions
          • Quest - Mark MQ1UndeadDies as Completed
          • Quest - Mark (Last created quest requirement) as Completed
          • Quest - Display to (All players) the Quest Update message: QUEST UPDATE - Retu...
          • Destructible - Open Iron Gate (Custom) 4969 <gen>
          • Destructible - Kill Pathing Blocker (Ground) (Large) 4979 <gen>
          • Destructible - Kill Pathing Blocker (Ground) (Large) 4978 <gen>
        • Else - Actions
 
Last edited:
From theory all looks good and I assume you to have correct units as reference etc.
But what might be a problem is that you use multiple specific unit references globaly.

When you kill a unit you can refer to it onEvent.
When you kill a unit and it gets removed (later) you lose reference to it.

So scenario:

Unit_1 gets killed
... (5 minutes later)
Unit_2 gets killed

Now you check if Unit_1 is alive or dead, but the unit does not exist anymore and you can't refer to it anymore like this.

Solutions:
1.You can add the units to a group at start, and always remove dying unit from that group.
If the group is empty you do your actions.
2. You make a simple integer counter +1 when a unit dies. When counter gets 11 you make actions.
 
Level 37
Joined
Jul 22, 2015
Messages
3,489
I'm going to second on IcemanBo's suggestion. However, I've never used UMSWE before, so I don't know what kind of extra stuff you have going on in there (;

Solutions:
1.You can add the units to a group at start, and always remove dying unit from that group.
If the group is empty you do your actions.
2. You make a simple integer counter +1 when a unit dies. When counter gets 11 you make actions.
 
Level 10
Joined
Apr 4, 2010
Messages
509
EDIT: oh IcemanBo already said it.

I'd do it like this.
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in (Quest_1 group) Equal to True
    • Actions
      • Unit Group - Remove (Dying unit) from (Quest_1 group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Quest_1 group) is empty) Equal to True
        • Then - Actions
          • -------- Do Actions --------
        • Else - Actions
 
Top