Data Assets
Data Assets keep reusable values in project files. Use them for items, locations, character details or any other information several scripts need to share.
Create a Data Asset
In the Content Browser, choose Add → Data Asset and name the file. Open it to add variables. A Data Asset can hold ordinary values as well as arrays, maps and references to media, characters and other Data Assets. Save the file when you finish editing it.
Keep related assets together. For example, a Weapon asset can define shared values such as Damage and Description while Iron Sword and Silver Sword supply their own values.
Variable Descriptions
Hover a variable row and choose Add description, or click an existing description to edit it. Press Enter or click away to save the description; Escape cancels the edit. Descriptions support Undo and Redo and do not change the variable's value.
Edit an inherited description in the parent file where the variable was defined. Children display that description alongside the inherited variable. The same controls are available in character files.
Inheritance and Overrides
A Data Asset can have a parent. It inherits the parent's variables and uses the closest value in its family unless you override it on the child. Changing a shared value on the parent then updates children that have not overridden that value.
- Own value: A variable defined on the asset you are editing.
- Inherited value: A variable supplied by a parent farther up the family.
- Override: A child's value that takes precedence over an inherited value.
Start with a Parent
Define common variables once on a parent, then create children for the differences. You can inspect the resolved result before using an asset in a story.
Table Viewer
Right-click a Data Asset in the Content Browser and choose Open table to compare its family in the Table Viewer. It shows the values each asset will provide, including inherited values and overrides. You can edit cells, filter and find values, use Find and Replace and adjust the table zoom. The single-asset editor is useful when you want to focus on one file.
Characters have their own table view with the same family idea. See Characters for character-specific fields and behavior.
Use Data Assets in Scripts
Drag a Data Asset from the Content Browser onto a script canvas or a User Interface script canvas. This creates a Get Data Asset reference for that file. Drag from its output to choose a variable read, a variable write or Get Variable Names. The reference keeps the accessors connected to the asset you selected.
- Create a Data Asset named Iron Sword and give it a Damage variable.
- Drag the asset onto a script canvas.
- Drag from the Get Data Asset output and choose Get Damage to use the resolved value, or Set Damage to change it during play.
Accessors can also work with array and map values. Get Variable Names returns the names available on the asset, including inherited variables. See Node Types and UI Scripting for where each node appears.
Data Reference Variables
Choose Data when creating a variable, then select a Data Asset as its value. A Data variable stores a reference to the asset, so you can change which item or quest a script is working with during play. It can be local or global in a script, local to an interface or a field on a character or another Data Asset. Data arrays and Data map values can hold collections of references.
A Get Data Asset node selects a fixed asset. A Data variable's Get and Set nodes instead read or change the selected reference. Connect the reference to an asset variable accessor to read or change a field on the selected asset. Renaming or moving the asset file preserves the reference. Data variables select Data Assets; use the Character type for character files.
Dialogue and Interface Values
Give a script a Data variable named Sword, select a weapon asset and use {Sword.Damage} in dialogue, options or text blocks. Paths can continue through Data or Character fields, such as {Quest.RewardItem.Name}. They read the current values, including inheritance and changes made during play. See Nested Character and Data References for supported values and naming rules.
In the UI Designer, use an element's bind button to select a compatible field from a character or Data Asset. For example, bind a price Text element directly to a weapon's Cost. Bindings use the selected asset and field, including inherited fields. Editable controls write back during play, and On Variable Changed can respond to field changes. See Binding Elements to Variables and UI Scripting.
Values During Play
A read starts with the asset's own value, then follows its parents until it finds a value. A script write changes the running game's value. It does not rewrite the Data Asset file in your project. StoryFlow Editor keeps those changes with the running state, and the Save System includes them in a save slot.
The Runtime Debugger has a Data Asset view so you can inspect values while testing. This is useful when an inherited value or a script write produces an unexpected result.
Import and Export
The Table Viewer supports CSV import and export for editing a family in a spreadsheet. Keep the exported row and column headers intact so the import can match each value to the right asset and variable. Import updates existing cells; it does not create assets or variables.
Arrays and maps appear in the CSV for reference, but changes to those cells cannot be imported. Edit them in the editor. Before applying an import, review the count of changed cells and any skipped entries. One Undo reverses the whole import.
You can also export the table as JSON for use in other tools. That export keeps arrays and maps as structured values. The Table Viewer's Import button reads CSV only.
A project JSON export includes readable Data Assets in data-assets.json, including parent relationships and referenced media. The Unity, Unreal Engine and Godot plugins can load that data with the rest of the project.
Project Files and Play Values
Editing a Data Asset changes its project file. Setting a value from a running script changes the current play session. Save the game if players should be able to return to that changed value later.