I have a character selection dialog(that lasts 20 seconds). When player chooses a character It creates a unit that belongs to the triggering player.
What I want is that when timer expires It will make a character for each player who didn't select a character. For instance I can make a player group of those who didn't select a character, but how do I spawn a unit for each player in this group? Any ideas?
One way would be to loop through Active Players that are not in "HideSelection" group:
Variable - Set Turtles = (Copy of (Active Players))
Player Group - Remove all players in HideSelection from Turtles
Player Group - Pick each player in Turtles and do (Actions) ->[create units and set variables for picked player]
Another one would be to create units for those players whose PlayerSelection does not equal 1.
I think you can also detect if dialog is visible for player, that would make 3rd way, create units for those players who see dialog.
It really depends on how you trigger..
Little side-note: I don't think that not active players can press dialog buttons, thus your second condition would always return true, thus it's unneeded.
Little side-note:
I don't think that not active players can press dialog buttons, thus your second condition would always return true, thus it's unneeded.
Haha, yeah, I knew somebody will say that, but I was too lazy to delete it :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi. Here's my problem:
I have a character selection dialog(that lasts 20 seconds). When player chooses a character It creates a unit that belongs to the triggering player.
What I want is that when timer expires It will make a character for each player who didn't select a character. For instance I can make a player group of those who didn't select a character, but how do I spawn a unit for each player in this group? Any ideas?
Thanks.
There are many ways to implement that..
One way would be to loop through Active Players that are not in "HideSelection" group:
Variable - Set Turtles = (Copy of (Active Players))
Player Group - Remove all players in HideSelection from Turtles
Player Group - Pick each player in Turtles and do (Actions) ->[create units and set variables for picked player]
Another one would be to create units for those players whose PlayerSelection does not equal 1.
I think you can also detect if dialog is visible for player, that would make 3rd way, create units for those players who see dialog.
It really depends on how you trigger..
Little side-note:
I don't think that not active players can press dialog buttons, thus your second condition would always return true, thus it's unneeded.
Thank you! Thats exactly what I needed.
Haha, yeah, I knew somebody will say that, but I was too lazy to delete it :D