Game Development Community

OneClick Debugging

by Chaim Krause · in Torsion · 11/17/2007 (10:03 pm) · 2 replies

On the Configuration Settings dialog there is a checkbox for OneClick Debugging. The hint says, "
Enables automatic injection of the debugger startup code in to the main entry script." I'm not sure what that means and how it effects my program. If I don't check it, what happens? How do I manually inject the debugger startup code?

#1
11/18/2007 (9:04 am)
There is a console function that must be run in order to setup your torque exe to listen for a telenet debugger connection, which allows torsion to connection / set breakpoints / etc. You can call this console function yourself but by default ( if that is checked ) torsion will insert that call to the top of main.cs

If you want to see what torsion actually inserts in your main.cs open your root main.cs file then click start with debugging and check out this nifty stuff attached to the top:
// BEGIN TORSION
eval( "dbgSetParameters( 6060, \"password\"" @ ( $dbgVersion > 0 ? ", true );" : " );" ) );
// END TORSION
This is removed automatically when you stop running your project.

Go to the torsion code browser and check out the parameters for dbgSetParameters for information about parameters if you want to call this from the console, for instance. This can be handy if you ran your game from, say, visual studio and then want to connect to it with torsion so you can debug something in script without having to restart.
#2
11/18/2007 (4:15 pm)
Thanks James. That is very useful information.