ConsoleMethod ConsoleFunction Reference
by Dreamer · 05/02/2005 (5:19 pm) · 7 comments
Download Code File
I sometimes need to edit the functionality of a particular ConsoleMethod or Function, to do this I need to know where in the source code it has been declared. So I finally decided to grep the entire SDK, and what follows is a list of all the ConsoleMethods, ConsoleFunctions, what parameters they take, what line and file they are declared on, and any resultant in line comments.
The easiest way to use the attached file is to simply load it into a text editor, and do searches with the Find function of your editor.
However it is formated so that if you are so inclined you can do a split on the colons : and load it into a DB or spreadsheet.
Just trying to read the file outright however may make you go blind :)
To generate your own version of this (Linux only unless you have some Linux utils on your windows box, TGE users MAY have the right stuff) simply go to a bash shell and enter the following commands.
Each one should be on a single line
One thing about the above, is that while the above MAY be helpful for scripting, the resource is actually meant as a road map for engine mods. If you are simply needing to script there are 2 commands you can use from within a console window or a script, which will show all of the Methods and Functions exposed to a console. This would be more appropriate in 99% of cases where you don't really care where in source the Method is, but actually just need to know that the method exists and what parameters it takes, etc.
Anyways the 2 console commands are
Enjoy!
I sometimes need to edit the functionality of a particular ConsoleMethod or Function, to do this I need to know where in the source code it has been declared. So I finally decided to grep the entire SDK, and what follows is a list of all the ConsoleMethods, ConsoleFunctions, what parameters they take, what line and file they are declared on, and any resultant in line comments.
The easiest way to use the attached file is to simply load it into a text editor, and do searches with the Find function of your editor.
However it is formated so that if you are so inclined you can do a split on the colons : and load it into a DB or spreadsheet.
Just trying to read the file outright however may make you go blind :)
To generate your own version of this (Linux only unless you have some Linux utils on your windows box, TGE users MAY have the right stuff) simply go to a bash shell and enter the following commands.
Each one should be on a single line
find Projects/Torque -print -follow | xargs egrep -H -n -e 'ConsoleFunction' >>"consolefunctions.txt"
find Projects/Torque -print -follow | xargs egrep -H -n -e 'ConsoleMethod' >>"consolemethods.txt"
One thing about the above, is that while the above MAY be helpful for scripting, the resource is actually meant as a road map for engine mods. If you are simply needing to script there are 2 commands you can use from within a console window or a script, which will show all of the Methods and Functions exposed to a console. This would be more appropriate in 99% of cases where you don't really care where in source the Method is, but actually just need to know that the method exists and what parameters it takes, etc.
Anyways the 2 console commands are
dumpFunctions(); dumpClasses();
Enjoy!
#2
Thanks for posting this. It's also in the docs... somewhere. ;)
05/02/2005 (11:18 pm)
I think F5 is search in IE (for some reason).Thanks for posting this. It's also in the docs... somewhere. ;)
#3
05/06/2005 (7:04 am)
wow! nice, the ultimate script resource. i give this 5 for extremely usefule. i didnt know about dumpfunctions() or dumpclasses() either. muchas gracias :)
#4
Seriously though, thanks for the props... I think I may do another resource here soon and call it, incredibly useful commands or something, that will include all the neat ways of getting info from and about the engine, things like tree(); %obj.dump(); etc and so forth.
05/06/2005 (7:11 am)
@Sean Well if you give it 5 then click the rate it button so we can all see :)Seriously though, thanks for the props... I think I may do another resource here soon and call it, incredibly useful commands or something, that will include all the neat ways of getting info from and about the engine, things like tree(); %obj.dump(); etc and so forth.
#5
05/06/2005 (7:17 am)
can i ask a question? what are the 2 numbers after the return type for each function?
#6
engine\audio\audioFunctions.cc(341): ConsoleFunction(alxPlay, S32, 2, 5, "alxPlay(handle) or "
engine\audio\audioFunctions.cc(372): ConsoleFunction(alxStop, void, 2, 2, "(int handle)")
engine\audio\audioFunctions.cc(381): ConsoleFunction(alxStopAll, void, 1, 1, "()")
Pretty much the exact same thing you have. But, when I click on one of those lines in my editor, it opens that file and puts my cursor on that line. it doesn't get any faster than that.
@ Sean - The first number is the minimum parameters that can be passed, and the second number is the maximum number of paramaters you can pass.
EDIT: Not sure if TextPad is available or at least usable on Linux.
05/07/2005 (5:34 am)
You know, you could have had this exact same functionality at your fingertips by just using a FREE copy of TextPad4 to do your editing. Which also gives you syntax coloring options and much more. Here's what the output of a "ConsoleFunction" search gives...engine\audio\audioFunctions.cc(341): ConsoleFunction(alxPlay, S32, 2, 5, "alxPlay(handle) or "
engine\audio\audioFunctions.cc(372): ConsoleFunction(alxStop, void, 2, 2, "(int handle)")
engine\audio\audioFunctions.cc(381): ConsoleFunction(alxStopAll, void, 1, 1, "()")
Pretty much the exact same thing you have. But, when I click on one of those lines in my editor, it opens that file and puts my cursor on that line. it doesn't get any faster than that.
@ Sean - The first number is the minimum parameters that can be passed, and the second number is the maximum number of paramaters you can pass.
EDIT: Not sure if TextPad is available or at least usable on Linux.
#7
05/07/2005 (6:25 am)
@Gonzo yeah sure that would work, but TextPad4 is a windows only app. I'm not a windows user. 
Torque Owner Dreamer
Default Studio Name
FYI this works in FireFox, I dunno about Internet Exploder.