SeceneSaver?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By genete
:warning: Old Version Published before Godot 3 was released.

According to the Node.set_owner() documentation:

When saving a node (using SceneSaver) all the nodes it owns will be saved with it

Does SceneSaver exists or should we use the method the documentation explains to load and save games?

Looks like SceneSaver is now ResourceSaver

Bojidar Marinov | 2016-05-08 08:34

:bust_in_silhouette: Reply From: volzhs

SceneSaver seems no longer exists.
To load and save game, it’s better to follow that instruction as you said.
http://docs.godotengine.org/en/latest/tutorials/engine/saving_games.html

I don’t know what you really want for saving game,
you can also use File.get_var() / File.store_var() for loading and saving game data.

:bust_in_silhouette: Reply From: volzhs

After a few test, I found a way to save a node to scn

var scene = PackedScene.new()
var result = scene.pack(child)
if result == OK:
    ResourceSaver.save("res://path/name.scn", scene) // or user://...

I think this will save current node status to scn file,
and probably reconstruct all when load.

Yes :slight_smile:
This is what I used a while ago to generate a lot of sprite nodes out of a tilesheet.

Hinsbart | 2016-05-07 17:12

Interesting. PackedScene documentation brings to other new resource to me: SceneState which shows when reading his members what’s saved with he scene:

  • Nodes count
  • Node type, name, path by node index
  • Whether node is a placeholder and its instance
  • Nodes groups
  • Nodes properties
  • Nodes connections and signals (methods and flags)

Fantastic!

genete | 2016-05-08 16:38

and the “res://path/name.scn”, scene) // or user:// is loaded when you load your game? or how does it works?

Themaker482 | 2016-06-07 21:22