====== New commands ======
This page lists the new commands added in the [[..:maniac|Maniac Patch]].
Those commands can be written either through the Maniac Patch editor, through the [[..:maniac#tpc|TPC program]] of the Maniac Patch, or by writing [[..:..:raw-format-commands|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:
* Save Index: Save slot ID that will be used for the save file. The ID to use can either be a constant or the value of a variable. The range of valid save slots is [-2147483648;2147483647].
* YYMMDD: Variable that should receive the date of the save file, in the YYMMDD format. If the selected save file is corrupted, the retrieved value will be 8991230, and if the selected save file does not exist, the retrieved value will be 0.
* HHMMSS: Variable that should receive the time of the save file, in the HHMMSS format.
* Level: Variable that should receive the level of the first party member of the save file. If there is no member in the party, the retrieved value will be 0.
* HP: Variable that should receive the current HP of the first party member of the save file. If there is no member in the party, the retrieved value will be 0.
* Name Destination: String variable that should receive the name of the first party member of the save file. ⚠️// This option is not directly accessible through the Maniac editor, and requires using the community plugin, TPC, raw writing or another tool.//
* Picture ID for Face Graphic: Picture IDs that should be used to retrieve the FaceSets of the party members. The IDs to use can either be constants or values of variables. The pictures will be placed at coordinates 0, 0, using an overworld and battle picture layer 7 with a transparency of 100%, with the other parameters being the default picture parameters.
Notes:
* If the selected save file is corrupted or does not exist, the retrieved value for HHMMSS, Level, and HP will be 0, the Name Destination name will be empty, and the selected picture IDs will be erased.
* As the picture graphics will be cut with the spritesheet feature on a 4 vertical sprites per 4 horizontal sprites setting, the retrieved graphics do not have to be the size of a FaceSet.
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:
* ''@save[1].getInfo'' corresponds to the save slot number (here, 1), with the possibility to replace the value by a variable.
* ''v[2]'' corresponds to the variable that should receive the date of the save file.
* ''v[3]'' corresponds to the variable that should receive the time of the save file.
* ''v[4]'' corresponds to the variable that should receive the level of the first party member of the save file.
* ''v[5]'' corresponds to the variable that should receive the HP of the first party member of the save file.
* ''t[6]'' corresponds to the string variable that should receive the name of the first party member of the save file.
* ''7'' corresponds to the picture ID that should receive the FaceSet of the 1st party member of the save file.
* ''8'' corresponds to the picture ID that should receive the FaceSet of the 2nd party member of the save file.
* ''9'' corresponds to the picture ID that should receive the FaceSet of the 3rd party member of the save file.
* ''10'' corresponds to the picture ID that should receive the FaceSet of the 4th party member of the save file.
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
* ''3001'': Command code
* ''a'': Whether the Save Index value to retrieve should be a constant (0) or a variable (1), a constant, with the name of the first party member retrieved in a string variable (16), or a variable, with the name of the first party member retrieved in a string variable (17).
* ''b'': Value to use for the Save Index.
* ''c'': Variable that should receive the date of the save file.
* ''d'': Variable that should receive the time of the save file.
* ''e'': Variable that should receive the level of the first party member of the save file.
* ''f'': Variable that should receive the HP of the first party member of the save file.
* ''g'': String variable that should receive the name of the first party member of the save file.
* ''h'': Whether the picture IDs to use for the retrieved FaceSets should be constants (0) or variables (1).
* ''i'': Picture ID that should receive the FaceSet of the 1st party member of the save file.
* ''j'': Picture ID that should receive the FaceSet of the 2nd party member of the save file.
* ''k'': Picture ID that should receive the FaceSet of the 3rd party member of the save file.
* ''l'': Picture ID that should receive the FaceSet of the 4th party member of the save file.
===== Save =====
//Player status: Supported //✅//; Inaccuracies: Store Result is not set to 0 when failing, see [[https://github.com/EasyRPG/Player/issues/3056|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:
* Save Index: Save slot ID that will be used for the save file. The ID to use can either be a constant or the value of a variable. The range of valid save slots is [1;2147483647], attempting to write a save file with a null or negative ID will fail.
* Store Result (Optional): Variable that should receive a value when the save file is written. If the save succeeds, the value written will be 1. Otherwise, the value written will be 0. As this value is written at the same time than the save file, and that it is not kept in the save file, the selected variable will be kept unaltered if the save file is loaded.
Notes:
* Output saves are subject to the file output limit of the patch (not more than ~3 file writing per second): if the file output limit is reached, the [[modified-maniac-commands#file-output-is-available|Conditional Branch: File output is available]] will be reported as false until it becomes possible again to write files.
It can be written as follow with the common TPC syntax: @save[1].save .res v[2]
Where:
* ''@save[1].save'' corresponds to the save slot number (here, 1), with the possibility to replace the value by a variable.
* ''.res v[2]'' corresponds to the variable where the save result will be written. It can be omitted, in which case no result will be output.
Raw writing: 3002, "", a, b, c, d
* ''3002'': Command code
* ''a'': Whether the Save Index value to retrieve should be a constant (0) or a variable (1).
* ''b'': Value to use for the Save Index.
* ''c'': Whether the result should be stored in a variable (1) or should be ignored (0).
* ''d'': Variable to use for Store Result.
===== 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:
* Save Index: Save slot ID that will be used for the save file. The ID to use can either be a constant or the value of a variable. The range of valid save slots is [1;2147483647], attempting to load a save file with a null or negative ID will fail.
* Disable file check: If this option is ticked, attempting to load an empty save file will give the same result than when trying to load a corrupted save file instead of failing.
* Disable blackout: If this option is ticked, the screen will not turn black when a save file is loaded. ⚠️// This option is not directly accessible through the Maniac editor, and requires using TPC, raw writing or another tool.//
Notes:
* If a corrupted save file is attempted to be loaded, or if an empty save file is attempted to be loaded with the file check disabled, the following things will happen:
* The game will act as if it was a new game (no switch, variable or string variable set, no item, no skill, default party), but will keep the current tileset if it was changed through the Change Tileset command
* The player and all vehicles will all be teleported on the current map of the player at coordinates 0,0
* The player sprite will be hidden
The command can be written as follow with the common TPC syntax: @save[v[105]].load .disableFileCheck .disableBlackout
Where:
* ''@save[1].load'' corresponds to the save slot number (here, 1), with the possibility to replace the value by a variable.
* ''.disableFileCheck'' corresponds to if the file check should be disabled. It can be omitted, in which case the file check will occur.
* ''.disableBlackout'' corresponds to if the blackout should be disabled. It can be omitted, in which case the blackout will occur.
Raw writing: 3003, "", a, b, c, d
* ''3003'': Command code
* ''a'': Whether the Save Index value to retrieve should be a constant (0) or a variable (1).
* ''b'': Value to use for the Save Index.
* ''c'': Whether the file check should be enabled (0) or disabled (1).
* ''d'': Whether the blackout should be enabled (0) or disabled (1).
===== 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:
* X Coordinate: Variable that should receive the X coordinate of the mouse.
* Y Coordinate: Variable that should receive the Y coordinate of the mouse.
* Ignore Window Size Ratio: If ticked, the mouse coordinate retrieved will ignore the window size ratio of the game instead of retrieving a position tied to the game screen. ⚠️// This option 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.//
Notes:
* If the mouse is placed out of the game window, it will still properly be tracked.
The command can be written as follow with the common TPC syntax: @mouse.getPos v[1], v[2]
Where:
* ''v[1]'' corresponds to the variable that should receive the X coordinate.
* ''v[2]'' corresponds to the variable that should receive the Y coordinate.
Raw writing: 3005, "", a, b, 0, d
* ''3005'': Command code
* ''a'': Variable that should receive the X coordinate.
* ''b'': Variable that should receive the Y coordinate.
* ''d'': Whether the window size ratio should be respected (0) or ignored (1).
===== 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:
* X Coordinate: X coordinate of the mouse to use.
* Y Coordinate: Y coordinate of the mouse to use.
* Ignore Window Size Ratio: If ticked, the mouse coordinate position will be calculated by ignoring the window size ratio of the game. ⚠️// This option 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.//
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:
* If the mouse is moved at coordinates out of the game window, it will be capped to the size of the game window.
The command can be written as follow with the common TPC syntax: @mouse.setPos 1, 2
Where:
* ''1'' corresponds to the value that should be used for the X coordinate.
* ''2'' corresponds to the value that should be used for the Y coordinate.
Both values can be written using the variable syntax (''v[1]'') to use variables instead of constants.
Raw writing: 3006, "", a, b, c, d
* ''3006'': Command code
* ''a'': Whether the coordinate values to use should be constants (0) or variables (1).
* ''b'': Variable that should receive the X coordinate.
* ''c'': Variable that should receive the Y coordinate.
* ''d'': Whether the window size ratio should be respected (0) or ignored (1).
===== 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:
* The **global save**, which consists of the area where the data is temporarily written in memory and altered by the various functions of the command.
* The ''Save.lgs'' file, which is the actual file written in the game folder that can be read and written on. It will always be referred as ''Save.lgs'' in the documentation of this command to avoid confusion with the global save.
Additionally, the global save can have two statuses, opened and closed:
* If set to opened, and that the game is closed either by the user or by using the Exit Game command, the content of the global save will be copied to the ''Save.lgs'' file.
* The ''Save.lgs'' file will not be updated if the game is forcefully closed by e.g. the Task Manager, or if a major game crash occurs (simple error messages from the engine properly write data).
* If set to closed, exiting the game will not alter the ''Save.lgs'' file.
Notes:
* The file ''Save.lgs'' is stored at the root of the game folder.
* Upon game boot or game reset, the content of the ''Save.lgs'' file is copied to the global save, and the global save status is set to closed.
* The output ''Save.lgs'' file is subject to the file output limit of the patch (not more than ~3 file writing per second): if the file output limit is reached, the [[modified-maniac-commands#file-output-is-available|Conditional Branch: File output is available]] will be reported as false until it becomes possible again to write files.
==== 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:
* The opened/closed status of the global save does not matter for saving.
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:
* The opened/closed status of the global save does not matter for saving.
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:
* Type: Whether switches or variables should be copied.
* Current Save Data: Position of the first switch or variable ID should receive the values from the global save, with the possility to use a constant or variable for the ID.
* Global Save Data: Position of the first switch or variable in the global save that should be copied, with the possility to use a constant or variable for the ID.
* Size: How many values should be copied, with the possibility to use a constant, variable or variable redirection.
Notes:
* Switches and variables do not share their slot allocations, so you can use the same slot numbers without conflict.
* Using the command will set the global save status to opened.
* Using a null or negative size will not copy any value.
Common TPC syntax for switches: gs[2].copyTo s[1], 3
Common TPC syntax for variables: gv[2].copyTo v[1], 3
Where:
* ''1'' corresponds to the position of the wanted value in the game data, with the possibility to use a constant or variable.
* ''2'' corresponds to the position of the wanted value in the global save, with the possibility to use a constant or variable.
* ''3'' corresponds to the size of the array, with the possibility to use a constant, variable or variable redirection.
Raw writing: 3016, "", 4, b, c, d, e, f
* ''3016'': Command code
* ''b'': Defines if the values to use are constants, variables or variable redirections:
* ''+1'' if the current game data position to use should be a variable.
* ''+16'' if the global save position to use should be a variable.
* ''+256'' if the size to use should be a variable.
* ''+512'' if the size to use should be a variable redirection.
* ''c'': Whether the type to use should be switches (0) or variables (1).
* ''d'': Value to use for the current game data position.
* ''e'': Value to use for the global save position.
* ''f'': Value to use for the size.
==== Copy to Global Save ====
**Copy to Global Save** allows to copy switches and variables to the global save.
The command has the following fields:
* Type: Whether switches or variables should be copied.
* Current Save Data: Position of the first switch or variable ID that should be copied to the global save, with the possility to use a constant or variable for the ID.
* Global Save Data: Position of the first switch or variable in the global save that should be written to, with the possility to use a constant or variable for the ID.
* Size: How many values should be copied, with the possibility to use a constant, variable or variable redirection.
Notes:
* Switches and variables do not share their slot allocations, so you can use the same slot numbers without conflict.
* Using the command will set the global save status to opened.
* Using a null or negative size will not copy any value.
Common TPC syntax for switches: gs[2].copyFrom s[1], 3
Common TPC syntax for variables: gv[2].copyFrom v[1], 3
Where:
* ''1'' corresponds to the position of the wanted value in the game data, with the possibility to use a constant or variable.
* ''2'' corresponds to the position of the wanted value in the global save, with the possibility to use a constant or variable.
* ''3'' corresponds to the size of the array, with the possibility to use a constant, variable or variable redirection.
Raw writing: 3016, "", 5, b, c, d, e, f
* ''3016'': Command code
* ''b'': Defines if the values to use are constants, variables or variable redirections:
* ''+1'' if the current game data position to use should be a variable.
* ''+16'' if the global save position to use should be a variable.
* ''+256'' if the size to use should be a variable.
* ''+512'' if the size to use should be a variable redirection.
* ''c'': Whether the type to use should be switches (0) or variables (1).
* ''d'': Value to use for the current game data position.
* ''e'': Value to use for the global save position.
* ''f'': Value to use for the size.
===== 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:
* @sys.gameOpt .pauseWhenInactive
* @sys.gameOpt .runWhenInactive
Raw writing: 3018, "", 0, 0, c
* ''3018'': Command code
* ''c'': Whether the game should pause when inactive (0) or run (1).
==== 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:
* FPS: Defines the speed of the game in FPS, with the default speed being 60.
* TestPlay: Defines if the TestPlay mode should be retained, disabled or enabled.
* Right Shift key: If set, holding the Right Shift key while a text box is displayed will make the text box be displayed instantly with its message instantly closing.
Notes:
* Attempting to set FPS to a null or negative value will not change them.
* The speed of the game and Right Shift key status are ONLY set through this command: for instance, loading a save file or resetting the game through the F12 key will not change/reset those properties.
* Those info are not stored in save files.
It can be written as follow with the common TPC syntax: @sys.gameOpt .fatal 60, b, c
Where:
* ''60'' corresponds to the FPS value, with the possibility to replace the value by a variable or variable redirection.
* ''b'' corresponds to the TestPlay Mode status, where 0 is keeping the current mode, 1 is disabling it, and 2 is enabling it.
* ''c'' corresponds to the Right Shift key status, with 0 being disallowed and 1 being allowed.
Raw writing: 3018, "", a, 1, c, d
* ''3018'': Command code
* ''a'': Whether the FPS value to retrieve should be a constant (0), a variable (1), or a redirection of variable (2).
* ''c'': Value to use for the FPS.
* ''d'': Determines the TestPlay status and if holding the Right Shift key can be used to entirely skip text:
* ''0'' if TestPlay status is kept and if the Right Shift Key is disallowed to skip text.
* ''+1'' if TestPlay is disabled.
* ''+2'' if TestPlay is enabled.
* ''+16'' if the Right Shift key is allowed to skip text.
==== 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:
* If the maximum value is lowered and that some picture IDs would be higher than the set maximum ID, those pictures will be erased.
* As this command allocates picture slots in memory, the higher the maximum is set, the worst performances will get, so setting a maximum very high should be avoided.
* Attempting to display a picture with an ID above the set maximum value will make the game throw an error forcing the game to close.
* Setting a null or negative value will set the maximum picture ID at 1.
* This information is not stored in save files and is reset if the game is reset or if a save file is loaded.
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
* ''3018'': Command code
* ''a'': Whether the Maximum Number of Pictures value to retrieve should be a constant (0), a variable (1), or a redirection of variable (2).
* ''c'': Value to use for the Maximum Number of Pictures.
==== 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:
* None: No frame skipping should occur (default value).
* 1/5: 1/5 of the frames can be skipped if the game needs it.
* 1/3: 1/3 of the frames can be skipped if the game needs it.
* 1/2: 1/2 of the frames can be skipped if the game needs it.
Notes:
* This info is stored in save files.
Common TPC syntax:
* @sys.gameOpt .fullFrame
* @sys.gameOpt .oneFifth
* @sys.gameOpt .oneThird
* @sys.gameOpt .oneHalf
Raw writing: 3018, "", 0, 3, c
* ''3018'': Command code
* ''c'': Whether the Frame Skip should be set to None (0), 1/5 (1), 1/3 (2) or 1/2 (3).
==== 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:
* This parameter is disabled by default and not stored in the save file.
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
* ''3018'': Command code
* ''c'': Whether the mouse procession should be enabled (0) or disabled (1).
==== 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:
* This command does not do anything visually if the default screen resolution of 320x240 is in use. It needs a [[..:maniac#resolution|different resolution]] to work.
* This parameter is stored in the save file.
Common TPC syntax:
* @sys.gameOpt.btlOrigin .center
* @sys.gameOpt.btlOrigin .topLeft
* @sys.gameOpt.btlOrigin .bottomLeft
* @sys.gameOpt.btlOrigin .topRight
* @sys.gameOpt.btlOrigin .bottomRight
* @sys.gameOpt.btlOrigin .top
* @sys.gameOpt.btlOrigin .bottom
* @sys.gameOpt.btlOrigin .left
* @sys.gameOpt.btlOrigin .right
Raw writing: 3018, "", 0, 5, c
* ''3018'': Command code
* ''c'': Determines the battle screen position:
* ''0'': Center
* ''1'': Top-Left
* ''2'': Bottom-Left
* ''3'': Top-Right
* ''4'': Bottom-Right
* ''5'': Top
* ''6'': Bottom
* ''7'': Left
* ''8'': Right
==== 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
* ''3018'': Command code
* ''a'': Whether the Maximum Number of Animations value to retrieve should be a constant (0), a variable (1), or a redirection of variable (2).
* ''c'': Value to use for the Maximum Number of Animations.
==== 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:
* The default values for the width and the height are 48.
* If the width or height is set to a null or negative value, said value will be reset to 48.
It can be written as follow with the common TPC syntax: @sys.gameOpt .winFaceSize 16, 32
Where:
* ''16'' corresponds to the face width in pixels, with the possibility to replace the value by a variable or variable redirection.
* ''32'' corresponds to the face height in pixels, with the possibility to replace the value by a variable or variable redirection.
Raw writing: 3018, "", a, 7, c, d
* ''3018'': Command code
* ''a'': Whether the constants, variables or variable redirections should be used for the face width and height:
* ''0'' if both values are constant.
* ''+1'' if the face width is a variable.
* ''+2'' if the face width is a variable redirection.
* ''+16'' if the face height is a variable.
* ''+32'' if the face height is a variable redirection.
* ''c'': Value to use for the face width.
* ''d'': Value to use for the face height.
===== 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:
* Selected variable ID: X size of the map
* Selected variable ID + 1: Y size of the map
It can be written as follow with the common TPC syntax: @sys.getInfo .mapSize .dst v[1]
Raw writing: 3021, "", 0, 0, c
* ''3021'': Command code
* ''c'': First variable ID that should receive the X size of the map.
==== 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:
* Layer: Whether tiles retrieved should come from the lower layer or upper layer.
* X: X coordinate of the tile that should have its ID retrieved, with the possibility to use a constant, a variable or variable redirection.
* Y: Y coordinate of the tile that should have its ID retrieved, with the possibility to use a constant, a variable or variable redirection.
* Width: How many tiles in width should be retrieved, with the possibility to use a constant, a variable or variable redirection.
* Height: How many tiles in height should be retrieved, with the possibility to use a constant, a variable or variable redirection.
* Output Variable: First variable ID that should receive the tile data.
Notes:
* Retrieving the data of an out of bounds tile will return the value 0.
The command be written as follow with the common TPC syntax: @sys.getInfo .tiles 1, 2, 3, 4 .upper .dst v[1]
Where:
* ''1'' corresponds to the X coordinate, with the possibility to replace the constant by a variable or variable redirection.
* ''2'' corresponds to the Y coordinate, with the possibility to replace the constant by a variable or variable redirection.
* ''3'' corresponds to the width, with the possibility to replace the constant by a variable or variable redirection.
* ''4'' corresponds to the height, with the possibility to replace the constant by a variable or variable redirection.
* ''v[1]'' corresponds to the first variable ID that should receive the tile data.
* ''.upper'' corresponds the layer property. If omitted, it will instead be set to ''.lower''.
Raw writing: 3021, "", a, 1, c, d, e, f, g, h
* ''3021'': Command code
* ''a'': Whether the values to use should be constants (default), variables or variable redirections:
* ''+1'' if the X coordinate to use should be a variable.
* ''+2'' if the X coordinate to use should be a variable redirection.
* ''+16'' if the Y coordinate to use should be a variable.
* ''+32'' if the Y coordinate to use should be a variable redirection.
* ''+256'' if the width to use should be a variable.
* ''+512'' if the width to use should be a variable redirection.
* ''+4096'' if the height to use should be a variable.
* ''+8192'' if the height to use should be a variable redirection.
* ''c'': Whether lower tiles (0) or upper tiles (1) should be retrieved.
* ''d'': Value to use for the X coordinate.
* ''e'': Value to use for the Y coordinate.
* ''f'': Value to use for the width.
* ''g'': Value to use for the height.
* ''h'': First variable ID that should receive the tile data.
==== Window Size ====
//Player status: Supported// ✅
**Window Size** allows to retrieve the [[..:maniac#resolution|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:
* Selected variable ID: X size of the window
* Selected variable ID + 1: Y size of the window
It can be written as follow with the common TPC syntax: @sys.getInfo .winSize .dst v[1]
Raw writing: 3021, "", 0, 2, c
* ''3021'': Command code
* ''c'': First variable ID that should receive the X size of the window.
==== 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:
* Ignore Alpha Value: If ticked, the pixel data will be retrieved in the [[https://en.wikipedia.org/wiki/Web_colors|RRGGBB]] format. If unticked, the pixel data will be retrieved in the AARRGGBB format.
* X: X coordinate of the pixel that should have its colour retrieved, with the possibility to use a constant, a variable or variable redirection.
* Y: Y coordinate of the pixel that should have its colour retrieved, with the possibility to use a constant, a variable or variable redirection.
* Width: How many pixels in width should be retrieved, with the possibility to use a constant, a variable or variable redirection.
* Height: How many pixels in height should be retrieved, with the possibility to use a constant, a variable or variable redirection.
* Output Variable: First variable ID that should receive the pixel data.
Notes:
* The red (RR), green (GG) and blue (BB) values are on a 0~255 range, while the alpha value is on a -128~127 range.
* The retrieved alpha value is always equal to -1 if a valid pixel is retrieved.
* Retrieving the data of an out of bounds pixel will return the value 0.
The command can be written as follow with the common TPC syntax: @sys.getInfo .pixel 1, 2, 3, 4 .dst v[1] .ignoreA
Where:
* ''1'' corresponds to the X coordinate, with the possibility to replace the constant by a variable or variable redirection.
* ''2'' corresponds to the Y coordinate, with the possibility to replace the constant by a variable or variable redirection.
* ''3'' corresponds to the width, with the possibility to replace the constant by a variable or variable redirection.
* ''4'' corresponds to the height, with the possibility to replace the constant by a variable or variable redirection.
* ''v[1]'' corresponds to the first variable ID that should receive the pixel data.
* ''.ignoreA'' corresponds the ignore alpha property. If omitted, the alpha value will be present in the retrieved value.
Raw writing: 3021, "", a, 3, c, d, e, f, g, h
* ''3021'': Command code
* ''a'': Whether the values to use should be constants (default), variables or variable redirections:
* ''+1'' if the X coordinate to use should be a variable.
* ''+2'' if the X coordinate to use should be a variable redirection.
* ''+16'' if the Y coordinate to use should be a variable.
* ''+32'' if the Y coordinate to use should be a variable redirection.
* ''+256'' if the width to use should be a variable.
* ''+512'' if the width to use should be a variable redirection.
* ''+4096'' if the height to use should be a variable.
* ''+8192'' if the height to use should be a variable redirection.
* ''c'': Whether the alpha value should be present in the pixel data retrieved (0) or if it should be ignored (1).
* ''d'': Value to use for the X coordinate.
* ''e'': Value to use for the Y coordinate.
* ''f'': Value to use for the width.
* ''g'': Value to use for the height.
* ''h'': First variable ID that should receive the pixel data.
==== 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 [[https://github.com/EasyRPG/Player/issues/3689|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:
* Selected variable ID: Type of the event, where ''1'' corresponds to map event, ''2'' to common event and ''4'' to battle event.
* Selected variable ID + 1: ID of the map event/common event/troop.
* Selected variable ID + 2: Page of the event.
* Selected variable ID + 3: Type of the execution, where ''0'' corresponds to ''Action Button'', ''1'' corresponds to ''Player Touch'', ''2'' corresponds to ''Event Touch'', ''3'' corresponds to ''Autorun'', ''4'' corresponds to ''Parallel Process'', ''5'' corresponds to ''Call'', ''6'' corresponds to ''Begin Battle'' and ''7'' corresponds to ''Parallel (Battle)''.
* Selected variable ID + 4: Position of the command in the code of the event.
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:
* If the selected event is not a map event, the value returned for the page will be 0.
* The type of the execution is also set to 0 for battle events.
* The type of execution for map events (values 0~2) that can be interacted with depends on the type of execution set for the page, not on how the event is interacted with: for instance, executing the code of a Player Touch or Event Touch event by using the interaction key in front of them will still give a value of 1 or 2.
* If the nesting points to an event not in the interpreter queue, all retrieved values will be set to 0.
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
* ''3021'': Command code
* ''a'': Whether the value to use for the nesting should be a constant (0), a variable (256) or variable redirection (512).
* ''c'': First variable ID that should receive the type of the event.
* ''e'': Value to use for the nesting.
==== 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
* ''3021'': Command code
* ''c'': Variable ID that should receive the tileset ID.
==== 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:
* Target Type: Whether the target should be a hero (Actor) or the message box (Message).
* Dynamic: If ticked, the FaceSet of the hero will be the one currently in use in the game. If not ticked, the FaceSet of the hero will be the one defined in the database. This has no effect if the target is set to Message.
* ID: ID of the hero that should have its FaceSet retrieved, with the possibility to use a constant, a variable or variable redirection. This has no effect if the target is set to Message.
* Output String Variable: String variable ID that should receive the name of the FaceSet.
* Output Variable: Variable ID that should receive the index of the FaceSet sprite.
Notes:
* If the Target Type is set to Actor and that the selected Actor is invalid, an error will be displayed and the game will close.
* If the Target Type is set to Message and that no face is currently displayed, the name retrieved will be empty, while the index value retrieved will be the one of the last face displayed in the message box.
* If no face was ever displayed in the message box in the save file, then the value 0 will be retrieved.
TPC syntax:
* @sys.getInfo .face .actor[1] .dynamic .dst t[1], v[1] is the syntax when the target type is Actor, where:
* ''.actor[1]'' corresponds to the actor ID value, with the possibility to replace the constant by a variable or variable redirection.
* ''.dynamic'' to tell if the FaceSet to retrieve should be the current one, and can be omitted in which case it will be set to ''.static''.
* ''t[1]'' is the output string variable.
* ''v[1]'' is the output variable.
* @sys.getInfo .face .win .static .dst t[1], v[1] is the syntax when the target type is Message, where ''t[1]'' is the output string variable and ''v[1]'' the output variable.
Raw writing: 3021, "", a, 6, c, d, e, f, g
* ''3021'': Command code
* ''a'': Whether the value to use for the Actor ID should be a constant (0), a variable (1) or variable redirection (2).
* ''c'': String variable ID that should receive the FaceSet name.
* ''d'': Variable ID that should receive the index of the FaceSet.
* ''e'': Whether the target should be a hero (0) or the text box display (1).
* ''f'': Value to use for the Actor ID.
* ''g'': Whether the value to retrieve should be static (0) or dynamic (1).
==== 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:
* Target Type: Whether the target should be a hero (Actor) or a map event (Event).
* Dynamic: If ticked, the retrieved CharSet will be the one currently in use. If not ticked for heroes, the CharSet will be the one defined in the database while for events, it will be the one of the current page.
* ID: ID of the hero or event that should have its CharSet retrieved, with the possibility to use a constant, a variable or variable redirection.
* Output String Variable: String variable ID that should receive the name of the CharSet.
* Output Variable: Variable ID that should receive the index of the CharSet sprite.
Notes:
* If the Target Type is set to an invalid actor, an error will be displayed and the game will close.
* If the Target Type is set to Event:
* If the event targeted uses an upper tile from the ChipSet, the retrieved name will be empty and the index value will be the ID of the upper tile sprite.
* Selecting the event IDs 10001~10005 can be used to reference the instances Player, Boat, Ship, Airship and This Event.
* If the Player is used as the target and that the option Dynamic is ticked, the retrieved name will be empty and the index value will be 0. If Dynamic is not ticked, the data retrieved will be of the current sprite used by the hero.
* If a vehicle is used as the target and that the Dynamic option is used, the CharSet retrieved will be the one of the last Set Vehicle Graphic command used on the vehicle, or from the database if the command was never used. CharSets set through the Set Move Route command will not be retrieved.
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:
* ''[1]'' corresponds to the actor/event ID value, with the possibility to replace the constant by a variable or variable redirection.
* ''.dynamic'' to tell if the CharSet to retrieve should be the current one, and can be omitted in which case it will be set to ''.static''.
* ''t[1]'' is the output string variable.
* ''v[1]'' is the output variable.
Raw writing: 3021, "", a, 7, c, d, e, f, g
* ''3021'': Command code
* ''a'': Whether the value to use for the Actor ID should be a constant (0), a variable (1) or variable redirection (2).
* ''c'': String variable ID that should receive the CharSet name.
* ''d'': Variable ID that should receive the index of the CharSet.
* ''e'': Whether the target should be a hero (0) or an event (1).
* ''f'': Value to use for the Actor ID.
* ''g'': Whether the value to retrieve should be static (0) or dynamic (1).
==== Camera Position ====
//Player status: Supported //✅//; Coordinates on looping maps for the edges are incorrectly reported, see [[https://github.com/EasyRPG/Player/issues/3665|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:
* Selected variable ID: X position of the camera
* Selected variable ID + 1: Y position of the camera
Notes:
* Even if the map loops, the camera position is retrieved in the same way, and the camera position will be returned with positive values.
It can be written as follow with the common TPC syntax: @sys.getInfo .camera .dst v[1]
Raw writing: 3021, "", 0, 8, c
* ''3021'': Command code
* ''c'': First variable ID that should receive the X position of the camera.
==== 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
* ''3021'': Command code
* ''c'': Variable ID that should receive the screen shake value.
==== 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:
* Selected variable ID: Fade-in of the current music
* Selected variable ID + 1: Volume of the current music
* Selected variable ID + 2: Speed of the current music
* Selected variable ID + 3: Balance of the current music
* Selected string variable ID: Name of the current music
Notes:
* Even if the music that was played does not exist/was the music "(OFF)", the parameters will still properly be retrieved.
* The fade-in is internally set by RPG Maker in milliseconds, so the fade-in value retrieved will also be in milliseconds (e.g. a 5 seconds fade-in will be retrieved as the value 5000).
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
* ''3021'': Command code
* ''c'': String variable ID that should receive the name of the current music.
* ''d'': First variable ID that should receive the fade-in of the current music.
===== 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:
* The output picture will always be in the .png format, and will always have the .png extension appended to it.
* Output pictures are written at the root of the folder of the game, but it is possible to use ''/'' characters to write in folders (e.g. asking to output a picture as ''Picture/example'' will output the image as ''example.png'' in the Picture folder of the game).
* If the picture is asked to be output with a character that cannot be used in a filename (e.g. ''?''), no picture will be output.
* If the selected picture name is empty or asks to write a picture outside of the game folder by specifying ''../'', no picture will be output, and an error will be displayed forcing the game to close.
* If a picture is currently being displayed and that its source file gets overwritten, the picture displayed will not change, and attempting to display another picture pulled from the same source file will display the new picture using the same display than the currently displayed picture, as its graphic will be pulled from the picture list.
* Edited pictures through the Edit Picture or Edit Picture (Tile) commands no longer point to their original picture file, so they are not subject to this point. In the case of Edit Picture, it will work as long as the selected picture ID was targeted independently if pixels were actually written.
* Output pictures are subject to the file output limit of the patch (not more than ~3 file writing per second): if the file output limit is reached, the [[modified-maniac-commands#file-output-is-available|Conditional Branch: File output is available]] will be reported as false until it becomes possible again to write files.
==== 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 picture will have its first colour in the index set to a transparent colour not part of the screenshot.
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
* ''3026'': Command code
* ''filename'': Output File to use for the file to create. If a string variable or string variable redirection is used, this has no effect.
* ''a'': Whether a string (0), variable (16) or variable redirection (32) should be used for the filename.
* ''d'': If the Output File is pulled from a string variable or string variable redirection, value to use for the string variable ID.
==== 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:
* 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.
* Picture ID: Picture ID that should be taken to output, with the possibility to use a constant, a variable or variable redirection.
* Apply Picture Effect: If ticked, any colour difference that affects the picture due to a Tint Screen or Flash Screen command, as well as any differences due to the use of of the picture tint feature or picture flip will be present on the output file. If not ticked, no picture effect will be used on the output file.
Notes:
* Regular pictures as well as string pictures can be used for the command.
* If a picture was cut using the spritesheet feature, only the selected sprite will be output.
* Pictures that were edited through the Edit Picture or Edit Picture (Tile) command will have their edited pixels output.
* Other picture parameters than those mentioned for the Apply Picture Effect section do not affect how the picture will be output.
* The index 0 colour of the picture ID will be written as an index 0 transparent colour on the output picture, independently of the colour of the original picture.
* If the selected picture ID does not contains any pixel (picture ID with no picture), a 0 kilobyte file will be written on the selected Output File, after which the game will display an error and close.
Common TPC syntax: @img.save .pic 1 .dynamic .dst "filename"
Where:
* ''1'' corresponds to the Picture ID, with the possibility to use a constant, a variable or variable redirection.
* ''filename'' corresponds to the Output File, with the possibility to use a string, a string variable or string variable redirection.
* ''.dynamic'' tells that picture effects should be applied. If omitted, it will turn into ''.static'' and picture effects will not be applied.
Raw writing: 3026, "filename", a, 1, c, d, e
* ''3026'': Command code
* ''filename'': Output File to use for the file to create. If a string variable or string variable redirection is used, this has no effect.
* ''a'': Dictates whether constants, variables or variable redirections should be used:
* ''+1'' if the Picture ID should come from a variable.
* ''+2'' if the Picture ID should come from a variable redirection.
* ''+16'' if the Output File should come from a string variable.
* ''+32'' if the Output File should come from a string variable redirection.
* ''c'': Value to use for the Picture ID.
* ''d'': If the Output File is pulled from a string variable or string variable redirection, value to use for the string variable ID.
* ''e'': Whether picture effects should not be applied (0) or be applied (1).
===== 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 [[https://bellard.org/quickjs/|QuickJS Javascript Engine]] to be able to execute JavaScript code, and as such follows its [[https://bellard.org/quickjs/quickjs.pdf|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:
* s[123] = 1 to alter the status of a switch (here, 123), with 0 to set it OFF and 1 to set it ON. The switch ID can be replaced by a variable (''s[v[123]]'').
* v[123] = 456 to change the value of a variable (here, 123 being set to 456). The variable ID can be replaced by a variable (''v[v[123]]'').
* t[123] = 'hello' to change the text of a string variable (here, 123 being set to hello). The string variable ID can be replaced by a variable (''t[v[123]]'').
The command has the following fields:
* Source Text: Code to execute, with the possibility to have it come from the command, from a string variable or from a string variable redirection.
* Variable that receive return value: Switches, switch redirections, variables, variable redirections, string variables and/or string variable redirections that should receive output values from the executed code, with as many output values as wanted. For instance, if you only execute the code ''[1, "a", 2]'' and that you set the output to be switch 10, string variable 20 and variable 30, the switch 10 will receive the value ON, the string variable 20 the value a and the variable 30 the value 2.
FIXME //Provide more examples and info on using JavaScript and making it communicate with the engine.//
Notes:
* If a command with an incorrect syntax is executed, the console will be opened and will display an error highlighting the syntax issue. This does not halt the game.
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:
* ''code'' corresponds to the JS code to execute, with the possibility to replace it by a string variable or string variable redirection.
* ''[s[1], s[v[2]], v[3], v[v[4]], t[5], t[v[[6]]] corresponds to the variables that should receive any output values. It is possible to set none by removing the brackets entirely.
Raw writing for the command code 3030: 3030, "code", a, b, 0, 0, e, f, g
* ''code'': If the code is set to come from the command, code to execute.
* ''a'': Whether the code to use should come directly from the command (0), from a string variable (1) or from a redirection of string variable (2).
* ''b'': If the code does not come from the command, value to use for the code.
* ''e'': How many values should be set as outputs.
* ''f'': Type of the selected output:
* ''0'': Switch
* ''1'': Switch redirection
* ''2'': Variable
* ''3'': Variable redirection
* ''4'': String variable
* ''5'': String variable redirection
* ''g'': Value to use for the selected output.
The values ''f'' and ''g'' are repeated up until the number of selected outputs.
Raw writing for the command code 3031: 3031, "code"
* ''3031'': Command code
* ''code'': JavaScript code to execute.
===== Zoom Screen =====
//Player status: Not yet supported ❌; A work-in-progress pull request to implement the command exists: [[https://github.com/EasyRPG/Player/pull/3499|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:
* Center X: On which X coordinate should the screen be centered, with the possibility to use a constant, a variable or variable redirection.
* Center Y: On which X coordinate should the screen be centered, with the possibility to use a constant, a variable or variable redirection.
* Scale: Which zoom scaling should be used, with the possibility to use a constant, a variable or variable redirection.
* Layer: Determines which layers should be zoomed, with the possibility to use a constant, a variable or variable redirection. The following layers values can be used:
* ''1'': Elements on the parallax background layer will be zoomed.
* ''2'': Elements on the tileset layer will be zoomed, as well as elements from the previous layer.
* ''3'': Elements on the below player events layer will be zoomed, as well as elements from all previous layers.
* ''4'': Elements on the player layer/same as character events layer will be zoomed, as well as elements from all previous layers.
* ''5'': Elements on the upper tiles layer will be zoomed, as well as elements from all previous layers.
* ''6'': Elements on the above player events layer will be zoomed, as well as elements from all previous layers.
* ''7'': Elements on the weather effects layer will be zoomed, as well as elements from all previous layers.
* ''8'': Elements on the animation layer will be zoomed, as well as elements from all previous layers.
* ''9'': Elements on the message window layer will be zoomed, as well as elements from all previous layers.
* ''10'': Elements on the timer layer will be zoomed, as well as elements from all previous layers.
* Frame: How many frames should be needed to complete the zoom, with the possibility to use a constant, a variable or variable redirection.
* Wait for Completion: Whether the game should wait for the zoom to finish before continuing processing the code of the event.
Notes:
* The Center X and Center Y set will not allow to zoom out of the screen: their center will always be set to not zoom on a part of the screen where nothing is rendered.
* If the Center X or Center Y is set to a negative value and that the Scale is set to 302 or more, then the negative Center value will use the center of the screen for its value instead of its actual value.
* Setting the Scale to a value below 100 will not zoom out the screen.
* Setting the Scale to a value above 24000 will not do any zoom.
* If the layer is set to a value not on the [1;10] range, no zoom will occur.
* The zoom only affects the overworld, it does not affect battles and menus.
* The zoom properties are kept in the save file.
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:
* ''1'' corresponds to the Center X, with the possibility to replace the constant by a variable or variable redirection.
* ''2'' corresponds to the Center Y, with the possibility to replace the constant by a variable or variable redirection.
* ''3'' corresponds to the Scale, with the possibility to replace the constant by a variable or variable redirection.
* ''4'' corresponds to the Layer, with the possibility to replace the constant by a variable or variable redirection.
* ''5'' corresponds to the Frame, with the possibility to replace the constant by a variable or variable redirection.
* ''.wait'' corresponds the Wait for Completion property, and can be omitted in which case the property will not be set.
Raw writing: 3032, "", a, b, c, d, e, f, g
* ''3032'': Command code
* ''a'': Defines if the values to use are constants, variables or variable redirections:
* ''+1'' if the Center X to use should be a variable.
* ''+2'' if the Center X to use should be a variable redirection.
* ''+16'' if the Center Y to use should be a variable.
* ''+32'' if the Center Y to use should be a variable redirection.
* ''+256'' if the Scale to use should be a variable.
* ''+512'' if the Scale to use should be a variable redirection.
* ''+4096'' if the Frame to use should be a variable.
* ''+8192'' if the Frame to use should be a variable redirection.
* ''+65536'' if the Layer to use should be a variable.
* ''+131072'' if the Layer to use should be a variable redirection.
* ''b'': Value to use for the Center X.
* ''c'': Value to use for the Center Y.
* ''d'': Value to use for the Scale.
* ''e'': Value to use for the Frame.
* ''f'': Value to use for the Layer.
* ''g'': Whether Wait for Completion should be disabled (0) or enabled (1).
===== 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:
* If the console is opened while the game is in window mode, the console will be opened by trying to not cover the area of the game screen.
* If the console is opened while the game is in fullscreen, the console will be opened behind the game screen.
* If this console is attempted to be manually closed by the user, the game will also be closed.
* Resetting the game will close the console.
* The console status is not stored in the save file, and loading a save file will not alter the state of the console.
* The console is also used by the Script command: if the JS formatting is incorrect, the console will be opened and will display an error about the formatting.
==== 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:
* Output Text: Text that should be output in the console, with the possibility to define it as part of the command, or use a string variable or string variable redirection.
* Extract Text: If ticked, the text markers ''\v[0]'', ''\n[0]'', ''\t[0]'', ''\SelfV[0]'', ''\SelfT[0]'' will be able to be used in messages.
* Hex: If Extract Text and Hex are both ticked, values displayed using a variable or self variable text marker will be converted to the hexadecimal format (alphabet characters are in lower case).
* Disable Linebreak: If ticked, the message that will be output will lack a linejump at its end, meaning that if another message is output after it, it will be displayed on the same line.
Notes:
* Other text markers than those mentioned in the Extract Text section as well as ExFont characters cannot be used in the console, and will be interpreted as pure text.
* If Extract Text is enabled and that an invalid actor is attempted to be displayed, an error will be displayed forcing the game to close.
TPC syntax: @console .out "string" .extract .hex .nolb
Where:
* ''string'' corresponds to the text to output, with the possibility to either use text, a string variable or a string variable redirection.
* ''.extract'' corresponds to the Extract Text Parameter. If omitted, it will not be set.
* ''.hex'' corresponds to the Hex Parameter. If omitted, it will not be set.
* ''.nolb'' corresponds to the Disable Linebreak Parameter. If omitted, it will not be set.
Raw writing: 3033, "string", a, 4, c, d
* ''3033'': Command code
* ''string'': If the string to display is set to come from the command, text to output.
* ''a'': Defines if the values to use are constants, variables or variable redirections:
* ''+256'' if the string to use should be a string variable.
* ''+512'' if the string to use should be a string variable redirection.
* ''c'': Defines which parameters should be applied:
* ''+1'' if Extract Text should be applied.
* ''+2'' if Hex should be applied.
* ''+4'' if Disable Linebreak should be applied.
* ''d'': If the string to use is a string variable or string variable redirection, ID of the string variable.
==== 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:
* Variable that receive input text: String variable that should receive the text input by the user, with the possibility to use a string variable or string variable redirection.
* Maximum length of input text: How many characters can be typed by the user, with the possibility to use a constant, variable or variable redirection.
* Extract Text: If ticked, typing the text markers ''\v[0]'', ''\n[0]'', ''\t[0]'', ''\SelfV[0]'', ''\SelfT[0]'' will convert those to their values before being sent to the string variable.
* Hex: If Extract Text and Hex are both ticked, values from variables and self variables text markers will be converted to the hexadecimal format (alphabet characters are in lower case).
Notes:
* The game will be put on hold until the Enter key is pressed.
* Setting the maximum length of input text to a null or negative value will not put any length limit.
* The maximum length of input text seems to be offset by -2, for some reason: for instance, if you want to set the limit to 26 characters, you will need to set it to 28.
* Due to this issue, setting the maximum length to 2 will make the string variable not receive anything, due to the actual limit being set to 0, while setting it to 1 will lead to an error display forcing the game to close (as the game will try to actually set the limit to -1).
* Text input in the console is actually tracked whenever text is typed in the console, not just when Input is in use:
* Typing text before using Input will actually be added to the next input text, with the possibility for the user to erase the previously written text (except any Enter key press).
* Text written past the character limit will be able to be used for a next Input, it is not lost.
* As Input waits for the Enter key to be pressed and that keys are tracked outside of the Input sequence, any Enter key press will be registered as a different text input that should be used the next time Input is used.
* Other text markers than those mentioned in the Extract Text section as well as ExFont characters will be interpreted as pure text.
* If Extract Text is enabled and that an invalid actor is typed, an error will be displayed forcing the game to close.
TPC syntax: @console .in t[1] .max 2 .extract .hex
Where:
* ''t[1]'' corresponds to the string variable that should receive input text, with the possibility to use a string variable or string variable redirection.
* ''2'' corresponds to the maximum length, with the possibility to use a constant, variable or variable redirection.
* ''.extract'' corresponds to the Extract Text Parameter. If omitted, it will not be set.
* ''.hex'' corresponds to the Hex Parameter. If omitted, it will not be set.
Raw writing: 3033, "", a, 3, c, d, e
* ''3033'': Command code
* ''a'': Defines if the values to use are constants, variables or variable redirections:
* ''+256'' if the string variable that should receive the input should be a string variable redirection.
* ''+4096'' if the maximum text length to use should be a variable.
* ''+8192'' if the maximum text length to use should be a variable redirection.
* ''c'': Defines which parameters should be applied:
* ''+1'' if Extract Text should be applied.
* ''+2'' if Hex should be applied.
* ''d'': Value to use for the string variable that should receive input.
* ''e'': Value to use for the maximum text length.
==== 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:
* Change Foreground Color: If ticked, the colour of the text will be changed according to the selected foreground colour value.
* Change Background Color: If ticked, the background colour of the text will be changed according to the selected background colour value.
* Foreground Color: Colour of the text to use, with the possibility to use a constant, variable or variable redirection.
* Background Color: Background colour to use, with the possibility to use a constant, variable or variable redirection.
Notes:
* The following values can be used to select colours:
* ''0'': Black
* ''1'': Blue
* ''2'': Green
* ''3'': Aqua
* ''4'': Red
* ''5'': Purple
* ''6'': Yellow
* ''7'': White
* ''8'': Gray
* ''9'': Light blue
* ''10'': Light green
* ''11'': Light aqua
* ''12'': Light red
* ''13'': Light purple
* ''14'': Light yellow
* ''15'': Bright white
* The selected colour is processed on 4-bit: as such, any value outside of the [0;15] range will loop back to be on said range.
* The default text colour is White while the default background colour is Black.
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
* ''3033'': Command code
* ''a'': Defines if the values to use are constants, variables or variable redirections:
* ''+256'' if the Foreground Color to use should be a variable.
* ''+512'' if the Foreground Color to use should be a variable redirection.
* ''+4096'' if the Background Color to use should be a variable.
* ''+8192'' if the Background Color to use should be a variable redirection.
* ''c'': Defines which elements should have their colour changed:
* ''+8'' if the text should have its colour changed.
* ''+16'' if the background colour should change.
* ''d'': Value to use for the Foreground Color.
* ''e'': Value to use for the Background Color.
===== 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:
* Operation: Whether the value of a setting should be retrieved (Get) or if the setting should be set (Set).
* Type: Which setting should be retrieved or set:
* Screen Mode: Whether the engine is in window mode (0) or in fullscreen mode (1).
* Window - Zoom: In window mode, which zoom level is used for the window, with the range of value accepted being [1;4].
* Window - Use interpolation: In window mode, whether interpolation should not be used (0) or if it should be used (1).
* Window - Keep size within display: In window mode, whether the size of the window should not be kept within display (0) or if should be kept within display (1).
* Fullscreen - Allow uneven pixel size: In fullscreen mode, whether having an uneven pixel size should be disallowed (0) or allowed (1). ⚠️// The option that needs to be set in the Maniac editor to assign this parameter is Fullscreen - Ignore aspect ratio for stretching, not Fullscreen - Allow uneven pixel size.//
* Fullscreen - Ignore aspect ratio for stretching: In fullscreen mode, whether the aspect ratio for stretching should not be ignored (0) or if it should be ignored (1). ⚠️// The option that needs to be set in the Maniac editor to assign this parameter is Fullscreen - Use interpolation, not Fullscreen - Ignore aspect ratio for stretching.//
* Fullscreen - Use interpolation: In fullscreen mode, whether interpolation should not be used (0) or if it should be used (1). ⚠️// The option that needs to be set in the Maniac editor to assign this parameter is Fullscreen - Allow uneven pixel size, not Fullscreen - Use interpolation.//
* Audio - Volume: Volume of the engine. The range of value accepted is [0;100].
* Show FPS: Whether FPS should not be shown (0) or if they should be shown (1).
* Save current setting as default: If set to 1 (always the default when booting a game), changing a setting will save all settings globally. If set to 0, changed settings will only apply to the current session.
* Operand: Value that should be used to either retrieve or set the setting. A variable or variable redirection can be used for both, while it is also possible to use a constant to set a value.
Notes:
* The settings set are not saved in the game folder but in a shared folder on the user machine, meaning those settings will be shared across all Maniac Patch games (those settings will not affect vanilla English RPG Maker 2003 games).
* If the screen mode was changed outside of the Control Media Option or the settings menu (use of the command Call System Functions or Toggle Fullscreen Mode, user pressing the F4 key), setting a value to the parameter Window - Zoom, Window - Keep size within dipslay or Show FPS will change the screen mode of the game back to the screen mode set as a setting.
* Fullscreen settings as well as the setting Window - Use interpolation will not directly take effect until the screen mode is changed.
* If a setting is attempted to be set to an out of bounds value, the closest valid value will be used instead.
* For the Audio - Volume setting, attempting to set some specific values will instead set those values to the requested value minus 1 (seemingly due to a rounding error). This happens for the following values: 1, 3, 4, 6, 8, 11, 12, 13, 16, 19, 21, 22, 24, 26, 29, 32, 35, 38, 39, 41, 42, 44, 45, 47, 48, 51, 52, 53, 57, 58, 59, 63, 64, 65, 69, 70, 71, 76, 77, 78, 82, 83, 84, 88, 89, 90, 94, 95, 96.
Raw writing: 3038, "", a, b, c, d
* ''3038'': Command code
* ''a'': If the command is set to retrieve settings, Whether the value to use for the setting should be a variable (0) or variable redirection (256). If the command is set to define settings, Whether the value to use for the setting should be a constant (0), a variable (256) or variable redirection (512).
* ''b'': Whether a setting should be retrieved (0) or set (1).
* ''c'': Type of setting to use:
* ''0'': Screen Mode
* ''1'': Window - Zoom
* ''2'': Window - Use interpolation
* ''3'': Window - Keep size within display
* ''4'': Fullscreen - Use interpolation
* ''5'': Fullscreen - Allow uneven pixel size
* ''6'': Fullscreen - Ignore aspect ratio for stretching
* ''7'': Show FPS
* ''8'': Save current setting as default
* ''9'': Audio - Volume
* ''d'': Value to use for the setting to set or retrieve.