Fancy_Fox_Pers Posted May 1, 2015 Share Posted May 1, 2015 (edited) Hi, I'm making characters for my French-speaking friends and today I was trying to find a right template for one's hat. I have encountered three problems though: -When placing it on the ground, the hat disappears-I don't know how I can name the item-The characters' headbase seems to disappear upon equipping (tested with Wilson) Besides, I'd also like to know how to put it with in my character mod. Edit: How do I attach the mod file to this forum? Edited May 1, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/ Share on other sites More sharing options...
DarkXero Posted May 1, 2015 Share Posted May 1, 2015 - Likely the build has a different name or the asset wasn't loaded- You need to put GLOBAL.STRINGS.(your hat prefab in upper case letters) = "My Hat Name"- You need to put an onequip and onunequip functions that alter the character's AnimState, like any other hat. You drop the hat file with your character file, combine the modmains, and you add the hat prefab to the PrefabFiles in the main modmain. Click "Reply to this topic" or "More Reply Options" to see the attachment options at the bottom of the post. Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-633701 Share on other sites More sharing options...
Fancy_Fox_Pers Posted May 1, 2015 Author Share Posted May 1, 2015 (edited) Thank you for the help! -I would like to show you that everything was renamed, maybe you'll stumble on some mistake I didn't see-Where do I put that? In scripts/prefabs/lua file?-I have no experience at all with items (aside from beards, if that counts...), I have no idea how to do that, sorry ^^'. Also, this very issue also happens with the tutorial mod so... :/ Thanks I tried that the first time, but it says I can't upload that type of file. I tried a Winrar format by the way. I don't know what other way to attach the mod (there are also no new textures, it's still the tutorial's) PS: I used as a template the "Hat Tutorial" by Ysovuka Edited May 1, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-633714 Share on other sites More sharing options...
DarkXero Posted May 1, 2015 Share Posted May 1, 2015 - Yes, renaming things tend to break everything- In modmain- Hats have this code: local function onequip(inst, owner, fname_override) local build = fname_override or fname owner.AnimState:OverrideSymbol("swap_hat", build, "swap_hat") owner.AnimState:Show("HAT") owner.AnimState:Show("HAT_HAIR") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") if owner:HasTag("player") then owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") end end local function onunequip(inst, owner) owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAT_HAIR") owner.AnimState:Show("HAIR_NOHAT") owner.AnimState:Show("HAIR") if owner:HasTag("player") then owner.AnimState:Show("HEAD") owner.AnimState:Hide("HEAD_HAT") end end inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HEAD inst.components.equippable:SetOnEquip(onequip) inst.components.equippable:SetOnUnequip(onunequip) Upload .lua files or .zip files. In winrar, instead of rar, pick zip. Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-633729 Share on other sites More sharing options...
Fancy_Fox_Pers Posted May 2, 2015 Author Share Posted May 2, 2015 (edited) Canotier_Lionel.zip -I attached the file, maybe you can have a look at it?-Thanks, done Buuuut it seems to crash now because of that line. "<name> expected near '('" even though I did that.-It seems that that code is already present. I don't personnally see what could be wrong with it. FYI: the prefab name is "canotier_lionel" Edited May 2, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-633911 Share on other sites More sharing options...
DarkXero Posted May 2, 2015 Share Posted May 2, 2015 Alright, here's the thing.Canotier_Lionel.zip Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-633952 Share on other sites More sharing options...
Fancy_Fox_Pers Posted May 2, 2015 Author Share Posted May 2, 2015 You are awesome, DarkXero! Thank you very much for your help. The hat now doesn't disappear anymore and the onequip/unequip stuff works just fine. Though it still says "MISSING NAME" in the invenotry. I only need to know how to fix that now, thank you again! Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-634063 Share on other sites More sharing options...
DarkXero Posted May 2, 2015 Share Posted May 2, 2015 You putGLOBAL.STRINGS.NAMES.CANOTIER_LIONEL = "Canotier"in the modmain. I forgot the NAMES. Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-634078 Share on other sites More sharing options...
Fancy_Fox_Pers Posted May 3, 2015 Author Share Posted May 3, 2015 Thank you! Link to comment https://forums.kleientertainment.com/forums/topic/53406-help-hat-mod/#findComment-634173 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