About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Saving/Loading custom world objects
Author Message
Rofar Offline
Member

Post: #1
Saving/Loading custom world objects
I have custom world objects based off of Game::Obj. When I save the world, the custom object class save(File &f) is not being called. Also the load method is not being called when loading a saved world.

I also have custom objects based off of Game::Static. For these objects, the extended save and load methods are called properly.

Anyone know a reason this might be happening? The custom objects do exist in the world after loading a saved version but the custom parameters are not being saved or loaded since my extended methods are not called.

I'll keep trying to find the problem.

[EDIT] It seems to be working now. I did a full rebuild of my code and re-built the world and now it works. Does Access type affect whether an object gets saved/loaded?
(This post was last modified: 01-31-2010 07:50 PM by Rofar.)
01-31-2010 07:42 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Saving/Loading custom world objects
yes, only Default access mode allows to use custom classess and custom io methods
01-31-2010 08:06 PM
Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #3
RE: Saving/Loading custom world objects
Ok, that was the issue then. So if you set it to constant then they do not save and load but just get discarded and then recreated when needed? So the create method gets called when the saved world is loaded? If that's the case, then I should be able to use constant and not worry about extending save and load because the custom parameters for these never change during runtime.
01-31-2010 08:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Saving/Loading custom world objects
yes, thats how Const works, you can just take care of 'create'
01-31-2010 08:42 PM
Find all posts by this user Quote this message in a reply
Post Reply