Evaluate in the running game
live_evalInspect and modify a live RPG Maker MZ playtest by executing JavaScript expressions, returning the result and awaiting promises.
Instructions
Run a JavaScript expression inside the live game and return its value. Requires the plugin's Allow Eval parameter, a configured RMMZ_LIVE_TOKEN, and a running playtest. Anything the engine exposes works: $gameVariables.value(3), $gamePlayer._x, $gameSwitches.value(12). An expression that returns a promise is waited for and the settled value comes back, so one call can watch a frame counter, a transfer or a scene change instead of polling for it. The game gives a promise 20000ms to settle and the call waits for the same 20000ms by default, so a promise that needs 15s is answered, not cut off; raise timeoutMs to 60000 for a longer wait, but the plugin still abandons the promise itself at 20s. Two engine behaviors bite here, so they are worth knowing before a result looks wrong. Calling an API that moves the character directly ($gamePlayer.moveStraight(6)) reaches some of what a key does and not the rest: the party step count and the touch triggers happen inside the step itself, but the encounter counter only ticks in Game_Player.updateNonmoving, which is a frame or two later, so a fast scripted walk can outrun it — live_move holds the arrow instead and gets all of it. And $gamePlayer.performTransfer() run by hand rebuilds the map from the previous map's $dataMap, because loading the new file is Scene_Map's job: the player then stands "on" the new map with the old map's events running under them. reserveTransfer(...) and wait is the way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeoutMs | No | How long to wait (default 20000, the same ceiling the plugin gives a promise) | |
| expression | Yes | A single expression; wrap statements in (() => { ... })() |