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
Help needed with "Intro script"
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Help needed with "Intro script"

Use these functions to make the player seem dazed/injured etc:

Teleport the Player to a PlayerStart area:
TeleportPlayer(string areaname);

Tilted/lowered head:
FadePlayerRollTo(float X, float speed, float maxspeed);
MovePlayerHeadPos(float x, float y, float z, float speed, float slowdowndist);

Move/Look speed multipliers:
SetPlayerMoveSpeedMul(float multiplier);
SetPlayerRunSpeedMul(float multiplier);
SetPlayerLookSpeed(float multiplier);

Image effects:
FadeImageTrailTo(float amount, float speed);
FadeSepiaColorTo(float amount, float speed);


Amnesia's faint sequences in the beginning use the head position/tilt controllers. You can script blackouts with FadeOut(float time); and FadeIn(float time);

Use a good combination of these functions using a switch function, which lets you tightly control the sequence without having to use multiple functions (like FunctionOne doing the blackout while FunctionTwo does the sound effects)

Here's a good example of an event switch function:

void SwitchFuncScaryEvent(string &in timer) {
    switch(GetLocalVarInt("eventStep")) {
        case 1:
            //Player sees something scary happen!
            AddTimer("nextstep", 1, "SwitchFuncScaryEvent");
        break;
        case 2:
            //Player reacts to said scary thing!
            AddTimer("nextstep", 1, "SwitchFuncScaryEvent");
        break;
        case 3:
            //Another part of the event happens, even more scary stuff!
            AddTimer("nextstep", 1, "SwitchFuncScaryEvent");
        break;
        case 4:
            //Player falls down and gasps!
            AddTimer("nextstep", 1, "SwitchFuncScaryEvent");
        break;
        case 5:
            //Player blacks out!
            AddTimer("nextstep", 1, "SwitchFuncScaryEvent");
        break;
    }
    
    AddLocalVarInt("eventstep", 1);
}
You can control the time between each step in the function by editing the timer duration in the step before it. This is how FG did their events, and boy did they do it well. With some practice you can make really convincing and detailed events using one or perhaps two functions!

(This post was last modified: 07-17-2011, 09:24 AM by palistov.)
07-17-2011, 09:22 AM
Find


Messages In This Thread
Help needed with "Intro script" - by HumiliatioN - 07-16-2011, 11:34 PM
RE: Help needed with "Intro script" - by palistov - 07-17-2011, 09:22 AM
RE: Help needed with "Intro script" - by palistov - 07-17-2011, 07:38 PM



Users browsing this thread: 1 Guest(s)