User Tools

Site Tools


user:player:easyrpg-commands

This is an old revision of the document!


EasyRPG commands

This page lists the commands that have been added to the EasyRPG Player, as well as commands that received new parameters.

To be able to use those commands in a game, the EasyRPG flag must be set in the EasyRPG.ini file of the game.

As of now, those commands can only be used by writing them in raw format, or by using the EasyRPGCommands plugin of the Maniac Patch editor.

The TestGame-EasyRPG includes test cases for those commands, which can be used as references if needed:

New commands

Trigger Event At

The Trigger Event At command allows to call the current page of an event by specifying its coordinates.

The command has the following fields:

  • X: X coordinate of the event to trigger, with the possibility to use a constant, a variable or variable redirection.
  • Y: Y coordinate of the event to trigger, with the possibility to use a constant, a variable or variable redirection.
  • Face Hero: If ticked, the event should turn to face the player.

Notes:

  • The event will be processed as if it was an event interaction. As such:
    • The current page of the event will be called
    • If the event on the selected tile is not active or was erased, it will not be called
    • The Conditional Branch: Event was triggered by decision key command will always be returned true
    • The timing event compared to a Call Event command can be slightly different
  • Only events that use Action Button trigger and the Same as Characters priority can be called.
  • If no event exists on the selected tile, nothing will happen.
  • If several events are present on the same tile, those events will all be called in ID order.
  • The player and vehicles are not events and cannot be triggered by this command.
  • This command is not subject to the 1,000 event call limit of the Call Event command.

Raw writing:

2002, "", a, b, c, d, e
  • 2002: Command code
  • a: Whether the X Coordinate to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the X Coordinate.
  • c: Whether the Y Coordinate to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • d: Value to use for the Y Coordinate.
  • e: Whether the triggered event should continue facing its current direction (0) or if it should face the hero (1).

Pathfinder

The Pathfinder command allows to make an event move to specified coordinates by avoiding obstacles that are on the route.

The command has the following fields:

  • Event ID: ID of the event that should move, with the possibility to use a constant, a variable or variable redirection. The following IDs can be used to reference specific instances:
    • 10001: Player
    • 10002: Boat
    • 10003: Ship
    • 10004: Airship
    • 10005: This Event
  • Target X: X coordinate that the event should try to go to, with the possibility to use a constant, a variable or variable redirection.
  • Target Y: Y coordinate that the event should try to go to, with the possibility to use a constant, a variable or variable redirection.
  • Max Iterations: How many iterations are done for the pathfinding before giving up, with the possibility to use a constant, a variable or variable redirection. Reducing the value of this parameter will give better performances, but can fail to find a route.
  • Max Route Steps: How many steps can the event take at most, with the possibility to use a constant, a variable or variable redirection. If it set to -1, no step limit will be applied.
  • Allow diagonal movement: If set, the event will be able to move diagonally to try to reach its destination.
  • Skip steps if cannot move: If set and that the event cannot move, the processing of the route will be stopped.
  • Debug output to terminal and logfile: If set, debug information about the command will be printed in the EasyRPG-Player.log file.
  • Pathfinding Flags: What type of pathfinding algorithm to use. The following algorithms can be chosen:
    • Find path and continue: this algorithm is useful when the command is only used once.
    • Wait, until event stops moving, then find path and continue: this algorithm suspends the interpreter until the current move action is finished, and is useful when used in loops to save resources.
    • Skip pathfinding when the event is currently moving: this algorithm is useful when doing a synchronisation of events by yourself, for instance with the Wait for Single Movement command.
  • Move Frequency: Pace at which the event should move between 1 and 8, with the possibility to use a constant, a variable or variable redirection.
  • Event Ignore List: Defines a list of events that should not be considered as obstacles when calculating the route. If set to use a variable or variable redirection, the first value retrieved will define the size of the array of events to ignore, and the variables after it will define which events should be ignored.

Notes:

  • The route is calculated upon use of the command, so if the terrain changes or if an event moves altering the route after the start, the selected route may try to make you go into the new obstacle.
  • If the selected event does not exist, the warning EasyRpgPathFinder: Unknown event with id [ID] will be displayed.

Raw writing:

