About Store Forum Documentation Contact



Post Reply 
Save Area to World Folder
Author Message
Pherael Offline
Member

Post: #1
Save Area to World Folder
Hi,
Well this is basic, but I would be grateful for help.

How can I save area (in code). For example I made in game some changes in world and want save changes permanently.

I little confused:
World.save() save only curent state to specific file so I know is not the function I want.
I have inesis source code, so I know how to made it manualy. But this is too much work, when I almost sure that EE can do this for me.

There is function customSaveWant() in Area class, but I dont know how to use it. If I overwrite it so it return true, in what moment exacly it save area? Every frame? When Area is unloaded? It will save area to world folder as in discription or it will only call customSave()?
01-27-2015 04:24 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Save Area to World Folder
it will save when you call save or when you delete the world through .del() unless EE changed that.

Code:
virtual Bool customSaveWant(               ) {return false;} // you can override this method and return true, this will cause saving the full Area into the game world folder
set this to true


Code:
virtual void customSave    (ChunkWriter &cw) {             } // you can override this method and within save custom chunks of data, this method will be called only if 'customSaveWant' returned true

then add the custom things you want to save into the chunkwriter at &cw, in which case EE sends the chunkwriter it uses per area anyway.

the order of call is that EE saves its area and all its standard things like mesh, physics objects etc.
then it calls customSave(chunkwriter)
and then ends the chunkwriter.
(This post was last modified: 01-28-2015 02:42 PM by Zervox.)
01-28-2015 02:37 PM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #3
RE: Save Area to World Folder
Thanks Zervox smile
01-28-2015 05:08 PM
Find all posts by this user Quote this message in a reply
Post Reply