Jump to content

Recommended Posts

Did someone here tried to make things glow? (like the glowberry )

I'm looking at wormlight.lua and i found this :

local light = inst.entity:AddLight()    light:SetFalloff(0.7)    light:SetIntensity(.5)    light:SetRadius(0.5)    light:SetColour(169/255, 231/255, 245/255)    light:Enable(true)    inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )

i tried messing with this code to make a character glow :

local Rageglow = function(inst,self)   self.inst.light = inst.entity:AddLight()     local spell = inst:AddComponent("spell")if inst.rage then    inst.rage.components.spell.lifetime = 0   inst.rage.components.spell:ResumeSpell()   inst.components.spell.spellname = "rageglow"   self.inst.light:SetFalloff(0.7)   self.inst.light:SetIntensity(.5)    self.inst.light:SetRadius(0.5)    self.inst.light:SetColour(169/255, 231/255, 245/255)   self.inst.light:Enable(true)    inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) else   self.inst.light:Enable(false) end  end

It's not working ( i'm saying this phrase a lot these days LOL) , someone knows what's missing in the code? Ty peeps.

Link to comment
https://forums.kleientertainment.com/forums/topic/56154-make-things-glow/
Share on other sites

Light (API docs)

 

If thats for your character in specific, just attach is straight to the guy, then disable it when not needed.

 

In other words, don't cast a spell or any of that nonsense, just add these to the character fn:

 

    inst.entity:AddLight() --light is not a component

    inst.Light:SetIntensity(1)
    inst.Light:SetRadius(1)
    inst.Light:SetFalloff(0)
    inst.Light:SetColour(200/255, 170/255, 150/255)

 

Then dis- or enable it using:

 

    inst.Light:Enable(false) --true for turning on

NO...no spell?!Okay :c . Dammit, i was in the right way this time, but i like to complicate things soooo much haha.Ty again mobb :grin: .

EDIT: W8, this actually didn't work, how is this possible? :o Going to check the api docs.

EDIT2: Are you peeps using bootstrap in the website?

Edited by TheShadeofTheNorth

I know this topic is old, but hopefully I can still get some help.

 

This is exactly something I'm looking for for my character but the code doesn't seem to be doing anything and I'm not entirely sure what's wrong. I believe I'm putting it in the right place, it's under the functions with all the other inst. things but when I open the game to test it, there's no glow visible.

I know this topic is old, but hopefully I can still get some help.

 

This is exactly something I'm looking for for my character but the code doesn't seem to be doing anything and I'm not entirely sure what's wrong. I believe I'm putting it in the right place, it's under the functions with all the other inst. things but when I open the game to test it, there's no glow visible.

 

Are you sure you're putting it in right? Can you copy/paste your characters functions into a post so I can see what it looks like?

Are you sure you're putting it in right? Can you copy/paste your characters functions into a post so I can see what it looks like?

 

I believe I am. I mean, I don't know how else to put it in, it seemed pretty straight forward when I was looking around, even more so with this topic here. The game's not crashing at least, so I know it's not entirely wrong. Here's how I put it in with the other things:

 

EDIT: I added the local light thing in as I realized I did not have it, but unfortunately that didn't fix the problem. Lines remain the same as seen below after another reorder test

 

 post-600933-0-95551700-1447964234_thumb.

 

I tried moving the lines around because I thought maybe one of them wasn't placed right, but that didn't fix it.

 

And it's not that it's not dark, I've been testing it while it's night but I have yet to see any kind of glow, it's just pitch black.

Edited by Tiggyloo

I believe I am. I mean, I don't know how else to put it in, it seemed pretty straight forward when I was looking around, even more so with this topic here. The game's not crashing at least, so I know it's not entirely wrong. Here's how I put it in with the other things:

 

EDIT: I added the local light thing in as I realized I did not have it, but unfortunately that didn't fix the problem. Lines remain the same as seen below after another reorder test

 

 attachicon.giffunctions.PNG

 

I tried moving the lines around because I thought maybe one of them wasn't placed right, but that didn't fix it.

 

And it's not that it's not dark, I've been testing it while it's night but I have yet to see any kind of glow, it's just pitch black.

 

That's strange, it should work. Actually, I can't even get it working for me when I try it. But I haven't played around with it yet

so I changed the number for the setFalloff to 0.75 and well

 

this happened

 

 

so it seems I'm getting somewhere now at least

 

Got it to work correctly!

 

post-600933-0-38727200-1447977707_thumb.

 

She just needs her sanity drain boost for rain now and she's all done! Still trying to figure that one out though

Edited by Tiggyloo

oh, right, duh

 

It was in fact working after all, you just have to change the numbers to see it.

 

post-600933-0-34510400-1447986959_thumb.

 

I changed the SetFalloff first and went from there. When the SetFalloff is set to 0 like the initial code there's no actual light around the player. I'm not sure why they decided to set it at 0 when that makes the function practically useless for its intended purpose

Yeah, the light parameters are weird. I think falloff is the radial distance it takes to fade to black, but I'm not sure if it's from the center, or the edge of the radius parameter.

 

This.

 

I wrote a detailed report of my experimentations with offset and the likes on the API docs, but I think hottehead gave up on them and took the site down.

This.

 

I wrote a detailed report of my experimentations with offset and the likes on the API docs, but I think hottehead gave up on them and took the site down.

 

So does that mean it's gone for good? :'c

 

dang. I wish I had archived some of that stuff. That site was such a good source of info

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...