2003, "", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o
  • 2003: Command code
  • a: Whether the Event ID to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Event ID.
  • c: Whether the Target X to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • d: Value to use for the Target X.
  • e: Whether the Target Y to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • f: Value to use for the Target Y.
  • g: Whether the Max Iterations to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • h: Value to use for the Max Iterations.
  • i: Whether the Max Route Steps to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • j: Value to use for the Max Route Steps.
  • k: Determines the parameters:
    • +1 if the pathfinding algorithm to use is "Wait, until event stops moving, then find path and continue". This overrides other pathfindings algorithms.
    • +2 if diagonal movements are allowed.
    • +4 if debug output is enabled.
    • +8 if the pathfinding algorithm to use is "Skip pathfinding when the event is currently moving". This overrides the default pathfinding algorithm "Find path and continue".
    • +16 if skip steps if cannot move is enabled.
  • l: Whether the Event Ignore List to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • m: If the Event Ignore List is set to constant, number of values to ignore. Otherwise, value to use for the Event Ignore List.
    • After m, if the Event Ignore List was set to 0, all arguments will be listed from here, after which the last two parameters will be listed.
  • n: Whether the Move Frequency to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • o: Value to use for the Move Frequency.

Wait for Single Movement

The Wait for Single Movement command allows to wait for one event to finish moving before continuing processing the code of the event.

While RPG Maker 2000 and RPG Maker 2003 already include a Wait for All Movement command, this command can easily lead to softlocks in game if one event gets stuck moving.

The command has the following fields:

  • Event ID: ID of the event that should have its movement end before continuing processing the event, with the possibility to use a constant, a variable or variable redirection. The following IDs can be used to reference specific instances:
    • 10001: Player
    • 10002: Boat
    • 10003: Ship
    • 10004: Airship
    • 10005: This Event
  • Failure Count: How many failures are allowed before giving up the movement wait, with the possibility to use a constant, a variable or variable redirection. If the Failure Count is set to 0, the game will not continue until the selected event finishes moving.
  • Output Variable: Variable that should receive the result of the wait, with the possibility to use a constant, a variable or variable redirection. If the wait was successful, the value 1 should be returned, otherwise, the value 0 will be returned.

Notes:

  • If the selected event does not exist, the warning EasyRpgWaitForSingleMovement: Unknown event with id [ID] will be displayed.

Raw writing:

2051, "", a, b, c, d, e, f
  • 2051: Command code
  • a: Whether the Event ID to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Event ID.
  • c: Whether the Failure Count to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • d: Value to use for the Failure Count.
  • e: Whether the Output Variable to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • f: Value to use for the Output Variable.

Set Interpreter Flag

ℹ️ This command is not present in the EasyRPGCommands plugin, and can only be written through raw writing as of now.

Current issues with the command: EasyRPG Player issue #3659

The Set Interpreter Flag command allows to temporarily enable or disable a patch flag for the processing of an event. This can for instance be used if you want to enable a patch only to do a specific action without further altering the behaviour of the game.

The command has the following fields:

  • Patch name: Name of the patch to enable or disable. The following patch names can be used:
    • dynrpg to enable or disable the DynRPG flag. DynRPG commands that can be used if the EasyRPG flag is set will not be affected.
    • maniac to enable or disable the Maniac Patch flag.
    • common-this to enable the Common This Event flag. It currently cannot be used to disable the flag.
    • key-patch to enable or disable the Key Patch flag.
    • rpg2k3-cmds or rpg2k3-commands to enable or disable the processing of RPG Maker 2003 commands.
    • rpg2k-battle to start a battle with the RPG Maker 2000 battle system.
  • Patch status: Whether the selected patch should be disabled (0) or enabled (1), with the possibility to use a constant, a variable or variable redirection.

Notes:

  • The name of the patch must match, but is not case-sensitive.
  • If the selected patch name does not exist, nothing will happen.
  • Only the event that uses the command as well as any events called by this event will use the selected flag parameter.

Raw writing:

2053, "patchname", a, b
  • 2053: Command code
  • patchname: Which patch should be altered for the processing of the event.
  • a: Whether the Flag Status to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Flag Status.

Process JSON

ℹ️ This command relies on the nlohmann_json dependency used by the EasyRPG Player, which is not shipped on homebrew platforms (Wii, Wii U, 3DS, PS Vita, Switch). As such, attempting to use this command on one of those platforms will fail and will display the warning "CommandEasyRPGProcessJson: JSON not supported on this platform".

Current issues with the command: EasyRPG Player issue #3657

The Process JSON command allows to retrieve values from a string variable to process them as-if it was a JSON file.

