Face/Hair model customization based on character generation

正在查看此主题的用户

proud

Regular
Alright, just a question on how I should go about this.

My character generation for Legend of the Five Rings mod asks which clan you are from. Two good examples include: Crane and Lion. Depending on your choice, I'd like to have hair color choices so a character could essentially dye their hair in the color of that clan.

craneclans.jpg
Kakita_Yoshi_2.jpg

Ikoma_Ujiaki.jpg
200px-Matsu_Agetoki.jpg

Crane would therefore have the choice of white or light blue at an early age, whereas Lion may have a red/tan or blonde color.

Here's the question:
Could I have a variable that gets set and the skins read the variable when it comes time to editing the face? If it were a global variable, if during the game a character renounced his/her ties with the clan and swore fealty to a new one, could I set the variable to something else, allowing the player (if they wanted) to click on their portrait and change their hair color?

This seems reasonable, but maybe I'm missing something. Any suggestions/advice would be great.
 
interesting...

The only way I see this (looking at the character face creation as it is) is that each clan has a face it's associated with.  If you notice, some faces can only have specific hair colors.  I don't know where this is defined, but I'm thinking this is where you should start.  To give an example, look at the face textures.  There are 2 for each:young and old.  When you move the age slider, it basically overlays (with transparency) the old face over the young.

Someone asked about making an injured/scared face, so I showed them if I change to old face code to a beat up face, the slider would make inuries appear.

You just have to find out how the color change for hair works.  Look up the hair textures.
 
Okay, I think I understand. The colors are overlain on top of the image. Here's an example I conjured:

hairtextures.jpg


Code in module_skins.py:
("manface_young_2",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19])

[list type=decimal][*]Name of the hair mesh
[*]Skin color (thanks HokieBT)
[*]Base texture
[*]color1, color2, … colorn[/list]

Where color# is 0x ALPHA? RED GREEN BLUE
The set of colors are the hair color overlays.
The 'c' found at the end of some of the colors likely means "color burn" or some other darker color comparison instead of overlay.

This is fantastic! I'll experiment with this further, but I think I got it now and shouldn't need any custom textures.

(For those curious: you can take hair_blonde.dds image and pop it into Photoshop or similar program, add a new layer on top, select "overlay" as blending option, and fill in the color of your choice.)
 
you've got the basic idea, but a few comments.

What I highlighted in red is actually the body hue (so you can change the color if their body).  You are correct on the base texture and the other colors are added to the base texture as you use the hair slider, etc.
("manface_young_2",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19])

What you probably want to do is define multiple races in module_skins.py.  So copy the man skin and create a man_crane and man_lion (you also need to add an entry into header_troops.py as well).  But they would be basically identical (same body models, etc) except:

all the face codes for man_crane would be something like:
("manface_young_2",0xffcbe0e0,["hair_white"],[<white>, <lightblue>])

all the face codes for man_lion would be something like:
("manface_young_2",0xffcbe0e0,["hair_white"],[<blonde>, <tan>, <red>])

then when you start the game you would use:

(troop_set_type,"trp_player",tf_male_crane),
or
(troop_set_type,"trp_player",tf_male_lion),

depending on what option they choose.    This also means you could give these flags to your troops and so when random face codes were generated they would be limited in hair color as well, etc.  I use this concept in my mod for creating different alien races, etc.
 
Incredible! This is exactly what I need to know! Thanks for correcting me and giving an example. I'm going to restrict the possible faces and the slider values to give the player only Asian faces to choose from (no Gaijin!)

Thanks again.
 
后退
顶部 底部