Table of Contents

New commands

This page lists the new commands added in the Maniac Patch.

Those commands can be written either through the Maniac Patch editor, through the TPC program of the Maniac Patch, or by writing raw format commands.

FIXME This page is currently a stub, most commands still need to be filled.

Get Save Info

Player status: Supported ✅; Requesting the name of the first party member is currently not supported and makes the command fail, requesting info from a null or negative save does not work

The Get Save Info command (セーブ情報の取得) allows to directly retrieve info from a save file.

The command has the following fields:

Notes:

It can be written as follow with the common TPC syntax:

@save[1].getInfo .datetime v[2], v[3] .level v[4] .hp v[5] .name t[6] .face 7, 8, 9, 10

Where:

The picture ID values can be written using the variable syntax (v[1]) to use variables instead of constants, which will affect all picture IDs.

Raw writing:

3001, "", a, b, c, d, e, f, g, h, i, j, k, l

Save

Player status: Supported ✅; Inaccuracies: Store Result is not set to 0 when failing, see EasyRPG Player issue #3056, lack of file output limit

The Save command (セーブの実行) allows to directly save on a requested save slot without using the save menu.

The command has two fields:

Notes:

It can be written as follow with the common TPC syntax:

@save[1].save .res v[2]

Where:

Raw writing:

3002, "", a, b, c, d

Load

Player status: Supported ✅; Inaccuracies: No transition to black is ever displayed, empty and corrupted save files cannot be loaded at all

The Load command (ロードの実行) allows to directly load a requested save slot without using the load menu.

The command has three fields:

Notes:

The command can be written as follow with the common TPC syntax:

@save[v[105]].load .disableFileCheck .disableBlackout

Where:

Raw writing:

3003, "", a, b, c, d

End Load Processing

Player status: N/A

The End Load Processing command (ロード処理の終了, referred to as End Load Process in the interface), unlike what its name suggests, does not do anything.

This command was created for a previous version of the Maniac patch which kept the screen black during 6 frames after a load transition, and this command could have been used to make the screen visible again earlier. As this command already lacks any behaviour in version 181209 (oldest Maniac version still available), and that the only other older public version is 180809, which is no longer available, it is unknown if this command ever had a behaviour in any publicly available version.

The command does not has any common TPC syntax as it was scrapped before the creation of TPC, and as such requires to be written in raw to write or edit it through TPC.

Raw writing:

3004, ""

Get Mouse Position

Player status: Supported ✅; Inaccuracies: Ignore Window Size Ratio not supported, tracking the mouse out of the game window not supported

The Get Mouse Position command (マウス座標の取得) allows to retrieve the position of the mouse.

The command has three fields:

Notes:

The command can be written as follow with the common TPC syntax:

@mouse.getPos v[1], v[2]

Where:

Raw writing:

3005, "", a, b, 0, d

Set Mouse Position

Player status: Not supported with no plan to be supported ❌; System specific, not exposed by SDL

The Set Mouse Position command (マウス座標の設定) allows to change the position of the mouse.

The command has three fields:

The coordinates to use can be set to either constants or value of variables, with the setting for it being shared for the two coordinates.

Notes:

The command can be written as follow with the common TPC syntax:

@mouse.setPos 1, 2

Where:

Both values can be written using the variable syntax (v[1]) to use variables instead of constants.

Raw writing:

3006, "", a, b, c, d

Show String Picture

FIXME

Get Picture Info

FIXME

Control Battle

FIXME

Control ATB Gauge

FIXME

Change Battle Command EX

FIXME

Get Battle Info

FIXME

Control Variable Array

FIXME

Key Input Processing EX

FIXME

Rewrite Map

FIXME

Control Shared Save

Player status: Supported ✅; Global save status is set to be opened on boot if it exists, no file output limit.

The Control Shared Save command (共有セーブの操作, known as Control Global Save in previous versions) allows to save switches and variables in a file named Save.lgs, that will be able to be read and written while playing from any save file.

When using the command, there are two different global save locations that need to be distinguished:

Additionally, the global save can have two statuses, opened and closed:

Notes:

Open

By using Open, the global save status will be set to opened.

Common TPC syntax:

@gsave.open

Raw writing:

3016, "", 0

Close

By using Close, the content of the Save.lgs file will be copied to the global save, and the global save status will be set to closed.

