ID:261881
 
How do i change this into a Click() or something a mob says?
mob
var
saved = ""
verb
Save2()
var/savefile/F = new(ckey)
Write(F)
usr << "Saved"
Load()
if(usr.saved)
var/savefile/F = new(ckey)
Read(F)
usr << "Loaded"
else
usr << "No Save File"

Write(savefile/F)
F["last_x"] << x
F["last_y"] << y
F["last_x"] << z

Read(savefile/F)
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_x"] >> last_z
src.loc=locate(last_x,last_y,last_z)






Like..

mob
Start
icon='enemy.dmi'
icon_state="eval"
verb
Speak()
set category = "Main"
set src in oview(1)
switch(input("new or load?") in list("New","Load"))
if("Load")
etc. etc.


or..

Load
icon = 'load.bmp'
layer = 99
Click()
if(usr.saved)
var/savefile/F = new(ckey)
Read(F)
usr << "Loaded"
else
usr << "No Save File"

Etc.

Ive tried these both on my own and they dont work..
I can get it to save just fine, using a Verb..
but i want Load on a splash screen, or a mob saying it.

Thanks!
-Cait

</<></<></<>
....bump o_O
Mashed_The_Hamster wrote:
How do i change this into a Click() or something a mob says?

No idea what you mean by that. Could you clarify?

Lummox JR
In response to Lummox JR
UMmmmm..

Like..
This is what i have Right NOW.

How can i incorperate that code i pasted up THERE.
so it is .. in a clickable turf or obj?


Turf
Load
icon = 'Load.bmp'
layer = 99
Click()
if(fexists("players/[usr.ckey].sav"))
var/savefile/F = new("players/[usr.ckey].sav")//this defines the F as a save file in the players directory
var/X
var/Y
var/Z
F["color"] >> usr.color
F["marry"] >> usr.marry
F["name"] >> usr.name
F["icon"] >> usr.icon
F["level"] >> usr.level
F["exp"] >> usr.exp
F["maxexp"] >> usr.maxexp
F["maxhealth"] >> usr.maxhealth
F["health"] >> usr.health
F["X"] >> X//this outputs the X var which we will put into the F later on
F["Y"] >> Y//same as X
F["Z"] >> Z//same as X/Y
usr.loc = locate(X,Y,Z)//locates the user to teh saved x/y/z
usr << sound('main.mid',repeat=1)
usr <<"Loaded!"
else
alert("You don't have a save state =)")
return ..()
..()
..()
New
icon = 'New.bmp'
layer = 99
Click()
usr.name = input("Choose a name for your character.",
"Your Name",
usr.name)
usr.icon='newall.dmi'
etc.