Changes

Jump to navigation Jump to search
Line 107: Line 107:  
There is also a '''LoadMode''' parameter, which tells you whether it was a full save, a build mode save or a company save (Usually used when the player is moving to another map or during multiplayer synchronization), which will allow you to only save data needed for each type. E.g. you probably don't have to save player preferences for a build mode save.
 
There is also a '''LoadMode''' parameter, which tells you whether it was a full save, a build mode save or a company save (Usually used when the player is moving to another map or during multiplayer synchronization), which will allow you to only save data needed for each type. E.g. you probably don't have to save player preferences for a build mode save.
   −
You can also override the serialization methods in the ModMeta class to take complete control of saving data. Returning null will make the mod not save any data. To help you with serializing data from your ModBehaviours, the ModMeta class has a '''ModBehaviours''' list of all active ModBehaviours that were creating when the mod was first loaded. However the default behaviour is to just call Serialize and Deserialize on your ModBehaviours in turn and check if they saved any data.
+
You can also override the serialization methods in the ModMeta class to take complete control of saving data. Returning null will make the mod not save any data. To help you with serializing data from your ModBehaviours, the ModMeta class has a '''ModBehaviours''' list of all active ModBehaviours that were creating when the mod was first loaded. However, the default behaviour is to just call Serialize and Deserialize on your ModBehaviours in turn and check if they saved any data, so just leaving it as is will work in most cases.
    
Note that your the save data is identified by the Name you've set in the ModMeta class. If you change this name, it will no longer be able to find the correct data from older saves and name clashes will result in data loss.
 
Note that your the save data is identified by the Name you've set in the ModMeta class. If you change this name, it will no longer be able to find the correct data from older saves and name clashes will result in data loss.

Navigation menu