![]() |
[SCRIPT] Unexpected token? - 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] Unexpected token? (/thread-15108.html) |
Unexpected token? - Manbearpig116 - 04-26-2012 Any ideas? //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 0); AddUseItemCallback("", "waterdoorkey", "waterdoor", "UsedKeyOnDoor", true); } void CollideRoomTwo(string &in asParent, string &in asChild, int alstate) { SetSwingDoorClosed("RoomTwoDoor", true, true); GiveSanityDamage(90 , true); PlayGuiSound("react_past", 1); } void UsedKeyOnDoor(string &in asItem, string &in asEntity); { SetSwingDoorLocked("waterdoorkey, false, true); PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false); RemoveItem("waterdoorkey"); } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Unexpected token? - TeamSD - 04-26-2012 I see unwanted space here; GiveSanityDamage(90 , true); Could you be more specific with your error? What does it exactly say? Also this line. PlayGuiSound("react_past", 1); I belive it should be like this: PlayGuiSound("react_pant.snt", 1); RE: Unexpected token? - Manbearpig116 - 04-26-2012 (04-26-2012, 06:25 PM)TeamSD Wrote: I see unwanted space here;It says FATAL ERROR : Could not load script file 'custom_stories/Awakening 0.1/,aps/01_basement.hps '! Main (17, 1) : ERR Unexpected token '{' RE: Unexpected token? - TeamSD - 04-26-2012 (04-26-2012, 06:32 PM)Manbearpig116 Wrote:void UsedKeyOnDoor(string &in asItem, string &in asEntity); <--- this is wrong I belive. Erase ;(04-26-2012, 06:25 PM)TeamSD Wrote: I see unwanted space here;It says { SetSwingDoorLocked("waterdoorkey, false, true); PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false); RemoveItem("waterdoorkey"); } Hope it works :) Prelauncher, you have sharp eyes RE: Unexpected token? - Prelauncher - 04-26-2012 SetSwingDoorLocked("waterdoorkey, false, true); make that: SetSwingDoorLocked("waterdoorkey", false, true); Main (17, 1) tells you on what line the problem is located RE: Unexpected token? - Manbearpig116 - 04-26-2012 Okay now it's telling me that the error is located at 37,2 but I have no idea what to do with it //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 0); AddUseItemCallback("", "waterdoorkey", "waterdoor", "UsedKeyOnDoor", true); } void CollideRoomTwo(string &in asParent, string &in asChild, int alstate) { SetSwingDoorClosed("RoomTwoDoor", true, true); GiveSanityDamage(90 , true); PlayGuiSound("react_pant.snt", 1); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("waterdoorkey", false, true); PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false); RemoveItem("waterdoorkey"); //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Unexpected token? - Prelauncher - 04-26-2012 void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("waterdoorkey", false, true); PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false); RemoveItem("waterdoorkey"); } |