Forums Index >> Modding >> How do you bring in scripts from other games?



Page : <1> :


I am very interested to see if I could bring the NetGraphGUi.gui from legends into TT for monitoring packets. It looks like this in TGE (just hit alt-n).

The.gui looks like.

 

// Profiles

New GuiControlProfile (NetGraphGhostsActiveProfile)

{

FontColor = "255 255 255";

};

New GuiControlProfile (NetGraphGhostUpdatesProfile)

{

FontColor = "255 0 0";

};

New GuiControlProfile (NetGraphBitsSentProfile)

{

FontColor = "0 255 0";

};

New GuiControlProfile (NetGraphBitsReceivedProfile)

{

FontColor = "0 0 255";

};

New GuiControlProfile (NetGraphLatencyProfile)

{

FontColor = "0 255 255";

};

New GuiControlProfile (NetGraphPacketLossProfile)

{

FontColor = "0 0 0";

};

//--- OBJECT WRITE BEGIN ---

New GuiControl(NetGraphGui) {

Profile = "GuiDefaultProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "0 0";

Extent = "640 480";

MinExtent = "8 2";

Visible = "1";

NoCursor = "1";

 

New GuiGraphCtrl(NetGraph) {

Profile = "GuiDefaultProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "432 5";

Extent = "200 200";

MinExtent = "8 2";

Visible = "1";

};

New GuiTextCtrl(Latency) {

Profile = "NetGraphLatencyProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "436 184";

Extent = "100 18";

MinExtent = "8 2";

Visible = "1";

Text = "Latency";

MaxLength = "255";

};

New GuiTextCtrl(PacketLoss) {

Profile = "GuiTextProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "536 184";

Extent = "59 18";

MinExtent = "8 2";

Visible = "1";

Text = "Packet Loss";

MaxLength = "255";

};

New GuiTextCtrl(BitsReceived) {

Profile = "NetGraphBitsReceivedProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "536 170";

Extent = "100 18";

MinExtent = "8 2";

Visible = "1";

Text = "Bits Received";

MaxLength = "255";

};

New GuiTextCtrl(GhostsActive) {

Profile = "NetGraphGhostsActiveProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "436 156";

Extent = "100 18";

MinExtent = "8 2";

Visible = "1";

Text = "Ghosts Active";

MaxLength = "255";

};

New GuiTextCtrl(GhostUpdates) {

Profile = "NetGraphGhostUpdatesProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "536 156";

Extent = "100 18";

MinExtent = "8 2";

Visible = "1";

Text = "Ghost Updates";

MaxLength = "255";

};

New GuiTextCtrl(BitsSent) {

Profile = "NetGraphBitsSentProfile";

HorizSizing = "left";

VertSizing = "bottom";

Position = "436 170";

Extent = "100 18";

MinExtent = "8 2";

Visible = "1";

Text = "Bits Sent";

MaxLength = "255";

};

};

//--- OBJECT WRITE END ---

// Functions

Function NetGraph::toggleNetGraph()

{

If(!$NetGraph::isInitialized)

{

$Stats::netGhostUpdates = 0;

NetGraph::updateStats();

$NetGraph::isInitialized = true;

}

If(!Canvas.isMember(NetGraphGui))

{

Canvas.add(NetGraphGui);

}

Else

Canvas.remove(NetGraphGui);

}

Function NetGraph::updateStats()

{

$NetGraphThread = NetGraph.schedule(32, "updateStats");

If(!$Stats::netGhostUpdates)

Return;

If(isobject(NetGraph))

{

If(isobject(ServerConnection))

NetGraph.addDatum(0,ServerConnection.getGhostsActive());

GhostsActive.setText("Ghosts Active: " @ ServerConnection.getGhostsActive());

NetGraph.addDatum(1,$Stats::netGhostUpdates);

GhostUpdates.setText("Ghost Updates: " @ $Stats::netGhostUpdates);

$Stats::netGhostUpdates = 0;

NetGraph.addDatum(2,$Stats::netBitsSent);

BitsSent.setText("Bits Sent: " @ $Stats::netBitsSent);

NetGraph.addDatum(3,$Stats::netBitsReceived);

BitsReceived.setText("Bits Received: " @ $Stats::netBitsReceived);

NetGraph.matchScale(2,3);

NetGraph.addDatum(4,ServerConnection.getPing());

Latency.setText("Latency: " @ ServerConnection.getPing());

NetGraph.addDatum(5,ServerConnection.getPacketLoss());

PacketLoss.setText("Packet Loss: " @ ServerConnection.getPacketLoss());

}

}

Function NetGraph::toggleKey()

{

If(!GhostsActive.visible)

{

GhostsActive.visible = 1;

GhostUpdates.visible = 1;

BitsSent.visible = 1;

BitsReceived.visible = 1;

Latency.visible = 1;

PacketLoss.visible = 1;

}

Else

{

GhostsActive.visible = 0;

GhostUpdates.visible = 0;

BitsSent.visible = 0;

BitsReceived.visible = 0;

Latency.visible = 0;

PacketLoss.visible = 0;

}

}

 

 

 

Last edited: Friday, June 30, 2006 at 10:38:22 PM

Friday, June 30, 2006 at 9:59:46 PM

