Randomdeamon

  • Content Count

    7
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Randomdeamon

  1. trying to get an item to work. from what i get it might be a load up error, nothing to do with the character. local assets= { Asset("ANIM", "anim/Healtorch.zip"), Asset("ANIM", "anim/swap_Healtorch.zip"), Asset("ANIM", "anim/torch.zip"), Asset("ANIM", "anim/swap_torch.zip"), Asset("SOUND", "sound/common.fsb"), Asset("ATLAS", "images/inventoryimages/cadstaff.xml"), Asset("IMAGE", "images/inventoryimages/cadstaff.tex"), } local prefabs = { "torchfire" } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_Healtorch", "swap_Healtorch") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") inst.components.equippable.dapperness = TUNING.CRAZINESS_MED 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 say(speaker, words) if speaker and speaker.components.talker then speaker.components.talker:Say(words) end end local function healtarget(staff, target) local owner = staff.components.inventoryitem.owner if target:HasTag("player") or not target:HasTag("monster") then target.components.health:DoDelta(40) else say(owner, "DontActdum.") end end local function usecadstaff(staff, target) local owner = staff.components.inventoryitem.owner if not owner:HasTag("mond") then say(owner, "I don't know how to use it!") return end if target ~= nil and target.components.health ~= nil then if target.components.health.currenthealth < target.components.health.maxhealth then healtarget(staff,target) else say(owner, "He's/She's fine") end end end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("torch") inst.AnimState:SetBuild("swap_torch") inst.AnimState:PlayAnimation("idle") inst.AnimState:SetBank("cadstaff") inst.AnimState:SetBuild("cadstaff") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst.entity:SetPristine() inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "Healtorch" inst.components.inventoryitem.atlasname = "images/inventoryimages/cadstaff.xml" inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(usecadstaff) inst.components.spellcaster.canuseontargets = true inst.components.spellcaster.canonlyuseonlocomotors = true inst:AddComponent("weapon") inst.components.weapon:SetDamage(TUNING.TORCH_DAMAGE) inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return inst end return Prefab("common/inventory/Healtorch", fn, assets, prefabs)