Frictional Games Forum (read-only)

Full Version: How do I trigger lights?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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!