How do I show a scene the way the player left it?

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

I am working on an rpg game and I want the player to affect a scene by taking objects or other things then leave the scene and come back and find the scene as he/she left it.

How do I save the state of a scene so that the player can come back to it?

:bust_in_silhouette: Reply From: Zylann

You can either:

  1. Save the state of the scene you left, in a global node for example, that you would save in a file to be sure it gets remembered when you restart the game (which you will have to do anyways if you want that to happen), and restore it when it gets loaded again, with some scrips reading the data you saved and setting the variables and states and visible/invisible stuf that you changed.

  2. Don’t destroy the scene you left, just hide it / make it inactive somehow, so when you come back it actually is the way you left it. However if you want this to persist between two sessions, you do still need to save those states in a file (which is another matter already covered by other questions on this website :wink: )

You can mix the two approaches, details of how you do it depends on your game.

Thank you that helped a lot.

DanielS559 | 2017-08-26 02:56