GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TheVulcoreTeam/Persistence: Addon to store data in text or encrypted files, in Godot Engine 4, in an easy way.

BranchesTags
Open more actions menu

Latest commit

 

History

47 Commits
47 Commits

Folders and files

NameName
Last commit message
Last commit date
addons
addons
 
 
examples
examples
 
 
images
images
 
 
tests/unit
tests/unit
 
 
.gitignore
.gitignore
 
 
.gut_editor_config.json
.gut_editor_config.json
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
project.godot
project.godot
 
 

Repository files navigation

Hardisk

Persistence Node

Addon to store data in text or encrypted files, in Godot Engine 4, in an easy way.

Usage Example

Branchs

  • main: Default development branch for Godot 4.x
  • for-godot-3.0: Branch for Godot 3.x
  • for-godot-2.1: Branch for Godot 2.x

Installation

  1. Download the last release from your Godot Version
  2. Extract the folder downloaded
  3. Coppy the addon folder to the root directory of your game, for example: ./my-game/addons
  4. (OPTIONAL) if you are using another addons you can move only the folder persistence_node to ./my-game/addons/
  5. Active de addon in project -> project settings -> addons -> Peristence Node (enable)
  6. And that, follow the explanation ;-)

Explanation

The persistence node consists of obtaining the data and storing it in persistent memory when needed.

To obtain the data we use our custom node Persistence. data is a property of Persistence node you can get that data and write de dictionary. Remember that dictionaries are passed by reference, so if you completely overwrite the dictionary, the rest of the data will be deleted.

  • BAD:

$MyPersistenceNode.data = { "new dictionary" : "something" }

  • RECOMENDED:

$MyPersistenceNode.data["something"] = "data here"

In the line marked as BAD the dictionary is being overwritten, which deletes all the data in the dictionary and only adds the new dictionary. It is not recommended for use.

On the other hand, the line marked as RECOMENDED only adds a new key/value pair.

Properties and Functions

Properties Usage
data (Only Read) You can access the data and then save it in this way $MyPersistenceNode.data
Functions Usage
save() Stores data in persistent memory, stores the data in persistent memory, in a json file, or in an encrypted binary file.
delete_file() Delete current file.

Inspector

Inspector

  • Folder Name: Is the name of the folder in which we want to store the information.
  • File Name: It is the name of the file in which we want to save the information. If you want to save information in more than one file, it is recommended to create more than one persistence node and change the file name (this property).
  • Extention Env Production: (Extension for the production environment) normally we want it to be a binary in production mode (when we launch the game). The extension can be changed but the file will be binary and encrypted with a password, the password must be placed in Password Env Production.
  • Extention Env Development: Normally we want it to be a JSON for the production environment as we can read the data easier and debug.
  • Password Env Production: This is the password that is necessary to encrypt the data so that it cannot be read by anyone, it is important to fill in this information. Before releasing the game to production.
  • Mode: Current node mode, normally the development environment is used when coding and should be switched to production when the game is released.
  • Store Objects: Ability to store objects activated, yes or no.
  • Warnings: Is used to display warnings during the development of this plugin, it can also be useful in case of an unexpected error.

Recomendations

  • Use the save() function only when necessary, since it accesses persistent memory and this is slower than accessing volatile memory such as RAM.
    • BAD: Use save() every time a bullet is fired in the game, to store at each moment the information of the number of bullets the player has.
    • GOOD: Use save() when exiting the game or the main game screen.
  • Use a persistence node for each file that is created.

Tutorial (In Spanish)

  • Godot Addons : Persistence Node 2024

About

Addon to store data in text or encrypted files, in Godot Engine 4, in an easy way.

Topics

addonsgdscriptgodotgodot-addongodot-engine

Resources

Readme
MIT license
Activity
Custom properties

Stars

55 stars

Watchers

4 watching

Forks

5 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.