Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turn PointLight off with switch
Ananaias Offline
Junior Member

Posts: 20
Threads: 7
Joined: Jun 2012
Reputation: 0
#1
Turn PointLight off with switch

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 ;~;
(This post was last modified: 06-08-2012, 09:05 AM by Ananaias.)
06-08-2012, 08:55 AM
Find
Dutton Offline
Member

Posts: 121
Threads: 3
Joined: Apr 2012
Reputation: 2
#2
RE: Turn PointLight off with switch

[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

[Image: 15isy6C]
(This post was last modified: 06-08-2012, 09:20 AM by Dutton.)
06-08-2012, 09:16 AM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#3
RE: Turn PointLight off with switch

Moved to development support.
06-08-2012, 09:37 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Turn PointLight off with switch

SetLightVisible.

Tutorials: From Noob to Pro
06-08-2012, 06:11 PM
Website Find
Ananaias Offline
Junior Member

Posts: 20
Threads: 7
Joined: Jun 2012
Reputation: 0
#5
RE: Turn PointLight off with switch

This is my coding so far:

PHP Code: (Select All)
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
(This post was last modified: 06-08-2012, 08:38 PM by Ananaias.)
06-08-2012, 08:26 PM
Find




Users browsing this thread: 2 Guest(s)