You are reading the docs of SDK 1.3.0, an older release. See the latest (1.11.0).
Start · SDK 1.3.0
Getting started
From nothing to a mod a player installs by pasting a link. Pick a track.
Script mod (no compiler)#
-
Get the SDK. Download
openrac-mod-sdk-<version>.zipfrom OpenRAC's releases (the ones named "Mod SDK") and unpack it. Script mods need SDK 1.1 or later. -
Copy the template.
template-script/is a whole repository: copy it to a new folder and make it a git repository (git init). -
Name your mod. In
openrac-mod.json, setid(lower case and hyphens, such asbig-jump),name,author,descriptionandversion(the manifest). -
Write it.
main.luauruns once when the game starts; it takes its hooks and callbacks there:Luauopenrac.on_frame(function() if openrac.fields.bolts > 1000 then openrac.log("rich!") end end)Script mods has the rest. Point your editor's Luau language server at the SDK's
types/rac1.d.luaufor autocomplete (the template's.vscode/settings.jsondoes it for VS Code with luau-lsp). -
Try it. In the launcher's Mods tab, Add a mod, and choose your folder. Switch it on and press Play. Your
openrac.loglines are in the game's log (Logs on the game's page). -
Release it. Push the repository to GitHub (public), then a tag with the manifest's version:
Shellgit tag v0.1.0 git push origin v0.1.0The template's workflow packages the mod and publishes the release (packaging and releases).
-
Share the link. Players paste
https://github.com/<you>/<repo>in the Mods tab's Add from a link (install from a link).
Native mod (C or C++)#
-
Get the SDK as above, and the tools: CMake, Ninja, and a compiler (Xcode's command-line tools on macOS,
build-essentialon Linux, Visual Studio with "Desktop development with C++" on Windows). -
Copy the template.
template/is a whole repository for a C++ mod. -
Fetch the SDK it pins, and build:
Shellpython3 tools/fetch_sdk.py # the SDK sdk.lock names, into .sdk/ (commit sdk.lock after the first time) cmake -S . -B build -G Ninja cmake --build build -
Write it in
src/mod.cpp(in C++, or in C):C++#include "openrac/mod.hpp" #include "openrac/games/rac1.hpp" static void load(openrac::Mod& mod) { mod.hook<openrac::rac1::Hero_SetPlanarVelocity>([](auto original, float angle) { original(angle); // the game's own, or the mod loaded before yours }); } OPENRAC_MOD_CPP("my-mod", "0.1.0", load) -
Try it. Add a mod in the launcher with the folder
build/package/<target>, switch it on, Play. -
Release it with a tag, as for a script mod: the workflow builds it on Windows, Linux and macOS and publishes one archive per platform with their checksums. Players never need a compiler.
Next#
- Hooks: what you can change, and how mods share a hook.
- Settings: give players options.
- Troubleshooting: when the mod does not load.
Generated from sdk/docs/getting-started.md at sdk-v1.3.0. Edit this page or report a problem.