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

[Trigger] Player group variable

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
Not sure I entirely understand the question...but...this might be what you were saying?

  • Do Multiple ActionsFor each (Integer TempInt) from 2 to 12, do (Actions)
    • Loop - Actions
      • Set TempPlayer = (Player(TempInt))
      • Set TempForce = (Player group(TempPlayer))
      • Game - Display to TempForce the text: Message
      • Custom script: call DestroyForce(udg_TempForce)
 
Level 19
Joined
Jan 12, 2011
Messages
1,523
Not sure I entirely understand the question...but...this might be what you were saying?

  • Do Multiple ActionsFor each (Integer TempInt) from 2 to 12, do (Actions)
    • Loop - Actions
      • Set TempPlayer = (Player(TempInt))
      • Set TempForce = (Player group(TempPlayer))
      • Game - Display to TempForce the text: Message
      • Custom script: call DestroyForce(udg_TempForce)

I meant that how do i make a player group where i don't need to do 12 times this :
  • Actions
    • Set PlayerGroupRed = Player Group - Player 2 (Blue)
    • Player Group - Add Player 3 (Teal) to PlayerGroupRed
    • Player Group - Add Player 4 (Purple) to PlayerGroupRed
    • Player Group - Add Player 5 (Yellow) to PlayerGroupRed
    • Player Group - Add Player 6 (Orange) to PlayerGroupRed
    • Player Group - Add Player 7 (Green) to PlayerGroupRed
    • Player Group - Add Player 8 (Pink) to PlayerGroupRed
    • Player Group - Add Player 9 (Gray) to PlayerGroupRed
    • Player Group - Add Player 10 (Light Blue) to PlayerGroupRed
    • Player Group - Add Player 11 (Dark Green) to PlayerGroupRed
    • Player Group - Add Player 12 (Brown) to PlayerGroupRed
Because if i do all players and then just delete player red it will delete it from all players aswell...
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
  • Do Multiple ActionsFor each (Integer TempInt) from 1 to 12, do (Actions)
    • Loop - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Equal to (==) 1
        • Then - Actions
        • Else - Actions
          • Set TempPlayer = (Player(TempInt))
          • Player Group - Add TempPlayer to PlayerGroupNoRed
If you wanted to make it so Blue was not added to the group then change condition to == 2 etc.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
(all players) is a constant force. Modifications to this force will be permanent. If you Destroy it then it is gone for good.

If the trigger/function is atomic (completes execution without being interrupted) then you can remove a player from the force, use the force then add the player back to the force and it will not make any difference. This is dangerous if the trigger/function can be interrupted by another thread as if that thread uses the (all players) force then it will be wrong.
 
Status
Not open for further replies.
Top