Frictional Games Forum (read-only)
Turn PointLight off with switch - 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: Turn PointLight off with switch (/thread-15960.html)



Turn PointLight off with switch - Ananaias - 06-08-2012

I used PointLight to make a room very bright, then all lights/lamps will be turned off when the player uses a switch that is needed to progress.

I figured out the code for making the lamps turn off, but I'm having a hard time with turning PointLights off. Any help?

EIDT: dammit, put this in the wrong spot on accident. Sorry ;~;


RE: Turn PointLight off with switch - Dutton - 06-08-2012

[BadJoke] EIDT = Electrical IDentification Technology [/BadJoke]

EDIT:
I'm not sure that your able to do that, but if possible it could open up some possibilities Smile


RE: Turn PointLight off with switch - Traggey - 06-08-2012

Moved to development support.


RE: Turn PointLight off with switch - Your Computer - 06-08-2012

SetLightVisible.


RE: Turn PointLight off with switch - Ananaias - 06-08-2012

This is my coding so far:

PHP Code:
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever""func_shelf");
}

void func_shelf(string &in asEntityint alState)
{
    if (
alState == 1)
{
    
SetSwingDoorLocked("lockthisshit"truetrue);
    
SetLampLit("light1room2"falsetrue);
    
SetLampLit("light2room2"falsetrue);
    
SetLampLit("light3room2"falsetrue);
    
SetLampLit("light4room2"falsetrue);
    
SetLampLit("light5room2"falsetrue);
    
SetLampLit("light6room2"falsetrue);
    
SetLampLit("light7room2"falsetrue);
    
SetLampLit("light8room2"falsetrue);
    
SetLampLit("light9room2"falsetrue);
    
SetMoveObjectState("shelf"1.0f);
    
PlaySoundAtEntity("""quest_completed.snt""rotatearea"0false);
        return;
    }


I'm assuming I would replace "SetLampLit" with "SetLightVisible"?

EDIT: decided to try that, and I guess that's wrong. Got this error:

[Image: zCmE]

Sorry if this is an easy fix, I'm still very new to this stuff. Sad

EDIT2: Awesome, I figured it out.

SetLightVisible("point1room2", false); is what I was looking for. Thanks Smile