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
Script Help Help with my story
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
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)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 08-26-2012, 04:15 PM by The chaser.)
08-26-2012, 04:14 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Help with my story

I don't think any script error could cause a black box; a crash possibly, but not a black box. The script looks fine from what I've observed, could you post your extra_english.lang?

I rate it 3 memes.
08-27-2012, 06:27 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Help with my story

Before i modified the script, the map worked perfectly. The .lang file is the same, but if you want it, here you have (but careful, it can ruin the story!)
I made the lang file with a program of the Frictional Games wiki.

.lang file:

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">The mind is something that can be very dark... prepare yourself.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note1_Name">Journal</Entry>
<Entry Name="Note_note1_Name">Hello, Daniel...</Entry>
<Entry Name="Note_note1_Text">Daniel... I'm your opposite. Your other side, your other dimension... I'm the dark part of you. As it, i'll try to kill you. Simple, isn't? Let's see if I can do it... Perhaps your "good mind" puts other notes for there, don't read them.</Entry>
<Entry Name="Note_note2_Name">Daniel, read this, please...</Entry>
<Entry Name="Note_note2_Text">Daniel... something terrible happened. You must survive, and of course, you have to escape. A new virus infected you, and it corrupted the brain. Me, your mind. Now you have two minds in your head, the dark one and me. Daniel. Fight your fears. You must fight him. Watch out. Be careful. </Entry>
<Entry Name="Note_note3_Name">Test 1: Dark mind</Entry>
<Entry Name="Note_note3_Text">Man, this is going to be good. Try to escape from my servants if you can. Let's see what you got.</Entry>
<Entry Name="Note_note4_Name">Test 2: Dark mind</Entry>
<Entry Name="Note_note4_Text">Damn! You did it! You survived! No, this is not going to be this way, YOU WILL DIE. Yes, you will. Let's see what you can do, enemy.</Entry>
<Entry Name="Note_note5_Name">Good mind</Entry>
<Entry Name="Note_note5_Text">Daniel, i know what's wrong. I must tell you that you are going to have a true nightmare. Find the key, get out of here and kill the master. He's a brute, it is going to be hard to defeat.I'll just try to put the necessary tools for doing it. But now you have priorities.</Entry>
<Entry Name="Note_note6_Name">Dark mind</Entry>
<Entry Name="Note_note6_Text">You are doing it... no, you are not going to escape. Nevermind, try to do it in here. Are you so sure yo will do it? No, you will DIE in here. Yes, that's it. Oh, i've done one thing... you will see it when you stop reading this note.</Entry>
<Entry Name="Note_note7_Name">Good mind</Entry>
<Entry Name="Note_note7_Text">Daniel, i discovered a very important thing. Some monsters dissapear with fog. If you find some, try to use it with them.</Entry>
<Entry Name="Note_note8_Name">Daniel, read this</Entry>
<Entry Name="Note_note8_Text">Daniel, you must hurry. He is finishing with me, kill the master! In this room you can see it: The dark mind is winning. That can't happen, you must kill the master, or we are going to die.</Entry>
<Entry Name="Note_FINAL_good_Name">Your final stand</Entry>
<Entry Name="Note_FINAL_good_Text">Daniel, this is the final. The enemy is going to appear. The only thing i can say is good luck. Kill the master. I put a hammer so you can crush his bones. It won't be easy, but... Good luck.</Entry>
</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name="WalkQuest_1">I should hide in that wardrobe.</Entry>
<Entry Name="WalkQuest">I think that i must run...</Entry>
<Entry Name="WalkQuest_2">What? A servant? Damn it...</Entry>
<Entry Name="WalkQuest_final">I.. I did it! I killed him! I'm free!</Entry>
</CATEGORY>
<CATEGORY Name="Ending">
<Entry Name="Credits">The chasing: Made by TheNoobLevelCreator. [br]This is my first story,[br]and it may have some errors, [br]but i hope everyone enjoyed this story. [br]You can find me in the Frictional Games Forum.[br][br]*-Thanks to:[br][br]A friend (Rembar) who gave me ideas)[br]Jennifer Orange[br]Frictional Games, for releasing amnesia[br]and the necessary tools for making this custom story.[br]The Frictional Games forum, for being so attentive and helping the persons with needs.[br][br][br]*-Music (they are modified)[br]Credits: Amon Amarth: Valhalla awaits me[br]Master fight: Shadow of the colossus soundtrack(The opened way)[br][br]</Entry>
</CATEGORY>
<CATEGORY Name="Levels">
<Entry Name="Art room">Art room</Entry>
<Entry Name="?">What is this? Should I enter?</Entry>
<Entry Name="Downstairs">Downstairs</Entry>
<Entry Name="I should cross...">I should cross...</Entry>
</CATEGORY>
</LANGUAGE>

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-27-2012, 08:55 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Help with my story

The problem isn't with the script, or the lang... it seems to be from THE MAP. Yes, i'm surprised. I've tried to quit the script and my personal wood planks (i changed the wooden planks.dae to .ent). Nothing.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-27-2012, 01:28 PM
Find




Users browsing this thread: 1 Guest(s)