|
@@ -125,7 +125,8 @@ Saving and reading data
|
|
|
|
|
|
As covered in the :ref:`doc_filesystem` tutorial, we'll need to open a file
|
|
|
so we can write to it or read from it. Now that we have a way to
|
|
|
-call our groups and get their relevant data, let's use to_json() to
|
|
|
+call our groups and get their relevant data, let's use :ref:`to_json()
|
|
|
+<class_@GDScript_method_to_json>` to
|
|
|
convert it into an easily stored string and store them in a file. Doing
|
|
|
it this way ensures that each line is its own object, so we have an easy
|
|
|
way to pull the data out of the file as well.
|
|
@@ -303,6 +304,8 @@ customized based on the needs of the individual project.
|
|
|
Additionally, our implementation assumes no Persist objects are children of other
|
|
|
Persist objects. Otherwise, invalid paths would be created. To
|
|
|
accommodate nested Persist objects, consider saving objects in stages.
|
|
|
-Load parent objects first so they are available for the add_child()
|
|
|
+Load parent objects first so they are available for the :ref:`add_child()
|
|
|
+<class_node_method_add_child>`
|
|
|
call when child objects are loaded. You will also need a way to link
|
|
|
-children to parents as the NodePath will likely be invalid.
|
|
|
+children to parents as the :ref:`NodePath
|
|
|
+<class_nodepath>` will likely be invalid.
|