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

Question about player triggers

Status
Not open for further replies.
Level 3
Joined
Mar 18, 2020
Messages
20
Try this:

  • RegionCounter
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set VariableSet TempUnitGroup = (Units in FunZone <gen> owned by (Player((Integer A))))
          • Set VariableSet TempInteger = (Number of units in TempUnitGroup)
          • Custom script: call DestroyGroup (udg_TempUnitGroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInteger Greater than 0
            • Then - Actions
              • Player Group - Add (Player((Integer A))) to PlayersInFunZone
            • Else - Actions
              • Player Group - Remove (Player((Integer A))) from PlayersInFunZone.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayersInFunZone) Equal to 2
        • Then - Actions
          • Game - Display to (All players) the text: 2 Players!
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayersInFunZone) Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: 3 Players!
        • Else - Actions
      • -------- etc, etc... --------
The loop 1 to 12 is for however many players you have (12 for 12 players).

TempUnitGroup is a Unit Group variable, TempInteger is an Integer variable, PlayersInFunZone is a Player Group variable.
 
Status
Not open for further replies.
Top