Page 1 of 1

Flickering Light from Blackout Radiant Map?

Posted: April 23rd, 2012, 6:27 pm
by Perplex
Hello everyone,

currently i am working on a new map and found in the blackout map (inclued in the compiletools) the Flickering Light

i tryd to inclued it but failed hard with it.

someone can explain how to get it work?

here is the code i found from blackout_code.gsc

Code: Select all

sleepy_shack()
{
        shack_guys = getentarray( "shack_guy", "targetname" );
        array_thread( shack_guys, ::spawn_ai );
        
        shack_light = getent( "shack_light", "targetname" );
        intensity = shack_light getLightIntensity();
        shack_light setLightIntensity( 0 );
        
        flag_wait( "second_shacks" );
        flag_wait( "high_alert" );
        wait( 1.5 );
        
        sleep_alert_trigger = getent( "sleep_alert_trigger", "targetname" );
        if ( level.player istouching( sleep_alert_trigger ) )
        {
                // don't flick the lights on if the player is standing in a place that reveals our lack of light flicking animation
                return;
        }
        
        // light flickers on
        /* 
        shack_light setLightIntensity( intensity );
        wait( 0.3 );
        shack_light setLightIntensity( 0 );
        wait( 0.01 );
        shack_light setLightIntensity( intensity );
        wait( 0.2 );
        shack_light setLightIntensity( 0 );
        wait( 1 );
 
        timer = 2;
        timer *= 20;
        
        for ( i = 0; i < timer; i++ )
        {
                new_intensity = intensity * ( 1 / ( timer - i ) );
                new_intensity *= randomfloatrange( 0.3, 1.7 );
                shack_light setLightIntensity( new_intensity );
                wait( 0.05 );
        }
        */ 
 
        timer = 2;
        timer *= 20;
        for ( i = 0; i < timer; i++ )
        {
                new_intensity = intensity * ( 1 / ( timer - i ) );
                new_intensity *= randomfloatrange( 0.3, 1.7 );
                shack_light setLightIntensity( new_intensity );
                wait( 0.05 );
        }
        
        shack_light setLightIntensity( intensity );
}
 
hope someone can help me get it work :S

best regards

Re: Flickering Light from Blackout Radiant Map?

Posted: April 24th, 2012, 12:20 am
by Drofder2004
setLightIntensity is a Single Player only command.

Re: Flickering Light from Blackout Radiant Map?

Posted: April 24th, 2012, 4:20 pm
by Perplex
ah okay, than i need to find a other way like light move (brush move)


thx drofder

Re: Flickering Light from Blackout Radiant Map?

Posted: April 24th, 2012, 6:14 pm
by Rezil
You can make a flickering light in EffectsEd, then spawn and loop that effect in your map.