Common TPC syntax:

@gsave.close

Raw writing:

3016, "", 1

Save

By using Save, the content of the global save will be written on the Save.lgs file.

Notes:

Common TPC syntax:

@gsave.save

Raw writing:

3016, "", 2

Save then Close

By using Save then Close, the content of the global save will be written on the Save.lgs file, and the global save status will be set to closed.

Notes:

Common TPC syntax:

@gsave.saveAndClose

Raw writing:

3016, "", 3

Copy from Global Save

Copy from Global Save allows to copy values from the global save to switches and variables.

The command has the following fields:

Notes:

Common TPC syntax for switches:

gs[2].copyTo s[1], 3

Common TPC syntax for variables:

gv[2].copyTo v[1], 3

Where:

Raw writing:

3016, "", 4, b, c, d, e, f

Copy to Global Save

Copy to Global Save allows to copy switches and variables to the global save.

The command has the following fields:

Notes:

Common TPC syntax for switches:

gs[2].copyFrom s[1], 3

Common TPC syntax for variables:

gv[2].copyFrom v[1], 3

Where:

Raw writing:

3016, "", 5, b, c, d, e, f

Set Picture ID

FIXME

Set Game Option

The Set Game Option command (ゲームのオプション設定) allows to alter several parameters of the engine while playing.

The command allows setting different options, which cannot be set in a single command, so they are separated by section here.

Behavior when Inactive

Player status: Supported ✅; This option is linked to the EasyRPG Player setting Pause when focus lost, and as such does not use the value set in a save file.

Behavior when Inactive defines if the window of the game should be put on hold (Wait) if put in the background or if it should stay active (Run). This info is stored in the save file, and the default mode is Wait.

Common TPC syntax:

Raw writing:

3018, "", 0, 0, c

Fatal Mix

Player status: Supported ✅; The FPS range is capped on the [10;500] range; FPS and Right Shift key are not kept if a save file is loaded or if the game is reset.

Fatal Mix allows to change the speed of the game, change the TestPlay mode and adjust the behaviour of the Right Shift key.

It has the following fields:

Notes:

It can be written as follow with the common TPC syntax:

@sys.gameOpt .fatal 60, b, c

Where:

Raw writing:

3018, "", a, 1, c, d

Maximum Number of Pictures

Player status: Unsupported ❌; The Player dynamically handles picture limits so it does not need it as much as Maniac does for optimisation.

Maximum Number of Pictures defines the maximum picture ID that can be used, with the default value being 1000.

The command allows specifying a value for the maximum picture ID, with the possibility to use a constant, a variable or variable redirection.

Notes:

The command can be written as follow with the common TPC syntax

@sys.gameOpt .picLimit 20

, with the possibility to replace the value by a variable or variable redirection.

Raw writing:

3018, "", a, 2, c

Frame Skip

Player status: Supported ✅

Frame Skip defines if displayed frames should be skipped when playing in case the game is struggling to keep up (i.e. bad performances).

The following values can be used:

Notes:

Common TPC syntax:

Raw writing:

3018, "", 0, 3, c

Mouse Text Window Operation

Player status: Partially supported ℹ️; The right mouse button is not mapped, and the left mouse button behaves like a regular interaction key for text boxes

⚠️ This option is not directly accessible through the Maniac editor, and requires using TPC, raw writing or another tool.

If Mouse Text Window Operation is enabled, the mouse will be able to be used in text boxes.

With this parameter enabled, the Right Mouse Button will work like a cancel key during message boxes and choice boxes. The Left Mouse Button will also be able to close message boxes when pressed, and it will be able to interact with choice boxes: by clicking on a choice, the cursor will be put on it if it is not already hovering it, and if the cursor was already on it, the choice will be selected.

Notes:

The command can be written as follow with the common TPC syntax

@sys.gameOpt.mouse.disableMsgProcession(0)

, with the possibility to set the value to 0 to allow it and 1 to disallow it.

Raw writing:

3018, "", 0, 4, c

Position of Battle Screen

Player status: Unsupported ❌

⚠️ This option is not directly accessible through the Maniac editor, and requires using TPC, raw writing or another tool.

Position of Battle Screen defines where the interface should be displayed on the screen during battles.

The position of the battle screen can be set to either center (default), top-left, bottom-left, top-right, top, bottom, left or right.

Notes:

