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

Help player group

Status
Not open for further replies.
Level 4
Joined
Feb 17, 2014
Messages
11
Hello everyone, im new on world editor and i need one help.

All i need is make a trigger where I add all 9 players To a player group X.
Then after a trigger runs,
1 random person from Group X, join Group Y and leaves Group X.
Then another Player from group X leave this group and join group Z. But I dont now how even to start. Can someone Help me?
 
Add first 9 players to X
  • For each (Integer I) from 1 to 9, do (Actions)
    • Loop - Actions
      • Player Group - Add (Player(I)) to X
Your trigger runs
  • -------- We move a player from X to Y --------
  • -------- --------
  • Set player = (Random player from X)
  • Player Group - Remove player from X
  • Player Group - Add player to Y
  • -------- --------
  • -------- We move a player from X to Z --------
  • -------- --------
  • Set player = (Random player from X)
  • Player Group - Remove player from X
  • Player Group - Add player to Z

player = player variable

X, Y, Z
= Player Group variables

I
= integer variable

In this example as you can see I run a loop from 1-9 to add players to X. I don't know how far it fits to your map. You also can add each player seperatly.
 
Level 4
Joined
Feb 17, 2014
Messages
11
Sorry for the late reply.
Thats work fine in my map. Thanks very much :)

But now i have anothe question,
Can i make a trigger after that where i check If Player 1 Was choosen, do action Else> If player 2 was choosen, do action an do so on?
IF there is one way, please help me.
 
Yes, you can check it easily. You will find a boolean comparisson which checks if a player is in PlayerGroup.
So you simply can check if (Player 1 is in GroupY/Z == true) ... and so on.

It depends of what you exactly gonna do, but if you would wanna check it for every player there would be a better way.
For example when you move Player X to Group Y, you could save the PlayerNumber of Player X in a integer variable and use it later:

Set Player = RandomPlayer of GroupX
Remove Player from Group X
Add Player to Group Y
Set Y_Integer = PlayerNumber of Player

(this would only work good if you would add only 1 player to Group Y, but can show that working with player number can be cool)
 
Status
Not open for further replies.
Top