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
Easy fix would be to call it before changing client.mob.