BaseMod Documentation

repository·master·Indexed 19 days ago

https://github.com/daviscook477/basemod

A modding framework and utility provider for Slay the Spire. BaseMod provides a developer console, extensibility hooks, and mod badges for developers. It includes ImGui-based tools for debugging, such as a search window for spawning cards, relics, and potions, an action queue manager, and a combat panel for modifying player and monster stats. Requires Java 8 and ModTheSpire v3.1.0+.

Tokens
1.2K
Snippets
2
Records
10
Agent score
18%

What's inside BaseMod

  1. Install BaseMod

    master

    To install BaseMod, copy the target/BaseMod.jar file into your ModTheSpire mods directory.

    If your mods directory is located at ../_ModTheSpire/mods relative to the repository root, Maven will automatically perform this copy step after packaging.

    cp target/BaseMod.jar path/to/your/mods/directory/
  2. Build BaseMod from source

    master

    Follow these steps to build the project using Maven:

    1. Install ModTheSpire locally using mvn install, or modify the pom.xml to point to a local copy of the ModTheSpire JAR.
    2. Copy desktop-1.0.jar from your Slay the Spire folder into the ../lib directory (relative to the repository root).
    3. Run the package command.
    mvn package
    mvn package
  3. Use the BaseMod Console

    master

    BaseMod includes a developer console for testing. For detailed instructions on how to use the console, refer to the Console Wiki Page.

    Important Safety Warnings:

    • Avoid using the fight command on an enemy or the event command in the starting room while Neow is present; doing so may result in an unloadable save file. Use these commands only after leaving the starting room.
    • Using the event command with an invalid ID will cause the game to crash.
  4. Manage the Action Queue

    master

    The Action Queue window provides a real-time view of the AbstractDungeon.actionManager.actions list. This is useful for debugging sequence-breaking or stuck game states.

    • View Actions: The table displays the class name of the action and its remaining duration.
    • Remove Actions: You can click the Remove button next to any action (including the currently executing currentAction) to immediately delete it from the queue. This can help bypass broken or infinite loops in game logic.
  5. Modify Player and Monster stats via Combat Panel

    master

    The BaseMod combat panel provides direct manipulation of creature attributes during gameplay:

    Player Stats

    • Keys: Toggle emerald, ruby, or sapphire keys (Act 4 content).
    • Gold: Adjust current gold via an input field.
    • HP: Set Max HP and Current HP (sliders/inputs).
    • Energy: Adjust Energy or toggle Infinite energy mode.
    • Deck/Hand: View and manipulate the master deck or current hand (Upgrade or Remove cards).

    Monster Stats

    • Control: Use Open All or Close All to expand/collapse monster info nodes.
    • HP/Block: Adjust individual monster health and block values via sliders/drags.
    • Powers: View active powers and click Remove to strip a specific power from a monster.
    • Kill: Use the Kill button to trigger an InstantKillAction on a monster.
  6. Use the BaseMod Search window to spawn items

    master

    The Search window allows you to quickly find and inject game assets into your current session. It is divided into three tabs:

    Cards

    • Filter by Mod ID: Use the dropdown to filter cards by their specific Mod ID or select ##ALL for everything.
    • Search: Use the text filter to search by card name or ID.
    • Actions:
      • Add to hand: Spawns a specified Count of the selected card (with a specified number of Upgrades) into your current hand. This requires being in combat.
      • Add to deck: Adds the selected card to your master deck. This triggers the ShowCardAndObtainEffect visual.

    Relics

    • Filter by Mod ID: Use the dropdown to filter relics by Mod ID or select ##ALL.
    • Search: Use the text filter to search by relic name or ID.
    • Action:
      • Obtain: Spawns the selected relic in the center of the screen and grants it to the player. Requires being in a valid room.

    Potions

    • Filter by Mod ID: Use the dropdown to filter potions by Mod ID or select ##ALL.
    • Search: Use the text filter to search by potion name or ID.
    • Action:
      • Obtain: Immediately grants the selected potion to the player.
  7. Configure BaseMod ImGui UI settings

    master

    BaseMod provides persistent configuration for its ImGui-based developer tools. You can control the visibility of specific windows using the following boolean configuration keys:

    • imgui-search: Toggles the visibility of the Search window (used for finding cards, relics, and potions).
    • imgui-actionqueue: Toggles the visibility of the Action Queue window (used for inspecting and removing pending game actions).

    These settings are managed via BaseMod.setBoolean and BaseMod.getBoolean and persist across sessions.