Face accessories for men

Users who are viewing this thread

I've been trying to set up face accessories for men in the beard slot.

I've already successfully set up a variety of jewelry for women in their beard slot (which I renamed to "face detail" in ui.csv). Everything works like a charm.

So I figured I'll just replicate the same logic for men. Nope, game refuses to work as expected - the color of face accessories changes based on hair color o_O
As a test case, I tried the same earing on women and men - same mesh, material, texture. On women works like a charm. On men - just doesn't.

At first I thought it must be some kind of hardcoded engine limitation, but then I started looking through Napoleonic Wars BRF files and boom! They have all kinds of accessories! Cigars, glasses, other stuff. So it should be doable, I think.

For women, I only declare the beard slot meshes, and leave the beard material section as an empty []
For men I tried:
- leaving list of materials unchanged (accessories' color based on hair color slider)
- adding accessory materials at the end of the list (same)
- emptying the list (all beards become white)

Anybody with experience have stumbled upon a similar problem? What am I missing?
 
Last edited:
Solution
Wow! Yes, I'm using Native, with just a mini-tweak for menu colors that I can easily port to a new file no problem (as long as I have the source code to edit).
I was just about to give up on this, so if you can send me a working file that I can just use as is, it would be amazing.

I'm truly in awe how helpful this forum is. Members don't seem numerous, but everyone I talked with so far is just so impressively altruistic and professional. And you aren't even getting paid for it.
Helping others is a great way to find the gaps in your own knowledge and figure out new things!

I have never played Napoleonic Wars, so this was really interesting to work through. After plugging away at it unsuccessfully, I checked their shaders, and I...
Checked the shaders. Here are the results:
objectused materialshader of materialtechnique of shader
regular beards (WB & NW)hair_blondehair_shader_anisohair_shader_aniso
my accessoriesrndl_jewelryiron_shaderstandart_noskin_nobump_nospecmap
NW accessories (type 1)Additionsenvmap_shader_skin_bump_colorspecenvmap_specular_diffuse_skin_bump_colorspec
NW accessories (type 2)russian_hats_3specular_shader_noskin_bump_highstandart_noskin_bump_specmap_high
NW accessories (type 3)russ_capsspecular_shader_noskin_bump_highstandart_noskin_bump_specmap_high
The shaders NW uses are not vanilla, so I tried importing them to my mod for testing. The accessories still change color, but I think the NW shaders just may have not kicked in, judging by the rgl.log warnings, that looked like this:
rgl_post_warning_line: Unable to get technique with name .........

I also checked how NW declares its accessories in module system - well, they only declare the meshes, leaving the list of beard materials in vanilla state (exactly like I was doing it).
 
Last edited:
Upvote 0
Already tried that. What works for females is just an empty list of beard materials in module_skins.py - if I do the same for men and empty their list of beard materials, then face accessories do work normally, but as a side effect all normal beards become white and unaffected by hair color slider.

So I guess it's a dead end, unless I somehow crack the NW mb.fx and get those shaders into native :/
 
Upvote 0
if I do the same for men and empty their list of beard materials, then face accessories do work normally,
I haven't taken a look at the NW resources, are their beards connected with the face accessories? Then I would assume that the face accessories are submeshes with a different shader. You could check the material entries on how they look like and if they include the beards and the accessories.
Otherwise, @SupaNinjaMan might know what can cause this.
 
Upvote 0
NW accessories are declared as beards in module_skins.py:
Python:
    ["h_simplest","h_bbeards","h_buckli","h_smalltail","a_la_garde","a_la_garde_v2","a_la_hussard","a_la_hussard_v2","a_la_russe","a_la_russian_grenadier","a_la_sans_culotte","a_la_sans_culotte_v2"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    ["accessory_glasses_simple","accessory_monocle","accessory_cigar_simple","accessory_pipe_simple","accessory_pipe_russian","accessory_eyepatch_simple","accessory_grashalm_simple","accessory_single_earing","accessory_flower_daisy","accessory_Rich_german_pipe_3"  # our accessories
    ,"beard_e","beard_d","beard_k","beard_y","beard_f","beard_b","beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_g","beard_q"], #beard meshes ,
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"], #beard_materials
 
Upvote 0
I know that they are using the beard slot there. The only thing I don't know out of mind is if their beard meshes are sometimes beards and accessories combined or not. I could imagine that it's sometimes a specific beard mesh combined with an accessory submesh, both using a different material, so that only the beard colour changes.
 
Upvote 0
You need to apply a material that uses a shader that does not use the vertex coloring of the mesh to change the final output. NW probably made a specific shader to prevent the beard colors from affecting the accessories. I don't think there is a shader in Native that applies accurate lighting and does not apply vertex color, though.
 
Upvote 0
Are you using the Native shaders? I can throw you an updated version that has a branch off of standart_* that doesn't use vertex colors.
Wow! Yes, I'm using Native, with just a mini-tweak for menu colors that I can easily port to a new file no problem (as long as I have the source code to edit).
I was just about to give up on this, so if you can send me a working file that I can just use as is, it would be amazing.

I'm truly in awe how helpful this forum is. Members don't seem numerous, but everyone I talked with so far is just so impressively altruistic and professional. And you aren't even getting paid for it.
 
Last edited:
Upvote 0
Wow! Yes, I'm using Native, with just a mini-tweak for menu colors that I can easily port to a new file no problem (as long as I have the source code to edit).
I was just about to give up on this, so if you can send me a working file that I can just use as is, it would be amazing.

I'm truly in awe how helpful this forum is. Members don't seem numerous, but everyone I talked with so far is just so impressively altruistic and professional. And you aren't even getting paid for it.
Helping others is a great way to find the gaps in your own knowledge and figure out new things!

I have never played Napoleonic Wars, so this was really interesting to work through. After plugging away at it unsuccessfully, I checked their shaders, and I was wrong. They do not strip the Vertex Color in any sort of way on the shader level.

It is actually the naming scheme being used in the beard meshes. By having the prefix "accessory_***" the engine ignores it when applying the hair color, and applies the material assigned in the BRF. Much more simple, and waaaay easier.

Just rename your meshes to have the "accessory_***" prefix and you'll be good to go!
 
Last edited:
Upvote 0
Solution
Helping others is a great way to find the gaps in your own knowledge and figure out new things!

I have never played Napoleonic Wars, so this was really interesting to work through. After plugging away at it unsuccessfully, I checked their shaders, and I was wrong. They do not strip the Vertex Color in any sort of way on the shader level.

It is actually the naming scheme being used in the beard meshes. By having the prefix "accessory_***" the engine ignores it when applying the hair color, and applies the material assigned in the BRF. Much more simple, and waaaay easier.

Just rename your meshes to have the "accessory_***" prefix and you'll be good to go!
This is by far the most mind-boggling thing I have encountered in Warband so far. How you figured that out I do not know, but I'm sure glad you did. I can already imagine the backend programmer who was like "that's gonna make people confused, but sure, no problem, I can code it in". And then proceeds to code it in. And then nobody proceeds to document it anywhere, because not documenting stuff is a long-standing TaleWorlds tradition.
Thank you for cracking the problem, I'll get to testing it right away.

EDIT:
I can't believe it works. But I confirm that it does. Thank you @SupaNinjaMan, truly.
 
Upvote 0
Back
Top Bottom