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
Script Help Light scripting
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#5
RE: Light scripting

(07-11-2014, 06:28 PM)Amn Wrote: SetLightVisible( light_name, true/false );

If the light it's an entity, use SetEntityActive( entity_name, true/false );

If you want the light to turn off after a sound it's over, calculate the time and use a timer, for a 10 seconds delay use this:
AddTimer ( "light_name", 10, "TurnOffLight" );

This is the function the timer should call to turn off
void TurnOffLight ( string &in light )
{ SetLightVisible( light, false ); }

If you're using AddEffectVoice you can use SetEffectVoiceOverCallback to set a function after the voice is over.

I tried the script without the voice. This is my script:

void OnStart()
{
SetEntityCallbackFunc("knop", "PlayVoice");
}

void PlayVoice(string &in asEntity, int alState)
{
SetLightVisible( "roomlight", true );
AddTimer ( "roomlight", 10, "TurnOffLight" );
{
void TurnOffLight ( string &in light )
{
SetLightVisible( "roomlight", false );
}
}

------------------------

It tells me: ''unexpected end of file'' when I test the level. What did I do wrong?
07-11-2014, 06:41 PM
Find


Messages In This Thread
Light scripting - by goodcap - 07-11-2014, 04:35 PM
RE: Light scripting - by Rapture - 07-11-2014, 05:23 PM
RE: Light scripting - by goodcap - 07-11-2014, 06:01 PM
RE: Light scripting - by Daemian - 07-11-2014, 06:28 PM
RE: Light scripting - by goodcap - 07-11-2014, 06:41 PM
RE: Light scripting - by Daemian - 07-11-2014, 06:49 PM
RE: Light scripting - by goodcap - 07-11-2014, 06:50 PM
RE: Light scripting - by Daemian - 07-11-2014, 06:59 PM



Users browsing this thread: 1 Guest(s)