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 How to make a "Wait" in the script.
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#6
RE: How to make a "Wait" in the script.

I'm having trouble understanding why there's a problem because I performed a similar solution in my own map, here's just a snippet:

    AddTimer("opendoor", 0.25f, "TimerOpenDoor");
    AddTimer("lightsout", 1, "TimerOpenDoor");
    AddTimer("stopeffects", 2, "TimerOpenDoor");
    
    StartScreenShake(0.007f,2, 0.25f,1);
    FadePlayerFOVMulTo(1.5, 0.5f);
    
}

void TimerOpenDoor(string &in asTimer)
{

    if(asTimer == "stopeffects")
    {
        
        FadePlayerFOVMulTo(1, 1);
        PlaySoundAtEntity("breath", "react_breath.snt", "Player", 1.0 / 0.75f, false);
        return;
    }
    if(asTimer == "lightsout")
    {
        SetLocalVarInt("lightsout", 1);
        for(int i=4;i<=6;i++)
            SetLampLit("chandelier_simple_short_"+i, false, true);
        for(int i=0;i<=6;i++)
            SetLampLit("LampBlownOut_"+i, false, true);
        PlaySoundAtEntity("breath2", "react_breath.snt", "Player", 1.0 / 1, false);
        return;
    }
    
    PlaySoundAtEntity("Wind", "general_wind_whirl", "Player", 2, false);
    PlaySoundAtEntity("scare", "react_scare.snt", "Player", 0.75f, false);
    
    SetSwingDoorClosed("castle_4", false, false);
    SetSwingDoorDisableAutoClose("castle_4", true);
    
    AddTimer("castle_4", 0.01f, "TimerSwingDoor");
    
    GiveSanityDamage(10, true);

}

^^

And that works just fine. Is the code working correctly? The function TimerLight isn't working? This is weird....

Outside the if statements, in TimerLight, put a command. If that doesn't work, then the whole function isn't working, and it's just an error when calling it.

Oh yeah, so I don't forget, is the script working at all? Are other functions working correctly?

(This post was last modified: 04-10-2012, 05:55 PM by Putmalk.)
04-10-2012, 05:53 PM
Find


Messages In This Thread
How to make a "Wait" in the script. - by iFondue - 04-10-2012, 05:13 PM
RE: How to make a "Wait" in the script. - by Putmalk - 04-10-2012, 05:53 PM



Users browsing this thread: 1 Guest(s)