Patch script events
patch_scriptApply insert, replace, or delete operations to a GB Studio script array, sequentially updating the selected scene or custom event script. Validates dialogue width budget before saving.
Instructions
Apply an ordered list of structured operations (insert / replace / delete) to a ScriptEvent[] array. Full-array replacement is intentionally unsupported — use delete + insert. Operations apply sequentially: each op's index refers to the array state AFTER all prior ops in this call. Persists the edited scene/customEvent to disk atomically. Before writing, the resulting tree is checked against the dialogue width budget (default 18 chars/line for EVENT_TEXT/EVENT_MENU/EVENT_CHOICE strings); violations refuse the write unless force: true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"locator": "<locator>",
"operations": "<operations>"
},
"name": "patch_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Skip the dialogue width budget check. Only set this if you've installed a wider custom font and have manually verified the lines fit on screen. | |
| locator | Yes | ||
| operations | Yes | ||
| widthBudget | No | Override the per-line character budget (default 18). Increase this only when a wider custom font is installed. |