Common TPC syntax:

Raw writing:

3018, "", 0, 5, c

Maximum Number of Animations

Player status: Unsupported ❌

⚠️ This option is not directly accessible through the Maniac editor, and requires using TPC, raw writing or another tool.

Maximum Number of Animations defines the maximum animation ID that can be used.

Unlike Maximum Number of Pictures, this option will only work to erase animations that are currently displayed and that are using an ID above the maximum set.

It can be written as follow with the common TPC syntax

@sys.gameOpt .animLimit 5

, with the possibility to replace the value by a variable or variable redirection.

Raw writing:

3018, "", a, 6, c

Face Size

Player status: Unsupported ❌

⚠️ This option is not directly accessible through the Maniac editor, and requires using TPC, raw writing or another tool.

Face Size defines which size should be used for FaceSets displayed in message boxes.

The command allows setting the width and height to use for FaceSets, with the possibility to use constants, variables or variable redirections.

Notes:

It can be written as follow with the common TPC syntax:

@sys.gameOpt .winFaceSize 16, 32

Where:

Raw writing:

3018, "", a, 7, c, d

Call Command

FIXME

Control String Variables

⚠️ This command is not directly accessible through the Maniac editor, and requires using the community plugin, TPC, raw writing or another tool.

FIXME

Get Game Info

The Get Game Info command (ゲーム情報の取得) allows to retrieve various game infos to store in variables and string variables.

Each section corresponds to a different info that can be retrieved.

Map Size

Player status: Supported ✅

Map Size allows to retrieve the size of a map.

After specifying a variable ID to receive the info, the following variables will receive a value:

It can be written as follow with the common TPC syntax:

@sys.getInfo .mapSize  .dst v[1]

Raw writing:

3021, "", 0, 0, c

Tile IDs

⚠️ While this command is accessible through the Maniac editor and can be written, assigning a value to be a variable or variable redirection is incorrectly done and incorrectly displayed in the list. Use TPC, raw writing or another tool to properly write the command.

Player status: Supported ✅

Tile IDs allows to retrieve the ID of tiles.

The command has the following fields:

Notes:

The command be written as follow with the common TPC syntax:

@sys.getInfo .tiles 1, 2, 3, 4 .upper .dst v[1]

Where:

Raw writing:

3021, "", a, 1, c, d, e, f, g, h

Window Size

Player status: Supported ✅

Window Size allows to retrieve the size of the game window defined for the game.

After specifying a variable ID to receive the info, the following variables will receive a value:

It can be written as follow with the common TPC syntax:

@sys.getInfo .winSize  .dst v[1]

Raw writing:

3021, "", 0, 2, c

Game Screen Pixels

⚠️ While this command is accessible through the Maniac editor and can be written, assigning a value to be a variable or variable redirection is incorrectly done and incorrectly displayed in the list. Use TPC, raw writing or another tool to properly write the command.

Player status: Supported ✅; Colours retrieved can be slightly off due to the different rendering.

Game Screen Pixels allows to retrieve the colour of pixels displayed on the screen.

The command has the following fields:

Notes:

The command can be written as follow with the common TPC syntax:

@sys.getInfo .pixel 1, 2, 3, 4 .dst v[1] .ignoreA

Where:

Raw writing:

3021, "", a, 3, c, d, e, f, g, h

Command Interpreter State

Player status: Partially supported ℹ️; Battle events do not have all their values retrieved correctly yet, battle common event types are not supported, type of execution for Player Touch and Event Touch can be inaccurate, see EasyRPG Player issue #3689

Command Interpreter State allows to retrieve the position in the code where the command was used.

After specifying a variable ID to receive the info, the following variables will receive a value:

The nesting parameter can be specified to select which event should be pointed to, with the possibility to use a constant, a variable or variable redirection.

For instance, if the event of ID 4 calls the event of ID 5 which calls the event of ID 6, and that the command is used in the code of the event of ID 6, a nesting of 0 will retrieve the position of the command compared to the code of the event of ID 6, a nesting of 1 compared to the event of ID 5, and a nesting of 2 compared to the event of ID 4.

Notes:

The command can be written as follow with the common TPC syntax

@sys.getInfo .interpreter .current v[1] .dst 1

, where v[1] corresponds to the variable that will receive the value and 1 to the nesting value, with the possibility to replace the constant by a variable or variable redirection.

