[1.3] Pawn Rules (v1.5.0): Disallow Foods, Relationships and More

Started by Jaxe, August 05, 2018, 12:38:08 PM

Previous topic - Next topic


Pawn Rules
Version 1.5.0

Built for RimWorld 1.3
Powered by Harmony
Available on Steam Workshop

Tired of feeding your prisoners Lavish Meals?
Need your animal handlers to stop bonding with livestock?
Want a colonist to avoid getting a new lover?
Have a worker on construction duty but shouldn't be building artistic furniture?

Then try out:

Pawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.

Currently the following rules can be applied:

  • Disallow certain foods
        Ignored if binging on food or optionally if malnourished or training an animal
  • Disallow bonding with certain animals
        This has no effect on existing bonds
  • Disallow new romances
        This has no effect on existing relations and engaged couples can still get married
  • Disallow constructing items that have a quality level
        Can still haul materials to blueprints

Any of these rules can be disabled and hidden from the rules window.

Supports addons created by other modders by allowing easy creation of new rule options while handling the GUI and world storage saving. Check out the wiki on addons.

This mod can be added or removed from a savegame at any time without issue.

Go to the Steam Workshop page and subscribe to the mod.

Download the latest release and unzip it into your RimWorld\Mods folder.

Link to final B19 release

This mod can be safely removed from a save without breaking the game. To do so go to Global Options from the main rules window for a character and select Remove Mod.
A save of your world will be made with no traces of this mod and the game will restart. Skipping the Remove Mod step will result in errors being displayed the first time a save is loaded although no further problems should occur.

For translators: Instead of including other languages with this mod, I would prefer and welcome translators to upload and maintain a language submod. If any translator would like the logo and art assets for this mod please contact me on Discord.


v0.2 uploaded. Fixed food rules not applying for packing food.


Looks like a good one- I had pawns feeding animals fine meals, can this prevent that as well?
(regarding dead man's apparel)
"I think, at the very least, the buff should go away for jackets so long as you're wearing the former owner's skin as a shirt."


compatible with vegetable garden and it's new meals that count as fine and lavish? Can you select prisoners (to forbid raw food but alout simple meals?)


Updated to v0.3 - Fixed rules showing up for non-colonists, prisoners or faction animals

Quote from: Crow_T on August 05, 2018, 03:51:16 PM
Looks like a good one- I had pawns feeding animals fine meals, can this prevent that as well?
Animals can have a food rules preset set for them. You could make a preset that only allowed kibble then assign it to a chicken and it should stop pawns getting anything other than kibble for them. You would have to set a food preset for each chicken you have although you could set a default for animals to the kibble preset and it would apply for all new animals you get.
I plan to make babies of animals inherit the rules of their parent in the next version.

Quote from: ultra4 on August 05, 2018, 07:45:38 PM
compatible with vegetable garden and it's new meals that count as fine and lavish? Can you select prisoners (to forbid raw food but alout simple meals?)
when Pawn Rules builds the food list it scans all things registered as having a nutritional value so it will likely spot other mods foods. In regards to prisoners being forbidden raw food, the answer is yes you can pick exactly what foods a prisoner would be allowed, again the food list should show every single food type in the game and allow you to disable them individually. Prisoners (or colonists/animals/guests for that matter) can be assigned rules individually or as a default.



Quote from: Canute on August 06, 2018, 02:07:00 AMwith your update speed you should maybe think about to add Modsync support.

Thanks will do. Already added it to the master in github but will only be active when I put the next release out (unless people want to manually add the new Modsync.xml file to the mod's About folder until then)


v0.4 released

- Added ModSync RW support
- Animals should now inherit their mother's rules
- Fixed null reference when quitting to main menu
- General code tidying


Oh wow. Yeah, another mandatory mod for me when I update to 1.0!!
I'll shoot your colonists...After a long nap.


Great mod love it!!!

seems this mod and prepare carefully aren't getting along?
Exception filling window for RimWorld.Page_ConfigureStartingPawns: System.NullReferenceException: Object reference not set to an instance of an object
at PawnRules.Data.Global.get_Rules () <IL 0x00005, 0x0000b>
at PawnRules.Data.Global.DeleteRules (Verse.Pawn) <IL 0x00000, 0x0000a>
at PawnRules.Patch.Verse_Pawn_Kill.Postfix (Verse.Pawn) <IL 0x00009, 0x0001b>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <IL 0x0072d, 0x012ab>
at EdB.PrepareCarefully.RelationshipManager.CreateNewTemmporaryPawn (Verse.Gender) <IL 0x0006d, 0x00211>
at EdB.PrepareCarefully.RelationshipManager..ctor (System.Collections.Generic.List`1<Verse.Pawn>,System.Collections.Generic.List`1<EdB.PrepareCarefully.CustomPawn>) <IL 0x000a5, 0x001bd>
at EdB.PrepareCarefully.PrepareCarefully.InitializeRelationshipManager (System.Collections.Generic.List`1<EdB.PrepareCarefully.CustomPawn>) <IL 0x00057, 0x000ef>
at EdB.PrepareCarefully.PrepareCarefully.Initialize () <IL 0x00023, 0x00044>
at EdB.PrepareCarefully.HarmonyPatches.DoWindowContentsPostfix (UnityEngine.Rect,RimWorld.Page_ConfigureStartingPawns) <IL 0x0006c, 0x00171>
at (wrapper dynamic-method) RimWorld.Page_ConfigureStartingPawns.DoWindowContents_Patch1 (object,UnityEngine.Rect) <IL 0x000be, 0x0052b>
at Verse.Window/<WindowOnGUI>c__AnonStorey0.<>m__0 (int) [0x00223] in C:\Dev\RimWorld\Assets\Scripts\Verse\UI\Windows\Window.cs:202

Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32) (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\Windows\Window.cs:206)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUI.cs:1817)

Edit: works fine if I add Pawn Rules into my modlist after starting a game with Prepare Carefully


Thanks for feedback. I just tested with Prepare Carefully and was able to start a game without any issues. I tried adding and removing characters in the preparation dialog and still no errors. Could you provide some steps that I could reproduce the error?

Edit: Ah I found it. It happens when the prepared characters are related to each other in some way. I'll work on fixing that.


You... I like you.
Thanks for this! I know it's something a lot of people have been asking about. Would you be interested in a spotlight video when you're at a later revision?


I've been waiting for a mod like this for ages now. Can't wait to try it out.

Thank you!


Released v0.5

- Fixed incompability with PrepareCarefully (actually this bug was unrelated and hopefully fixed other potential issues)
- Countless other tweaks, this is quite a large update
- Main Feature: Supports addons created by other modders to add new options to rules window.

Quote from: Navy1227 on August 07, 2018, 03:51:45 AM
Would you be interested in a spotlight video when you're at a later revision?
That sounds great, I'm getting closer to not calling it a beta build, just hoping to hear a little more feedback first.