Frictional Games Forum (read-only)

Full Version: PlayerLookAt Intro (Pandemoneus')
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I copied Pandemoneus' script for the player to look left and right when he spawns in the map, replaced the entities to look at to the ones in the room I spawn in, but for some reason, it doesn't work even though I don't encounter any errors?

Any help would be appreciated (especially from Pandemoneus Tongue)!

Here's my code for the StartPlayerLookAt:
Code:
void Intro()
{
    AddDebugMessage("Begin Intro", false);
    SetPlayerCrouching(true);
    SetPlayerActive(false);
    FadeOut(0.0f);
    FadeIn(6.0f);
    FadeImageTrailTo(1.0f, 1.0f);
    AddTimer("1", 2, "IntroTimer");
    AddTimer("2", 2.5f, "IntroTimer");
    AddTimer("3", 3, "IntroTimer");
    AddTimer("4", 4, "IntroTimer");
    AddTimer("5", 6, "IntroTimer");
}

void IntroTimer(string &in asTimer)
{
    if(asTimer == "1"){
        PlayGuiSound("player_cough.snt", 0.7f);
    }
    else if(asTimer == "2"){
        SetPlayerCrouching(false);
    }
    else if(asTimer == "3"){
        StartPlayerLookAt("candlestick_tri_1", 2.0f, 1.0f, "");
    }
    else if(asTimer == "4"){
        StopPlayerLookAt();
        StartPlayerLookAt("DoorScript", 3.0f, 3.0f, "");
        PlayGuiSound("react_breath_slow", 0.7f);
    }
    else if(asTimer == "5"){
        StopPlayerLookAt();
        FadeImageTrailTo(0, 1.0f);
        PlayGuiSound("react_breath_slow", 0.5f);
        SetPlayerActive(true);
        SetMessage("Message", "Hint0", 0);
        AddDebugMessage("End Intro", false);
    }
}

EDIT: and I created a DoorScript for the player to look at since I'd like to get the slamming door script working too, so that shouldn't be the problem...
Make sure you do Intro(); in OnStart() Tongue

Code:
//---- BEGIN INTRO ----//
if(!ScriptDebugOn()) Intro(); //no intro when you are testing
else AddDebugMessage("Skipping Intro", false);

By the way, I found ways to make it look better in the code, but I will start using them on my next map.
(09-21-2010, 09:00 PM)Pandemoneus Wrote: [ -> ]Make sure you do Intro(); in OnStart() Tongue

Code:
//---- BEGIN INTRO ----//
if(!ScriptDebugOn()) Intro(); //no intro when you are testing
else AddDebugMessage("Skipping Intro", false);

By the way, I found ways to make it look better in the code, but I will start using them on my next map.

Ohh, maybe that's why... I'll check it out!

EDIT: Yup, that was it, thanks for your help!
Is there any way to combine the StartPlayerLookAt with a WakeUp Script, so it's as if the player had just woken up and then coughs and looks around?

Here's the WakeUp script I have:
Code:
void wakeUp () {
    FadeOut(0);     // Instantly fades the screen out. (Good for starting the game)
    FadeIn(20);      // Amount of seconds the fade in takes
    FadeImageTrailTo(2, 2);
    FadeSepiaColorTo(100, 4);
    SetPlayerActive(false);    
    FadePlayerRollTo(50, 220, 220);                 // "Tilts" the players head
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);              // Simulates being on the ground
    AddTimer("trig1", 11.0f, "beginStory");            // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);        // Change all settings to defaults
    FadeRadialBlurTo(0.0, 1);
    FadeSepiaColorTo(0, 4);
    SetPlayerCrouching(false);
    FadeImageTrailTo(0,1);
}
All you'd have to do is add the look left and right function in the beginStory function. So, when the asleep effects wear off, beginStory runs, and he looks left and right.