Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Fatal Error
ide Offline
Junior Member

Posts: 20
Threads: 3
Joined: Oct 2010
Reputation: 0
#1
Script Fatal Error

[Image: d354881ae52ddbcd664cb8f14809f7044g.jpg]
Yet again a new scripting problem.

The game throws that error at me when I change levels(from first to second).
The functions that are causing the error don't even exist in the script. Can't figure out what is causing this...
Script:
void OnStart()
{
//AddEntityCollideCallback(string& asParentName, string& asasChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
//18_amb.ogg
AddEntityCollideCallback("Player", "StartArea_1", "spook", true, 1);
AddEntityCollideCallback("Player", "StartArea_1", "spook", true, -1);
AddEntityCollideCallback("Player", "ScriptArea_1", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_10", "spook", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_8", "DoorCloses", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_9", "spook", true, -1);
//AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);
//MyFunc(string &in asItem, string &in asEntity)
AddUseItemCallback("", "key_tomb_1", "mansion_10", "UnlockDoor", true);
SetMessage("help", "2ndstart", 5);
}
void spook(string &in asParent, string &in asChild, int alState){
if(asChild == "StartArea_1")
PlayMusic("02_amb_safe.ogg", false, 1, 1, 1, false);

if (asChild == "ScriptArea_10"){
StopMusic(0, 1);
PlayMusic("12_amb.ogg", false, 1,1,1,false);
SetSwingDoorClosed("mansion_3", false, true);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10,true);
}
if (asChild=="ScriptArea_1" || asChild=="ScriptArea_2" || asChild=="ScriptArea_3" || asChild=="ScriptArea_4")
SetEntityActive("armour_nice_complete_8", false);
if(asChild == "ScriptArea_5"){
PlaySoundAtEntity("", "scare_wood_creak_walk", "ScriptArea_7", 0, false);
PlayMusic("05_event_steps.ogg", false, 1, 1, 1, false);}
if(asChild=="ScriptArea_6")
PlayMusic("01_amb_darkness.ogg", false, 1, 1, 1, false);
AddEntityCollideCallback("Player", "ScriptArea_6", "spook", true, -1);
if (asChild=="ScriptArea_6" && alState==-1)
StopMusic(1, 1);
if(asChild=="ScriptArea_9")
SetEntityPlayerInteractCallback("mansion_13", "GruntComes2", true);
}
void DoorCloses(string &in entity){
SetSwingDoorClosed("mansion_11", true, true);
PlaySoundAtEntity("", "scare_wood_creak_walk", "PathNodeArea_1", 1, false);
}
void GruntComes(string &in entity){
SetEntityActive("servant_grunt_1", true);
SetSwingDoorClosed("mansion_10",true,true);
SetSwingDoorLocked("mansion_10", true, true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 3, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
}
void LightsOut(string &in entity){
SetLampLit("torch_static01_3", false, true);
SetLampLit("torch_static01_5", false, true);
SetLampLit("torch_static01_7", false, true);
SetLampLit("candlestick_floor_18", false, true);
SetLampLit("candlestick_floor_19", false, true);
SetLampLit("torch_static01_6", false, true);
SetLampLit("candlestick_floor_17", false, true);
SetLampLit("torch_static01_8", false, true);
SetLampLit("torch_static01_9", false, true);
SetLampLit("candlestick_floor_16", false, true);
SetLampLit("torch_static01_2", false, true);
SetLampLit("torch_static01_1", false, true);
SetLampLit("torch_static01_4", false, true);
SetLampLit("candlestick_floor_14", false, true);
SetLampLit("candlestick_floor_13", false, true);
SetLampLit("candlestick_floor_15", false, true);
SetLampLit("torch_static01_10", false, true);
SetLampLit("candlestick_floor_25", false, true);
SetLampLit("candlestick_floor_26", false, true);
SetLampLit("candlestick_floor_12", false, true);
SetLampLit("candlestick_floor_11", false, true);
SetLampLit("candlestick_floor_10", false, true);
PlaySoundAtEntity("", "scare_wind", "WindArea", 0, false);
PlayMusic("20_event_darkness.ogg", false, 1, 1, 1, false);
SetMessage("help", "lightsout", 5);
}
void UnlockDoor(string &in asItem, string &in asEntity){
SetSwingDoorLocked( asEntity, false, true);
}
void GruntComes2(string &in entity){
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 3, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
}
void OutDoorInfo(){
SetMessage("help", "outside", 5);
void CellarDoorInfo(){
SetMessage("help", "cellar", 5);
}
void OnEnter()
{
}
void OnLeave()
{
}
10-16-2010, 04:29 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#2
RE: Script Fatal Error

MulleDK19's XML validator shows no errors?


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-16-2010, 04:35 PM
Find
ide Offline
Junior Member

Posts: 20
Threads: 3
Joined: Oct 2010
Reputation: 0
#3
RE: Script Fatal Error

Valid. According to the validator.
10-16-2010, 04:49 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#4
RE: Script Fatal Error

The error message show a path that makes absolutely no sense:

custom_stories/Hotel/custom_stories/Hotel/maps/C:/Program Files (x86)/Amnesia - The Dark Descent/redist/custom_stories/Hotel/maps/koe2.hps

Of course it can't load the script, the path is invalid. Maybe check file locations?
It looks like it tries to call functions in OnStart() that do not exist and the other way round, really screwed up..


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-16-2010, 04:59 PM
Find
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#5
RE: Script Fatal Error

Wow, Never seen a error like THAT before.
10-16-2010, 10:49 PM
Find
ide Offline
Junior Member

Posts: 20
Threads: 3
Joined: Oct 2010
Reputation: 0
#6
RE: Script Fatal Error

Are the second map's functions supposed to be in the OnStart or OnEnter? Just wondering...
10-19-2010, 07:46 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#7
RE: Script Fatal Error

(10-19-2010, 07:46 PM)ide Wrote: Are the second map's functions supposed to be in the OnStart or OnEnter? Just wondering...

Neither, they have their own script file!


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-19-2010, 08:19 PM
Find
ide Offline
Junior Member

Posts: 20
Threads: 3
Joined: Oct 2010
Reputation: 0
#8
RE: Script Fatal Error

I know. But are they in their own script file inside OnStart or OnEnter?
10-20-2010, 03:16 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#9
RE: Script Fatal Error

Depends on when you want them to be called. The ones you want to be called the first time the player enters the map and then never again, put in OnStart().

Everything in OnStart() gets called when the level loads the FIRST time.
OnEnter() is for the functions that need to be called when the player enters the map, be it the 2nd, 3rd or 4th time..

So I believe Big Grin


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-20-2010, 03:21 PM
Find
ide Offline
Junior Member

Posts: 20
Threads: 3
Joined: Oct 2010
Reputation: 0
#10
RE: Script Fatal Error

My Custom Story project has really clogged because of this problem. Any suggestions?
11-04-2010, 09:03 PM
Find




Users browsing this thread: 4 Guest(s)