This directory contains mod examples and documentation in order for you to better wrap your head around how it works. I promise it's super easy!
*For now, replacer mods are only supported in offline mode. Plugins are supported in both. This will probably change in the future!
- How Modding Works
- How to Activate Mods
- How do I Create a Texture/Audio/Font Mod?
- Another Example - Audio Mod
- Creating a Plugin
- Good Luck!
There are two kinds of mods, "replacers" and "plugins". Replacers are mods that replace files in the game, such as textures or audio. Plugins are JavaScript files that may change the game's behavior.
Mods exist in their own folders. So, if you make or download a replacer mod called "MyMod", the mods folder should look like so:
mods/
# Your mod goes into "replacers" because it replaces files in the game
replacers/
MyMod/
# ... all of your files
...or a plugin mod called "MyPlugin":
mods/
# Your mod goes into "plugins" because it changes the game's behavior
plugins/
MyPlugin.js
When a new mod is added to a user's mod directories, it is automatically added to the mod list.
Any changes a mod makes will apply automatically the next time the user loads the game. This doesn't even require a full restart, just press Ctrl+R
!
Your mod must match the file structure of PokeRogue. Here's an example:
- You want to replace the PokeRogue logo with your modified one.
- Anything that would be in the "public" folder of the PokeRogue repository should be in the ROOT of your "MyMod" folder.
- In this example, you are replacing
public/images/logo.png
, so your mod folder should containimages/logo.png
like so:# PokeRogue Structure: public/ images/ logo.png # Your Mod Structure: MyMod/ images/ logo.png
- In this example, you are replacing
If you are familiar with how The Binding of Isaac mods work, this is basically the same. The result should be instantly noticeable, and the example provided in mods/LogoReplacer
will result in the following:
Now, let's say you want to replace Pikachu's cry. In the PokeRogue repository, the file is located at public/audio/cry/25.m4a
(because Pikachu is Pokémon #25). So, your mod folder should look like this:
# PokeRogue Structure:
public/
audio/
cry/
25.m4a
# Your Mod Structure:
MyMod/
audio/
cry/
25.m4a
That's it! Your mod should now properly apply! You can verify this by starting a new game and selecting the Pokemon in the starter selection menu (if you have them unlocked).
Plugins are pretty open-ended, technically you can make this do anything. Some examples would be changing values, names of things, or just how the game works. Here are some specific notes regarding plugins:
- RogueTop doesn't have any special API helpers for plugins... yet
- Plugins must be singular JavaScript files (no
import
s!). If you want to bundle several files together, or like TypeScript, my personal reccomendation is to use a bundler like esbuild. - Plugins are executed somewhat late in the loading cycle. If you need plugins to load early for some reason, feel free to make a feature request.
A simple plugin that literally just logs something to the console would look like so:
// MyPlugin.js
console.log("Hello from MyPlugin!");
If this document didn't make it click, that's fine, just take a look at the mods/
folder here and see how it works. Both examples written here are present in that folder. It's really simple once you get the hang of it!
If you'd like to request more advanced modding features, feel free to open a new issue.