How do I get the world to restore automatically? Can you please tell me? It would be helpful.
ID:164489
![]() May 31 2007, 2:50 pm
|
|
I don't want my world to reboot, I already know how to do that, I want to know how to get my world to restore.
|
Chipster wrote:
I don't want my world to reboot, I already know how to do that, I want to know how to get my world to restore. ?? Repop() ?? |
A better way would be to add a proc to every atom you want to restore, and then call that proc when you need them restored. To keep the CPU hit down, you can restore only a certain number of objects at a time, say 100 per tick, until they are all restored. You could also break your world up, and only restore sections that have no players.
Basically, you'll want to reset all the variables for the object in the restore proc you write, including it's location, visibility, and anyting else that may have changed since the world was started.
Another way could use savefiles. Simply save every object you wanted to restore to a savefile when the world starts. You could even do this just once, if you don't expect the objects to change from game to game, and then add them to the zip file when you build your world. When you want to restore them, simply overwrite the objects with their default savefiles, and they should restore to that state.
There may be other methods you could try, but these three should get you started. Hope that helps!
~X