Search the Community
Showing results for tags 'add'.
Found 1 result
-
I want to make shining hand item - weapon kind. My base was lightbulb at first, and then "torch" but there came an little issue... I tried following codes: local assets={ Asset("ANIM", "anim/orbstaff.zip"), Asset("ANIM", "anim/swap_orbstaff.zip"), Asset("ATLAS", "images/inventoryimages/orbstaff.xml"), Asset("IMAGE", "images/inventoryimages/orbstaff.tex"),} local prefabs ={ "torchfire",} local function fn() local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_orbstaff", "swap_orbstaff") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") inst.fire = SpawnPrefab( "torchfire" ) --inst.fire.Transform:SetScale(.125,.125,.125) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( owner.GUID, "swap_object", 0, -110, 1 ) end local function OnUnequip(inst, owner) inst.fire:Remove() inst.fire = nil owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() local sound = inst.entity:AddSoundEmitter() MakeInventoryPhysics(inst) anim:SetBank("orbstaff") anim:SetBuild("orbstaff") anim:PlayAnimation("idle") inst:AddComponent("inspectable") inst:AddTag("sharp") inst:AddComponent("weapon") inst.components.weapon:SetDamage(48) inst:AddComponent("characterspecific") inst.components.characterspecific:SetOwner("wayrra") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "orbstaff" inst.components.inventoryitem.atlasname = "images/inventoryimages/orbstaff.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return instendreturn Prefab("common/inventory/orbstaff", fn, assets)I also tried the lightbulb one but didn't work at all.. local light = inst.entity:AddLight()light:SetFalloff(0.7)light:SetIntensity(.5)light:SetRadius(1)light:SetColour(230/255, 230/255, 100/255)light:Enable(true)After using torchfire the item does shine when Equipped and stops when not equipped but you know how the torch/willow lighter looks - it has FIRE ANIMATION (yellow sparks, flames thing following the torch stick) Is there anyway to remove showing of flames and leaving only LIGHT? I tried commenting out some lines but effects where like: NO LIGHT AT ALL or LIGHT + FLAMES visible -.- Guess I'm lost :/