Prerequisites
- This isn’t a programming tutorial. I’m going to keep the jargon to a minimum, but I’m not going to explain how loops work, or what a string is, or how functions work.
- This isn’t a GML tutorial. If you’ve never used a modern game engine before, you’ll want to read over the official manual (or my shorthand) before continuing.
- You want a code editor. My (completely unbiased) suggestion is Visual Studio Code, but just use your favorite. There are also other tools you might find useful.
What does it do?
Rusted Moss exposes six Game Objects we can write unrestricted* GameMaker Event code for. This means we can do (almost) anything we want, including completely replacing all of Rusted Moss’s code (!!!). However, most of this documentation will explain how to stay within the bounds of the game’s systems.
Where are my Files?
Mods live in Rusted Moss’s Steam directory, Steam/steamapps/common/Mose
. You can easily find this by right-clicking on the game and clicking “Browse local files”.
In that folder, you’ll find the data.win
file (for Undertale Mod Tool), but we’re mainly after the mods
folder. Inside, we’ll find the mod configuration file meta_info.ini
and the example mod sniper_bnuy.ini
.
meta_info.ini
[general]
mod_enabled = 0
[meta_info]
mod_0 = sniper_bnuy.ini
[general]
: This is a header (denoted by brackets[ ]
), and describes what the next section is doing. In this case, it’s mod settings.mod_enabled = 0
: This is a key-value pair and determines if modding is enabled. Setting this to1
will enable modding.[meta_info]
: This is also a header, and is where we tell Rusted Moss what mods we have and where they are.mod_0 = sniper_bnuy.ini
: This key-value pair tells us we have a mod calledsniper_bnuy.ini
that we want to run.
Any mods you want to load should be placed under the [meta_info]
header and must have indexes in order.
[general]
mod_enabled = 1
[meta_info]
mod_0 = my_mod.ini
mod_1 = myOtherMod.ini
mod_2 = "With spaces.ini"
mod_4 = NotLoaded.ini
Because of boring technical reasons, you should only use one mod (mod_0
) at a time. Each mod name references a .ini
file in the Mods
directory, so let’s look at sniper_bnuy.ini
for what they look like.
sniper_bnuy.ini
[object_list]
controller = enabled
instance = enabled
[controller_events]
room_start = "i = 0; while ..."
[instance_events]
create = "self.parent ..."
draw = "if ..."
step = "if ..."
[object_list]
: This header lists which Game Objects we want to write code for.{OBJECT} = enabled
: If an object isn’t listed as{OBJECT_NAME} = enabled
, then its Event code won’t be loaded. Rusted Moss looks forenabled
exactly, not a truthy value.[{OBJECT}_events]
: The key-value pairs after this header are associated with the Game Object in the header.{EVENT} = {SOME_CODE}
: The value{SOME_CODE}
is interpreted as one line of Catspeak code for the Event listed as the key. I recommend using single quotes'
to wrap your Event code so you can use double quotes"
for strings.
If you want a more in-depth breakdown of this mod, check out the Example Mod page.
To RMML or not to RMML
Rusted Moss Mod Loader (or RMML) is a mod created by me (Harlem512) to aid with developing, installing, and distributing mods. It comes with Rusted Moss Mod Manager (RMMM), a mod that lets you download mods off the internet. My (completely unbiased) recommendation is to install Rusted Moss Mod Loader and use that instead of trying to use the “standard” modding tools.
You can visit the RMML Quickstart page to get started with RMML.
Final Notes
Modded Event code is run immediately when the Event for a particular Instance fires, and modded Game Objects don’t implement any other behavior on their own. This means calling event_inherited()
on your own.
controller
is a non-pausing, persistent Game Object that is created when the menu loads, and is destroyed when you return to the menu. Most of your code can live in this object, with other Instances accessed with clever with
blocks. instance
Instances don’t pause (the Steam page lies).
If you’re doing serious modding work, I recommend bypassing the normal mod loading process using Rusted Moss Mod Loader or your own mod loader.