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"
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
RE: Help needed with "Intro script"

(07-17-2011, 09:22 AM)palistov Wrote: 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!


Okay begin was good but he teleports "Player doesn't fall down he automatic teleport and then he rotates he's head 90 degrees right then later he is normally state. and i can move... its stupid how i can make it more realistic I dont understand that Scaryevent advanced timer thing.


“Life is a game, play it”
(This post was last modified: 07-17-2011, 07:21 PM by HumiliatioN.)
07-17-2011, 07:20 PM
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 HumiliatioN - 07-17-2011, 07:20 PM
RE: Help needed with "Intro script" - by palistov - 07-17-2011, 07:38 PM



Users browsing this thread: 1 Guest(s)