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
Need help with script
Zuror Offline
Junior Member

Posts: 1
Threads: 1
Joined: Feb 2011
Reputation: 0
#1
Need help with script

when you pick up the lantern a monster is supposed to spawn and a door is supposed to bang but there is some problem with the script.

void Interact_Lantern(string &in asEntity, string &in asType)
{
    SetEntityActive("servant_grunt_1" , true);
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0.0f, "");
    PlaySoundAtEntity("snd_monst", "amb_alert.snt", "servant_grunt_1", 0, false);

    
    PlaySoundAtEntity("bangs", "05_event_door_bang", "mansion_16", 1, false);
    PlaySoundAtEntity("whineaa", "scare_whine_loop", "Player", 0.5f, false);

    StartPlayerLookAt("mansion_16", 6, 40, "");
    StartPlayerLookAt("servant_grunt_1", 6, 40, "");
    StartPlayerLookAt("mansion_16", 6, 40, "");
        
    FadeSepiaColorTo(0.75f, 0.3f);
    FadeImageTrailTo(1.5, 0.5);
    
    AddTimer("bang1", 0.6f, "TimerBangDoor");
    AddTimer("bang2", 1.6f, "TimerBangDoor");
    AddTimer("bang3", 2.5f, "TimerBangDoor");
    AddTimer("bang4", 3.0f, "TimerBangDoor");
}
void TimerBangDoor(string &in asTimer)
{    
    if(asTimer == "bang1"){
        AddPropImpulse("mansion_16", 0, 0, 5, "World");
        PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);
        CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_16", false);
        StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
        GiveSanityDamage(10, true);
    }
    else if(asTimer == "bang2") {
        AddPropImpulse("mansion_16", 0, 0, 5, "World");
        CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_16", false);
        StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
    }
    else if(asTimer == "bang3") {
        AddPropImpulse("mansion_16", 0, 0, 5, "World");
        PlaySoundAtEntity("scare", "react_breath", "Player", 0.5f, false);
        CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_16", false);
        StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
    }
    else {
        SetSwingDoorLocked("mansion_16", false, false);
        FadeSepiaColorTo(0, 0.3f);
        FadeImageTrailTo(0, 0.1);
        StopSound("whineaa", 4);
        AddTimer("timerRes", 5.0f, "TimerResetPlayer");
    }
}
(This post was last modified: 02-15-2011, 10:35 PM by Zuror.)
02-15-2011, 10:32 PM
Find




Users browsing this thread: 1 Guest(s)