Creating Your First Plugin
Locate your plugin directory
Find your OpenRCT2 user directory:
- Windows:
C:\Users\YourName\Documents\OpenRCT2\plugin - Mac:
/Users/YourName/Library/Application Support/OpenRCT2/plugin - Linux:
$XDG_CONFIG_HOME/OpenRCT2/pluginor$HOME/.config/OpenRCT2/plugin
plugin folder.Understanding the Plugin Template
Plugin Metadata
TheregisterPlugin() function registers your plugin with OpenRCT2. Let’s break down the metadata:
- name: The display name of your plugin
- version: Your plugin’s version number
- authors: Your name or an array of contributor names
- type: The plugin type (
local,remote, orintransient) - see Plugin Types - licence: The license identifier (e.g.,
MIT,GPL-3.0) - see SPDX License List - targetApiVersion: The OpenRCT2 API version your plugin targets
- minApiVersion: The minimum OpenRCT2 API version required
- main: The entry point function that runs when your plugin loads
API Versioning
targetApiVersion
In case there are breaking API changes, plugins can use this to keep the old API behavior. For example, in version 34,Entity.type would no longer return peep for guests and staff - instead it would return either guest or staff. If your plugin expects peep, you can specify version 33 to keep the old behavior.
minApiVersion
This prevents your script from loading on older versions of OpenRCT2 that don’t support all the APIs you require.Console and REPL
The console is a JavaScript interpreter (REPL - Read-Eval-Print Loop), similar to the console found in web browsers when you press F12. You can write and test expressions interactively.Using console.log
Reloading Your Plugin
By default, when you make changes to your script, you must exit your current game and open it again for the script to reload. However, you can enable hot reload for rapid development - see Hot Reload.Example: Adding Cash Every Day
Here’s a simple plugin that adds cash to your park every in-game day:Using TypeScript
For better development experience, you can use TypeScript:Debugging
Debugging has not yet been implemented, but is planned. In the meantime, useconsole.log() to print useful information for diagnosing problems.
Choosing a License
The authors must define a licence for the plugin, making it clear whether that plugin can be altered, copied, etc. Good reference material is listed on ChooseALicense. Try to pick one of them and use its corresponding identifier from SPDX.ES5 Limitations
Some ES6 functions are not available:Array.find()andArray.includes()are not supported- Arrow functions, classes,
letkeyword require transpilation - async/await, spread operator, destructuring, template literals require transpilation
Next Steps
- Learn about Plugin Types to understand local, remote, and intransient plugins
- Explore Game Actions for multiplayer-safe modifications
- Enable Hot Reload for rapid development
- Check out Examples for more plugin ideas

