Frictional Games Forum (read-only)

Full Version: Script Help Please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please help I cannot find what is wrong with my script here-

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
AddEntityCollideCallback("Player", "AreaDoorSlam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DoorSlam", false, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityDamage(5.0f, true);
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate");
GiveSanityBoostSmall();
}
void func_slam(string &in asParent, string &in asChild, int alState)
}

Nothing comes after this? And notice that your brackets are messed up there. Try this:

void func_slam(string &in asParent, string &in asChild, int alState)
{
}


PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

Whats up here? You should press the return button in between the PlaySounds, so it's like this.

PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

Other then that everything looks good. No missing semi-colons or quotes.


For future reference, the error message that appears when loading the map contains a reference to the line where the problem originates. There are 2 numbers in brackets e.g. (27, 10). The first number (in this example '27') is the line number where the problem is occuring. This helps to track down the issue