The command has the following fields:

  • Operation: Determines what type of operation should be done, with the possibility to use a constant, a variable or a variable operation. The following operations can be used:
    • 0 - Get Value: Returns the value of the object pointed by the JSON path. If the JSON path was set to /, the entire JSON will be returned.
    • 1 - Set Value: Sets the value of the variable to the object that was pointed by the JSON path.
    • 2 - Get Length: Returns the numbers of elements of the JSON from the specified JSON path. If the specified JSON path has no element or does not exist, the value returned will be 0.
    • 3 - Get Keys: Returns the name of the elements of the JSON from the specified JSON path. If the specified JSON path points to a normal object an object that does not exist, the value returned will be [].
    • 4 - Get Type: Returns the type of the element that was pointed by the JSON path. If an object does not exist, the value returned will be 0 for a variable and an empty result for a string variable. The following types can be retrieved (where the type on the left will be the result if the output is set to a string variable, and the value on the right the value assigned if set to a variable):
      • object, 1
      • array, 2
      • string, 3
      • number, 4
      • boolean, 5
      • null, 6
    • 5 - Remove Key: Removes the selected element that was pointed by the JSON path. If the selected path is valid but the object does not exist, nothing will happen. If the root is selected as the target, the content of the JSON will end up being {}.
    • 6 - Array Push: Adds the selected value to the array pointed by the JSON path. If the pointed element is not an array, it will not work.
    • 7 - Array Pop: Removes the last entry of the array pointed by the JSON path to put in the target variable. If the array is empty, a warning will be displayed.
    • 8 - Contains: Returns the value 1 if the selected JSON path exists, and returns 0 otherwise.
  • JSON String: Determines where the JSON string to use is sourced. It can either be directly set through the command, or be set through a string variable or redirection of string variable.
  • Target Variable Type: Determines the type of the target, with the possibility to use a constant, a variable or variable redirection. 0 corresponds to a switch, 1 to a variable and 2 to a string variable.
  • Target Variable ID: ID that should be used for the target, with the possibility to use a constant, a variable or variable redirection.
  • JSON Path: Determines where the JSON path should point to within the selected JSON string. It can either be directly set through the command, or be set through a string variable or redirection of string variable. It is possible to point at the root of the JSON by specifying /.
  • Parser settings: Determines if a variable value or string variable value can be used inside the JSON Path. The options are the following:
    • No Parsing: Using \V[] or \T[] as part of a JSON path will be interpreted as text.
    • Parse Command Codes (\V[] etc): Using \V[] or \T[] as part of a JSON path will be interpreted as the value of the variable and as the value of the string variable, respectively.
    • Parse Command Codes (\V[] etc., numbers in Hex): Using \V[] or \T[] as part of a JSON path will be interpreted as the value of the variable and as the value of the string variable, respectively, with those values converted to hexadecimal when relevant (hexadecimal letters in lowercase).
  • Pretty Print JSON: If set and that a string variable should receive the result, the JSON will be written with pretty print set (linejumps and spacing).
  • Wrap "Get Keys" list in { "keys": [] }: If set and that the operation used was Get Keys, the keys obtained will be added within an array called keys.

Notes:

  • If the selected source JSON does not follow the expected syntax of a JSON, a warning mentioning so will be displayed and the command will fail.
  • The JSON Path is case-sensitive, and a warning will be displayed if no path or if a non-existing object to retrieve was specified.
  • If an operation is used that should alter the source JSON, the source JSON will be altered to use the optimised JSON formatting (no space, all on one line), even if Pretty Print JSON was selected.
  • If the operation used is supposed to give a result to the selected variable type, a switch will only be set to ON if the result it is supposed to receive is 1 and otherwise be set to OFF, and for a variable, it will only receive a value if the result it is supposed to receive is a value, and otherwise will be set to 0.

Raw writing:

2055, "string", a, b, c, d, e, f, g, h, i, j, k
  • 2055: Command code
  • "string": JSON of the command followed by the JSON Path, with both attached.
  • a: Whether the Operation Mode to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Operation Mode.
  • c: Whether the JSON to use should come directly from the command (0), from a string variable (1) or from a redirection of string variable (2).
  • d: If the JSON to use is set to come from the command, number of characters of the JSON. Otherwise, value to use for the string variable or redirection of string variable for the JSON.
  • e: Whether the Target Var Type value to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • f: Value to use for the Target Var Type.
  • g: Whether the Target Var ID value to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • h: Value to use for the Target Var ID.
  • i: Whether the JSON Path to use should come directly from the command (0), from a string variable (1) or from a redirection of string variable (2).
  • j: If the JSON Path to use is set to come from the command, number of characters of the JSON Path. Otherwise, value to use for the string variable or redirection of string variable for the JSON Path.
  • k: Determines the parameters:
    • +1 if command codes should be parsed.
    • +2 if command codes should be parsed, with numbers in hexadecimal. It overrides the previous parsing setting.
    • +4 if Pretty Print JSON should be applied.
    • +8 if Get Keys lists should be wrapped with
      { "keys": []}

      .

