User Tools

Site Tools


development:technical-details:patches:dynrpg

This is an old revision of the document!


DynRPG

DynRPG is a patch made by Cherry for RPG Maker 2003 v. 1.08, with the ambitious goal of creating a C++ SDK for RPG Maker 2003, and allows creating many different plugins. Plugins usually either alter game mechanics (quick patches), alter a game behaviour if a switch or variable is set to a specific value, or add a new command that can be used through the comment command.

Unfortunately, DynRPG plugins are Windows/RPG_RT-specific (read of dll files, editing of specific RPG_RT values), and as such require to be reimplemented in the EasyRPG Player through high level emulation, with patches needing to be individually analysed and ported. Games can even combine several DynRPG patches or use unique ones not seen anywhere else, making game support harder. Quick patches are also a problem, as they can pollute the code base depending on how they are reimplemented.

As of version 0.8.1.1, the EasyRPG Player only has support for the DynText plugin, as well as support for some individual commands that should not matter for game compatibility (exclusive EasyRPG commands). They can all be found documented here. A game is recognised as a DynRPG game if a file named dynloader.dll is present in the folder of the game, or if the DynRPG flag is set through the EasyRPG.ini file or through command line.

The TestGame-2003 includes test cases for the DynRPG patch, which can be used as references if needed:

Command syntax

DynRPG commands are written through the Comment command. A single command cannot be written on several lines, but all of the lines of a Comment command can be used to trigger DynRPG commands.

A command name always starts by a @, and is usually formatted like this:

@CommandName 123, "abc", V456, VV789, N12, NV34, Hello

@commandName is the name of the command to use which is case insensitive, with all of the info after being parameters of the command, which can be of various natures:

  • 123 is a number
  • abc is a string
  • V456 is the value of the variable 456, and is a number
  • VV789 is the variable redirection of the value present in the variable 789, and is a number
  • N12 is the name of the hero of ID 12, and is a string
  • NV34 is the name of the hero of the value present in variable 34, and is a string
  • Hello is a token; token are interpreted and stored in lowercases, so it will be interpreted as hello

The EasyRPG Player also supports additional parameters if the Maniac patch is enabled:

  • T123, which corresponds to the string variable 123, and is a string
  • TV456, which corresponds to the string variable redirection of the value present in the variable 456, and is a string

Whenever a command is written in a specific way, keep in mind that a number or string parameter can be replaced by a variable or hero name.

The syntax info comes from the Rules and guidelines for plugin developers from the DynRPG documentation.

DynText

Current inaccuracy issues: EasyRPG Player issue #3577

Patch and testcase: https://rpgmaker.net/engines/rt2k3/utilities/12/

DynText is a patch made by Kazesui allowing to write text on the screen, by assigning the text written to a string ID and linking it to a picture ID, with the text written reusing on the fly the transparency, ID layering and display/lack of display of the linked picture ID.

The patch supports a parameter to set the default picture ID to link in the DynRPG.ini file, through the PictureID= field of the [DynTextPlugin] section (if no value is set, the default value is considered to be 1).

The following text arguments can be used in a text (using 1 here as an example ID):

  • \a[1] to display the name of the status of the requested ID
  • \I[1] to display the description of the item of the requested ID
  • \i[1] to display the name of the item of the requested ID
  • \N[1] to display the class of the hero of the requested ID
  • \n[1] to display the name of the hero of the requested ID
  • \v[1] to display the value of the variable of the requested ID
  • \T[1] to display the description of the skill of the requested ID
  • \t[1] to display the name of the skill of the requested ID
  • \x[1] to display content of the requested string ID

Games using it: Venia

@write_text

@write_text allows to write text on the screen at the requested coordinates. If the command targets a string ID already in use, no text will be written.

The command is written as follows:

@write_text "Test", 160, 120, "Hello World", "fixed", 1, 2

  • Test corresponds to the string ID that the string will use; Note that the string ID is case-sensitive
  • 160 corresponds to the X coordinate where the string should be drawn
  • 120 corresponds to the Y coordinate where the string should be drawn
  • Hello World corresponds to the text that should be drawn
  • fixed indicates that the string should be scrolled with the map; if it is not specified, the string will not scroll with the map
  • 1 indicates that the text should be written using the colour 1 of the System graphic; if it is not specified, the colour 0 is used
  • 2 indicates that the string ID is linked to the picture of ID 2; if it is not specified, the default linked picture ID is used

Here, it will write the string Hello World at coordinates 160, 120, by making the text scroll with the map, and using the colour 1. The string will use the ID Test, and will be linked to the picture ID 2, reusing its transparency and display properties.

