-
Notifications
You must be signed in to change notification settings - Fork 39
Storage
Database file for engine global variables. See an example. This json file contains an object that contains user-defined variables that control the state of the game. Location: assets\dbs\storage_db.json
.
Storage values (engine global variables) is a feature that allows controlling the states of your game. Whenever a map is changed, all the things that happened or were done in this map are reset, unless you hold some information that you want to be persistent. For example, if you open a chest and get an item, you want that chest to never be closed anymore, it means you want it to be opened and empty even if the hero change maps. For this, you need a storage value for holding this info. Let's suppose you have a chest in Madra, then you create a storage value called, for example, chest_in_madra
of string type with value closed
. Then you tie the chest sprite key to this variable, so whenever the map is mounted, the engine will look for the value of chest_in_madra
to choose the corresponding sprite of the chest. So when you first interact with the chest, you set the value of chest_in_madra
to open
after getting the item, then every time you reach this map again, you'll see the chest open.
This file must contain an object. Example:
{
"value_1_key_name": 123,
"value_2_key_name": "abcd",
"value_3_key_name": true,
"value_4_key_name": {"x": 21, "y": 44},
}
Storage values can only be one of the types: string
, boolean
, number
, or an object designating a position like this: {"x": 10, "y": 22.5}
.
When using storage keys to build maps and events, you can reference a boolean variable prepending a not:
on its name in order to retrieve the inverted value of it. Example: not:value_3_key_name
.
- Home
- Introduction for developers
- Tutorials
- Game initialization settings
- Map settings
-
Game Events
- Add item to party event
- Audio play event
- Battle event
- Branch event
- Camera fade event
- Camera follow event
- Camera move event
- Camera shake event
- Casting aura event
- Change collision layer event
- Char animation play event
- Char blend mode event
- Char exp event
- Char fall event
- Char hue event
- Char item manipulation event
- Char level change event
- Char rotation event
- Char shadow visibility event
- Char tween position event
- Chest event
- Colorize char event
- Colorize map event
- Control bgm event
- Create storage var event
- Custom collision body event
- Destroyer event
- Dialog event
- Djinn get event
- Djinn set status event
- Emoticon event
- Event activation event
- Event caller event
- Event holder event
- Event loop event
- Exit Sand mode event
- Face direction event
- Flame char event
- Generic sprite event
- Grant ability event
- IO anim play event
- IO tween position event
- Item checks event
- Jump event
- Layer tween event
- Layer visibility event
- Look event
- Main chars join split event
- Map blend mode event
- Map opacity event
- Move event
- Outline char event
- Particles event
- Party join event
- Permanent status event
- Psynergy stone event
- Set char activation event
- Set char collision event
- Set char visibility event
- Set IO activation event
- Set IO collision event
- Set IO visibility event
- Set NPC collision event
- Set party coins event
- Set value event
- Storage change event
- Summon event
- Teleport event
- Tile event manage event
- Timer event
- Tint char event
- Databases
- Code reference