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.
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 1
Let's say we want to know what happens when a player jumps. Well, start up a server and enable tracing, jump, then disable it really fast. Now open up your console and you should see a lot of junk, scroll up till you see "Entering Jump(1)", it should look like so:
Everything having to do with jump I highlighted, and I will explain to you below.
So since we are the host, we can see server sided things going on. The server sided function that gets called on when a player jumps is armor::onTrigger. Not going to go too much into detail on what it does, how it works, etc.
The client sided function that gets called as you can see is Jump(boolean). You can see what arguments it takes and what it returns;
The client sided function that gets called as you can see is Jump(boolean). You can see what arguments it takes and what it returns;
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.