Every new shelf starts at Preferred and pulls meals out of the freezer, every new bill searches the whole map to make one item, and every tamed husky starts with no area and no training. Blax Defaults lets you tune one stockpile, shelf, bill, crop, building or animal, click "Make default", and every new one you make starts like it. Its forbid rules decide what stays forbidden when pawns go down, die or are stripped: the good weapons, the food and the medicine get allowed, the junk stays forbidden. Colonists, slaves and prisoners stay with Blax Castes.
Status: 1.0 and 1.1 (forbid rules) are on the Workshop, 1.1.0 since 2026-11-30. The other areas are designed, no code yet. [features.md](features.md) is the plan of record for scope and order and lists the features new in it. Checked against the RimWorld 1.7.5021 game code on 2026-11-29. RimWorld 1.7, package id `blax.defaults`. It keeps nothing in the save, so it can be added to or removed from a running colony at any time.
Changes on 2026-12-01, planned by area (Fabian: plan the whole mod, chunked by what belongs together, never by time or size):
- [features.md](features.md) is new: the scope of the finished mod, its areas with their steps and status, the order of the areas, what is left out and the open questions. New features there: your own stockpile types, materials no new bill uses, medical care per species, young animals learn what they outgrew, areas every new map starts with, and Build copy carries the source's settings. The last three come from the backlog. New colonies waits for Fabian's call.
- Release numbers after 1.1 and every day count are gone. "At a glance" is a table by area, and "Releases" became "Features by area": the rest of storage sits next to 1.0's storage, recipe defaults and workbench bills next to 1.0's bill values, and mech auto-repair next to mech work modes and areas, which now ship together. Shipped features say which release they shipped in. The older notes below use the release numbers of their day.
- Spec text is unchanged apart from references to unshipped releases, which now name the feature, and the effort marks, which keep S, M and L without days. The 1.0 setup line is gone; the setup is done.
- Backlog: the three promoted items say so. Per-colony override and multiplayer moved to Cut, since both need state in the save; storyteller and world presets joined them.
- "Works with the other Blax mods" gains Blax Laws (designed on its branch `design/act-catalogue`), and "Sibling doc changes" lists the sibling lines that still name Defaults' old release numbers.
- Releases re-cut: values for every new bill ship in 1.0 next to storage, because storage already has working 1.7 mods and the bill values don't. 1.0 covers only storage with a storage blueprint; the build scope, graves, sarcophagi, mortars and other storage move to 1.1. Corpse rules and mech auto-repair move to 1.2.
- Fixed what would have broken features or tests: mortar storage sits on the turret's gun, so the tab and the made hook both resolve it there; "Load the game's default" rebuilds settings from scratch instead of adding categories; a new mech's work mode never repurposes group 1; orbital purchases get their slaughter limits on arrival; recipes a bench can't take are skipped like research.
- Replace Stuff's revival is described as it works: it spawns the new building and copies bills (plain workbenches only), temperatures, the plant and shelf settings. Rebuilt stoves get the bench set, rebuilt bookcases, graves and sarcophagi start from the default, and a revival guard keeps a revived grower's crop.
- Storage defaults gain a rule for items they don't list, so an empty default stays empty when a mod adds items. The quick setup leaves single-purpose storage (chemfuel pumps, weapon racks) unticked.
- The defaults file never rotates a broken file into its backup, keeps every broken copy under its own name, and replaces the file only after a read-back matches.
- Animal rows get a "not set" state that falls through to the every-animal row; young animals skip training they are too small for; born animals copy only what their own species can learn. Doors, lamps, and heaters and coolers get "every" rows. Vents are dropped: they have no target temperature.
- Preset Filtered Zones is not reached and its zones show no Defaults button. The forbid rules are named as the one exception to "only what you make or acquire", and the enemy rule gets an "anywhere" switch.
- DLC support: every feature works with any DLC combination, core only included, and About.xml names no DLC. What needs one switches off cleanly without it: growth vats and the mech rows (Biotech), biosculpter pods (Ideology), and the "slaves only", "mechs only" and "non-mechs only" parts of recipe defaults. The mech rows now show disabled with "Needs Biotech" instead of being hidden. Each release runs the tests in all 8 combinations of Royalty, Ideology and Biotech; Anomaly and Odyssey are guarded in code only.
- Matched with the Castes and Zones docs: the ownership sentence and the Castes section now say that the forbid rules write outside creation and see humanlike pawns' corpses and gear. A saved default for a DLC building shows disabled with "Needs Biotech" (or Ideology) instead of counting as a name from an inactive mod. The Needs column uses the format the three docs share.
- The forbid rules get their own release, 1.1, right after 1.0, and the other releases shift by one: more storage and bills 1.2, animals 1.3, growers and buildings 1.4, mechs 1.5.
- The two plain switches for dropped gear become two rules, your colony and enemies, each a vanilla item filter with the hit points and quality ranges stockpiles have. Going down and dying share one rule, because gear drops once: when the pawn goes down, or when it dies without going down, as raiders downed by violence often do. What doesn't match keeps the game's flag.
- The rules reach apparel: an opt-in strip switch per rule forbids what stripping drops when the filter refuses it. Butchering stays vanilla.
- Everything the rules allow, corpses included, waits until no enemy that can still fight is on the map.
- A downed colonist's main weapon stays forbidden only while the colonist lies where it fell, for it to pick up again, as vanilla does. Once the colonist is rescued, carried off or dies, it has forgotten the weapon, and the rule decides. That also covers a kidnapped colonist's weapon, so its backlog item goes.
- After review: escaping prisoners stay in your colony, like rebelling slaves; a rule without a filter takes its suggested setup when ticked (Fabian's call, 2026-11-30, replacing "can't be turned on before it has a filter"); an animal's corpse follows the animal switch even when the animal was hostile.
- Hooks: scopes on `Pawn.Kill` and `Pawn_HealthTracker.MakeDowned` with a recorder on the `CompForbiddable.Forbidden` setter replace the postfix on `Pawn.DropAndForbidEverything`. That catches stacks a drop merges into and leaves trades, captures and map generation alone.
- Matched with the Castes, Zones and Slaves docs: all four carry the "go down, die or are stripped" sentence and Zones' work rule areas (its 1.6) in their ownership lines, and say "allowed area" for Castes' area slot. The Zones section says how work rule areas and the forbid rules compose, and the release numbers each doc cites of the others follow this re-cut.
| Defaults file and settings page | Shipped in 1.0: one defaults file shared by every save that never resets itself, a settings page that works from the main menu, overlap warnings. Designed: "Add a default" from the main menu and dropping names of removed mods | None | The self-resetting settings of 1trickPwnyta's Defaults (75k, no 1.7) |
| Storage | Shipped in 1.0: new stockpiles, dumping stockpiles, shelves, bookcases, hoppers, fridges and weapon racks start with the filter and priority you saved, set from a "Defaults" button in the storage tab; one click makes new shelves start empty. Designed: graves, sarcophagi, mortars, growth vats, biosculpter pods and modded storage too. New: your own stockpile types in the Zone menu | None (growth vats: Biotech, biosculpter pods: Ideology) | [FSF] No Default Shelf Storage (93k), the storage half of 1trickPwnyta's Defaults (75k, no 1.7) and of Set my Defaults (116); new stockpile types partly cover Preset Filtered Zones (16k) and Simple Stockpile Presets (16k) |
| Bills | Shipped in 1.0: values for every new bill (radius, drop on floor, repeat mode and more). Designed: defaults per recipe saved from the bill window, the bills a new workbench comes with. New: materials no new bill uses | None ("slaves only": Ideology, "mechs only" and "non-mechs only": Biotech) | Better Workbench Management's default store mode (452k, no 1.7), Default Ingredient Radius (11.6k), the bill values and per-recipe and per-workbench bills of 1trickPwnyta's Defaults and Set my Defaults, Auto Bill Restore (1.1k, no 1.7) |
| Forbid rules | Shipped in 1.1: what the game forbids when one of your colony's or an enemy's pawns goes down or dies is allowed when it matches a filter with hit points and quality ranges, once the fight is over. Stripping can forbid what doesn't match. Corpses outside the home area can stay allowed | None (slaves: Ideology, colony mechs: Biotech) | KilledEnemyAutoAllowed (Continued) (5.2k), Allow Dead Animals (67k, no 1.7), Allow Everything (3.8k, no 1.7) for drops, partly Auto Strip on Haul's tainted forbid (18k) |
| Animals | Designed: area, follow flags and training per species when an animal joins; born animals copy their mother; auto-slaughter limits for a species you own for the first time and for new maps. New: medical care per species, young animals learn what they outgrew | None | Animal Controls' join defaults (57k, no 1.7), Auto Training (1.2k), the newborn copy of Assign Animal Food (25k, no 1.7) |
| Mechs | Designed: auto-repair, the work mode of the control group a new mech joins and its area, per mech kind, and a Defaults gizmo on mechs | Biotech | Auto-repair On (61k, no 1.7), the mech work modes of 1trickPwnyta's Defaults |
| New maps | New: named areas every new map starts with (no spec yet) | None | The default areas of 1trickPwnyta's Defaults |
| Growing | Designed: crops for new growing zones and hydroponics basins | None | Default Plant Selector (7), the crop defaults of 1trickPwnyta's Defaults |
| Buildings | Designed: settings for new doors, tables, traps, heaters, coolers and lamps, per building or for every door, lamp, heater or cooler. New: Build copy carries the source's settings | None | No Default Gather Spot (8.4k, no 1.7), Default White Lights (656), Always Auto-Rearm (67) |
| New colonies | Idea, waits for Fabian's call (features.md, "Open questions"): play settings and the medical defaults for animals and other factions' pawns at game start | None | The play settings of 1trickPwnyta's Defaults |
Workshop numbers are current subscribers from the Steam Web API (GetPublishedFileDetails), read on 2026-11-29 and, for the rows new on 2026-12-01, that day; "no 1.7" means the item has no 1.7 tag. Needs: "None" means the area runs on the core game, and a DLC in brackets marks the parts that switch off without it (see "DLC support"). A DLC alone, as for mechs, means the whole area switches off without it. The order of the areas is in [features.md](features.md). Each spec's effort mark (S, M or L) says how big the feature is; it decides nothing about what ships together.
- Nothing changes until you save a default. Every kind starts at "the game's default" and every rule ships off, so installing the mod alone changes nothing.
- One default per kind: per stockpile type, per building, per recipe, per workbench, per species, per mech kind. Animals and mechs also have an "every animal" and "every mech" row, and doors, lamps, and heaters and coolers an "every door", "every lamp" and "every heater or cooler" row, each used field by field where the kind's own row sets nothing. No "all storage" row: emptying every storage building at once breaks hoppers and pipe taps, a recurring complaint about [FSF] No Default Shelf Storage (comments 2023-07-08 and 2025-08-16). The quick setup covers the bulk case with a checkbox per kind.
- A default applies once, when the thing is created: designated, built, tamed, bought, born, gestated. Changing or forgetting a default never touches an existing stockpile, shelf, bill or animal. "Load your default" on one thing is the explicit way to update it.
- Only what you make or acquire. Ruins, map generation, trader stock and reinstalled minified buildings keep the game's settings. Benches in abandoned outposts never get your bills; a cook walking to one was a complaint about 1trickPwnyta's Defaults (2025-12-07).
- The one exception is the forbid rules (1.1). They act on gear and corpses you neither made nor acquired, and they live on the settings page, not behind a "Make default". All of them ship off.
- Forbid rules come in two groups: your colony (colonists, slaves, colony mechs, colony animals and prisoners, a rebelling slave or an escaping prisoner included) and enemies (anyone else hostile to you when they go down or die). Neutral visitors, traders and quest lodgers keep the game's rules: a downed visitor that gets up where it fell picks its weapon up again, and a trader's wares sit in its inventory.
- Each group's rule is one vanilla item filter with the hit points and quality ranges stockpiles have. What matches is allowed; what doesn't keeps the game's flag. A rule never forbids a dropped thing the game left allowed; only the opt-in strip switch forbids.
- Going down and dying share one rule: gear drops once, either when the pawn goes down or when it dies without going down. Raiders downed by violence often die on the spot instead (80% at population intent 0), so one rule covers both.
- "Where" defaults to anywhere. Inside the home area the game already leaves dropped food and medicine allowed and forbids only weapons and an enemy's loot, so a home-area rule would not reach the food left forbidden outdoors.
- Everything a rule allows waits until no enemy that can still fight is on the map, so no rule sends a hauler into a fight. No switch for it.
- A downed colonist's main weapon stays forbidden only while the colonist lies where it fell, for it to pick up after getting up, as vanilla does. Once the colonist is rescued, carried off or dies, it has forgotten the weapon, and the rule decides.
- Ticking a rule that has no filter yet saves its suggested setup first and turns the rule on in one click (decided 2026-11-30); Edit changes it from there. Forgetting the filter turns the rule off.
- Suggested setups, applied only when you press the button: enemies get every item, but hit points 50 to 100% and Normal or better, anywhere, stripping on, so a Poor rifle or one below 50% stays forbidden while food, medicine, drugs and silver are allowed. Your colony gets every item, full ranges, anywhere, stripping off.
- Butchering strips corpses too but stays vanilla under the strip switch: what a butcher strips lands next to the bench, where a burn bill or a dumping stockpile takes it.
- Defaults are global, shared by every save, in their own file in the game's Config folder. Not in mod settings: a mod settings file that fails to load is replaced by fresh settings on the next write, which is how Defaults' users lost theirs. No per-colony layer yet.
- A storage default stores every item it allows and every item it refuses, plus a rule for items it doesn't list, such as those a mod adds later: follow the game's default for that kind (what "Make default" saves), refuse them or allow them. The quick setup saves "refuse", so an empty shelf stays empty when you add a mod. Items from a mod you removed stay in the file, are skipped, and work again when the mod comes back.
- Surgery bills and pasted bills are never touched. Pawn restrictions, a specific target stockpile, custom names, styles and xenogerms belong to one save and are left out of a bill default; "take to stockpile X" becomes "best stockpile".
- Born animals copy their mother's training wishes and follow flags and keep the mother's area, as vanilla already does for the area. The species default applies to tamed, bought, wanderer, quest and starting animals.
- Colonists, slaves and prisoners belong to Blax Castes. Defaults never writes to a humanlike pawn, with or without Castes.
- Values for every new bill ship in 1.0 next to storage; recipe defaults and workbench bill sets follow in the bills area. Storage already has working 1.7 mods ([FSF] No Default Shelf Storage, [KV] Save Storage, Adaptive Storage - Global Settings), while the default store mode of Better Workbench Management (452k) has no 1.7 build and is asked for on Defaults' page (2026-02-16). Bills also come up more often than storage in the comments on both builds of 1trickPwnyta's Defaults: 36 comments mention bills or workbenches, 24 shelves, storage or stockpiles (about 650 comments, read 2026-11-29).
- Name: Blax Defaults, always with the subtitle "Starting settings for storage, bills, crops, buildings, animals and mechs". The Workshop description's first line is "Colonists, slaves and prisoners: Blax Castes."
- Any DLC combination works, core only included. A feature that needs a DLC shows disabled on the settings page with "Needs Biotech" (or Ideology), and everything else keeps working.
- Not supported: multiplayer (the file differs per client), Anomaly corpse stockpiles, Odyssey fishing zones and gravship starts (neither DLC is installed here to test).
Three parts carry everything. The library and the designation and blueprint hooks shipped in 1.0; the build scope arrives with graves, mortars and other storage, and the join funnel with the animal defaults; later features only add kinds and hooks. The forbid rules of 1.1 keep their filters in the library and use their own unsaved scopes. Game code references are to the decompiled 1.7.5021 assembly (namespace folder, file, line); XML references are to the game's `Data` folder.
-`DefaultsLibrary` (static) holds one entry per kind, keyed by a string: `stockpile:Stockpile`, `stockpile:Dumping`, `stockpile:<designator type name>`, `storage:<ThingDef>` and `bill:*` since 1.0; `forbid:colony` and `forbid:enemies` (the forbid rules' filters) since 1.1; `bill:<RecipeDef>` and `bench:<ThingDef>` with the bills area; `animal:*`, `animal:<race ThingDef>` and `slaughter:<race ThingDef>` with animals; `mech:*` and `mech:<race ThingDef>` (auto-repair, work mode and area) with mechs; `grower:Zone_Growing` and `grower:<ThingDef>` with growing; `building:<ThingDef>`, `building:*door`, `building:*lamp` and `building:*temperature` with buildings.
- File: `Config/BlaxDefaults/Defaults.xml` under the game's save data folder (`GenFilePaths.ConfigFolderPath`, Verse/GenFilePaths.cs:178).
- Writing, in this order:
1.`Scribe.saver.InitSaving` on `Defaults.xml.tmp`, the library inside a try. On an exception: `Scribe.saver.ForceStop()` (Verse/ScribeSaver.cs:213), delete the `.tmp`, one error in the log, both files untouched.
2. Read the `.tmp` back with the loader and compare it with the library in memory. `Scribe_Deep.Look` catches an exception from a nested `ExposeData` and only logs it (Verse/Scribe_Deep.cs:61-63), so a throwing entry would otherwise leave a well-formed file without it. 1trickPwnyta's Defaults' author puts its resets down to an exception while saving (reply 2025-12-07). On a mismatch: delete the `.tmp`, one error, both files untouched.
3. Only then `File.Replace(tmp, file, file + ".bak")`, or `File.Move(tmp, file)` when there is no main file. A crash at any step leaves the old file.
- Why not ModSettings: `LoadedModManager.ReadModSettings` catches any exception, logs a warning and returns fresh settings (Verse/LoadedModManager.cs:553-561), and the next `WriteModSettings` overwrites the old file, flushing whatever its `finally` has (:566-576). Mod settings (`BlaxDefaultsSettings`) keep only the toggles and the dismissed overlap warnings.
- Strings only: defNames, enum names, numbers. Nothing uses `Scribe_Defs`, and no `ThingFilter` is deep-saved (its `ExposeData` resolves `allowedDefs` as defs, Verse/ThingFilter.cs:290-299). Loading can never throw over a missing def. The file is read in the `[StaticConstructorOnStartup]` class, after defs exist.
- Names resolve at apply time with `DefDatabase<T>.GetNamedSilentFail`. A name that doesn't resolve is skipped and stays in the file. The settings page shows "N names from mods that are not active" per entry; a "Drop them" button comes with "Add a default and drop inactive names".
- Loading: main file, then `.bak`. A file that fails to load is renamed at once to a name of its own, `Defaults.broken-<yyyyMMdd-HHmmss>.xml` for the main file and `Defaults.bak.broken-<yyyyMMdd-HHmmss>.xml` for the backup, with "-2", "-3" appended if that name exists. The main file is renamed even when the `.bak` loads, so the next write can't rotate the broken file into `.bak` over the only good copy: with no main file, that write is a `File.Move` and the `.bak` stays. If both fail: an empty library, one warning in the log and a red line on the settings page naming the broken copies. Renaming is the only file operation at load; nothing is written until the player saves or forgets a default.
- A format version in the root node. Changes are additive only.
- StorageTemplate: `priority` (enum name), `allowed` and `refused` (ThingDef names), `unlisted` (`Game`, `Refuse` or `Allow`), `allowedSpecial` and `refusedSpecial` (SpecialThingFilterDef names), the hit points range and the quality range. "Make default" fills `allowed` and `refused` from every def that is `EverStorable(willMinifyIfPossible: true)` (Verse/ThingDef.cs:1394) and passes the kind's parent filter, and saves `unlisted = Game`. Applying starts from the game's default for the kind (on a new thing, what vanilla just set), writes the priority through the `Priority` setter, calls `filter.SetAllow` per resolved def, then handles every storable def the parent allows that is in neither list: `Game` leaves it, `Refuse` and `Allow` set it. The edit window shows the rule as a dropdown under the filter. The forbid rules (1.1) reuse the template as a filter: the priority is unused, and `unlisted` is `Refuse` (stays forbidden) or `Allow`.
Every write happens at one creation hook, apart from the forbid rules (1.1), which write the forbidden flag when a pawn goes down, dies or is stripped (`Pawn_HealthTracker.MakeDowned`, `Pawn.Kill`, `Pawn.Strip`). All of them go through vanilla setters onto vanilla fields. Nothing marks a thing as handled, so nothing needs saving.
- Build scope (arrives with graves, mortars and other storage): a prefix on `Frame.CompleteConstruction(Pawn)` (RimWorld/Frame.cs:262) opens a `[ThreadStatic]` scope when the frame's type is exactly `Frame` and its faction is the player's. It records the frame's map, cell, `entityDefToBuild` and `glowerColorOverride` (:17), because the frame destroys itself inside the method (:280). A Harmony finalizer closes the scope, even on an exception.
- Made hook: a postfix on `ThingMaker.MakeThing(ThingDef, ThingDef)` (Verse/ThingMaker.cs:8) while the scope is open and the def is the frame's. It records the new thing and applies the defaults that must be in place before spawn (storage parents without a storage blueprint, temperature targets, door hold-open, gather spot). The postfix runs after the thing's own `PostMake`, so a turret's gun already exists (RimWorld/Building_TurretGun.cs:164-169). Nested `MakeThing` calls inside it, such as `MakeGun` making the gun (:684-688), have another def and are skipped. For every other `MakeThing` call the cost is one static field read.
- Built hook: a postfix on `Frame.CompleteConstruction` applies the defaults that spawn code would overwrite (bills, crops, trap rearm, lamp colour) to the recorded thing, only if that thing is spawned.
- Replace Stuff (3526354009, 539,443, 1.7) revives a destroyed building by spawning the new building and then copying a few settings from the destroyed one it kept: its `Source/DestroyedRestore/ReviveBuilding.cs` wraps this method's `GenSpawn.Spawn` call and calls `DestroyedBuildings.ReviveBuilding` right after it. Its handlers are keyed by exact class (`BuildingReviver.cs`, `CanDo` uses `thing.GetType()`): bills for `Building_WorkTable`, the target temperature for `Building_Heater` and `Building_Cooler`, the plant for `Building_PlantGrower` and the settings for `Building_Storage`. `DestroyedBuildings.SaveBuilding` keeps no other building. The same names are in its 1.7 `Replace_Stuff.dll`. So the built hook runs on every revived building, and everything revival doesn't copy gets the default, as on any rebuild. Temperatures set by the made hook are overwritten by revival afterwards, so the old value wins.
- Revival guard: the scope's prefix reads Replace Stuff's `DestroyedBuildings` map component by reflection (`AccessTools.TypeByName("Replace_Stuff.DestroyedRestore.DestroyedBuildings")`, field `destroyedBuildings`, a dictionary keyed by cell) and notes whether it holds a building at the frame's position. Revival removes the entry later in the same call. When the prefix saw one, the built hook adds no bills and sets no crop, since revival restores those. Without Replace Stuff the guard is a null check.
- Exact `Frame` only: Replace Stuff's stuff replacement uses `ReplaceFrame : Frame` and completes through its own method (its `Source/Replace/ReplaceFrame.cs`, a prefix on `Frame.CompleteConstruction` that skips the vanilla body for it). That building keeps its settings.
- Not covered, on purpose: god-mode instant builds, map generation, minified reinstalls, gravship landings.
- Join funnel (arrives with the animal defaults; mechs reuse it): animals and colony mechs entering the player faction. Collected in postfixes on `Pawn.SetFaction(Faction, Pawn)` (Verse/Pawn.cs:2702, a prefix snapshots the old faction) and `PawnGenerator.GeneratePawn(PawnGenerationRequest)` (Verse/PawnGenerator.cs:139). Applied when the outermost known caller returns: prefix and finalizer scopes on `Hediff_Pregnant.DoBirthSpawn`, `CompHatcher.Hatch`, `RecruitUtility.Recruit`, `Pawn.PreTraded` and `Bill_ProductionMech.CreateProducts` push and pop a depth counter, and the outermost finalizer applies the collected pawns. That way the defaults land after each caller's own writes. Outside any scope they apply at the end of the collecting postfix. Humanlike pawns never enter: `RaceProps.Animal` or `IsColonyMech` is the first check.
- Unsaved transient state only: the scope fields, the collected pawn list, the new growing zones of one drag, and for pawns that join without a map a `ConditionalWeakTable<Pawn, PendingJoin>` applied when they first spawn. A pawn bought into a caravan has no map, and neither has one bought from an orbital trader: `TradeShip.GiveSoldThingToPlayer` splits it off the ship, calls `PreTraded` and only then drops it in a pod (RimWorld/TradeShip.cs:199-208). `PendingJoin` carries the area label and the auto-slaughter first-animal check. The forbid rules (1.1) add their scope stack with the things recorded in it, the butchering flag and the wait list; a save and reload starts with all of them empty.
- No GameComponent, MapComponent, WorldComponent, ThingComp, def or field of ours ever enters a save. The only data Defaults writes are vanilla fields at creation, apart from the forbid rules (1.1), which write the vanilla forbidden flag when a pawn goes down, dies or is stripped. Vanilla saves all of them.
- Loading a save runs no Defaults code. Every spawn hook skips `respawningAfterLoad`, and loading never calls a designator, `MakeThing` for a saved thing, `MakeNewBill`, `Frame.CompleteConstruction`, `Pawn.Kill`, `MakeDowned` or `Pawn.Strip`.
- Multiplayer: the file differs per client and the hooks fire inside synced commands, so it would desync. The Workshop page says "Multiplayer: not supported yet", as Castes does.
## DLC support
Every Blax mod works with any DLC combination, core only included (rule of 2026-11-29). For Defaults:
- About.xml lists no DLC as a dependency.
- A feature that needs a DLC switches off cleanly without it: its section or row on the settings page shows disabled with "Needs Biotech" (or the DLC it needs), its hooks do nothing, and everything else keeps working. No feature needs Royalty.
- DLC defs only through `MayRequire`: a DefOf field for DLC content carries `[MayRequireBiotech]` (or its DLC's attribute), and XML that names one carries `MayRequire="Ludeon.RimWorld.Biotech"`. So far none is needed: the DLC kinds below are reached through their class or storage parent, and saved names resolve with `GetNamedSilentFail`.
- DLC code behind `ModsConfig.<DLC>Active`, checked before a hook touches DLC content. The patch on `Bill_ProductionMech.CreateProducts` (mechs) is applied in every combination: the class is in the game's own assembly and never runs without Biotech.
- The forbid rules (1.1) need no DLC. Slaves (Ideology) and colony mechs (Biotech) belong to your colony through `Faction == Faction.OfPlayer` when their DLC is loaded, with no DLC call. Every mechanoid kind destroys its weapon instead of dropping it in any DLC set (`destroyGearOnDrop` on Core's `BaseMechanoidKind`, `Races_Mechanoid.xml:59`). The special filters for tainted and biocoded things are Core defs (Core `Misc/SpecialThingFilterDefs/SpecialThingFilters.xml:149-203`). The chips superheavy mechs leave exist only with Biotech and reach the enemy rule like any other drop.
- The defaults file is shared by every DLC set. A saved default for a DLC kind that isn't loaded, such as a growth vat default without Biotech, stays in the file and shows on the settings page as a disabled row with "Needs Biotech" (or its DLC). A DLC name inside an entry, such as Wastepack in a stockpile filter, baby food in a bench set or toxipotato in a crop list, is skipped and counts with the names from inactive mods. Both work again when the DLC is back. The DLC of a kind that isn't loaded comes from the `[MayRequire<DLC>]` attribute of the vanilla DefOf field with its name (`ThingDefOf.GrowthVat` is `[MayRequireBiotech]`, ThingDefOf.cs:976-977; `ThingDefOf.BiosculpterPod` is `[MayRequireIdeology]`, :917-918), the way Castes' `DlcSupport` reads it. A kind with no such field, from a removed mod, counts as an inactive name.
- A save made with a DLC loads without it. Defaults keeps nothing in the save (see "Save safety"); the vanilla fields it wrote are the game's to load.
- Anomaly and Odyssey are not installed here, so they are guarded in code only. Defaults names none of their defs. Their content meets checks that are false without them: `RaceProps.Animal` excludes Anomaly entities (`IsAnomalyEntity` checks `ModsConfig.AnomalyActive`, Verse/RaceProperties.cs:265-275, :342), `Pawn.IsMutant` (Verse/Pawn.cs:662) skips mutants, and Odyssey's six trainables (`AttackTarget` to `SludgeSpew`, all `[MayRequireOdyssey]`, RimWorld/TrainableDefOf.cs:12-28) show in the species rows only when Odyssey loads them. The Harbinger tree's corpse stockpile, gravship stockpiles and grow zones, and fishing zones are not reached.
-`run-tests.ps1 -NoDlc` runs the suite on the core game; `-Dlc Royalty,Biotech` loads only the named installed DLCs. A test that needs a DLC logs "skipped: needs Biotech" (or its DLC) without failing. Each feature that touches DLC content names its DLC-off test.
- A release runs all 8 combinations of Royalty, Ideology and Biotech: -NoDlc, each alone, each pair and all three, each with phase 1 and phase 2. All must pass.
- Anomaly and Odyssey get no run here; their guards are checked by reading the code.
- Phase 2's check that the .rws holds no "BlaxDefaults" covers "a save made with a DLC loads without it", so there is no cross-DLC load test.
| Values for every new bill | Bills, shipped 1.0 | None | Works. Mech gestation bills don't exist |
| Gear rules for your colony and enemies | Forbid rules, shipped 1.1 | None | Works. Slaves (Ideology) and colony mechs (Biotech) don't exist; mechs drop no weapon in any set |
| Waiting until the fight is over | Forbid rules, shipped 1.1 | None | Works |
| Strip switch | Forbid rules, shipped 1.1 | None | Works. The tainted and biocoded filters are Core |
| Corpse rules | Forbid rules, shipped 1.1 | None | Works |
| Graves, sarcophagi, mortars and modded storage | Storage | None | Works |
| Growth vats | Storage | Biotech | Not offered in the tab, the quick setup or "Add a default"; a saved default stays in the file and shows disabled with "Needs Biotech" |
| Biosculpter pods | Storage | Ideology | Not offered in the tab, the quick setup or "Add a default"; a saved default stays in the file and shows disabled with "Needs Ideology" |
| Add a default and drop inactive names | Defaults file | None | Works |
| Defaults per recipe | Bills | None | Works |
| "Slaves only" in a recipe default | Bills | Ideology | Skipped when a bill is made; kept in the file, and the default's summary marks it "Needs Ideology" |
| "Mechs only" and "non-mechs only" in a recipe default | Bills | Biotech | Skipped when a bill is made; kept in the file, and the default's summary marks it "Needs Biotech" |
| Bills for new workbenches | Bills | None | Works. A set entry for a DLC recipe, such as baby food (Biotech), is skipped and counted |
| Species defaults, born animals, Training tab | Animals | None | Works. Dryads (Ideology) don't exist |
| Auto-slaughter limits | Animals | None | Works |
| Auto-repair for new mechs | Mechs | Biotech | Mech section disabled with "Needs Biotech"; saved rows stay |
| Crops for growing zones and plant growers | Growing | None | Works. A DLC crop in the list, such as toxipotato (Biotech), is skipped and the next one tried |
| Building settings | Buildings | None | Works |
| Mech work modes, areas and gizmo | Mechs | Biotech | Disabled with "Needs Biotech", no gizmo; saved rows stay |
- Core: graves and sarcophagi (`Buildings_Misc.xml:771`, `:877`), the mortar (`Buildings_Security_Turrets.xml:532`, `:587`), shelves, bookcases (`Buildings_Furniture.xml:1697`, `:1733`), the hopper (`Buildings_Production.xml:1788`), the hydroponics basin and plant pot, the three lamps with a colour picker (`Buildings_Furniture.xml:1362`, `:1472`, `:1521`), the heater and cooler (`Buildings_Temperature.xml`), the five trainables (`Trainables.xml`), the husky, the chicken and the Scyther. For the forbid rules: the special filters for biocoded and tainted things (`Misc/SpecialThingFilterDefs/SpecialThingFilters.xml:149`, `:167`, `:185`, `:195`; core mercenaries already carry biocoded weapons, `PawnKindDefs_Humanlikes/PawnKinds_Mercenary.xml:14`), `destroyGearOnDrop` on `BaseMechanoidKind` (`ThingDefs_Races/Races_Mechanoid.xml:59`) and the humanlike weapon pickup (`ThinkTreeDefs/Humanlike.xml:297-300`).
- Biotech: the growth vat (`Biotech/Defs/ThingDefs_Buildings/Buildings_Misc.xml:331`; `ThingDefOf.GrowthVat`, `[MayRequireBiotech]`, RimWorld/ThingDefOf.cs:977), wastepack (`Items_Resource_Manufactured.xml`; added to the stockpile presets only with Biotech, Verse/ThingFilter.cs:791, :800), toxipotato (`Plants_Cultivated_Farm.xml:5`; `[MayRequireBiotech]`, ThingDefOf.cs:1249), pollution (`PollutionGrid.IsPolluted` is false without Biotech, Verse/PollutionGrid.cs:62), baby food (`RecipeDefs/Recipes_Food.xml:5`, on both stoves through `MayRequire`, Core `Buildings_Production.xml:731-732`, `:824-825`), the militor (`Races_Mechanoids_Light.xml`), the mech gestator, the mechlink (`Hediffs_Mechanitor.xml`), auto-repair (`CompProperties_MechRepairable` on Core's `BaseMechanoid` with `MayRequire`, Core `Races_Mechanoid.xml:52`), and the chips hostile superheavy mechs leave (`killedLeavingsPlayerHostile`, `Races_Mechanoids_SuperHeavy.xml:93-95`; RimWorld/GenLeaving.cs:78-80). `Pawn.IsColonyMech` checks `ModsConfig.BiotechActive` first (Verse/Pawn.cs:798), and the bill menu offers the mech restrictions only with Biotech (RimWorld/Dialog_BillConfig.cs:561).
- Ideology: the biosculpter pod (`Buildings_Ideo.xml:410`; `ThingDefOf.BiosculpterPod`, `[MayRequireIdeology]`, ThingDefOf.cs:918), dryads (`animalType` Dryad, `Races_Animal_Special.xml:92`; `RaceProps.Dryad`, Verse/RaceProperties.cs:279), nutrifungus (`Plants_Special.xml:5`), the bill menu's "slaves only" (Dialog_BillConfig.cs:550) and slaves themselves (`Pawn.IsSlaveOfColony`, Verse/Pawn.cs:648).
Specs grouped by area, in the order of [features.md](features.md), which is the plan of record for scope and order. Shipped features say which release they shipped in. The areas New maps and New colonies, and the features new in that plan, have no spec here yet.
- **Players get:** Mod settings > Blax Defaults lists every saved default by section (Stockpiles, Storage buildings and Every new bill; later Forbid rules, Recipes, Workbenches, Animals, Growers and buildings, Mechs). Each row says what it sets ("Shelf: Normal, allows 14 of 1,903 items, refuses unlisted items") and has Edit and Forget; Forget asks first. Edit opens the vanilla item filter with a priority dropdown and the rule for unlisted items. It all works from the main menu. A status line shows the entry count and any names from inactive mods. Since 1.0 a default is made from the storage tab or the quick setup; "Add a default" and "Drop them" are the feature "Add a default and drop inactive names".
- **How:** The library, file handling and templates from the data model. The window is `Mod.DoSettingsWindowContents`, one section per category, each with its master toggle. The storage edit window draws `ThingFilterUI.DoThingFilterConfigWindow` on a scratch `ThingFilter` built from the template. Its parent filter is the building's `fixedStorageSettings` (RimWorld/BuildingProperties.cs:287), else `StorageSettings.EverStorableFixedSettings()` (RimWorld/StorageSettings.cs:136-146). It needs defs only, not a running game.
- A section or saved default whose DLC is off is drawn disabled with "Needs Biotech" (or the DLC it needs) and stays in the file: the mech section, a growth vat or biosculpter pod default, the restriction in a recipe default's summary. DLC names inside an entry count with the names from inactive mods (see "DLC support").
- **Settings:** `enabled` (on; off applies nothing and keeps the file), `stockpileDefaults` (on), `storageDefaults` (on).
- **Save and removal:** nothing in the save. The file is a config file.
- **Overlaps:** none.
- **Replaces:** the failure players report most about 1trickPwnyta's Defaults (3285178686, 75,492, no 1.7): settings that reset themselves (comments 2025-12-07, 2026-01-27, 2026-06-30) and presets naming removed mods that need a full reset (2024-10-01).
- **Tests:** Every run starts with an empty library: run-tests.ps1 deletes `Config/BlaxDefaults` in its own save data folder, so the player's file is never touched.
- A template allowing Steel and the made-up name "BlaxTest_Missing" is written and read back: Steel resolves, the missing name is kept and counted, and applying the template logs nothing.
- -NoDlc: a stockpile template saved with Biotech (Steel allowed, Wastepack refused) loads, keeps Wastepack in the file, counts it as one inactive name and applies Steel without a log line.
- Every write leaves the previous content in `.bak`.
- Main file truncated, `.bak` good: the library loads from `.bak` with one warning, and the main file now exists only as `Defaults.broken-<timestamp>.xml` with the original bytes. A default saved afterwards creates a new main file and leaves `.bak` byte-identical.
- Both truncated: an empty library, two broken copies with the original bytes, nothing written until a default is saved. Doing it twice in one run gives four broken copies with distinct names and no exception.
- A test-only template whose `ExposeData` throws is added and a save is triggered: `Defaults.xml` and `.bak` are byte-identical to before, no `.tmp` remains, and one error is logged.
- Phase 2: the .rws contains no "BlaxDefaults" outside the meta block's mod list.
- **Risks:** a player who edits the XML by hand and breaks it gets the broken-file path, with the file kept.
- **Players get:** The settings page names each active mod that sets the same defaults, and what it sets. On the first game loaded in a session, one message lists those not yet dismissed, with "Don't remind me" per mod.
- **How:** Detection only, through a Compat helper (`ModLister.GetActiveModWithIdentifier(id, ignorePostfix: true)`), so a local copy next to a Workshop copy still matches. No patches against those mods. Dismissed ids live in mod settings, not the save. Each area adds the mods of its own category. 1.0 detects 1trickPwnyta's Defaults (`defaults.1trickPwnyta`, read from its About.xml; the Experimental build 3522445452, 2,517, no 1.7, keeps the same id), the unofficial Defaults 1.7 repack (3836680679, 145, 1.7), Set my Defaults, [FSF] No Default Shelf Storage, [FSF] FrozenSnowFox Tweaks and Default Normal Empty Storage for storage, and Better Workbench Management, Default Ingredient Radius, Default Bill Ingredient Radius and Default Until X for the bill values. Package ids other than Defaults' are read from each mod's About.xml before shipping, as Castes did.
- **Settings:** `warnOverlaps` (on).
- **Save and removal:** nothing in the save.
- **Overlaps:** this feature is the overlap handling.
- **Replaces:** nothing.
- **Effort:** S.
- **Tests:** An id injected into the detection list shows in the settings text and in the message, once per session. A dismissed id doesn't.
- **Risks:** a wrong package id misses silently.
#### Add a default and drop inactive names
Designed, no code yet.
- **Players get:** On the settings page, "Add a default" picks a stockpile type or a storage building and opens the edit window on the game's default, so a default can be made from the main menu. Each entry with names from inactive mods gets "Drop them", which asks first.
- **How:** The picker lists the stockpile types and every def with a storage tab that Defaults covers, the same list as the quick setup. "Drop them" removes the unresolved names from that entry and writes the file.
- **Settings:** covered by `storageDefaults`.
- **Save and removal:** nothing in the save.
- **Overlaps:** none.
- **Replaces:** nothing beyond the library.
- **Effort:** S.
- **Tests:** "Add a default" for Shelf creates a template equal to the shelf's def default. "Drop them" on the entry with "BlaxTest_Missing" removes that name, keeps Steel, and the counter shows 0.
- **Players get:** A "Defaults" button at the top right of the storage tab of stockpiles and of every storage building Defaults covers: since 1.0 shelves, small shelves, bookcases, hoppers, fridges and weapon racks; with "Graves, mortars and other storage" also graves, sarcophagi, mortars, growth vats, biosculpter pods and other storage. Its menu has "Make default for new shelves" (always naming the kind), "Load your default", "Load the game's default" and "Forget the default for new shelves", which asks first. The tooltip says whether new shelves start from your default. On a stockpile each entry opens a submenu of stockpile types, and the tooltip lists every type that has a default.
- **How:** A postfix on `ITab_Storage.FillTab` (RimWorld/ITab_Storage.cs:104). The tab is 300 by 480, contracted by 10 (`:13`, `:108`), and the priority button takes 160 px of the 35 px top row (`:113`), so ours sits at (180, 10, 110, 29) in tab coordinates. When `IsPrioritySettingVisible` is false (`:87`) the top row is 20 px (`:89`), and the button becomes a 20 px icon at (270, 10). The subclasses `ITab_Shells` and `ITab_BiosculpterNutritionStorage` don't override `FillTab`, so they get it too.
- Kind: from the protected `SelStoreSettingsParent` (`:15`, read through an AccessTools delegate). A `Zone_Stockpile` doesn't remember which designator made it: its constructor uses the preset only for the label and `SetFromPreset`, and `ExposeData` saves only the settings (RimWorld/Zone_Stockpile.cs:37-48). So on a stockpile all four entries open the same submenu: "stockpile", "dumping stockpile", and one entry per modded stockpile designator. A thing, or a comp of one, gives its def; a `Blueprint_Storage` gives its `BuildDef` and a `Frame` its `entityDefToBuild`. A `StorageGroup` of linked shelves (`:28-52`) gives its first member's def, and Load writes the group's settings.
- Turrets: `ITab_Shells` falls back to the turret's gun when the selected `Building_TurretGun` has no storage itself (RimWorld/ITab_Shells.cs:5-19), and the gun's `CompChangeableProjectile` reads the gun def's `building.defaultStorageSettings` (RimWorld/CompChangeableProjectile.cs:51-58; Core `Buildings_Security_Turrets.xml:618-640` puts both on `Artillery_Mortar`). When the selected object is a `Building_TurretGun`, the kind is the turret's def (`Turret_Mortar`), the settings are the gun comp's, and the game's default is the gun def's. The made hook of "Graves, mortars and other storage" uses the same key.
- No button: any parent that is none of the above, such as the `Zone_PresetStockpile` of Preset Filtered Zones (see "New stockpiles start from your default"). Until "Graves, mortars and other storage" ships, also any thing whose def has no storage blueprint, since nothing would apply its default yet.
- Load your default first loads the game's default for the kind, then applies the template, so it gives the same settings as a new one. The `Priority` setter notifies haul destinations and haulables while playing (RimWorld/StorageSettings.cs:23-56).
- The game's default is built on a scratch `new StorageSettings()` and written with `StorageSettings.CopyFrom` (:90-95), whose `ThingFilter.CopyAllowancesFrom` replaces the allowed defs, special filters and ranges (Verse/ThingFilter.cs:634-665). For stockpiles the scratch gets `SetFromPreset` with the type's preset and Priority Normal, as the vanilla constructor does (RimWorld/Zone_Stockpile.cs:37-43). `SetFromPreset` alone only adds categories (Verse/ThingFilter.cs:779-800), so on an existing stockpile it would keep everything already allowed. For buildings the scratch copies `def.building.defaultStorageSettings` (RimWorld/BuildingProperties.cs:289), or keeps the empty filter at the priority a fresh `StorageSettings(parent)` takes when the def has none, as `PostMake` leaves it. Defaults never edits that field, so it always holds the loaded value.
- **Settings:** covered by `enabled`.
- **Save and removal:** writes only the selected thing's own storage settings.
- **Overlaps:** Blax Zones' planned deliveries into stockpiles and shelves add "Receive deliveries" and sell gizmos to the same stockpiles and shelves; a button inside the tab keeps the gizmo bar short. Adaptive Storage - Global Settings (3530785055, 61,986, 1.7) applies filters to many buildings on demand; the last click wins.
- **Replaces:** for one preset per kind, the manual save and load of [KV] Save Storage, Outfit, Crafting, Drug and Operation Settings (3222246658, 109,174, 1.7) and Simple Stockpile Presets (Continued) (2189006791, 16,278, 1.7).
- **Tests:** The menu builder `StorageDefaultsMenu.OptionsFor(parent)` runs on a stockpile, a dumping stockpile, a shelf, a shelf blueprint and two linked shelves.
- Labels name the kind; on a stockpile, Make default, Load, Load the game's default and Forget each offer the type submenu.
- Make default stores a template equal to the current settings. Load writes it back after a change.
- The game's default restores Preferred and the shelf categories on a shelf.
- A stockpile narrowed to Steel with a hit points range of 50 to 100%: Load the game's default > stockpile gives settings equal to a new vanilla stockpile's: the DefaultStockpile categories and no Steel-only narrowing, the special filters and full ranges of a fresh filter, and Normal. Load the game's default > dumping gives only Corpses and Chunks at Normal, plus Wastepack only when Biotech is active (`SetFromPreset`, Verse/ThingFilter.cs:800), which the -NoDlc run checks.
- With stockpile and dumping defaults saved, Forget > dumping removes only the dumping entry, and the tooltip lists both types before and one after.
- A test-only `Zone` subclass implementing `ISlotGroupParent`, like Preset Filtered Zones' zone, gets no options.
- Drawing is checked by hand, since headless runs have no GUI.
- **Risks:** a mod that replaces `ITab_Storage` with its own tab shows no button. Its buildings still get defaults at creation, and the settings page edits them.
- **Players get:** Drag a stockpile or a dumping stockpile and it starts with the filter and priority you saved for that type. A modded designator that subclasses the vanilla stockpile designator is a type of its own.
- **How:** A postfix on `Designator_ZoneAddStockpile.MakeNewZone` (RimWorld/Designator_ZoneAddStockpile.cs:29). `Designator_ZoneAdd.DesignateMultiCell` calls it before `RegisterZone` and before the zone has cells (RimWorld/Designator_ZoneAdd.cs:149, :182). The postfix applies the template to `((Zone_Stockpile)__result).settings`.
- Type: the protected `preset` field (`:8`, read with `AccessTools.FieldRefAccess`) for the vanilla designators. `Designator_ZoneAddStockpile_Resources` and `_Expand` give "Stockpile" (DefaultStockpile), `_Dumping` gives "Dumping stockpile". An Expand drag that touches no existing zone makes a new stockpile (`:182`), which gets the Stockpile default just as vanilla gives it the Stockpile preset. Any other subclass is its own type, keyed by type name and labelled with its `NewZoneLabel`.
- Designators that override `MakeNewZone` without calling the base never reach the postfix and keep their own filter. Quick Stockpile Creation (1742151109, 85,713, 1.7) is one; 1trickPwnyta's Defaults overwrote its filter (comment 2025-08-01).
- Preset Filtered Zones (Continued) (2343873835, 16,079, 1.7) is not reached at all: its `Designator_PresetZoneAdd` subclasses `Designator_ZoneAdd`, and its `MakeNewZone` returns a `Zone_PresetStockpile`, a `Zone` with `ISlotGroupParent` and its own static `ITab_Storage` (its `Source/PresetFilteredZones/Designator_PresetZoneAdd.cs` and `Zone_PresetStockpile.cs` on GitHub). Its zones keep their preset filters and show no Defaults button. Support is a backlog item; the mod isn't installed here.
- Not reached, on purpose: the Harbinger tree's corpse stockpile (`HarbingerTree.CreateCorpseStockpile`, Anomaly) and gravship landings (`MoveableStockpile.TryCreateStockpile`), which build `Zone_Stockpile` directly.
-`MakeNewZone` is virtual, so the call isn't inlined.
- **Settings:** `stockpileDefaults` (on).
- **Save and removal:** the zone saves its settings as vanilla (`Zone_Stockpile.ExposeData`, RimWorld/Zone_Stockpile.cs:45-49).
- **Overlaps:** 1trickPwnyta's Defaults and Set my Defaults (3737034968, 116, 1.7) set the same thing; warned.
- **Tests:** With "Stockpile: Important, simple meals only", `DesignateMultiCell` over an empty 3x3 area gives a zone at Important that allows MealSimple and refuses Steel. Two disjoint blocks in one drag give two zones, both with the template. A dumping drag with no template stays vanilla (Corpses and Chunks allowed). An Expand drag next to an existing zone grows it without touching its filter. Phase 2: the zone's settings persist.
- **Risks:** none known.
#### New storage buildings start from your default
- **Players get:** Place a shelf, small shelf, bookcase, hopper, fridge or weapon rack and it starts with the default you saved for that building. Changes you make on the blueprint before it's built still win. A shelf, small shelf, hopper or other `Building_Storage` that auto-rebuild puts back keeps its old settings; a rebuilt bookcase starts from your default like a new one. Ruins, map generation and trader stock keep the game's settings. Graves, sarcophagi, mortars and other storage without a storage blueprint follow with their own feature.
- **How:** Every def whose `building.blueprintClass` is `Blueprint_Storage` or a subclass (RimWorld/BuildingProperties.cs:45). In vanilla that is the shelves, the bookcases (`Blueprint_StorageWithRoomHighlight`, a subclass) and the hopper (`Core/Defs/ThingDefs_Buildings/Buildings_Furniture.xml:1550` and `:1670`, `Buildings_Production.xml:1809`). In the installed mods, RimFridge's fridges (its 1.6 `Defs/ThingDefs_Buildings/Fridge_Base.xml:33`) and Weapon Racks' racks (parent `StorageShelfBase`, its 1.7 `Defs/ThingDefs/ThingDefs_Buildings.xml:5`).
- A postfix on `Blueprint_Storage.PostMake` (RimWorld/Blueprint_Storage.cs:60-68) applies the template after vanilla copied the def's default. The blueprint hands its settings to the frame (`MakeSolidThing`, `:92-100`), and `Frame.CompleteConstruction` copies them onto every `IStorageGroupMember` after it spawns (RimWorld/Frame.cs:326-330), bookcases included. That replaces the def default the building's own `PostMake` set (RimWorld/Building_Storage.cs:142-150).
- Auto-rebuild: a destroyed frame hands its settings to the new blueprint for any `Blueprint_Storage` (RimWorld/Frame.cs:192-204), but a destroyed building only when it is a `Building_Storage` (Verse/Building.cs:322-327). `Building_Bookcase` isn't one (RimWorld/Building_Bookcase.cs:8), so a rebuilt bookcase keeps the new blueprint's `PostMake` settings, which are now the template.
- Other factions place blueprints only for sieges (`SiegeBlueprintPlacer`, sandbags and artillery, none of them storage blueprints) and quest sketches (RimWorld/SketchThing.cs:172).
- A template never widens what a building takes. `StorageSettings.AllowedToAccept` also checks the parent filter (RimWorld/StorageSettings.cs:97-112), and templates are built only from defs the parent allows.
- Linked shelves use their group's settings (`Building_Storage.GetStoreSettings`, :100-107). The default stays on the shelf's own settings, as vanilla does.
- **Settings:** `storageDefaults` (on).
- **Save and removal:** vanilla fields on the blueprint, the frame (`Frame.storageSettings`, :190) and the building (`Building_Storage.ExposeData`, :182-188).
- **Overlaps:**
- [FSF] No Default Shelf Storage (945085502, 93,146, 1.7) and the "No Default Storage Settings" option of [FSF] FrozenSnowFox Tweaks (2893432492, 40,720, 1.7) change the def default in XML. For a kind with a saved default ours applies on top; for the rest theirs is "the game's default". Warned on the shelf kinds.
- RimFridge (2898411376, 282,094, no 1.7, package id `rimfridge.kv.rw`; 1.7 loads its 1.6 folder) and Weapon Racks (2788630748, 57,447, 1.7, `Aelanna.WeaponRacks`) are kinds by their own defs. Both package ids were read from the installed copies' About.xml.
- Replace Stuff (3526354009, 539,443, 1.7, `Memegoddess.ReplaceStuff`): a stuff replacement completes through its own frame class and is skipped. Building a different def over an old one copies `Building_Storage` settings one tick after spawn (its `Source/NewThing/NewThingFrame.cs`, `TransferStorageSettings`), after ours, so its copy wins. Its revival of a destroyed shelf copies the old settings after spawn, and vanilla's frame copy then writes the same settings, carried in the rebuild blueprint.
- Pick Up And Haul (1279012058, 1,784,724, no 1.7), Haul to Stack (949498803, 77,411, no 1.7) and Haul After Harvest (3834328825, 414, 1.7) read storage settings and write none.
- **Replaces:** Default Normal Empty Storage (3779351608, 17, no 1.7), the storage-building part of Defaults and Set my Defaults, and together with the quick setup [FSF] No Default Shelf Storage.
- **Tests:** With "Shelf: Normal, Steel only", `GenConstruct.PlaceBlueprintForBuild` places a shelf blueprint at Normal with Steel only. Allowing Wood on the blueprint and completing the frame with `CompleteConstruction(worker)` gives a shelf allowing Steel and Wood. A shelf spawned with `GenSpawn.Spawn(ThingMaker.MakeThing(Shelf, WoodLog))` keeps Preferred. A built shelf narrowed to Silver and destroyed with auto-rebuild on leaves a blueprint allowing only Silver. With "Bookcase: Normal, novels only", a built bookcase narrowed to textbooks and destroyed with auto-rebuild on leaves a blueprint with novels only. A template naming Steel never makes a hopper accept Steel. -Compat: a Weapon Racks rack built through a frame takes its template, and Replace Stuff's stuff replacement of a shelf keeps the shelf's settings.
- **Risks:** a modded storage building that sets its settings after spawn instead of in `PostMake` overwrites ours. The compat run covers RimFridge and Weapon Racks, the two in the installed set.
- **Players get:** A settings-page button "New shelves start empty at Normal" opens a list of every storage building with a checkbox. General-purpose shelves are ticked; hoppers, bookcases and single-purpose storage such as chemfuel pumps and weapon racks start unticked. Confirming saves an empty default at Normal for each ticked kind, one that also refuses items mods add later. Kinds that already have a default are marked and start unticked.
- **How:** The list holds defs with a storage tab that Defaults covers: since 1.0 those with a storage blueprint, with "Graves, mortars and other storage" every one. A kind is ticked when all of these hold:
-`thingClass` is `Building_Storage` or a subclass;
-`building.isHopper` (RimWorld/BuildingProperties.cs:138) is false, since an empty hopper starves the nutrient paste dispenser;
- its parent filter (`fixedStorageSettings`, else every storable item) allows things from at least two top-level item categories, the children of `ThingCategoryDefOf.Root`. Each allowed def counts under the top-level category its first `thingCategories` entry leads to; defs without one don't count.
- So a kind limited to one def or one category stays unticked: Rimefeller's chemfuel pump and chemfuel siphon allow only Chemfuel (its 1.7 `Defs/ThingDefs_Buildings/BuildingsB_Refining.xml:3-130`, `Building_Storage` without `isHopper`), and an empty default would stop the siphon from taking cans, the "pipe network taps and drains" complaint on [FSF] No Default Shelf Storage (comment 2023-07-08). Weapon racks allow only Weapons and already start empty at Important.
- The saved templates are ordinary entries with `unlisted = Refuse`, editable and forgettable one by one.
- **Settings:** covered by `storageDefaults`.
- **Save and removal:** nothing in the save.
- **Overlaps:** with [FSF] No Default Shelf Storage active, the button's tooltip says the two do the same thing.
- **Replaces:** [FSF] No Default Shelf Storage (945085502, 93,146, 1.7) and "No Default Storage Settings" in FrozenSnowFox Tweaks (40,720, 1.7), per kind instead of blanket.
- **Tests:** The setup with its preselection creates empty Normal templates for Shelf and ShelfSmall and none for Hopper or Bookcase. A shelf built afterwards allows nothing, at Normal. With the test mod's storable def `BlaxTest_Widget` removed from the template's lists, as if a mod had added it later, that shelf refuses it; the same template with `unlisted = Game` lets it follow the shelf's def default. -Compat: the RimFridge fridge is ticked and a Weapon Racks rack unticked; once "Graves, mortars and other storage" ships, Rimefeller's ChemfuelHopper and ChemfuelSiphon are listed and unticked.
- **Players get:** Build a grave, sarcophagus, mortar, growth vat or biosculpter pod, or a modded storage building without a storage blueprint such as Rimefeller's chemfuel pump, and it starts with the default you saved for it. The storage tab's Defaults button now shows on them. A grave or sarcophagus that auto-rebuild puts back starts from your default like a new one; vanilla doesn't carry their old filter into the rebuild. Ruins, map generation and trader stock keep the game's settings. Growth vats need Biotech and biosculpter pods Ideology.
- **How:** The build scope from the data model arrives here. These parents take the def default while the thing is made, not from a blueprint: graves and sarcophagi (`Building_CorpseCasket.PostMake`, RimWorld/Building_CorpseCasket.cs:51-58), the growth vat (`Building_GrowthVat.PostMake`, :231-238), the biosculpter pod (`CompBiosculpterPod.Initialize`, :249-256), a `Building_Storage` without a storage blueprint (`Building_Storage.PostMake`, RimWorld/Building_Storage.cs:142-150) and mortar shells (`CompChangeableProjectile.Initialize`, :51-58).
- The made hook applies the template to the thing's `IStoreSettingsParent`: the thing, or its first comp that is one, found the way `ITab_Storage.GetThingOrThingCompStoreSettingsParent` finds it (RimWorld/ITab_Storage.cs:153-170). Skipped for defs that have a storage blueprint, which 1.0 covers.
- Turrets: the mortar's shell storage sits on its gun, not on the turret. Core puts `CompProperties_ChangeableProjectile` and `building.defaultStorageSettings` on the gun def `Artillery_Mortar` (`Buildings_Security_Turrets.xml:618-640`), and `Turret_Mortar` names it as `turretGunDef` (:576). When the made thing is a `Building_TurretGun` and has no storage parent itself, the hook resolves the parent as `ITab_Shells` does, on `turret.gun` (RimWorld/ITab_Shells.cs:5-19), and keys the kind by the turret's def, as the tab does. The gun exists by then, because `PostMake` calls `MakeGun` before `MakeThing` returns.
- Rebuilds: a grave or sarcophagus has no storage blueprint, so auto-rebuild places a plain blueprint and the made hook gives the new one the template, or the def default without one. Vanilla carries settings only for `Building_Storage` (Verse/Building.cs:322-327).
- The quick setup's list widens to every def with a storage tab, with the same preselection rule.
- DLC: the growth vat (`ThingDefOf.GrowthVat`, `[MayRequireBiotech]`) and the biosculpter pod (`ThingDefOf.BiosculpterPod`, `[MayRequireIdeology]`) exist only with their DLC. The hook reaches them through the storage parent, never by def, so without the DLC it never meets one, the tab, the quick setup and "Add a default" don't list them, and a saved default stays in the file and shows disabled on the settings page with "Needs Biotech" or "Needs Ideology".
- **Settings:** covered by `storageDefaults`.
- **Save and removal:** vanilla fields on the building or its comp (`Building_CorpseCasket.ExposeData`, :61-65; `CompChangeableProjectile.PostExposeData`, :44-49).
- **Overlaps:**
- VFE Security (1845154007, 903,230, 1.7) adds `VFES_Turret_Artillery`, a `VFESecurity.Building_Artillery` with `ITab_Shells` and its shell storage on the gun def `VFES_Artillery_ArtilleryGun` (its 1.6 `Defs/ThingDefs_Buildings/Buildings_Artillery.xml:180-333`). The turret path covers it if that class derives from `Building_TurretGun`, which the -Compat run checks.
- Rimefeller (1321849735, 362,163, 1.7): its chemfuel pump, siphon and unloading bay are `Building_Storage` without a storage blueprint, so they become kinds here.
- **Replaces:** the grave and other storage defaults of 1trickPwnyta's Defaults and Set my Defaults.
- **Effort:** S + S, including the build scope.
- **Tests:** With "Grave: Important, animal corpses only", a grave built through a frame takes its template and a grave spawned directly keeps the def default (humanlike corpses). A built grave narrowed by hand to human corpses and destroyed with auto-rebuild on, then rebuilt through the frame, has the template, not the hand filter. With "Mortar: high-explosive shells only", a `Turret_Mortar` completed through a frame has a gun whose `CompChangeableProjectile` allows only `Shell_HighExplosive`, and `StorageDefaultsMenu.OptionsFor` on the selected turret names "mortars" and stores under `storage:Turret_Mortar`. With Biotech, a growth vat built through a frame takes its template; with Ideology, a biosculpter pod's nutrition storage does (each skipped without). -NoDlc: the quick setup lists neither, and a saved `storage:GrowthVat` entry is kept, drawn as a disabled row with "Needs Biotech", and not counted as an inactive name. -Compat: a `VFES_Turret_Artillery` built through a frame takes its template; Rimefeller's ChemfuelHopper built through a frame takes its template.
- **Risks:** a storage parent that sets its settings in `SpawnSetup` overwrites ours.
- **Players get:** A settings section "Every new bill": repeat mode (do X times, do until you have X, do forever), the count (1), the target (10), pause when satisfied (off) and resume at (5), ingredient radius (unlimited), allowed skill range (0 to 20), where products go (best stockpile or drop on floor), count equipped (off), count tainted (off), and the hit points and quality ranges used for counting. Each value starts at "the game's default", and only values you change are applied. Since 1.0 they are set on the settings page; the bill window's Defaults button comes with "Defaults per recipe from the bill window".
- **How:** A postfix on `BillUtility.MakeNewBill` (RimWorld/BillUtility.cs:36-55). Its only vanilla callers are the Bills tab's add menu (RimWorld/ITab_Bills.cs:114) and the dev colony maker.
- Applies to `Bill_Production` and `Bill_ProductionWithUft`. `Bill_ProductionMech`, `Bill_ResurrectMech` and `Bill_Autonomous`, also returned there, get only recipe defaults, because gestation and forming bills store no products.
- "Do until you have X" only where `recipe.WorkerCounter.CanCountProducts(bill)`, the check the vanilla menu makes (RimWorld/BillRepeatModeUtility.cs:15-24). Elsewhere the bill uses "do X times" with the count.
- Store mode through `SetStoreMode(BestStockpile or DropOnFloor)` (Bill_Production.cs:197-205), never SpecificStockpile, which needs a save-specific group and logs "Inconsistent bill StoreMode data set" without one.
- Not reached: surgery (`HealthCardUtility.CreateSurgeryBill` makes a `Bill_Medical`, RimWorld/HealthCardUtility.cs:420, RimWorld/Bill_Medical.cs:9), pasted bills (`Bill.Clone` with the parameterless constructor, Bill.cs:462-480, pasted at ITab_Bills.cs:67) and loaded bills.
- **Settings:** `billDefaults` (on).
- **Save and removal:** vanilla bill fields, saved by `Bill.ExposeData` and `Bill_Production.ExposeData` inside the bench's bill stack.
- **Overlaps:** Better Workbench Management (935982361, 452,369, no 1.7) sets the store mode of new bills; Default Ingredient Radius (2909706985, 11,626, 1.7) and Default Bill Ingredient Radius (3789671048, 55, no 1.7) set the radius; Default Until X (3554414830, 27, no 1.7) sets the repeat mode. Warned; whichever patch runs last wins. Nice Bill Tab (3520130671, 356,388, 1.7) redraws the Bills tab; if it adds bills through `MakeNewBill` it is covered, and a compat run decides the README line.
- **Replaces:** the default store mode of Better Workbench Management (452k), Default Ingredient Radius (11.6k), Default Bill Ingredient Radius (55), Default Until X (27), and the bill radius, skill range and store mode of 1trickPwnyta's Defaults (75k).
- **Tests:** With "drop on floor, radius 30, do until 20", `MakeNewBill` for CookMealSimple returns a bill with DropOnFloor, radius 30, TargetCount and target 20. A recipe whose counter can't count products gets RepeatCount. A clone of that bill keeps the source values when the global values change. `CreateSurgeryBill` returns an untouched bill. With Biotech (skipped without), a mech gestation bill keeps vanilla values.
- **Risks:** `MakeNewBill` is small and called from a lambda, so the JIT may inline it into the menu. Headless tests call it directly and can't prove the menu path. If a manual check shows the postfix skipped there, the fallback is a postfix on the `Bill_Production(RecipeDef, Precept_ThingStyle)` constructor (Bill_Production.cs:108-111), which runs for new bills only (cloning and loading use the parameterless one) but also for bills other mods create in code; the README then says so.
- **Players get:** A "Defaults" button in the bill window. "Make these the default for new <recipe> bills" saves the ingredient filter, repeat and count values, pause, radius, skill range, store mode, "slaves only", "mechs only" or "non-mechs only", the counting options and "limit to allowed stuff". "Make these the values for every new bill" copies the shared values into the global set. "Forget the default for <recipe>" asks first. New bills of that recipe start from it, at any workbench. Values that match your every-bill values aren't saved for the recipe, so they keep following the every-bill values when you change those.
- **How:** A postfix on `Dialog_BillConfig.DoWindowContents` (RimWorld/Dialog_BillConfig.cs:114) draws a 150 by 30 button at the top right of the 800 by 664 window (`:46`), right of the title, which ends at x 440 (`:117`). The bill is the protected field `bill` (`:16`).
- BillTemplate: the fields from "Values for every new bill" plus ingredient `allowed` and `refused` defNames (built only from defs the recipe's `fixedIngredientFilter` allows, Verse/RecipeDef.cs:33), special filters, `limitToAllowedStuff` and a restriction (any, slaves only, mechs only, non-mechs only).
- Left out, because they belong to one save: pawn restriction, the store and include groups, the custom name, style and xenogerm. A bill set to "take to stockpile X" saves best stockpile; the button's tooltip says so.
- Sparse: "Make default" stores only the fields whose value differs from what a new bill of that recipe gets at that moment, the game's value with the every-bill values on top. The ingredient filter is stored only when it differs from the recipe's `defaultIngredientFilter` (Verse/RecipeDef.cs:35, copied into every new bill at RimWorld/Bill.cs:156), and the restriction only when it isn't "any". Fields not stored follow the every-bill value, so a later change there still reaches this recipe. The settings page shows them as "follows every-bill value".
- Applied in the `MakeNewBill` postfix after the global values, so a stored recipe field wins over the global one.
- Restrictions go through `SetAnySlaveRestriction`, `SetAnyMechRestriction` and `SetAnyNonMechRestriction` (Bill.cs:173-197), under the conditions the vanilla menu uses (Dialog_BillConfig.cs:550-575): slaves only with Ideology, mech restrictions with Biotech and `MechWorkUtility.AnyWorkMechCouldDo(recipe)`. Without the DLC a stored restriction is skipped when a bill is made, the bill takes anyone, and the restriction stays in the file for when the DLC is back. The settings page's summary of that recipe default marks it "Needs Ideology" or "Needs Biotech".
- The settings page lists recipe defaults with a summary and Forget. Editing happens in the bill window: change a bill, make it the default again.
- **Settings:** covered by `billDefaults`.
- **Save and removal:** vanilla bill fields only.
- **Overlaps:** Set my Defaults' bill library and Defaults' bill templates; warned with the bill category.
- **Replaces:** New Game Plus' workbench bill library (2909126210, 23,475, no 1.7), the per-recipe half of Defaults and Set my Defaults, and the manual bill save of [KV] Save Storage (109,174), for one default per recipe.
- **Effort:** M.
- **Tests:** From a CookMealSimple bill with human meat refused, slaves only (Ideology), forever and radius 40, "Make default" stores those values. A new CookMealSimple bill from any stove has them; a CookMealFine bill gets only the global values. With the every-bill radius at 30, a CookMealSimple default saved with radius 30 and forever stores forever but not the radius; after the every-bill radius changes to 50, a new CookMealSimple bill has radius 50 and forever, while a recipe default saved with radius 40 keeps 40. A bill whose store mode was a specific stockpile saves BestStockpile and logs no store mode error. -NoDlc: the slaves-only part is ignored without errors and is still in the file; a mechs-only default saved with Biotech is ignored the same way. A removed recipe's default is kept and skipped.
- **Risks:** an ingredient filter saved before a mod added a new meat lets the new meat follow the recipe's own default filter, which is the intended rule.
#### Bills for new workbenches
Designed, no code yet.
- **Players get:** A "Defaults" button in a workbench's Bills tab. "Make these the bills for new electric stoves" saves the bench's bills, in order, each as a full bill default; "Forget" removes the set. A new bench of that type that you build comes with those bills, and so does a bench auto-rebuild puts back, since vanilla rebuilds benches empty. Benches in ruins, from map generation and reinstalled from a minified bench keep what they have. With Replace Stuff, a bench built over another one keeps the old bench's bills, and a revived bench of the plain workbench class (tailoring benches, smithies, the machining table, the drug lab) gets its old bills back; stoves, the stonecutter's table, the electric smelter and the crematorium come back empty in Replace Stuff too, so they get the set.
- **How:** The button is a postfix on `ITab_Bills.FillTab`: a 24 px icon left of the vanilla paste button, which sits at `WinSize.x - PasteX`, `PasteY` (RimWorld/ITab_Bills.cs:17-40). Building goes through the build scope's built hook: when the new thing is an `IBillGiver` whose `BillStack` is still empty and its def has a set, each entry becomes `recipe.MakeNewBill()` with the global values and then the entry's values.
- An entry is added only where the vanilla add menu would offer it: the recipe is still on the bench (`def.AllRecipes`), `AvailableNow`, and `AvailableOnNow(newBench)` (Verse/RecipeDef.cs:398), the same pair the add menu and paste check (RimWorld/ITab_Bills.cs:43, :86). Skipped entries produce one message ("2 bills skipped: research not done or not possible on this bench").
- Sets hold up to 15 bills, the vanilla cap (`BillStack.MaxCount`, RimWorld/BillStack.cs:15).
- Replace Stuff's new-thing replacement moves the old bench's bills inside `GenSpawn.Spawn`, before our postfix (its `Source/NewThing/NewThingFrame.cs`, `TransferBills`), so the empty-stack check keeps them. Its revival copies bills only for the exact class `Building_WorkTable`; the stoves, the stonecutter's table, the electric smelter and the crematorium are `Building_WorkTable_HeatPush` (Core `Buildings_Production.xml:676, 770, 864, 1065, 1440`), which its `DestroyedBuildings.SaveBuilding` never keeps. The revival guard skips the set for a revived plain bench even when it had no bills.
- An entry whose recipe isn't loaded, such as baby food without Biotech (Biotech `RecipeDefs/Recipes_Food.xml:5`, on both stoves through `MayRequire`, Core `Buildings_Production.xml:731-732`, `:824-825`), is skipped and counted in the message, and stays in the set.
- **Settings:** `benchBillSets` (on).
- **Save and removal:** the bills are vanilla bills in the bench's stack.
- **Overlaps:** Auto Bill Restore (3542342928, 1,146, no 1.7), Set my Defaults' bills per workbench and Defaults' workbench bills; warned. No Max Bills: Redux (3526216885, 34,055, no 1.7) raises the cap; sets stay at 15.
- **Replaces:** the per-workbench bills of Defaults and Set my Defaults, and Auto Bill Restore's restore after a rebuild where Replace Stuff doesn't revive the bench: a rebuilt bench gets the set.
- **Effort:** S + S.
- **Tests:** With a set for the electric stove (simple meals forever, fine meals until 10), a stove completed through a frame has both bills in order with those values. A stove spawned directly has none. With fine meal research missing, the stove gets one bill and the message. A set entry whose recipe's `AvailableOnNow` is false on the new bench (a test-only recipe worker) is skipped and counted in the message. -NoDlc: a stove set saved with Biotech, holding simple meals and baby food, gives a new stove the simple meal bill and the message, and the set still holds baby food. -Compat, with Replace Stuff: building an electric stove over a fueled stove that has bills keeps the old bills, not the set; an electric stove with bills destroyed with auto-rebuild on and rebuilt through the frame gets the set; an electric tailoring bench with two bills, destroyed and rebuilt the same way, has its two old bills and no set; the same bench with no bills stays empty.
- **Risks:** a bench whose bills another mod adds during spawn gets no set; that matches "the player already has bills there".
Shipped in 1.1. What stays forbidden when a pawn goes down, dies or is stripped, set per group with the vanilla item filter. Nothing here is a "Make default": every rule sits in a "Forbid rules" section of the settings page and ships off.
Read in the 1.7.5021 code. Two calls drop a pawn's things and forbid some of them: going down (`Pawn_HealthTracker.MakeDowned`, Verse/Pawn_HealthTracker.cs:837, sets the state at :848 and calls `DropAndForbidEverything(keepInventoryAndEquipmentIfInBed: true, rememberPrimary: true)` at :856-860 while the pawn is spawned) and dying (`Pawn.Kill`, Verse/Pawn.cs:2096, calls `DropAndForbidEverything()` at :2230-2233 when the pawn was spawned). `DropAndForbidEverything` is Pawn.cs:2890-2928. Stripping is the third way (`Pawn.Strip`, :3895-3921).
| Thing | Goes down | Dies | Stripped |
|---|---|---|---|
| Equipment (the weapon) | Dropped and forbidden anywhere (Pawn.cs:2921, Verse/Pawn_EquipmentTracker.cs:162). Kept when the pawn goes down in a bed (Pawn.cs:2919) | Dropped and forbidden anywhere, in a bed too | Dropped allowed (Pawn.cs:3913) |
| Inventory: food, medicine, drugs, silver, a trader's wares, Simple Sidearms' sidearms | Dropped, forbidden only outside the home area (Pawn.cs:2922-2925, Verse/Pawn_InventoryTracker.cs:182-187). A stack that merges into one on the ground forbids that stack. Kept in a bed | The same, in a bed too | Dropped with the flag it had (Pawn.cs:3915 passes neither forbid nor unforbid) |
| Carried thing | Dropped, forbidden anywhere when the pawn's faction is hostile to you, else unchanged (Pawn.cs:2915-2918, Verse/Pawn_CarryTracker.cs:136-139) | The same | Not stripped |
| Apparel | Stays worn | Stays on the corpse. A violent death costs each piece 15 to 40% of its hit points (RimWorld/Pawn_ApparelTracker.cs:612-618), and apparel with `careIfWornByCorpse` turns tainted (RimWorld/Apparel.cs:182-187) | Dropped allowed (Pawn.cs:3914) |
| Corpse | | Forbidden outside the home area, unless designated for hunting or slaughter or reserved by the hunter who killed it (Pawn.cs:2132-2133, :2197-2204) | |
What follows from it:
- Gear drops once: when the pawn goes down, or when it dies without going down. A pawn that goes down drops its weapon and inventory then, and when it dies later there is nothing left to drop. Violence that would down a pawn outside your faction often kills it on the spot instead, without `MakeDowned` (Verse/Pawn_HealthTracker.cs:527-572, `pawn.Kill(dinfo)` at :571): humanlikes 80% at population intent 0, 87% at -1 and 26% at 8 (Verse/HealthTuning.cs:115-122; 85%, 92% and 30% with wavering prisoners, :124-131), times the difficulty's enemy death factor (Pawn_HealthTracker.cs:557), animals 50% (:553) and mechs always (:557). Kinds with `forceDeathOnDowned` always die (:522-526). Your own pawns, prisoners and guests never roll it (:527). So one rule covers both, and a rule for either alone would miss gear.
- Inside the home area the game forbids only the weapon and an enemy's carried thing; dropped food and medicine are already allowed there. Food left forbidden outdoors lies outside the home area.
- Things deteriorate only on the ground (RimWorld/SteadyEnvironmentEffects.cs:120-135 walks the things in each cell), so food and medicine leave an inventory in the condition they went in.
- Going down remembers the main weapon (`mindState.droppedWeapon`, Pawn_EquipmentTracker.cs:174-177). Every humanlike picks it up after getting up, forbidden or not (`JobGiver_PickupDroppedWeapon` with `ignoreForbidden`, Core `ThinkTreeDefs/Humanlike.xml:297-300`; Verse.AI/JobGiver_PickupDroppedWeapon.cs:9-16), as long as both stay where they are. The link is cleared once the weapon isn't spawned, for example in a hauler's hands (Verse.AI/Pawn_MindState.cs:557-560), and once the pawn itself despawns (`Pawn.DeSpawn` sets `mindState.droppedWeapon = null`, Pawn.cs:2418). Rescue despawns it: `JobDriver_TakeToBed` carries the pawn through `Toils_Haul.StartCarryThing` (RimWorld/JobDriver_TakeToBed.cs:121, Verse.AI/Toils_Haul.cs:77), whose `Pawn_CarryTracker.TryStartCarry` splits it off the map (Verse/Pawn_CarryTracker.cs:94; `SplitOff` calls `DeSpawnOrDeselect`, Verse/Thing.cs:1616, :930-936). A kidnapper carrying it, leaving the map and death despawn it too; death despawns the pawn (Pawn.cs:2170) before `Pawn.Destroy` clears the mind (:2367). The pickup also needs the weapon on the pawn's own map (Verse.AI/JobGiver_PickupDroppedWeapon.cs:11-14). A rescued colonist therefore never goes back for its weapon, and vanilla leaves it forbidden where it fell. Equipping another weapon clears the link too (Verse/Pawn_EquipmentTracker.cs:227), and so does the pickup job as it starts (Verse.AI/JobDriver_Equip.cs:66), which then holds a reservation on the weapon (:57).
- Every mechanoid kind destroys its weapon instead of dropping it (`destroyGearOnDrop`, Core `Races_Mechanoid.xml:59`; Pawn.cs:2892-2896), yours and enemies' alike. A hostile superheavy mech (Biotech) leaves a chip, forbidden outside the home area (RimWorld/GenLeaving.cs:78-80, :180-183, reached from Pawn.cs:2236).
- Stripping is a player order: the Strip designation or right-click order (`JobDriver_Strip`, RimWorld/JobDriver_Strip.cs:31-38, which won't touch a forbidden target, :27), a corpse's Strip (Verse/Corpse.cs:386-389), butchering (`autoStripCorpses`, on by default, Verse/RecipeDef.cs:45; Verse.AI/Toils_Recipe.cs:336-339) and caravan forming's auto strip (RimWorld/Dialog_FormCaravan.cs:756-759). Cremation turns it off (Core `RecipeDefs/Recipes_Cremation.xml:13`), so a cremated corpse burns with its apparel. In a caravan, Strip moves everything into inventories (Pawn.cs:3898-3909).
-`DropAndForbidEverything` has three more callers: trading a pawn away (`PreTraded`, Pawn.cs:2612), capture (RimWorld/Pawn_GuestTracker.cs:461) and Anomaly's distress-call sites while their map is made (RimWorld.Planet/DistressCallUtility.cs:50).
Per pawn kind:
- Colonists: the weapon, the inventory (carried medicine, drugs, food) and whatever they were hauling, which keeps its flag.
- Slaves (Ideology): the same code; most carry no weapon.
- Prisoners: capture drops everything (Pawn_GuestTracker.cs:461), so a prisoner holds nothing unless it grabs a weapon in a prison break. Breaking out makes it hostile to you (RimWorld/GenHostility.cs:138-141), though never an active threat that holds up the wait (`IsPotentialThreat` skips prisoners, :277), and it stays a prisoner of your colony: a prison break only gives it a `LordJob_PrisonBreak` (RimWorld/PrisonBreakUtility.cs:195-203), and the host faction stays yours. Its drops follow the colony rule, like a rebelling slave's.
- Colony mechs (Biotech): the weapon is destroyed; a carried thing keeps its flag.
- Colony animals: no equipment; a pack animal's inventory drops, forbidden outside the home area.
- Raiders: the weapon forbidden; the inventory (medicine, drugs, food) forbidden outside the home area; stolen goods they carry forbidden anywhere; the corpse forbidden outside the home area. Hostile mechs drop nothing but superheavy chips.
- Neutral visitors and traders: as raiders, apart from what they carry. A trader's wares sit in its own and its pack animals' inventories (RimWorld/Pawn_TraderTracker.cs:17-37), so a downed trader drops them, forbidden outside the home area. Stripping a living member of a non-hostile faction costs 40 goodwill (RimWorld/Faction.cs:810-816).
- Quest lodgers belong to your faction with an extra home faction (`IsQuestLodger`, RimWorld/QuestUtility.cs:524-531); other quest pawns follow their faction.
#### Gear rules for your colony and for enemies
- **Players get:** Two rules on the settings page, "Gear your colony drops" and "Gear enemies drop", each off until you turn it on. When one of the group's pawns goes down or dies, everything the game forbids that matches the rule's filter is allowed again once the fight is over (next feature); what doesn't match stays forbidden, as in vanilla. A rule never forbids a dropped thing the game left allowed. Your colony is colonists, slaves (Ideology), colony mechs (Biotech), colony animals and prisoners, also while they break out; enemies are everyone else hostile to you when they go down or die. Neutral visitors, traders and quest lodgers keep the game's rules, and a line under the rules says so. A downed colonist's main weapon stays forbidden while the colonist lies where it fell, so it picks the weapon up after getting up, as vanilla does; once the colonist is rescued, carried off or dies, the rule decides. Each rule has:
- a filter: Edit opens the vanilla item filter with the hit points and quality sliders stockpiles have and its special filters (tainted, biocoded, rotten, smeltable). The row says what it allows ("all items, hit points 50 to 100%, Normal or better"). Ticking the rule while it has no filter saves the suggested setup (below) as its filter, strip switch included, and turns it on; a message says so ("Using the suggested setup: ..."). The strip switch stays disabled until the rule has a filter. Forget on the row asks first, deletes the filter and turns the rule and its strip switch off;
- "Where": anywhere (the default) or only inside the home area;
- "Stripping forbids what doesn't match" (see below);
- "Use the suggested setup", which asks first. Enemies: every item, hit points 50 to 100%, Normal or better, anywhere, stripping on, so a Poor rifle or one below 50% stays forbidden while food, medicine, drugs and silver are allowed. Your colony: every item, full ranges, anywhere, stripping off.
- **How:**
- Groups, read in the prefix while the pawn is alive: your colony when `Faction == Faction.OfPlayer` and not `IsQuestLodger()` (RimWorld/QuestUtility.cs:524), or `IsPrisonerOfColony` (Verse/Pawn.cs:624); otherwise enemies when `HostileTo(Faction.OfPlayer)` (RimWorld/GenHostility.cs:118), which covers raiders, manhunting animals and predators hunting yours (:130-137); otherwise no rule. A dead pawn is destroyed (`Thing.Kill`, Verse/Thing.cs:1038-1041), and `HostileTo` is false for anything destroyed (GenHostility.cs:120-123), so the group can't be read afterwards. A berserk colonist, a rebelling slave and a prisoner breaking out stay in your colony: the colony test comes first, and a prison break leaves the pawn a prisoner of your colony (RimWorld/PrisonBreakUtility.cs:195-203), though `HostileTo` is true for it (GenHostility.cs:138-141).
- Scopes: a prefix on `Pawn.Kill(DamageInfo?, Hediff)` (Verse/Pawn.cs:2096) and one on the private `Pawn_HealthTracker.MakeDowned(DamageInfo?, Hediff)` (Verse/Pawn_HealthTracker.cs:837, called from :577 and :833) push the pawn and its group onto a `[ThreadStatic]` stack, while the game is playing and no map is being made (`MapGenerator.mapBeingGenerated`, Verse/MapGenerator.cs:12). A finalizer pops it, even on an exception. A death inside a death, such as a boomalope exploding in the death action (Pawn.cs:2281-2284), pushes its own scope. Both methods are long, so neither is inlined.
- Recorder: a prefix and a postfix on the setter of `CompForbiddable.Forbidden` (RimWorld/CompForbiddable.cs:20-45). While a scope is open, the prefix reads the old value and the postfix adds the thing to the innermost scope when it went from allowed to forbidden. So a scope holds exactly what the game forbade in that call: the weapon, inventory outside the home area (including a stack a drop merged into, since the game forbids the merged stack, Pawn_InventoryTracker.cs:182-187), an enemy's carried thing, the corpse (Pawn.cs:2203) and superheavy chips (GenLeaving.cs:180-183). A thing that was forbidden already isn't recorded and stays forbidden. Outside a scope the cost is one static field read, plus the wait list check below. The recorder never changes a forbid; the setter has some twenty lines and calls into the listers, so it isn't inlined. Nothing patches `ForbidUtility.SetForbidden` or `SetForbiddenIfOutsideHomeArea` (RimWorld/ForbidUtility.cs:16-58).
- Apply, in the postfixes of `Kill` and `MakeDowned`: a recorded thing that is no longer spawned or no longer forbidden is skipped; a corpse goes to the corpse rules. Any other thing is allowed when its group's rule is on and has a filter, its cell passes "Where" (`map.areaManager.Home[cell]`) and the filter allows it, through `SetForbidden(false, warnOnFail: false)`: at once when the map has no active threat, else through the wait list.
- Remembered weapon: for your colony with its rule on, the `MakeDowned` postfix never allows `pawn.mindState.droppedWeapon` at once, threat or not. It goes on the wait list with its owner, and the 250-tick check keeps that entry while `owner.mindState?.droppedWeapon == weapon`, which in practice is while the colonist lies where it fell. Rescue, a kidnapper, leaving the map and death despawn the owner and break the link (Pawn.cs:2418, see "What the game forbids today"), and from the next check the weapon is decided like any other entry: no threat, still spawned, still forbidden, inside "Where", allowed by the filter. A weapon no longer spawned leaves the list, because the colonist or a hauler took it. When the pickup job starts it breaks the link and reserves the weapon (Verse.AI/JobDriver_Equip.cs:57, :66), so a check that allows the weapon on the colonist's way changes nothing for it. The link is read in the check, so this needs no patch, and a colonist that dies after going down needs nothing in the `Kill` prefix.
- Filter: a StorageTemplate (see the data model) under `forbid:colony` and `forbid:enemies`, priority unused. Its parent filter is every storable item (`StorageSettings.EverStorableFixedSettings`, RimWorld/StorageSettings.cs:136-146) without the Corpses category, which the corpse rules cover. The edit window is the 1.0 storage editor without the priority, its unlisted rule offering "Refuse" (stays forbidden) and "Allow"; the suggested setups save "Allow", so items a mod adds later follow the ranges. Applying builds one scratch `ThingFilter` per rule, kept until the template changes, and calls `ThingFilter.Allows(Thing)` (Verse/ThingFilter.cs:874-906): the def, the hit points as a rounded percentage when the range isn't full (:881-889, `CaresAboutHitPoints` :263-273), the quality of things that have one (:894-897) and the special filters (:898-904).
- The ranges count for every item that has hit points or quality. Food and medicine have hit points but leave the inventory in the condition they went in, and silver has none (Core `ThingDefs_Items/Items_Resource_Stuff.xml:18`), so in practice the ranges sort weapons, and apparel when stripping.
- Not reached: trading a pawn away, capture and distress-call sites, which call `DropAndForbidEverything` outside `Kill` and `MakeDowned`.
- **Settings:** `forbidRules` (on, as a category), `colonyGearRule` (off), `colonyGearAnywhere` (on), `enemyGearRule` (off), `enemyGearAnywhere` (on). The filters live in the defaults file, so a mod settings file that fails to load turns the rules off and keeps the filters. Turning a rule on needs a saved filter under `forbid:colony` or `forbid:enemies`. Forget on that entry deletes it and sets the rule's toggle and its strip toggle to false. A rule that is on but finds no filter, because the defaults file failed to load, acts as off and its row says why; the toggle stays as saved, since nothing is written at load.
- **Save and removal:** the vanilla forbidden flag on each thing. Removing the mod leaves the flags as they are.
- **Overlaps:**
- KilledEnemyAutoAllowed (Continued) (2159090973, 5,232, 1.7) allows everything killed pawns drop, anywhere, for every pawn (its Workshop page); warned.
- Allow Everything (2592726874, 3,842, no 1.7) allows every item on the map, which undoes what a rule leaves forbidden; warned.
- Non uno Pinata (don't drop items) (1778821244, 143,710, no 1.7) keeps gear on downed and dead pawns, with options for colonists and outsiders, so little drops for the rules to sort; warned.
- Looting Manager (2002001082, 7,216, no 1.7) and No more weapons bloat (3069777660, 3,648, 1.7) remove, biocode or degrade enemy gear. The rules see what lands; a change those mods make after our postfix keeps the flag the rule gave.
- Mechanoids Drop Guns! (Continued) (2059921296, 2,409, 1.7) makes mechs drop their weapons, which then fall under the enemy rule.
- Simple Sidearms (927155256, 973,410, no 1.7) keeps sidearms in the inventory, so they drop as inventory, forbidden only outside the home area, and the filter sorts them as weapons.
- Forced Rearmament (3232549170, 22,494, 1.7) and Where is my weapon? (1539028008, 201,950, no 1.7) make colonists fetch their dropped weapon; the remembered weapon waiting while its owner lies where it fell suits both.
- Allow Tool (761421485, 1,388,637, no 1.7; its changelog lists an option to unforbid the items next to a downed pawn you finish off) and Keyz' Allow Utilities (3524716849, 91,139, 1.7) allow by hand and compose. Pick Up And Haul (1279012058, 1,784,724, no 1.7) hauls what is allowed. Hospitality (753498552, 768,458, no 1.7): guests stay vanilla.
- No Workshop mod found that allows dropped things by quality or condition (searched 2026-11-29).
- The overlap warnings gain this category: KilledEnemyAutoAllowed (Continued) (`Mlie.KilledEnemyAutoAllowed`), Allow Everything (`AndrewRaphaelLukasik.AllowEverything`), Non uno Pinata (`avilmask.NonUnoPinata`) and, for the corpse rules, Allow Dead Animals (`AndrewRaphaelLukasik.AllowDeadAnimals`), each read from the About.xml in the mod's public source on 2026-11-30. Not detected: the 1.0 original of KilledEnemyAutoAllowed (1858219355, 291, 1.0 only), whose About.xml predates package ids; the id the game makes up for it hashes its description. The overlap texts say these mods "do some of the same things", since they set no starting settings.
- **Replaces:** KilledEnemyAutoAllowed (Continued) (5.2k) for your colony and enemies: with both rules on, every item allowed, anywhere, and the corpse rules on, what dying pawns drop is allowed everywhere, while neutral pawns' drops stay vanilla. Allow Everything (3.8k) for what downed and dead pawns drop.
- **Tests:** No hostile pawn on the test map unless a test says so.
- A colonist downed by damage outside the home area, colony rule on with the suggested setup: its packaged survival meal and herbal medicine on the ground are allowed; its rifle is forbidden, is its `droppedWeapon` and stays forbidden over several checks. Killed afterwards: the rifle is allowed after the next check. With the rule off, all three stay forbidden.
- The same downed colonist carried to a bed by a rescuer: its rifle is allowed after the next check.
- The same downed colonist healed where it fell: it gets up and equips its still forbidden rifle, the entry leaves the list and nothing logs.
- A prisoner breaking out, downed outside the home area with a knife: the knife stays forbidden while the prisoner lies there and follows the colony rule once the prisoner is carried back to its cell.
- With no filter saved, `colonyGearRule` and `enemyGearRule` can't be set and a raider's drops stay vanilla. Forget on a saved enemy filter sets `enemyGearRule` and `enemyStripRule` to false. With `enemyGearRule` on in mod settings and an empty library, a raider's drops stay vanilla and nothing logs.
- A raider killed outside the home area, enemy rule on with the suggested setup: a Normal assault rifle at 80% is allowed, a Poor one at 80% and a Normal one at 40% stay forbidden, its go-juice and medicine are allowed, and its corpse stays forbidden (corpse rules off).
- A raider downed, not killed: its weapon is allowed. Captured afterwards: nothing else changes and nothing logs.
- "Only inside the home area": a raider killed outside stays vanilla; killed inside, its Normal 80% rifle is allowed.
- Two raiders with 5 medicine each killed on one cell outside the home area: one stack of 10, allowed. A stack of 10 medicine the player forbade next to a raider killed with 5: the merged stack stays forbidden.
- A raider carrying 200 silver killed inside the home area: allowed with the rule on, forbidden with it off.
- A filter refusing medicine never forbids: a raider killed inside the home area leaves its medicine allowed.
- With both rules on, a downed trader guest's wares outside the home area and a downed quest lodger's weapon stay forbidden.
- Ideology (skipped without): a downed slave's meal outside the home area follows the colony rule. Biotech (skipped without): a colony mech hauling steel goes down and the steel keeps its flag; a hostile Scyther dies, drops no weapon and nothing logs.
- -Compat: with Hospitality, a downed guest's weapon stays forbidden; with Pick Up And Haul, an allowed rifle gets hauled.
- Phase 2: the flags persist, and the .rws contains no "BlaxDefaults" outside the meta block.
- **Risks:** haulers walk to the far side of the map after a fight; "only inside the home area" keeps them close. A colonist drafted right after getting up keeps its remembered weapon waiting until it is undrafted and fetches it. A mod that forbids drops in a postfix after ours wins.
#### Wait until the fight is over
- **Players get:** Things a rule allows wait while an enemy that can still fight is on the map, and are allowed once none is left, so no rule sends a hauler into a fight. A downed colonist's weapon also waits while the colonist lies where it fell (see the gear rules). Changing a waiting thing's flag yourself takes it off the list. A save and reload forgets the list: things still waiting stay forbidden, as in vanilla.
- **How:** An unsaved list of thing, rule and, for a remembered weapon, its owner, with the `Game` it belongs to; a different `Current.Game` clears it. A postfix on `Map.MapPostTick` (Verse/Map.cs:966) returns at once while the list is empty. Otherwise, every 250 ticks for each map with entries: an entry whose thing is no longer spawned on that map leaves the list; a remembered weapon stays while `owner.mindState?.droppedWeapon == weapon`; if any other entry is left, it asks `GenHostility.AnyHostileActiveThreatToPlayer(map)` (RimWorld/GenHostility.cs:227-236), which skips downed pawns (Verse/Pawn.cs:4162-4172), sleeping, fleeing, dormant and fogged ones and hive defenders (GenHostility.cs:266-300, :311-334). With no threat, each of those entries whose rule is still on, still forbidden, still inside "Where" and matching the current filter is allowed, and all of them leave the list. Outside a scope and only while the list isn't empty, the recorder's postfix drops a thing whose flag changes. Removing a map drops its entries.
- An awake mech cluster or a siege camp keeps the list waiting until it is gone; a dormant cluster doesn't (`CompCanBeDormant`, GenHostility.cs:285-289).
- **Settings:** none; both gear rules and the corpse rules wait.
- **Tests:** With a hostile test pawn standing on the map, a raider killed with the enemy rule on leaves its rifle forbidden; after the hostile pawn is downed and 250 ticks pass, the rifle is allowed. A waiting rifle the player allows and forbids again stays forbidden at the end. A waiting rifle a pawn picks up leaves the list without a log line. A waiting rifle the filter no longer allows stays forbidden. Phase 2: a rifle still waiting at save time stays forbidden after the load, and nothing logs.
#### Stripping forbids what doesn't match
- **Players get:** Per rule, "Stripping forbids what doesn't match", off until you turn it on; the suggested enemy setup turns it on. Stripping one of the group's pawns or corpses then forbids each dropped thing the filter refuses, and the rest stays allowed, as vanilla leaves it. This is how the rules reach apparel: worn apparel never drops when a pawn goes down or dies, so a raider's duster reaches you through stripping. With the suggested enemy setup, a stripped Normal duster at 80% stays allowed and a Poor tuque is forbidden where it lands. Butchering strips too but stays vanilla, because what a butcher strips lands next to the bench, where a burn bill or a dumping stockpile can take it.
- **How:** A prefix on `Pawn.Strip(bool)` (Verse/Pawn.cs:3895), which a corpse's Strip calls (Verse/Corpse.cs:386-389), records the pawn's equipment, apparel and inventory in `__state`. The postfix, when the pawn's group has its strip switch on, forbids with `SetForbidden(true, warnOnFail: false)` each recorded thing now spawned on a map, inside "Where", that the filter refuses. A living pawn's group is read as in the gear rules. A corpse's pawn is destroyed, so its group comes from its faction alone: your faction (not a lodger) is your colony, a faction hostile to yours (`Faction.HostileTo(Faction.OfPlayer)`) is enemies, so a dead prisoner counts by the faction it came from.
- Butchering: a prefix and a finalizer on the private static `Toils_Recipe.CalculateIngredients(Job, Pawn)` (Verse.AI/Toils_Recipe.cs:301) set a `[ThreadStatic]` flag, and the strip postfix does nothing while it is set.
- In a caravan nothing lands (Pawn.cs:3898-3909), so nothing happens. A stripped inventory stack that merges into a stack on the ground keeps that stack's flag.
- **Save and removal:** the vanilla forbidden flag.
- **Overlaps:** Auto Strip on Haul (2560725133, 18,416, 1.7) strips corpses when they're hauled, through the vanilla strip code (its Workshop page), so its strips follow the switch, and its own option to forbid tainted apparel composes. Cremate Auto Strip (1575458517, 52,813, 1.7) strips before cremation; if its strip runs outside `CalculateIngredients`, it follows the switch, which a compat check settles for the README. Apparel Tainted Only When Corpse Rots (2413156320, 49,913, no 1.7) and Removes Tainted Clothes (2006356192, 22,391, no 1.7) change the tainted flag the filter reads. Non uno Pinata changes what stripping drops.
- **Replaces:** partly the tainted-apparel forbid of Auto Strip on Haul (18k).
- **Tests:** Enemy strip switch on, suggested setup: stripping a raider corpse wearing a Normal duster at 80% and a Poor tuque at 90% leaves the duster allowed and the tuque forbidden; with the switch off, both are allowed. The same corpse butchered at a butcher table with the switch on: both allowed. A colonist's corpse stripped with only the enemy switch on: both allowed. A raider stripped while down: its shirt isn't tainted and follows the filter. A strip inside a test caravan logs nothing.
#### Corpses outside the home area stay allowed
- **Players get:** Three switches, each off (vanilla) by default: "Animal corpses outside the home area are allowed", "Enemy corpses outside the home area are allowed" and "Other corpses outside the home area are allowed". Manhunters and predators count as animals. Haulers and butchers then see a hunt's or a raid's corpses without a click per body, once the fight is over.
- **How:** The game forbids a new corpse outside the home area unless a hunter reserved it or it was designated for hunting or slaughter (Verse/Pawn.cs:2132-2133, :2197-2204); the recorder catches that forbid inside the `Kill` scope. The `Kill` postfix allows the corpse when the switch for its kind is on, the first kind that fits deciding: animal (any `RaceProps.Animal`, your own, manhunters and predators hunting yours included, though the last two are in the enemies group through `HostileTo`, RimWorld/GenHostility.cs:130-137), then enemy (the group read in the prefix: hostile humanlikes, mechs and, with Anomaly, entities, which fail `RaceProps.Animal`), then other (everything else: your colony's humanlikes and mechs, neutral pawns, mechs that aren't hostile). It waits like the gear rules.
- Never patched: `ForbidUtility.SetForbidden` (RimWorld/ForbidUtility.cs:16), which player designators use too, and `SetForbiddenIfOutsideHomeArea` (:48), five lines that may be inlined.
- **Settings:** `animalCorpsesAllowed`, `enemyCorpsesAllowed` and `otherCorpsesAllowed`, all off, under `forbidRules`.
- **Save and removal:** the vanilla forbidden flag on each corpse.
- **Overlaps:** Allow Dead Animals (2403873031, 67,347, no 1.7) and the corpse half of KilledEnemyAutoAllowed (Continued); warned. Allow Tool is the manual way and composes.
- **Tests:** A wild animal killed outside the home area with the animal switch on: its corpse isn't forbidden; off, it is; a corpse a hunter reserved is unchanged. A raider killed outside the home area with the enemy switch on: not forbidden. A manhunter husky killed outside the home area with only the animal switch on: allowed; with only the enemy switch on: forbidden. A corpse inside the home area is never touched. With a hostile test pawn on the map, an enemy corpse waits and is allowed once the hostile pawn is downed.
- **Players get:** Per species, plus an "every animal" row, what a new animal starts with: allowed area by name (for example "Barn"), follow when drafted, follow during fieldwork, and which training is wanted. It applies once, when an animal joins: tamed, bought, a wanderer or quest animal, a starting animal. Born animals copy their mother (see below). Animals you already have never change. A young animal skips training it is still too small for (Haul needs body size 0.40, Rescue 0.65); "Load your default" in its Training tab adds it once it has grown.
- **How:** The join funnel from the data model.
-`Pawn.SetFaction` clears the area through `playerSettings.Notify_FactionChanged` (Verse/Pawn.cs:2766, RimWorld/Pawn_PlayerSettings.cs:336-340) and wants Tameness (Pawn.cs:2770). Both happen before our postfix.
- Filter: `RaceProps.Animal`, player faction, not dead or destroyed. Mutants and dryads are skipped. DLC: Anomaly entities fail `RaceProps.Animal` (Verse/RaceProperties.cs:265-275), mutants are caught by `Pawn.IsMutant` (Anomaly, Verse/Pawn.cs:662) and dryads by `RaceProps.Dryad` (Ideology, :279); without those DLCs the checks are false.
- States per field. Area: not set, no area, or a label. Follow when drafted and follow during fieldwork: not set, on or off. Training, per `TrainableDef`: not set, want, don't want, or leave alone. "Not set" falls through to the every-animal row, and from there to the game. "No area" and "leave alone" stop there and keep what the game gave the animal. "Make default" from an animal fills every field: its area's label (or no area), its two follow flags, and want or don't want for each trainable it can be assigned, leaving the others not set.
- Area: `map.areaManager.GetLabeled(label)` (Verse/AreaManager.cs:86) on `pawn.MapHeld`, when `Area.AssignableAsAllowed()` (Verse/Area.cs:115), written with `playerSettings.AreaRestrictionInPawnCurrentMap` (Pawn_PlayerSettings.cs:85-110). Skipped when `SupportsAllowedAreas` is false (:133-143: roamers and races with `disableAreaControl`). A label missing on that map leaves the area alone. An animal with no map yet (bought into a caravan or from an orbital trader) goes into the pending table, and a postfix on `Pawn.SpawnSetup` (Verse/Pawn.cs:1366) applies it on its first spawn that isn't `respawningAfterLoad`.
- Follow flags: `followDrafted` and `followFieldwork` (Pawn_PlayerSettings.cs:21-23).
- Training, read from `DefDatabase<TrainableDef>`, so modded trainables appear. Every "don't want" entry is applied before any "want" entry, because `SetWantedRecursive(td, false)` also un-wants everything that needs `td`, and wanting `td` also wants its prerequisites (RimWorld/Pawn_TrainingTracker.cs:199-217). Want: `training.SetWantedRecursive(td, true)`, only when `CanAssignToTrain(td).Accepted` (:95). Don't want: `SetWantedRecursive(td, false)`. Tameness is never turned off. Odyssey's six trainables (`[MayRequireOdyssey]`, RimWorld/TrainableDefOf.cs:12-28) show only when Odyssey loads them; a row naming one is kept and skipped without it. The edit window refuses a row that wants a trainable while its prerequisite is "don't want" (Release wanted, Obedience don't want) and says why.
- Size: `CanAssignToTrain` checks `td.minBodySize` against the pawn's current body size (:137, :152; Core `Trainables.xml:54` Rescue 0.65, `:74` Haul 0.40), so a juvenile or newborn fails it and the want is skipped. Defaults apply once and keep no state, so nothing re-applies when the animal grows; the backlog has the stateless way to do it.
- Castes guard: when Blax Castes with its read-only API is active (`CastesApi` version 1), `CastesApi.CasteIdOf(Pawn)` is bound by reflection, and a pawn with a caste is skipped (see "Works with the other Blax mods").
- **Save and removal:** vanilla fields (`Pawn_PlayerSettings.ExposeData`, :199; `Pawn_TrainingTracker.ExposeData`, :37). Pending entries aren't saved: an animal bought into a caravan that is saved and reloaded before it arrives lands unrestricted, as in vanilla.
- **Overlaps:** Animal Controls (2426119067, 57,471, no 1.7), Assign Animal Food (2520066544, 24,867, no 1.7), Auto Training (3475428845, 1,209, no 1.7), Better Pawn Control (1541460369, 227,579, no 1.7, `VouLT.BetterPawnControl`) and Better Pawn Control Forked (3724294345, 1,335, 1.7, `KyleMHB.BetterPawnControlForked`; both ids verified in Castes' Compat). Warned on the animal section. Blax Castes also postfixes `Pawn.SetFaction`; the two postfixes compose, Castes acting on humanlike pawns and Defaults on animals.
- **Replaces:** the joining-animal defaults of Animal Controls (57k) and Better Pawn Control (228k), partly; Auto Training (1.2k).
- **Tests:** Husky default: area "BlaxTestBarn", follow drafted on, Obedience and Release wanted. `RecruitUtility.Recruit(husky, Faction.OfPlayer, colonist)` on a wild husky: afterwards the area is BlaxTestBarn, followDrafted is true, and Obedience and Release are wanted. A trader husky bought through `PreTraded(PlayerBuys, ...)` gets the same. A label missing on the map leaves the area null without errors. A species without a row uses the every-animal row. Husky row with Obedience not set and the every-animal row with Obedience wanted: a new husky wants Obedience; with Obedience at leave alone instead, it doesn't. A row with Obedience don't want and Release want is refused by the editor; a row saved by hand that way gives a husky wanting both, whatever order the file lists them in, since wants go last and want their prerequisites. A wild husky pup of body size below 0.40 recruited with Haul wanted doesn't want Haul and logs nothing. A recruited human prisoner is untouched. With Ideology (skipped without), a `Dryad_Basic` generated with the player faction is untouched. A husky bought by a caravan off-map gets the area when it spawns on the home map. Phase 2: the values persist and the .rws contains no "BlaxDefaults" outside the meta block.
- **Risks:** a mod that sets animal areas after the join call returns (Animal Controls, Better Pawn Control) overwrites ours, hence the warnings.
- **Players get:** A calf or chick born to one of your animals copies its mother's training wishes and follow flags, and keeps her area as vanilla does. It copies only what it can be assigned itself: a newborn is too small for Haul or Rescue, and a crossbred young of another species skips what that species can't learn. A per-species switch "Born animals use this default instead" gives them the species default, area included.
- **How:** Births run inside the `Hediff_Pregnant.DoBirthSpawn` scope (Verse/Hediff_Pregnant.cs:157), which generates the pawn with the mother's faction and copies her area after spawning (:177), and the `CompHatcher.Hatch` scope (RimWorld/CompHatcher.cs:81), which copies `hatcheeParent`'s area (:101). The pawn is collected by the `GeneratePawn` postfix and applied when the scope ends, so it already has the area. The mother is the `mother` argument or the hatcher's `hatcheeParent`; with no mother (a found egg), the species default applies.
- Each copied wish goes through the newborn's own `CanAssignToTrain(td)` (RimWorld/Pawn_TrainingTracker.cs:95), which reads its own def and body size, and in the same order as the species default: un-wants first, then wants.
- Vanilla Expanded Framework (2023507013, 2,056,150, 1.7, active here) patches `DoBirthSpawn` in `VEF.AnimalBehaviours` and `VEF.AnimalGenes` and can change a crossbred offspring's kind (`ModifyCrossbreedKindDef` in its 1.7 `VEF.dll`). The check above uses the pawn that was actually born, so a different kind is handled.
- **Settings:** covered by `animalDefaults`; the per-species switch is off.
- **Replaces:** the newborn copy of Animal Controls (57k) and Assign Animal Food (25k).
- **Effort:** included in the feature above.
- **Tests:** A player husky with Obedience and Haul wanted and area "Pen": `DoBirthSpawn(mother, null)` gives a pup with Obedience wanted, Haul not wanted (too small) and area Pen. With the switch on, the pup gets BlaxTestBarn and the species training. `CompHatcher.Hatch` on a fertilized egg laid by a player hen copies the hen. -Compat: the same birth with VEF active logs nothing.
- **Players get:** A "Defaults" button in a tame animal's Training tab: "Make this husky's settings the default for new huskies" (its wanted training, follow flags and its area's name), "Make default for every new animal", "Load your default" (applies to this animal now, with the same size checks) and "Forget". The settings page lists species with Edit: a four-state box per trainable (not set, want, don't want, leave alone), a three-state box per follow flag (not set, on, off) and the area (not set, no area, or a name: a dropdown of the current map's areas in a game, free text in the main menu).
- **How:** A postfix on `ITab_Pawn_Training.FillTab` (RimWorld/ITab_Pawn_Training.cs:30) draws a 30 px button at (254, 0), right of the vanilla rename button at (220, 0, 30, 30) (RimWorld/TrainingCardUtility.cs:17-29).
- **Settings:** covered by `animalDefaults`.
- **Save and removal:** "Load your default" writes vanilla fields.
- **Tests:** The menu builder on a husky with Obedience wanted and area Pen stores Obedience as want and area "Pen"; "Load your default" on a second husky applies it.
- **Risks:** a mod that redraws the training card may cover the button; the settings page still works.
#### Auto-slaughter limits for new species and new maps
- **Players get:** A "Defaults" button in the vanilla auto-slaughter window: "Make this map's limits the default" and "Load the default onto this map" (asks first). The default also applies by itself, per species, the first time an animal of that species joins a map whose limits for it are untouched, and to every new colony map.
- **How:** Every map gets one `AutoSlaughterConfig` per tameable species when it is built, all unlimited (Verse/AutoSlaughterManager.cs:215-219, `TryPopulateMissingAnimals` :254-265; fields in Verse/AutoSlaughterConfig.cs:7-19), so the only "new species" moment is the first animal.
- Template per species: `maxTotal`, `maxMales`, `maxMalesYoung`, `maxFemales`, `maxFemalesYoung`, `allowSlaughterPregnant`, `allowSlaughterBonded`. Untouched means all five limits at -1 and both flags false.
- First animal: the join funnel's apply checks the config for `pawn.def` on `pawn.MapHeld`. If it is untouched and the map has no other player animal of that species, it copies the template, clears the `uiMax*Buffer` strings so the window shows the new numbers, and calls `Notify_ConfigChanged()`. A pawn with no map at that moment, bought into a caravan or from an orbital trader (RimWorld/TradeShip.cs:199-208: `PreTraded` runs before the drop pod), gets the check stored in its pending entry, and the `Pawn.SpawnSetup` postfix runs it on its first spawn that isn't `respawningAfterLoad`, on the map it lands on.
- New maps: a postfix on `MapGenerator.GenerateMap` (Verse/MapGenerator.cs:79) applies every species template to untouched configs when the map `IsPlayerHome` (Verse/Map.cs:354).
- Button: a postfix on `Dialog_AutoSlaughter.DoWindowContents` (RimWorld/Dialog_AutoSlaughter.cs:88) draws a 160 by 35 button at the bottom left, left of the close button; the window is 1050 by 600 (`:56`) and its tip text sits right of the close button.
- **Settings:** `slaughterDefaults` (on).
- **Save and removal:** the map's `autoSlaughterManager`, saved by vanilla.
- **Overlaps:** Colony Manager Redux (3310027356, 44,730, 1.7) sets culling targets itself; Improved Auto Slaughter (3378091537, 2,913, no 1.7), Better Auto Slaughter (2985501794, 2,029, no 1.7) and Auto Slaughter Plus (3825007923, 183, 1.7) change the slaughter rules. Warned; none of them is installed here.
- **Replaces:** nothing; no Workshop mod sets slaughter limits per species ahead of time. Asked for on Defaults' page (2026-01-26).
- **Tests:** Chicken template with max 10: the first player chicken on the test map sets the chicken config's maxTotal to 10; a second chicken doesn't apply it again; a config the player set to 5 stays at 5. A chicken bought from a test orbital trader through `TradeShip.GiveSoldThingToPlayer` has no map during `PreTraded`; once its drop pod opens on the test map, the chicken config's maxTotal is 10. A fresh `AutoSlaughterManager(map)` passed through the new-map apply takes the template. "Load the default onto this map" overwrites after the confirm.
- **Risks:** generating a full map in the headless suite is slow, hence the fresh manager instead of `GenerateMap`.
Needs Biotech. Without it the mech section of the settings page shows disabled with "Needs Biotech", its rows stay in the file, no hook acts on a mech and the gizmo never appears. Auto-repair, work mode, area and the gizmo share the mech row and the join funnel, so they ship together.
- **Players get:** On the settings page, per mech kind plus an "every mech" row: auto-repair not set, on or off. A new colony mech, gestated, hacked or given by a quest, starts with it. Work mode, area and a Defaults gizmo on mechs are the next feature and ship with this one.
- **How:** The join funnel, extended to `IsColonyMech` (Verse/Pawn.cs:794-808). Gestation runs inside the `Bill_ProductionMech.CreateProducts` scope (RimWorld/Bill_ProductionMech.cs:20-27). The write is `CompMechRepairable.autoRepair` (RimWorld/CompMechRepairable.cs:10). Resurrected mechs come back as the same pawn and keep their settings.
- DLC: every mech step checks `ModsConfig.BiotechActive` first. `IsColonyMech` checks it too (Verse/Pawn.cs:798), and the comp exists only with Biotech (`CompProperties_MechRepairable` on Core's `BaseMechanoid` with `MayRequire`, Core `Races_Mechanoid.xml:52`). The `CreateProducts` patch is applied in every combination and never runs without Biotech.
- **Settings:** `mechDefaults` (on).
- **Save and removal:** vanilla field `autoRepair` (CompMechRepairable.cs:31-34).
- **Overlaps:** Auto-repair On (3312319778, 61,014, no 1.7); warned.
- **Tests:** With Biotech (skipped without): with "Militor: auto-repair on", a militor generated with the player faction inside the `CreateProducts` scope helper has `autoRepair` true; a mech given through `SetFaction` gets the every-mech row's value. -NoDlc: a Scyther given the player faction through `SetFaction` is untouched by Defaults, and the Militor row stays in the file, in the mech section drawn disabled with "Needs Biotech", and is not counted as an inactive name.
- **Players get:** The mech rows of auto-repair gain the work mode of the control group a new mech joins and an allowed area by name, each not set or set. A gestated mech goes into a control group in that mode when one is free; a mechanitor's group 1 is never switched to another mode for it. A "Defaults" gizmo on a selected colony mech saves its kind's default from it: auto-repair, its group's work mode and its area's name.
- **How:**
- Gestation runs inside the `Bill_ProductionMech.CreateProducts` scope (RimWorld/Bill_ProductionMech.cs:20-27): it generates the mech (:24), then adds the overseer relation (:25), whose `OnRelationCreated` calls `AssignPawnControlGroup` with no work mode (RimWorld/PawnRelationWorker_Overseer.cs:7-18), which puts the mech in group 1, `controlGroups[0]` (RimWorld/Pawn_MechanitorTracker.cs:204). At the scope's end the mech has an overseer.
- Work mode: Defaults picks the target group itself before touching the mech, and doesn't call `AssignPawnControlGroup(mech, mode)`. That method takes the first group with the mode, else switches the first empty group to the mode, else uses group 1 (:185-200). Called after `UnassignPawnFromAnyControlGroup` (:209), it often finds group 1 empty, for example when the new mech is the mechanitor's first, so it would switch group 1 from Work to Escort, and every later mech without a mode lands in group 1 (:204).
- The target: the first group whose `WorkMode` is the wanted mode, group 1 included; else the first group above group 1 with no mechs other than this one (`MechsForReading`, RimWorld/MechanitorControlGroup.cs:31).
- Found: an empty target gets `SetWorkMode(mode)` (:84), then `target.Assign(mech)` (:74-82), which takes it out of its other groups, then `mechanitor.Notify_BandwidthChanged()` (Pawn_MechanitorTracker.cs:268).
- None found: the mech stays in group 1 and no group's mode changes.
- Only for new mechs, never on later reassignments. A mechlink gives two groups (Biotech `Hediffs_Mechanitor.xml:83`).
- Area: as for animals; mechs support areas unless their race sets `disableAreaControl`. Resurrected mechs come back as the same pawn and keep their settings.
- Gizmo: a postfix on `Pawn.GetGizmos` (Pawn.cs:3354) for colony mechs only, so never without Biotech (`IsColonyMech`, :798). Control groups come from the mechlink, also Biotech.
- **Settings:** covered by `mechDefaults`.
- **Save and removal:** vanilla fields: the mechanitor's control groups and the mech's area.
- **Overlaps:** the mech work modes of 1trickPwnyta's Defaults; warned. Mech Work Tab (3268299107, 89,072, 1.7) and Foldable Tabs (3845615729, 506, 1.7) draw these settings and write them only on clicks; they compose.
- **Replaces:** the mech defaults of 1trickPwnyta's Defaults.
- **Effort:** S + S + S.
- **Tests:** With Biotech (skipped without): a mechanitor fixture with two control groups, both empty, both in Work, and a Militor default of Escort. `Bill_ProductionMech.CreateProducts` on a gestator fixture with the mechanitor bound gives a militor in group 2, now set to Escort, while group 1 is still in Work. If that fixture is too heavy for the harness, the test makes the same two calls (generate with the player faction, add the overseer relation) inside the scope helper. With group 2 already holding a mech in Work, the next Escort militor stays in group 1 and group 1 stays in Work. With group 1 set to Escort by hand, the militor stays in group 1. A mech hacked or given by a quest through `SetFaction` gets its area. -NoDlc: with a saved Militor Escort row, the mech section reports "Needs Biotech", the row stays in the file, and nothing logs.
- **Risks:** a mod that reassigns mechs to groups on join overrides ours; none is installed.
- **Players get:** Per grower kind ("growing zone" and each plant grower: hydroponics basin, plant pot, VFE Farming planters), an ordered list of up to three crops, plus allow sowing and allow cutting for zones. A new zone or grower takes the first crop that can grow there right now; if none can, the game picks as before (potato, or toxipotato on polluted ground with Biotech). Right-click the vanilla "Set plant" button for "Make rice the default for new growing zones": rice moves to the top of the list, the other entries keep their order, and a fourth drops off. On a zone it also saves that zone's allow sowing and allow cutting. The settings page edits each kind with three crop dropdowns and, for zones, two checkboxes. A grower revived by Replace Stuff keeps its old crop.
- **How:**
- Zones: a postfix on `Designator_ZoneAdd_Growing.MakeNewZone` (RimWorld/Designator_ZoneAdd_Growing.cs:57) collects zones of the exact type `Zone_Growing` (custom zone subclasses are left alone) and sets `allowSow` and `allowCut` (RimWorld/Zone_Growing.cs:14, :16). A postfix on `Designator_ZoneAdd.DesignateMultiCell` (RimWorld/Designator_ZoneAdd.cs:104), with a finalizer that clears the list, picks the crop once the zones have cells. It calls `SetPlantDefToGrow` (Zone_Growing.cs:213) before anything reads `PlantDefToGrow`, whose getter otherwise fixes potato or toxipotato on first read (:24-42).
- "Can grow there": `PlantUtility.CanSowOnGrower(plant, grower)` (RimWorld/PlantUtility.cs:284: pollution and sow tags) and `Command_SetPlantToGrow.IsPlantAvailable(plant, map)` (Verse/Command_SetPlantToGrow.cs:166: research, permanent darkness, wild-only), the same checks the vanilla picker makes.
- DLC crops resolve only with their DLC: toxipotato is Biotech (`[MayRequireBiotech]`, RimWorld/ThingDefOf.cs:1249), nutrifungus Ideology. An entry that doesn't resolve is skipped like one that can't grow there. Without Biotech there is no pollution (`PollutionGrid.IsPolluted`, Verse/PollutionGrid.cs:62), so that part of the check always passes.
- Growers: the build scope's built hook, after spawn (the pollution check needs the cells). Two guards keep a crop the grower already got:
- the revival guard from the data model: Replace Stuff's revival sets the old plant after spawn for the exact class `Building_PlantGrower`, which can be the def's own default, so comparing with the default can't tell;
- the grower still has its def's own `defaultPlantToGrow` (RimWorld/BuildingProperties.cs:265, set in `Building_PlantGrower.PostMake`, RimWorld/Building_PlantGrower.cs:46-50). This keeps the plant Replace Stuff's new-thing replacement copies from the grower it replaces (its `NewThingFrame.cs`, the `IPlantToGrowSettable` replacement), unless that plant happens to be the new def's default.
- Right-click: a postfix on the `Gizmo.RightClickFloatMenuOptions` getter (Verse/Gizmo.cs:33) for `Command_SetPlantToGrow` instances, which don't override it. The kind comes from the command's `settable` (`Zone_Growing` or a grower def). The entry puts the selected plant first in the kind's list and removes it further down if it was there; with a zone selected, it copies the zone's `allowSow` and `allowCut`.
- Settings page: per kind, three dropdowns of plants whose `sowTags` contain "Ground" for zones or the grower def's `building.sowTag`, the def-level part of `CanSowOnGrower` (PlantUtility.cs:284-299), so they work from the main menu. Pollution, research and light are checked when a zone or grower is made.
- **Settings:** `growerDefaults` (on).
- **Save and removal:** vanilla fields (`Zone_Growing.ExposeData`, :53-59).
- **Overlaps:** Default Plant Selector (3843503101, 7, 1.7) and the plant type of 1trickPwnyta's Defaults; warned. Haul After Harvest (3834328825, 414, 1.7) and Prison Labor (1899474310, 174,954, 1.7) read growing zones and write no crop. The gravship path (`MoveableGrowZone`) sets its own crop and isn't reached.
- **Replaces:** Default Plant Selector (7) and the crop defaults of Defaults and Set my Defaults.
- **Tests:** With "growing zone: rice, then potato", a new zone on fertile soil grows rice; on soil rice can't use (a sow tag test with a hydroponics-only plant first in the list) it falls to the next entry; with no valid entry the getter still gives potato. A hydroponics basin built through a frame takes its list; one spawned directly keeps vanilla's crop. A zone drag that makes two zones sets both. With the zone list "rice, potato, corn", the right-click entry for strawberry on a zone with sowing off gives "strawberry, rice, potato" and allow sowing off; for potato it gives "potato, rice, corn". -NoDlc: with "growing zone: toxipotato, rice" a new zone grows rice and logs nothing. -Compat, with Replace Stuff: a hydroponics basin growing rice, its def's default, with the list "potato" first, destroyed with auto-rebuild on and rebuilt through the frame, still grows rice.
- **Players get:** The settings a new building starts with: hold open for doors, gather spot for tables, auto-rearm for traps, target temperature for heaters, coolers and other buildings with a thermostat, and lamp colour for lamps with a colour picker. Set per building, or once for every door, every lamp, or every heater or cooler; a building's own row wins field by field. A "Defaults" gizmo on a selected building: "Make these the defaults for new <building>" (copies every supported setting), "Make these the defaults for every door" (or lamp, or heater or cooler) where it is one, "Load your default" and "Forget". A rebuilt door, lamp, trap or table gets the default like a new one; a heater or cooler revived by Replace Stuff keeps its old target.
- **How:** Through the build scope.
- Before spawn (made hook): door hold-open, the protected `holdOpenInt` (RimWorld/Building_Door.cs:15, written with `AccessTools.FieldRefAccess`); gather spot, `CompGatherSpot.Active` (RimWorld/CompGatherSpot.cs:10); target temperature, `CompTempControl.TargetTemperature` (RimWorld/CompTempControl.cs:17-29), clamped to the props' `minTargetTemperature` and `maxTargetTemperature` (RimWorld/CompProperties_TempControl.cs:11, :13). Vanilla only sets the def default on first spawn while the value is still the -99999 placeholder (CompTempControl.cs:35-42), so ours stays. In Core and the installed DLCs only the heater and the cooler carry `CompProperties_TempControl` (Core `Buildings_Temperature.xml`); the vent (`Building_Vent`, :333-385) has only `CompProperties_Flickable` and no target, so it has nothing to default.
- After spawn (built hook): trap auto-rearm, the private `autoRearm` (RimWorld/Building_Trap.cs:11), which `SpawnSetup` sets from the home area (:69-76), written only where `CanSetAutoRearm` (:31) holds; lamp colour, `CompGlower.GlowColor` (Verse/CompGlower.cs:39-48) for `Props.colorPickerEnabled`, skipped when the frame carried a colour from Build copy (`Frame.glowerColorOverride`, RimWorld/Frame.cs:17, applied at :376-381).
- "Every" rows: `building:*door` for any `Building_Door` or subclass, `building:*lamp` for any def whose `CompProperties_Glower` has `colorPickerEnabled`, `building:*temperature` for any def with `CompProperties_TempControl`. Each field is set or not set; per field the building's own row wins, then the "every" row, then the game. "Make default" from a building fills every field of the row it saves.
- Replace Stuff's revival copies the target temperature for the exact classes `Building_Heater` and `Building_Cooler` after spawn, over ours (see the data model). It keeps no door, lamp, trap or table, so those get the default.
- Gizmo: a postfix on `Building.GetGizmos` (Verse/Building.cs:401) for player buildings whose def has at least one supported setting. Storage buildings use the tab button instead. Icon: a vanilla texture checked with `ContentFinder` at startup, with a text-only fallback. The menu acts once per click, even with several buildings selected.
- **Save and removal:** vanilla fields (`holdOpen` at Building_Door.cs:311, `autoRearm` at Building_Trap.cs:61, the comps' own data).
- **Overlaps:** No Default Gather Spot (2901774438, 8,402, no 1.7), Default White Lights (3784067674, 656, 1.7), Default Light Color (3773507545, 100, no 1.7), Always Auto-Rearm (3809500495, 67, 1.7) and the white-lights option of FrozenSnowFox Tweaks; warned. Dubs Central Heating (2619214952, 123,605, 1.7) declares its radiators' comp as `DubsCentralHeating.DBHCompTempControl` on a `CompProperties_TempControl` (its 1.7 `Defs/ThingDefs_Buildings/BuildingsE_Heating.xml`); `GetComp<CompTempControl>` finds it if it derives from `CompTempControl`, which the compat run checks, and the radiators then fall under "every heater or cooler". Doors from [DG]More Door Variants (3832293718, 24,182, 1.7) derive from `Building_Door` and fall under "every door".
- **Replaces:** No Default Gather Spot (8.4k), Default White Lights (656) through "every lamp", Default Light Color (100), Always Auto-Rearm (67), and the heater and cooler targets of 1trickPwnyta's Defaults.
- **Tests:** Door default hold open: a door completed through a frame has `HoldOpen` true, a door spawned directly false. Table default gather spot off: `CompGatherSpot.Active` false. Trap outside the home area with rearm on: `autoRearm` true. Heater at 18 C: 18 after spawn; a template of 60 is clamped to the def's maximum. A standing lamp with a colour gets it; a frame from Build copy with its own colour keeps that colour. "Every lamp: white" with no standing-lamp row: a standing lamp built through a frame is white; with a standing-lamp row set to blue, it is blue. "Every door: hold open" gives an autodoor built through a frame `HoldOpen` true. -Compat: a Dubs radiator built through a frame takes the "every heater or cooler" target, or the test logs that the comp isn't a `CompTempControl`; a [DG]More Door Variants door takes the "every door" value; with Replace Stuff, a heater set to 25 C, destroyed with auto-rebuild on and rebuilt through the frame, is at 25 C while the template says 18.
- **Risks:** a building that resets these settings in its own spawn code overwrites ours; the tests cover the vanilla classes.
## Works with the other Blax mods
- Package ids: `blax.slaves`, `blax.castes`, `blax.zones`, `blax.defaults`. No hard dependencies. Defaults lists no sibling in About.xml and no sibling lists Defaults, so the load order doesn't matter. Defaults offers no API in 1.x.
- Detection: one Compat helper, `ModLister.GetActiveModWithIdentifier(id, ignorePostfix: true)`. Sibling APIs are bound by reflection (`AccessTools.TypeByName`, `AccessTools.Method`) into cached delegates at startup; a missing sibling or method is a silent no-op.
- Ownership line for every Blax design doc: "Defaults: starting settings of vanilla stockpiles and growing zones, storage buildings, production bills, workbenches, buildings, animals and mechs, and what the game forbids when pawns go down, die or are stripped. It writes when something is made or joins, and through its opt-in forbid rules when a pawn goes down, dies or is stripped. It keeps nothing in the save."
Castes owns every humanlike player pawn: colonists, slaves and prisoners, their apparel, food, drug and reading policies, medical care, schedule, work priorities, weapon loadout, allowed area, hostility, self-tend, carried medicine, fire at will and prisoner interaction. Defaults never sets any of these, and stays out of the way in these ways:
- Pawn filter: the join funnel checks `RaceProps.Animal` or `IsColonyMech` first, so Defaults never writes to a humanlike pawn, with or without Castes. The forbid rules (1.1: `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip`) see any pawn, colonists and slaves included, but write only the forbidden flag on its corpse and on the things it drops or is stripped of, never a caste slot. Castes' join hooks filter the other way round on `RaceProps.Humanlike` (`JoinHooks.Watching` in blax-castes), so no pawn reaches both join funnels.
- Caste guard: when Castes' read-only API is active (`CastesApi` version 1, where `CasteIdOf` arrives), Defaults binds `CastesApi.CasteIdOf(Pawn)`, checks `Active`, and skips any animal or mech that has a caste. Today none can; the guard keeps Castes in charge if it ever adds animal or mech castes.
- Policies: Defaults never creates, edits or assigns an apparel, food, drug or reading policy and adds nothing to the four policy dialogs. Castes' starter castes still find the Slave outfit and Simple food by their starting labels.
- Medical care: Defaults never writes `PlaySettings` medical defaults or a pawn's medical care. Animal medical care stays with the vanilla "Default medical care" window.
- Areas: Castes' allowed area slot gives humanlike pawns an allowed area by name; Defaults gives animals and mechs one by name. Only Defaults' "Areas every new map starts with" (features.md, New maps) creates areas, the named ones both mods then find. Neither mod can pick one of Zones' work rule areas, which aren't vanilla areas (see "Blax Zones").
- Ownership: Zones owns sleeping spots, beds by zone, every friendly drop location and per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area.
- Of the zone designators, Defaults hooks only `Designator_ZoneAddStockpile` (since 1.0) and `Designator_ZoneAdd_Growing` (growing). Zones' delivery and sleeping zones subclass `Zone` and `Designator_ZoneAdd` directly and use their own tabs (`ITab_Delivery` for delivery zones, the animal-zone and people-zone tabs for sleeping zones), so no Defaults hook or button reaches them.
- Zones' "Receive deliveries", sell and direct-delivery flags live in Zones' MapComponent, keyed by zone ID and ThingID. "Make default" never reads or copies them, and a new stockpile starts unflagged, as Zones decides.
- Zones' own zone defaults stay in Zones: its backlog holds "Make default" for new delivery and sleeping zones.
- The forbid rules (1.1) act only inside `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip`, and the wait list holds only what they recorded there, so goods Zones delivers keep the forbid flag of the vanilla call.
- Zones' work rule areas compose with the forbid rules. A rule decides whether a dropped thing stays forbidden; Zones' "Don't haul from here" decides whether haulers fetch it, and "Haul first" brings it in before other hauling. So a Normal rifle allowed in a killbox painted "Don't haul from here" lies there until the player unticks the rule. "Only inside the home area" reads the vanilla home area (`map.areaManager.Home`), which work rule areas never change. Neither mod hooks the other's code.
- No overlap. Surgery bills, which Slaves keeps through status changes and uses for hemogen, are `Bill_Medical` and never touched. Trade, prices and slave medicine are Slaves'.
- The forbid rules (1.1) count slaves with your colony, rebelling ones included. Slaves forbids nothing and patches none of their methods. Its planned sedation relay downs a rebel with `HealthUtility.TryAnesthetize` (Verse/HealthUtility.cs:533-543), whose `AddHediff` reaches `MakeDowned` (Verse/Pawn_HealthTracker.cs:226, :237, :520, :577). With the colony rule on, the rebel's weapon is then a remembered weapon: it waits while the slave lies where it fell, and the colony rule decides once the slave is carried off.
### Blax Laws
Laws is designed on its branch `design/act-catalogue` and not accepted yet. Its package id would be `blax.laws`; Defaults would list it nowhere in About.xml.
- Lawbook templates across saves (Laws' backlog) live in Laws' own file under the game's Config folder, with the write, read-back and backup rules of Defaults' file copied as code. Defaults' file never holds a lawbook, and neither mod reads the other's file.
- Laws' subdue downs a pawn through `Pawn_HealthTracker.MakeDowned`, so with the colony rule on its weapon is a remembered weapon: it waits while the pawn lies where it fell, and the colony rule decides once the pawn is carried off. Laws never touches that weapon.
- An arrest drops the weapon and inventory inside `SetGuestStatus`, which the forbid rules don't see. Laws' "Release gives back what jail took" allows the weapon the arrest dropped again at the release. Neither mod hooks the other.
- When Laws' design is accepted, the ownership line and the Castes paragraph above take the Laws wording from Laws' "Sibling doc changes": Castes' prisoner interaction except the Maintain only and Release modes Laws sets on colonists it jailed.
- Patches are applied one class at a time from a `[StaticConstructorOnStartup]` class, logging "[Blax Defaults] N patches applied". One broken target doesn't take the others down.
- Every category has a ModSettings toggle, plus the master `enabled`.
- Tests: the headless in-game test mod from `blax-slaves/Tests` (BlaxSlavesTests harness, run-tests.ps1), copied in as `Tests/BlaxDefaultsTests` from Castes' copy, whose run-tests.ps1 already takes -NoDlc and -Dlc. Phase 1 runs in a quick-test colony, phase 2 after a save and reload. -Compat adds the installed mods Defaults is tested next to: RimFridge, Weapon Racks, Replace Stuff, Rimefeller, VFE Security, Vanilla Expanded Framework, Dubs Central Heating, [DG]More Door Variants, Pick Up And Haul, Haul to Stack, Prison Labor, Hospitality, plus Blax Castes (and Blax Zones once it has code). -NoDlc runs on the core game and -Dlc with a list loads only those installed DLCs; a release runs all 8 combinations of Royalty, Ideology and Biotech (see "DLC support"). The overlap mods aren't installed on the test machine; their detection is tested with an injected id.
### Sibling doc changes, when this design is accepted
- Done (2026-11-29), Castes `docs/design.md`: the backlog item "Animal and mech castes" becomes "Animals and mechs: Blax Defaults (per-species join defaults)"; the cut line about Defaults' non-pawn defaults gets "now Blax Defaults"; "Not supported for now" points animals and mechs to Blax Defaults; the package ids and the ownership list gain `blax.defaults` and the Defaults sentence above.
- Done (2026-11-29), Castes `docs/design.md`: "Works with the other Blax mods" names Defaults as a `CastesApi` version 1 consumer, "Defaults 1.2 reads `Active` and `CasteIdOf` (API version 1, Castes 1.1) to skip any animal or mech that has a caste", and the API's risk notes say the contract spans four repos.
- Castes UI labels, Scribe keys unchanged: the "Defaults" button above the Caste column becomes "On join" and the "Join defaults" window "Caste on join". Next to a mod called Blax Defaults, a "Defaults" button in Castes sends players to the wrong mod.
- Done (2026-11-29), Zones `docs/design.md`: the ownership line carries the Defaults sentence above, and the backlog carries "Make default for new delivery and sleeping zones, in Zones' own tabs, stored as names in Zones' own file (S)". The corpse and gear rules act only inside `Pawn.Kill` and `Pawn.DropAndForbidEverything` (since the forbid rework: `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip`), never on goods Zones delivers, so Zones' note that Defaults has no rule for arriving goods stays true.
- Done (2026-11-29), from the forbid rework: the ownership line in Castes `docs/design.md`, Zones `docs/design.md` and Slaves `docs/roadmap.md` takes the new wording above ("go down, die or are stripped").
- Done (2026-11-29), Castes `docs/design.md`: "Defaults 1.2 reads `Active` and `CasteIdOf`" becomes "Defaults 1.3", and its line on Defaults' forbid rules reads "see any pawn that goes down, dies or is stripped, colonists and slaves included, but write only the forbidden flag on the corpse and on the things it drops or is stripped of, never a caste slot".
- Done (2026-11-29), Zones `docs/design.md`: its Defaults notes name the new releases ("`Designator_ZoneAdd_Growing` (its 1.4)", "Defaults' build scope (its 1.2)") and read "Defaults' forbid rules (its 1.1) act only inside `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip`, never on goods Zones delivers". The rest of that note stays true: the recorder only records inside those calls, so drop pods and caravan goods keep the forbid flag of the vanilla call.
- Done (2026-11-29), after Zones' work rule areas (its 1.6): Castes `docs/design.md`, Zones `docs/design.md`, Slaves `docs/roadmap.md` and this doc carry the same Zones sentence ("per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area") and say "allowed area" for Castes' area slot. Slaves' package ids gain `blax.defaults`.
- Pending (2026-12-01), from the plan by area: Castes `docs/design.md`, its "Blax Defaults" section, "Defaults 1.3 reads `Active` and `CasteIdOf`" becomes "Defaults' animal and mech defaults read `Active` and `CasteIdOf`". Zones `docs/design.md`, its Blax Defaults note, "`Designator_ZoneAdd_Growing` (its 1.4)" becomes "(its growing area)" and "Defaults' build scope (its 1.2)" becomes "Defaults' build scope (with graves, mortars and other storage)". References to shipped releases (1.0, the forbid rules' 1.1) stay.
- Planned in features.md (New maps): areas every new map starts with, named and coloured (M): asked for on Defaults' page (2025-06-17, 2025-07-27). Created with `AreaManager.TryMakeNewAllowed` (Verse/AreaManager.cs:147) in a `MapGenerator.GenerateMap` postfix. Castes' allowed area slot and Defaults' animal areas then resolve on new maps.
- New colonies (M), waits for Fabian's call (features.md, "Open questions"): play settings (auto rebuild, auto home area, manual priorities, zone visibility) and the default medical care for tame animals, wildlife, entities and other factions' pawns, written once when a new game starts. Save Storyteller Settings (3744418945, 31,979, no 1.7) and New Game Plus (23k) show demand for new-game setup, but it pays off once per colony and our colonies run for years. It never carries the medical defaults for colonists, slaves, prisoners or ghouls, which are humanlike player pawns and Castes' side. Storyteller and world presets are cut.
- Planned in features.md (Buildings): Build copy carries bills and storage settings (S): vanilla copies stuff, style, precept and lamp colour only (RimWorld/BuildCopyCommandUtility.cs:11-14). Needs an unsaved link from the blueprint to the source building. Asked for in the Steam thread "Why does 'build copy' not copy the settings too?" (2021-10-10, https://steamcommunity.com/app/294100/discussions/0/3087772148447673742/).
- Planned in features.md (Animals, as "Young animals learn what they outgrew"): young animals get size-gated training when they grow (S): a postfix on `LifeStageWorker.Notify_LifeStageStarted` (called from `Pawn_AgeTracker.RecalculateLifeStageIndex`, Verse/Pawn_AgeTracker.cs:577) for player animals, skipped when the previous life stage is null, as it is on load. It wants each trainable the species default wants that the animal was too small for at the previous stage and can be assigned now. No saved state; it would reach animals that predate the default, so it needs its own switch.
- Preset Filtered Zones support (S): a reflection-guarded postfix on its `Designator_PresetZoneAdd.MakeNewZone`, keyed by its `PresetZoneType`, and its zones accepted by the storage tab button. Only worth it if the mod enters the list.
- Several named defaults per kind, picked from the Defaults menu (S): asked for on Defaults' page (2026-01-31).
- Control groups added later start in a work mode by group number (S): a postfix on the private `Pawn_MechanitorTracker.Notify_ControlGroupAmountMayChanged` (:217).
- Beds in a hospital room start as medical beds, refuel targets per building (S each).
- Export and import of the defaults file, to share it between players (S).
- Gravship-start shelves (Odyssey) as a setting, since one player wants them included and others don't; fishing zone defaults through `Designator_ZoneAdd_Fishing.MakeNewZone`. Neither DLC is installed here.
- Gear of neutral pawns who died or were carried off (S): a third forbid rule for visitors and traders, since nobody comes back for that gear. It would use the colony's remembered-weapon wait, so their gear stays vanilla while they lie where they fell.
- "Use this stockpile's filter for a forbid rule" in the storage tab's Defaults menu (S), for players whose stockpiles already say what they want to keep.
- A per-colony override ("this colony differs") and multiplayer, moved from the backlog on 2026-12-01: both need the active defaults in the save, and Defaults keeps nothing there. Multiplayer would also need a 1.7 build of the Multiplayer mod to test.
- Storyteller, difficulty, world seed and faction presets for new colonies (2026-12-01): a new-game screen tool, not a starting setting of something the player makes, and the bulk that made players find 1trickPwnyta's Defaults too big (Castes' Cut). Save Storyteller Settings (3744418945, 31,979, no 1.7) covers the storyteller part.
- Anything for colonists, slaves or prisoners: policies, medical care, schedule, work priorities, weapon loadout, hostility, self-tend, carried medicine, fire at will, area, prisoner interaction. Those are Castes'. Pregnancy approach and the starting xenotype are per-pawn humanlike settings too; if anyone builds them, Castes' DLC switches are the place. Baby feeding is stored per baby and per feeder, and Castes cut its baby autofeed slot.
- Policy contents and default policies (the starting sets, what a new policy allows): policies are save objects that castes reference, and Castes' caste templates across saves move policies between colonies as files.
- Editing defs at startup (`defaultStorageSettings`, `defaultPlantToGrow`, `defaultTargetTemperature`): it also hits ruins, map generation and trader stock, can't tell what the player built, breaks "Load the game's default", and must match across multiplayer clients.
- An animal food policy: 1.7 has none (`Pawn_FoodRestrictionTracker.Configurable` is humanlike only, RimWorld/Pawn_FoodRestrictionTracker.cs:34-44). Adding one is a system, not a default; Animal Controls does it.
- Per-animal slaughter, milking or shearing flags: vanilla has only per-map, per-species auto-slaughter limits.
- Re-applying defaults on load, on a timer, or to existing things when a default changes: it would fight hand changes. "Load your default" covers the explicit case.
- Bills on benches the player didn't build (ruins, outposts): the cook walks there.
- Surgery bill defaults: `Bill_Medical`, and Slaves keeps those bills through status changes.
- Patching `StorageSettings.SetFromPreset`, `Zone_Growing.SetPlantDefToGrow`, `BillStack.AddBill` or `ForbidUtility.SetForbiddenIfOutsideHomeArea`: one- to five-line methods the JIT may inline. Patching `ForbidUtility.SetForbidden`: player designators use it. The 1.1 recorder on the `CompForbiddable.Forbidden` setter only reads, and only inside a downing or a death.
- Forbid rules for neutral visitors, traders and quest lodgers: a downed visitor that gets up where it fell picks its weapon up again (Core `ThinkTreeDefs/Humanlike.xml:297-300`), and a downed trader drops wares that aren't yours (RimWorld/Pawn_TraderTracker.cs:17-37). One that is carried off or dies forgets its weapon (Verse/Pawn.cs:2418); that gear is the backlog's third rule.
- Forbidding drops the game leaves allowed (inventory inside the home area, what your pawns were hauling): the rules only take back the game's forbids. The strip switch is the one opt-in exception, because stripping allows everything.
- Keeping gear on downed or dead pawns, as Non uno Pinata does: it changes what drops, not what gets forbidden, and needs prefixes that skip vanilla code.
- Separate filters per kind of thing inside a group (one for weapons, one for food): the hit points and quality ranges only bite items that have them, and dropped food leaves the inventory as it went in, so one filter per group covers "good weapons, all food".
- Allowing a downed colonist's weapon while the colonist lies where it fell: once a hauler moves the weapon, the colonist forgets it (Verse.AI/Pawn_MindState.cs:557-560) and gets up unarmed. A colonist that is carried away has already forgotten it (Verse/Pawn.cs:2418), so the rule decides it then.