0 votes

I am making a game in which there are items, and in order to make it simpler to develop I made a plugin for creating items, in which you give it a name, description, and image, and then assign it an ID, which you can pass to different objects in the world as a reference to an object with that name, description, and image (I have an item.gd script so I can have things like var item = preload("res://item.gd").new(image, title, description))

My current approach is basically creating a dictionary containing the IDs as keys for the actual item reference, the problem of course is that I want it to be permanent even when you close the editor or game. How can I do that? (Hopefully I don't need to save the items as files for later access).

Thanks in advance.

asked Jul 21, 2018 in Engine by PugMasterPug (110 points)

1 Answer

+2 votes

When you close the game, it leaves the computer's memory. If you need data to persist after quitting the game, you must save the data to a file, then read that data when the game is next run.

See http://docs.godotengine.org/en/latest/tutorials/io/saving_games.html for information.

answered Jul 21, 2018 by kidscancode (10,212 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.