evilmarshmallow Posted February 9, 2025 Share Posted February 9, 2025 Hi! Sorry if this is a stupid question but I wanted to make a custom helmet that hides the face of my character, however I was wondering if there was a way to keep it on the head during animations? like for example when go through a wormhole the helmet flies off and reveals the headless body, is there a way to keep it on the head like the void cowl? Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/ Share on other sites More sharing options...
Meepenator Posted February 10, 2025 Share Posted February 10, 2025 --So if you look into the hats.lua you'll see that it does this for I think the void cowl and the lunar variant(Forgot it lmao). fns.fullhelm_onequip = function(inst, owner) if owner:HasTag("player") then _base_onequip(inst, owner, nil, "headbase_hat") owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") owner.AnimState:Hide("HEAD_HAT_NOHELM") owner.AnimState:Show("HEAD_HAT_HELM") owner.AnimState:HideSymbol("face") owner.AnimState:HideSymbol("swap_face") owner.AnimState:HideSymbol("beard") owner.AnimState:HideSymbol("cheeks") owner.AnimState:UseHeadHatExchange(true) else _base_onequip(inst, owner) owner.AnimState:Show("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") end end --and this fns.fullhelm_onunequip = function(inst, owner) _onunequip(inst, owner) if owner:HasTag("player") then owner.AnimState:ShowSymbol("face") owner.AnimState:ShowSymbol("swap_face") owner.AnimState:ShowSymbol("beard") owner.AnimState:ShowSymbol("cheeks") owner.AnimState:UseHeadHatExchange(false) end end -- it also has this but so long as you put the above parts into the onunequip and onequip properly, you should be fine. fullhelm_onequip = fns.fullhelm_onequip, fullhelm_onunequip = fns.fullhelm_onunequip, --I believe these were for skins Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1795527 Share on other sites More sharing options...
evilmarshmallow Posted February 10, 2025 Author Share Posted February 10, 2025 1 hour ago, Meepenator said: --So if you look into the hats.lua you'll see that it does this for I think the void cowl and the lunar variant(Forgot it lmao). fns.fullhelm_onequip = function(inst, owner) if owner:HasTag("player") then _base_onequip(inst, owner, nil, "headbase_hat") owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") owner.AnimState:Hide("HEAD_HAT_NOHELM") owner.AnimState:Show("HEAD_HAT_HELM") owner.AnimState:HideSymbol("face") owner.AnimState:HideSymbol("swap_face") owner.AnimState:HideSymbol("beard") owner.AnimState:HideSymbol("cheeks") owner.AnimState:UseHeadHatExchange(true) else _base_onequip(inst, owner) owner.AnimState:Show("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") end end --and this fns.fullhelm_onunequip = function(inst, owner) _onunequip(inst, owner) if owner:HasTag("player") then owner.AnimState:ShowSymbol("face") owner.AnimState:ShowSymbol("swap_face") owner.AnimState:ShowSymbol("beard") owner.AnimState:ShowSymbol("cheeks") owner.AnimState:UseHeadHatExchange(false) end end -- it also has this but so long as you put the above parts into the onunequip and onequip properly, you should be fine. fullhelm_onequip = fns.fullhelm_onequip, fullhelm_onunequip = fns.fullhelm_onunequip, --I believe these were for skins Hey! I tried adding them like you said but the game crashes upon loading with the error "variable 'fns' is not declared" any ideas? I'm still new to this so I don't know how to go about it Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1795570 Share on other sites More sharing options...
Meepenator Posted February 10, 2025 Share Posted February 10, 2025 That was just the base game code, take out the parts that have fns and just use the onequip parts like this, this *should* work local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_hat", "insertyourhathere_swap","swap_hat") --this either goes here and has your item swamp in the middle if owner:HasTag("player") then -- owner.AnimState:OverrideSymbol("swap_hat", "insertyourhathere_swap","swap_hat") --or here owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") owner.AnimState:Hide("HEAD_HAT_NOHELM") owner.AnimState:Show("HEAD_HAT_HELM") owner.AnimState:HideSymbol("face") owner.AnimState:HideSymbol("swap_face") owner.AnimState:HideSymbol("beard") owner.AnimState:HideSymbol("cheeks") owner.AnimState:UseHeadHatExchange(true) else owner.AnimState:Show("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") end end local function OnUnequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_hat") -- this should go here if owner:HasTag("player") then owner.AnimState:ShowSymbol("face") owner.AnimState:ShowSymbol("swap_face") owner.AnimState:ShowSymbol("beard") owner.AnimState:ShowSymbol("cheeks") owner.AnimState:UseHeadHatExchange(false) end end Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1795590 Share on other sites More sharing options...
evilmarshmallow Posted February 10, 2025 Author Share Posted February 10, 2025 1 hour ago, Meepenator said: That was just the base game code, take out the parts that have fns and just use the onequip parts like this, this *should* work local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_hat", "insertyourhathere_swap","swap_hat") --this either goes here and has your item swamp in the middle if owner:HasTag("player") then -- owner.AnimState:OverrideSymbol("swap_hat", "insertyourhathere_swap","swap_hat") --or here owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") owner.AnimState:Hide("HEAD_HAT_NOHELM") owner.AnimState:Show("HEAD_HAT_HELM") owner.AnimState:HideSymbol("face") owner.AnimState:HideSymbol("swap_face") owner.AnimState:HideSymbol("beard") owner.AnimState:HideSymbol("cheeks") owner.AnimState:UseHeadHatExchange(true) else owner.AnimState:Show("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") end end local function OnUnequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_hat") -- this should go here if owner:HasTag("player") then owner.AnimState:ShowSymbol("face") owner.AnimState:ShowSymbol("swap_face") owner.AnimState:ShowSymbol("beard") owner.AnimState:ShowSymbol("cheeks") owner.AnimState:UseHeadHatExchange(false) end end I'm so sorry to bother you again but I've seem to run into another issue, I was able to get in the game without crashing now but when I put the hat on both the hat itself and the characters face go invisible while the head remains no matter what I do Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1795607 Share on other sites More sharing options...
Meepenator Posted February 11, 2025 Share Posted February 11, 2025 So the thing is, I think you need to actually change the anim of the hat itself, I'm trying to make it work on my end but owner.AnimState:UseHeadHatExchange(false) this is what would stop the hat from flying off, and you kinda need owner.AnimState:Show("HEAD_HAT") owner.AnimState:Show("HEAD_HAT_HELM") to work properly. I'll keep looking into it but I think you need to actually have those specific anim states. Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1796208 Share on other sites More sharing options...
evilmarshmallow Posted February 11, 2025 Author Share Posted February 11, 2025 Thanks for your help, I'm not sure how one goes about changing the anim but I'll try looking around! Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1796397 Share on other sites More sharing options...
Meepenator Posted February 12, 2025 Share Posted February 12, 2025 I used to be able to uncompile the anim stuff but I forgot how to do it. I'm sure if you look into the old modding pages here you might be able to find them. Link to comment https://forums.kleientertainment.com/forums/topic/163855-question-about-custom-helmets/#findComment-1796530 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now