Change hair/eye color of a "job"?


#1

I need help x.x

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”)


#2

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.


#3

Check out the Clothing mod that Wiese and I did; we have a few instances of mixing new models into the professions, for helmets and outfits or such.

I would think you could make a black hair wig sort of thing for your carpenter, or colored contact eyes, in a similar way?


#4

:thinking::thinking:
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? :thinking::laughing:

Interesting :thinking:
I’ll take a look into it. Thank u :grin:

If I figure out or have some questions I’ll comment here


#5

I haven’t looked into the specifics but I’d start looking at your bog standard heartling and when/where it gets its face


#6

@Kittyodoom I took a look into your mod (just the code).
Firstly, congratz :grin:
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?


#7

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


#8

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.


#9

:thinking::thinking:
I got it.
Well. fortunetly my goal is to change the eyes color. The hair was just a thought.

And yes, it’s for a new class. I used the carpenter as an example.

I’ll use what I have now. I’ll try to know how to program in Lua to try memorize de old hair color.

Thank you all :grin::grin::grin:

do u say to add that pair of eyes into the outfit?


#10

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.

think helmet…but invisible exept for eyes.


#11

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.


#12

I did what u guys told me. But creating the .qb eyes and calling it to the job equipament, will it still has its animation?


#13

As long as the name of the matrix (name it in the voxel editor) is “eyes” it should.