RimWorld

RimWorld

25 ratings
Simple Non Humanlike Pawn Control
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5
File Size
Posted
Updated
1.153 MB
18 Apr @ 12:44am
17 May @ 9:22am
5 Change Notes ( view )

Subscribe to download
Simple Non Humanlike Pawn Control

Description
Simple Pawn Control Framework

Custom control system for non-humanlike pawns.
This mod enables drafting, equipping, and work tab logic for any animal, mechanoid, mutant, or custom-defined race.




🔧 How to Use (Players)

1. Click the new Pawn Control button in main tab.
2. Select a race type (e.g. Animal, Mechanoid, ToolUser).
3. Pick a race from the dropdown (e.g. muffalo, dryad, etc.).
4. Apply one of the preset tags from the right panel.
5. Done - now save game and reload and your selected pawns now show up in Work tab, can be drafted, and follow custom job trees.

✅ Draft controller included
✅ Compatible with gear / weapon pickup
✅ Fully XML-based preset system
✅ Dynamic injection; no patch clutter




⚙️ For Modders

This mod provides a modular framework for defining pawn work capability, skill simulation, draftability, and AI behavior via XML extensions.

---

1. Define a Mod Extension

Attach this extension to any `ThingDef` with a `race` element:

<modExtensions> <li Class="emitbreaker.PawnControl.NonHumanlikePawnControlExtension"> <!-- Enable work --> <tags> <li>AllowWork_Construction</li> <li>AllowWork_Hauling</li> <li>BlockWork_Research</li> </tags> ``` <!-- Skill Simulation --> <baseSkillLevelOverride>5</baseSkillLevelOverride> <skillLevelAnimalAdvanced>8</skillLevelAnimalAdvanced> <injectedSkills> <li><skill>Plants</skill><level>10</level></li> </injectedSkills> <injectedPassions> <li><skill>Plants</skill><passion>Major</passion></li> </injectedPassions> <!-- Enable combat & gear --> <forceDraftable>true</forceDraftable> <forceEquipWeapon>true</forceEquipWeapon> <!-- Optional ThinkTree override --> <mainWorkThinkTreeDefName>PawnControl_ForceAnimalToHumanlike</mainWorkThinkTreeDefName> ``` </li> </modExtensions>




2. Work Tags

Supported tags follow a naming pattern. Examples:

  • AllowWork_Construction\
    – enables construction jobs
  • AllowWork_Hunting\
    – enables hunting
  • BlockWork_Research\
    – disables all research-related jobgivers
  • AllowAllWork
    – enable every supported WorkType




3. Runtime APIs

This mod injects:

  • Draft controller via Pawn.drafter
  • Equipment / Apparel / Inventory trackers if missing
  • Pawn\_SkillTracker if work is allowed
  • Work tab visibility, WorkSettings, and ThinkTree assignments
  • Optional override for RaceProperties.Animal or IsMechanoid classification

You can control ThinkTree injection using:

<mainWorkThinkTreeDefName>PawnControl_ForceAnimalToHumanlike</mainWorkThinkTreeDefName>




4. Example Usage

Want your dryad to haul, fight, and wear armor?

Just define:

<forceDraftable>true</forceDraftable> <forceEquipWeapon>true</forceEquipWeapon> <forceWearApparel>true</forceWearApparel> <tags> <li>AllowWork_Hauling</li> <li>AllowWork_Cleaning</li> <li>AllowWork_Firefight</li> </tags>

And it will behave like a pawn with those capabilities — showing up in WorkTab and accepting player orders.




🔗 Compatibility

Compatible with:

  • Combat Extended
  • Vanilla Expanded Framework
  • Vehicle Framework
  • Humanoid Alien Races (HAR)
  • Work Tab, Numbers, Drafting Mods
  • Multi-pawn think trees

No core files overwritten. Supports safe hot-load if extension is defined before first spawn.




🧪 Debugging Tools

Enable developer mode for:

  • Log: cache resets, pawn injection
  • Validation for ThinkTree, Skills, Tags
  • Status panel in PresetManager




📁 Preset Manager (Advanced)

The in-game Preset Manager tool supports:

  • Injecting presets without XML edits
  • Saving runtime changes
  • Reverting presets per race
  • Dynamic preview of injected tags

Everything is handled through runtime-safe XML-compatible mod extensions. No patching required.




📜 License & Usage

MIT License.
Feel free to bundle, fork, or adapt for your faction mod, as long as credit is given.

📜 Contribution
Myself: Architecture design, base code development, code review and validation
ChatGPT: Framing and translation. Simplifying codes. Adding summary for other modders to understand how do codes work. Image generation (for thumbnail of this mod)
Claude 3.7 (GitHub Copilot): On IDE code development and refactoring. Debugging.
21 Comments
emitbreaker  [author] 13 Jul @ 3:19am 
@Cotton I'm currently refactoring entire code to align with 1.6. Will check and fix it for 1.5 as well.
Cotton 13 Jul @ 12:18am 
I should also add that I'm using 1.5
Cotton 13 Jul @ 12:18am 
My mechanoids wouldn't auto attack while drafted, it doesn't produce any errors either. But when I removed the mod they worked again. Any idea what i can do to fix it?
emitbreaker  [author] 6 Jun @ 4:01am 
@Dinomyte Sorry for my belated response - would you please give me a little context?
Dinomyte 28 May @ 11:50pm 
mine arent showing up in the work tab :c
emitbreaker  [author] 17 May @ 9:24am 
Updated: Architecture overhauled for 3 to 4 times past 2.5 weeks - so you will see the redlines for the first time you load this updated version. However, it won't damage your save file since I've tested them already.

See above updated description for the details how this new architecture works.

One big change is in game Pawn Preset Manager - now players can apply preset to the in game pawns - it stands for only within a specific save. However, deinjection may still remain some dead weights.
emitbreaker  [author] 6 May @ 11:57am 
Updated:
1. 15 more JobGivers updated. Now AllowWork_Handling fully works for non humanlike pawns.
2. ForceDraftable now works as intended. Now you could see the Draft gizmo if mod extension has forceDraftable == true.
3. ForceEquipWeapon added. Now you can allow Non Humanlike pawns wear weapons by right clicking over item. No function for Apparel implemented yet.
emitbreaker  [author] 5 May @ 12:05pm 
Also, you can find GitHub repository of this mod's assembly from the link at the bottom of mod descriptions.
emitbreaker  [author] 5 May @ 12:01pm 
Also, AllowWork_Firefighter has it's own JobGiver, but there is issue with Verb injection to pawn so I'm not recommend to use the function yet.

This update won't corrupt your save, yet you may see one time red lines as well as some Obsolete related warnings.
emitbreaker  [author] 5 May @ 12:01pm 
@All Completely revised architecture - now virtual mod extension injection function temporarily ripped off, as well as tag management function. It took stupid long time for me to understand how does rimworld job creating > reserving > assignment works.

Now, I fully created separated think tree, with think tree replace and ensure function, as well as custom JobGivers that replacing vanilla WorkGiver / JobDriver combination, in consideration with performance and compatibility.

Currently, force animal and AllowWork_BasicWorker, AllowWork_Warden, AllowWork_Growing, AllowWork_PlantCutting, AllowWork_Hauling, AllowWork_Cleaning fully functional with custom jobgivers. However, there could be potential glitches for Warden, which isn't fully tested yet.