ID:146347
 
Code:
            save
icon='clientscreen.dmi'
icon_state = "save"
layer = MOB_LAYER + 5
Click()
call(/mob/verb/Save)()
src << "<font color=yellow><i><center>Now Saving..."
sleep(10)
src << "<font color=yellow><i><center>Saving Complete"
New(client/C)
screen_loc = "2,1"
C.screen+=src


mob
verb
Save()
set hidden = 1
src.client.base_SaveMob()


Problem description:
runtime error: Cannot read null.client
proc name: Save (/mob/verb/Save)
usr: Mic (/mob/namek)
src: null
call stack:
Save()
the save (/obj/hud/save): Click(the grass (27,176,1) (/turf/basicturf/grass))


this isn't really about the runtime error.

I want the save inside the save hud, but for now I want to call it.

but I get this runtime error when I call the Save Verb...

Any ideas on how to fix the calling issue.. or better yet on how to place the verb into the Save hud?

You are calling the verb without defining the src. I don't know a lot about the call proc, but I think that's your problem.

I suggest using a proc instead.
Crzylme wrote:
Code:
>             save
> icon='clientscreen.dmi'
> icon_state = "save"
> layer = MOB_LAYER + 5
> Click()
> call(/mob/verb/Save)()
> src << "<font color=yellow><i><center>Now Saving..."
> sleep(10)
> src << "<font color=yellow><i><center>Saving Complete"
> New(client/C)
> screen_loc = "2,1"
> C.screen+=src
Arg, well, instead of making it a verb, make it a proc.
In response to Xeal
Make the Verb into a proc. I did that. But I still get a runtime error. the same exact thing.

<font color=red>runtime error: undefined proc or verb /obj/hud/save/Save().

proc name: Click (/obj/hud/save/Click)
usr: Jon (/mob/male)
src: the save (/obj/hud/save)
call stack:
the save (/obj/hud/save): Click(the grass (26,179,1) (/turf/basicturf/grass))</font>

save
icon='clientscreen.dmi'
icon_state = "save"
layer = MOB_LAYER + 5
Click()
call(src, /mob/proc/Save)()
src << "<font color=yellow><i><center>Now Saving..."
sleep(10)
src << "<font color=yellow><i><center>Saving Complete"
New(client/C)
screen_loc = "2,1"
C.screen+=src

/////////////////////////////////////////////////////////

mob
proc
Save()
src.client.base_SaveMob()


What did I do wrong?
In response to Crzylme
Crzylme wrote:
Make the Verb into a proc. I did that. But I still get a runtime error. the same exact thing.

<font color=red>runtime error: undefined proc or verb /obj/hud/save/Save().

proc name: Click (/obj/hud/save/Click)
usr: Jon (/mob/male)
src: the save (/obj/hud/save)
call stack:
the save (/obj/hud/save): Click(the grass (26,179,1) (/turf/basicturf/grass))</font>

save
> icon='clientscreen.dmi'
> icon_state = "save"
> layer = MOB_LAYER + 5
> Click()
> call(src, /mob/proc/Save)()
> src << "<font color=yellow><i><center>Now Saving..."
> sleep(10)
> src << "<font color=yellow><i><center>Saving Complete"
> New(client/C)
> screen_loc = "2,1"
> C.screen+=src
>
> /////////////////////////////////////////////////////////
>
> mob
> proc
> Save()
> src.client.base_SaveMob()
>

What did I do wrong?
call(src, /mob/proc/Save)()

Replace it with usr.Save(). I don't work with Click() much, so I'm not sure if its right.
In response to Crzylme
Crzylme wrote:
Make the Verb into a proc. I did that. But I still get a runtime error. the same exact thing.

<font color=red>runtime error: undefined proc or verb /obj/hud/save/Save().

proc name: Click (/obj/hud/save/Click)
usr: Jon (/mob/male)
src: the save (/obj/hud/save)
call stack:
the save (/obj/hud/save): Click(the grass (26,179,1) (/turf/basicturf/grass))</font>

save
> icon='clientscreen.dmi'
> icon_state = "save"
> layer = MOB_LAYER + 5
> Click()
> call(src, /mob/proc/Save)()
> src << "<font color=yellow><i><center>Now Saving..."
> sleep(10)
> src << "<font color=yellow><i><center>Saving Complete"
> New(client/C)
> screen_loc = "2,1"
> C.screen+=src
>
> /////////////////////////////////////////////////////////
>
> mob
> proc
> Save()
> src.client.base_SaveMob()
>

What did I do wrong?

*runs off a cliff* O.o
call(src, /mob/proc/Save) makes the compiler frigin tweek. If you look in the reference you can only use ProcRef: path of proc (/proc/MyProc). So src along with the path to the proc is not accepted.

Just do your call(/mob/proc/Save)(). Now that last runtime error had to do with your mob code alone. You know the one Im talkin right? The one with the null.client I think it was.

[EDIT] Ok lets see, Where is base_SaveMob() function located? Is it in the client?
According to the runtime error. /mob/male or Jon is equal too usr not src. To get your reference to your client. You would need to do a var/client/C = usr.client. Type Casting right?

But If I were you I would just use the base_SaveMob() in the mob. But to each his own.

-- Green Lime
In response to Crzylme
Read the runtime error:
runtime error: undefined proc or verb /obj/hud/save/Save().
undefined proc or verb, meaning the following procedure or verb doesn't exist: /obj/hud/save/Save()

The problem is with the line: call(src, /mob/proc/Save)()
src is the object which contains the proc or verb, and the /obj/hud/save does not the Save proc.
It doesn't care what comes before the /proc/WHATEVER, it changes that to the type which src is.
First off, it's a procedure so you don't necessarily need to use call(). Secondly, in Click() proc for atoms, src is the 'source' of the click proc (Whatever's being clicked) and usr is the 'user' of the click proc (Whatever's doing the clicking)

This is one of those 'ok' procs that you can use usr, but I recommend that you look up click proc (client) in the DM Help (Press F1).

If you want to just take the easy way, change
call(src, /mob/proc/Save)() into: usr.Save()

If you change save back to a verb, you'd change the call() to this.... call(usr, /verb/Save)()
In response to JackGuy
JackGuy wrote:
Read the runtime error:
runtime error: undefined proc or verb /obj/hud/save/Save().
undefined proc or verb, meaning the following procedure or verb doesn't exist: /obj/hud/save/Save()

The problem is with the line: call(src, /mob/proc/Save)()
src is the object which contains the proc or verb, and the /obj/hud/save does not the Save proc.
It doesn't care what comes before the /proc/WHATEVER, it changes that to the type which src is.
First off, it's a procedure so you don't necessarily need to use call(). Secondly, in Click() proc for atoms, src is the 'source' of the click proc (Whatever's being clicked) and usr is the 'user' of the click proc (Whatever's doing the clicking)

This is one of those 'ok' procs that you can use usr, but I recommend that you look up click proc (client) in the DM Help (Press F1).

If you want to just take the easy way, change
call(src, /mob/proc/Save)() into: usr.Save()

Well, thanks Jack, for confirming what I said <<'.