Jump to content

Crash: Could not find anim [anim] in bank [...]


Recommended Posts

[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:


 

 

Thanks.

 

Link to comment
Share on other sites

I changed

inst.AnimState:SetBank("mynewarmor")

to

inst.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 :p.

I'm so lost.

Link to comment
Share on other sites

@rezecib, I tried understanding that but failed. I can't override containers.widgetsetup because my prefab is the same name "bkpekkapiece".

 

Here's my code

Issue1: crash when opening armor (supposed to have 2 inv slots)

Issue2: invisible when dropped

Issue3: 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
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...