Edit of asset "Text Database" Accepted

Old/Current New/Edit
Title Text Database Text Database
Description Advanced loader for text data files (JSON, CFG). It can load your files and perform a complex data validation. If you like keeping your data in text files, this will be useful as it ensures that your data is correct, i.e. without typos.

Data collections in TextDatabase are arrays of dictionaries. You can e.g. store items, enemy data, or level metadata etc. in a JSON or CFG files, where each item/enemy/level/etc is a Dictionary with some properties. You can define fields for your data, which can be either mandatory, or just allowed, and the loader will ensure that your fields are correct.

Example usage:
var database = TextDatabase.new()
database.add_mandatory_property("price")
database.add_valid_property("attack")
database.load("res://items.json)
var data = database.get_array()

Example valid file:
[
{
"name": "Sword",
"price": 100,
"attack": 5
}
]

Example invalid file:
[
{
"name": "Shield",
"defense": 1
}
]
It's missing "price" and "defense" is not a defined property, so the file won't load. You can catch errors like this, so you can avoid unexpected behaviors due to data typos.

btw, ConfigFiles (CFG) are much better than JSON. Here's the Sword example as CFG:
[Sword]
price = 100
attack = 5

You can store multiple items in one file and load multiple files into database. Just use load() multiple times on one database and then get_array() will return data from all files. Or you can use get_dictionary() instead and access the entries by name.

Explaining all functionality would be very long, so just read the README, which you can find in the asset's repository (: You can also find an example project in there.
Advanced loader for text data files (JSON, CFG). It can load your files and perform a complex data validation. If you like keeping your data in text files, this will be useful as it ensures that your data is correct, i.e. without typos.

Data collections in TextDatabase are arrays of dictionaries. You can e.g. store items, enemy data, or level metadata etc. in a JSON or CFG files, where each item/enemy/level/etc is a Dictionary with some properties. You can define fields for your data, which can be either mandatory, or just allowed, and the loader will ensure that your fields are correct.

Example usage:
var database = TextDatabase.new()
database.add_mandatory_property("price")
database.add_valid_property("attack")
database.load("res://items.json)
var data = database.get_array()

Example valid file:
[
{
"name": "Sword",
"price": 100,
"attack": 5
}
]

Example invalid file:
[
{
"name": "Shield",
"defense": 1
}
]
It's missing "price" and "defense" is not a defined property, so the file won't load. You can catch errors like this, so you can avoid unexpected behaviors due to data typos.

btw, ConfigFiles (CFG) are much better than JSON. Here's the Sword example as CFG:
[Sword]
price = 100
attack = 5

You can store multiple items in one file and load multiple files into database. Just use load() multiple times on one database and then get_array() will return data from all files. Or you can use get_dictionary() instead and access the entries by name.

Explaining all functionality would be very long, so just read the README, which you can find in the asset's repository (: You can also find an example project in there.
Category Scripts Scripts
License MIT MIT
Repository Provider GitHub GitHub
Repository Url https://github.com/KoBeWi/Godot-Text-Database https://github.com/KoBeWi/Godot-Text-Database
Issues Url https://github.com/KoBeWi/Godot-Text-Database/issues https://github.com/KoBeWi/Godot-Text-Database/issues
Godot version Godot 3.4 Godot 3.4
Version String 1.0 1.0
Download Commit 19d9065b52607ea338e97443d545c919bc78ffcd 19d9065b52607ea338e97443d545c919bc78ffcd
Download Url (Computed) https://github.com/KoBeWi/Godot-Text-Database/archive/19d9065b52607ea338e97443d545c919bc78ffcd.zip https://github.com/KoBeWi/Godot-Text-Database/archive/19d9065b52607ea338e97443d545c919bc78ffcd.zip
Icon Url https://raw.githubusercontent.com/KoBeWi/Godot-Text-Database/master/Media/Icon.png
https://raw.githubusercontent.com/KoBeWi/Godot-Text-Database/master/Media/Icon.png