Skip to content

An external plugin system for RPG Maker XP & VX making it possible to run Ruby scripts at system startup and shutdown

Notifications You must be signed in to change notification settings

nemuruibai/rmxp-plugin-system

 
 

Repository files navigation

Rxdata Versioning Utility

Version: 1.0.6

Updated by: Gegerlan ([email protected]), Varun ([email protected])

Introduction

Have you ever wanted to work on an RPG Maker XP (RMXP) or RPG Maker VX (RMVX) game with a group of friends, but ran into trouble with conflicts when multiple people edit the same rxdata files? If you want to safely and efficiently version the data in your game, then read on!

I have written a general plugin system for RPG Maker XP and VX so that scripts can be run externally (using the normal Ruby interpreter) at startup and/or shutdown of RMXP. This allows for implementing more advanced functionality, such as exporting scripts and data from .rxdata files (scripts, system data, maps, etc.) into plain-text files which are human-readable and can be easily versioned with a versioning system such as Git, Subversion or Mercurial. I've also written scripts which can read these exported text files and import them back into .rxdata files so that RMXP can read them. Now, anytime two people change a map, a script, or any other game data, all of the conflicts can be easily resolved in plain text.

I've been careful to make sure that the RGSS objects are always exported in the same way, so that unnecessary conflicts are avoided. The data files are exported as YAML files and the RGSS scripts are exported as normal Ruby files. This provides other benefits beyond just versioning the data. For example, you could use your favorite text editor outside of RMXP to edit your scripts; just make sure you don't export the scripts before you import your changes. Also, seeing what changed in the YAML files when you do something in RMXP is really helpful in understanding how the game data works!

Some other ideas for plugins that could be written are:

  • A patcher script which downloads updates for your RGSS scripts.
  • A time and change logger script that records team member's work time between opening and closing RMXP or RMVX and a comment regarding their changes.

Features

General

  • Plugins are runnable on startup and on shutdown of the editor. For example, below plugins provide automatic importing of all versioned text files into .rxdata files before starting RMXP. When RMXP is closed, all .rxdata files are exported back into versionable text files.
  • Plugin system behavior is configurable via a config.yaml file.

DataImporterExporter plugin

  • Exports .rxdata or .rvdata files (except Scripts) to text files in the YAML data format.
  • Imports YAML files back into .rxdata or .rvdata files that RPG Maker editor can read.
  • Only exports rvdata and rxdata files if they need to be exported (i.e. have been modified since RMXP was opened or haven't been exported yet).

ScriptImporterExporter plugin

  • Exports all scripts contained in Scripts to individual Ruby files (via the ScriptImportExporter plugin).
  • Imports Ruby scripts previously exported back into a Scripts.rxdata (RMXP) or Scripts.rvdata (RMVX) file that RPG Maker can read.
  • Only exports scripts if they are not empty (for example, place-holder scripts)
  • Cleanup script (called clean.rb) provided to help identify stale scripts (i.e. scripts which are added in RPG Makers's script editor, exported, and then later removed from the script editor, but still remain in your scripts directory).

Downloads

A demo project showing plugin system usage (Just extract archive somewhere and run Game.bat, instead of Game.rxproj).

RMXP Plugin System Demo (v1.0.5)

Sample Files

A sample YAML file exported from System.rxdata.

Sample exported YAML file

A sample export digest. This file is generated by the RGSS script exporter and is a list of all exported scripts. It is used so they can be re-imported into Scripts.rxdata in the original order later. Notice that the third column (exported Ruby file name) for the second entry is EMPTY. No file is actually exported, since that script in RMXP was actually an empty entry.

Sample script export digest

A sample config file for the utility.

Sample config file

The default Game.bat file used to launch RMXP (instead of Game.rxproj).

Sample Game.bat file

Sample Game.bat output (verbose mode)

Sample output for Game.bat

Instructions

Requirements

  • Ruby Interpreter - Get the most recent version here. It is required to run the utility scripts outside of RMXP. You will need a version with the YAML and Zlib modules.
  • RPG Maker XP - For RMXP games
  • RPG Maker VX - For RMVX games
  • Windows - Tested on Windows 10
  • (Optional) Versioning System - If you want to keep track of versions of your exported data, you will need a versioning system like Git, Mercurial, or Subversion.

Setup

  • Install the listen and wdm gems (though this should be done automatically).

  • Download the latest version of RMXP Plugin System in this repo (as a ZIP at top of this page or cloning using Git).

  • Back up your project (just copy it somewhere for safe-keeping).

  • Extract the archive into a directory or your choice. NOTE: If you wish to use this in multiple projects, it is best to create a folder in the same directory as your projects and extract to that folder. Just make sure to update the PLUGIN_SYSTEM_ROOT and RMXP_PROJECT_ROOT variables set in Game.bat (see below default Game.bat). A sample directory hierarchy is below:

    C:\project
    |-- RmxpPluginSystem
    |-- ProjectA
    |-- ProjectB
    |-- ...
    |-- ProjectZ

    With the above structure, all projects can use the same version of the plugin system.

  • Modify any configuration parameters you necessary, in the config.yaml file, such as output directory paths for the YAML and Ruby files.

Usage

  • Just run Game.bat.
  • Kick back, relax, and let the batch file do everything for you. NOTE: It will ignore importing the first time it is run, since no data has been exported yet. When you close RMXP, all of the data will be exported (as long as you don't close the command window that Game.bat opened).

What to Version

  • The exported data YAML files
  • The exported Ruby scripts
  • The script export digest (digest.txt)
  • The RMXP Plugin System scripts (so that everyone sharing your project has them)
  • Game.bat file

FAQ

  • Does this utility work for RMVX?

    Yes, by running start_rmvx.rb.

  • What versioning system does this utility work with?

    Theoretically, all of them. Exported files should be version-able by any versioning system that can version UTF8-encoded text files, which I think is all of them. I've tested this versioning two different RMXP projects with Subversion with no problems.

  • When versioning the exported files, why do I get conflicts when there is no change in the files?

    Probably this is due to editing the exported file in a text editor or diff program which modified the newlines in the file. Try telling your versioning system to ignore new line differences or always convert them automatically.

  • Why are my changes not exported after I close RMXP?

    You may want to check that you have not accidentally closed the command window that says, "DO NOT CLOSE THIS COMMAND WINDOW!!!". The export step should automatically execute from the batch script when you close RMXP.

Compatibility

I'm unsure of compatibility with SDK. This utility should be compatible with any script modifications, since it runs outside of RMXP and treats scripts as data. However, you may experience problems if you have directly modified any of the classes in the RPG module. In general, one should not directly modify these classes, but in case you have, I've included a Ruby file for RGSS modifications (the default location is /Utility/rmxp/rgss_mod.rb). You will need to add your changes to that file so that they can be automatically picked up by the importer/exporter scripts.

Credits and Thanks

Author's Notes

  • THIS UTILITY MODIFIES YOUR PROJECT'S .rxdata FILES! Make sure to back them up before using it.
  • If you need Ruby implementations of the Table, Color, and Tone classes that can load and dump the .rxdata files that RMXP can read, they are included in the utility in rgss_internal.rb, or you can email me and I'll send them to you. :)

Terms and Conditions

This utility is free for any use, commercial or otherwise.

About

An external plugin system for RPG Maker XP & VX making it possible to run Ruby scripts at system startup and shutdown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%