|
|
||
|---|---|---|
| 1.7/Assemblies | ||
| About | ||
| Defs | ||
| Languages/English/Keyed | ||
| Patches | ||
| Source | ||
| Tests | ||
| Tools | ||
| docs | ||
| .gitignore | ||
| CHANGELOG.md | ||
| README.md | ||
README.md
Blax Castes
RimWorld mod (1.7) by Blax Gaming: policy bundles and join defaults. Every slave you buy needs its apparel, food, drug and reading policy, its schedule and its work priorities set by hand. Blax Castes bundles those settings into castes such as Slave or Miner slave, and puts each pawn into the right caste the moment it joins or changes status. Needs Harmony. Works with any combination of DLCs, or none: see DLC support for what each one adds.
Design and roadmap: docs/design.md. Planned next: a caste button on selected pawns and new caste from a pawn (1.1), allowed area, hostility, self-tend, carried medicine and fire at will per caste (1.2), a caste for every way a pawn joins, children included (1.3).
Features (1.0)
- 📦 Castes. A caste manages up to eight slots: apparel, food, drug and reading policy, medical care, schedule, work priorities and, with [1001] Weapons Tab Reborn, the weapon loadout. Each slot is set or left alone. Putting a pawn in a caste writes every managed slot through the vanilla setters (and Weapons Tab Reborn's own API for the loadout).
Source/BlaxCastes/Caste.cs,CasteUtility.cs - ✅ Per-slot checks. Apparel, drugs, reading and the schedule need the pawn's tracker and skip quest lodgers, prisoners and mutants without policies; apparel also skips mutants that wear no apparel, and the schedule skips the mutants the Schedule tab leaves out. Food needs a configurable food tracker and skips babies and mutants without policies. Medical care needs player settings and a flesh pawn. Work priorities and the loadout are for colonists and slaves only. So a prisoner in a caste gets its food policy and medical care only.
- 🕒 Schedule. A caste can carry a full day: 24 hours of anything, work, recreation, sleep or meditate (Royalty). The manager paints it like the vanilla Schedule tab: pick the activity with the vanilla selector, then click or drag over the hours. A drag paints only when it starts on the hours, so dragging the scrollbar past them never paints. "Copy from pawn" takes the schedule of one of your colonists or slaves, and "Leave alone" stops managing it. While the caste leaves the schedule alone, the first painted hour (or a copy) gives every member the whole day; the tooltips say so. A pawn whose whole day matches the caste follows every change; one hour changed by hand and the pawn keeps its own. Meditate hours need Royalty: without it they act as Anything, the caste keeps them for when Royalty is back, and a note under the grid names them. An hour whose activity came from a removed mod becomes Anything.
Source/BlaxCastes/ScheduleSlot.cs - 🛠️ Work priorities. A caste sets only the work types you pick, each to 1, 2, 3, 4 or off; the rest stay as they are. So every caste can set Firefighting to 1, and a Field slave caste Growing 1 and Plant cutting 2. Work types a pawn cannot do are skipped. With manual priorities off, any number means on; Castes still stores the caste's number, so turning manual priorities on later leaves every member following its caste. "Start from nothing" turns every other work type off first, for castes that should do only their listed work; Patient and Bed rest stay as they are, because they are how a hurt or sick colonist or slave goes to bed. The Follow rule works per work type. Childcare (Biotech), Dark study (Anomaly) and Fishing (Odyssey) are listed while their DLC is on; while it is off a caste keeps their priorities, skips them and names them in a note with a "Forget these" button for a DLC you dropped for good, "Start from nothing" turns no work off when only such types are listed, and "Apply to all members" hides when they are all the caste manages. The slot turns itself off while one of these is active: Work Tab replaces the vanilla work priorities, and Free Will, Work Manager, AutoPriorities and WorkRoles set them automatically.
Source/BlaxCastes/WorkSlot.cs - 🗡️ Weapon loadout. With [1001] Weapons Tab Reborn active, a caste can set the pawn's weapon loadout: a Guard caste a rifle loadout you made, a Slave caste the Pacifist loadout. Without the mod the row is hidden. Castes calls the API Weapons Tab Reborn publishes for Better Pawn Control, found by reflection; if that API is missing or fails, the slot turns itself off with one warning in the log, and a call that fails never counts as a deleted loadout. In a save made without Weapons Tab Reborn, Castes creates the mod's loadout database the way the mod does, so the slot works at once. A loadout deleted in Weapons Tab Reborn becomes unmanaged in the caste, with one warning.
Source/BlaxCastes/WeaponsTab.cs - 🔗 Members follow their caste. Change a caste's slot and every member still on the old value gets the new one. Members you changed by hand keep theirs. A slot that was left alone and becomes managed reaches every member; a slot that stops being managed changes nobody. Edits inside a policy (the Slave outfit's filter) reach members through the vanilla reference.
Source/BlaxCastes/CasteManager.cs - 🌱 Starter castes. A new game starts with three castes, already picked in the join defaults: Colonist (your current default apparel, food, drug and reading policy, medical care left alone), Slave (the Slave outfit, Simple food, No drugs; reading and medical care left alone) and Prisoner (Simple food). Bought and new colonists use Default caste, which is Colonist; bought and new slaves use Slave; new prisoners use Prisoner. The starting colonists go into Colonist, so their policies do not change. Policies are found by their starting names (No drugs by its source def); one that was renamed or deleted leaves its slot alone. Without Ideology there is no Slave caste and the slave rows stay at No caste; the settings say so under the starter castes option. A save started without Ideology gets the Slave caste on its first load with Ideology, wired to the slave rows that are still at No caste, with one message; such a save has no Slave outfit (the game makes it only in a new game with Ideology), so Castes makes one for that caste, the only policy it creates without a click. A save without castes gets the starter castes once, on load, with one message (it points to the mod settings while the Caste column is off); nobody moves until you click "Assign by status", which gives each pawn its caste's policies in place of its own.
Source/BlaxCastes/StarterCastes.cs - 🗂️ Caste manager. Assign tab > "Manage castes" above the Caste column. It is the vanilla policy manager: the caste list with new, duplicate, rename, delete and make default on the left, and on the right a scrolling list of the slots: one row per policy with a "managed" checkbox, a dropdown and a pencil that opens the vanilla editor for that policy, the weapon loadout row while Weapons Tab Reborn is active, the schedule grid and a cycle button per work type (leave alone, 1, 2, 3, 4, off) with "Start from nothing". Clicking a cycle button several times in a row moves only the members that followed the work type before the first click, so a pawn you set by hand to a value the cycle passes through keeps it; pawns "Assign by status" puts into the caste in between start on the caste's value and follow the next clicks too. Ticking a slot starts it at the game's default policy (or the colonist default medical care, or Weapons Tab Reborn's default loadout). The work priorities are greyed out, with a note, while the setting is off or an automatic work manager is active. Below the slots: the member count and "Apply to all members", which asks first, naming the count, and then sets every managed slot on every member, hand changes included. Next to the close button, "Assign by status (N)" shows while pawns without a caste exist: it asks first, because it replaces those pawns' own policies with their caste's, then puts each into the caste of its new colonist, new slave or new prisoner row, and skips pawns you set to No caste. "Make default" explains the default caste in its tooltip. When the game has no Slave outfit, a "Create Slave outfit" button makes one. A caste using the Slave outfit warns that it has no cold protection. Deleting a caste leaves its members casteless on their current policies, and join rows that pointed at it fall back to No caste.
Source/BlaxCastes/Dialog_ManageCastes.cs - 📋 Caste column. A Caste column in the Assign tab, left of hostility, medical care and the policy columns; the same column sits right of the timetable in the Schedule tab (clear of the tab's activity selector) and left of the work columns in the Work tab. In the Work tab only "Manage castes" sits above it, so the header keeps the work columns' height. Click a cell for the menu (No caste, every caste, Reset to caste, Edit caste), or drag down the column to give several pawns the same caste; pawns already in that caste keep their hand changes while you drag. The cell shows the caste, the caste with "*" when one of the pawn's managed slots differs (the tooltip names each slot with both values; for the schedule it says "Schedule", for work priorities it names each work type that differs), "No caste" when you took the pawn out by hand or its caste was deleted, "None" when it is not in a caste, "(pending)" while a join will change its caste on the next tick, and "Unchangeable" for quest lodgers. The first click on the header sorts by caste, pawns without one last; the second click reverses it.
Source/BlaxCastes/PawnColumnWorker_BlaxCaste.cs,CasteColumns.cs,Patches/BlaxCastes_Assign.xml,Patches/BlaxCastes_ScheduleWork.xml - 🚪 Join defaults and status changes. Assign tab > "Defaults" above the Caste column. Five rows pick a caste for bought as slave, bought as colonist, new colonist, new slave and new prisoner: No caste, Default caste (the one marked default in the manager) or a specific caste. The two slave rows need Ideology: without it they are hidden, unless a save made with Ideology still has slaves or a slave row picks a caste; then they show with a "Needs Ideology" note.
Source/BlaxCastes/JoinDefaults.cs,Dialog_JoinDefaults.cs- Buying a pawn from a trader uses the bought rows; the pawn's final status picks slave or colonist. Every other change between colonist, slave and prisoner goes by the final status: recruiting, freeing a slave and releasing an arrested colonist to new colonist; enslaving and returned runaways to new slave; capturing, quest prisoners, arresting a colonist and imprisoning a slave to new prisoner.
- Castes applies a join one tick after it happens, after the game's own status-change resets, so its choice wins over mods that set policies in the same call. A bought slave arrives with its caste's outfit and food policy already set, and a message names the caste.
- A caste you pick by hand before the join is applied wins over the row. A pawn sold or released before then is dropped.
- A No caste row takes a pawn out of a caste a join row had put it in; a caste you picked by hand stays. With "Reset policies" on, the policies it still has from that caste go back to the game defaults (medical care to the game's default for its status, if the caste set it); policies you changed by hand stay. The same happens when a row moves a pawn on from a row-set caste to a caste that leaves some of those policies alone, so a recruited prisoner does not keep the prisoner food. The schedule, work priorities and loadout have no game default and stay as they are.
- Babies (Biotech), quest lodgers and mutants without policies (Anomaly) are skipped. A mutant whose def is gone (a save made with Anomaly, loaded without it) is left alone.
- ↩️ The old caste comes back. When a colonist or slave leaves your faction, is sold or becomes a prisoner, Castes remembers its caste (or No caste, if you set that) and its own settings from just before the change. If it comes back within 60 days (a setting) with the same status, it gets that caste back instead of its row's: an arrested Miner who is released is a Miner again, a Miner slave you sell and buy back is a Miner slave again, and a pawn you set to No caste is back at No caste. It keeps what you had changed by hand: settings that followed the caste get the caste's current value, settings you had changed get your value back, and a setting the caste started managing while it was away (a schedule, a work type) gets the caste's value, as it did for every member. A policy you deleted in the meantime is skipped, even if a new policy got its number. What the caste it had while it was away set (the prisoner caste's food) goes back to how it was. An arrested colonist who is then enslaved goes to the new slave row. Records are saved with the game, keyed by the pawn's ID, and dropped when they are older than the setting or their caste is deleted.
- 👋 Leaving. A pawn that leaves your faction (sold, released, gone to another faction) leaves its caste on the next tick, and a check every 2500 ticks catches the rest. Its policies stay as they are. Leaving the map counts by where the pawn ends up: a freed slave from another faction that walks off, an escaped slave or prisoner, a pawn left on a map that closes, or a prisoner a gravship leaves behind (Odyssey), leaves its caste (a slave with its slave caste remembered), and nothing joins a caste on the way out. A pawn that leaves in a caravan, a transport pod or a shuttle, or is kidnapped, is still yours and keeps its caste.
- ⚠️ Overlap warnings. If Better Pawn Control, Better Pawn Control Forked, 1trickPwnyta's Defaults, Automatic Slave Outfit or PrisonerDefaults is active, the settings page names it and what it sets, and one message per save suggests turning those options off. Castes still wins, because it applies a tick later. Detection only; Castes patches none of them.
Source/BlaxCastes/OverlapWarnings.cs,Compat.cs - 💬 First load. A new game, or the first load of a save that already has castes, posts one message that points to Assign > Manage castes. While the game runs without the Caste column it waits; a change to the column setting counts after the restart it needs, for this message and the starter castes message.
- ⚙️ Settings.
enabled(off: castes never write a policy, schedule, work priority or loadout; castes and memberships stay in the save),manageWorkPriorities,manageWeaponLoadout(shown while Weapons Tab Reborn is active),enableJoinDefaults,joinMessages,revertOnLeave("Reset policies a caste set when a join moves the pawn on"; only governs that revert),returnToPreviousCasteandformerCasteDays(60),seedStarterCastes,warnOverlaps,showAssignColumn(the Caste column in the Assign, Schedule and Work tabs; needs a restart). All toggles are on by default. While a game is loaded, the settings page also has "Manage castes" and "Join defaults" buttons, the way in while the column is off.Source/BlaxCastes/BlaxCastesMod.cs
💾 Save safety: all state lives in one game component (GameComponent_BlaxCastes), nothing is stored on vanilla objects, and the only vanilla data Castes writes is each pawn's own policies, medical care, timetable and work priorities (and its Weapons Tab Reborn loadout, through that mod's API). Schedules and work priorities are saved as def names and loadouts as ids, never as references. Memberships drop pawns that are discarded or destroyed without being dead, on every save and after loading. A policy that left its database (a mod deleting it without TryDelete, or a delete in a vanilla editor opened from the manager) or a loadout Weapons Tab Reborn no longer has becomes unmanaged with one warning per caste; a schedule hour whose activity is gone becomes Anything, and a work type that is gone is dropped, each with one warning. Names from an official DLC that is off (Meditate, Childcare, Dark study, Fishing) are kept with no warning and skipped, and work again when the DLC is on again. Without Weapons Tab Reborn a caste keeps its loadout id for when the mod comes back. Joins waiting for the next tick are saved with the game. Former-caste records are keyed by the pawn's ID, not by reference; the pawn's own policies in a record are kept like a caste's, and a policy deleted since is dropped before the save, so loading never meets one it cannot find or mistakes a new policy with the same number and name for it. Adding the mod to a running save works. Removing it leaves every pawn on its last policies; the next load logs two red errors for the missing component ("Could not find class BlaxCastes.GameComponent_BlaxCastes" and "Can't load abstract class Verse.GameComponent"). They do no harm and go away once the game is saved again.
Replaces: Automatic Slave Outfit and PrisonerDefaults, the join, schedule and work defaults of Better Pawn Control, Better Pawn Control Forked and 1trickPwnyta's Defaults, the joiner work priorities of Plug and Play Joiner, and partly Save My Settings (clothing and food presets per pawn).
Compat:
- Blax Slaves: its buy-as-slave-or-colonist button lands in the right bought row, and returned runaways land in the new slave row (or their old caste). Castes calls nothing in Blax Slaves.
- Trade as Slave or Colonist: same as Blax Slaves' buy mode. Blax Slaves' buy mode stands down while it is active.
- Better Pawn Control, its fork, 1trickPwnyta's Defaults, Automatic Slave Outfit and PrisonerDefaults set policies of their own when a pawn joins. Castes applies a tick after the join, so its row wins, and it warns while one of them is active. Turn theirs off so two mods don't write the same policies.
- [1001] Weapons Tab Reborn: the weapon loadout slot. It has no 1.7 build; 1.7 loads its 1.6 assembly, and its loadout API works there. A caste that sets the loadout writes it a tick after a join, so it wins over Weapons Tab Reborn's default loadout; a caste that leaves it alone leaves Weapons Tab Reborn in charge.
- Work Tab replaces the vanilla work priorities, and Free Will, Work Manager, AutoPriorities and WorkRoles set them automatically, so while one of them is active the work priorities slot is off and greyed out in the manager.
- Tested next to Hospitality, Custom Prisoner Interactions, Prisoner Realism and Weapons Tab Reborn.
- Numbers builds its own tables, so the Caste column shows only in the vanilla Assign, Schedule and Work tabs.
Not supported yet: multiplayer, animal castes. A caste button on selected pawns comes in 1.1.
DLC support
Blax Castes works with any combination of DLCs, or with the core game alone, so nobody is left out. About.xml lists no DLC. When a DLC is turned off for a save, Castes keeps what it stored from that DLC (Meditate hours, Childcare, Dark study and Fishing priorities) and uses it again once the DLC is back. Removing a DLC from a running save can still make the game itself log errors or drop content. A feature that needs a DLC switches off without it, and everything else keeps working.
| Feature | Needs | Without it |
|---|---|---|
| Castes, caste manager, Caste column, members follow, Apply to all members, Assign by status | Nothing | Same |
| Apparel, food, drug and reading policy, medical care | Nothing | Same |
| Schedule slot | Nothing | Four brushes instead of five |
| Meditate hours | Royalty | No Meditate brush. Saved Meditate hours act as Anything and come back with Royalty; painting them over drops them |
| Work priorities slot, Start from nothing | Nothing | Same |
| Childcare priority | Biotech | Not listed. A saved priority is kept and skipped; "Forget these" drops it |
| Dark study priority | Anomaly | Same as Childcare |
| Fishing priority | Odyssey | Same as Childcare |
| Weapon loadout slot | [1001] Weapons Tab Reborn (a mod, not a DLC) | Row hidden, the saved loadout id is kept |
| Starter Colonist and Prisoner castes and their join rows | Nothing | Same |
| Starter Slave caste, Create Slave outfit, the cold protection note | Ideology | Not created. A save gets the Slave caste, and the Slave outfit if it has none, on its first load with Ideology |
| Join rows: bought as colonist, new colonist, new prisoner | Nothing | Same |
| Join rows: bought as slave, new slave | Ideology | Hidden, or shown with a "Needs Ideology" note while a save made with Ideology still has slaves |
| Status changes: buying, recruiting, arresting, releasing, capturing | Nothing | Same |
| Status changes: enslaving, freeing, imprisoning a slave, returned runaways, a slave sold and bought back | Ideology | Cannot happen |
| The old caste comes back | Nothing | Works for colonists |
| Leaving: sold, released, map exit, closing map; caravans, pods, shuttles and kidnapping keep the caste | Nothing | Same |
| A prisoner a gravship leaves behind leaves its caste | Odyssey | Cannot happen |
| Babies skipped | Biotech | No babies exist |
| Mutants without policies or apparel skipped | Anomaly | No mutants exist. A mutant whose def is gone is left alone |
| Overlap warnings, settings, messages | Nothing | Without Ideology the settings say that slaves need it |
Anomaly and Odyssey are not installed on the test machine, so their parts are checked against the 1.7 game code rather than in a test run.
Development
The repo is the mod folder. Link it into the game with a directory junction, run from the repo root (adjust the RimWorld path); Tests/run-tests.ps1 creates it if it is missing:
New-Item -ItemType Junction -Path "E:\SteamLibrary\steamapps\common\RimWorld\Mods\BlaxCastes" -Target (Get-Location).Path
Build (needs the .NET 10 SDK; output goes to 1.7/Assemblies/BlaxCastes.dll):
dotnet build Source\BlaxCastes\BlaxCastes.csproj -c Release
RimWorldDir and HarmonyDir in the csproj point at the Steam install and the Harmony mod; override them with -p:RimWorldDir=... elsewhere.
RimWorld 1.7 no longer runs on Unity/Mono. It runs on .NET 10 (CoreCLR) with Ludeon's own engine ("Waylith"):
Assembly-CSharp.dllandUnityStubs.dll(Rect, Color...) sit in the install root, and targetnet10.0.- Harmony for 1.7 is the Harmony mod's
1.7/Assemblies/0Harmony.dll(Workshop 2009463077). Reference it, don't ship it. ParameterlessPatchAll()is obsolete in Harmony 3. - Patches are applied from a
[StaticConstructorOnStartup]class, one class at a time, so one broken target can't disable the rest. CheckPlayer.logfor[Blax Castes] 6 patches applied(the join hooks onPawn.SetFaction,Pawn_GuestTracker.SetGuestStatusandPawn.PreTraded, and the leaving hooks onPawn.ExitMap,MapDeiniter.PassPawnsToWorldandGravshipUtility.AbandonMap). Every target is in the core game, so all six apply with any DLC set.
Every change to castes, memberships, join rows and the default caste goes through CasteManager, so the sync rules and the enabled switch hold whichever window or hook made the change.
Works with the other Blax mods: Castes has no hard dependency on Blax Slaves or Blax Zones and calls nothing in them. Load order is Castes, Zones, Slaves; Castes lists no sibling in loadAfter. Detection goes through Compat.IsActive(packageId), which matches a local copy next to a Workshop copy. 1.0 has no API. 1.1 adds a read-only CastesApi for Blax Zones, 1.3 the join API for Blax Slaves.
Workshop page
- Art:
About/Preview.png,About/ModIcon.pngand the section headers indocs/art/steam/are rendered fromSource/Art;Source/Art/README.mdhas every render command. - Description:
docs/workshop-description.txt(Steam BBCode). Its images load fromhttps://cdn.blax.at/blax-gaming/castes/, because Steam loads description images cross-origin and Forgejo's raw URLs send noAccess-Control-Allow-Originheader. - In-game clips worth recording for the page:
docs/workshop-media.md.
Workshop upload
Tools/workshop-upload.ps1 creates and updates the Workshop item from the command line. A small tool (Tools/WorkshopUpload) uses the Steamworks.NET build and steam_api64.dll that ship with RimWorld and attaches to the running, logged-in Steam client as RimWorld, so it needs no password, no game window and no dev mode.
.\Tools\workshop-upload.ps1 # dry run: build, stage, check the Steam login; uploads nothing
.\Tools\workshop-upload.ps1 -Check # release check: lists every problem -Publish would refuse
.\Tools\workshop-upload.ps1 -Publish # upload
.\Tools\workshop-upload.ps1 -Publish -DescriptionFile docs\workshop-description.txt # also replace the description
It stages only what players need (About, 1.7, Defs, Patches, Languages) in %TEMP%, sets the tags the game would (Mod plus the supported versions), and writes every CHANGELOG.md entry since the version in Tools/workshop-published.txt as the change note. The title comes from About.xml and the preview is About/Preview.png. -Publish refuses unless the shipped files are committed and pushed, the top CHANGELOG entry matches modVersion, and two test runs passed after the last build: one with every installed DLC and one with -NoDlc (Tests/run-tests.ps1 keeps both results as the "all" and "nodlc" copies). It also refuses while a forgejo.blax.at link in the description needs a login, so the repo has to be public before the first upload.
The Workshop item is 3848261054 (About/PublishedFileId.txt), so -Publish updates it. Without that file the first -Publish creates a new Workshop item, Public unless you pass -Visibility private (Steam's own default for a new item is Private), and uses docs/workshop-description.txt as its description. It writes the new id to About/PublishedFileId.txt before the content upload, so a failed upload is retried as an update and never makes a second item, and writes Tools/workshop-published.txt after a successful one. Commit both files. From then on -Publish updates that item. The in-game route still works: Tools/workshop-stage.ps1 swaps the junction for a clean copy, upload from Mods > Blax Castes > Advanced... > Upload to Steam Workshop (dev mode), then workshop-stage.ps1 -Done copies the new id back into the repo.
-DescriptionOnly -DescriptionFile docs\workshop-description.txt replaces just the text of an existing item, with no build, no content upload and no change note. Steam loads description images as cross-origin requests, so every [img] host must send an Access-Control-Allow-Origin header or the image shows broken; the script checks each one and -Publish refuses otherwise. Forgejo's raw URLs send no such header, so the Steam images are served from cdn.blax.at/blax-gaming/, which does.
Tests
Tests/BlaxCastesTests is a separate test mod. Tests/run-tests.ps1 builds both projects, links the test mod into the game's Mods folder for the run, and starts RimWorld headless (-headless -quicktest -blaxcastestests, no window) with its own save data folder in %TEMP%\BlaxCastesTest, so your mod list, saves and settings stay untouched. Every run starts from default mod settings. The suite runs in a quick-test colony, saves and reloads the game, runs the persistence tests, writes BlaxCastesTestResults.txt and quits. It takes under a minute and needs Steam running.
.\Tests\run-tests.ps1 # refuses while RimWorld is open
.\Tests\run-tests.ps1 -AllowWhileRunning # runs next to an open game, at below-normal priority
.\Tests\run-tests.ps1 -AllowWhileRunning -Compat -NoBuild
.\Tests\run-tests.ps1 -AllowWhileRunning -Compat -Tasoc -NoBuild
.\Tests\run-tests.ps1 -AllowWhileRunning -NoDlc -NoBuild
If PowerShell blocks scripts, run it as powershell -ExecutionPolicy Bypass -File .\Tests\run-tests.ps1 -AllowWhileRunning.
-Compatalso loads Blax Slaves and the installed mods Castes is tested next to (Hospitality, Custom Prisoner Interactions, Prisoner Realism, Weapons Tab Reborn), in the load order Castes, then Slaves. Trade as Slave or Colonist stays out, so the buy-mode test drives Blax Slaves' own buy mode. The loadout tests run only here; without Weapons Tab Reborn they skip, and one test checks the slot stays off.-Tasocadds Trade as Slave or Colonist; Blax Slaves' buy mode stands down for it, and the buy-mode test drives that mod instead.-NoDlcruns on the core game alone;-Dlc Royalty,Biotechloads only the named installed DLCs. Every installed DLC is still listed as known, so the game does not switch a left-out one on. Run the suite without a switch, with-NoDlcand with each DLC left out before a release.-NoBuildskips the build.
The mods whose join defaults overlap with Castes (Better Pawn Control, its fork, 1trickPwnyta's Defaults, Automatic Slave Outfit, PrisonerDefaults) and the automatic work managers are not installed on the test machine. Their package ids were read from each mod's About.xml in its public source repository (listed in Source/BlaxCastes/Compat.cs), and the overlap and work manager tests inject an id into the detection list.
A test fails when Blax Castes logs an error, or when an error's stack passes through the mod or the test code. It also fails on any [Blax Castes] warning it did not declare with T.ExpectWarning (must be logged) or T.AllowWarning (may be logged), and the startup test fails on any Blax Castes warning, so a missing DLC def or a failed patch shows up in every DLC set. Errors another mod logs from its own code while a test ticks the game are listed as LOGERR lines instead; the harness keeps a short list of them (KnownForeignErrors in Harness.cs). Today that is Weapons Tab Reborn's "tried to equip loadout" error, which it logs once for the first pawn of another faction that thinks.
Only one run at a time: a lock file in the data folder holds the running script's process id, and a lock left by a dead process is taken over. Mods\BlaxCastes must be a junction to this repo; the script creates it if missing and stops if a real folder is in the way. Exit code 0 means all passed, 1 failures, 2 the run didn't finish (see game.log and game.err.log in the data folder).
Tests are public static void methods marked [BlaxTest("area: what", phase: 1)], using T for assertions and Fixtures for colonists, prisoners, slaves, quest lodgers, babies, castes, policies, ticks and queued joins. Phase 2 runs after the save and reload; carry ids through T.Carry, or T.CarryAtSave for values later phase-1 tests may still change. A test that needs a DLC skips with "needs Ideology" (slaves) or "needs Biotech" (babies) after its core part; the DLC-off side has its own tests in DlcTests.cs. The buy-mode compat test needs -Compat or -Tasoc, the loadout tests -Compat. Headless runs have no GUI, so the tests drive the logic behind the windows and the column; drawing is checked by hand.
Useful 1.7 switches for manual runs: -quicktest (straight into a generated colony), -headless, -savedatafolder=<dir>, -QuitAfterBoot, -NoFileLog.
Made by Blax
🛠️ Blax Gaming is a project of Blax Software, an Austrian software practice. We write Austrian-quality code in many fields: web platforms, mobile apps, backends, infrastructure, and the mods we play in our own colonies. Need something built? 👉 www.blax.at
