Frictional Games Forum (read-only)
(SOLVED) Fade IN a PointLight? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: (SOLVED) Fade IN a PointLight? (/thread-12222.html)



(SOLVED) Fade IN a PointLight? - Shadowfied - 12-31-2011

Okay so I'm making a map where there are lights getting lit as the player moves forward. In one area I want a pointlight to fade in. I've managed to get it to activate when the player reaches the script area but it activates immediately and it looks pretty stupid.
I also managed to get the reverse effect, fading it out using "FadeLightTo("PointLight_1", 0, 0, 0, 0, 13.5 , 1.0f);" but that's not what I want right now.

Is there any way to make a Point Light fade in?

Thanks in advance!



RE: Fade IN a PointLight? - Statyk - 12-31-2011

Try putting a torch/lamp outside of the map somewhere, and attach the pointlight to it, setting the pointlight's color to: 0, 0, 0, 1... Then script the LAMP/TORCH to "SetLampLit("LAMPNAME", false);", then have the LAMP/TORCH scripted "SetLampLit("LAMPNAME", true);" when you need the light to fade it. You should get the effect you like.


RE: Fade IN a PointLight? - Your Computer - 12-31-2011

Have you tried using a timer?


RE: Fade IN a PointLight? - Shadowfied - 12-31-2011

Have yet to try your method Statyk, will do later though.

@Your Computer

How would that help? I want the light to fade in softly, the timing of when it activates does not matter.



RE: Fade IN a PointLight? - Your Computer - 12-31-2011

(12-31-2011, 07:55 PM)Shadowfied Wrote: @Your Computer

How would that help? I want the light to fade in softly, the timing of when it activates does not matter.

My mistake, i was ignoring FadeLightTo's built-in timer. I should have asked, do you know what providing 0 for the RGB values for the light does?


RE: Fade IN a PointLight? - Shadowfied - 01-01-2012

Oh yeah, perhaps that would make it black..Let's see...

Alright now the light stays on but it still doesn't fade in, I use this..
FadeLightTo("PointLight_1", 2, 2, 2, 0, -1 , 3.0f);



RE: Fade IN a PointLight? - Khyrpa - 01-01-2012

(01-01-2012, 12:06 PM)Shadowfied Wrote: Oh yeah, perhaps that would make it black..Let's see...

Alright now the light stays on but it still doesn't fade in, I use this..
FadeLightTo("PointLight_1", 2, 2, 2, 0, -1 , 3.0f);
This doesnt make any sense...
Just put the point lights in editor with 0,0,0,0 values and then use the fadein. There cant be anything else to do. But I'm hesitant because why wouldnt you test that yourself?



RE: Fade IN a PointLight? - Shadowfied - 01-01-2012

(01-01-2012, 01:00 PM)Khyrpa Wrote:
(01-01-2012, 12:06 PM)Shadowfied Wrote: Oh yeah, perhaps that would make it black..Let's see...

Alright now the light stays on but it still doesn't fade in, I use this..
FadeLightTo("PointLight_1", 2, 2, 2, 0, -1 , 3.0f);
This doesnt make any sense...
Just put the point lights in editor with 0,0,0,0 values and then use the fadein. There cant be anything else to do. But I'm hesitant because why wouldnt you test that yourself?
I have a Point light in the map, I want it to fade in as the player enters a script area, I used SetLightVisible to disable it in void OnStart(). But when I enter the script area it still appears immediately but I want it to fade in so that you can see that it's going from dark to bright.




RE: Fade IN a PointLight? - Khyrpa - 01-01-2012

(01-01-2012, 01:04 PM)Shadowfied Wrote: I have a Point light in the map, I want it to fade in as the player enters a script area, I used SetLightVisible to disable it in void OnStart(). But when I enter the script area it still appears immediately but I want it to fade in so that you can see that it's going from dark to bright.
nononono....
If you dont want the player to see the the point light just set the color values to 0. There is no point using setlight visible when you can just tone the value to 0.




RE: Fade IN a PointLight? - Shadowfied - 01-01-2012

(01-01-2012, 01:12 PM)Khyrpa Wrote:
(01-01-2012, 01:04 PM)Shadowfied Wrote: I have a Point light in the map, I want it to fade in as the player enters a script area, I used SetLightVisible to disable it in void OnStart(). But when I enter the script area it still appears immediately but I want it to fade in so that you can see that it's going from dark to bright.
nononono....
If you dont want the player to see the the point light just set the color values to 0. There is no point using setlight visible when you can just tone the value to 0.
Thanks, it works now. I put it at 0,0,0,0 in the editor and used the same script and now it fades in smoothly.

Thanks again.