Using the broforce‐tools Script - Gorzontrok/Bro-Maker GitHub Wiki

The Broforce-Templates repo provides the broforce-tools (bt) command line tool for creating new projects, managing Thunderstore metadata, and packaging releases.

Installation

Windows / Linux:

pipx install path/to/Broforce-Templates/Scripts

NixOS:

If you're using the Broforce-Templates flake, enable it in your NixOS config:

programs.broforce-tools.enable = true;

Configuration

The first time you run broforce-tools, it'll prompt you for configuration. You can also create a config file manually:

Windows: Place broforce-tools.json next to the script in Scripts/

Linux: ~/.config/broforce-tools/config.json

{
  "repos": ["BroforceMods"],
  "defaults": {
    "namespace": "YourName",
    "website_url": "https://github.com/yourname/repo"
  },
  "repos_parent": "/path/to/repos",
  "templates_dir": "/path/to/Broforce-Templates"
}

Creating a New Bro Project

You can run bt create interactively and it'll walk you through the options, or you can provide them on the command line:

bt create -t bro -n "Your Bro's Name" -a "Your Name"

If you want the project created in a different repository than the one you're currently in, use -o:

bt create -t bro -n "Your Bro's Name" -a "Your Name" -o "BroforceMods"

This will:

  1. Copy the bro template files into your repo
  2. Rename all files and references to your bro's name
  3. Create a Changelog.md in the release folder
  4. Copy the BroforceModBuild.targets file to your repo if needed
  5. Optionally set up Thunderstore metadata

Build System

The bt create command sets up your project with the BroforceModBuild.targets build system, which handles compiling your project, copying the .dll to your mod's content folder, and installing it to the game. You'll need to set up a LocalBroforcePath.props file in your repo root. There's an example file in Broforce-Templates/Scripts/LocalBroforcePath.example.props that you can copy and edit:

<Project>
  <PropertyGroup>

    <!-- REQUIRED: Path to your Broforce installation -->
    <!-- For Thunderstore/r2modman installs: -->
    <BroforcePath>C:\Users\YourName\AppData\Roaming\r2modmanPlus-local\Broforce\profiles\Default\UMM</BroforcePath>
    <!-- For direct UMM installs: -->
    <!-- <BroforcePath>C:\Program Files (x86)\Steam\steamapps\common\Broforce</BroforcePath> -->

    <!-- Path to reference DLLs (default points to BroforceMods/libs) -->
    <!-- <LibPath>path/to/libs</LibPath> -->

    <!-- Paths to BroMakerLib and RocketLib -->
    <!-- These default to looking in the game's Mods folder (Thunderstore structure) -->
    <BroMakerLibPath>$(BroforcePath)\Mods\BroMaker-BroMaker\BroMaker\BroMakerLib.dll</BroMakerLibPath>
    <RocketLibPath>$(BroforcePath)\Mods\RocketLib-RocketLib\RocketLib\RocketLib.dll</RocketLibPath>
    <!-- If building from source repos instead: -->
    <!-- <BroMakerLibPath>path/to/Bro-Maker/BroMakerLib/_ModContent/BroMakerLib.dll</BroMakerLibPath> -->
    <!-- <RocketLibPath>path/to/RocketLib/RocketLib/_ModContent/RocketLib.dll</RocketLibPath> -->

    <!-- Build Options -->
    <!-- <CloseBroforceOnBuild>true</CloseBroforceOnBuild> -->
    <!-- <LaunchBroforceOnBuild>false</LaunchBroforceOnBuild> -->
    <!-- <UseHardLinksForInstall>false</UseHardLinksForInstall> -->
    <!-- <VerboseBuildOutput>false</VerboseBuildOutput> -->

  </PropertyGroup>
</Project>

Only BroforcePath is required. The build options are all optional and their defaults are shown above.

If you have multiple repos, you can also set up a BroforceGlobal.props file in the parent directory of all your repos to share settings across them. Each repo's LocalBroforcePath.props will automatically import it if it exists, and can override any settings from it.

Once that's set up, building the solution will automatically install your bro to BroMaker_Storage in the game directory.

Loading your Bro In-Game

After building your project, your bro's files will be installed directly to the game's BroMaker_Storage folder by the build system, so you should be able to start up Broforce and see your bro in the BroMaker menu.

Thunderstore

Setting Up Thunderstore Metadata

If you skipped the Thunderstore setup during project creation, you can set it up later:

bt init-thunderstore "Your Bro's Name"

This creates a manifest.json, README.md, and placeholder icon.png in your release folder. It auto-detects dependencies from your .csproj references.

Packaging a Release

When you're ready to publish your bro on Thunderstore:

bt package "Your Bro's Name"

This syncs the version from your Changelog.md into the manifest.json, validates your files and dependencies, and creates a Thunderstore-ready .zip file.

Version Management

Versions are managed through your Changelog.md. Add entries under the (unreleased) section as you work, and bt package will use that version when creating the package:

bt changelog add "Your Bro's Name" "Fixed fire rate being too fast"

You can also see which projects have unreleased changes:

bt unreleased

Other Project Types

The bt create command can also create regular mods and wardrobe projects:

bt create -t mod -n "My Mod" -a "Your Name"
bt create -t wardrobe -n "My Wardrobe" -a "Your Name"
⚠️ **GitHub.com Fallback** ⚠️