RimWorld

RimWorld

267 ratings
Hair Modding Plus (continued)
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5
File Size
Posted
Updated
6.705 MB
Mar 16, 2023 @ 2:31am
Sep 14, 2024 @ 2:28pm
15 Change Notes ( view )

Subscribe to download
Hair Modding Plus (continued)

Description
Original mod (Dont use together!): https://steamcommunity.com/sharedfiles/filedetails/?id=2114832515

Hair Modding Plus
by Butterfish and Shashlichnik

For those of us that play RimWorld like The Sims, but with more equal amounts of murder.


Download
GitHub: https://github.com/MaxDorob/HairModdingPlus-1.4
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=2947607004


Description
TLDR: This mod gives modders the ability to have a hair texture render behind a pawn, as well as use alpha masks on hair, without additional fiddling with XML.

If you've made/tried to make a hair mod, you'll likely realize that RimWorld just slaps the texture on top of the pawn, colors the entire thing, and calls it a day.
This mod gives modders an additional hair layer to work with that renders behind the pawn. So you'll be able to make, for example, long hair that flows down the back, without having to tailor-make it for one/each body type or make design compromises.
In addition, this mod also enables the use of alpha masks on hair, so you can make hair with decorations/accessories that can be colored separately in-game.
What's more, you don't even have to add more information to your HairDef XML, just provide the textures and you're done.

(Since 1.5 hair mask is part of Rimworld. Just add <overrideShaderTypeDef>CutoutComplex</overrideShaderTypeDef> to your HairDef)

Hair that actually fits all [raw.githubusercontent.com]

Note: This mod will not magically convert existing hair to work as above. You'll have to get hair from other mods that utilize this mod. Below are a few examples of such hair mods:
Note 2: Gradient hair shown above is from Gradient Hair.


Dependencies
You'll need Harmony to use this mod. Get it at GitHub[github.com] or Steam.


Compatibility
1.4 Should be compatible with most mods, unless they skip RenderPawnInternal or ResolveAllGraphics.
Can't imagine anything that would break 1.5 version

Patched to be compatible with (not sure about 1.5):
  • Prepare Carefully
  • Gradient Hair
  • Babies And Children 1.2 by CentAtMoney
  • Babies And Children 1.3 by cometopapa
  • Show Hair With Hats or Hide All Hats
  • Hats Display Selection
  • Humanoid Alien Races 2.0, but needs more testing
  • Children and Pregnancy 1.2 (not yet updated for 1.3 at time of writing)
  • Facial Stuff (not updated since 1.1, your mileage may vary)
Secondary hair color is selectable with Prepare Carefully (select "Hair Color 2" from the dropdown).

Safe to add or remove from existing saves.


Known 1.4 Issues
Semi-transparent portions of hair might appear significantly more transparent or significantly less transparent due to shader issues. This may cause certain hairstyles that rely on it (e.g. shaved hair) to appear wrong. No fix is possible at the moment.


How to Use (1.4)
Note: The instructions below assume you already know how to make a regular hair mod.
If you're interested in making a hair mod and don't know where to start, check this guide out for more information.

Back Hair Layer(1.5)
To have a texture render behind the pawn, simply add "_back" between texture name and direction, like a "demo_back_south.png" ("demo_back_southm.png" for optional mask).

Back Hair Layer(1.4)
To have a texture render behind the pawn, simply add "_back" to the end of your texture's file name.
Example[raw.githubusercontent.com]

"demo_south.png" is your regular texture displayed when the pawn faces south, and "demo_south_back.png" is the texture that will be behind the pawn when the pawn faces south. This works the same for the other orientations, e.g. "demo_east.png" and "demo_east_back.png". Back textures are optional, textures without a corresponding "_back.png" will display as they usually would.

West or east back textures will NOT be automatically flipped if only one is provided. This is intentional, to allow modders to make asymmetrical hairs if they wish. To have a back texture be used for both east and west sides, just make a copy of it and rename the copy accordingly i.e "name_east_back.png" and "name_west_back.png".

Alpha Masks (1.5)
Since 1.5 there's ability to change hair Shader with overrideShaderTypeDef node of HairDef. Simply set it to <overrideShaderTypeDef>CutoutComplex</overrideShaderTypeDef> and name your mask same way as texture but with m on end, i.e. "name_eastm.png"

Alpha Masks (1.4)
For more information on alpha masks, check this guide[github.com] out.

To apply an alpha mask to a hair texture, simply add "m" to the end of your mask's file name. This works for both front textures and back textures.
Areas marked red (#FF0000) will be painted with the primary color, areas marked green (#00FF00) will be painted with the secondary color, and areas marked black (#000000) will not be painted.
Example[raw.githubusercontent.com]

"demo_southm.png" is the mask that will be applied to "demo_south.png", and "demo_south_backm.png" will be applied to "demo_south_back.png". Masks are optional, textures without a corresponding "m.png" will display as they usually would.

West or east masks will NOT be automatically flipped if only one is provided. This is intentional, to allow modders to make asymmetrical hairs if they wish. To have a mask be used for both east and west sides, just make a copy of it and rename the copy accordingly i.e "name_eastm.png" and "name_westm.png".


Examples
Download the demo hair mod from a source below to see working examples (includes the hair shown above):
Github: https://github.com/TheButterfish/HairModdingPlus/blob/master/ButterfishHairModdingPlusHairSamples.zip
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=2324262910
or try out one of the mods mentioned under Description above.


Licensing
If you wish to improve, fork, add patches, borrow code snippets, include in a modpack, or take over if I go on hiatus, go ahead. Just mention me in the credits and you're good to go.


Credits
Andreas Pardeike, for creating Harmony
Killface, for a code snippet I borrowed from his Facial Stuff mod
sumghai, for contributing some hair samples for the demo mod
The various contributors to the RimWorld modding wiki
4288, for helping me host this mod on Steam
Tynan Sylvester, for stealing my time and money creating RimWorld
Butterfish for this mod
97 Comments
InvitedRhino683 Apr 20 @ 6:50pm 
is this compatible with character / pawn editor ?
Шашлычник ;р  [author] Feb 26 @ 7:42pm 
Will think about it
Archilyte Feb 26 @ 6:05am 
hey! idk if you're updating this still, but if u are, may i suggest hiding the back hair layer when pawn is sleeping on a bed? (specifically if that bed auto hides body, which is almost all beds,only ones i can think of that doesnt do that are sleeping spots and those slab beds from alpha memes or some other mod)
Шашлычник ;р  [author] Dec 22, 2024 @ 2:16am 
Everything works correct for me.
Make sure that HAR loaded before this mod
keko bleibt keko Dec 21, 2024 @ 11:22am 
The mod does not function correctly when HAR is loaded, the hairs from Roo's HD Royalty Hairstyles with colorable extras are just transparent, with only the outlines visible.
Tested with only this, the hair mod and HAR loaded. Removing HAR makes everything work again.
Deebs Aug 24, 2024 @ 2:15pm 
That makes complete sense, thank you.
Шашлычник ;р  [author] Aug 24, 2024 @ 2:04pm 
There's no auto-flip cuz there may be no back layer for the west or east.
Deebs Aug 24, 2024 @ 11:49am 
Something I've noticed while working with this mod- 'back' files won't automatically flip, so if you have hair_east_back but no hair_west_back, it won't automatically flip the east to west.

I'm also not certain how Rimworld layers pawn images, but I've noticed that the head on north view overlaps the body- this would make sense for the hair, but for the head graphic itself, I'm unsure. I wonder if the addition of a 'top' layer can help with that, where the head/hair graphic can be placed in the usual layer order and then a 'top' layer can go over back items as needed/expected.

Speaking of which, I've been naming the hypothetical top overlapping layers for hair _top for now, for whenever that feature may be added. I again deeply appreciate that you're considering adding that to this mod.

Otherwise, this mod has been a joy to work with and it really makes hairstyles look SO much more alive! Thank you so much for upkeeping and keeping this mod alive!
Deebs Aug 22, 2024 @ 1:17pm 
@Шашлычник ;р I'm working on some new/default replacement hairs and I'd love if that feature was part of it!

What I'd like is if the 'top' layer could cover biotec ear pieces, so they could cover ears entirely or just show partial. I think it would open up a lot of options for some lovely hair styles.

Thank you so much for be willing to add that feature, I'm sure it'll be helpful to more than just me :)
Шашлычник ;р  [author] Aug 22, 2024 @ 1:17am 
@Deebs, I can do that. Is it needed for your mod?