Help with my story
Hi, Forum.
Some persons already know that i'm making my CS the chasing. So, i tried to fix something and then i wanted to add realism.
The player gets chased by a brute in a hallway. The problem was that the monster had to be there always, so the scare was always there. The player could survive with a doors that i put in the hallway, so it had time. I made something so the monster always appeared, but there was an issue: The doors didn't stay. That way, the monster always killed the player. So, i made a teleport system (you touch the door, you appear in the other side). Then, you appear in another part.
Please, pay attention, because it is a bit complicated.
If you had a hammer, you appear there with wooden planks closing the door (Daniel is supposed to do that with the hammer. But, if you don't have it, the monster will appear and you will have to run.
I had to make a variable, but then it gave an error:
From BlackBox:
Exception Reason:
Amnesia.exe caused an EXCEPTION_ACCESS_VIOLATION in module Amnesia.exe at 0023:005480B4
Stack Trace
0023:005480B4 Amnesia.exe
0023:005495C1 Amnesia.exe
0023:0052DA32 Amnesia.exe
This is the script:
void OnStart()
{
SetLocalVarInt("Var1", 0);
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
AddEntityCollideCallback("Player", "Slam_area", "func_slam", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "explosion", true, 1);
AddUseItemCallback("", "Key_1", "Slam_2", "FUNCTION", true);
AddEntityCollideCallback("Player", "ScriptArea_3", "Madness_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Chase_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "Brute_1", true, 1);
AddEntityCollideCallback("servant_brute_2", "ScriptArea_5", "Disable_Brute_1", true, 1);
AddEntityCollideCallback("Player", "Check", "DiePlayer", true, 1);
AddEntityCollideCallback("Player", "SG", "fear", true, 1);
SetEntityCallbackFunc("Slam_2", "Teleport_1");
SetEntityCallbackFunc("DT2", "Teleport_2");
SetEntityCallbackFunc("DT3", "Teleport_3");
SetEntityCallbackFunc("DT4", "Teleport_4");
SetEntityCallbackFunc("DT5", "Teleport_5");
SetEntityCallbackFunc("NECESSARY", "OnPickup");
}
void OnPickup (string &in asEntity, string &in type)
{
AddLocalVarInt("Var1", 1);
}
void Teleport_1 (string &in asEntity, string &in type)
{
TeleportPlayer("T1");
SetEntityActive("servant_brute_1", true);
}
void Teleport_2 (string &in asEntity, string &in type)
{
TeleportPlayer("T2");
}
void Teleport_3 (string &in asEntity, string &in type)
{
TeleportPlayer("T3");
}
void Teleport_4 (string &in asEntity, string &in type)
{
TeleportPlayer("T4");
}
void Teleport_5 (string &in asEntity, string &in type)
{
TeleportPlayer("T5");
}
void fear (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Hallu", true);
SetEnemyDisableTriggers("Hallu", true);
if (alState == 1)
{
SetEntityActive("plank_2.5m_3", true);
SetEntityActive("plank_2.5m_1", true);
SetEntityActive("plank_2.5m_2", true);
SetEntityActive("plank_2.5m_4", true);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void DiePlayer(string &in asParent, string &in asChild, int alState)
{
CheckPoint("StartUpCP", "PlayerStartArea_2", "AfterDeath", "", "");
}
void Disable_Brute_1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_2", false);
}
void Brute_1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Troll", true);
SetEntityActive("servant_brute_2", true);
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_2", 10, "");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_3", 10, "");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_4", 0, "");
SetMessage("Messages", "WalkQuest_1", 3);
}
void Chase_1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
ShowEnemyPlayerPosition ("servant_brute_1");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
}
void Madness_1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive ("slime_pile_1", true);
SetEntityActive ("slime_pile_2", true);
SetEntityActive ("slime_pile_3", true);
SetEntityActive ("slime_pile_4", true);
SetEntityActive ("slime_6way_1", true);
SetLightVisible ("PointLight_1", true);
FadeOut (1);
StartScreenShake(0.1, 4.7, 0.05, 0.5);
AddTimer("", 1, "Madness_as");
PlayMusic("insanity_monster_roar03", false, 10, 0.1, 10, false);
}
void Madness_as(string &in asTimer)
{
FadeIn(6);
}
void FUNCTION (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
RemoveItem(asItem);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Slam_1", true, true);
GiveSanityDamage(5.0f, true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, true);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, true);
}
void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
ShowEnemyPlayerPosition ("servant_grunt_2");
}
void explosion(string &in asParent, string &in asChild, int alState)
{
SetEntityActive ("corpse_male_1", true);
SetEntityActive ("corpse_male_2", true);
SetEntityActive ("corpse_male_3", true);
AddPropForce("corpse_male_1", 5, 4, 76, "world");
AddPropForce("corpse_male_3", 40, 4, 6, "world");
AddPropForce("corpse_male_2", 0, 0, 76, "world");
GiveSanityDamage(50.0f, true);
PlaySoundAtEntity("", "21_intro_scream.snt", "Player", 0, true);
}
void AfterDeath (string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "ScriptArea_4", "Chase_1", true, 1);
AddEntityCollideCallback("Player", "SG", "fear", true, 1);
SetEntityCallbackFunc("Slam_2", "Teleport_1");
SetEntityCallbackFunc("DT2", "Teleport_2");
SetEntityCallbackFunc("DT3", "Teleport_3");
SetEntityCallbackFunc("DT4", "Teleport_4");
SetEntityCallbackFunc("DT5", "Teleport_5");
}
void OnEnter ()
{
}
void OnLeave()
{
}
PD: Sorry for bad english!
THE OTHERWORLD (WIP)
Aculy iz dolan.
(This post was last modified: 08-26-2012, 04:15 PM by The chaser.)
|