TheShadeofTheNorth Posted July 14, 2015 Share Posted July 14, 2015 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 endIt'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 Share on other sites More sharing options...
Mobbstar Posted July 14, 2015 Share Posted July 14, 2015 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 Link to comment Share on other sites More sharing options...
TheShadeofTheNorth Posted July 14, 2015 Author Share Posted July 14, 2015 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 .EDIT: W8, this actually didn't work, how is this possible? Going to check the api docs.EDIT2: Are you peeps using bootstrap in the website? Link to comment Share on other sites More sharing options...
TheShadeofTheNorth Posted July 16, 2015 Author Share Posted July 16, 2015 Got it working, just a code positioning problem Link to comment Share on other sites More sharing options...
Tiggyloo Posted November 19, 2015 Share Posted November 19, 2015 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. Link to comment Share on other sites More sharing options...
pickleplayer Posted November 19, 2015 Share Posted November 19, 2015 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? Link to comment Share on other sites More sharing options...
Arkathorn Posted November 19, 2015 Share Posted November 19, 2015 Most light sources aren't particularly visible unless it's nighttime, could that be it? Link to comment Share on other sites More sharing options...
Mobbstar Posted November 19, 2015 Share Posted November 19, 2015 Most light sources aren't particularly visible unless it's nighttime, could that be it? For reference, gold and ghost's glow differs from normal light in that they're using "anim.ksh" for special rendering. Link to comment Share on other sites More sharing options...
Tiggyloo Posted November 19, 2015 Share Posted November 19, 2015 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 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. Link to comment Share on other sites More sharing options...
pickleplayer Posted November 19, 2015 Share Posted November 19, 2015 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 functions.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 Link to comment Share on other sites More sharing options...
Tiggyloo Posted November 19, 2015 Share Posted November 19, 2015 I'm going to mess around with it more and see if I can figure it out. If you figure it out, please let me know! Link to comment Share on other sites More sharing options...
Tiggyloo Posted November 19, 2015 Share Posted November 19, 2015 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! She just needs her sanity drain boost for rain now and she's all done! Still trying to figure that one out though Link to comment Share on other sites More sharing options...
pickleplayer Posted November 20, 2015 Share Posted November 20, 2015 don't you want to tell us how you fixed it so that others who have the same problem that read this later can know how you fixed it?Maybe if TheShadeOfTheNorth had done the same, it would have helped you fix it earlier Link to comment Share on other sites More sharing options...
Tiggyloo Posted November 20, 2015 Share Posted November 20, 2015 oh, right, duh It was in fact working after all, you just have to change the numbers to see it. 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 Link to comment Share on other sites More sharing options...
Arkathorn Posted November 20, 2015 Share Posted November 20, 2015 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. Link to comment Share on other sites More sharing options...
Mobbstar Posted November 20, 2015 Share Posted November 20, 2015 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. Link to comment Share on other sites More sharing options...
pickleplayer Posted November 20, 2015 Share Posted November 20, 2015 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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.