ID:140366
 
Anyone know what the runtime error, bad client, usually means when its in the New() proc under client?
If you could show your New() procedure under client, and if you are calling it manually show that too. I would guess you are calling it with something that isn't a client. Bad client usually means there is no client.
Well I usually don't like to show my actual code, but this whole client and mob relationship is new to me so here it is.

client
New()
var/player_sav = "players/[ckey].sav"
if(fexists(player_sav))
var/savefile/F = new(player_sav)
F["name"] >> name
F["powerlevel"] >> powerlevel
world << output("[name] has arrived","chat")
else
gilist += /obj/battle/Gi_Light
gilist += /obj/battle/Gi_Medium
gilist += /obj/battle/Gi_Dark
gilist += /obj/battle/Gi2_Light
gilist += /obj/battle/Gi2_Medium
gilist += /obj/battle/Gi2_Dark
gilist += /obj/battle/Gi3_Light
gilist += /obj/battle/Gi3_Medium
gilist += /obj/battle/Gi3_Dark
hairlist += /obj/battle/Uub_Light
hairlist += /obj/battle/Uub_Medium
hairlist += /obj/battle/Uub_Dark
nocontrol = 1
can = 1
mob.Move(locate(9,3,2))
mob.dir = 1
winshow(mob,"CreateCharacter",1)
do
sleep(2)
if(hair == 0)
if(skincolor == 0)
mob.overlays -= hairlist
mob.overlays += /obj/battle/Uub_Light
overworldavatar = /obj/hud/avatars/Uub
if(skincolor == 1)
mob.overlays -= hairlist
mob.overlays += /obj/battle/Uub_Medium
overworldavatar = /obj/hud/avatars/Uub2
if(skincolor == 2)
mob.overlays -= hairlist
mob.overlays += /obj/battle/Uub_Dark
overworldavatar = /obj/hud/avatars/Uub3
if(gicolor == 0)
if(skincolor == 0)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi_Light
overworldcharacter = "Gi_Light"
if(skincolor == 1)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi_Medium
overworldcharacter = "Gi_Medium"
if(skincolor == 2)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi_Dark
overworldcharacter = "Gi_Dark"
if(gicolor == 1)
if(skincolor == 0)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi2_Light
overworldcharacter = "Gi2_Light"
if(skincolor == 1)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi2_Medium
overworldcharacter = "Gi2_Medium"
if(skincolor == 2)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi2_Dark
overworldcharacter = "Gi2_Dark"
if(gicolor == 2)
if(skincolor == 0)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi3_Light
overworldcharacter = "Gi3_Light"
if(skincolor == 1)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi3_Medium
overworldcharacter = "Gi3_Medium"
if(skincolor == 2)
mob.overlays -= gilist
mob.overlays += /obj/battle/Gi3_Dark
overworldcharacter = "Gi3_Dark"
while(submit <> 1)
name = input("Character Name") as text
hud = new/obj/hud/default(mob.client)
hudavatar = new overworldavatar(mob.client)
fullhealth()
mob.overlays = 0
mob.icon = 'omovement.dmi'
mob.icon_state = overworldcharacter
mob.Move(locate(21,7,1))
nocontrol = 0
powerlevel = 10
loading = 0
return
return ..()


The variables submit, skincolor, and gicolor are controlled by buttons on the CreateCharacter window.

Please Help
In response to Railon
You never initialized mob, so it's null. When you call winshow(mob, blah), it evaluates to winshow(null, blah) which throws the error.

You need to actually create a mob for the client before you try to use it.