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
FadeLightTo not working properly
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
FadeLightTo not working properly

I placed a PointLight in the game, with the following values:

Name: PointLight_1
R: 0
G: 0
B: 0
A: 1
Radius: 3.5

And I'm using a script to turn it on red.

PHP Code: (Select All)
void OnEnter()
{    
    
AddTimer("guardian"10.0f"TimerGuardian");
}

void TimerGuardian(string &in asTimer)
{
    
AddTimer("roar"RandFloat(20.0f45.0f), "TimerRoar");
    
PlaySoundAtEntity("""guardian_activated.snt""Player"0false);
    
SetRadialBlurStartDist(0.2f);
    
FadeRadialBlurTo(0.070.015f);
    
StartScreenShake(0.01f4.0f0.5f,0.3f);
    
SetPropActiveAndFade("slime_6way_1"true1.0f);
    
FadeLightTo("PointLight_1"0.8f0.0f0.0f1.0f, -12.0f);
    
PlaySoundAtEntity("""slime_create.snt""slime_6way_1"0false);


Yet, for some reason, it's not working properly. I see no change for 2 seconds, and at the end of it--when the light should be fully red--it flashes red for just a split second, but otherwise stays dark.

I've searched my script and there is nothing else that can be turning it off.

Full script below if you want to see it, but I don't think it will help:

Spoiler below!
PHP Code: (Select All)
void TimerRumble(string &in asTimer)
{
    
StartScreenShake(0.01f5.0f1.0f1.0f);
    
CreateParticleSystemAtEntity("","ps_green_wind_breeze.ps""SmokeArea"false);
    
PlayGuiSound("03_cloud_solo.snt"1.0f);
    
AddTimer("rumble"RandFloat(20.0f45.0f), "TimerRumble");
}

void StartBrute(string &in asEntity)
{
    
SetEntityActive("servant_brute_1"true);
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_132"0.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_135"2.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_142"3.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_139"3.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_135"2.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_132"0.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"0.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_4"0.001f"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_5"0.001f"");
}

///////////////////////////////
// START SHADOW
///////////////////////////////

void TimerRoar(string &in asTimer)
{
    
PlaySoundAtEntity("""guardian_ontop.snt""Player"0false);
    
StartScreenShake(0.01f4.0f0.5f,0.3f);
    
AddTimer("roar"RandFloat(20.0f45.0f), "TimerRoar");
}

void TimerGuardian(string &in asTimer)
{
    
AddLocalVarInt("GuardianStep"1);
    
float fEventSpeed 10.0f;
    
    switch(
GetLocalVarInt("GuardianStep")) {
        case 
1:
            
AddTimer("roar"RandFloat(20.0f45.0f), "TimerRoar");
            
PlaySoundAtEntity("""guardian_activated.snt""Player"0false);
            
//SetRadialBlurStartDist(0.2f);
            //FadeRadialBlurTo(0.07, 0.015f);
            //StartScreenShake(0.01f, 4.0f, 0.5f,0.3f);
            
SetPropActiveAndFade("slime_6way_1"true1.0f);
            
FadeLightTo("PointLight_1"0.8f0.0f0.0f1.0f, -12.0f);
            
PlaySoundAtEntity("""slime_create.snt""slime_6way_1"0false);
        break;
        case 
2:
            
SetPropActiveAndFade("slime_pile_large_1"true1.0f);
            
SetPropActiveAndFade("slime_6way_3"true1.0f);
            
SetPropActiveAndFade("slime_egg_2"true1.0f);
            
SetPropActiveAndFade("slime_pile_1"true1.0f);
            
SetPropActiveAndFade("slime_6way_2"true1.0f);
            
SetPropActiveAndFade("slime_egg_1"true1.0f);
            
SetPropActiveAndFade("slime_3way_1"true1.0f);
            
SetPropActiveAndFade("slime_anim_wall_1"true1.0f);
            
FadeLightTo("PointLight_2"0.8f0.0f0.0f1.0f, -12.0f);
            
PlaySoundAtEntity("""slime_create.snt""slime_pile_large_1"0false);
            
SetPropActiveAndFade("slime_6way_4"true1.0f);
            
SetPropActiveAndFade("slime_anim_wall_2"true1.0f);
            
SetPropActiveAndFade("slime_anim_ceiling_1"true1.0f);
            
SetPropActiveAndFade("slime_3way_2"true1.0f);
            
SetPropActiveAndFade("slime_egg_3"true1.0f);
            
SetPropActiveAndFade("slime_pile_2"true1.0f);
            
SetPropActiveAndFade("slime_pile_3"true1.0f);
            
SetPropActiveAndFade("slime_pile_large_2"true1.0f);
            
FadeLightTo("PointLight_3"0.8f0.0f0.0f1.0f, -12.0f);
        break;
        case 
3:
            
SetPropActiveAndFade("slime_pile_5"true1.0f);
            
SetPropActiveAndFade("slime_egg_4"true1.0f);
            
SetPropActiveAndFade("slime_6way_5"true1.0f);
            
SetPropActiveAndFade("slime_3way_3"true1.0f);
            
SetPropActiveAndFade("slime_pile_4"true1.0f);
            
SetPropActiveAndFade("slime_anim_wall_3"true1.0f);
            
SetPropActiveAndFade("slime_pile_large_3"true1.0f);
            
FadeLightTo("PointLight_4"0.8f0.0f0.0f1.0f, -12.0f);
            
PlaySoundAtEntity("""slime_create.snt""slime_pile_large_1"0false);
            
SetPropActiveAndFade("slime_anim_ceiling_2"true1.0f);
            
SetPropActiveAndFade("slime_egg_6"true1.0f);
            
SetPropActiveAndFade("slime_6way_6"true1.0f);
            
SetPropActiveAndFade("slime_pile_large_4"true1.0f);
            
SetPropActiveAndFade("slime_egg_5"true1.0f);
            
SetPropActiveAndFade("slime_anim_wall_4"true1.0f);
            
SetPropActiveAndFade("slime_pile_6"true1.0f);
        break;
    }
    if(
GetLocalVarInt("GuardianStep") < 27)  AddTimer("guardian"fEventSpeed"TimerGuardian");
}

//////////////////////
////////////////////////////
// Run first time starting map
void OnStart()
{
    
SetMapDisplayNameEntry("sanctuary");
    if(
HasItem("gold"))
    {
        
SetEntityActive("gold"false);
    }
    if(
HasItem("vitriol"))
    {
        
SetEntityActive("vitriol"false);
    }
    
SetEntityPlayerInteractCallback("chemical_container_1""StartBrute"true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{    
        
AddTimer("guardian"10.0f"TimerGuardian");
        
PlayMusic("TGW_35_chase"true1100true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
    
SetupLoadScreen("LoadingText4""Loading"5"ch4load.jpg");



(This post was last modified: 01-01-2013, 12:07 AM by Damascus.)
12-31-2012, 11:55 PM
Find




Users browsing this thread: 1 Guest(s)