If statement 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: If statement error (/thread-14377.html) |
If statement error - FlawlessHappiness - 03-31-2012 My if-statement makes a strange error i cannot seem to solve. What i want is (as to many others) for my door to display a message when it is locked. I was going to test it out when this showed up: FATAL ERROR: Could not load script file 'custom _stories/OE/custom_stories/OE/maps/D-Dur.hps'! main(22, 11) : ERR :Expected ';' main(30, 11) : ERR :Expected ';' My script looks like this: void OnStart() { SetEntityPlayerInteractCallback("V17_door", "V17_door", false); SetEntityPlayerInteractCallback("V18_door", "V18_door", false); } 18 void V17_door(string &in asEntity) 19 { 20 if(GetSwingDoorLocked("V17")) 21 { 22 SetMessage"Messages", "V17", 0); <- Look it is there!! 23 } 24 } 25 26 void V18_door(string &in asEntity) 27 { 28 if(GetSwingDoorLocked("V18")) 29 { 30 SetMessage"Messages", "V18", 0); <- It is also here!! 31 } 32 } What is wrong here?? EDIT: And my message is here: ////////////////////////////MESSAGES <CATEGORY Name="Messages"> <Entry Name="V17">Doeren er laast</Entry> <Entry Name="V18">Doeren er laast</Entry> </CATEGORY> RE: If statement error - SilentStriker - 03-31-2012 SetMessage"Messages", "V17", 0); this is how it should look like SetMessage("Messages", "V17", 0); and the same with V18 you forgot the ( RE: If statement error - Linus Ă…gren - 03-31-2012 Also, you did not define wether if the code shall check if the door is locked or not; if(GetSwingDoorLocked("V18") == true/false) RE: If statement error - FlawlessHappiness - 03-31-2012 AWESOME!!! It works! Very much thanks you! You guys are awesome RE: If statement error - SilentStriker - 03-31-2012 You're welcome |