ID:179607
 
Ok, this may get complicated so bear with me. I want a save verb to come up when you walk up to lets say, a save point. And then a pop up will come up and say, would you like to save your game? and then you can choose Yes or No. This way it is like a real RPG. Thanks,

~KnightRen
i believe one would be

Enter()
usr.loc(the turf location)
src.client.base_SaveMob()
usr<<"You have been saved"
In response to Super16
Too bad he's not using character saving. This would work.

turf/savepoint
icon='grass.dmi'
var/mob/M
var/savefile/F = new("[M.ckey].sav")
Entered(mob/M)
..()
switch(input("Would you like to save?")in list("Yes","No"))
if("Yes")
Write(F)
M<<"[F] has been loged and saved"
else
M<<"Come back when you want to save!"


mob/Login()
var/savefile/F = new("[src.ckey].sav")
Read(F)
In response to Super16
Ok, I said that wrong, what I meant was if you walked up to an object, and more importantly, where do I put this code? Underneath the object's coding?

~KnightRen
In response to Nadrew
Ok, im not sure if I need the char handling lib or what, but I get 2 errors. Error 1: M.ckey: invalid variable Error 2: = :expected a constant expression , I have the code in just like you, except with right indentation, so....


~KnightRen
In response to KnightRen
Try moving the savefile var down below the Entered proc
In response to Nadrew
Ok, I did that, and it even compiles and will run the game fine, but I just get a black screen, nothing happens, here is what I have:

savepoint
icon = 'woodfloor2.dmi'
var/mob/M
Entered(mob/M)
var/savefile/F = new("[M.ckey].sav")
..()

switch(input("Save?")in list("Yes","No"))
if ("Yes")
Write(F)
M<<"[F] has been logged and saved"
else
M<<"Come back when you want to save!"
In response to KnightRen
Now that you put the save code under entered you don't need the var/mob/M, as for the black screen add ..() into the login code.
In response to Nadrew
Thanks alot, helped tons.

~KnightRen
In response to Nadrew
What does this savefile do... just save all the vars for that player?
In response to Nadrew
Um ok, yeah, he is right, everything works fine now, it even says it saves... But when I logout and rerun the game..it doesnt give me a choice to choose the saved char.


~KnightRen
In response to Evilkevkev
It saves all non-temp/global/const vars for the mob.
In response to Nadrew
Well, what im really needing is a save verb that saves everything, and gives you the choice to play as that char when you come back in the game any time.


~KnightRen

In response to KnightRen
In that case download Deadrons character saving and edit it a bit to fit what you need.