Game Development Community

Could do with a few basic pointers learning torquescript

by Glynn James · in Torque Game Builder · 03/11/2006 (5:42 am) · 1 replies

Hi!

Im a web developer so ive worked with php, asp, perl, and loads of other web based scripting languages, so learning torquescript for most of the part has been dead easy, it all the same really, just how you handle the different markup methods.

what im failing to figure out is some of what i presume are object/system references within the code. basically i dont know what they are called so its difficult to do a serach on them.

heres an example
in main.cs (i know i havent got very far!) of the tgb standard release t2d folder
within the function parseArgs

%arg = $Game::argv[%i];
yep the start is obvious, im creating a variable %arg and storing that whatsit thats after it inside it
the whatsit is the problem

whats is $Game? (ive not created it as a variable far as i can see in the code)
whats the :: for? (i presume this is some object related prefix of somekind?)
is argv a torque built in function? (i havent searched on this - its mainly the $game:: bit confusing me)

as i got further through the trail of files i find other instances of it

Parent::loadKeybindings();

i can look up loadkeybindings - i presume its a function either built into torque or in one of the already exec'ed extra .cs files, but parent:: ?

Im not asking some to explain it all in the post, but a pointer to a page somewhere explaining it would be fantastic!

Thank you in advance!

#1
03/11/2006 (6:00 am)
This may help in general and with the :: in relation to namespaces
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2212

'::' is a qualfier

you could use it to assign variables to a namespace
$Game::whatevernamespace


the 'arg' you talk about should be the one/s refering to arguments passed at the .exe stage.
Like T2D.exe -argumentX


you can go here and the the
Essential Guide Torque Game Engine (EGTGE)
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5661


I hope this helps

Remember you don't need to declare varaibles before using them... (just in case that is confusing things a bit)