ID:156224
Dec 3 2010, 5:32 pm
|
|
For my game, a player can successfully buy a house. Now, I'm trying to add editable furniture. How do I make a saving script that saves where the furniture is placed when a reboot is executed, so that when the reboot is done, the furniture is still there?
|
In response to Hashir
|
|
Never EVER call write like that, it will bug the "Read".
|
In response to Hashir
|
|
@ Hashir :
That doesn't help the OP, for the most part. You don't generally want to use Write() and Read(), and instead << the variables/objects. @ Colin1011 : What you'll most likely want to do is loop through the objects and add them to a list so that you can save the list like so: obj/furniture |
In response to Maximus_Alex2003
|
|
They still just disappear... this is where I call those procs you wrote up.
mob and Logout() |
In response to Colin1011
|
|
You've given us no background on how furniture actually exists in your game, so it's pretty hard to say where the problem is.
|
In response to Colin1011
|
|
Those procedures weren't /mob related, since /mob is terrible to base procedures with, since they aren't players. Plus, you specifically asked for when the world is rebooted, hence why they are global procedures.
|
In response to Pirion
|
|
Pirion wrote:
Never EVER call write like that, it will bug the "Read". How do you call it? |
In response to Falacy
|
|
savefile operator <<
F << Val F["Path"] << Val |
In response to Pirion
|
|
That doesn't really have anything to do with Read or Write, that's a method for more manually saving things
|
In response to Falacy
|
|
Calling Read() and Write() directly can result in mangled savefiles in certain circumstances. >> and << cannot.
|
Then whenever you need to load it, put Read code in a reboot or anywhere else you want to, so that it can be loaded.