ID:946242
 
(See the best response by NNAAAAHH.)
Hello. I am trying to figure out how to best make mob to be taking turns. I am trying to make it flexible for different amount of players in a party system. So if there's 2 in a party and 2 enemies it will be like: player, enemy, player 2, enemy 2. If its 3 players and 2 enemies it would be like p,e,p2,e2,p3,p. But how do I do that? And what would be the best way? Make a personal turn and a global turn? How do I make it flexible for several players?
Would the developer help section not be more appropriate for the question?
You can have a list() containing the player's turn. Ex:
var
mob
enemy1 = new(pick(ENEMY_LIST)) // Assume you have a specific list of enemy pathway to choose from
enemy2 = new(pick(typesof(/Enemy/Cave) - /Enemy/Cave)) // An alternative method to the above
list/players = Initialize_List(mob1, mob2, enemy1, enemy2) // Assume this proc. sorts people based on a variable, ie. speed, and return a list() of the people in order

while(!GAME_OVER) // while the round is still happening
var/mob/current_player = players[1] // Get whoever is first in the list
players -= current_player
players += current_player // This should add the person to the end of the list now.

...do turn stuff
Best response
http://www.byond.com/developer/Albro1/TBSFrameLib

You can either use the libary itself, or use it as a basis for your own. I recomend the first previous until gaining more talent in the programming area.