@remove_text

@remove_text allows to delete a string ID. If the selected string ID does not exist, nothing will happen.

The command is written as follows:

@remove_text "Test",

Here, it will remove the text that uses the string ID Test.

@remove_all

@remove_all allows to delete all of the strings displayed in a single command without having to specify a string ID.

The command is written as follows:

@remove_all

@apppend_text

@append_text allows to add new text on an existing string ID on the same line. If the selected string ID does not exist, nothing will happen.

The command is written as follows:

@append_text "Test", "message",

Here, it will add the text message to the string ID Test, by adding the new text on the current line.

@append_line

@append_line allows to add new text on an existing string ID on a new line. If the selected string ID does not exist, nothing will happen.

The command is written as follows:

@append_line "Test", "message",

Here, it will add the text message to the string ID Test, by adding the new text on a new line.

DynText seems to encounter issues if a single string ID is displayed on 7 lines, with an error occurring if 8 lines are used at once.

@change_text

@change_text allows to change the text and colour of a string ID. If the selected string ID does not exist, nothing will happen.

The command is written as follows:

@change_text "Test", "New Text", 10

Here, it will change the text of the string ID Test to New Text, by using the colour 10.

@change_position

@change_position allows to change the position of a string ID. If the selected string ID does not exist, nothing will happen.

The command is written as follows:

@change_position "Test", 20, 40

Here, it will change the position of the text of the string ID Test to the coordinates 20, 40.

@call

@call is a command from the RPGSS DynRPG plugin made by Anatoli Steinmark, which allows calling other DynRPG commands. As RPGSS allowed easily editing and creating commands in Lua format, with @call being able to be used to call those new commands, the command made sense within RPGSS, and was for instance used in the DynRPG game Skateboarding is WAR. As no element from RPGSS is implemented in the Player, it can only be used to call existing DynRPG commands (DynText, Dyn-EasyRPG commands, or @call itself), not serving much purpose.

The command is written as follows:

@call command_to_call

For instance, if you want to display the info message Hello World using @call, you can write it as

@call easyrpg_output, Info, "Hello World"

Dyn-EasyRPG commands

The EasyRPG Player includes some exclusive commands, which can be used if the patch DynRPG or EasyRPG is active.

@easyrpg_add

@easyrpg_add is a sample function serving as an example for implementing DynRPG commands. It can be used to do an addition of several values and then set them to a variable. It can be seen as an expanded version of the @add command from the AdvancedMath DynRPG plugin.

The command is written as follows:

@easyrpg_add 1, 10, 5

The first parameter corresponds to the variable that will be written (here, variable 1), and parameters after will be added up and then set to the value of variable 1 (here, variable 1 will be set to 10 + 5, so 15).

The command can be written using only two parameters (the variable to set and one value to add), and several parameters can be added as wanted.

As the first value already targets a variable, writing it as V1 will use the value of the variable 1 to point to the variable to use, while writing it as VV1 will use the value of the variable 1 to target a variable ID which will then have its value used to target another variable ID.

@easyrpg_output

@easyrpg_output is a function allowing to send a message to either the debug console (message only seen through the debug console of debug builds, through the webplayer console or through the EasyRPG logs), as an info message displayed on the screen as white, as a warning message displayed on the screen as yellow, or as an error message that will make the player close after the message has been seen. As the error message is different depending on the platform used, taking into account the different error screens when writing an error message is recommended. It can be useful to add those to a game you are making for debugging, for instance by displaying warnings in unexpected cases, or displaying debug messages for complex systems as to debug them more easily (you can also combine those with the command Conditional Branch: Playtest mode is active if your game is in 2k3e mode and that you only want to display info while playtesting).

The message channels used automatically apply linewrapping, so you should not have to worry if a message will be cut or not.

The message displayed only accepts one text marker, $, which will display the parameter of the selected ID from the current command.

The command is written as follows:

@easyrpg_output Info, "Hello $1! Variable 5 is $2, Variable 7 is $3 (variable redirection)", WORLD, V5, VV6

  • Info corresponds to the token which dictates which message level should be used. It can be set to either Debug, Info, Warning or Error.
  • Hello $1! Variable 5 is $2, Variable 7 is $3 (variable redirection) corresponds to the message that will be displayed; $1 displays the first parameter after the message, so it will display the token world (tokens are lower case). $2 will return the value of the variable 5, while $3 will return the value of the variable redirection of variable 6.

You can use any of the parameters mentioned in the command syntax for the additional parameters.

References and further reading

development/technical-details/patches/dynrpg.1789212638.txt.gz · Last modified: by carbonara

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki