Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script debug
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
Script debug

Can somebody explain how ScriptDebugOn(); is used? I know what it does but not how to use it.
07-27-2013, 05:43 PM
Find
Artyom Offline
Senior Member

Posts: 370
Threads: 27
Joined: Jul 2012
Reputation: 11
#2
RE: Script debug

Checks whether the debug mode is enabled.
See Setting up Development Environment to setup debug mode on your own computer.

- Inactive account -
07-27-2013, 07:04 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#3
RE: Script debug

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: (Select All)
// let's say you just used some variable called "i"

if(ScriptDebugOn()) // the code below will only execute if ScriptDebugOn() returns true
{
    
AddDebugMessage("Value of i is: " ifalse);    // here false just means not to check for duplicate debug messages

(This post was last modified: 07-29-2013, 02:08 PM by TheGreatCthulhu.)
07-29-2013, 02:06 PM
Find




Users browsing this thread: 1 Guest(s)