Script debug - 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 debug (/thread-22250.html) |
Script debug - Neelke - 07-27-2013 Can somebody explain how ScriptDebugOn(); is used? I know what it does but not how to use it. RE: Script debug - Artyom - 07-27-2013 Checks whether the debug mode is enabled. See Setting up Development Environment to setup debug mode on your own computer. RE: Script debug - TheGreatCthulhu - 07-29-2013 To clarify a bit more: debugging is, well, the process of finding bugs in your code so that you can get rid of them. Sometimes, you write a script, and it looks like everything checks out, it compiles fine and the level loads, but then you find out that it does something completely unexpected, or mysteriously stops working, or something along those lines. If that happens, you can try and investigate what's happening with the values of variables as your code is running, and what methods get called when, etc. If you set up your development environment as explained in the link above, the ScriptDebugOn() will return true. On the other hand, when you deliver your custom story, when the non-dev users run the script, ScriptDebugOn() will return false. This means that you can use debugging as you're developing the CS or FC, print out diagnostic messages etc., and when a non-dev user runs your level, nothing of it will be shown (or executed). PHP Code: // let's say you just used some variable called "i" |