update_database_entry
Partially update an RPG Maker database entry: overwrite specified fields, or append event commands, enemies, or battle pages. Fails if the ID doesn't exist.
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; troops + addPage inserts one battle-event page from a compact trigger. Troops and animations also support plain fields updates now (e.g. rename a troop, replace its members/pages, or relabel an animation). 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/addPage | |
| addPage | No | troops only: append a battle-event page without resending the others. when (at least one, ANDed): turn [a, b] = turn a + b*X (b 0: only turn a); enemyHpBelow [troopSlot from 0, pct]; actorHpBelow [actorId, pct]; switchId; turnEnd true. span battle|turn|moment (default battle). commands: event commands, e.g. from build_event_commands. position: page index to insert at. | |
| 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 |