A collection of C++ utilities for extracting, inspecting, editing, and rebuilding Scripts.rxdata files used by RPG Maker XP.
These tools allow you to work with your game's scripts directly from the command line — view them, search through them, and even rebuild a new rxdata file from edited files.
- Extract all scripts from an
.rxdatafile to individual.rbsource files. - Display a single script's contents directly in your terminal.
- Search for functions across all scripts by name.
- Export a specific script to a standalone Ruby file.
- Recompile modified
.rbscripts back into a valid.rxdatafile. - Works fully offline — no need for RPG Maker itself.
- Fast native performance with no runtime dependencies.
RPGMakerXP-Tools/
├─ include/
│ ├─ utils.hpp # Shared utility declarations
│ ├─ script_processor.hpp # Script processing function declarations
│ └─ ruby_marshal.hpp # Ruby Marshal format reader/writer
├─ src/
│ ├─ utils.cpp # Shared helpers for loading/decompressing data
│ ├─ script_processor.cpp # Script processing implementations
│ ├─ ruby_marshal.cpp # Ruby Marshal format implementation
│ ├─ extract_all_scripts.cpp # Dump every script into separate .rb files
│ ├─ display_script.cpp # Print a single script's source
│ ├─ function_search.cpp # Locate which scripts define a given function
│ ├─ save_script.cpp # Export one named script to ./saved/
│ └─ compile_rxdata.cpp # Rebuild Scripts.rxdata from .rb sources
├─ Makefile # Build configuration
└─ README.md
- C++17 compatible compiler (g++, clang++)
- zlib development library
- POSIX environment (Linux, macOS, WSL)
macOS (with Homebrew):
brew install zlibDebian/Ubuntu:
sudo apt-get install build-essential zlib1g-devFedora/RHEL:
sudo dnf install gcc-c++ zlib-develArch Linux:
sudo pacman -S base-devel zlibmakeThis creates executables in the bin/ directory with the rmxp_ prefix.
To install the tools system-wide:
sudo make installThis installs all binaries to /usr/local/bin. You can specify a different prefix:
sudo make install PREFIX=/optsudo make uninstallmake clean- Place your RPG Maker project's
Scripts.rxdata(or whatever you have called it) file in thedata/directory. - Build the tools with
make. - Use one of the CLI tools as shown below.
./bin/rmxp_display_script data/[your_scripts].rxdata "Main"Prints the decompressed Ruby code of the script named Main.
./bin/rmxp_function_search data/[your_scripts].rxdata "update_graphics"Lists all script names that contain a function called update_graphics.
./bin/rmxp_save_script data/[your_scripts].rxdata "Scene_Title"Writes the script to ./saved/Scene_Title.rb, creating the folder if necessary.
./bin/rmxp_extract_all_scripts data/[your_scripts].rxdataExtracts every script into separate .rb files, named according to their script titles. The output folder is a datetime snapshot string (so you don't accidentally overwrite old extractions).
After editing your exported .rb scripts, you can recompile them back into a new [filename]_updated.rxdata (usually Scripts_updated.rxdata) using (for example):
./bin/rmxp_compile_rxdata data/Scripts.rxdata saved/Main.rbYou can also pass multiple scripts or enter entire directories at once:
./bin/rmxp_compile_rxdata data/Scripts.rxdata saved/Main.rb saved/UI_Bag.rb saved/Battlers.rb./bin/rmxp_compile_rxdata data/Scripts.rxdata saved/*./bin/rmxp_compile_rxdata data/Scripts.rxdata "saved/*.rb"The compiler will:
- Read each
.rbfile as raw bytes. - Match it to its original entry in the
Scripts.rxdata(or whatever it's called for you). - Replace that entry's contents if found.
- Skip any
.rbfiles that don't exist in the original archive (without stopping the process). - After rebuilding, a new file
Scripts_updated.rxdatais created in the same directory as the originalrxdatafile.
To use it in RPG Maker XP, rename it to Scripts.rxdata and place it in your project's Data/ folder, replacing the old one.
If you've run sudo make install, you can use the tools from anywhere:
rmxp_display_script data/Scripts.rxdata "Main"
rmxp_function_search data/Scripts.rxdata "update_graphics"
rmxp_save_script data/Scripts.rxdata "Scene_Title"
rmxp_extract_all_scripts data/Scripts.rxdata
rmxp_compile_rxdata data/Scripts.rxdata saved/*.rbAll tools share common interfaces defined in the header files.
You can include them in your own C++ projects:
#include "utils.hpp"
#include "script_processor.hpp"
int main() {
auto scripts = loadScripts("data/[your_scripts].rxdata");
for (const auto& entry : scripts) {
std::cout << entry.name << std::endl;
std::cout << entry.code.substr(0, 200) << std::endl; // print first 200 chars
}
return 0;
}[your_scripts].rxdatais a Ruby Marshal–encoded array.- Each entry is
[id, name, zlib_compressed_bytes]. - The utilities decompress and decode the bytes to plain UTF-8 Ruby code.
- Recompilation reverses this process.
- Build errors about zlib → ensure zlib development headers are installed.
- Unicode errors → some scripts use non-UTF-8 encodings; they're skipped with a warning.
- File not found → ensure you pass the correct path to the
rxdatafile. - No output → check script name case sensitivity.
- Glob patterns not expanding → ensure you're running on a POSIX system or quote the pattern for shell expansion.
- Permission denied during install → use
sudo make install.