Game Development Community

Any documentation about variables? (what they do, range of value

by Frederic "Intruder" Tessier · in Torque Game Engine · 02/23/2003 (7:42 am) · 12 replies

Hello folks!

Well i have been modding some of the Torque demo available out there to get more familiar with the engine and also see what we can do with it (we are doing an evaluation of it). But i do this by doing some guess, like for example if i edit the pref.cs i can see the following :

$pref::CloudOutline = "0";
$pref::CloudsOn = "1";
$pref::Decal::decalTimeout = "5000";
$pref::Decal::maxNumDecals = "256";
$pref::decalsOn = "1";

I can guess by the name what those variable will affect. And that probably 0 is for FALSE and 1 for TRUE. But then when i see the timeout value is it milli or micro seconds? Is there a minimum/maximum value?

So what i am wondering is if they are any kind of references i could read, instead of having to poke with each variable to see what they do and their limits?

Thanks for your collaboration in advance.

#1
02/23/2003 (8:26 am)
There's no documentation or tutorials that I know of to directly answer these questions. I still consider myself a newbie, but I "think" I've got the basic idea of what you're asking. For most "timeout" values that I know of, it's all in milliseconds. Looking in the C++, you can find the line adding the decalTimeout variable to the console:

Con::addVariable("$pref::Decal::decalTimeout", TypeS32, &smDecalTimeout);

What you could take from that is that this is a TypeS32 variable which has a range of I think oh, +/- 2 billion. Since there's nothing else in this line which limits its range, I would guess that the maximum for that variable is about 2 billion.

I hope this helps.
#2
02/23/2003 (12:51 pm)
Frederic does not own the SDK so any C++ code is useless to him . . .

and the answer is no none of this is documented. The only way to determine these things is digging thru the C++ side of the house which you don't have.

And assuming that the range is based on the type is 100% WRONG! Alot of those float values are power modifiers that only 0.0 to 1.0 is valid inputs, some of them are limited by reason and the limits are in the implementation with clamping and other things that can only be derived by digging thru the C++
#3
02/23/2003 (1:43 pm)
(takes own advice...)

@ Jarrod: I know you didn't mean it this way, but what you said came across as an indication that the Torque engine and community are hostile to modding. I know Torque piracy is a big issue, and that self-policing is a good thing, and that the source of Torque should be more closely guarded than it is, but jeez, that seemed a bit excessive. He's interested in modding the engine, and possibly in buying it at a later date. He makes that perfectly clear. Presume innocent until proven guilty...
#4
02/23/2003 (5:23 pm)
...And now you might know why I myself have not tried to Mod...
#5
02/23/2003 (7:16 pm)
heh, no...not really...
#6
02/23/2003 (7:16 pm)
Silly Jarrod, TypeS32 isn't a float, it's an int! :p
#7
02/23/2003 (9:11 pm)
Times are very often expressed in 1000ths of a second... So the DecalTimeout you have there is set to 5 seconds. Just so ya know - I think the thread sort of jumped off topic. :)
#8
02/24/2003 (2:40 am)
Also, to clearify (since it seems my original post was rather vague), the only variables I know of that are given a range shorter than their type would indicate are those used in AddNamedFieldV(...., new FRangeValidator(0,whatever)). The Con::addVariable() function is totally different and doesn't support that. So, if a variable like decalTimeout does have a limit other than it's type would indicate, it would be somewhere buried in code (either in C++ or .CS), but I haven't seen any occurances of that.

Frederic: Sorry, I didn't quite get that you don't have the SDK. But feel free to post or email me any more questions on the C++ code and hopefully you'll get a prompt (and somewhat correct) answer. :)

p.s. - It would be rather cool if someone took the time to post a resource on the uses and ranges of all the variables and named fields exported from C++ to CS code!
#9
02/24/2003 (6:08 am)
Sounds like the closest thing to what you are loking for is the Torque Script Reference.

This will outline most scripting variables, their scope and uses. I ahven't found anything more specific outside of the SDK, and fishing through the code as was previously stated. This is probably your best bet. ;-)
#10
02/24/2003 (9:12 am)
damn you people read for COMPREHENSION, I never accused him of anything, I was making it clear to the other responder that posting C++ code was a waste of time . . .

And I was using a contrived example in refering to floats . . .

if you people spent half the time reading posts before responding the forums would not be so full of one line cruft, go do stand up on open mike night and drop the keyboard and back away.

I mean it takes a HUGE leap of negative faith to assume I was acussing anyone of anything, damn it is almost enought to just quit posting and wasting my time.
#11
02/24/2003 (10:01 pm)
Yep, finding out what some function from the engine and even the scripts do require you to dig through 'em for days :b . I had this problem trying to make the player collide with an Item, well, after a lot of digging and even trying to write my own Item type class I found the code IN the Item class that I was looking for, and with a little modification I got it all working (will post a resource on that later), anycase, if I had better documentation telling me what each member in a class do and what each variable is for I would have found a solution sooner, but this is a great engine and through the community posts we can help each other out.
#12
02/25/2003 (2:54 pm)
Thanks for everyone that have answer me with their insight!

Indeed like Jarrod mention i do not own the TGE sdk yet (but hopefully i will in the near future). So telling me to dig down the C++ source code isnt possible. This is why i was asking in the forums if anyone had done this work. Also using this methodology isnt always the most efficient one, having a real document that you can simply go read/browse is better.

So in my quest for finding documentation i came across the following (none of them are complete, but it is a good start)

List of preferences variables (by Joel baxter)
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2444

Script Reference (by Rick Smorawski)
http://perlmonkey.org/tge/

Torque Script Documentation! (by Ron Yacketta)
http://www.garagegames.com/downloads/TGE_Console_Cmds.rtf
http://www.egotron.com/torque/script.html

If people of other document source please let me know!

Thanks!