Page 1 of 2

Lightsource issue

Posted: Mon Oct 15, 2012 11:20 pm
by Leki
Hi .
Is there a way to create "non fading" lightsource? I mean stable source of light without "pulse effect".

Re: Lightsource issue

Posted: Mon Oct 15, 2012 11:38 pm
by Komag
You can just set the life to be crazy high, like a million seconds

Re: Lightsource issue

Posted: Mon Oct 15, 2012 11:40 pm
by Neikun
I wonder if the same could be achieved if the life is set to zero?

Re: Lightsource issue

Posted: Mon Oct 15, 2012 11:46 pm
by Lmaoboat
Neikun wrote:I wonder if the same could be achieved if the life is set to zero?
That just makes no light at all, and kills any existing light. However, the light still counts as existing in terms of scripting, so creating a light, setting it's duration to 0 to get rid of it, and creating it again will cause an error if not spaced apart, which as really annoying until we got :destroy().

Re: Lightsource issue

Posted: Tue Oct 16, 2012 12:08 am
by Lmaoboat
Also, you can make a fade-in effect by using an "anti-light" who's fade out makes it cancel out less and less of the actual light.

Code: Select all

spawn("timer", self.level, self.x, self.y, self.facing, self.id.."time")
:setTimerInterval(2.1)
:addConnector("activate", self.id, "pulse")
:activate()

function pulse()
		spawn("fx", self.level, self.x, self.y, self.facing, self.id.."light2")
		:setLight(-1,-1,-1,10,5,1,true)
		:translate(0,1,0)
		spawn("fx", self.level, self.x, self.y, self.facing, self.id.."light1")
		:setLight(1,1,1,10,5,2,true)
		:translate(0,1,0)
end

Re: Lightsource issue

Posted: Tue Oct 16, 2012 7:10 am
by Szragodesca
Lmaoboat wrote:Also, you can make a fade-in effect by using an "anti-light" who's fade out makes it cancel out less and less of the actual light.
SpoilerShow

Code: Select all

spawn("timer", self.level, self.x, self.y, self.facing, self.id.."time")
:setTimerInterval(2.1)
:addConnector("activate", self.id, "pulse")
:activate()

function pulse()
		spawn("fx", self.level, self.x, self.y, self.facing, self.id.."light2")
		:setLight(-1,-1,-1,10,5,1,true)
		:translate(0,1,0)
		spawn("fx", self.level, self.x, self.y, self.facing, self.id.."light1")
		:setLight(1,1,1,10,5,2,true)
		:translate(0,1,0)
end
Does that have the same grainy effect as the negative light value I tested in the slimes thread? If not, it may be closer to what I was going for with the dark slime anti-light (although it wasn't meant to pulse). I can't test it for myself, since I'm off to work, but if it could be tied to a mob to cause a moving unlight aura, that would be wicked. :twisted:

Re: Lightsource issue

Posted: Tue Oct 16, 2012 9:09 am
by Leki
I am sorry, maybe I asked in wrong way. :oops:
I would like to create a lightsource with constant intensity. Each light in Grimrock is "pulsating": torch, ceiling lamp, light spell etc. I want lightsource without this effect if it's possible. I am missing "pulsating" boolean in light entity - maybe creating of this kind of light is not possible. :cry:

Re: Lightsource issue

Posted: Tue Oct 16, 2012 11:46 am
by Szragodesca
Basically, you want a lightbulb, not a torch. Consistent, even glow as opposed to flicker.

I could definitely see a use for that in some Dungeon (metal) themed dungeons. I don't doubt someone will try to modernize LoG in a map or 2, and some magelights would be consistent as well (better for reading tomes). :)

Re: Lightsource issue

Posted: Tue Oct 16, 2012 9:56 pm
by Leki
Szragodesca wrote:Basically, you want a lightbulb, not a torch. Consistent, even glow as opposed to flicker.

I could definitely see a use for that in some Dungeon (metal) themed dungeons. I don't doubt someone will try to modernize LoG in a map or 2, and some magelights would be consistent as well (better for reading tomes). :)
... or sunlight for outdoor scene?

Re: Lightsource issue

Posted: Thu Oct 18, 2012 2:30 am
by Lmaoboat
Leki wrote:I am sorry, maybe I asked in wrong way. :oops:
I would like to create a lightsource with constant intensity. Each light in Grimrock is "pulsating": torch, ceiling lamp, light spell etc. I want lightsource without this effect if it's possible. I am missing "pulsating" boolean in light entity - maybe creating of this kind of light is not possible. :cry:
Oh, that's easy, just create an FX entity and use FX:setLight(red, green, blue, brightness, range, time, castShadow)