RGSS Specifications

Differences from the Previous Version (RGSS2)

RGSS2, which is incorporated into RPG Maker VX, has a number of differences from RGSS1, which was included with RPG Maker XP. The main differences are listed below.

In addition to the above, a number of other minor changes have been made.

In this manual, functions or specifications that have been changed for RGSS2 will be marked with a (RGSS2) symbol.

Starting a Game

Game folder

Normally, you launch RGSS by double-clicking the icon for the game file, Game.exe (or Game if the Windows option "Hide extensions for known file types" has been turned on). The folder that contains this file is called the game folder.

In-progress games can be started up by selecting [Playtest] from the menu or [Battle Test] from the Troop database. When this is done, the global variable $TEST will be set to true. When performing a Battle Test, the $BTEST variable will also be set to true. With RGSS1, the value of the Ruby built-in variable $DEBUG was changed but this was removed because differences in behavior could lead to problems in rare cases. (RGSS2)

Game operation is specified in Game.ini, the configuration file.

Game.ini

The Game.ini file is automatically created and updated by RPGVX. It can also be edited manually with Notepad or another text editor.

Example:

[Game]
RTP=RPGVX
Library=RGSS200E.dll
Scripts=Data\Scripts.rvdata
Title=RubyQuest
RTP

The title of the RGSS-RTP the game is using. Usually "RPGVX".

If the specified RTP isn't installed, an error message will be displayed.

Library

The name of the RGSS DLL. This file is usually installed in the RTP folder.

If there's a DLL specified in the game folder, it will be given precedence.

Scripts

The data file in which scripts are stored, specified with a path relative to the game folder.

Ruby's scripts usually take the form of text files with the extension .rb, but RGSS uses one proprietary packaged file. This file cannot usually be edited without using RPGVX's script editor. The data is comprised of multiple sections and is executed in the listed order, as displayed.

Title

The game title, displayed in the game window's title bar.

RGSS-RTP

RTP (Run-Time Package) is a mechanism that reduces game data size for distribution. RTP contains standard graphics and audio files used across many different games. Installing these resources as a common file before playing a game eliminates the need to download duplicate files over and over.

RTP files can use the following methods from the built-in game library to access files as though they were in the game folder. The extensions can be left off the file names that are passed to the methods below--their file types (such as .png or .mid) are identified automatically.

Bitmap.new, Audio.bgm_play, Audio.bgs_play, Audio.me_play, Audio.se_play, Graphics.transition

Installation Data

The standard RTP for RPG Maker VX is just "RPGVX" but it is now possible to use RTPs with different structures. If you know how to make an installer, follow these steps to create a unique RTP at the user level. However, using common names for RTP titles, such as "Extension", is not recommended; they might conflict with the names of new, official RTPs in the future.

By default, RTP is installed in the following folder: (RGSS2)

[CommonFilesFolder]\Enterbrain\RGSS2\[RTPName]
Here, [CommonFilesFolder] is the location of the Windows "Common Files" folder, while [RTPName] is the name of the RTP. Here's an example:
C:\Program Files\Common Files\Enterbrain\RGSS2\RPGVX

The RTP installer creates a string value containing the RTP name in the "HKEY_LOCAL_MACHINE\SOFTWARE\Enterbrain\RGSS2\RTP" registry key and uses it to set the path. RGSS recognizes the string specified in this key as the RTP. (RGSS2)

Encrypted Archives

Encrypted archives make it difficult for others to analyze and/or rebuild the game contents. Normally all data and graphic files (not audio and font files) are stored in Game.rgss2a. You can create an encrypted archive by checking the [Create encrypted archive] box when compressing the game data.

The files within the encrypted archive can use the following methods from the built-in game library to access files as though they were in the game folder:

load_data, Bitmap.new, Graphics.transition

When there is an encrypted archive in the game folder, the script data (normally Data\Scripts.rvdata) defined in the Scripts line of Game.ini will always be read from the archive. This is a limitation that prevents files within the archive from being read by an external script.

Due to its nature, the encrypted archive's internal format has not, and will not, been released to the public. Please refrain from analyzing it.

Other

Character Set

RGSS uses the UTF-8 character set. UTF-8 is a way of encoding Unicode, a character set that can display letters and characters from all the world's languages.

Ruby's built-in variable $KCODE (not included in this reference) is set to "UTF8" by default. RPGVX's script data and all other string data are also in UTF-8, so you don't have to worry about any encoding conflicts as you build your game.

Frame Rate

The standard frame rate for RGSS2 games is 60 frames per second. With RGSS1, it was possible to turn the Smooth Mode option off and skip drawing some frames, thereby making games run at half frame rate, but this has been eliminated with RGSS2.(RGSS2)

You can change the framerate with Graphics.frame_rate.

Properties

The term "property" is used in the game library overview. This is not a concept in Ruby's specifications, but rather a term unique to RGSS.

For example, this is how to obtain and set a sprite's x-coordinate (Sprite#x):

x = sprite1.x         # obtain
sprite2.x = x + 32    # set

For the sake of convenience, methods that are defined to both obtain (read) and set (write) via assignment operators in this way are called "properties".

When objects such as the Color class, the Tone class, or the Rect class are defined as properties, a reference to the object itself is returned to the caller, rather than a copy. Therefore, it is possible to change the color of a font by using this format:

color = font1.color
color.set(255, 0, 0)
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)