Raw writing:

3021, "", a, 4, c, 0, e

Tileset ID

Player status: Supported ✅

Tileset ID allows to retrieve the ID of the current tileset.

A variable ID must be specified through the command, which will receive the ID of the current tileset upon use.

It can be written as follow with the common TPC syntax:

@sys.getInfo .tilesetId  .dst v[1]

Raw writing:

3021, "", 0, 5, c

Actor Face Graphic

Player status: Supported ✅; The empty message box index quirk is not supported.

Actor Face Graphic allows to retrieve the FaceSet of a hero or of the message box.

The command has the following fields:

Notes:

TPC syntax:

Raw writing:

3021, "", a, 6, c, d, e, f, g

Actor Body Graphic

Player status: Supported ✅; Requesting the dynamic sprite of a vehicle also receives sprites set through the Set Move Route command.

Actor Body Graphic allows to retrieve the CharSet of a hero or of an event.

The command has the following fields:

Notes:

The TPC syntax is

@sys.getInfo .body .actor[1] .dynamic .dst t[1], v[1]

when the target type is Actor and

@sys.getInfo .body .ev[1] .dynamic .dst t[1], v[1]

when the target type is Event, where:

Raw writing:

3021, "", a, 7, c, d, e, f, g

Camera Position

Player status: Supported ✅; Coordinates on looping maps for the edges are incorrectly reported, see EasyRPG Player issue #3665

Camera Position allows to retrieve the position of the camera. The position of the camera retrieved corresponds to the top-left corner pixel of the screen compared to the map placement.

After specifying a variable ID to receive the info, the following variables will receive a value:

Notes:

It can be written as follow with the common TPC syntax:

@sys.getInfo .camera .dst v[1]

Raw writing:

3021, "", 0, 8, c

Screen Shake Value

Player status: Supported ✅

Screen Shake Value allows to retrieve by how many pixels the screen was shifted on the left by the Shake Screen command.

A variable ID must be specified through the command, which will receive the screen shake value upon use.

It can be written as follow with the common TPC syntax:

@sys.getInfo .shake .dst v[1]

Raw writing:

3021, "", 0, 9, c

Current BGM

Player status: Supported ✅

Current BGM allows to retrieve the infos of the current music.

After specifying a variable ID and string variable ID to receive the info, the following variables will receive a value:

Notes:

It can be written as follow with the common TPC syntax

@sys.getInfo .bgm  .dst t[1], v[1]

, with t[1] corresponding to the string variable and v[1] to the variable.

Raw writing:

3021, "", 0, 10, c, d

Edit Picture

FIXME

Output Image

Player status: Supported ✅; Appending the .png in the filename does not add it as part of the filename, outputting with an invalid character displays a warning, Show Picture loads the new file when used so no overwriting shenanigan, file output limit not supported/detected; See other sections for individual compatibility.

The Output Image command (画像の出力) allows to output a screenshot of the game or a displayed picture and write it in the folder of the game.

This can be used to export pictures from the game so that the user can use them, or it can be used by the developer to then call those output pictures later on.

Notes:

Game Screen

Player status: Supported ✅; The first colour in the index is not set to a transparent colour

By specifying Game Screen, a screenshot of the game will be taken and be output in the requested location.

The only option available is the Output File (where the picture should be written), with the possibility to define it as part of the command, as a string variable or as a string variable redirection.

Notes:

The common TPC syntax is

@img.save .screen .dst "filename"

, with the possibility to replace the filename by a string variable or string variable redirection.

Raw writing:

3026, "filename", a, 0, 0, d

Picture

Player status: Supported ✅; Outputting a picture that does not exist writes a 1x1 black pixel

By specifying Picture, a copy of the picture in the selected picture ID will be output in the requested location.

The command has the following fields:

Notes:

Common TPC syntax:

@img.save .pic 1 .dynamic .dst "filename"

Where:

Raw writing:

3026, "filename", a, 1, c, d, e

Add Move Route

FIXME

Edit Picture (Tile)

Player status: Unsupported ❌

FIXME

Control Message

Player status: Unsupported ❌

FIXME

Script

Player status: Unsupported ❌

The Script command (スクリプト) allows to execute JavaScript code.

