ID:149763
 
i can save my characters status but i can't save the map so whatever i do w/ GM powers (build, delete) doesn't get saved. can someone tell me what is wrong my save code looks like this....

Write(savefile/F)
// This is sample code that keeps track of the player's last position on the map.
// Their last position is stored when the mob is saved, then reinstated when the mob
// is read in.

// First, call the default Write() behavior for mobs.
..()

// Now, if we have a map, remember their last location.
if (world.maxx)
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
// Call the default Read() behavior for mobs.
..()

// Now, if we have a map, put them back on the map in their last location.
if (world.maxx)
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)


mob/verb/Save()
var/savefile/F = new("[usr.ckey].sav")
Write (F)
usr<<"You have been saved!"
mob/verb/Load()
var/savefile/F = new("[usr.ckey].sav")
Read(F)
usr<<"You have been Loaded!"
</<></<></<>
the code that you just showed does not save changes you might make to the map. it will only save changes to the character that you are playing as. if you want to save all the changes that you might make to the map with your gm powers that would require a lot more code. my personal fealing, if you are making an average rpg (which it appears you are), making a save file to save every change you make to the map while in the game isnt worth it. unless for some reason your game needs to save those changes its a lot of hassel to make a saving code for the entire map for what little it does.
In response to Loduwijk
oops, sorry bout that, i didnt mean to post twice
In response to Loduwijk
That's what the delete button is for!
In response to Loduwijk
There is a demo on saving the .dmp files made by Gazoot which can be found here. the only problem is is that it is invitation only and it says he is looking for ppl with bigger ever changing worlds, but who knows.
so does anyone know any code that would let me save anything because i want to be able to save these kinds of changes. Also if anyone knows a code that would allow the person to load and create a char at the beginning screen instead of in the game that would also help me a lot
In response to Nadrew
there is a button that lets u delete your posts? i dont see one anywhere, where is it?
In response to Loduwijk
It's next to reply, and edit button (you can only delete it if no one has replied to it).
In response to Alienman22774
when u say in game saving, i will assume you mean you have a verb that saves your game. if u want to make it load at startup instead, then just put in inside login. like this:

mob/Login
//your loading code here
..()

hope i helped. (if u want to make it save at logout then just put your saving code inside logout the same way, hope that was helpful too)
In response to Nadrew
What i want is to have the code work that when u log in it asks what u want to do (create new char, delete char, or continue a already saved char) i can't get that to work i've use several demos but none of them work its poping up w/ 100 or more errors. and i want to to save the Map and character info when u log out. can someone tell me a code or give me a link to a demo that might work for me???
In response to Alienman22774
I see what you want. I think you should keep the Save Character Script, and use a seperate world saving script. Also, it might be a better idea to have it:
world/New()
spawn(20000)
DoWorldSave()


And have it save every oh, 20, and have an Admin verb that would let you save whenever (Say near shutdown)

This has been posted before, and the best idea I've gotten is:
1) Save only tiles that have been modified
OR
2) Leave out a common tile, such as grass, and save the rest
In response to Nova2000
i tryed ur code but it didn't work
In response to Alienman22774
Alienman22774 wrote:
so does anyone know any code that would let me save anything because i want to be able to save these kinds of changes. Also if anyone knows a code that would allow the person to load and create a char at the beginning screen instead of in the game that would also help me a lot

Get the Blue Book, it covers file saving schemes, and you can come up with your own code if you study it and play with it. That what I plan on doing right now as I need to save certain areas in my game's map.

LJR
In response to Alienman22774
Alienman22774 wrote:
What i want is to have the code work that when u log in it asks what u want to do (create new char, delete char, or continue a already saved char) i can't get that to work i've use several demos but none of them work its poping up w/ 100 or more errors. and i want to to save the Map and character info when u log out. can someone tell me a code or give me a link to a demo that might work for me???

For future reference, stop calling it a code, like your playing a nintendo game, need a code to unlock some part of the game.

LJR
In response to Alienman22774
Yeah, you have to create the procedure to save the world... but I'm not even sure if New() under World will work. That was just an idea of how to start the code.