stdlib

⭐ ⭐ (366 endorsements) 📥 29,664 downloads 📌 v2.6 📅 10/4/2023
🟡 Updated this year

By hackflow · Utilities

⬇ Download Mod Source: Nexus Mods ↗ 📅 Updated: 6/22/2026 📅 Created: 10/4/2023
⚠️ Potentially Incompatible — Recent Game Update

This mod may not work until the author updates it. Check for an update, or see the rollback guide.

🔍 Analysis

  • 👍 1.2% endorsement rate — high engagement, a strong quality signal
  • 🏆 #9 of 51 Utilities mods in this game by downloads

📋 About This Mod

This does not alter game by itself. It's purpose it to make other modders' lives easier.

Here is a glimpse of how this could be used. See full docs on Github.

Usage

Do some random stuff

// Make local aliases for std namespaces

local Rand = ::std. Rand, Re = ::std. Re, Str = ::std. Str, Text = ::std. Text,

Debug = ::std. Debug.with({prefix = "mymod: "});

// Choose a random weapon

local weapon = Rand.choice(["scramasax" "ancient/khopesh" "falchion"]);

actor.m. Items.equip(::new("scripts/items/weapons/" + weapon));

// Same but with different weights

local weapon = Rand.choice(["scramasax" "ancient/khopesh" "falchion"], );

// Dropping loot for a wolf

local n = 1 + Rand.poly(2, ::World. Assets.getExtraLootChance());

local items = Rand.choices(n, ["werewolf_pelt_item" "adrenaline_gland_item"], );

foreach (item in items) {

local loot = ::new("scripts/items/misc/" + item);

loot.drop(_tile)

Strings and Text

local short = Str.cutprefix(name, "Ancient ");

if (Str.startswith("background.legends_", this.getID())) ...

Str.join("_", split(id, "."))

local romanNumber = Re.find(this.getName(), " (+)$");

local versionNums = Re.all("1. 4. 25", @"\d+"); // ["1", "4", "25"]

// Patch tooltip text, add 5 to chance to hit, and make it green color

local tooltip = getTooltip();

tooltip.text = Re.replace(tooltip.text,

@"(\d+)(% chance to hit)",

@(x, end) Text.positive(x.tointeger() + 5) + end);

Debug things

// Log that, accepts arbitrary nested data structure

Debug.log("loot for wolf", items);

// Outputs: mymod: loot for wolf = ["werewolf_pelt_item", "adrenaline_gland_item"]

// Only show keys that contain "Level"

Debug.log("bro", _player, "Level");

// bro = {m = {Level = 13, LevelUps = 0, LevelUpsSpent = 13, ...}, ...}

// Same but go deeper

Debug.log("bro", _player, {filter = "Level", depth = 4});

//     human = {

//         actor = {m = {LevelActionPointCost = 1, LevelFatigueCost = 4, ...}, ...}

//         ...

//     m = {Level = 13, LevelUps = 0, LevelUpsSpent = 13, ...}

Manipulate player:

// Roll weighted talent stars

foreach (i in Rand.take(3, , weights)) {

local w = weights;

_player.m. Talents = Rand.choice(, );

// Add one more talent, but not in attributes excluded by background

🤖 AI-enhanced — based on mod data

stdlib is a utility mod for Battle Brothers that fills the gap left by the missing Squirrel/Battle Brothers standard library. It provides a collection of various utilities to assist in coding mods, making it a foundational tool for mod developers.

✨ Key Features

Provides an assortment of various utilities to help coding mods
Fills the gap left by the lacking Squirrel/Battle Brothers standard library

📊 Pros & Cons

✅ Pros

  • Solid download count (29,664) shows it's widely used by the modding community
  • 366 endorsements indicate it's trusted and appreciated by modders
  • Essential for anyone serious about making Battle Brothers mods

⚠️ Cons

  • Last updated June 2026 — may not be actively maintained
  • Requires knowledge of Squirrel scripting to fully utilize
🎯 Is This For You?
For Battle Brothers mod developers who need a solid foundation of utility functions. If you're just a player looking for gameplay tweaks, this isn't for you — it's a developer tool. Skip if you don't plan on coding mods.
📦 Install:Easy· Under 1 minute

💡 Beginner Tips

  • Place the mod in the Battle Brothers data directory or use a mod manager like ModLoader
  • Check the mod's source code or comments for usage examples, as the description lacks details
  • Ensure you have the latest version of the game to avoid compatibility issues

📊 Mod Details

Game
Battlebrothers Mods
Author
hackflow
Version
2.6
Downloads
29,664
Endorsements
366
Category
Utilities
Created
10/4/2023
Updated
6/22/2026

🧩 Commonly Used Together

Users add these mods to the same collections — a real compatibility signal, not an AI guess.

🔧 How to Install Battle Brothers Mods

Download from Nexus Mods.

📖 Full step-by-step install guide for Battle Brothers →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Battle Brothers commands, item IDs, and more.

Keep browsing — more Battle Brothers mods await

📋 All Battle Brothers Mods 🏆 Top 25 📂 More Utilities 👤 More by hackflow 🔎 Similar Mods 🌐 Best Utilities (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods