I have been working on Heaven's Last Defense and run into many problems. I have solved 99% of them myself thanks to the tutorials on the SC2Mapster. However I am now at a point where I cannot find a tutorial for my problem and I don't know how to solve it.
I have a character selection screen. When you choose a character and confirm it you get control of Hero units, Elite units, etc... My problem is this. I want the game to wait to start until all players have chosen their heroes. I know this is based around a Boolean Array variable and a loop, I just don't know how to make it work. Ideally, once all players have made their choice, the Boolean would come back all true and initiate the cameras moving, the countdown ticking and all that jazz. Anyone have any advice?
There are probably quite a few ways you can solve this problem. For example, at map initialisation, you could add all players with the 'playing' status added to a group and have a variable 'PlayersReady' = 0. When a player confirms their class, have a custom action which does the following:
Modify PlayersReady + 1
If PlayersReady = Number of players in group 'PlayingPlayers'
Then run trigger 'StartCountDown' (or something similar)
Thanks bro, I actually did the reverse of that by subtracting players out of a playergroup filled with active players at map initialization. Thanks for the response though.
make sure you check for players that have left game.... if your game wait for people...... The active players returns true for players that have left the game.... you need to also check for "player has left game" = false
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
To post a comment, please login or register a new account.
I have been working on Heaven's Last Defense and run into many problems. I have solved 99% of them myself thanks to the tutorials on the SC2Mapster. However I am now at a point where I cannot find a tutorial for my problem and I don't know how to solve it.
I have a character selection screen. When you choose a character and confirm it you get control of Hero units, Elite units, etc... My problem is this. I want the game to wait to start until all players have chosen their heroes. I know this is based around a Boolean Array variable and a loop, I just don't know how to make it work. Ideally, once all players have made their choice, the Boolean would come back all true and initiate the cameras moving, the countdown ticking and all that jazz. Anyone have any advice?
Code for map provided upon request.
There are probably quite a few ways you can solve this problem. For example, at map initialisation, you could add all players with the 'playing' status added to a group and have a variable 'PlayersReady' = 0. When a player confirms their class, have a custom action which does the following:
Modify PlayersReady + 1
If PlayersReady = Number of players in group 'PlayingPlayers'
Then run trigger 'StartCountDown' (or something similar)
@ChromiumBoy: Go
Thanks bro, I actually did the reverse of that by subtracting players out of a playergroup filled with active players at map initialization. Thanks for the response though.
make sure you check for players that have left game.... if your game wait for people...... The active players returns true for players that have left the game.... you need to also check for "player has left game" = false