Frictional Games Forum (read-only)

Full Version: Script Fatal Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[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:
Code:
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()
{
}
MulleDK19's XML validator shows no errors?
Valid. According to the validator.
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..
Wow, Never seen a error like THAT before.
Are the second map's functions supposed to be in the OnStart or OnEnter? Just wondering...
(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!
I know. But are they in their own script file inside OnStart or OnEnter?
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
My Custom Story project has really clogged because of this problem. Any suggestions?