RMML 6 and RMMM
Rusted Moss Mod Loader 6 is the future. Featuring performance improvements, a new syntax, safety features, and an included Mod Manager, modding has never looked better. With this update, RMML’s core API has essentially locked in; any future updates cannot modify behavior without breaking existing mods or creating dependency hell.
Naturally, “the last” RMML update means breaking some things. This page details what has changed, but here’s the short version for players of mods:
For Players
After (optionally) backing up your mods
folder, you can download RMML 6 and install it like normal. If you have existing mods, you can either download them again with Rusted Moss Mod Manager in-game, or put your old mods in the mods/rmml
folder. Downloaded mods are located in the Saves folder. Any mod configuration (such as Maya/Ameli palette options) should be placed in the mod.
The old mods/rmml/modlist.txt
(in the Steam directory) has been to mods/modlist.txt
in the Saves folder. If you have manually installed mods, they must be re-added to the mod list. RMMM can do this for you using the in-game UI, or you can find the new list in the Saves folder. The mod list in the Steam directory is only used if the game crashes.
For Mod Makers
Some of you already have RMML 6 Beta installations, which can be safely updated with RMMM. If you have an existing RMML 5 (or lower) installation, you can follow the for players section and come back.
Here’s the quick changed stuff:
- Steam
mods/rmml/modlist.txt
-> Savesmods/modlist.txt
: You shouldn’t need to modify either file, since RMMM will manage them. rmml_log.txt
->mods/log.txt
: Logging functions have changed file paths. If you need to use the old filename, you can setglobal.rmml.log_name
like normal.- Each mod makes an
omod_controller
: Each mod has its ownomod_controller
Instance; Alarms and instance variables will work as expected,with
andinstance_number
will not. global.rmml.current_mod
->global.rmml_current_mod
: The currently running mod.self.mod_name
and how mod names are determined is unchanged.- Dev Mode: (Some) startup errors are caught, no hot-reloading, etc. See the link for more details.
global.rmml.modmap
->global.rmml_map
: Structure has changed. Still shouldn’t modify this directly, useglobal.rmml.register
instead.global.rmml.exec
,global.rmml.purge_fn
, andglobal.rmml.as
: They’re gone, never to return again (probably).- No more duplicate Game Object and Event pairs: Before, you could specify multiple
controller
create
(for example) code fences. This is now an error. Unless you’re abusing RMML’s specifications, this shouldn’t change anything.
And here’s the new (technical) stuff:
global.rmml.try(try, catch, ...args)
: Wraps the passed function in a try-catch block using magic powers.global.rmml.warn(msg)
andglobal.rmm.warnings
: Warnings thrown during the mod loading process (or user programs). Most errors from before are warnings now.global.rmml.clone(struct)
: Shallow copies a struct of structs. Used for RMML’s internals (please don’t modify it <3).
global.rmml.modmap
-> global.rmml_map
The structure of RMML’s mod map, used for associating Events, mod names, and Catspeak functions, has changed. In RMML 5, it was a struct containing an array containing a flattened tuple of a mod name and a function.
global.rmml.modmap = {
"controller_events_create": [
"my_mod", fun () { ... },
"your_mod", fun () { ... },
],
"instance_events_other_room_start": [
"my_mod", fun () { ... },
],
}
In RMML 6, this is a simpler struct of structs.
global.rmml_map = {
"controller_events_create": {
"my_mod": fun () { ... },
"your_mod": fun () { ... },
},
"instance_events_other_room_start": {
"my_mod": fun () { ... },
},
}
You probably weren’t modifying this structure directly (use global.rmml.register), but there is one user-facing change. RMML no longer supports multiple code blocks for the same Game Object and Event. For example, the following fails.
# controller
## create
```
-- this doesn't run
-- (and causes a startup error)
show_message("Hello")
```
```
-- this DOES run
show_message("World!")
```
Having multiple code blocks for the same Event-Game-Object pair was counter-intuitive and could lead to bugs, such as if you forgot an Event header.