Armadyllo Posted May 28, 2019 Share Posted May 28, 2019 (edited) Hello, I've been trying to create a custom item for my character, and all the animations (ground, inventory) seem to be working except my swap_[item] one. The character just stands there empty-handed. I've been following this tutorial: Here's my maxglove.lua local assets={ Asset("ANIM", "anim/maxglove.zip"), Asset("ANIM", "anim/swap_maxglove.zip"), Asset("ATLAS", "images/inventoryimages/maxglove.xml"), Asset("IMAGE", "images/inventoryimages/maxglove.tex"),} prefabs = { } local function fn() local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_maxglove", "swap_maxglove") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() local sound = inst.entity:AddSoundEmitter() MakeInventoryPhysics(inst) anim:SetBank("maxglove") anim:SetBuild("maxglove") anim:PlayAnimation("idle") inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "maxglove" inst.components.inventoryitem.atlasname = "images/inventoryimages/maxglove.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return inst end return Prefab("common/inventory/maxglove", fn, assets, prefabs) swap_maxglove.scml swap_maxglove.zip Edited May 28, 2019 by Armadyllo Link to comment Share on other sites More sharing options...
Thomas Die Posted May 30, 2019 Share Posted May 30, 2019 have you checked that you've registered the item's assets in modmain, sometimes when people try to mix two files they usually forget to change the modmain to accommodate this 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