J192 Posted December 19, 2014 Share Posted December 19, 2014 (edited) I have been trying to make an armor item that is obviously wearable on the torso. The problem is that the front view animation also displays the on-ground animation and the on-ground animation is not visible. Everything else is displayed properly. This is what's inside armor_cactus.lua:local assets={Asset("ANIM", "anim/armor_cactus.zip"), Asset("ATLAS", "images/inventoryimages/armorcactus.xml"), Asset("IMAGE", "images/inventoryimages/armorcactus.tex"),} local function OnBlocked(owner) owner.SoundEmitter:PlaySound("dontstarve/wilson/hit_armour") end local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "armor_cactus", "swap_body") inst:ListenForEvent("blocked", OnBlocked, owner)end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") inst:RemoveEventCallback("blocked", OnBlocked, owner)end local function fn(Sim)local inst = CreateEntity() inst.entity:AddTransform()inst.entity:AddAnimState() MakeInventoryPhysics(inst) inst.AnimState:SetBank("armor_marble") inst.AnimState:SetBuild("armor_cactus") inst.AnimState:PlayAnimation("anim") inst:AddTag("grass") --inst:AddComponent("inspectable") inst:AddComponent("inventoryitem")inst.components.inventoryitem.foleysound = "dontstarve/movement/foley/grassarmour"inst.components.inventoryitem.atlasname = "images/inventoryimages/armorcactus.xml" inst:AddComponent("fuel") inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORCACTUS_USES, TUNING.ARMORCACTUS_ABSORPTION) inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) return instendreturn Prefab( "common/inventory/armorcactus", fn, assets) --GLOBAL.STRINGS.NAMES.ARMORCACTUS = "Cactus Suit"--GLOBAL.STRINGS.RECIPE_DESC.ARMORCACTUS = "It's all spiny."--GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.ARMORCACTUS = "Gotta go fast."--GLOBAL.STRINGS.CHARACTERS.WILLOW.DESCRIBE.ARMORCACTUS = "I hope there aren't spines on the inside."--GLOBAL.STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.ARMORCACTUS = "Spike plant protects Wolfgang."--GLOBAL.STRINGS.CHARACTERS.WENDY.DESCRIBE.ARMORCACTUS = "I am a dumb emo that says dumb crap about death because I'm dumb."--GLOBAL.STRINGS.CHARACTERS.WX78.DESCRIBE.ARMORCACTUS = "PROTECTIVE BARRIER COMPATIBLE WITH MY METAL CASING"--GLOBAL.STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.ARMORCACTUS = "Provides more offense than defense, but it'll work."--GLOBAL.STRINGS.CHARACTERS.WOODIE.DESCRIBE.ARMORCACTUS = "It does not look safe."--GLOBAL.STRINGS.CHARACTERS.WAXWELL.DESCRIBE.ARMORCACTUS = "I'll look like a pufferfish in this."--GLOBAL.STRINGS.CHARACTERS.WEBBER.DESCRIBE.ARMORCACTUS = "We can be a hedgehog."--GLOBAL.STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.ARMORCACTUS = "Plant armour."This is what's inside armor_cactus.scml:<?xml version="1.0" encoding="UTF-8"?><spriter_data scml_version="1.0" generator="BrashMonkey Spriter" generator_version="b5"> <folder id="0" name="swap_body"> <file id="0" name="swap_body/swap_body-0.png" width="100" height="120" pivot_x="0.504745" pivot_y="0.173962" /> <file id="1" name="swap_body/swap_body-1.png" width="100" height="120" pivot_x="0.573745" pivot_y="0.167712" /> <file id="2" name="swap_body/swap_body-2.png" width="104" height="116" pivot_x="0.411774" pivot_y="0.163366" /> <file id="3" name="swap_body/swap_body-3.png" width="92" height="128" pivot_x="0.586136" pivot_y="0.135355" /> <file id="4" name="swap_body/swap_body-4.png" width="92" height="124" pivot_x="0.457603" pivot_y="0.125407" /> <file id="5" name="swap_body/swap_body-5.png" width="100" height="124" pivot_x="0.637245" pivot_y="0.132867" /> <file id="6" name="swap_body/swap_body-6.png" width="100" height="120" pivot_x="0.504995" pivot_y="0.171254" /> <file id="7" name="swap_body/swap_body-7.png" width="108" height="120" pivot_x="0.63981" pivot_y="0.174796" /> <file id="8" name="swap_body/swap_body-8.png" width="104" height="120" pivot_x="0.411053" pivot_y="0.164796" /> <file id="9" name="swap_body/swap_body-13.png" width="172" height="192" pivot_x="0.445055" pivot_y="0.220576" /> </folder> <entity id="0" name="armor_cactus"> <animation id="0" name="anim" length="34"> <mainline> <key id="0" time="0"> <object_ref id="0" name="swap_body" abs_x="0" abs_y="0" abs_pivot_x="0.445055" abs_pivot_y="0.220576" abs_angle="0" abs_scale_x="1" abs_scale_y="1" abs_a="1" timeline="0" key="0" z_index="1" /> </key> <key id="1" time="34"> <object_ref id="0" name="swap_body" abs_x="0" abs_y="0" abs_pivot_x="0.445055" abs_pivot_y="0.220576" abs_angle="0" abs_scale_x="1" abs_scale_y="1" abs_a="1" timeline="0" key="1" z_index="1" /> </key> </mainline> <timeline id="0" name="swap_body"> <key id="0" time="0" spin="1"> <object folder="0" file="9" x="-5.249" y="4.499" scale_x="1" scale_y="1" angle="0" /> </key> <key id="1" time="34" spin="1"> <object folder="0" file="9" x="-5.249" y="4.499" scale_x="1" scale_y="1" angle="0" /> </key> </timeline> </animation> </entity></spriter_data> This is what's inside swap_body:0 - front view1 - front view skewed to left2 - front view skewed to right3 - side view4 - side view skewed to right5 - side view skewed to left6 - back view7 - back view skewed to left8 - back view skewed to right13 - on ground/dropped Edited December 19, 2014 by J192 Link to comment https://forums.kleientertainment.com/forums/topic/46983-armor-animation-not-displaying-correctly/ 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