data_table
Author and inspect Data Table rows: describe the row struct, list, add, set, and remove rows.
What it's for
A Data Table is a spreadsheet-style asset: every row is an instance of one row struct, keyed by a row name. This namespace lets your assistant read and edit that content as plain JSON, so you can manage game data (loot tables, ability stats, dialogue lines, tuning curves) by describing the change in words instead of clicking through the Data Table editor.
The read side reports the table's row struct, the row count, and the rows themselves in the same
shape as a data_table.json asset dump, so your assistant can see exactly what fields
exist and what values are set before it touches anything. The write side covers the full lifecycle
of a row: add a new one, overwrite an existing one, or remove one, passing field values as a JSON
object that is converted into the row struct.
There is also an operation to rebind the whole table to a different row struct. That one is destructive: it drops every existing row, so it requires an explicit force flag when the table is not empty. Reach for it only when you are changing the table's schema, not its data.
Examples
See what a table holds before editing
Your assistant reads the row struct and current rows first, so its edits match the fields that actually exist.
You: What rows are in DT_WeaponStats right now?
call("data_table.list_rows", {assetPath:"/Game/Data/DT_WeaponStats"})
→ {rowStruct:"WeaponStatRow", rowCount:2,
rows:{Pistol:{Damage:12, FireRate:0.4}, Rifle:{Damage:30, FireRate:0.1}}}
Done. Two rows: Pistol and Rifle, on the WeaponStatRow struct.
Add a new row
Give the row a name and its field values as JSON; it errors if that row name already exists.
You: Add a Shotgun to DT_WeaponStats: 45 damage, 0.8 fire rate.
call("data_table.add_row", {assetPath:"/Game/Data/DT_WeaponStats",
rowName:"Shotgun", values:{Damage:45, FireRate:0.8}})
→ {ok:true}
Done. Added row Shotgun to DT_WeaponStats.
Update a row, creating it if needed
Overwrite an existing row's values, and fall back to add-row behavior when the row is missing.
You: Set Rifle damage to 34 in DT_WeaponStats, and create the row if it's gone.
call("data_table.set_row", {assetPath:"/Game/Data/DT_WeaponStats",
rowName:"Rifle", values:{Damage:34, FireRate:0.1}, createIfMissing:true})
→ {ok:true}
Done. Rifle now deals 34 damage.