Frictional Games Forum (read-only)
[SCRIPT] Lighting Complications [RESOLVED] - 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: [SCRIPT] Lighting Complications [RESOLVED] (/thread-21257.html)



Lighting Complications [RESOLVED] - BonesTheRabbit - 04-24-2013

Code:
void OnStart()
{    
    SetEntityConnectionStateChangeCallback("ArchiveLamp_01", "Light_01");
}

void Light_02(string &in asEntity, int alState){ FadeLightTo("ArchiveLight_01", 1, 0, 0, 1, 4.0, 1.0); }

So, this code doesn't seem to want to work. In essence, I just want a point light to activate when I light a lamp entity. I can't use a connection, because the light is a different color than the lamp. Halp?


RE: Lighting Complications - 7heDubz - 04-24-2013

Is there a script that will check if Light A is on and then use a condition that is light A is on then activate pointlight B?


RE: Lighting Complications - BonesTheRabbit - 04-24-2013

(04-24-2013, 05:11 AM)WIWWM Wrote: Is there a script that will check if Light A is on and then use a condition that is light A is on then activate pointlight B?

I have absolutely no idea. I've looked through, and there doesn't seem to be much regarding lamps outside of a function to turn them on or off. Handy if you want a gust of wind to blow them out, but... Well, that's all I can find. Lighting a lamp doesn't seem to count as interacting with it, either. Needless to say, I'm stumped.


RE: Lighting Complications - FlawlessHappiness - 04-24-2013

Use connected lights.

Click the spot light and make all the color values 0.

Then click the lamp and go to the entity tab.
Paste the name of the light in the tab called something like "Connected light".
Adjust the lighting color from 1 to 0.5
Set the lamp unlit.


RE: Lighting Complications - BonesTheRabbit - 04-24-2013

(04-24-2013, 05:35 AM)BeeKayK Wrote: Use connected lights.

Click the spot light and make all the color values 0.

Then click the lamp and go to the entity tab.
Paste the name of the light in the tab called something like "Connected light".
Adjust the lighting color from 1 to 0.5
Set the lamp unlit.

I thought this made the light the same color as the lamp.


RE: Lighting Complications - DeAngelo - 04-24-2013

You could always make a custom entity version of the lamp where the light is the color you want your pointlight to be. Then connect them. Would probably look better too to have the ambient pointlight that comes with the lamp be the same color as your pointlight.


RE: Lighting Complications - FlawlessHappiness - 04-24-2013

It does make the light the same color as the lamp. I'm guessing you just wanted a brighter area of the lamp.
If not, use SetEntityCallbackFunc.

Inside the function put:

if(asType == abLit)
{
Fade the light
}