Trace
Purpose
Use the trace function to enable (or disable) function call tracing. If enabled, tracing will print a message every time a function is entered, showing what arguments it received, and it will print a message every time a function is exited, showing the return value (or last value of last statement) for that function.
Syntax
Trace(enable); enable – A boolean value. If set to true, tracing is enabled, otherwise it is disabled. (trace(1); or trace(0);)
Returns
No return value.
Definition from Garage Games.
Purpose
Use the trace function to enable (or disable) function call tracing. If enabled, tracing will print a message every time a function is entered, showing what arguments it received, and it will print a message every time a function is exited, showing the return value (or last value of last statement) for that function.
Syntax
Trace(enable); enable – A boolean value. If set to true, tracing is enabled, otherwise it is disabled. (trace(1); or trace(0);)
Returns
No return value.
Definition from Garage Games.
Example 2
Let's try another example, moving forward! So what happens when we move forward? I'll show you. Once again, be at your own server (don't have to be, but it makes looking through your console a bit easier), enable tracing, move forward a bit, then disable it quickly.
Now you should see a lot of stuff again which will look somewhat like this:
Let's try another example, moving forward! So what happens when we move forward? I'll show you. Once again, be at your own server (don't have to be, but it makes looking through your console a bit easier), enable tracing, move forward a bit, then disable it quickly.
Now you should see a lot of stuff again which will look somewhat like this:
Notice the selected area:
That is the function that gets called, the arguments it took, and what it returned when you moved forward.
Conclusion
When tracing certain functions, there may be a lot of stuff that goes on between the entering of the function and the leaving of the function so try and know what you are looking for.
When tracing certain functions, there may be a lot of stuff that goes on between the entering of the function and the leaving of the function so try and know what you are looking for.