Stoker
Cheat Manager and Console
Screenshots 1 screenshots
About this mod Author’s original text
Stoker
A powerful cheat manager and console for Monster Train 2.
Features
- In-game console with command completion
- Command history navigation
- Real-time command suggestions
- Support for subcommands and options
- Customizable command system
- Log viewer with different message types (Info, Warning, Error)
- Fluent API for easy command creation
Installation
- Install BepInEx for your game
- Install Trainworks
- Place the Stoker plugin in the BepInEx/plugins directory
- Start the game
How to Use
Opening the Console
- Press the backtick key (`) to toggle the console
Basic Usage
- Type commands and press Enter to execute them
- Use Up/Down arrows to navigate command history
- Press Tab to cycle through command completions
- Press Shift+Tab to cycle backwards through completions
Command Structure
Commands follow this general structure:
command [subcommand] [options] [arguments]
Available Commands
Help Command
help
Displays a list of all available commands and their descriptions.
Echo Command
echo
Echoes back the provided message.
Card Commands
card add [options]
card remove [options]
Manage cards in the game.
Gold Command
gold
Add or remove gold. The amount can be positive or negative.
Relic Commands
relic add [options]
Add relics to your collection.
Command Completion
The console features intelligent command completion:
- Press Tab to cycle through available completions
- Completions are shown in semi-transparent gray
- Suggestions update in real-time as you type
- Supports completing:
- Command names
- Subcommands
- Option names
- Option values
- Argument values
Development
Using the Fluent API
The Fluent API provides a clean, readable way to create commands. Here are some examples from the codebase:
Basic Command
var command = new CommandBuilder("echo").WithDescription("Echo a message").WithArgument("message").WithDescription("The message to echo").WithParser((xs) => xs).Parent().SetHandler((args) => {
if (!args.Arguments.ContainsKey("message"))
throw new Exception("Missing argument");
var message = args.Arguments["message"];
if (message is null)
return Task.CompletedTask;
Plugin.Logger.LogInfo(message.ToString());
return Task.CompletedTask;
}).UseHelpMiddleware();
Command with Options
var command = new CommandBuilder("gold").WithDescription("Manage gold").WithArgument("amount").WithDescription("The amount of gold to add").WithParser((xs) => xs).WithDefaultValue("100").WithSuggestions(() => ["100", "+100", "-100"]).Parent().SetHandler((args) => {
var arguments = args.Arguments;
if (!arguments.ContainsKey("amount"))
throw new Exception("Missing argument");
if (arguments["amount"] is not string amount)
throw new Exception("Invalid argument");
Plugin.Logger.LogInfo($"Adding {amount} gold to the player");
AccessTools.Method(typeof(CheatManager), "Command_AdjustGold").Invoke(null, [amount]);
return Task.CompletedTask;
}).UseHelpMiddleware();
Command with Subcommands
var command = new CommandBuilder("card").WithDescription("Manage cards").WithSubCommand("add").WithDescription("Add a card to the deck").WithArgument("name").WithDescription("The name of the card to add").WithSuggestions(() => [.. Railend.GetContainer().GetInstance>().GetAllIdentifiers(RegisterIdentifierType.ReadableID).Select(c => c.ToString())]).WithParser((xs) => xs).Parent().SetHandler((args) => {
var arguments = args.Arguments;
if (!arguments.ContainsKey("name"))
throw new Exception("Missing argument");
if (arguments["name"] is not string cardName)
throw new Exception("Invalid argument");
Plugin.Logger.LogInfo($"Adding card: {cardName}");
CheatManager.Command_AddCard(cardName);
return Task.CompletedTask;
}).UseHelpMiddleware().Parent();
Adding New Commands (In-Depth)
To add a new command, you can either use the Fluent API (recommended) or implement the ICommand interface directly for more control:
public class MyCommand: ICommand
{
public string Name
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: