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
How do I trigger lights?
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#1
How do I trigger lights?

I've tried this

On the leveleditor: the SpotLight I want to use set on not active

In the script:


void Activate_Area(string &in item)
{
SetEntityActive("Suitor_Scare", true);
SetLightVisible("SpotLight_Shadow", true);
}

(This is after I pick up a key)



Note: The light is also on if I start the map, I didn't even triggered it yet.

Help would be appreciated, I won't doubt you can help cuz you guys always have helped me succefully in the past Smile

[Image: 25F7U37.png]
08-10-2012, 02:39 AM
Website Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: How do I trigger lights?

Lights cannot be toggled via the level editor like most other entities, they only work through scripts. Use this function:

SetLightVisible(string& asLightName, bool abVisible);


Place it under void OnStart() and use false for the Boolean argument. When you want to use it in the function to trigger it, use it again, except making the bool true.

Hope that helped.

I rate it 3 memes.
08-10-2012, 02:46 AM
Find
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#3
RE: How do I trigger lights?

(08-10-2012, 02:46 AM)andyrockin123 Wrote: Lights cannot be toggled via the level editor like most other entities, they only work through scripts. Use this function:

SetLightVisible(string& asLightName, bool abVisible);


Place it under void OnStart() and use false for the Boolean argument. When you want to use it in the function to trigger it, use it again, except making the bool true.

Hope that helped.
That worked perfectly!
I was trying to make a Suitor walk past the hallway and cast a shadow using the SpotLight.
Even I got scared and jumped, the effects worked good, thanks!

[Image: 25F7U37.png]
08-10-2012, 02:58 AM
Website Find




Users browsing this thread: 1 Guest(s)