• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[GUI]Randomly pick one player to another team

Status
Not open for further replies.
This is how I would do it. First make 2 Player group variables, and a player variable array, then make these triggers:

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Add the players to team A --------
      • Player Group - Add Player 1 (Red) to TeamA
      • Player Group - Add Player 2 (Blue) to TeamA
      • Player Group - Add Player 3 (Teal) to TeamA
      • Player Group - Add Player 4 (Purple) to TeamA
      • -------- Add the players to team B --------
      • Player Group - Add Player 5 (Yellow) to TeamB
      • Player Group - Add Player 6 (Orange) to TeamB
      • Player Group - Add Player 7 (Green) to TeamB
      • Player Group - Add Player 8 (Pink) to TeamB
      • -------- Set the ally/enemy settings --------
      • Player Group - Make TeamA treat TeamA as an Ally with shared vision
      • Player Group - Make TeamA treat TeamB as an Enemy
      • Player Group - Make TeamB treat TeamB as an Ally with shared vision
      • Player Group - Make TeamB treat TeamA as an Enemy
  • Switch Teams
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • -------- Picks a random player from both teams --------
      • Set RandomPlayerSwitch[1] = (Random player from TeamA)
      • Set RandomPlayerSwitch[2] = (Random player from TeamB)
      • -------- Swop both players to either side's team --------
      • Player Group - Remove RandomPlayerSwitch[1] from TeamA
      • Player Group - Add RandomPlayerSwitch[1] to TeamB
      • Player Group - Remove RandomPlayerSwitch[2] from TeamB
      • Player Group - Add RandomPlayerSwitch[2] to TeamA
      • -------- Refresh the ally/enemy settings --------
      • Player Group - Make TeamA treat TeamA as an Ally with shared vision
      • Player Group - Make TeamA treat TeamB as an Enemy
      • Player Group - Make TeamB treat TeamB as an Ally with shared vision
      • Player Group - Make TeamB treat TeamA as an Enemy
You're trying to make a random player from both team's swop teams right? Or we're you trying to make 1 player switch, without being replaced? So 4v4 becomes 3v5?
 
This is how I would do it. First make 2 Player group variables, and a player variable array, then make these triggers:

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Add the players to team A --------
      • Player Group - Add Player 1 (Red) to TeamA
      • Player Group - Add Player 2 (Blue) to TeamA
      • Player Group - Add Player 3 (Teal) to TeamA
      • Player Group - Add Player 4 (Purple) to TeamA
      • -------- Add the players to team B --------
      • Player Group - Add Player 5 (Yellow) to TeamB
      • Player Group - Add Player 6 (Orange) to TeamB
      • Player Group - Add Player 7 (Green) to TeamB
      • Player Group - Add Player 8 (Pink) to TeamB
      • -------- Set the ally/enemy settings --------
      • Player Group - Make TeamA treat TeamA as an Ally with shared vision
      • Player Group - Make TeamA treat TeamB as an Enemy
      • Player Group - Make TeamB treat TeamB as an Ally with shared vision
      • Player Group - Make TeamB treat TeamA as an Enemy
  • Switch Teams
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • -------- Picks a random player from both teams --------
      • Set RandomPlayerSwitch[1] = (Random player from TeamA)
      • Set RandomPlayerSwitch[2] = (Random player from TeamB)
      • -------- Swop both players to either side's team --------
      • Player Group - Remove RandomPlayerSwitch[1] from TeamA
      • Player Group - Add RandomPlayerSwitch[1] to TeamB
      • Player Group - Remove RandomPlayerSwitch[2] from TeamB
      • Player Group - Add RandomPlayerSwitch[2] to TeamA
      • -------- Refresh the ally/enemy settings --------
      • Player Group - Make TeamA treat TeamA as an Ally with shared vision
      • Player Group - Make TeamA treat TeamB as an Enemy
      • Player Group - Make TeamB treat TeamB as an Ally with shared vision
      • Player Group - Make TeamB treat TeamA as an Enemy
You're trying to make a random player from both team's swop teams right? Or we're you trying to make 1 player switch, without being replaced? So 4v4 becomes 3v5?

The setting of the game is there has no team B. Then when the game start , system randomly pick one of the player from team a and make matching player become enemy with other player. During this process there will no replacement for any player. Something like Troll vs Elves .
 
For the random stack, you can make it dynamic, it's all MATH. You can set the team first by adding existing players from each team, make a integer array to state the player number, example: 2,4,5. This number array then stores the player value in this case for the integer array memory it will be: index 1: 2, index 2: 4, index 3: 5. If you are a math genius you would already get it :P anyways from here random the integer array using the method. index [random from 1 to [max]] in this case max is 3, so it will be taking everything from the integer array hope it's not confusing!
 
Status
Not open for further replies.
Back
Top