ID:264434
 
Code:
turf
Title
icon='Title.dmi'

Click(mob/src)
..()
src<<"Checking our database to see if your in our Database Files."
if(fexists("playersaves/[src.name].save"))
src.Load()
src.loc = locate(1,1,2)
return
src.CharCre()
return


Problem description:

Whe i run the game and click the screen it says this as a error runtime error: undefined proc or verb /turf/CharCre().

proc name: Click (/turf/Click)
usr: XxBloody NightmarexX (/mob)
src: the turf (6,5,1) (/turf)
call stack:
the turf (6,5,1) (/turf): Click(the turf (6,5,1) (/turf), "default.map1", "icon-x=15;icon-y=32;left=1;scr...")
runtime error: undefined proc or verb /turf/CharCre().
XxBloody NightmarexX wrote:
Code:
> turf
> Title
> icon='Title.dmi'
>
> Click(mob/src)
> ..()
> src<<"Checking our database to see if your in our Database Files."
> if(fexists("playersaves/[src.name].save"))
> src.Load()
> src.loc = locate(1,1,2)
> return
> src.CharCre()
> return
>

Problem description:

Whe i run the game and click the screen it says this as a error runtime error: undefined proc or verb /turf/CharCre().

proc name: Click (/turf/Click)
usr: XxBloody NightmarexX (/mob)
src: the turf (6,5,1) (/turf)
call stack:
the turf (6,5,1) (/turf): Click(the turf (6,5,1) (/turf), "default.map1", "icon-x=15;icon-y=32;left=1;scr...")
runtime error: undefined proc or verb /turf/CharCre().

The problem is clarified in the second-to-last line of the runtime error:

the turf (6,5,1) (/turf): Click(the turf (6,5,1) (/turf), "default.map1", "icon-x=15;icon-y=32;left=1;scr...")

The first argument to Click() is not the person who clicked the item, but it's actually the item's location. The person who clicked the item is passed to the proc with usr:

turf/title/Click()
var/mob/m = usr
if(istype(m))
m << "You clicked the [src.name]!"
In response to Mobius Evalon
Yea that didn't help me any.
In response to Mobius Evalon
Mobius Evalon wrote:
> turf/title/Click()
> var/mob/m = usr
> if(istype(m))
>


That seems pretty pointless, why re-typecast and check? usr is already defined as a /mob type and will always contain a mob when a verb or mouse proc is invoked (unless the programmer specifically messes with usr). What's for sure is that all the m var helps you is by saving 2 characters to type. =P
src is the turf, not the person doing the clicking. You'd use usr instead of src in this case, and get rid of that absolutely insane mob/src argument. It shouldn't be there, and you should never declare a variable named src.
In response to Kaioken
Kaioken wrote:
Mobius Evalon wrote:
> > turf/title/Click()
> > var/mob/m = usr
> > if(istype(m))
> >

That seems pretty pointless, why re-typecast and check? usr is already defined as a /mob type and will always contain a mob when a verb or mouse proc is invoked (unless the programmer specifically messes with usr). What's for sure is that all the m var helps you is by saving 2 characters to type. =P

Ideally he'd replace the generic /mob type with the type his game uses for the purpose of logging in. Even though it does squat in my specific example, I figured that detailing the process couldn't hurt. I also thought I had put a comment in the code snippet to say the same thing, but I guess it slipped my mind, hmm...
In response to XxBloody NightmarexX
I Fixed it./