Game Development Community

dev|Pro Game Development Curriculum

Debugging an Example with TribalIDE

by Ale Palmero · 05/19/2003 (11:04 am) · 12 comments

debugging an example with TribalIDE

I'll show how to set up the TribalIDE to debug the RACING example that comes with torque.

1 - Start up Torque racing mod. I have torque installed on D:\torque, in D:\torque\example\ I created a new shortcut to
D:\torque\example\torqueDemo.exe -mod racing
Click it and Torque will start to the main menu. Don't load any level/mission yet.

2- Press the ~ key to see the console and type dbgsetparameters(PORT_NUMBER,PASSWORD); . I use dbgsetparameters(28000,"pass");
You can include this dbgsetparameters command in the mod itself for example at the end of racing\main.cs (remember to delete the main.dso to force recompiling, after modifying the .cs) if you are debugging this project often.

3- Run TribalIDE. Create a new project. The project base directory in my case is D:\torque\example\
This is the trickiest part. If you put a wrong path here the TribalIDE will hang later, on the "Requesting Server Script List" step. To make sure you put the right base directory you could try in the console with commands like compile("racing/server/scripts/car.cs"); As the base dir of racing/server/scripts/car.cs is exactly D:\torque\example\ then the command will execute ok, otherwise the file car.cs will not be found (You'll see the errors opening the console)
You could choose YES in the dialog asking if you want to add all files in the example subdirs, and then remove all the files from folders other than racing/. Or you could choose NO and add them manually with Add files to project (Shift+11)
Save the project.

4- Configure TribalIDE to connect to the Torque client: in the menu Edit/Preferences, on the -Debugger- tab, set server address (127.0.0.1 if you are running Torque in the same machine). The Port and Password are the same you set in the step 2 of this tutorial.

5 -Now press the play button (or Debug/Run or simply ) and if you set everything right you are connected to the server and you'll see green boxes at the right of the filenames in the project tabs. If any of the filenames don't have a green box you need to compile it pushing the Right mouse button over the filename and selecting . Once the file is compiled, you can set breakpoints on it. On the source code tabs you will see small green dots on the lines of code that you are allowed to set breakpoints.

6 -Lets put a breakpoint in racing/example/server/scripts/game.cs, on the createPlayer function: click on the blue dot at its left side.
Then start a mission on the Torque Game Engine window or use the commands createServer("SinglePlayer", "racing/data/missions/track1.mis"); localConnect("me");
After loading the engine will stop at the breakpoints you set. When the engine stopped at a breakpoint you can see the value of a variable right clicking on it and adding a Watch. Use F9 to continue the execution.


You could try the integrated debugger but you'll need 2 machines with enough graphic card to run Torque, 1 running the game and the other running the debuguer GUI. You'll run the game in the first and then in the other you'll start Torque and use exec("common/debugger/debugger.cs"); in the console to load the debug GUI and connect to the server.

About the author

Recent Blogs


#1
05/19/2003 (2:02 pm)
This is interesting, but apparently you can no longer download Tribal IDE from anywhere. I know the author had released the source code about a year ago but his site is gone as well.

Anyone know where you can still get it? Or can someone who has it put it up on a server somewhere?
#2
05/19/2003 (3:06 pm)
I've sent you a copy. If Yahoo doesn't allow attachments, send me a note back with a better email.

Good resource btw. It took me quite some time to figure this out on my own. This should save the new batch of GGers a big headache.
#3
05/19/2003 (10:08 pm)
We have TribalIDE mirrored on our site.
You can also try JEdit with our TIDE plugin, which also has a TGE Debugger (JEdit is cross-platform).
#4
05/20/2003 (7:01 am)
Great Info!!

@Erik, or anyone, do you have the source code or know where I might get a copy of the source for Tribal IDE mentioned by TheMartian? I remember researching this a while back but most of the links were dead ends.

Thanks
#5
05/20/2003 (7:26 am)
hey thanks guys! I did a bunch of searching and couldnt find a build of it so I appreciate the email.

I did however locate the source, written in delphi. You also have to tromp around
and get all the libraries he used to build it. I dont have delphi so I was never able to actually build it myself. (weird that i lost the tribal-exe tho *shrug*)

anyway ill put it up so you can grab it.

get it from here
http://www.themartianzone.com/TribalIDEsource.zip
#6
07/08/2003 (6:19 am)
Hey guys,

I am trying out the Tribal IDE and I am getting the following error:

"Cannot change port if not closed"

Is there something I am missing?

Thanks for the resource!

-Jeff
#7
07/08/2003 (6:29 am)
Hmm, not sure what I did, but its working now. :)
#8
11/12/2003 (7:17 pm)
Hey can anyone tell me why when I right click on a variable I can't see its value. I
#9
12/13/2003 (5:58 pm)
Burton,

It appears the right click thing no longer works for setting a watch. If you click on the "Watches" Tab you will see your watches. (which by default will be blank) to add to the watch list simple type the var name in the small text line box below the watches box that has the "watches,values" cols. Then hit enter.

hope that makes sense.
#10
02/15/2005 (3:15 am)
This app sounds pretty kewl, but I dont own a copy of windows(nor have it installed).
So now im a bit stuck, i cant emulate it(yet). Have anyone tried porting it to linux?
#11
02/15/2005 (3:21 am)
Use JEdit...
#12
09/25/2006 (8:04 am)
This working ok... thanks!.