Unexpected end of file - 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: Unexpected end of file (/thread-13850.html) |
Unexpected end of file - Shives - 03-08-2012 Hi I made a test for my script. The result FATAL ERROR main(80,1) :Unexpected end of file I watched the script but I can't find the mistake. My script Code: void OnStart() RE: Unexpected end of file - flamez3 - 03-08-2012 void OnStart() { if (GetEntityPlayerLookAtCallback("grunt_1", string& asCallback,false); { AddTimer("", 5, "Brucke"); } } void Brucke(string &in asTimer) { if (GetEntityPlayerLookAtCallback("grunt_1", string& asCallback,false); { ClearEnemyPatrolNodes("grunt_1"); } AddUseItemCallback("", "Key_1", "mansion_1", "Schlussel", true); SetEntityCallbackFunc("Key_1", "Grunt"); AddEntityCollideCallback("grunt_1", "ScriptArea_1", "Away", false, 1); } void Schlussel(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false); RemoveItem("Key_1"); } void Grunt(string &in asEntity, string &in type) { SetEntityActive("Grunt_1", true); AddEnemyPatrolNode("grunt_1", "PathNodeArea_1", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_6", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_7", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_8", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_9", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_10", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_11", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_12", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_13", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_14", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_15", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_16", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_17", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_18", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_19", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_20", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_21", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_22", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_23", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_24", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_25", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_26", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_27", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_28", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_29", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_30", 0, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_31", 0, ""); } void Away(string &in asParent, string &in asChild, int alState) { SetEntityActive("Grunt_1", false); } //////////////////////////// // Run when entering map void OnEnter() { PlayMusic("06_amb.ogg", true, 0.7, 3, 0, true); FadeOut(0); FadeIn(8); } //////////////////////////// // Run when leaving map void OnLeave() { } I fixed it up a little for ya. Make sure you check all the open brackets to check if you closed them. RE: Unexpected end of file - Shives - 03-08-2012 expected " ( " expected " ( " I can't find it RE: Unexpected end of file - flamez3 - 03-08-2012 I haven't had tremendous experience with IF statements. I'll let someone else have a try. C: RE: Unexpected end of file - Shives - 03-08-2012 ThankYou anyway By the way: I've forgotten to script an else XD RE: Unexpected end of file - Damascus - 03-09-2012 if (GetEntityPlayerLookAtCallback("grunt_1", string& asCallback,false); You have an open parentheses here. Same thing for the identical line further down. RE: Unexpected end of file - Your Computer - 03-09-2012 (03-09-2012, 07:15 AM)Damascus Wrote: if (GetEntityPlayerLookAtCallback("grunt_1", string& asCallback,false); Also, the syntax of an if statement doesn't contain semicolons. RE: Unexpected end of file - Shives - 03-09-2012 (03-09-2012, 08:31 AM)Your Computer Wrote:So whats the right syntax?(03-09-2012, 07:15 AM)Damascus Wrote: if (GetEntityPlayerLookAtCallback("grunt_1", string& asCallback,false); I tried it again. Same result RE: Unexpected end of file - Your Computer - 03-09-2012 (03-09-2012, 04:05 PM)Shives Wrote: So whats the right syntax? PHP Code: if (/* expressions */){ BTW, you also tried to call a function that doesn't exist. RE: Unexpected end of file - Shives - 03-09-2012 It's the first time I use "if" I don't know much about it. So where are my mistakes. I can't find them |