Game Development Community

dev|Pro Game Development Curriculum

Enhanced TelnetDebugger

by Tom Spilman · 07/19/2005 (3:34 am) · 102 comments

Download Code File

*** This resource is obsolete and the code is now included in all shipping versions of the Torque engine ***

Thanks to all the community members that made this resource possible!

Team Sickhead

www.sickheadgames.com/images/shbug_03.png

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.

Page «Previous 1 2 3 4 5 6 Last »
#1
07/19/2005 (3:34 am)
Tom, Ben G and I have been talking about these script debugging updates for some time, and it is *awesome* seeing them come together. Tom and the Sickhead crew are kicking ass, and this resource is so useful. I can't wait for Torsion, Sickhead's forthcoming editor.. the support for Torquescript and real-time debugging is going to be incredible.
#2
07/19/2005 (9:26 am)
Very cool of you and Sickhead Games to release these updates for free :) Really looking forward to Torsion too.
#3
07/19/2005 (12:04 pm)
@Matthew - Well it's not that we're nice as much as we really want to see these changes make it into HEAD. We hate having to keep the core of Torque patched like this if we don't have to. The resource acts like a sort of public test before inclusion into the official codebase.
#4
07/19/2005 (2:30 pm)
@Tom: Here are some changes to main.cc to compile on 1.3 with LP

"gui/core/guiCanvas.h" changed to "gui/guiCanvas.h"
"core/frameAllocator.h" changed to "sim/frameAllocator.h"
#include "game/badWordFilter.h" (deleted)
lines 335 & 347 commented out (bad word filter create and destory lines)


After that it compiled fine on 1.3 with new lighting pack updates

I think 1.4 changed relocated the gui to gui/core, and I'm not sure where the badLanguageFilter came from? In house maybe?

I'm about to unzip and strat playing with Torsion, so I'll let ya know if I find anything else.

B--

EDIT:: Didn't run the exe before the post, compiled fine, but not loading... I'll kick it in the head a few times and post back the results! :)



UPDATE:: I tried posting a new message twice, but it didn't go through, so I'll add it here:

1.4 works with no problems. I replaced the main.cc with the one from 1.3 and changed the executef to evaluate, and noticed a line at 345 in your main.cc that might need changing.

Con::executef(1, "onExit"); // should change this to evaluate

Everything in 1.3 compiled and ran fine after the changes, but typing echo($dbgVersion); into the console returns nothing, where 1.4 returns 2.

I'm wondering Tom if the evaluate command was the only thing you changed in the main.cc? I would play with it more, but I've little time until later this weekend.

I did get a chance to spend a few minutes with Torsion, and it looks great! I can't wait until I get a chance to spend some time with it this weekend.

B--
#5
07/19/2005 (5:09 pm)
@Brandon - The only thing that changed in main.cc is that one evaluate line. If the echo doesn't return 2 then something very odd is happening as TelnetDebugger sets this in it's constructor which is executed at engine startup. Line 345 should stay as it.
#6
07/19/2005 (7:27 pm)
I have 1.3 and changed all the items in the \engine\console folder. I didn't change the main.cc (I saw the omission of a couple of console functions (createCanvas, and setModpaths); the only change I made was the executef to the evaulate.

Works great, even tried with the Torsion debugger. Created a breakpoint, and stepped through.. Works great.
#7
07/19/2005 (7:32 pm)
@Steve - Thanks for that report. If you want to do it manually the change to main.cc is only converting that executef( "eval" ) directly to an evaluate() call and passing in the source file name. This allows breakpoints to be placed in the root main.cs. Admittedly this isn't a huge feature, but it tends to confused people when breakpoints that should fire do not.
#8
07/19/2005 (9:10 pm)
I really should get some rest before working with any code base! haha Your right about line 345 Tom, I don't know why I had "replaced function" on the brain... The stock 1.3 with LP worked great, the problem was with my modified version of 1.3, and I got it all working great, so this is a much welcomed addition to the torque offerings!

Thanks again Tom for all the work you've put into this.

B--
#9
07/19/2005 (10:53 pm)
Okay, GG folks... let's get this into HEAD :D
#10
07/20/2005 (7:57 am)
I have found a bug. The following script code works prior to putting in the engine\console\ changes:

. 
  Echo("In HostServerPanelGui::onWake");
.
.
   SM_missionList.clear();
   %i = 0;
   for(%file = findFirstFile($Server::MissionFileSpec); %file !$= ""; %file = findNextFile($Server::MissionFileSpec))  
      if (strStr(%file, "/CVS/") == -1)
      {
 
*** Not returning the %MissionInfo ***

    	%MissionInfo = HostServerPanelGUI.getMissionDisplayName(%file);

*** Not returning the %Missioninfo ***

                 SM_missionList.addRow(%i++, %MissionInfo.name @ "\t" @ %file @ "\t" @ %MissionInfo.selectionbmp );
      }
   SM_missionList.sort(0);
   SM_missionList.setSelectedRow(0);
   SM_missionList.scrollVisible(0);
   SM_missionList.onMouseDown();
.
.
.

//----------------------------------------
function hostserverpanelGUI::getMissionDisplayName( %this, %missionFile ) 
{
   %file = new FileObject();
   
   %MissionInfoObject = "";
   
   if ( %file.openForRead( %missionFile ) ) {
		%inInfoBlock = false;
		
		while ( !%file.isEOF() ) {
			%line = %file.readLine();
			%line = trim( %line );
			
			if( %line $= "new ScriptObject(MissionInfo) {" )
				%inInfoBlock = true;
			else if( %inInfoBlock && %line $= "};" ) {
				%inInfoBlock = false;
				%MissionInfoObject = %MissionInfoObject @ %line; 
				break;
			}
			
			if( %inInfoBlock )
			   %MissionInfoObject = %MissionInfoObject @ %line @ " "; 	
		}
		
		%file.close();
	}
	%MissionInfoObject = "%MissionInfoObject = " @ %MissionInfoObject;
	eval( %MissionInfoObject );
	
   %file.delete();

   if( %MissionInfoObject.name !$= "" )
      return %MissionInfoObject;
   else
      return fileBase(%missionFile); 
}

