Skip to content

Structured Data

Structured Data items store JSON tables (configs, catalogs, localization, spawn tables, and so on). Create them in the Project view (or import a .json file); edit the body in the Code editor.

Project-linked data

On the Project item, under Structured Data, add entries that link a Structured Data item. Linked items load with the project and appear under Loaded code in the Code editor.

Each entry needs a Name (required). Leaving Name empty when linking defaults it to the item name. That Name is what scripts use:

local Data = require 'engine/datasets'

local levels = Data.levels          -- or Data.get("levels")
local all = levels:getData()        -- full parsed JSON
local first = levels:getData("0.id") -- optional dot path

You can still load by path with Loader.loadStructuredData when the item is not on the project list.