![]() |
ERR : Unexpected token '{' - 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: ERR : Unexpected token '{' (/thread-10877.html) Pages:
1
2
|
ERR : Unexpected token '{' - Wickedwrath - 10-20-2011 Hello! I finally got my keys and "scary event" to work in my script, but when I added Elven's awesome piano scare-script I'm getting a error "ERR : Unexpected token '{'". Can someone explain what this error means? What I coul'd think of is that I have placed one of those '{ }' wrong, or? - This is my whole script. Help me solve this, please? PHP Code: //////////////////////////////////////////////////////////////////////////////////// RE: ERR : Unexpected token '{' - Your Computer - 10-20-2011 In your case, you forgot to define a function properly. Do you see the section where it says "ALL THE KEYS!"? The code block below it is just hanging there without a function definition. RE: ERR : Unexpected token '{' - Wickedwrath - 10-20-2011 (10-20-2011, 05:36 PM)Your Computer Wrote: In your case, you forgot to define a function properly. Do you see the section where it says "ALL THE KEYS!"? The code block below it is just hanging there without a function definition.I tried to remove it, but it's still not working. Getting the same Error.. RE: ERR : Unexpected token '{' - Your Computer - 10-20-2011 (10-20-2011, 05:39 PM)Wickedwrath Wrote: I tried to remove it, but it's still not working. Getting the same Error.. What was it that you removed? RE: ERR : Unexpected token '{' - Wickedwrath - 10-20-2011 (10-20-2011, 05:44 PM)Your Computer Wrote:///////////////////////////////////////////////////////////////////////////////////(10-20-2011, 05:39 PM)Wickedwrath Wrote: I tried to remove it, but it's still not working. Getting the same Error.. // ALL THE KEYS! RE: ERR : Unexpected token '{' - Your Computer - 10-20-2011 (10-20-2011, 05:51 PM)Wickedwrath Wrote: /////////////////////////////////////////////////////////////////////////////////// To explain what i said in post #2: A code block is started with a { and ended with a }. The code block below the "ALL THE KEYS!" section implies that you wanted the code block to be part of a function's definition. However, you did not provide the function header. This confused the compiler, who was expecting a function header, but got something else. I only pointed out the commented section to help make it easier for you to find the line where the issue is located. I do not know for what purpose that code block is to be used for, so i'm leaving it to you to define a function header. RE: ERR : Unexpected token '{' - Wickedwrath - 10-20-2011 Hm, so you are saying that there is something wrong with the Key-part? It works perfect when I remove the "piano script", so it have to be something wrong with that one, or? RE: ERR : Unexpected token '{' - Your Computer - 10-20-2011 Yeah, this is the part that is causing the issue: PHP Code: { You're going to want it to be something like this: PHP Code: void function_name_here(/*parameters here*/) RE: ERR : Unexpected token '{' - Wickedwrath - 10-20-2011 (10-20-2011, 07:10 PM)Your Computer Wrote: Yeah, this is the part that is causing the issue:Ah, okay. I did put "void function_name_here(/*parameters here*/)" and the games can load, but the Keys won't work now.. I don't get this at all. Also, the Piano doesn't work either. RE: ERR : Unexpected token '{' - jens - 10-20-2011 You'll need some scripting/programing understanding, you are just jumping right in with no understanding of the basics. Perhaps reading this is a good starting place, http://wiki.frictionalgames.com/hpl2/tutorials/script/entihscript_beginner |