Serialisation – Arma Reforger
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "\{\{GameCategory\|armaR\|Modding\|(Guidelines|Tutorials)\|([^=↵]*)\}\}" to "{{GameCategory|armaR|Modding|$2|$1}}") |
||
(One intermediate revision by the same user not shown) | |||
Line 120: | Line 120: | ||
if (!context.IsValid()) | if (!context.IsValid()) | ||
return false; | return false; | ||
context.WriteValue("theString", m_sVariable); | context.WriteValue("theString", m_sVariable); | ||
context.WriteValue("integer", m_iVariable); | context.WriteValue("integer", m_iVariable); | ||
Line 155: | Line 155: | ||
{{GameCategory|armaR|Modding|Tutorials | {{GameCategory|armaR|Modding|Scripting|Tutorials}} |
Latest revision as of 13:32, 26 February 2025
This page explains serialisation using SCR_JsonSaveContext/SCR_JsonLoadContext and SCR_BinSaveContext/SCR_BinLoadContext.
JSON
Serialisation
Deserialisation
Binary
Serialisation
Deserialisation
Object Serialisation
Simple
The following class set to serialise will serialise all its properties.
NonSerialized
Adding the NonSerialized() decorator to a field will make the serialisation ignore it.
Advanced
The following methods allow to define a custom serialisation per class. This is useful to avoid saving lengthy yet useless information for loading as well as load values in a certain order.
SerializationSave
If an object has the SerializationSave method defined, the SaveContext will use it and not process object's properties automatically at all.
SerializationLoad
If an object has the SerializationLoad method defined, the SaveContext will use it and not process object's properties automatically at all.