ID:1065774
 
(See the best response by Kaiochao.)
Code:
world mob = /temporary          //logs you in as temporary at default.

temporary
Login()
..()
loc = null
if(!game_started) src<<"<i>There is currently no game in progress!</i>"
else src<<"<i>There is a game in progress!</i>"

temporary
parent_type = /mob
verb
join_game() //join button
if(!game_started)
usr << "<i>The game has yet to start!</i>"
return
winset(usr,"join","is-disabled=true")
winset(usr,"class","is-disabled=false")
client.mob = new /player //triggers player/login() ...i assume

==============================================================================
player
antelope_warrior
icon = 'antelope.dmi'
Login()
world << "player_LOGIN()"
..()
loc = null
name = key
if(game_started)
world << "player_LOGIN() 2"
toggle_class() // Opens "Class Pick Interface"

[class pick interface]
verb
toggle_class()
// toggles class selection pop-up interface

play_game()
set
hidden = TRUE
instant = TRUE
world << "play game test"
var/selected = params2list(winget(usr, "AWarrior;LTamer;Rhino;redteam;blueteam;yellowteam;autoteam", "is-checked"))
var/player/playerMob = null

if(selected["AWarrior.is-checked"] == "true") playerMob = new /player/antelope_warrior
client.mob = playerMob
toggle_class()


Problem description:
produces runtime error. "bad client." When the line that causes the error " client.mob = playerMob" is removed. The screen just stays black. I'm supposed to become the "antelope warrior" when i login. :(

Runtime log:
player_LOGIN()
player_LOGIN()2
toggle class check
play game test

runtime error: bad client
verb name: toggle class (/player/verb/toggle_class)
usr: Hulio-G (/player)
src: Hulio-G (/player)
call stack:
Hulio-G (/player): toggle class()
Hulio-G (/player): play game()

player_LOGIN()
player_LOGIN()2
toggle class check
toggle class check
toggle class check
Best response
You're missing some code in your toggle_class() verb. I suspect it's a winset() or winshow(). Those expect a client passed as the first argument, and you're likely giving it the mob that doesn't have the client attached anymore.

Easy fix would be to call it before changing client.mob.
Thanks, that did the trick.
for future reference, if you put #define DEBUG at the top of your project's code, the runtime errors will tell you what line is causing the error.