• 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.

Plz Help With My Victory Trigger / Adding Players to Groups

Status
Not open for further replies.
Level 20
Joined
Mar 16, 2008
Messages
812
Uncle helped me with this trigger but I changed some things on it, now it seems to not be working consistently. I just played a game and l lost as red player 1, I never got the final defeat button to leave the game. I think player 1 red (me) was not added to losing group?

It did seem to mark all the players correctly as winners/losers. So I'm kinda confused why player 1 red didn't get defeat pop up??? https://wc3stats.com/games/209166/mmd

Any insight would be appreciated. Thanks.

  • Log Metadata Uncle
    • Events
      • Time - MMD_Timer expires
    • Conditions
    • Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Add Players to Winning Group if King's (team leader) Main Building is Alive --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MMD_PN Equal to 0
        • Then - Actions
          • Cinematic - Send transmission to Losing_Group_Var from a Neutral Passive.Orb Forger named |cffff0000GAME OVER... at (Center of (Playable map area)): Play No sound and display Please wait while m.... Modify duration: Add 38.00 seconds and Wait
          • Cinematic - Send transmission to Winning_Group_Var from a Neutral Passive.Orb Forger named |cff00ff00VICTORY|r at (Center of (Playable map area)): Play No sound and display Please wait while m.... Modify duration: Add 38.00 seconds and Wait
          • -------- [CODE]~~~~~~~ --------
          • -------- Team Red --------
          • -------- ~~~~~~~[/CODE] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0012 <gen> is alive) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group1Red and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0012 <gen> is dead) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group1Red and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
            • Else - Actions
          • -------- [CODE]~~~~~~~ --------
          • -------- Team Blue --------
          • -------- ~~~~~~~[/CODE] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0025 <gen> is alive) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group2Blue and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0025 <gen> is dead) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group2Blue and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
            • Else - Actions
          • -------- [CODE]~~~~~~~ --------
          • -------- Team Teal --------
          • -------- ~~~~~~~[/CODE] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0038 <gen> is alive) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group3Teal and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0038 <gen> is dead) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group2Blue and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
            • Else - Actions
          • -------- [CODE]~~~~~~~ --------
          • -------- Team Purple --------
          • -------- ~~~~~~~[/CODE] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0051 <gen> is alive) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group4Purp and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (King's Castle 0051 <gen> is dead) Equal to True
            • Then - Actions
              • Player Group - Pick every player in Group4Purp and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
            • Else - Actions
          • -------- [CODE]~~~~~~~ --------
          • -------- Team Black and No Team --------
          • -------- ~~~~~~~[/CODE] --------
          • -------- If 4 kings are defeated then black team wins --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DefeatCounter Equal to 4
            • Then - Actions
              • Player Group - Pick every player in Black_Group_Var and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
              • Player Group - Pick every player in Group6_DiedasBlk and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Winning_Group_Var
                  • Player Group - Remove (Picked player) from Losing_Group_Var.
            • Else - Actions
          • -------- If 3 kings are defeated then 1 king remains and black team has been defeated --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DefeatCounter Equal to 3
            • Then - Actions
              • Player Group - Pick every player in Black_Group_Var and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
              • Player Group - Pick every player in Group6_DiedasBlk and do (Actions)
                • Loop - Actions
                  • Player Group - Add (Picked player) to Losing_Group_Var
                  • Player Group - Remove (Picked player) from Winning_Group_Var.
            • Else - Actions
          • -------- Players with no team or AFK players --------
          • Player Group - Pick every player in Group5_NoGroup and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • Wait 1.00 seconds
      • -------- [CODE]~~~~~~~ --------
      • -------- Log Data --------
      • -------- ~~~~~~~[/CODE] --------
      • Set VariableSet MMD_PN = (MMD_PN + 1)
      • Set VariableSet MMD_Player = (Player(MMD_PN))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MMD_Player controller) Not equal to Computer
          • Or - Any (Conditions) are true
            • Conditions
              • (MMD_Player slot status) Equal to Is playing
              • (MMD_Player slot status) Equal to Has left the game
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MMD_Player is in Winning_Group_Var.) Equal to True
            • Then - Actions
              • -------- Winner: --------
              • Custom script: call MMD_UpdateValueString("mode", udg_MMD_Player, udg_MMD_String[udg_MMD_PN])
              • Wait 0.10 seconds
              • Custom script: call MMD_FlagPlayer (udg_MMD_Player, MMD_FLAG_WINNER)
              • Wait 0.10 seconds
            • Else - Actions
              • -------- Loser: --------
              • Custom script: call MMD_UpdateValueString("mode", udg_MMD_Player, udg_MMD_String[udg_MMD_PN])
              • Wait 0.10 seconds
              • Custom script: call MMD_FlagPlayer (udg_MMD_Player, MMD_FLAG_LOSER)
              • Wait 0.10 seconds
        • Else - Actions
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MMD_PN Equal to 12
        • Then - Actions
          • -------- Skip players 13, 14, 15, and 16: --------
          • Set VariableSet MMD_PN = 16
          • Trigger - Run Log Metadata Uncle <gen> (ignoring conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MMD_PN Equal to 20
            • Then - Actions
              • -------- All players have been logged, finish: --------
              • Player Group - Pick every player in Winning_Group_Var and do (Actions)
                • Loop - Actions
                  • -------- Victory --------
                  • Game - Victory (Picked player) (Show dialogs, Show scores)
              • Player Group - Pick every player in Losing_Group_Var and do (Actions)
                • Loop - Actions
                  • -------- Defeat --------
                  • Game - Defeat (Picked player) with the message: |cffff0000GAME OVER...
              • Cinematic - Send transmission to Losing_Group_Var from a Neutral Passive.Orb Forger named |cffff0000GAME OVER... at (Center of (Playable map area)): Play No sound and display |cff00ff00Metadata .... Modify duration: Add 38.00 seconds and Wait
              • Cinematic - Send transmission to Winning_Group_Var from a Neutral Passive.Orb Forger named |cff00ff00VICTORY|r at (Center of (Playable map area)): Play No sound and display |cff00ff00Metadata .... Modify duration: Add 38.00 seconds and Wait
            • Else - Actions
              • -------- Run for the next player: --------
              • Trigger - Run Log Metadata Uncle <gen> (ignoring conditions)
 
Last edited:
Level 20
Joined
Mar 16, 2008
Messages
812
I think this trigger below was working well. One game it didn't parse the players but I think that was related to other triggers that killed the castles. This trigger really counts victory depending on what castles are alive.

What I wanted to change was 1) it wasn't showing the final 'Cinematic - Send transmissions' and 2) players suggested that if black team wins then all black team players should be counted as winners even if there were eliminated before the final victory.

  • Log Metadata Uncle
    • Events
      • Time - MMD_Timer expires
    • Conditions
    • Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Team Red --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0012 <gen> is alive) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group1Red and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Winning_Group_Var
              • Player Group - Remove (Picked player) from Losing_Group_Var.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0012 <gen> is dead) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group1Red and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Team Blue --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0025 <gen> is alive) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group2Blue and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Winning_Group_Var
              • Player Group - Remove (Picked player) from Losing_Group_Var.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0025 <gen> is dead) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group2Blue and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Team Teal --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0038 <gen> is alive) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group3Teal and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Winning_Group_Var
              • Player Group - Remove (Picked player) from Losing_Group_Var.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0038 <gen> is dead) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group2Blue and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Team Purple --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0051 <gen> is alive) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group4Purp and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Winning_Group_Var
              • Player Group - Remove (Picked player) from Losing_Group_Var.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (King's Castle 0051 <gen> is dead) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Group4Purp and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • -------- [CODE]~~~~~~~ --------
      • -------- Team Black and No Team --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DefeatCounter Equal to 4
        • Then - Actions
          • Player Group - Pick every player in Black_Group_Var and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Winning_Group_Var
              • Player Group - Remove (Picked player) from Losing_Group_Var.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DefeatCounter Equal to 3
        • Then - Actions
          • Player Group - Pick every player in Black_Group_Var and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to Losing_Group_Var
              • Player Group - Remove (Picked player) from Winning_Group_Var.
        • Else - Actions
      • Player Group - Pick every player in Group5_NoGroup and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to Losing_Group_Var
          • Player Group - Remove (Picked player) from Winning_Group_Var.
      • -------- [CODE]~~~~~~~ --------
      • -------- Log Data --------
      • -------- ~~~~~~~[/CODE] --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MMD_PN Equal to 0
        • Then - Actions
          • Cinematic - Send transmission to Losing_Group_Var from a Neutral Passive.Orb Forger named |cffff0000GAME OVER... at (Center of (Playable map area)): Play No sound and display Please wait while m.... Modify duration: Add 38.00 seconds and Wait
          • Cinematic - Send transmission to Winning_Group_Var from a Neutral Passive.Orb Forger named |cff00ff00VICTORY|r at (Center of (Playable map area)): Play No sound and display Please wait while m.... Modify duration: Add 38.00 seconds and Wait
        • Else - Actions
      • Set VariableSet MMD_PN = (MMD_PN + 1)
      • Set VariableSet MMD_Player = (Player(MMD_PN))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MMD_Player controller) Not equal to Computer
          • Or - Any (Conditions) are true
            • Conditions
              • (MMD_Player slot status) Equal to Is playing
              • (MMD_Player slot status) Equal to Has left the game
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MMD_Player is in Winning_Group_Var.) Equal to True
            • Then - Actions
              • -------- Winner: --------
              • Custom script: call MMD_UpdateValueString("mode", udg_MMD_Player, udg_MMD_String[udg_MMD_PN])
              • Wait 0.10 seconds
              • Custom script: call MMD_FlagPlayer (udg_MMD_Player, MMD_FLAG_WINNER)
              • Wait 0.10 seconds
            • Else - Actions
              • -------- Loser: --------
              • Custom script: call MMD_UpdateValueString("mode", udg_MMD_Player, udg_MMD_String[udg_MMD_PN])
              • Wait 0.10 seconds
              • Custom script: call MMD_FlagPlayer (udg_MMD_Player, MMD_FLAG_LOSER)
              • Wait 0.10 seconds
        • Else - Actions
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MMD_PN Equal to 12
        • Then - Actions
          • -------- Skip players 13, 14, 15, and 16: --------
          • Set VariableSet MMD_PN = 16
          • Trigger - Run Log Metadata Uncle <gen> (ignoring conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MMD_PN Equal to 20
            • Then - Actions
              • -------- All players have been logged, finish: --------
              • Player Group - Pick every player in Winning_Group_Var and do (Actions)
                • Loop - Actions
                  • -------- Victory --------
                  • Game - Victory (Picked player) (Show dialogs, Show scores)
              • Player Group - Pick every player in Losing_Group_Var and do (Actions)
                • Loop - Actions
                  • -------- Defeat --------
                  • Game - Defeat (Picked player) with the message: |cffff0000GAME OVER...
              • Cinematic - Send transmission to Losing_Group_Var from a Neutral Passive.Orb Forger named |cffff0000GAME OVER... at (Center of (Playable map area)): Play No sound and display |cff00ff00Metadata .... Modify duration: Add 38.00 seconds and Wait
              • Cinematic - Send transmission to Winning_Group_Var from a Neutral Passive.Orb Forger named |cff00ff00VICTORY|r at (Center of (Playable map area)): Play No sound and display |cff00ff00Metadata .... Modify duration: Add 38.00 seconds and Wait
            • Else - Actions
              • -------- Run for the next player: --------
              • Trigger - Run Log Metadata Uncle <gen> (ignoring conditions)
 
Level 20
Joined
Mar 16, 2008
Messages
812
Sorry to double post and also sorry for being helpless to solve my own problems. One of the players just reported a similar problem again that he can't leave the game without alt+f4'ing, shared this screen shot. Pretty much the final victory button isn't showing up. The trigger seems to parse everyone correctly otherwise.
 

Attachments

  • 1644999336709.png
    1644999336709.png
    13.6 MB · Views: 12

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,388
It's locked in Cinematic Mode, which Disables user control. Just make sure you turn that stuff off at the end or something.

Edit: I noticed that when you give players Victory/Defeat you also run two more Cinematic transmissions that don't seem necessary. Try deleting those.
 
Level 20
Joined
Mar 16, 2008
Messages
812
Thank you so much for your reply!

typically the cinematic mode runs while this parse trigger runs, then everyone gets a final victory/defeat with no problem.

The first cinematic transmission says "wait while we load meta data to replay" the 2nd one says "data loaded" or something like that.

EDIT: maybe just run the final victory defeat every 60 sec after game ends? or something like that?

 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,388
But you're running two more Cinematic transmissions at the end when parsing has already completed. At that point the players are given Defeat/Victory and can leave the game. If for some reason you need more time then add another Wait at the end before issuing Defeat/Victory. Once the Cinematic is fully finished and players have control again issue out the Defeat/Victory stuff.
 
Level 20
Joined
Mar 16, 2008
Messages
812
well one is for the losing group 'you lost' and one is for the winning grp 'you won'. would that cause a problem?

the cinematic just runs forever after the game ends pretty much. so they could stay and watch the cinematic further or just leave.

i'm really sleepy hope this makes sense.
 
Status
Not open for further replies.
Top