RimWorld

RimWorld

[CAT] Show Hair With Hats or Hide All Hats
Nero Cross 26 Feb, 2023 @ 5:46pm
Having 'Eyes' Troubles
Hey there, a bit of an issue I've been having, seems to not be a bug but rather be an oversight stemming from some of Ludeon's changes regarding certain items' rendering categories.

The short version: For whatever reason, it seems as though things using 1.3's 'Eyes' bodypartgroup aren't inheriting the effects of this mod properly, and render functions specified in their xmls are breaking with this installed.

A bit more detail: I've been using the XML function of "<forceRenderUnderHair>true</forceRenderUnderHair>" on one of my projects to create eyewear that sets naturally on the pawn's face and has any front hanging hair render over the eyewear, as well as other little tricks like hiding aspects of headwear that would in reality be hidden away by hair falling over it, such as the straps of an eyepatch.

It works like a charm in my mostly vanilla test environment, but when tested on a game with Show Hair installed, it seems to break the function and force everything to render over hair, even if the 'Force Over Hair' mod setting is swapped to 'Normal'.

At first, I thought it may just be a hard conflict in how this mod was written, but I then tested the same function on a 'full head' piece of head gear, and it worked like expected and rendered under hair properly, so long as the 'Normal' flag was checked in the mod menu. So, the issue seems to just be related to headgear that uses the 'Eyes' group.

I appreciate any insight or assistance you can offer regarding this.
< >
Showing 1-4 of 4 comments
Nero Cross 28 Feb, 2023 @ 5:51pm 
Did some sleuthing and found a workaround.

For anyone else that may happen to run into this issue, all one needs to do is add: [defName="Eyes"] as another entry in the BodyPartGroupDef_Patch, and set the IsHeadDef to 'true' and the head coverage to 1. Make sure you also place [defName="Eyes"] in the inverse "not" operation at the start, so the new entry isn't overridden by that, and voila, anything that uses the Eyes section should now properly inherit the same behaviors as regular headgear.
cat2002  [developer] 2 Mar, 2023 @ 6:10pm 
So just to be clear, the issue is with eyewear, such as glasses being rendered over the hair?
Could you give me an example of an item with this issue?
Nero Cross 2 Mar, 2023 @ 6:31pm 
https://ibb.co/JHmv0hg
Here's what I was working on at the time when I noticed this.
From what I've gathered, the issue is that since the BodyPartGroupDef_Patch opens by flagging anything that doesn't use UpperHead, FullHead, or Teeth as not being headgear, headgear related XML functions like <forceRenderUnderHair>true</forceRenderUnderHair> stop working on things that aren't one of those three whitelisted bodypartgroups.

When I added Eyes as a fourth entry, everything started working as intended.
Last edited by Nero Cross; 2 Mar, 2023 @ 6:32pm
Nero Cross 2 Mar, 2023 @ 7:30pm 
In terms of something you can replicate and see with your own eyes, you'll have to do a little editing, as I'm not aware of any other mod released that is currently using <forceRenderUnderHair> for eyewear, but you can manually force it to get an ingame example.

With the Vanilla Apparel Expanded glasses, for example, you'd have to open their Headgear_Industrial.xml, and set the Glasses' entry to have <hatRenderedFrontOfFace>false</hatRenderedFrontOfFace> and <forceRenderUnderHair>true</forceRenderUnderHair>.

With those flagged properly, the behavior in an otherwise vanilla game without Show Hair installed should force the glasses to render under hair.

When Show Hair is installed with its current settings, the rendering will be forced over the hair, regardless of whether or not "Force Over Hair" or "Normal" is selected in the mod settings.

Now, with BodyPartGroupDef_Patch edited to whitelist Eyes as a group, the rendering should now work properly, with the Glasses rendering over hair if "Force Over Hair" is selected, and under if "Normal" is selected.

Here's some screenshots of the test I quickly threw together: https://ibb.co/FqVjVcd
< >
Showing 1-4 of 4 comments
Per page: 1530 50