You are viewing a potentially older version of this package. View all versions.
SpecialCircumstances-UndoEverywhere-0.2.1 icon

UndoEverywhere

Adds Restart Ring to the pause menu outside combat, undoing shop purchases, event choices and path picks back to the end of your last battle -- or to the start of the run. Battles you already won stay won.

Date uploaded 2 days ago
Version 0.2.1
Download link SpecialCircumstances-UndoEverywhere-0.2.1.zip
Downloads 26
Dependency string SpecialCircumstances-UndoEverywhere-0.2.1

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
MT2-Trainworks_Reloaded-0.7.2 icon
MT2-Trainworks_Reloaded

A Data Loader and Injection Engine for Monster Train 2

Preferred version: 0.7.2
Conductor-Conductor-0.4.1 icon
Conductor-Conductor

Central library of reusable custom effects, status effects, and keywords to make modding Monster Train 2 safer and easier, used as a dependency for other mods.

Preferred version: 0.4.1

README

UndoEverywhere

A Monster Train 2 mod that adds a way to undo out-of-combat mistakes -- shop purchases, event choices, path picks -- that the game otherwise has no undo for outside of battle.

The pause menu's Restart Battle button now also works on the map, where it relabels itself to Restart Ring. Picking it rewinds the run to the moment the last battle ended -- or to the start of the run, if you haven't fought one yet -- and reloads from there. Any battles you've already won stay won; only the shop purchases, event choices and path picks made since are undone.

Under the hood the mod snapshots your save file at each of those boundaries (a .stagestart file next to the real save) and restores it through the game's own continue-run path, so gold, relics, deck and map position all come back exactly as the game itself would load them.

Changes in 0.2.0

Fixes to the restart itself, all reproduced and verified in game:

  • The button did nothing during a run's first ring. The run-start snapshot was taken from GameStateManager.StartNewRun, which returns before the run exists, so it captured an empty save. Pressing the button restored that emptiness over the live run. Snapshots are now taken when the map first opens, and a snapshot is refused outright unless the save holds a set-up run.
  • The button then stayed hidden for the rest of that run, because the wrecked save sat at a game sequence the mod treats as non-restartable.
  • A new run could rewind into the previous one. The snapshot file is named after the save slot, which every run in that slot shares. Snapshots now carry their run's id and one belonging to a different run is ignored and replaced.
  • Restarting the first ring dropped you on the clan-selection screen with the run erased, because the game's continue path treats a save at that early stage as "no run in progress" and starts a new one.
  • Snapshots are now deleted when a run ends -- abandoned, lost or won.
  • The confirmation dialog says "ring" instead of "battle" when it is about to restart a ring.

Configuration

None -- the mod has no config file. It's on whenever the plugin is loaded.

Install

Use a mod manager (r2modman / Thunderstore Mod Manager) and install SpecialCircumstances-UndoEverywhere. Dependencies are pulled in automatically:

  • BepInEx 5.4.2100
  • Trainworks Reloaded 0.7.2
  • Conductor 0.4.1

Manual install: drop UndoEverywhere.dll into BepInEx/plugins/.

Known limitations

  • Snapshots survive quitting and relaunching. Installing the mod part-way through a ring is fine: a snapshot is taken the next time the map opens.
  • The button stays hidden during battle intros and at the game-over screen -- a lost run can't be rewound -- and on the run-setup screen, where there is no run to snapshot yet. In ring 0 it becomes available as soon as the map opens.
  • Rewinding is all-or-nothing back to the last battle. There's no step-by-step undo of a single shop purchase.
  • The confirmation dialog reads "restart the current ring" in English only. The vanilla battle wording stays localized; the ring wording isn't.

Build

dotnet build

The output DLL is copied to ../../mt2-plugins/UndoEverywhere after every build (PluginDeployDir in UndoEverywhere.csproj) -- point that at your BepInEx/plugins folder to test in-game directly.

Harmony patches live in UndoEverywhere/patches/: RestartStagePatches.cs wires the pause-menu button up outside of combat and performs the restart, and StageStartMarker.cs captures the snapshots it restores back to.

Publishing to Thunderstore is driven by thunderstore.toml via tcli; the VS Code tasks in .vscode/tasks.json build, validate and publish the package.

License

See LICENSE.