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

Win Trigger Help

Status
Not open for further replies.
Level 5
Joined
Jun 8, 2009
Messages
101
As you all know im working on a map called Cops N Robbers its a remake for starcrafts Cops and robbers and ive been working on it for some time trying to get it balanced and do it all correctly while adding some of the many features WC3 has to offer.


I have a trigger question.

I need to know how to run a trigger that detects how many robbers are in the game. I have the game set so that the cops win when all the robbers have been captured. As of now I have the win trigger linked to cops lumber, everytime they kill a robber they receive 1 lumber. But I don't know how to set a trigger that detects players and how many are active in the game. Can anyone help me?

Or help me rebuild an all new trigger to define win conditions?

The robbers conditions are easy. They achieve 200 lumber and victory is thiers
 
  • Trigger1
  • Events
    • Time - Elapsed time is 0.00 seconds
  • Conditions
  • Actions
    • Set CopsG = (Allies of Player 1 (Red))
    • Set RobbersG = (Allies of Player 8 (Pink)) (?) --- "Player Group" variable
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • If (Conditions) are true then do (Actions) else do (Actions)
      • If - Conditions
        • (Owner of (Killing unit)) is in (Cops)) Equal to True
      • Then - Actions
        • Set Cops = ((Cops) + 1) --- Integer Variable
        • Player - Set (Cops) to (Owner of (Killing unit)) lumber
        • If (Conditions) are true then do (Actions) else do (Actions)
          • If - Conditions
            • Cops Equal to (Number of Players in (Robbers))
          • Then - Actions
            • Player Group - Pick up every Player in (Cops) and do (Actions)
              • Loop - Actions
                • Game - Victory (Picked Player) (Show dialogs, Show scores)
            • Player Group - Pick up every Player in (Robbers) and do (Actions)
              • Loop - Actions
                • Game - Defeat (Picked Player) (Show scores, Show dialogs)
      • Else - Actions
        • If (Conditions) are true then do (Actions) else do (Actions)
          • If - Conditions
            • (Owner of (Killing unit)) is in (Robbers)) Equal to True
          • Then - Actions
            • Set Robbers = ((Robbers) + 1) --- Integer variable
            • Player - Set (Robbers) to (Owner of (Killing unit)) lumber
            • If (Conditions) are true then do (Actions) else do (Actions)
              • If - Conditions
                • Robbers Equal to 200
              • Then - Actions
                • Player Group - Pick up every Player in (Robbers) and do (Actions)
                  • Loop - Actions
                    • Game - Victory (Picked Player) (Show dialogs, Show scores)
                • Player Group - Pick up every Player in (Cops) and do (Actions)
                  • Loop - Actions
                    • Game - Defeat (Picked Player) (Show scores, Show dialogs)
      • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top