what i want to do is make each player take its turn in order, player 1 goes 1st, player 2 goes next, then player 3 goes last, then back to player 1 again over and over the lengh of the game. i already have a timer and would like to move to next player when time expires. timer set at 30 seconds after it expires go to player to and so on. i know how to do it but its a VERY long way around where you set the game durration timer and make about half a million tirggers to move it every 30 seconds, omfg no. so! anyone know how to do this? thank you for the help if you do :D.
(perform a check here that will test if someone has won, in which case you have to break the loop)
Create a timer
Wait until timer expires
Set a couple of variables (basically which one of the X players should be playing next, based on an integer variable that will be incremented every turn, then reset to 1 to at some point to let the first player take his next turn)
Check if it's a player's turn then do actions accordingly: either pause its units/commands (if it's not his turn), or let him do whatever he wants (if he's playing)
...It's very generic because it's hard to tell what you're trying to achieve besides the time-based turns system. But basically, the idea behind a turn-based system is to repeat a loop that will execute a few actions, according to a few variables changing every time a new player takes his turn.
i already got a timer that expires and when it expires it triggers all units in a area to attack. what im basicly looking for is that player 1 builds lets say a barracks, that barracks triggers player 9 to create 6 marines. i got this part, then when it expires then player 1 dont spawn any units when timer expires and its players 2 turn to spawn units, say player 2 has a gateway and it spawns 4 zealot for player 9. what i dont want to happen is that everytime the timer expires that every player spawns units. like i said "takeing turns" LOL. just dont want both to fire when timer expires. could get VERY nasty being i have 8 players, if they all spawned units at the same time, haha.
SpawnTest
Events
Unit - Any Unit Enters P1BuildArea
Local Variables
Conditions
(Unit type of (Triggering unit)) == Gateway
(Owner of (Triggering unit)) == 1
Actions
Unit - Create 5 Zealot for player 9 at (Center of NorthSpawnArea) using default facing (No Options)
how to make this fire only when its player 1's turn and only when timer is at lets say 2 seconds left...right now that fires everytime player 1 creates a gateway reguardless of turns or order.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
what i want to do is make each player take its turn in order, player 1 goes 1st, player 2 goes next, then player 3 goes last, then back to player 1 again over and over the lengh of the game. i already have a timer and would like to move to next player when time expires. timer set at 30 seconds after it expires go to player to and so on. i know how to do it but its a VERY long way around where you set the game durration timer and make about half a million tirggers to move it every 30 seconds, omfg no. so! anyone know how to do this? thank you for the help if you do :D.
You could create a timer variable and have an event like "Timer X Expires." To start the timer, use the Start Timer action function.
Repeat forever:
...It's very generic because it's hard to tell what you're trying to achieve besides the time-based turns system. But basically, the idea behind a turn-based system is to repeat a loop that will execute a few actions, according to a few variables changing every time a new player takes his turn.
@ZealNaga:
i already got a timer that expires and when it expires it triggers all units in a area to attack. what im basicly looking for is that player 1 builds lets say a barracks, that barracks triggers player 9 to create 6 marines. i got this part, then when it expires then player 1 dont spawn any units when timer expires and its players 2 turn to spawn units, say player 2 has a gateway and it spawns 4 zealot for player 9. what i dont want to happen is that everytime the timer expires that every player spawns units. like i said "takeing turns" LOL. just dont want both to fire when timer expires. could get VERY nasty being i have 8 players, if they all spawned units at the same time, haha.
SpawnTest
Events
Unit - Any Unit Enters P1BuildArea
Local Variables
Conditions
(Unit type of (Triggering unit)) == Gateway
(Owner of (Triggering unit)) == 1
Actions
Unit - Create 5 Zealot for player 9 at (Center of NorthSpawnArea) using default facing (No Options)
how to make this fire only when its player 1's turn and only when timer is at lets say 2 seconds left...right now that fires everytime player 1 creates a gateway reguardless of turns or order.