SM_missionList is GuiTextListCtrl

Its reading the mission files but is not returning the %MissionInfoObject. When I undo the engine\console\ changes, it then works correctly and I get the %MissionInfoObject returned

I'm going to try and see if I can find where the bug is.. but, I'm not familiar with those with the console compiles.. so make take me a little longer.
#11
07/20/2005 (8:24 am)
@Steve - I assume this is something in your own copy of Torque? If you need help i just need to get setup with a simple example that exhibits the problem.
#12
07/20/2005 (8:36 am)
@Tom - Yeah,, it is with my version, but I never changed the items compiledEval and compiler.cc & .h.

Let me see if I can get a simple example set up using torque demo.
#13
07/20/2005 (10:28 am)
Bryan, believe me, we're excited and anxious to get this into the official codebases too, but we need to make sure it gets tested pretty thoroughly before doing so. :) Tom always writes good code and is thorough, so I'm sure it won't take long to vet this resource.

Everyone, please keep reporting back on how this is working for you. :)
#14
07/20/2005 (12:19 pm)
Hi Tom,

First off, awesomes resource! I've been testing this resource with your new editor, and it works great mostly, but I have hit a small issue. Now, it very well could be something I've done wrong in my code, but I thought I'd mention it since, like Steve, the issue just appeared after incorporating the resource.

I suspect there may be something funny with either how local variables are handled, or the eval() function. This is one problem I'm having:

I have a script that passes received message variables to a function through eval, like so:
addMessageCallback('test', handleTest);
function handleTest(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
  %eval = "myFunction (%a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);";
  eval (%eval);
}

The vars %a1, %a2, etc. are showing up fine in your excellent debugger and editor! (Which is by the way, how I found the problem. :) However, when I trace to "myFunction", the vars %a1, %a2, etc are all nothing. So it seems somewhere in the eval() function, the variables are getting lost.

If I find out anything new, I'll let you know. Thanks again for the great resource!
- Drew

edit: I just noticed one more small thing. If I name a mission like so: "testMission (snow)", the part in parenthesis and the parenthesis themselves don't show up in the joinServerGui list box. But, they do show up in the mission load screen. Again, the problem could lie in my code, but I thought it's not a bad idea to mention it.
#15
07/20/2005 (11:09 pm)
@Drew & Steve - Your bugs are related. I broke eval() in my changes. I'm working on a fix now.
#16
07/22/2005 (11:56 am)
@Drew & Steve - Sorry for the delay in the fix... it has become rather challenging finding the right solution and making sure it works right. I should have something later today.
#17
07/22/2005 (2:00 pm)
Hi Tom,

That's no problem! Thank you for working on such useful tools, like this resource and the Torsion editor. I think you are making a lot of people happy. :) Take your time and don't feel rushed by me, do it at whatever pace works for you. When you have the next version ready, you can count on me to test it for you, as a solid script debugger is something I'd really like to use for myself, and see in Torque.

Let me know if I can be of any other assistance,
- Drew
#18
07/24/2005 (5:49 pm)
I had the same problem as above with incorrect include file paths. Can ya please validate here that this was the correct process to take?

#include "gui/core/guiCanvas.h" changed to "gui/guiCanvas.h"
#include "core/frameAllocator.h" changed to "sim/frameAllocator.h"
#include "game/badWordFilter.h" (deleted)

lines 335 & 347 commented out (bad word filter create and destory lines)
#19
07/24/2005 (5:59 pm)
@Brian: When I posted that message, I didn't know how much of main.cc Tom had updated, but after his answer all you need to change in your main.cc is around line 323. Unless you are using version 1.4 in which case Tom's main.cc works great.

U32 size = str.getStreamSize();
   char *script = new char[size + 1];
   str.read(size, script);
   str.close();
   script[size] = 0;

   //Con::executef(2, "eval", script);
    Con::evaluate(script, false, useDefaultScript ? defaultScriptName : argv[1]); 
   delete[] script;

   return true;
}

The commented out line is the origianl Con::executef followed by Tom's changed line below it where he is calling Con::evaluate. So just comment out the one line, and add the one below it in your ./engine/game/main.cc file.

B--
#20
07/24/2005 (6:06 pm)
Thanks Brandon,

When building the SDK vc7 with Visual Studios .NET those include files prevent the project from being built unless you change the path in main.cc file.

I have made the changes and commented out the files and the build worked. However, the Torque.EXE starts then exists quickly. Here is the console file:

//-------------------------- 7/24/2005 -- 21:04:09 -----
Processor Init:
Intel Pentium 4, ~3.35 Ghz
(timed at roughly 3.37 Ghz)
FPU detected
MMX detected
SSE detected

Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions

Input Init:
keyboard0 input device created.
mouse0 input device created.
DirectInput enabled.

main.cs (285): Unable to find function setModPaths
--------- Loading MODS ---------
Missing file: tutorial.base/main.cs!
Error: Unable to find specified mod: tutorial.base

Error: Unable to load any specified mods
--------- Parsing Arguments ---------
Engine initialized...
NOT enabling debug...


NEW INFO: I have replaced the Torque.EXE (debug version) with the demo version and the demo works.
Page «Previous 1 2 3 4 5 6 Last »