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
Configuration Files Help How do i make the end of the storie when player enter area
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#8
RE: How do i make the end of the storie when player enter area

Okay, make a script area to the right, and another to the left. name them "lookright" and "lookleft"... Add the area the player walks into to start the event. Name this "startlookarea". Then put this in corrresponding areas.

//_________________________

void OnStart()
{
AddEntityCollideCallback("Player", "startlookarea", "endinglook_func", true, 1); //begins the look left and right
}

//LOOKING FUNCTIONS
void endinglook_func(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("lookleft", 2, 3, ""); //looks at the left script area
SetPlayerActive(false); //sets playability off
AddTimer("lookrighttimer", 4, "startlookright"); //timer to look right
}

void startlookright(string &in asTimer)
{
StartPlayerLookAt("lookright", 3, 4, ""); //looks at the right script area
AddTimer("falltimer", 6, "fall_func"); //timer to fall
}

void fall_func(string &in asTimer)
{
MovePlayerHeadPos(0, -1.4f, 0.5f, 5, 0.5f); //drops view to the floor
FadePlayerRollTo(80, 0.7f, 20); //rolls head 80 degrees
FadeOut(2); //fades out screen to black
StopPlayerLookAt(); //stops player looking at the script area
AddTimer("endingtimer", 3, "rollcredits_func"); //timer to end game
}

void rollcredits_func(string &in asTimer)
{
StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, 3); //keep it 3 or higher, or the credits will post an out-of-place code at the bottom.
}


//_____________________________

AAAAAAANNNND there it it is! looking, fall, and fade out to credits... Can't believe I did all that XD also, here is the info for the "startcredits":

Starts the end credits screen.
asMusic - the music to play (including .ogg)
abLoopMusic - determines whether the music should loop
asTextCat - the category to be used in the .lang file (must be “Ending”)
asTextEntry - the entry in the .lang file (must be “MainCredits”)
alEndNum - Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.

EDIT: add:

StopPlayerLookAt();

in "void fall_func(string &in asTimer)"
(This post was last modified: 01-02-2012, 05:15 AM by Statyk.)
01-02-2012, 05:10 AM
Find


Messages In This Thread
RE: How do i make the end of the storie when player enter area - by Statyk - 01-02-2012, 05:10 AM



Users browsing this thread: 1 Guest(s)