Flickering Light from Blackout Radiant Map?

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Perplex
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: March 5th, 2010, 12:02 pm
Location: Germany

Flickering Light from Blackout Radiant Map?

Post by Perplex » April 23rd, 2012, 6:27 pm

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Flickering Light from Blackout Radiant Map?

Post by Drofder2004 » April 24th, 2012, 12:20 am

setLightIntensity is a Single Player only command.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Perplex
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: March 5th, 2010, 12:02 pm
Location: Germany

Re: Flickering Light from Blackout Radiant Map?

Post by Perplex » April 24th, 2012, 4:20 pm

ah okay, than i need to find a other way like light move (brush move)


thx drofder

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Flickering Light from Blackout Radiant Map?

Post by Rezil » April 24th, 2012, 6:14 pm

You can make a flickering light in EffectsEd, then spawn and loop that effect in your map.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests