build_event_commands
Create validated RPG Maker MV event-command fragments without files or a selected project; feed them to insert_event_commands or nest in choice/conditional builders.
Instructions
Build a validated RPG Maker MV event-command fragment without writing files or requiring a selected project. Returns {commands, warnings?}; feed commands to insert_event_commands, or nest them in a choice/conditional builder. kind selects the command; only fields belonging to that kind are accepted. Troop-only kinds: enemy_appear, change_enemy_state, abort_battle. Fragments omit the root end marker; complete branches include their required nested end markers. MV Show Text has four parameters (no MZ speakerName); plugin_command emits MV code 356, never MZ 357. IDs accept integers or whole decimal integer strings; constants accept finite numbers. Supported game references are checked when inserting into a project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| pan | No | ||
| fade | No | ||
| kind | Yes | ||
| name | No | control_switch self_switch: A-D; flow label/jump_to_label: label text; play_audio: file name without extension (empty stops the channel); show_picture: picture file. | |
| stat | No | change_actor: hp takes allowDeath; exp/level take showLevelUp; state takes stateId and remove. | |
| text | No | plugin_command: full MV command string, e.g. "DoorCtl open 1". | |
| wait | No | Wait for the effect, animation, balloon or move route to finish (move_route default true). | |
| wrap | No | show_text: true reflows all lines as one paragraph, "hard" keeps each line as a break; both split into 4-line boxes. Width ~55 chars, ~38 with a face. | |
| blend | No | ||
| color | No | ||
| endId | No | control_switch/control_variable: inclusive final ID; defaults to the starting ID. | |
| goods | No | shop_processing: goods in order; omit price to use the database price. | |
| lines | No | show_text: message lines. MV does not wrap; long lines are warned about unless wrap is set. | |
| mapId | No | ||
| pitch | No | ||
| power | No | ||
| scope | No | control_switch: switch requires switchId; self_switch requires name A-D. | |
| speed | No | ||
| steps | No | move_route: steps in order; times repeats one. toward/away are relative to the player. Parameters: jump x,y; wait frames; switch_on/off switchId; change_speed value 1-6; change_freq value 1-5; change_image name,index; change_opacity value 0-255; change_blend_mode value 0-3; play_se name,volume?,pitch?,pan?; script text. | |
| value | No | control_switch: default on. | |
| action | No | flow: wait requires frames; label/jump_to_label require name. | |
| amount | No | change_gold/change_items/change_actor hp|mp|exp|level: constant amount. Give amount or amountVariableId. | |
| effect | No | screen_effect. tint: color [r,g,b,gray] -255..255; flash: color [r,g,b,strength] 0..255; shake: power, speed 1-9. | |
| frames | No | ||
| indent | No | Base indentation, default 0. Nested branch bodies are rebased without mutating their inputs. | |
| itemId | No | ||
| origin | No | ||
| remove | No | change_party_member, change_actor state, change_enemy_state: remove instead of add. | |
| repeat | No | move_route: loop the route. Default false. | |
| scaleX | No | ||
| scaleY | No | ||
| volume | No | ||
| actorId | No | change_party_member/name_input: actor ID. change_actor: actor ID, 0 = entire party (or use actorVariableId). | |
| canLose | No | ||
| channel | No | play_audio. | |
| choices | No | ||
| opacity | No | ||
| operand | No | control_variable: {type:"constant",value}; {type:"variable",variableId}; {type:"random",min,max}; or {type:"game_data",dataType:0..7,param1?,param2?}. MZ game-data type 8 is rejected. | |
| stateId | No | ||
| troopId | No | battle_processing: give troopId, troopVariableId, or randomEncounter: true. | |
| branches | No | show_choices: one command fragment per choice. Omit for empty branches. | |
| decrease | No | Subtract instead of add. Default false. | |
| duration | No | screen_effect: frames, default 60. | |
| faceName | No | show_text: face image basename, default empty. | |
| itemType | No | change_items, default item. | |
| position | No | show_text: top/middle/bottom; show_choices: left/middle/right. | |
| switchId | No | ||
| balloonId | No | 1-15 as in the editor list (1 exclamation). | |
| canEscape | No | ||
| condition | No | conditional_branch: switch {type,switchId,value?}; self_switch {type,name,value?}; variable {type,variableId,comparison,constant? OR variableOperand?}; actor_in_party {type,actorId}; gold {type,gold,compare?}; item {type,itemId}. Only keys for the selected type are allowed. | |
| direction | No | ||
| faceIndex | No | show_text: face slot 0-7, default 0. | |
| maxLength | No | name_input: 1-16, default 8. | |
| operation | No | ||
| pictureId | No | show_picture/erase_picture: slot 1-100. | |
| skippable | No | move_route: skip a step that cannot be performed. Default false. | |
| winBranch | No | battle_processing: result branches, only when canEscape or canLose. | |
| wrapWidth | No | show_text: override the wrap width in characters. | |
| allowDeath | No | ||
| background | No | Text/choice window background. | |
| cancelType | No | show_choices: -1 disables cancel; -2 or choices.length selects the separate cancel branch; otherwise a zero-based choice index. | |
| elseBranch | No | ||
| enemyIndex | No | Troop slot from 0; change_enemy_state also accepts -1 for the entire troop. | |
| initialize | No | change_party_member: reset the actor when adding. | |
| loseBranch | No | ||
| thenBranch | No | ||
| variableId | No | ||
| animationId | No | ||
| characterId | No | show_animation/show_balloon/move_route: -1 player, 0 this event (default), n map event n. | |
| defaultType | No | show_choices: selected choice index, or -1 for none. | |
| designation | No | transfer_player/show_picture: whether the coordinates are literal values or variable IDs. | |
| showLevelUp | No | ||
| cancelBranch | No | show_choices: commands for a separate cancel branch. | |
| escapeBranch | No | ||
| includeEquip | No | change_items weapon/armor: also remove equipped copies. | |
| purchaseOnly | No | ||
| commonEventId | No | ||
| actorVariableId | No | ||
| randomEncounter | No | ||
| troopVariableId | No | ||
| amountVariableId | No | Use this variable's value as the amount. |