Jump to content

How do I fix this?


Blucher

Recommended Posts

This works, I suppose, but only if I drop the amulet on the ground.  I'm not worried about that, but how do I get the amulet to shine light while equipped?

function BlueAmuletPostInit(inst)inst.entity:AddLight()inst.Light:SetRadius(5)inst.Light:SetFalloff(1)inst.Light:SetIntensity(.5)inst.Light:SetColour(128/255,128/255,255/255)inst.Light:Enable(true)endAddPrefabPostInit("blueamulet", BlueAmuletPostInit)
Link to comment
Share on other sites

take a look at the magiluminescence's code that should help you a bit

 

in the meantime I'll try and find it for you and add it to this post

heres the yellow amulets code, it uses the fueled component 

 

[codesyntax]
---YELLOW
local function onequip_yellow(inst, owner) 
    owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "yellowamulet")
 
    if inst.components.fueled then
        inst.components.fueled:StartConsuming()        
    end
 
    inst.Light:Enable(true)
 
    owner.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
 
end
 
local function onunequip_yellow(inst, owner) 
    owner.AnimState:ClearBloomEffectHandle()
    owner.AnimState:ClearOverrideSymbol("swap_body")
    if inst.components.fueled then
        inst.components.fueled:StopConsuming()        
    end
 
    inst.Light:Enable(false)
end

[/codesyntax]

 

it may not be configurable but this part of the code may help

 

 inst.Light:Enable(true)

Link to comment
Share on other sites

take a look at the magiluminescence's code that should help you a bit

[snip]

 

Thank you very much.  This did work:

local assets={Asset("ANIM", "anim/amulets.zip"),Asset("ANIM", "anim/torso_amulets.zip"),}local function onequip_yellow(inst, owner)     owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "yellowamulet")    if inst.components.fueled then        inst.components.fueled:StartConsuming()            end    inst.Light:Enable(true)    owner.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )endlocal function onunequip_yellow(inst, owner)     owner.AnimState:ClearBloomEffectHandle()    owner.AnimState:ClearOverrideSymbol("swap_body")    if inst.components.fueled then        inst.components.fueled:StopConsuming()            end    inst.Light:Enable(false)endfunction BlueAmuletPostInit(inst)    inst.components.equippable:SetOnEquip( onequip_yellow )    inst.components.equippable:SetOnUnequip( onunequip_yellow )     inst.entity:AddLight()    inst.Light:Enable(false)    inst.Light:SetRadius(2)    inst.Light:SetFalloff(0.7)    inst.Light:SetIntensity(.65)    inst.Light:SetColour(128/255,128/255,255/255)endAddPrefabPostInit("blueamulet", BlueAmuletPostInit)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...