BoxyPop Posted September 2, 2017 Share Posted September 2, 2017 I am looking for help, my item is invisible when it is equipped Cactuspike_DST.rar Link to comment Share on other sites More sharing options...
Lumina Posted September 2, 2017 Share Posted September 2, 2017 Probably related to the anim swap_item. How do you made the anim ? How is your code looking ? Link to comment Share on other sites More sharing options...
BoxyPop Posted September 2, 2017 Author Share Posted September 2, 2017 5 hours ago, Lumina said: Probably related to the anim swap_item. How do you made the anim ? How is your code looking ? local assets = { Asset("ANIM", "anim/cactuspike.zip"), Asset("ANIM", "anim/swap_cactuspike.zip"), Asset("ATLAS", "images/inventoryimages/cactuspike.xml"), Asset("IMAGE", "images/inventoryimages/cactuspike.tex") } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_cactuspike", "cactuspike") 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 function fn(colour) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("cactuspike") inst.AnimState:SetBuild("cactuspike") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "cactuspike" inst.components.inventoryitem.atlasname = "images/inventoryimages/cactuspike.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst:AddComponent("inspectable") local cactuspike_damage = 65 inst:AddComponent("weapon") inst.components.weapon:SetDamage(cactuspike_damage) inst.components.weapon:SetRange(1) inst:AddComponent("finiteuses") inst.components.finiteuses:SetMaxUses(200) inst.components.finiteuses:SetUses(200) inst.components.finiteuses:SetOnFinished(inst.Remove) return inst end return Prefab("common/inventory/cactuspike", fn, assets) Link to comment Share on other sites More sharing options...
BoxyPop Posted September 2, 2017 Author Share Posted September 2, 2017 and use this tutorial to make anim Link to comment Share on other sites More sharing options...
BoxyPop Posted September 2, 2017 Author Share Posted September 2, 2017 8 hours ago, Lumina said: Probably related to the anim swap_item. How do you made the anim ? How is your code looking ? Cactuspike_DST.rar And all files is here. Link to comment Share on other sites More sharing options...
Lumina Posted September 2, 2017 Share Posted September 2, 2017 @MauroxyBofoxez Ok, i think you need another folder named "swap_cactuspike" into the already existing "swap_cactuspike", and your .png in this folder. This to allows the .png file to be used as a "symbol". At least it's how i understand the structure of the tutorial you followed. Better to make a clean .scml project from scratch. And i think this line should be changed : owner.AnimState:OverrideSymbol("swap_object", "swap_cactuspike", "cactuspike") to : owner.AnimState:OverrideSymbol("swap_object", "swap_cactuspike", "swap_cactuspike") I'm not entirely sure, but it worth a try. Link to comment Share on other sites More sharing options...
BoxyPop Posted September 2, 2017 Author Share Posted September 2, 2017 YEEEEEEAH VERY THANKS :3 <3 Link to comment Share on other sites More sharing options...
Lumina Posted September 2, 2017 Share Posted September 2, 2017 I'm glad to know this is working fine Link to comment Share on other sites More sharing options...
ZupaleX Posted September 2, 2017 Share Posted September 2, 2017 I don't want to be a **** but there is one topic like that per week and it's always exactly the same problem, i.e. wrong folder structure. Just a tiny search is not so hard. Link to comment Share on other sites More sharing options...
Lumina Posted September 2, 2017 Share Posted September 2, 2017 I think it will help with an update tutorial. Old topics on forum have strange problem with structure of code, and it makes it harder to read, so people do more mistakes. I'm not saying people shouldn't search, but i think that it doesn't help. 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