SenL Posted January 17, 2015 Share Posted January 17, 2015 [00:00:46]: Could not find anim [anim] in bank [mynewarmor][00:00:47]: [Fixed] SPAWNING PLAYER AT: (2.00, 0.00, -146.00) [00:00:47]: Serialize session to session/07800007865F7D8F/KU_d8EeZHlp[00:00:47]: Deserialize local session session/07800007865F7D8F/KU_d8EeZHlp[00:00:47]: Failed to load minimap from session data: session/07800007865F7D8F/KU_d8EeZHlp_minimap[00:01:13]: [string "scripts/widgets/containerwidget.lua"]:29: attempt to index local 'widget' (a nil value) What am I missing...?Is there a tutorial to create a new armor? I finished this tutorial:http://forums.kleientertainment.com/topic/29427-tutorial-creating-a-handslot-equippable-item-from-scratch/ Thanks. Link to comment https://forums.kleientertainment.com/forums/topic/49256-crash-could-not-find-anim-anim-in-bank/ Share on other sites More sharing options...
SenL Posted January 17, 2015 Author Share Posted January 17, 2015 I changedinst.AnimState:SetBank("mynewarmor")toinst.AnimState:SetBank("armor_slurtleshell")and it works... I still got crash [string "scripts/widgets/containerwidget.lua"]:29: attempt to index local 'widget' (a nil value) though.I'm trying to make an armor that has inventory slots but I'm borrowing codes and it doesn't work .I'm so lost. Link to comment https://forums.kleientertainment.com/forums/topic/49256-crash-could-not-find-anim-anim-in-bank/#findComment-602823 Share on other sites More sharing options...
rezecib Posted January 17, 2015 Share Posted January 17, 2015 @SenL, Container widgets are a bit funky right now. This thread might help you, though. Link to comment https://forums.kleientertainment.com/forums/topic/49256-crash-could-not-find-anim-anim-in-bank/#findComment-602903 Share on other sites More sharing options...
Aquaterion Posted January 17, 2015 Share Posted January 17, 2015 Try changing it to inst.AnimState:SetBank("myitem") Link to comment https://forums.kleientertainment.com/forums/topic/49256-crash-could-not-find-anim-anim-in-bank/#findComment-602952 Share on other sites More sharing options...
SenL Posted January 17, 2015 Author Share Posted January 17, 2015 @rezecib, I tried understanding that but failed. I can't override containers.widgetsetup because my prefab is the same name "bkpekkapiece". Here's my codeIssue1: crash when opening armor (supposed to have 2 inv slots)Issue2: invisible when droppedIssue3: not shown in character's body -- how do you do this in Spriter? local assets ={ Asset("ANIM", "anim/bkpekkapiece.zip"), Asset("ANIM", "anim/swap_bkpekkapiece.zip"), Asset("ATLAS", "images/inventoryimages/bkpekkapiece.xml"), Asset("IMAGE", "images/inventoryimages/bkpekkapiece.tex")}local slotpos = { Vector3(0,64+32+8+4,0), Vector3(0,32+4,0)}local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "swap_bkpekkapiece", "bkpekkapiece") owner.AnimState:OverrideSymbol("swap_body", "swap_bkpekkapiece", "swap_body")endlocal function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") owner.AnimState:ClearOverrideSymbol("bkpekkapiece")endlocal function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("armor_slurtleshell") inst.AnimState:SetBuild("bkpekkapiece") inst.AnimState:PlayAnimation("idle") --local minimap = inst.entity:AddMiniMapEntity() --minimap:SetIcon("bkpekkapiece.tex") if not TheWorld.ismastersim then return inst end inst.entity:SetPristine() inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "bkpekkapiece" inst.components.inventoryitem.atlasname = "images/inventoryimages/bkpekkapiece.xml" inst:AddComponent("armor") --inst.components.armor:InitCondition(TUNING.ARMORSNURTLESHELL*.45, .85) inst.components.armor:InitCondition(TUNING.ARMORSNURTLESHELL, TUNING.ARMORSNURTLESHELL_ABSORPTION) inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY inst.components.equippable.walkspeedmult = 0.9 inst:AddComponent("container") inst.components.container:WidgetSetup("treasurechest") --inst.components.container:SetNumSlots(2) -- inst.components.container.widgetslotpos = slotpos -- inst.components.container.widgetanimbank = "uicontainer2x1" -- inst.components.container.widgetanimbuild = "uicontainer2x1" -- inst.components.container.widgetpos = Vector3(-200,0,0) -- inst.components.container.side_align_tip = 100 inst:AddComponent("repairable") inst.components.repairable.repairmaterial = "goldnugget" inst.components.repairable.announcecanfix = false inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) return instendreturn Prefab( "common/inventory/bkpekkapiece", fn, assets) Thanks for help! Link to comment https://forums.kleientertainment.com/forums/topic/49256-crash-could-not-find-anim-anim-in-bank/#findComment-603069 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