01-02-2012, 04:02 AM
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
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
(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.
void OnStart()
{
//START MOVE SHELF EVENT1
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
//END MOVE SHELF EVENT1
//START SERVANT BRUTE EVENT1
AddEntityCollideCallback("Player", "monsterspawn_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("servant_brute_1", "servant_grunt_1_remove", "RemoveMonster", true, 1);
//END SERVANT BRUTE EVENT1
//START CROWBAR EVENT1
AddUseItemCallback("", "crowbar_1", "mansion_1", "CrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1);
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 asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//END MOVE SHELF EVENT1
//START SERVANT BRUTE EVENT1
void MonsterFunction(string &in asParent, string &in asChild, int 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 asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
}
//END SERVANT BRUTE EVENT1
//START CROWBAR EVENT1
void CrowbarOnDoor(string &in item, string &in door)
{
SetEntityActive("crowbar_joint_1", true);
RemoveItem("crowbar_1");
}
void crowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
}
void crowbarfunc(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("mansion_1", 0.0f);
SetEntityActive("crowbar_joint_1", false);
}
//END CROWBAR EVENT1
//START KEY EVENT1
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Hidden Door", false, true);
RemoveItem("Hidden door key");
PlaySoundAtEntity("", "unlock_door.snt", "Hidden Door", 0.0f, true);
}
//END KEY EVENT1
void OnEnter()
{
}
void OnLeave()
{
}
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()
{
}
<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 curse. But Remember, The 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't 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 tonight! haha!... </Entry>
<Entry Name="Note_Test08_Name">If anyone read answer...</Entry>
<Entry Name="Note_Test08_Text">If anyone read this. get 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>