OpenRCT2 Modding Cheat Sheet
A one-page printable reference for plugin basics, the park/ride/guest API, UI windows and map/tile access the most-used TypeScript snippets for OpenRCT2 plugins. Pin it next to your monitor!
A one-page printable reference for plugin basics, the park/ride/guest API, UI windows and map/tile access the most-used TypeScript snippets for OpenRCT2 plugins. Pin it next to your monitor!
registerPlugin({
name: "My Plugin",
version: "1.0",
authors: ["You"],
type: "remote",
licence: "MIT",
main: function() {
console.log("Plugin loaded!");
}
});
The main function runs once when the plugin is loaded set up your hooks and UI here.
// read/write park cash console.log(park.cash); park.cash += 10000; // park name park.name = "Fun World"; // current in-game date console.log(date.year, date.month, date.day);
const rides = map.getAllEntities("ride"); rides.forEach(function(ride) { console.log(ride.name); console.log(ride.excitement); console.log(ride.intensity); console.log(ride.nausea); });
Excitement, intensity and nausea are raw rating values, divide by 100 for the displayed star value.
const guests = map.getAllEntities("guest"); guests.forEach(function(guest) { console.log(guest.happiness); console.log(guest.energy); console.log(guest.cash); });
ui.openWindow({
classification: "my-plugin-window",
width: 200,
height: 120,
title: "My Plugin",
widgets: [
{ type: "label", x: 10, y: 20, width: 180, height: 14, text: "Hello!" },
{ type: "button", x: 10, y: 40, width: 80, height: 16, text: "Click", onClick: function() {} },
{ type: "dropdown", x: 10, y: 60, width: 100, height: 14, items: ["A","B"] }
]
});
const tile = map.getTile(10, 15); tile.elements.forEach(function(el) { console.log(el.type); }); // surface height (in z-units, divide by 8 for game height) const surface = tile.elements.find(function(e) { return e.type === "surface"; }); console.log(surface.baseHeight);
context.subscribe("interval.tick", function() { // runs every game tick }); context.subscribe("ride.ratings.calculate", function(e) { console.log("Ride ratings calculated for ride " + e.rideId); });
registerPlugin({
name: "Cash Booster",
version: "1.0",
authors: ["You"],
type: "remote",
licence: "MIT",
main: function() {
if (typeof ui === "undefined") return;
ui.registerMenuItem("Cash Booster", function() {
ui.openWindow({
classification: "cash-booster-window",
width: 180,
height: 90,
title: "Cash Booster",
widgets: [
{
type: "button",
x: 10, y: 30, width: 160, height: 20,
text: "Add ยฃ10,000",
onClick: function() {
park.cash += 1000000;
}
}
]
});
});
}
});
Follow one of our free step-by-step workshops in the Workshop hub.
๐ง Browse Workshops โ