Torque command line arguments
by Charlie Malbaurn · in Torque Game Engine · 12/20/2004 (4:43 am) · 7 replies
Hey,
I tried to do a search on this but maybe I worded it wrong(on my 22nd hour awake)
Anyway I know that you can start torque from the command line and feed it scripts and the sort but I am wondering if you can feed it multiple things at once.
For example. I want to start Torque, run the functions writeOutFunctions() and writeOutClasses() and then Exit.
I've never been a command line person so I don't know. I went from using XTreeGold on DOS to windows 95 and considering how long ago that was, I hope no one will blame me for asking such a question
Oh and happy holidays everyone!
I tried to do a search on this but maybe I worded it wrong(on my 22nd hour awake)
Anyway I know that you can start torque from the command line and feed it scripts and the sort but I am wondering if you can feed it multiple things at once.
For example. I want to start Torque, run the functions writeOutFunctions() and writeOutClasses() and then Exit.
I've never been a command line person so I don't know. I went from using XTreeGold on DOS to windows 95 and considering how long ago that was, I hope no one will blame me for asking such a question
Oh and happy holidays everyone!
About the author
#2
I thought about that.
See the thing is, I'm writing an editor and I want to grab all the functions and methods when the user first starts a project.
The way it is set up now, when you first create a project group you point the program to the executable and from there I want it to start Torque, pull the information and exit. Then it will scan all of the script files for any script based objects or methods and add them accordingly.
I also want to keep it as automated as possible.
Maybe what I can do as a work around is enter the lines into the script through code, run Torque then remove the lines.
12/20/2004 (4:57 am)
Thanks Ron,I thought about that.
See the thing is, I'm writing an editor and I want to grab all the functions and methods when the user first starts a project.
The way it is set up now, when you first create a project group you point the program to the executable and from there I want it to start Torque, pull the information and exit. Then it will scan all of the script files for any script based objects or methods and add them accordingly.
I also want to keep it as automated as possible.
Maybe what I can do as a work around is enter the lines into the script through code, run Torque then remove the lines.
#3
It's amazingly tricky to get regular expressions working properly for things like this, but as far as I can tell it's exactly what you are looking for--the ability for an editor to be aware of script function definitions within a Torque environment.
IMO, actually running TGE simply to dump out the function list is a really big kludge if what I described above is what you are trying to accomplish.
12/20/2004 (5:31 am)
I would suggest you check out how things like CTAGS works--basically, it is a set of regular expressions that can search through files automatically and determine what lines meet the requirements for being a "script definition", a "script call", etc.It's amazingly tricky to get regular expressions working properly for things like this, but as far as I can tell it's exactly what you are looking for--the ability for an editor to be aware of script function definitions within a Torque environment.
IMO, actually running TGE simply to dump out the function list is a really big kludge if what I described above is what you are trying to accomplish.
#4
The main decision factor here is that not everyone will have access to source code. There's alot of people out there learning torque through the demo before they make an investment.
I've been able to pull out the classes, functions and methods out of the source code for a couple of days now. But again that was source code.
That and the fact that it is independent of the engine itself, has made me decide to take this road.
I know it may seem to be a 'big kludge' but it will only happen one time. unless the engine is recomplied and the user wants to re-grab the defs
12/20/2004 (6:46 pm)
Well Stephen,The main decision factor here is that not everyone will have access to source code. There's alot of people out there learning torque through the demo before they make an investment.
I've been able to pull out the classes, functions and methods out of the source code for a couple of days now. But again that was source code.
That and the fact that it is independent of the engine itself, has made me decide to take this road.
I know it may seem to be a 'big kludge' but it will only happen one time. unless the engine is recomplied and the user wants to re-grab the defs
#5
12/20/2004 (8:22 pm)
That's a good point--for some reason I was thinking you wanted to grab all the functions that were defined in your script files, not all the ConsoleFunctions that actually implement the underlying functionality.
#6
What's going to end up happening is that I'm going to make a stock set for the compiled versions and allow it to build its own for the debug versions.
That way if someone is using the demo it will already have a set. And since the demo doesn't include the source, there's less of a chance that it will be missing anything anyway.
12/21/2004 (3:19 am)
The problem I have come across though is that if you do the writeOutClasses and writeOutfunctions with the debug it works fine. If I try to do it with a release version it doesn't show the args and it doesn't write them to the files, even though it creates them.What's going to end up happening is that I'm going to make a stock set for the compiled versions and allow it to build its own for the debug versions.
That way if someone is using the demo it will already have a set. And since the demo doesn't include the source, there's less of a chance that it will be missing anything anyway.
#7
12/21/2004 (5:18 pm)
There's a few key defines which control this behavior; if you feel like changing it it's pretty straightforward.
Associate Ron Yacketta
onStart()
somehting like
function onStart() { Parent::onStart(); echo("\n--------- Initializing MOD: FPS ---------"); // Load the scripts that start it all... exec("./client/init.cs"); exec("./server/init.cs"); exec("./data/init.cs"); // Server gets loaded for all sessions, since clients // can host in-game servers. //initServer(); writeOutFunctions(); writeOutClasses(); quit(); // Start up in either client, or dedicated server mode if ($Server::Dedicated) { initDedicated(); } else { initClient(); } }Keep in mind, this is untested and is a hack job. In theory it _should_ work
-Ron