Sign in to follow this  

How can i change the molehat's filter color?

Recommended Posts

Milllk    59

i try to use the addcomponentpostinit but it does not work.


local function ChangeMoleShader (inst)
    print("it work")
        day = "images/shader/purple_moon_cc.tex",
        dusk = "images/shader/purple_moon_cc.tex",
        night = "images/shader/purple_moon_cc.tex",
        full_moon = "images/shader/purple_moon_cc.tex",
    return inst

Share this post

Link to post
Share on other sites
Mr. Tiddles    1154

The answers you seek lie within the hats.lua prefab, located in the scripts-prefabs folder, my child.



What I mean is, the colourcube override is in the onequip/onunequip functions in the hat.lua. What you'd wanna do is make a prefab postinit for the molehat itself. 


Adding a function something like this in said postinit:


        inst.components.equippable:SetOnEquip( function(inst)
And as for what thingy to do? You'll find your clues in the hat.lua.
An unequip would be uneeded, as it already just removes the colour cube and night vision. 

Share this post

Link to post
Share on other sites
Milllk    59

the molehat has a tag nightvision which provides the vision effect,it can't be change during equip or unequip,it rely on the inst itself




like this, so i add the tag ,but can't change the color,i guess if i can find where nightvision is defined,i will be fine for modifying.


ill try what u've told.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this