update_database_entry
Partially update any RPG Maker database entry by overwriting specific fields, with special append methods for common events and troops. Fetch current values first to enable safe reverts.
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 |
|---|---|---|---|
| entity | Yes | Which database contains the entry | |
| id | Yes | ID of the entry to modify (must exist; find it with query_database) | |
| fields | No | Subset of properties to overwrite, e.g. {"name": "Hero", "price": 250}. Not needed when using appendCommand/addEnemyId | |
| 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 | |
| addEnemyId | No | troops only: enemy ID to append as a new member at an auto-computed screen position |