Game Development Community

Adding a new Torque Script Extension

by MrPhil (Philip Ludington) · in Torque Game Engine · 02/28/2005 (12:46 pm) · 26 replies

So I've started work on a Torque Script extension for Visual Studio .Net 2003. I've run into a major road block: .cs = C# file to Visual Studio. There maybe a way to get around this in VS but it scares me to think about.

So I'm thinking it might be a better idea to add a new extension that the Torque family can accept as a script file. I know little about the engine architecture I was hoping someone could give me a rough estimate of the effort that would be?

What would the new extension be you ask? Right now I'm favoring .tge but anyone kicking around a better extension then please let me know.

About the author

My name is Philip Ludington, I'm a professional programmer by day and I dabble in game development by night. Learn more about my projects at www.MrPhilGames.com

Page «Previous 1 2
#1
03/01/2005 (4:10 pm)
I think the best extension would be *.ts short for torque script
#2
03/01/2005 (5:03 pm)
Have been thinking about this most of the day, and the only real things I can think of:

1) You'll need to obviously change all of your scripts that exec(...) files to reflect the new extension.
2) You'll need to modify the exec(...) function itself, as well as any low level primitives in consolexxx.cc/h that deal with loading and compiling script files.
3) You'll need to probably look for the same thing in 2) above for searching for (and writing out) .cs.dso files. We normally just call them .dso, but there is a .cs stub in there as well.
4) There is probably more that I'm missing!
#3
03/01/2005 (5:06 pm)
.ts would be better since TSE/TGE/T2D all use TorqueScript.
#4
03/01/2005 (8:34 pm)
@ Stephen Zepp - Thanks for the insight sound like a big deal as I suspected. I've been mulling things over and I'm starting to think it might be a better use of my time to work on a Torque editor. Meaning an editor built on/in Torque. Labrat suggested I check out Davis Sickmon's work TGE In-Game Script Editor. So I need to at least research that first.

@ Michael-Paul & David - Actual .ts was the second thing that jumped into my mind (after .tcs), but according to FileExt that is the extension for "Transport Stream MPEG-2 Video Stream" which I was thinking could lead to some problems.
Quote:VOB files you find on a DVD are MPEG2-PS files. The PS format, however, is not adapted for streaming video through a network or by satellite. Another format called Transport Stream (TS) was designed for streaming MPEG videos through such channels. VideoLAN software can handle these streams.
On the other hand it isn't a language and maybe that is all that matters.
#5
03/01/2005 (8:44 pm)
Every time I've seen TS files utilized in realtime, they've been ecapsulated in another wrapper format like WMF's, MOV's, or Real Media formats. Video encoding programs may see them and try to encode them, but they shouldn't cause streaming problems. At least not from my experience. I only have limited distanced learning and streaming video knowledge, though.

How about .tps for Torque Platform Script.

But that could get confused with TPS reports...
#6
03/01/2005 (9:46 pm)
How about .tsc?

I haven't seen this extension used in programs.
GG any comments about the new extension for torque scripts suggestions?
#7
03/09/2005 (3:05 pm)
I'm curious... What does the c in cs stand for?

I'm not sure about macs or linux, but on windows, we're no longer limited to two or three letters in extensions. How about just .torque?

-Nick
#8
03/10/2005 (8:18 am)
@Nikhil
I always assumed it stood for compiled script
#9
03/10/2005 (8:53 am)
.cs (as far as I know) stands for c script.
#10
03/10/2005 (11:34 am)
@Philip
I think Nikhil was wondering what the "c" in the torque script extension cs is for. But yes, .cs is also the extension for c#.
#11
03/10/2005 (1:57 pm)
@Todd Yes, and he answered. ;) Script that is derivative of the language 'C', predecessor to 'C++'.
#12
03/10/2005 (2:34 pm)
@Daniel
Now that you say that I see what he was saying, I totally read it wrong heh
#13
03/10/2005 (2:44 pm)
That was funny. I guess I should be more clear.

To Torque .cs = c script
To Visual Studio .cs = c sharp

To Einstein c is the constant speed of light
#14
03/10/2005 (2:55 pm)
@David Blake -

But that could get confused with TPS reports...

was that a reference to Office Space??
#15
03/10/2005 (5:03 pm)
Office Space was a great movie. :) .TSC would be a good extension, but really, since the engine doesn't use C#, it's hard to confuse C# code files and scripts.
#16
03/10/2005 (5:20 pm)
@daniel

Atleast we configure the application when doubleclick seperately from C# plus we can provide a new kickass icon for Torque Scripts without ruining Bill Gate's Empire Softwares lol.

*.tsc for torque script WHO SAYS AYE?
#17
03/10/2005 (8:00 pm)
Good point John. Forgot about that.
#18
03/10/2005 (8:09 pm)
We see you've been missing a lot of work.
Well, I can't say I've been missing it!

Since I haven't felt like doing a find/replace on cs and then recompiling the engine and then sorting out a large number of referential bugs, it may be a good reference point to check on the TorqueBASIC project. The aim of TorqueBASIC was to add TorqueScript functionality with BASIC syntax for new user integration. I believe that a BASIC parser was even created. It might be a good idea to use it as a starting point.
#19
03/11/2005 (7:45 am)
@Daniel - Maybe I'm missing the joke but the problem isn't a human telling the difference between the files the problem is that I can't add Torque Script as a language Visual Studio recognizes because it conflicts with C# Sharp files. As far as I've figured there is no way around this problem within Visual Studio so I figured it might be easier to change the extension from with in Torque.

At this point, I'm so busy working on my game etc. that I haven't put much more time into the project. I've started using ConText which is free and does alright.

@David - I'll have to looking to this project, maybe it'll outline some of the work necessary.

In general because I am a programmer by trade I tend to get involved in complicated tools changes which slows down the progress on my game. So I'm constantly reminding myself to put the game first. Maybe If I didn't have a day job and I could put aside a few hours a week to improve tools I'd be able to make some progress in this area, but for now I would count on it.
#20
03/11/2005 (11:52 am)
Philip, you're absolutely right - I just didn't see the problem at first because I use Visual Studio to read my .cs scripts, but I only have C++... not C#, so I have no conflicts. A new extension is necessary. :)
Page «Previous 1 2