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
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
How do i make the end of the storie when player enter area

Hello i have been working with a story a while a test one how do i make a ending with creds when player enter area or more this you enter area you looking around then you fall down (Die) and the map is done any tip

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-02-2012, 04:02 AM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: How do i make the end of the storie when player enter area

PHP Code: (Select All)
void StartCredits(stringasMusicbool abLoopMusicstringasTextCatstringasTextEntryint alEndNum); 
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.


(Taken from: http://wiki.frictionalgames.com/hpl2/amn..._functions)

Creator of The Dark Treasure.
01-02-2012, 04:09 AM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: How do i make the end of the storie when player enter area

How do i make that the player to look around the ending place then he falling down then the cred starts

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-02-2012, 04:19 AM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#4
RE: How do i make the end of the storie when player enter area

Well, make some script areas where you want the player to look, then use StartPlayerLookAt function to make him look at a specific area. You can use timers to make him look at several different areas, and to stop looking, use StopPlayerLookAt.

If you want the player to fall down somewhere, use a block box and then set it inactive with SetEntityActive script when you want him to fall down.

Creator of The Dark Treasure.
01-02-2012, 04:23 AM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#5
RE: How do i make the end of the storie when player enter area

(01-02-2012, 04:23 AM)junkfood2121 Wrote: Well, make some script areas where you want the player to look, then use StartPlayerLookAt function to make him look at a specific area. You can use timers to make him look at several different areas, and to stop looking, use StopPlayerLookAt.



If you want the player to fall down somewhere, use a block box and then set it inactive with SetEntityActive script when you want him to fall down.



So i will make area for that look func
How is that script sorry im new :S Never done , force player to look Sad

void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt(); is it that
And how do i make a few of them i want him to look at left after that right then he falling down...
this is my hps
PHP Code: (Select All)
void OnStart()
{
//START MOVE SHELF EVENT1
    
SetEntityConnectionStateChangeCallback("lever""func_shelf");
//END MOVE SHELF EVENT1

//START SERVANT BRUTE EVENT1
    
AddEntityCollideCallback("Player""monsterspawn_1""MonsterFunction"true1); 
    
AddEntityCollideCallback("servant_brute_1""servant_grunt_1_remove""RemoveMonster"true1);
//END SERVANT BRUTE EVENT1

//START CROWBAR EVENT1
    
AddUseItemCallback("""crowbar_1""mansion_1""CrowbarOnDoor"true);
    
AddEntityCollideCallback("crowbar_joint_1""door_script_1""crowbarfunc"true1);
    
SetEntityActive("crowbar_joint_1"false);
//END CROWBAR EVENT1
//START KEY EVENT1
AddUseItemCallback("""Hidden door key""Hidden Door""KeyOnDoor"true); 
}
//END KEY EVENT1

//START MOVE SHELF EVENT1
void func_shelf(string &in asEntityint alState)
{
if (
alState == 1)
{
    
SetMoveObjectState("shelf",1.0f);
    
PlaySoundAtEntity("""quest_completed.snt""shelf_move_1"0false);
    return;
}
}
//END MOVE SHELF EVENT1


//START SERVANT BRUTE EVENT1 
void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"true); 
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_4"2"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_7"0"");
}    

void RemoveMonster(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"false);

//END SERVANT BRUTE EVENT1

//START CROWBAR EVENT1
void CrowbarOnDoor(string &in itemstring &in door)
{
    
SetEntityActive("crowbar_joint_1"true);
    
RemoveItem("crowbar_1");
}

void crowbar(string &in asItemstring &in asEntity)
{
    
SetEntityActive("crowbar_joint_1"true);
}

void crowbarfunc(string &in asParentstring &in asChildint alState)
{
    
SetPropHealth("mansion_1"0.0f);
    
SetEntityActive("crowbar_joint_1"false);
}
//END CROWBAR EVENT1

//START KEY EVENT1
void KeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("Hidden Door"falsetrue);
RemoveItem("Hidden door key");
PlaySoundAtEntity("""unlock_door.snt""Hidden Door"0.0ftrue);
}
//END KEY EVENT1

void OnEnter() 
{

}

void OnLeave() 
{



http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 01-02-2012, 04:34 AM by jessehmusic.)
01-02-2012, 04:28 AM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#6
RE: How do i make the end of the storie when player enter area

Here's a rough example. I added comments that you can check in the code. Smile

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "Area_End", "End", true, 1); //Defines the collidebox
}

void End(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false); //Makes the player unable to move
StartPlayerLookAt("Area_Left", 5.0f, 5.0f, ""); //Forces the player to look at Area_Left

AddTimer("LookRight", 2.0f, "LookTimer"); //After 2 seconds, the player will look at the Area_Right box
AddTimer("PlayerFall", 5.0f, "LookTimer"); //After 5 seconds, the player will fall down
AddTimer("RollCredits", 8.0f, "LookTimer"); //After 8 seconds, the credits will roll
}

void LookTimer(string &in asTimer)
{
if(asTimer == "LookRight") //If the time is "LookRight", this will happen etc
{
StartPlayerLookAt("Area_Right", 5.0f, 5.0f, "");
}

if(asTimer == "PlayerFall")
{
SetEntityActive("block_box_1", false); //Disables the block-box that is preventing the player from falling down
}

if(asTimer == "RollCredits")
{
StartCredits("musicfile.ogg", true, "Credits", "EntryCredits", 2); /*Start credits. Replace musicfile.ogg with your music, "Credits" with the credits category in your lang file,
"EntryCredits" with the entry of your credits in the lang file*/
}
}

void OnEnter()
{

}

void OnLeave()
{
}

Creator of The Dark Treasure.
01-02-2012, 05:04 AM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#7
RE: How do i make the end of the storie when player enter area

then i need 3 area's right... or do i have wrong how did i make a falling box :S or can i talk to you in skype

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-02-2012, 05:07 AM
Website Find
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
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#9
RE: How do i make the end of the storie when player enter area

how do i make that category in .lang
here is .lang
PHP Code: (Select All)
<LANGUAGE>
    <
CATEGORY Name="CustomStoryMain">
        <
Entry Name="Description">
            
You have been knocked down by the guards of Camelot
            
But they thought you were a warlock.They locked you in and decide to let you die in prison.
            
But they didnt know the castle was under an curseBut RememberThe darkness is hunting you!....
            
Year 1500 was there a warlock that created this curse to make the castle die out.
            
The warlock was called "Lord Cronos"
            
The king of Camelot had killed all of lord Cronos family..
            And 
now he is back and taking he's revange. Flee from the castle alive!..


        </Entry>
    </CATEGORY>
    <CATEGORY Name="Journal">
        <Entry Name="Note_Test01_Name">Run!</Entry>
        <Entry Name="Note_Test01_Text">If you read this RUN!!!</Entry>
        <Entry Name="Note_Test02_Name">Dont!</Entry>
        <Entry Name="Note_Test02_Text">Please dont kill me , DONT KILL ME AHHHH...</Entry>
        <Entry Name="Note_Test03_Name">A curese? 1/3</Entry>
        <Entry Name="Note_Test03_Text">Oktober 1670.[br] I dont know why i have this feeling.[br] I just dont know, i was eating dinner with my friend.[br]Then when i come home i just had this feeling it must be a curse.[br]Last monday i was walking to the village.[br]And i heard the people  was talking about "Cronos".[br] (rest of the note is gone...maybe i find it later?</Entry>    
          <Entry Name="Note_Test04_Text">He won'
do anthing to help the people out![br]I have to do something![br]But what can i do im just a slave...[br]But i know some friends that work for the king.[br]He can't let his men  leave those people to die...HE CANT!!!!</Entry>
        <Entry Name="Note_Test04_Name">Left to die in darkness...</Entry>
        <Entry Name="Note_Test05_Text">I can'
t believe that he left us here to die...[br]I can't believe it!.LET HIM BRUN IN HELL</Entry>
        <Entry Name="Note_Test05_Name">My last words - James</Entry>
        <Entry Name="Note_Test06_Name">Report From The Cells</Entry>
        <Entry Name="Note_Test06_Text"> have done what you told me to do.[br]I have killed all warlocks , all cursed people.[br]What is next work for me now.[br](Can'
t see what it says...)</Entry>
        <
Entry Name="Note_Test07_Name">I Found A Way!!</Entry>
        <
Entry Name="Note_Test07_Text">I have found a way to make the king pay!!![br]If i just stick to the plan he will die tonighthaha!... </Entry>
        <
Entry Name="Note_Test08_Name">If anyone read answer...</Entry>
        <
Entry Name="Note_Test08_Text">If anyone read thisget out of the castle![br]The king has gone mad!! you have to stop him![br]He killed all those innocent people..[br]I tried to stop him but i coudn't but remember that Cronos wont let you live his curse have made this castle to a dead end..</Entry>
</CATEGORY>

        <CATEGORY Name="Inventory">
        <Entry Name= "ItemName_Door key">Door key</Entry>
        <Entry Name= "ItemDesc_Door key">Key for an wooden door</Entry>
        <Entry Name= "ItemName_Old door key">Door key</Entry>
        <Entry Name= "ItemDesc_Old door key">Old door key</Entry>
        <Entry Name= "ItemName_Door Key III">Door Key</Entry>
        <Entry Name= "ItemDesc_Door Key III">Maybe this key work to the next door?</Entry>
        <Entry Name= "ItemName_Rusty Key">Rusty Key</Entry>
        <Entry Name= "ItemDesc_Rusty Key">Rusty Key , but where does it go..</Entry>
        <Entry Name= "ItemName_Main hall key">Main hall key</Entry>
        <Entry Name= "ItemDesc_Main hall key">key for main hall</Entry>
        <Entry Name= "ItemName_Hidden door key">Hidden Door Key</Entry>
        <Entry Name= "ItemDesc_Hidden door key">A Key For An Hidden Door..</Entry>
        </CATEGORY>
    <CATEGORY Name="Messages">
        <Entry Name="RememberToCloseTheDoor">Remember to close the door. </Entry>
    </CATEGORY>
    <CATEGORY Name="MainCredits">
    
    </CATEGORY>
    </LANGUAGE> 

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 01-02-2012, 05:24 AM by jessehmusic.)
01-02-2012, 05:22 AM
Website Find
Statyk Offline
Schrödinger's Mod

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

<CATEGORY Name="CreditsCat">
<Entry Name="CreditsEntry">BLAH BLAH credits go here!</Entry>
</CATEGORY>



The category name and entry name don't have to follow like the description of the function says. it can be to your liking.
(This post was last modified: 01-02-2012, 05:31 AM by Statyk.)
01-02-2012, 05:26 AM
Find




Users browsing this thread: 3 Guest(s)