Clone Map Event

The Clone Map Event allows to clone an event from the current map or from another map to the current map.

The command has the following fields:

  • Source Map: Map ID of the event that should be cloned, with the possibility to use a constant, a variable or variable redirection. If the Source Map is set to 0, the current map ID will be used.
  • Source Event ID: Source Event ID that should be cloned, with the possibility to use a constant, a variable or variable redirection. If the map to clone events from is the current map, it will take into account cloned events and destroyed events for the events that can be cloned.
  • Target X: X coordinate where the cloned event should be placed, with the possibility to use a constant, a variable or variable redirection.
  • Target Y: Y coordinate where the cloned event should be placed, with the possibility to use a constant, a variable or variable redirection.
  • Target Event ID: Event ID to use for the cloned event, with the possibility to use a constant, a variable or variable redirection. If an event already exists on the selected ID, it will be replaced. If the selected ID is null or negative, then the ID that will be used will be last event ID present on the map + 1.
  • New Event Name: Name that should be used for the new event. If left blank, the name of the source event will be used.

Notes:

  • If the selected Source Map does not exist, an error will be displayed and the Player will close.
  • If the selected Source Map exists but not the Source Event ID, the warning CloneMapEvent: Event ID [ID] not found on source map [ID] will be displayed.
  • It is not possible to clone the player, a vehicle or the instance This Event.
  • The command can clone erased events and cloned events, but not events have been destroyed.
  • Cloned events on the current map are kept in the save file, but those changes are not permanent: the actual map file will not be altered, and leaving and reentering the map will reload all events present on the map.

Raw writing:

2056, "eventname", a, b, c, d, e, f, g, h, i, j, k, l
  • eventname: Name to use for the cloned event.
  • a: Whether the Source Map to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Source Map.
  • c: Whether the Source Event ID to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • d: Value to use for the Source Event ID.
  • e: Whether the Target X to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • f: Value to use for the Target X.
  • g: Whether the Target Y to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • h: Value to use for the Target Y.
  • i: Whether the Target Event ID to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • j: Value to use for the Target Event ID.
  • k: Whether the New Event Name to use should be defined as part of the command (0), should come from a string variable (1) or from a redirection of string variable (2).
  • l: Value to use for the New Event Name. If the New Event Name comes from the command itself, this parameter does not matter.

Destroy Map Event

The Destroy Map Event command allows to entirely remove an event from the current map.

When using the command Erase Event on an event, the event is not actually erased, it is just disabled: it is still possible to call the event, and it is possible to bring it back through the Return function of the Erase Event command of the Maniac patch.

The Destroy Map Event command, meanwhile, completely removes the event: the event will no longer exist and will not be able to be called. It can be combined with the command Clone Map Event to remove events that were cloned once they are no longer needed.

The command only has one field, which consists of the ID of the event, with the possibility to use a constant, a variable or variable redirection.

Notes:

  • It is possible to specify the event ID 0 or 10005 to specify the instance This Event.
  • Targetting the event IDs 10001 to 10004 will not target the player or vehicles.
  • If the selected event ID does not exist, the warning "DestroyMapEvent: Event ID [ID] not found on current map" will be displayed.
  • Destroyed events on the current map are kept in the save file, but those changes are not permanent: the actual map file will not be altered, and leaving and reentering the map will reload any event present on the map that was destroyed.

Raw writing:

2057, "", a, b
  • 2057: Command code
  • a: Whether the Event ID to use should be a constant (0), a variable (1) or a redirection of variable (2).
  • b: Value to use for the Event ID.

Modified EasyRPG commands

Call System Functions (Open Save Menu)

Since the Maniac patch, the Open Save Menu command was reworked to also allow opening other menus, and was renamed to Call System Functions.

EasyRPG Player assigns a menu value to open one of its exclusive menus.

Open Language Menu

ℹ️ This command is not present in the EasyRPGCommands plugin, and can only be written through raw writing as of now. As it does not take any parameter, you can directly copy it from the TestGame-EasyRPG if needed.

The Open Language Menu function allows to open the language menu of the EasyRPG translation feature.

If this command is used and at least one translation exists, the language menu will be opened. Otherwise, it's the save menu that will be opened.

Raw writing:

11910, "", 207
user/player/easyrpg-commands.1790527427.txt.gz · Last modified: by carbonara

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki