Ludeon Forums

Ludeon Forums

  • October 13, 2019, 07:06:30 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 6

Author Topic: [1.0] Don't Shave Your Head! - v1.0.0  (Read 32954 times)

Dark_Inquisitor

  • Drifter
  • **
  • Posts: 95
  • Why not?
    • View Profile
[1.0] Don't Shave Your Head! - v1.0.0
« on: November 03, 2017, 10:39:20 AM »


Authors: NoImageAvailable, Dark_Inquisitor

Description:
This mod allows hair to show under headwear.
Headwear that doesn't cover the upper head (e.g. sunshades, goggles, etc.) displays the whole hair texture.
Headwear that covers hair in some way will have the texture replaced with custom textures that fit exactly under the headwear, thus allowing to display hair at all times without any clipping. Works with all headwear, both vanilla and modded.

Supported hairstyles (mods):
- vanilla (default)
- Rimsenal Hair Pack*
- NackbladInc Rimhair 2.2*
- Spoon's Hair Mod*
- RimNGE*
- Xeva's Hairstyles*

*Remember that you have to download them separately.

Your favourite hairstyle not supported yet? Consider using Show Hair with Hats!

To-do list:
1) Roppoi Hair compatibility (this will take a looong time...)


Remember to back-up your save file before adding any mods!

Pictures
You don't have to shave your hair to put on sunglasses! (apparel from Shinzy's Apparello)


What's the difference, though? (apparel from Shinzy's Apparello)






Special thanks:
To NoImageAvailable - without him and his coding skills, this mod would never exist;
To rooki1, spoonshortage, nackblad, sumghai and Xeva - for letting us use art from their mods.


How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.

Technical mumbo-jumbo for modders:
How does it work?
The mod places texture sets called "FullHead" and "UpperHead" within a folder structure equal to the hair's texPath, e.g. the textures for the vanilla Afro would be placed in `Things/Pawn/Humanlike/Hairs/Afro/`. The mod automatically detects properly placed and named textures, and will switch to the FullHead/UpperHead texture if the respective BodyPartGroup is covered. If a texture can't be found it will default to Shaved hair, meaning vanilla style hiding of hair.

To make a hair mod compatible:
  • Make a folder next to your png files and name it the same as the hairstyle, like ABC_front.png means the folder should be named ABC
  • Inside that folder you add Bodypart + _front, _back, _side, like FullHead_front.png
  • Valid bodyparts are FullHead, UpperHead and Jaw, making a total of 9 if all are used
  • If an image is missing, the shaved head will be used

Licensing:
- You can use this mod in your modpack. Why are you waiting? Go and add it!
- Wait, you want to use the files? Ask me first!
- Want to ONLY update mod to the newest version? You are allowed to do so, but put it ONLY on this thread.
« Last Edit: December 07, 2018, 07:28:50 PM by Dark_Inquisitor »
Logged

Nightinggale

  • Colonist
  • ***
  • Posts: 378
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #1 on: November 03, 2017, 10:43:48 AM »

How is this different from Show Hair with Hats?
Logged
ModCheck - boost your patch loading times and include patchmods in your main mod.

NoImageAvailable

  • Colonist
  • ***
  • Posts: 911
  • Enemy Unknown
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #2 on: November 03, 2017, 11:00:09 AM »

How is this different from Show Hair with Hats?

That one simply displays hair with hat graphics, resulting in tons of clipping. This mod switches between regular hair and custom textures that are designed to fit perfectly under hats, meaning it actually looks like what you would see in reality when someone with long hair, a mohawk, etc. puts on a hat.
Logged
"The power of friendship destroyed the jellyfish."

Dark_Inquisitor

  • Drifter
  • **
  • Posts: 95
  • Why not?
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #3 on: November 03, 2017, 11:01:29 AM »

How is this different from Show Hair with Hats?

That one simply displays hair with hat graphics, resulting in tons of clipping. This mod switches between regular hair and custom textures that are designed to fit perfectly under hats, meaning it actually looks like what you would see in reality when someone with long hair, a mohawk, etc. puts on a hat.

Exactly, just like in the pictures shown in the post...

indy2018

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #4 on: November 03, 2017, 12:23:47 PM »

I have some issue with your mod.

