HajiKasu Posted June 23, 2019 Share Posted June 23, 2019 So I'm trying to add the ability to give Glommer a hat. I think I've already figured out how to add the recognition for the hat and stuff to actually be accepted and equipped: local function ShouldAcceptItem(inst, item) return ( --accept all hats! item.components.equippable ~= nil and item.components.equippable.equipslot == EQUIPSLOTS.HEAD ) end local function OnGetItemFromPlayer(inst, giver, item) --I wear hats if item.components.equippable ~= nil and item.components.equippable.equipslot == EQUIPSLOTS.HEAD then local current = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) if current ~= nil then inst.components.inventory:DropItem(current) end inst.components.inventory:Equip(item) inst.AnimState:Show("hat") end end and then add this to the fn() inst:AddComponent("inventory") How would I edit the spriter file so that Glommer actually puts on the hat when I give it to him? And is there anything else I'm missing? Link to comment Share on other sites More sharing options...
Ultroman Posted June 25, 2019 Share Posted June 25, 2019 I don't think the Glommer animation rig has a spot for hats. I think you'd have to create your own new Glommer mob with a new animation rig. Link to comment Share on other sites More sharing options...
HajiKasu Posted June 25, 2019 Author Share Posted June 25, 2019 If I replaced glommer’s animation rig with a new one through the mod, then used PrefabPostInit to add the hat code to glommer, would it work the same as if I had created a new custom glommer? Additionally, are there any tutorials on how to add/create an animation state in an animation rig? Link to comment Share on other sites More sharing options...
Ultroman Posted June 26, 2019 Share Posted June 26, 2019 It would not be the same, but either way is fine. If you want to make all Glommers wear hats, also for the other players, then you have to make a server mod, which replaces the animation rig. I have no idea how to create those, but you can give Glommer any animation bank and build you want. I'm guessing you have to make a new animation bank for Glommer, which includes a hat-node or whatever. There are no up-to-date tutorials. You can only follow the tutorials on the forums as best you can, and then go search these forums for solutions to the remaining problems you might have. There are many, many people who have been through here, who've used the same tutorials and asked the questions you have before. Take a look at my newcomer post for how to search the forum optimally, and general good advice about debugging and basics. Link to comment 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