Probably you wont be able to... Why? TGE basic code that TT is missing :(
Only small scripts usually work, or lines of code, nothing much useful


Saturday, July 01, 2006 at 3:09:47 AM

Damn - so that is why TGE's SpeedoMeter (Racing) doesn't work in TT :'(

 

 

 

 

Saturday, July 01, 2006 at 4:19:44 AM

Arggghhh....

Loading compiled script game/client/ui/NetGraphGui.gui.
game/client/ui/NetGraphGui.gui (0): Unable to instantiate non-conobject class Gu iGraphCtrl.

The.cs does reference/create GuiGraphCtrl? -->New GuiGraphCtrl(NetGraph) {

TT should have all of this data, but will it allow me to create that NetGraph window?

can get it to compile just the function portion. Now its just a matter of getting that info.

Compiling game/client/scripts/netGraph.cs...
Loading compiled script game/client/scripts/netGraph.cs.

 

Last edited: Saturday, July 01, 2006 at 8:02:11 AM

Saturday, July 01, 2006 at 7:52:28 AM

I have tried stuff like this before, and TT doesn't have half the stuff we would need.

Saturday, July 01, 2006 at 9:41:09 AM

I've tried to host the Orc Village this from the TGE on TT and it shows up as a cloudy sky and a blank cloud im standing on. But if you want to host it there is a good thing to do. Take everything in the Data and creator and copy it into The TT root file in contents/resources/game/data/ and if you would like to use scripts on say TT1_3.mis just copy the racing script -

//-----------------------------------------------------------------------------
// Torque Engine
// Copyright (c) GarageGames.Com
//-----------------------------------------------------------------------------

// Writes out all script functions to a file
function writeOutFunctions()
{
new ConsoleLogger( logger, "scriptFunctions.txt", false );
dumpConsoleFunctions();
logger.delete();
}

// Writes out all script classes to a file
function writeOutClasses()
{
new ConsoleLogger( logger, "scriptClasses.txt", false );
dumpConsoleClasses();
logger.delete();
}

My Web Site- GameForums.com On Sunday, August 34 2006 become a member of my forums with many game topics!
-Gort

Last edited: Saturday, July 01, 2006 at 9:59:52 AM

Saturday, July 01, 2006 at 9:56:07 AM

Getting a little closer

 

Sunday, July 02, 2006 at 6:08:12 AM

Not sure if its a case of TT not having the capabilty, but whether they "turned it on". Case in point, I took the binds.cs from torque and replaced it with the TT one. Was able to drive around, could shoot, but not move my turret. "esc" didn't work either, but when I hit "g" I would jump out of the server then back in as a different tank. The same file structure is used between Torque and TT, so you can kinda see what is there and what isn't.

 

Sunday, July 02, 2006 at 8:01:13 AM

Ahh now I see what you guys are talking about. Trying to bring that into TT would be one heck a task but you could break it up individually and do it. To bad would have been cool.

 

Saturday, July 08, 2006 at 5:25:01 AM

Clark stripped a lot of stuff out of TT for performance reasons. My guess is that the C++ code required to support the graph is no longer in TT.

 

 

 

 

Saturday, July 08, 2006 at 10:40:02 AM

Yes thats what it looks like. I was adding in stuff from what console said was missing (from my torquecvs folder) and was trying to execute from the main in there respective folders. After about adding the 15.cs or.gui file I asked myself if its really worth it.

 

Saturday, July 08, 2006 at 12:47:18 PM

 

 

Clark stripped a lot of stuff out of TT for performance reasons. My guess is that the C++ code required to support the graph is no longer in TT.

 

Shame on him! How could he remove triggers? What about water? In game editor for modding?
Tsk Tsk :P

 

 

 

 

Sunday, July 09, 2006 at 10:38:45 AM

Triggers? Just make a powerup with a huge bounding box. (Visible mesh optional.)

 

 

 

 

Sunday, July 09, 2006 at 11:58:16 PM

Yeah well we have done that :P
But what about the others eh? XD

 

 

 

 

Monday, July 10, 2006 at 7:30:12 PM

Heh heh... If I knew how to put them back in for ya, I would.

See how I use my 'artist' title as a cop out.. Mwahahaha.

 

 

 

 

Wednesday, July 12, 2006 at 12:19:08 AM

^Shouldnt be that hard if you have TGE's source (some 1337 skillz and you have yourself a copy of ThinkTanks.exe TGE-style) but then for people to use it too, they also needed the new ThinkTanks.exe, and even then, it'd be illegal to use the file ;)


Wednesday, July 12, 2006 at 6:46:20 AM

Now that I think of it... Would it be illegal if the makers of the game made a new.exe including the stuff we are missing?
Like, they MADE the game, is it not within their right to release a new aspect to their creation?

 

 

 

 

Wednesday, July 12, 2006 at 7:44:03 PM

^That wouldnt, but I think the "leader" of the company has to aggree with it (aka GarageGames currently)... But we can't... What a pity :(


Thursday, July 13, 2006 at 4:55:19 AM

Wonder if people offered some cash for versions of TT with more source included if they would be interested.

 

Thursday, July 13, 2006 at 5:25:17 AM

If you ever do it, gimme :P
But thats not what we meant... Getting the current TSL source isnt THAT needed. To add this stuff we need to edit the C++ code, that means the code the EXECUTABLE file is based in. To be able to use new stuff, everyone that wants it has to use a modified exe with the changed code... I would also like to have all the.cs :P, even though I can understand whats going on in.cs.dso (having all the.cs would be a major help though :P)


Thursday, July 13, 2006 at 7:28:22 AM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald