![]() |
[SCRIPT] Parentheses issue - 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] Parentheses issue (/thread-12022.html) Pages:
1
2
|
Parentheses issue - Grimm101 - 12-22-2011 Hey guys, EDIT: Updated the script and managed to remove the error for line 20 but my current error is it points to the bracket below void doorclosebang I've got an issue when I start my level, I want to make a door slam when I walk into a specific area and play a sound when it happens. I am getting an error on line 20 and line 25. Which are both curly brackets. I'm not sure what this means. This is my code below. The 20th line can be seen below //Triggers PS: I'm new to PHP/C++ and I think this a good starting point. I'm good with VB and Ok ish with C#. So far i've found this the easiest code to understand and read fluently but this kind of issue I am unsure of. I'm sure it is something simple and silly. =) Thanks PHP Code: //////////////////////////////// RE: Parentheses issue - Your Computer - 12-22-2011 I have trouble believing that is how your script actually looks. Could you edit your post with the forum's source editor and replace the script with the actual script? RE: Parentheses issue - Grimm101 - 12-22-2011 Sorry mate didn't notice, there you go. I made an edit. I notice that my post seems to be unexplained. After the recent changes I have made I fixed one of the issues. I understand that the main commands need to be under the same bracket. I can't put the code below anywhere else. My error says: "ERR Unexpected Token '{'" It seems it is to do with the bracket which holds the code below. I am not sure what to do. SetSwingDoorClosed("Bedroom_Key_Door", true, true); //Closes a swing door: Effects indicate true to see the door close PlaySoundAtEntity("", "bang", "DoorCloseBang", 0, false); //Create banging on the door sound when the door shuts RE: Parentheses issue - Your Computer - 12-23-2011 You have a semicolon as part of the DoorCloseBang function header. That's a big no-no for function definitions. RE: Parentheses issue - Apjjm - 12-23-2011 You have a semi-colon at the end of Code: void DoorCloseBang(string &in asParent, string &in asChild, int alState); ![]() RE: Parentheses issue - Grimm101 - 12-23-2011 See, I knew it would be something stupid!! Thanks guys!! Your a great help. I have a new issue with my code. It works fine and everything but as you can see, I want a sound to be played when the door shuts. The sound called "Bang.snt" Currently there is no sound being played. This is my new code PHP Code: //////////////////////////////// RE: Parentheses issue - Your Computer - 12-23-2011 Where is bang.snt found in the original Amnesia sounds? Or did you make your own .snt file and called it bang? RE: Parentheses issue - Grimm101 - 12-23-2011 (12-23-2011, 12:57 AM)Your Computer Wrote: Where is bang.snt found in the original Amnesia sounds? Or did you make your own .snt file and called it bang?It's in "amnesia the dark descent/sounds/24" Cheers =] RE: Parentheses issue - Your Computer - 12-23-2011 Whether in 15 or 24, mine has a number in front on the name. Doesn't your's have a number prefixed too? RE: Parentheses issue - Grimm101 - 12-23-2011 Yep I literally just noticed that too, added the number making it "24_Bang.snt" and still no sound. Is it correct of me to have "DoorCloseBang"? That is what I am unsure of. |