Screenshots included
My save with your mod activated (Top)
And how it looks with the  [A18] Show Hair with Hats (AlienRaces now supported) mod that was already mentioned in this thread. (Second screenshot).



[attachment deleted by admin: too old]
« Last Edit: November 03, 2017, 01:28:13 PM by indy2018 »
Logged

Dark_Inquisitor

  • Drifter
  • **
  • Posts: 95
  • Why not?
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #5 on: November 03, 2017, 12:50:43 PM »

I have some issue with your mod.

Screenshots included
My save with your mod activated (Top)
And how it looks with the  [A18] Show Hair with Hats (AlienRaces now supported) mod that was already mentioned in this thread. (Second screenshot).
I guess I will stick with Show Hair with Hats mod for now.

Something here is deffinetly wrong, since those are not textures that should be displayed when no hat is worn.
Tell me, does the pawns look like this in game, or just the top bar is like this?

indy2018

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #6 on: November 03, 2017, 01:37:52 PM »

I think I know what my issue was. These screenshots were made with in game option "hats shown only on game map" turned on (they had their invisible hats on so the hairs looked "funny".
« Last Edit: November 03, 2017, 01:41:57 PM by indy2018 »
Logged

Dark_Inquisitor

  • Drifter
  • **
  • Posts: 95
  • Why not?
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #7 on: November 03, 2017, 01:41:05 PM »

I think I know what my issue was. These screenshots were made with in game option "hats shown only on game map" turned on (they had their hats on but they weren't "rendered" so the hairs looked "funny".

Good to hear everything was solved :)
Also it's a thing that slipped by, we'll see what can be done about this.

Nightinggale

  • Colonist
  • ***
  • Posts: 378
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #8 on: November 03, 2017, 03:42:36 PM »

I like the new comparison images. It really makes clear what the difference is between each version. Also I do like this mod quite a bit now that I'm complete aware of how it stands out.

I have studied the C# code and I must say it's brilliant. I'm keeping it for future reference because it's Harmony Transpillar done right, meaning the dll should be compatible with all other mods unless they mod the very same instructions. Secondly the concept of controlling the drawing code based on presence of png files rather than xml is great. It really is a showcase example of mod coding done right.

I do wonder about the added hair pngs. If it doesn't matter which mod they are in, then why copy hair from other mods with concent rather than just adding the files to the mods, which provides the hairstyles in the first place? This mod would be easier to maintain if it becomes common knowledge that adding a hairstyle should add extra files to support DSYH. In fact people can add hairstyles, add support and you wouldn't even need to be involved.

Another thing I wondered about is has this been tested with alien race framework? AFAIK that mod is using Transpillar on the very same method.

Last, but not least: the guide on how to add support is quite short and lacks details. Looks like the real approach is something like this:
  • Make a folder next to your png files and name it the same as the hairstyle, like ABC_front.png means the folder should be named ABC
  • Inside that folder you add Bodypart + _front, _back, _side, like FullHead_front.png
  • Valid bodyparts are FullHead, UpperHead and Jaw, making a total of 9 if all are used
  • If an image is missing, the shaved head will be used
Maybe not a perfect guide, but it provides a lot more information on the approach.
Logged
ModCheck - boost your patch loading times and include patchmods in your main mod.

Kiame

  • Planetologist
  • ****
  • Posts: 1245
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #9 on: November 03, 2017, 03:58:15 PM »

If you want to say in your picture comparing the different approaches "Show Hair w/ Hats" I give you permission to - just so it's clearer what's being compared.  :)

I am going to try out this mod. Initially (before trying it) I almost want to be able to toggle which hats will show un-clipped hair or which hats hide hair.

And quick nitpick...
"What's the difference, tough? (apparel from Shinzy's Apparello)"
should probably be "though"
« Last Edit: November 03, 2017, 04:07:29 PM by Kiame »
Logged

Dark_Inquisitor

  • Drifter
  • **
  • Posts: 95
  • Why not?
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #10 on: November 03, 2017, 06:20:50 PM »

If you want to say in your picture comparing the different approaches "Show Hair w/ Hats" I give you permission to - just so it's clearer what's being compared.  :)

I am going to try out this mod. Initially (before trying it) I almost want to be able to toggle which hats will show un-clipped hair or which hats hide hair.

And quick nitpick...
"What's the difference, tough? (apparel from Shinzy's Apparello)"
should probably be "though"

