• 🏆 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!

[Trigger] What's wrong with my trigger?

Status
Not open for further replies.
Level 8
Joined
Jul 18, 2010
Messages
332
hero dungeon failed
Events
Unit - A unit Dies
Conditions
((Dying unit) is in team1units) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(All units of team1units are dead) Equal to True
Then - Actions
Quest - Display to (All players) the Quest Failed message: Hero Dungeon Failed...
Wait 2.00 seconds
Unit Group - Pick every unit in team1units and do (Actions)
Loop - Actions
Hero - Instantly revive (Picked unit) at Region8, Show revival graphics
Trigger - Turn on reviving heroes <gen>
Player Group - Pick every player in team2 and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) controller) Equal to User
Then - Actions
Quest - Display to (All players) the Warning message: Next up, Furnace of...
Trigger - Turn off reviving heroes <gen>
Trigger - Turn on furnace of hell <gen>
Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
Set team2units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
Unit Group - Pick every unit in team2units and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of Region 011 <gen>)
Set team2player = (Picked unit)
Item - Create Ankh of Reincarnation at (Position of (Picked unit))
Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
Trigger - Turn on furnace of hell <gen>
Player Group - Pick every player in team1 and do (Actions)
Loop - Actions
Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
Set team1units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
Unit Group - Pick every unit in team1units and do (Actions)
Loop - Actions
Unit - Pause (Picked unit)
Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) controller) Not equal to User
Then - Actions
Unit - Unpause all units
Set herodungeonboss = boss
Player Group - Pick every player in team1 and do (Actions)
Loop - Actions
Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
Player Group - Pick every player in team2 and do (Actions)
Loop - Actions
Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
Else - Actions
Else - Actions

It doesn't trigger when all of the units in the team1units die. All of the units in team1units are heroes.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • hero dungeon failed
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in team1units) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (All units of team1units are dead) Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Quest Failed message: Hero Dungeon Failed...
          • Wait 2.00 seconds
          • Unit Group - Pick every unit in team1units and do (Actions)
            • Loop - Actions
              • Hero - Instantly revive (Picked unit) at Region8, Show revival graphics
          • Trigger - Turn on reviving heroes <gen>
          • Player Group - Pick every player in team2 and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Equal to User
                • Then - Actions
                  • Quest - Display to (All players) the Warning message: Next up, Furnace of...
                  • Trigger - Turn off reviving heroes <gen>
                  • Trigger - Turn on furnace of hell <gen>
                  • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                  • Set team2units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
                  • Unit Group - Pick every unit in team2units and do (Actions)
                    • Loop - Actions
                      • Unit - Move (Picked unit) instantly to (Center of Region 011 <gen>)
                      • Set team2player = (Picked unit)
                      • Item - Create Ankh of Reincarnation at (Position of (Picked unit))
                  • Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
                  • Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
                  • Trigger - Turn on furnace of hell <gen>
                  • Player Group - Pick every player in team1 and do (Actions)
                    • Loop - Actions
                      • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                      • Set team1units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
                      • Unit Group - Pick every unit in team1units and do (Actions)
                        • Loop - Actions
                          • Unit - Pause (Picked unit)
                      • Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
                      • Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Not equal to User
                • Then - Actions
                  • Unit - Unpause all units
                  • Set herodungeonboss = boss
                  • Player Group - Pick every player in team1 and do (Actions)
                    • Loop - Actions
                      • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                  • Player Group - Pick every player in team2 and do (Actions)
                    • Loop - Actions
                      • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                • Else - Actions
        • Else - Actions
It doesn't trigger when all of the units in the team1units die. All of the units in team1units are heroes.
Put "[trigger]" in front of and "[/trigger]" at the end of the trigger.


It doesn't matter whether they're heroes or not: the condition should work (although I don't like that condition, but okay...).
Add this to the "Else - actions":

  • Unit Group - Pick every unit in team1units and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Picked unit)) Greater than 0.00
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Picked unit)) + is still alive)
        • Else - Actions
It's called "debugging a trigger", you should do it more often :D
Everything can go wrong in triggers, the thing is that you can easily search WHERE it went wrong.
Then you don't need to stare at the trigger mindlessly, but can take appropriate actions.

I advice you to use a lot of game messages to check every part of the trigger and usually it only takes a few moments before you found where the problem is.
All that's left then is to actually solve it (and if you cannot, then you can post it here ^^).
 
Level 13
Joined
Sep 13, 2010
Messages
550
First renovating:

  • hero dungeon failed
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in team1units) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (All units of team1units are dead) Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Quest Failed message: Hero Dungeon Failed...
          • Wait 2.00 seconds
          • Unit Group - Pick every unit in team1units and do (Actions)
            • Loop - Actions
              • Hero - Instantly revive (Picked unit) at Region8, Show revival graphics
          • Trigger - Turn on reviving heroes <gen>
          • Player Group - Pick every player in team2 and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Equal to User
                • Then - Actions
                  • Quest - Display to (All players) the Warning message: Next up, Furnace of...
                  • Trigger - Turn off reviving heroes <gen>
                  • Trigger - Turn on furnace of hell <gen>
                  • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                  • Set team2units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
                  • Unit Group - Pick every unit in team2units and do (Actions)
                    • Loop - Actions
                      • Unit - Move (Picked unit) instantly to (Center of Region 011 <gen>)
                      • Set team2player = (Picked unit)
                      • Item - Create Ankh of Reincarnation at (Position of (Picked unit))
                      • Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
                      • Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
                  • Trigger - Turn on furnace of hell <gen>
                  • Player Group - Pick every player in team1 and do (Actions)
                    • Loop - Actions
                      • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                      • Set team1units = (Units owned by (Picked player) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))
                  • Unit Group - Pick every unit in team1units and do (Actions)
                    • Loop - Actions
                      • Unit - Pause (Picked unit)
                        • Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.25 seconds
                        • Camera - Set the camera bounds for (Picked player) to Region 023 <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked player) controller) Not equal to User
                    • Then - Actions
                      • Unit - Unpause all units
                      • Set herodungeonboss = boss
                      • Player Group - Pick every player in team1 and do (Actions)
                        • Loop - Actions
                          • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                      • Player Group - Pick every player in team2 and do (Actions)
                        • Loop - Actions
                          • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                    • Else - Actions
        • Else - Actions
Second: What needs to happen exactly
Third: You may paste your other triggers or post your map
Fourth: use "[TRIGGER.]INSERT YOUR CODE HERE[/TRIGGER]" -->
folder.gif
with "Copy as text" function from WE
At least: Use Prewiev Post button.

Recommend to debug your triggers with
  • Game - Display to (All players) the text: Working
to see if something not works correctly.

EDIT: Ahh ap0calypse was faster ;)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Oh yes, about that condition, it's useless:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked player) controller) Equal to User
      • Then - Actions
        • //Actions 1
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked player) controller) Not equal to User
      • Then - Actions
        • //Actions 2
      • Else - Actions
Is the same as:

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked player) controller) Equal to User
      • Then - Actions
        • //Actions 1
      • Else - Actions
        • //Actions 2
Could you just attach the map to your post? Or explain the problem a bit better, that could help as well (what does the trigger do and what doesn't it do? What's it supposed to do? etc).
 
Status
Not open for further replies.
Top