update_database_entry
Update an existing database entry by overwriting specified fields. Supports appending commands to common events or enemies to troops without providing fields.
Instructions
Partially update an existing database entry: only the keys in fields are overwritten (arrays like traits/learnings/actions are replaced wholesale, not merged); the data file is written immediately and there is no undo, so fetch current values with query_database first if you may revert. Returns the full entry after the update. Fails with an error if the ID does not exist. Special append forms that do not need fields: common_events + appendCommand inserts one event command before the list terminator; troops + addEnemyId adds a member at an auto-computed battle position. Plain troop updates and animations are not supported. Class params in fields accept 8 seeds (expanded to full curves) or 8 arrays of 100 per-level values. Editing tilesets affects every map using them; malformed flags break passability project-wide.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the entry to modify (must exist; find it with query_database) | |
| entity | Yes | Which database contains the entry | |
| fields | No | Subset of properties to overwrite, e.g. {"name": "Hero", "price": 250}. Not needed when using appendCommand/addEnemyId | |
| addEnemyId | No | troops only: enemy ID to append as a new member at an auto-computed screen position | |
| appendCommand | No | common_events only: one event command {code, indent, parameters} appended before the terminator. Common codes: 101+401=Show Text, 121=Control Switches, 122=Control Variables |