Run an editor action
editor_commandPerform live actions in the running Mount & Blade II: Bannerlord Modding Kit editor: run console commands, check scenes, reimport assets, manage dialogs, capture screenshots, and measure performance.
Instructions
Live actions in the running Modding Kit editor (needs the bridge): console (run a developer console command), list_commands (console commands by prefix; entries ending in '.' are groups such as 'scene.', 'resource.', 'prefab.' — list them with that prefix), check_scene (editor's scene problem check), reimport_assets (re-converts changed sources of earlier imports — new files need the Resource Browser's Import new asset), raycast (from/to or a position straight down → hit point), ground_height, warning (show a message in the editor), enter_editor (from the main menu), ping, quit (confirm=true; closes the game without saving). Also without the bridge: screenshot (captures the game window and returns the image; when the game is frozen or has no window yet, the message box blocking it), dialogs (the game's message boxes such as 'RGL WARNING', prompts Windows shows for it, the scene editor's modal Qt dialogs such as 'Do you want to save the scene?' with their texts, fields and buttons, and its other open windows), dismiss_dialogs (press OK, or button, on them; editor dialogs and file dialogs only with a named button) and fill_dialog (type into an editor dialog's input fields, set its check boxes and select a list/tree item — by label or #n — then read everything back; it never presses a button). With the bridge also: perf (frame times over seconds: average, percentiles, fps, plus the engine's main/renderer fps). cleanup deletes the screenshots, walk traces and dialog/bridge logs this server left in the bridge folder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | raycast: end point. | |
| from | No | raycast: start point. | |
| path | No | screenshot: keep a full-resolution copy in this .png file (default: nothing is kept on disk). | |
| check | No | fill_dialog: check boxes or radio buttons to set, by label, to true/false. Values are strings. | |
| title | No | dismiss_dialogs/fill_dialog: only dialogs whose title contains this text (e.g. 'RGL WARNING', 'Save Scene'). | |
| action | Yes | Action. | |
| button | No | dismiss_dialogs: button text or control id to press (default: OK, or the only button). 'OK', 'Cancel', 'Yes', 'No', 'Retry', 'Ignore', 'Close' also match Windows boxes in any language (e.g. 否(N)). Scene editor (Qt) dialogs and file dialogs are only answered with a named button. Dialogs without a matching button are left open. | |
| fields | No | fill_dialog: input fields to set, by label, name or #1, #2 … in order, e.g. {"Name": "my_scene_v2"}. Values are strings. | |
| prefix | No | list_commands: command prefix (default all). | |
| select | No | fill_dialog: text of a list or tree item to select (e.g. a module or scene name). | |
| source | No | screenshot: 'window' (default) captures the game/editor window including the editor UI and works without the bridge; 'engine' asks the renderer (needs the bridge; black while the scene editor is in front). | |
| command | No | console: the command line, e.g. 'help'. | |
| confirm | No | quit: must be true — closes the game; unsaved editor changes are lost. | |
| message | No | warning: text to show in the editor's warning panel. | |
| seconds | No | perf: sampling time (default 5, max 120). | |
| position | No | raycast/ground_height: [x, y, z] point to probe downwards from. | |
| max_width | No | screenshot: width of the image returned to you (default 1280; the saved file keeps full size). |