Script Help Please - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Script Help Please (/thread-14300.html) |
Script Help Please - EthanLancaster - 03-28-2012 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(); } RE: Script Help Please - DaAinGame - 03-28-2012 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. RE: Script Help Please - Adrianis - 03-28-2012 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 |