An "Unexpected end of file" error? - 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: An "Unexpected end of file" error? (/thread-10909.html) |
An "Unexpected end of file" error? - MissMarilynn - 10-21-2011 I keep getting an unexpected end of file error with my scripting and it says the problem is with the last line (which is just }) Any suggestions? PHP Code: void OnStart() { AddEntityCollideCallback("Player", "monsterspawn", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "clockbong", "ClockScare", true, 1); SetEntityPlayerInteractCallback("Girls_Dorm_First_Floor", "IsItLocked3", true); SetEntityPlayerInteractCallback("Boys_Dorm_First_Floor", "IsItLocked4", true); SetEntityPlayerInteractCallback("ra_office", "IsItLocked5", true); AddUseItemCallback("open_Girls_Dorm_First_Floor_door", "girl_key", "Girls_Dorm_First_Floor", "openlevel", false); } RE: An "Unexpected end of file" error? - Your Computer - 10-21-2011 You have an extra quotation mark for Boys_Dorm_First_Floor in the if statement. BTW, when using php or code bbcode, it is best if you copy the code directly from your text editor when placing your code in between code or php bbcode. RE: An "Unexpected end of file" error? - MissMarilynn - 10-21-2011 (10-21-2011, 08:54 PM)Your Computer Wrote: You have an extra quotation mark for Boys_Dorm_First_Floor in the if statement.Thank you! I was going over it so many times and I couldn't figure it out. I tried but it didn't work...:/ RE: An "Unexpected end of file" error? - Your Computer - 10-21-2011 (10-21-2011, 08:55 PM)MissMarilynn Wrote: I tried but it didn't work...:/ I always avoid the WYSIWYG editor of the forums. The source editor will never give you problems (if you understand bbcodes). RE: An "Unexpected end of file" error? - MissMarilynn - 10-21-2011 (10-21-2011, 08:59 PM)Your Computer Wrote:I understand bbcodes a little. I'm relatively new to forums. It's been a huge help though with my scripting!(10-21-2011, 08:55 PM)MissMarilynn Wrote: I tried but it didn't work...:/ I can't get my key code to work for some reason too...It's a level door I'm trying to unlock. My code right now is: AddUseItemCallback("open_Girls_Dorm_First_Floor_door", "girl_key", "Girls_Dorm_First_Floor", "openlevel", false); void openlevel(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Girls_Dorm_First_Floor", false, true); PlaySoundAtEntity("", "unlock_door", "door1", 0, false); RemoveItem("girl_key"); PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false); GiveSanityBoostSmall(); } It removes my key and give me the sanity boost and plays the music but it won't unlock. RE: An "Unexpected end of file" error? - Your Computer - 10-21-2011 Level doors are unlocked with SetLevelDoorLocked, not SetSwingDoorLocked. RE: An "Unexpected end of file" error? - MissMarilynn - 10-21-2011 (10-21-2011, 09:31 PM)Your Computer Wrote: Level doors are unlocked with SetLevelDoorLocked, not SetSwingDoorLocked.It gave me an error when I switched it out? It said no matching signatures. AddUseItemCallback("", "girl_key", "Girls_Dorm_First_Floor", "openlevel", false); void openlevel(string &in asItem, string &in asEntity) { SetLevelDoorLocked("Girls_Dorm_First_Floor", false, true); PlaySoundAtEntity("", "unlock_door", "door1", 0, false); RemoveItem("girl_key"); PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false); GiveSanityBoostSmall(); } RE: An "Unexpected end of file" error? - Your Computer - 10-21-2011 That's because level doors don't have any applicable effects, and so there is no third parameter. Always refer to this page when dealing with HPL2 script functions: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions RE: An "Unexpected end of file" error? - MissMarilynn - 10-21-2011 (10-21-2011, 09:37 PM)Your Computer Wrote: That's because level doors don't have any applicable effects, and so there is no third parameter.Third parameter? So I would have to change my script to: AddUseItemCallback("", "girl_key", "Girls_Dorm_First_Floor", "openlevel"); void openlevel(string &in asItem, string &in asEntity) { SetLevelDoorLocked("Girls_Dorm_First_Floor", false); PlaySoundAtEntity("", "unlock_door", "door1", 0, false); RemoveItem("girl_key"); PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false); GiveSanityBoostSmall(); } |