Frictional Games Forum (read-only)
[LVL ED] SpotLight still active? - 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: [LVL ED] SpotLight still active? (/thread-48628.html)



SpotLight still active? - goodcap - 05-31-2016

I've placed a light box in my level and when you activate it you see a picture on the wall. Obviously this is done with a spotlight and that all works fine.

There's one problem, though. The spotlight is active and is lit from the beginning, even though it's in-active in the level editor. Is this some kind of bug?


ProjectLight" ACTIVE []

void Projector(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("ProjectLight", true);
PlaySoundAtEntity("ProjectorSound", "OldMovieProjector.snt", "Projector", 1, false);

}


RE: SpotLight still active? - Romulator - 05-31-2016

In OnStart(), use SetLightVisible(); to make it invisible.

Otherwise in OnStart() and your callback, use FadeLightTo(); instead.

PHP Code:
void FadeLightTo(stringasLightNamefloat afRfloat afGfloat afBfloat afAfloat afRadiusfloat afTime); 

Quote:Changes the properties of a light.

asLightName - internal name
afR - red value
afG - green value
afB - blue value
afA - alpha value
afRadius - radius of the light. -1 means keeping the radius
afTime - time in seconds until change is done

The simplest way would be to just copy and paste the R/G/B values you have assigned in your Level Editor (and divide them by 255 to get the decimal float value), but change the alpha to 0 or 1 (invisible and visible), -1 for radii and 0.01f for the time needed.