Jump to content

Recommended Posts

The glow code doesn't work anymore so I'm guessing they modified something about it.
 Does anyone know what they changed? Heres what I usually do:

	inst.entity:AddLight()    inst.Light:Enable(true)    inst.Light:SetRadius(1)    inst.Light:SetFalloff(.6)    inst.Light:SetIntensity(0.9)    inst.Light:SetColour(49/255,114/255,231/255)

But because of recent updates this code makes it so clients can't see the glow anymore.

Edited by rons0n
Link to comment
https://forums.kleientertainment.com/forums/topic/54494-they-updated-lightglow/
Share on other sites

@PeterA, nothing much Peter. I just now realized that all my custom glow items never glowed to the clients ever in the first place. So it's just me being silly because I never tried out the glow as a client before. It's just astonishing no one ever informed me for 3+ months lol.

 

But I guess I'll ask now because I still don't know the answer. Anyone know who to make things glow to the clients? Heres what I have for an example:

 

local assets ={	Asset("ANIM", "anim/formbluegem.zip"),    Asset("ATLAS", "images/inventoryimages/formbluegem.xml"),	Asset("IMAGE", "images/inventoryimages/formbluegem.tex"),}local prefabs = {	"bluegem",}-- Still does nothing. Dunno what it should do...local function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()    MakeInventoryPhysics(inst)	inst.entity:AddTransform()	inst.entity:AddAnimState()	inst.entity:AddSoundEmitter()    inst.entity:AddNetwork()    	inst:AddTag("formbluegem")	    if not TheWorld.ismastersim then        return inst    end		inst.entity:AddLight()    inst.Light:Enable(true)    inst.Light:SetRadius(1)    inst.Light:SetFalloff(.6)    inst.Light:SetIntensity(0.9)    inst.Light:SetColour(49/255,114/255,231/255)		inst.entity:SetPristine()         inst.AnimState:SetBank("formbluegem")    inst.AnimState:SetBuild("formbluegem")    inst.AnimState:PlayAnimation("idle", false)	    MakeHauntableLaunch(inst)    inst:AddComponent("inspectable")		inst:AddComponent("stackable")	inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM			inst:AddComponent("perishable")	inst.components.perishable:SetPerishTime(TUNING.PERISH_ONE_DAY)	inst.components.perishable:StartPerishing()	inst.components.perishable.onperishreplacement = "bluegem"	    inst:AddComponent("inventoryitem")	inst.components.inventoryitem.imagename = "formbluegem"	inst.components.inventoryitem.atlasname = "images/inventoryimages/formbluegem.xml"	    return instendreturn Prefab( "common/inventory/formbluegem", fn, assets) 

 

Much is appreciated

 

Edited by rons0n
   if not TheWorld.ismastersim then        return inst    end

 

This effectively tells the initialization function to check if it's the host, and if not, to exit the function there.  Only the host will execute any commands after that point.  Your code that adds lighting is located just after that if statement, so clients never execute it.

 

Edit: Forgot to mention ya, @rons0n

Edited by Corrosive

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
×
  • Create New...