The Selected Data feature can be used for all kinds of custom systems.
Selected data is available in the event system and formulas. Formulas originally called by events – either directly or through a battle action, e.g. formulas used by an ability that’s calculated from a battle event – will share the selected data with the event.
Selected data could be anything, e.g.:
- a game object or multiple game objects
- a combatant or multiple combatants
- an ability or multiple abilities
- a weapon/armor or multiple weapons/armors
- an item or multiple items
- a combination of different things, e.g. a combatant and 2 items
You can keep track of different selected data by using different Selected Keys to identify them.
The selected key equipment holds all equipment of a combatant, while the selected key abilities holds all abilities of another combatant.
You can see an example use case for the selected data feature in this gameplay tutorial.
Data is selected through the Selected Data steps in the event system (Add > Event > Selected Data) and formulas (Add > Selected Data).
There are different steps to select different kinds of data, e.g. game objects, combatants or the current equipment of a combatant. Some steps also allow creating new data instead of using data from an existing source, e.g. the Select Item step can select items from a combatants inventory or create new instances of defined items.
Using selected data
Selected data can be used in various other steps in the event system and formulas. E.g. the Add To Inventory step can optionally use items and equipment stored in selected data and add them to a combatant’s inventory.
The Selected variable origin in events and formulas allows using game variables attached to the selected data (e.g. Object Variables attached to game objects or combatants, ability/item/equipment variables attached to abilities, items or equipment).
Additionally, object selection fields in events can use game objects stored in selected data. Game objects can come from game objects directly, or be the game objects of combatants.
This can be used to e.g. add all float variables damageBonus attached to a combatant’s equipment to a damage formula’s result.
Special selected keys
Battle events and formulas used by abilities and items will automatically add the ability/item with the selected key action to the selected data.
Through this, you can always use or change variables attached to the ability/item that is used by their battle events or formulas (e.g. damage formulas or hit chances).
An ability’s battle event increases a float variable useCount by 1 each time the ability is used.
The ability’s damage formula (target status changes) adds the useCount variable to the formula’s result to give bonus damage depending on how often the ability is used.