The Maniac Patch executable comes bundled with QuickJS Javascript Engine to be able to execute JavaScript code, and as such follows its syntax and features. Note that the os and std functions are not present in the Maniac Patch implementation of QuickJS, due to their potential dangerous use.

Additionally, the following JavaScript commands can be used to alter switches, variables and string variables:

The command has the following fields:

FIXME Provide more examples and info on using JavaScript and making it communicate with the engine.

Notes:

Internally, the command comes with two different command codes, 3030 and 3031, with 3030 used for the first line of a script and 3031 used for the next lines of a same script. This is similar to the Show Text and Comment commands, where their first line and their other lines use different command codes. Using 3031 commands without starting with a 3030 command first will not do anything.

TPC only offers editing the first command code: the second command code is impossible to edit through the Maniac Patch or TPC, and can only be deleted.

TPC syntax of the first command code:

@js [s[1], s[v[2]], v[3], v[v[4]], t[5], t[v[[6]]] .run "code"

Where:

Raw writing for the command code 3030:

3030, "code", a, b, 0, 0, e, f, g

The values f and g are repeated up until the number of selected outputs.

Raw writing for the command code 3031:

3031, "code"

Zoom Screen

Player status: Not yet supported ❌; A work-in-progress pull request to implement the command exists: EasyRPG Player pull request #3499

The Zoom Screen command (画面のズーム) allows to zoom in on the screen while in the overworld.

The command has the following fields:

Notes:

The command can be written as follow with the common TPC syntax:

@scr.zoom .pos 1, 2 .rate 3 .layer 4 .time 5 .wait

Where:

Raw writing:

3032, "", a, b, c, d, e, f, g

Console

Player status: Unsupported ❌

The Console command (コンソール) allows to open a console in an external window, display text in it and allows the player to type text through it.

Notes:

Open

Open opens the console window. If the console was already opened, nothing will happen.

Common TPC syntax:

@console .open

Raw writing:

3033, "", 0, 0

Close

Close closes the console window. All text output and input of the console will be cleared, and the colours for the console will be reset. If the console was already closed, nothing will happen.

Common TPC syntax:

@console .close

Raw writing:

3033, "", 0, 1

Output

Output allows to display text in the console. If the console was closed, it will be opened prior to outputting text.

The command has the following fields:

Notes:

TPC syntax:

@console .out "string" .extract .hex .nolb

Where:

Raw writing:

3033, "string", a, 4, c, d

Input

Input puts the game on hold and asks the player to type in the console. If the console was closed, it will be opened prior to the text input.

The command has the following fields:

Notes:

TPC syntax:

@console .in t[1] .max 2 .extract .hex

Where:

Raw writing:

3033, "", a, 3, c, d, e

Set Text Color

Set Text Color allows to change the colours used for the text and text background for the next text that will be displayed by the console. If the console was closed, it will be opened prior to changing the text colour.

The command has the following fields:

Notes:

When not using constants, the TPC syntax is

@console .setColor .front v[1] .back v[2]

, where v[1] corresponds to the foreground colour and v[2] to the background colour, with the possibility to replace both by variable redirections, as well as removing entirely the .front or .back argument if you do not want to set a foreground or background colour.

If you are using constants, the TPC syntax is

@console .setColor .front (.blue, .green, .red, .emph) .back (.blue, .green, .red, .emph)

, where the content in brackets defines the colour as a combination of a blue, green, red and intensity value, with the possibility to removing entirely the .front or .back argument if you do not want to set a foreground or background colour.

Raw writing:

3033, "", a, 4, c, d, e

Control Self Variable

⚠️ This command was added in development versions of the editor, and is as such not available in public versions, in addition to lacking a common TPC writing.

Player status: Unsupported ❌

FIXME

Change Troop Member

⚠️ This command was added in development versions of the editor, and is as such not available in public versions, in addition to lacking a common TPC writing.

FIXME

Control Media Option

⚠️ This command was added in development versions of the editor, and is as such not available in public versions, in addition to lacking a common TPC writing.

Player status: Unsupported ❌

The Control Media Option command (メディアオプションの操作) allows to retrieve and set the settings of the Maniac Patch engine.

This command can be used to replace the settings menu added in the English version of RPG Maker 2003 accessible by pressing F5, as all of the settings accessible from it and that were kept in Maniac can be set through it.

The command has the following fields:

Notes:

Raw writing:

3038, "", a, b, c, d