Thanks for your kind words :)
As for comparison - I think there are few mods with similar problem (facial stuff, i think? I don't really remember...) Besides, i don't really want to point at anyone. It just don't seem right.
Also yeah, description corrected ;)


I have studied the C# code and I must say it's brilliant. I'm keeping it for future reference because it's Harmony Transpillar done right, meaning the dll should be compatible with all other mods unless they mod the very same instructions. Secondly the concept of controlling the drawing code based on presence of png files rather than xml is great. It really is a showcase example of mod coding done right.

To clear things up - whole code was written by NoImageAvailable. As goes for me, I literally suck when it comes to writing actual code.
All kudos to him! :)


Another thing I wondered about is has this been tested with alien race framework? AFAIK that mod is using Transpillar on the very same method.

Technically speaking it should work.


Last, but not least: the guide on how to add support is quite short and lacks details. Looks like the real approach is something like this:
  • Make a folder next to your png files and name it the same as the hairstyle, like ABC_front.png means the folder should be named ABC
  • Inside that folder you add Bodypart + _front, _back, _side, like FullHead_front.png
  • Valid bodyparts are FullHead, UpperHead and Jaw, making a total of 9 if all are used
  • If an image is missing, the shaved head will be used
Maybe not a perfect guide, but it provides a lot more information on the approach.

You wrote this? I wrote this.
(indeed it is much better description of what to do, i hope you won't mind if i incorporate it)

Diana Winters

  • Colonist
  • ***
  • Posts: 446
  • Space Neko
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #11 on: November 03, 2017, 09:03:18 PM »

I'm having a small problem with an item from fashion rimsta



It's relevant tags are:
Code: [Select]
<apparel>
<bodyPartGroups>
<li>UpperHead</li>
<li>Teeth</li>
</bodyPartGroups>
<wornGraphicPath>Things/Pawn/Humanlike/Apparel/Hats/FSSurgicalMask</wornGraphicPath>
<layers>
<li>Overhead</li>
</layers>
<tags>
<li>Outlander</li>
<li>Workforce</li>
</tags>
<defaultOutfitTags>
<li>Worker</li>
</defaultOutfitTags>
</apparel>

so I am not sure why the textures are not working properly (as I am sure that they have vanilla hairs)

Testing with the cowboy hat indicates that it is a problem specific to this headgear.
« Last Edit: November 04, 2017, 11:45:37 AM by Diana Winters »
Logged

Nightinggale

  • Colonist
  • ***
  • Posts: 378
  • Refugee
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #12 on: November 03, 2017, 10:22:04 PM »

(indeed it is much better description of what to do, i hope you won't mind if i incorporate it)
Sure. I wrote this for people to read. I'm thinking the easier it is to add support, the more likely it is that people will add support in their own mods. It doesn't help that the mod itself makes it easy if people don't know what to do.

  • If an image is missing, the shaved head will be used
I minor correction to make it completely accurate.
  • A bodypart set contains _front, _back and _side. Either add all or none as incomplete sets will result in serious problems!
  • Bodyparts with no set will use shaved head graphics
The first version doesn't make it clear that just adding _front will make the code assume _back and _side to be present and read those without checking if they exist first. I don't know what will happen, but with a bit of luck, it will just be errors in the log. Worst case is crashing the game. Either way the code can't get to shaved head once it figures _front is present for the bodytype in question, which in itself is an issue.
Logged
ModCheck - boost your patch loading times and include patchmods in your main mod.

NoImageAvailable

  • Colonist
  • ***
  • Posts: 911
  • Enemy Unknown
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #13 on: November 04, 2017, 05:17:32 AM »

I'm having a small problem with an item from fashion rimsta

And what exactly is the problem?
Logged
"The power of friendship destroyed the jellyfish."

Diana Winters

  • Colonist
  • ***
  • Posts: 446
  • Space Neko
    • View Profile
Re: [A18] Don't Shave Your Head!
« Reply #14 on: November 04, 2017, 11:46:32 AM »

I'm having a small problem with an item from fashion rimsta

And what exactly is the problem?

Ooops, posted the wrong liknk for the image

As you can see, these hairs are clippng through the hat instead of using the alternate textures.
Edit: I think the hairs are Afro and Scorpiontail
Logged
Pages: [1] 2 3 ... 6