Error Hps - 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: Error Hps (/thread-24706.html) |
Error Hps - ZIEGMEBALLEN - 02-26-2014 Amnesia says that Script not Valid Error ( 10,1) Unexpected token.. How to fix this ? //////////////////////////// // Run first time starting map void OnStart() { AddUseItemCallback("", "SecondRoomKey_1", "SecondRoom_1", "UsedKeyOnDoor", true); AddUseItemCallback("", "Corridorkey_1", "Level_2", "UsedKeyOnDoor", true); } void Teleport1(string &in asParent, string &in asChild, int alStates); { AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1); SetEntityActive("TeleportingNG_1", true); PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false); AddPropForce("TeleportingNG_1", -10000, 0, 0, "world"); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("SecondRoom_1", false, true); SetSwingDoorLocked("Level_2", false, true); PlaySoundAtEntity("", "unlock_door", "SecondRoom_1", 0, false); PlaySoundAtEntity("", "unlock_door", "Level_2", 0, false); RemoveItem("SecondRoomKey_1"); RemoveItem("Corridorkey_1"); } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Error Hps - Mudbill - 02-26-2014 You have a semi-colon at the end of this contructor: Code: void Teleport1(string &in asParent, string &in asChild, int alStates); Remove that. Also, this thread should be in CS Development > Development Support. RE: Error Hps - ZIEGMEBALLEN - 02-26-2014 (02-26-2014, 10:06 AM)Mudbill Wrote: You have a semi-colon at the end of this contructor: Yes! Thank you. It finally worked, but my jump scare didn't it's on the script. void Teleport1(string &in asParent, string &in asChild, int alStates) { AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1); SetEntityActive("TeleportingNG_1", true); PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false); AddPropForce("TeleportingNG_1", -10000, 0, 0, "Player"); } How do i make this work ? And by the way i loved your videos , i subscribed you RE: Error Hps - Mudbill - 02-26-2014 You can't call the collision callback within itself or else it never starts. You need to move the AddEntityCollideCallback somewhere else, probably to OnStart. RE: Error Hps - Romulator - 02-26-2014 At the end of your void, remove the s from the "states", so it becomes: PHP Code: void Teleport1(string &in asParent, string &in asChild, int alState) And as Mudbill said: You should also put that AddEntityCollideCallback in your OnStart() RE: Error Hps - ZIEGMEBALLEN - 02-26-2014 (02-26-2014, 10:50 AM)Mudbill Wrote: You can't call the collision callback within itself or else it never starts. You need to move the AddEntityCollideCallback somewhere else, probably to OnStart. Okay it worked now, my jumpscare appear.. Anyway sorry if i keep giving you problem at my script and i hope you'll have a best video and more subscribers.. Thanks .. if i have another problem please help me next time ... I'll rate your reputation |