ID:264343
 
Code:
mob
proc
Start()
var/mob/mobcreation
var/newname = input("Pick Character Name","Name",src.key)
if(lentext(newname) > 20)
src << "Your name can not exceed 20 characters."
Start()
if(isnull(newname) | newname == "" | !newname)
src << "Your name may not be of null."
Start()
if(Check_For_Tags(newname,HTML_TAGS) == TRUE)
src << "Your name may not have tags of html in them."
Start()
else
newname = html_encode(newname)
usr.loc = locate(120,112,8)
start
switch(input("Pick your character","Play As") in list ("Saiyan"))
if("Saiyan")
switch(input("What saiyan would you like to be?")in list("Goku","Vegeta","Nevermind"))
if("Goku")
mobcreation = new/mob/characters/Goku()
mobcreation.race = "Goku"
world << "[usr] is now Goku"
mobcreation.loc = locate(40,227,10)
mobcreation.name = newname
src.client.mob = mobcreation
if("Vegeta")
mobcreation = new/mob/characters/Vegeta()
mobcreation.race = "Vegeta"
world << "[usr] is now Vegeta"
mobcreation.loc = locate(40,227,10)
mobcreation.name = newname
src.client.mob = mobcreation

if("Nevermind")
goto start


Problem description
When i code this its showing error with the reason undefined proc. I would appreciate the help.

turf
New_Char
Click()
Start()
..()



You're trying to call a mob proc under a turf definition. Bad.
In response to Spunky_Girl
Could you show me then how it should be done? thanks.
In response to Dark Inc.
A turf can only call turf procs; an obj can only call obj procs; mobs can only call mob procs. End of story.
In response to Spunky_Girl
show me a example so i know how it works ;/
In response to Spunky_Girl
Spunky_Girl wrote:
You're trying to call a mob proc under a turf definition. Bad.
A turf can only call turf procs; an obj can only call obj procs; mobs can only call mob procs. End of story.

It's more accurate to say you can only call a turf proc on a turf, a mob proc on a proc etc... you can call any type of object proc from(/under/inside) any object proc, so saying "you can't call a mob proc from a turf proc" is wrong; you can, you just need to use some mob and not src (the turf). In Click() he'd want the mob doing the click, which is usr.
In response to Kaioken
Which is what I was trying to get at honestly.

turf/Grass //defined as a turf
New()
..()
mobProc() //You can't do that

mob/proc/mobProc() //defined as a mob proc
//...
In response to Spunky_Girl
That wasnt what i asked for , but nvm i already fixed it bymyself. Thanks for trying to help.
Dark Inc. wrote:
turf
> New_Char
> Click()
> Start()
> ..()



There's your problem. You making the turf call mob/proc/Start()

What you want to do is
turf
New_Char
Click()
usr.Start() //put a usr there, to call Start() on whoever clicked the turf
..()