I’m about 2hrs trying to figure out how can I make a fix color of hair or eye to a job class.
For example: Carpenters to have always black hair.
Is that possible?
I tryied to understand how the code worksto do this, but I didn’t find a way
I’m asking cuz I want to do one thing and I need to change the eye color to do what I want.
(I think a problem is to memorize the color before changing, and when the hearthling become a worker, the color “back to normal”)
Ah I hadn’t thought of the back to normal problem… (I had concidered this kind of stuff for some classes)
Well bugger ill give it some thought, I’ll let you know if I think of something
Edit: I just did, make an item which is just the hearthlings animated eyes, add it to the heartling upon promotion. Now if he or she de-Promotes he or she still has their own eyes.
will this work?
And do u say that .qb green eyes, right? But I’ll need to create a specific .qb with the color I want, won’t I? Or I just call the eye.qb and in the code I change the color with the material_map?
Interesting
I’ll take a look into it. Thank u
If I figure out or have some questions I’ll comment here
@Kittyodoom I took a look into your mod (just the code).
Firstly, congratz
Secondly, the thing is that I don’t know how I can change the hair or eyes of a job class. Idk if u change the hair or eyes of a job…
I’m trying (and tryied) to dig the lua files to understand how it works, but… for a while I couldn’t find how works.
I think is because of the “type”, cuz the job is “job” type and others files that can change de apparence is “entity”.
Idk if i’m right.
I tryied to use the “components” to change the color… no results
@Relyss
It’s possible to change the hair/eye color of a job class just changing the .json file? Or I need to create/change .lua files?
Depending on what you want to do, you can skip a lot of headache going with simpler routes.
For example, what class you want to have this change? If it is a new class made by you, you can simple add into the job json that it should have an equip, and that equip would be a pair of eyes you can make in .qb
I think the easiest way would be like Kittyodoom suggested: adding a wig and eyes to the carpenter outfit model (overriding the carpenter qb model, or making a mixinto to the outfit json file to point to the model in your mod).
This, when configured correctly, will not have any issues when demoting later.
There might be a way to do it with Lua for keeping the hairstyle, but I don’t think it would restore the old color if you were to demote them later. You might need to add even more code to do it.
Edit: if it’s a custom class, then what BrunoSupremo said would be the easiest way.
he basicly means the idea i started with.
make an entity that holds the “apearance” of the new eyes…
tell your class that, in addition to the right clothes and other stuff, it should also “enquip” the new eyes.
You could do that, but it would be better if the eyes were its own equipment. In the job json you can define all the equipment that automatically appears with the class, like outfits or tools, so you just set it to have the eyes too. The game will take care to remove all those equips automatically too when you de-promote it or change to other class.