[SCRIPT] fatal error! help plz - 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] fatal error! help plz (/thread-21656.html) |
fatal error! help plz - pewds..fan - 05-28-2013 hi everyone here is the error that arrives when im trying to enter from my map 2 to map 3: FATAL ERROR:Could not load script file 'custom_stories/paskaa/custom_stories/paskaa/maps/C:/Program Files(x86)/kauhupelit/Amnesia-The Dark Descent(2)/redist/custom_stories/paskaa/maps/03_testi.hps' main(11,4): ERR : Expected ',' or ',' main(12,19) : ERR : Expected identifier main(13,19) : ERR : Expected identifier main(14,19) : ERR : Expected identifier SCRIPT //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "START_GRUNT_1", "GRUNT", true, 1); AddEntityCollideCallback("Player", "START_KNIGHTS", "KNIGHT", true, 1); } void KNIGHT(string &in asParent, string &in asChild, int alState) SetEntityActive("KNIGHT_0", true); SetEntityActive("KNIGHT_1", true); SetEntityActive("KNIGHT_2", true); SetEntityActive("KNIGHT_3", true); void GRUNT(string &in asParent, string &in asChild, int alState) { SetEntityActive("GRUNT_1", true); AddEnemyPatrolNode("GRUNT_1", "NODE_1", 0, ""); } //////////////////////////// // Run when entering map void OnEnter() { AutoSave(); AddEntityCollideCallback("Player", "door_close", "closedoor", true, 1); } void closedoor(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("mansion_1", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } //////////////////////////// // Run when leaving map void OnLeave() { AutoSave(); } if you can find these mistakes that i could not find plz tell me ! RE: fatal error! help plz - Adrianis - 05-28-2013 Code: void KNIGHT(string &in asParent, string &in asChild, int alState) The problem is here, you need the { and } surrounding the code in the middle - look at all you're other functions in that script, they all have.. Code: void NAME( stuff) This error, main(11,4): ERR : Expected ',' or ',' The first number in brackets (number 11) refers to the line number that the problem occured on - you can count line by line down to 11, and see the problem. Code: void KNIGHT(string &in asParent, string &in asChild, int alState) Also, you made another thread reporting problems you were having with this map - a bunch of us responded trying to help, but you didn't actually respond. It would be nice if you could respond to people trying to help, giving them the stuff they ask for and letting them know whether it helped or not. RE: fatal error! help plz - pewds..fan - 05-28-2013 i could not find any mistakes in error main(11,4): ERR : Expected ',' or ',' i searched the whole line but i just could not find anything (i noticed the brackets a min after sending this post ) RE: fatal error! help plz - Adrianis - 05-28-2013 Fair enough - the line number is always going to be 'approximately' where the problem is, it may be a few lines above or below depending on the actual error being reported. In this case it looks like line 11 is 'SetEntityActive("KNIGHT_0", true);' This is the first line that the game realizes there is a problem, all the lines that came before it were perfectly fine. Because it did not find a { it was expecting to find , or ; at line 11, but it didn't find any, so it crashes the game and says there's a problem at line 11, where it was supposed to find a valid character. It can't know what you were trying to do, so it has to report on the only place it knows there is a problem, the correction to that problem happens to come a line before it. Hope that helps explain it RE: fatal error! help plz - pewds..fan - 05-28-2013 thanks man its working now |