Jump to content

Add persistent data


Umbrella

Recommended Posts

Hello,

 

I would like to save extra information when a game is saved, and reconstruct it on loading.

 

Is there an obvious way to do so ? Maybe register a save/load callback to the GameManager, or overload the serialization mecanism ?

 

Thank you !

 

EDIT: I noticed cvar get saved, but is it the good way to go if I need a more complex object to persist ?

Link to comment
Share on other sites

Hello,

 

I would like to save extra information when a game is saved, and reconstruct it on loading.

 

Is there an obvious way to do so ? Maybe register a save/load callback to the GameManager, or overload the serialization mecanism ?

 

Thank you !

 

EDIT: I noticed cvar get saved, but is it the good way to go if I need a more complex object to persist ?

 

cvar is just a string and a float value. You can get quite clever with them. However, it's stored on a character, so it depends on your usage.

Link to comment
Share on other sites

Thank you Sphereii !

 

Reconstructing complex objects from key/values might be tedious, so I was hoping serialization could do the work for me.

 

As for usage, I was thinking of a more global object. Isn't there always a main character (server owner, map creator ... ) or game object (maybe the bedrock block at (0,0) ) guaranteed to be in game, on which I could attach "global" cvar ?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...