What are OpenRCT2 Plugins?
Plugins are JavaScript files that extend OpenRCT2’s functionality by interacting with the game through a comprehensive scripting API. Each script is a single physical JavaScript file within theplugin directory in your OpenRCT2 user directory.
Use Cases
Plugins can be used for a wide variety of purposes:Productivity Tools
- Extra windows displaying park information
- Custom dashboards and statistics
- Enhanced editing tools
- Title sequence editors
Game Enhancements
- Custom game modes for multiplayer
- Welcome messages and server management tools
- Anti-spam and moderation systems
- Kick/ban tools for servers
Automation
- Park automation scripts
- Scheduled events and actions
- Custom ride ratings
- Guest generation modifications
Plugin Directory Locations
The user directory for each platform is usually:- Windows:
C:\Users\YourName\Documents\OpenRCT2 - Mac:
/Users/YourName/Library/Application Support/OpenRCT2 - Linux:
$XDG_CONFIG_HOME/OpenRCT2or in its absence$HOME/.config/OpenRCT2
How Plugins are Loaded
OpenRCT2 will load every single file with the extension.js in the plugin directory recursively. If you want to prevent a plugin from being used, you must move it outside this directory, or rename it so the filename does not end with .js.
JavaScript Engine
Scripts are written in ECMAScript 5 compatible JavaScript. OpenRCT2 currently uses the duktape library to execute scripts.Using Modern JavaScript
While the engine supports ES5, you don’t need to write in ES5 directly. You can use transpilers like Babel or TypeScript to write modern JavaScript (ES6+) with features such as:- Arrow functions
- The
letandconstkeywords - Classes
- Template literals
- Default parameters
TypeScript Support
JavaScript or TypeScript is recommended, as that will allow you to utilize the type definition file we supply (openrct2.d.ts). This provides rich editor features such as autocompletion and inline API documentation.
Official Resources
Official references for writing plugins are:- The API:
openrct2.d.tsdistributed with OpenRCT2 - Sample scripts: OpenRCT2/plugin-samples
- TypeScript plugin example: IntelOrca/OpenRCT2-ParkManager
Editor Recommendations
Visual Studio Code is recommended, as it supports the TypeScript definition file workflow very well, providing IntelliSense and API documentation even for JavaScript files.Safety and Security
Sandbox Environment
Scripts are executed in a sandbox container with no direct access to your computer. Scripts can only use the APIs provided, which consist of interactions with OpenRCT2 and a limited API for storing data.While scripts are sandboxed, it is technically possible for a script to freeze the game or fill your disc up with data. These issues are usually noticed quickly and are not particularly severe.
Performance Considerations
Scripts can consist of any behavior and have a large memory pool available to them. The speed will vary depending on the hardware and system executing them. Duktape provides engine-specific performance tips that can help optimize your scripts.Growing the API
The APIs for OpenRCT2 try to provide access to the game’s data structures as much as possible, but can only be added over time. The best way to grow the plugin system is to add APIs on-demand.If you find an API is missing, please raise an issue on GitHub. Feel free to discuss it on Discord and submit a pull request.

