ID:179083
 
1. I am trying to set a list that will remain constant and change based on the input of all players entering the game. i.e. they log in and select a bot to play, I don't want the subsequent players to be able to select the same bot.
Where or how should I create this list so that it will remain constant throughout the subsequent player logins.

2. Almost the same as number one, I want the first player to log in to be able to set the number of players allowed in the game. But I currently get the question coming up for every player, for /mob/var/players[0]
Login()
if(length(players) == 0)
noplayers = input("How many players in the game?","1-6")
return ..()
I wish I could set these variables to the world.

3. Is there a way to get the game to wait for all the players to log in? I have been trying
while(length(players) < noplayers)
sleep()
I think you'd want to use a world var for #1, which means just declare a var without anything before it:

var/list/available_bots = list()

Them, if you don't want other players to be able to access the same robot that someone else chooses, remove that robot from the list as soon as it's chosen, and re-add it as soon as that player leaves or dies or whatever.

var/bot
mob/ChooseBot()
src.bot = input("which bot?") in list("SuperDroid","MegaMonkey")
available_bots -= src.bot

mob/Died()
available_mobs += src.bot
src.loc = null



As for #2, if players is a list of all players in the game, then you'll need to use players.len, not length(players), since the latter is more fitting for text strings and such. players.len will show the actual number of mobs in the players list.

if(players.len == 1)

(naturally, there's going to be one player after you log in)




#3, best to have some kind of "Start Game" verb that gets the action going, but will only work if, for example, if(players.len >= 4). Otherwise it'll just tell you to wait for more players.

Hope that helps.