ID:264099
 
Code:
client
var/list/characters = list()
var/max_characters = 3
New()
..()
characters += mob
verb/Change_Characters()
var/mob/new_character = input("Which character will you take control of?") as mob in characters
if(new_character) new_character.client = src
verb/Display_Characters()
src << "Characters:"
for(var/mob/M in characters)
src << "You own [M]."
verb/Make_New_Character()
var/mob/new_character = new(null)
src.characters += new_character
src << list2params(src.characters)
new_character.client = src
new_character.Character_Creation()
if(characters.len >= max_characters) src.verbs -= /client/verb/Make_New_Character


Problem description:
The characters list remains empty, even when I add mobs to it with +=.
client
var/list/characters = list()
var/max_characters = 3
New()
..()
src.characters += src.mob
verb/Change_Characters()
var/mob/new_character = input("Which character will you take control of?") as mob in src.characters
if(new_character)
src.mob = new_character
verb/Display_Characters()
src << "Characters:"
for(var/mob/M in src.characters)
src << "You own [M]."
verb/Make_New_Character()
var/mob/new_character = new/mob(null)
src.characters += new_character
for(var/mob/M in src.characters)
src << "<tt>debug: [M]"
new_character.Character_Creation()
if(characters.len >= max_characters)
src.verbs -= /client/verb/Make_New_Character
In response to Mechana2412
Don't forget the tags :).
In response to A.T.H.K
Forgot which tag it was, fixed it now >_>

Thanks for reposting my code for me anyway.
In response to Mechana2412
Thank you, but the problem remains. I think it has something to do with switching mobs.
I didn't understand why this code didn't work, so I tested it, and the code works perfectly... >_>
It must have something to do with your Character_Creation() proc that may mess everything up.
That new_character.Character_Creation() line should be last in that verb as well, in case it has some sleep procedures or something, because it will pause the verb that called it until the proc finishes, which could cause people to somehow gain more than three mobs. (Due to the check being after.)