0 votes

Hi, im trying to make a save/load menu for my game.
For example, im in the current level, press ctrl+s to save and then pops up a menu with multiple slots (you can choose in which one u want to save it), how can I get the path of the current level ?

Idk how to post the image directly here, im sorry

https://imgur.com/gallery/pYJNycK

Godot version 3.3.2
in Engine by (19 points)
get_tree.current_scene.filename

To get the path of the current scene.
If you want to access previous scenes, everytime you save a scene, save the filename of that scene to a list or dictionary. And then you can access it through the list/dictionary.

1 Answer

0 votes

You'll probably want to take a look both into the Saving Games doc:
https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html

And PackedScenes:
https://docs.godotengine.org/en/stable/classes/class_packedscene.html

The latter is what you'll need to save the scene "as is".
Similar question: https://godotengine.org/qa/903/how-to-save-a-scene-at-run-time

by (292 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.