20,741
edits
m (add to examples) |
m (https://forum.flightgear.org/viewtopic.php?f=6&p=359868#p359868) |
||
Line 1: | Line 1: | ||
{{Stub}} | {{Stub}} | ||
== Objective == | |||
Demonstrate how to save/load a Nasal hash with variables for serialization/persistence purposes | |||
== Background == | |||
It is pretty common for more sophisticated Nasal scripts (or even Addons) to have some configuration values, i.e. default values and custom settings/configuration | |||
== Problem == | |||
Conceiving a custom file format and implementing a custom parser can quickly become tedious and redundant. | |||
== Approach == | |||
Thus, we will be using a Nasal hash that is treated like JSON and then use this to serialize/unserialize the data as needed | |||
== Implementation == | |||
Consider the following setup | Consider the following setup |