Game Development Community

TGE Script Documentation

by Ron Yacketta · in General Discussion · 04/04/2002 (6:34 am) · 86 replies

Hello Everyone,


I have already spoke with Jeff Tunnel via email and he gave me the thumbs up "Go Go Go" signal.

So, work has begun to combine current resources and forum threads regarding TGE scripting into a single HTML formatted resource. Once this has been accomplished I will be trolling through the document (and engine code) to dig up as much info on each scripting command I can (weather it be from code, a GG employee or some other source).

If you have a scripting resource, tip, trick or tid bit of information please forward it to me so I can include it in this document. Full credit will be given to those who contribute to the project.

Regards,
Ron
#41
04/10/2002 (6:32 am)
Nice one Harold,
That will definatly make the document!
#42
04/10/2002 (9:52 am)
If anyone has anything to add to the document please send it to ryacketta@ciber.com
I be will hashing out the document look and feel on my vacation next week, and would like your input before I leave on Monday.

Also,
If anyone lives near Old Lyme, CT drop me a line. I will be their for the week.

-Ron
#43
04/12/2002 (4:16 pm)
Folks,

I have just completed documenting all 300+ console functions/commands. I will be spending next week (while on vacation) reformating the document and getting it ready to be sent to GG for their review/input.

If you would like to add anything to the document please get it to me before Sunday 10PM EST

Regards,
Ron
#44
04/22/2002 (8:17 am)
O.k
Vacation is over :(
work was done on the documentation, but not to the level I would have hoped to complete. I will definatly polish my section up realy soon and have it ready.

Does anyone else have any content to provide? or has this turned into a massive solo operation?

I recall Matt Webster wanting to pitch in as well as another chap, any word on progress ?

Regards,
Ron
#45
04/23/2002 (10:23 am)
Hey Ron -
Why not release what ya have to those who are interested in contributing (I am) so we see the format, what's actually done, etc., and it makes it easier to visually see where efforts need to be added. Just a thought. I'd probably hack on a couple o' sections here and there, but, probably they wouldn't end up being 'complete' resources. But someone could pick up where I left off, add to it what they have worked with, etc.
#46
04/23/2002 (11:16 am)
Progress:

1. Detailed outline that describes every topic and sub-topic to be covered with datablocks.

2. Written basic descriptions of datablocks, and what they are used for.

3. Not much else :p

At the end of every month things get a bit stressing with the newsletter release coming up. I am sorry to have taken so long on getting this portion of the documentation out, but I will have a complete draft ready within 2-2.5 weeks (a week or so after the newsletter release)

Be patient :)
#47
04/23/2002 (12:26 pm)
Matt,

In no hurry at all :)
was just curious more than anything, I am no where near complete with what I want to have accomplished. I do have a Phase 1 near final draft format.

Regards,
Ron
#48
04/23/2002 (3:54 pm)
ron, i know its not much help, but when youre done id be happy to proofread if you like. its all im able to do, and spelling/grammatical errors are a pet peeve of mine :)

btw thanks for doing this
#49
04/23/2002 (6:32 pm)
Jeff,

I will definatly take you up on that offer, I can provide the content for the documentation. Getting it in a decent format that a novice could digest might be a little tought. I have to keep reminding myself to not use coding lingo etc..
#50
04/25/2002 (3:40 pm)
well just post here and let me know. i cant get yahoo mail up but the problem could be my side as i reinstalled everything a week ago. i can definitely help dummy proof things for you (ie ill be the dummy =)
#51
04/25/2002 (5:31 pm)
Jeff,

Sounds like you did not get my email then. I sent you the rough of the first 1/2 page from the opening
#52
04/26/2002 (1:08 pm)
Genral Quarters General Quarters ALL hands man your battle stations this is NOT a drill!

Genral Quarters General Quarters ALL hands man your battle stations this is NOT a drill!

Genral Quarters General Quarters ALL hands man your battle stations this is NOT a drill!

Yeah yeah yeah, so what I spent 7 years in the Navy.

Now that I have your attention :)

I need you YES YOU!

do you have any tips/tricks/uncompleted documentation regarding TGE scripting that could be benefical to the entire community?

if so send them to me, anything and everything regarding TGE scripting will be accepted and reviewed to be put into the TGE scripting documentation.

This is a high vis project folks, something that has been on the GG plate for some time. So lets come together and kick out a kick arse document that will make GG proud!
#53
05/07/2002 (7:04 am)
How clean and complete does the documentation need to be? Reason I ask is that I'm slowly making notes while writing Trajectory - my most current one was how to do pull down menus, for instance. However, I'm SURE it's not complete, since I didn't jump into the GUIMenu stuff in the C++ side of Torque to look and see what all properties it supports. But for most normal stuff, what I have would be all that most people need.
#54
05/07/2002 (7:12 am)
Davis,

Community supplied documentation, tips, tricks etc do not need to be in any certain format or even 100% completed. Information that is passed my way will be reviewed and reformated (if needed) to fit into the current format of the documentation.

-Ron
#55
05/07/2002 (7:15 am)
Ok, cool. No extra work that way ;-)

Look for more cra.... er... stuff to show up in your email today or tomarrow. I'll start compiling my notes and put 'em into something semi-coherent. If anyone is lookin' to see what other people are workin' on for scripting doc. stuff, I'm mainly going to be documenting GUI stuff for the moment.
#56
05/07/2002 (7:49 am)
a little stuck here, so far I have been able to dig
through the engine code to read up on console commands
and functions.
I have found the following features "'@' 'SPC' 'NL' 'TAB'" used within the scripts
in the example dir.

I am have been unable to find references to these in the
code (maybe they are built in lex/yacc functions?).

Is the following a save/correct assumption as to what
these do?

String operators:
@ 	Concatenates one or more values together to form
        a new value
NL 	Concatenates one value together with a new line
        to form a new value
TAB 	Concatenates one value together with a tab to
        form a new value
SPC 	Concatenates one value together with a space to
        form a new value

-Ron
#57
05/07/2002 (7:54 am)
EDITED: Please excuse the formating I modified it for better readability in the forums

Folks,

Some feedback here please, so far I have gone through
4 - 5 revisions of the document trying to find a
format I like. This is my latest format, it is similar
in respects to the others.

In this section I will explain each Console command and function 
used in the TGE CVS HEAD version as of 04/04/02. 
Examples of each command or function will be given, along its 
prototype, and its return value.

Before we begin, let's take a few minutes to define some
terms, reserved keywords and operators that will be used
within this document.

Terms used within the document
	string 	refers to any single or double quoted
		collection of characters that can include 
		both numbers and text
	boolean	refers to a numeric value of either 1 or
		0 (1 being TRUE and 0 being FALSE)
	numeric refers to any intrinsic numeric data
		type (whole number, boolean, decimal number
		and or a hexadecimal number)
	global variable	refers to a variable that is
		accessible from within any function or script
	local  variable	refers to a variable that is
		only accessible within the function or script it is
		created
	variable 	refers to any string that begins
			with a percent sign (%) denoting 
			a local variable or dollar sign
 			($) denoting a global variable
	tagged string	Tagged strings are used for any
			string constant that is transmitted 
			across a connection. The entire string is 
			sent once, when referenced a short tag 
			(numeric value) identifying that string is 
			sent instead of the entire string.

Reserved Key Words
	break, case, continue, datablock, default, else,
false, function, if, for, new, or, package, return,
switch, switch$, true, and while

Operators
Assignment operators
	= 	Assigns the value of the second operand
		to the first operand.

Mathematical Operators: 
	+	(Addition) Adds 2 numbers
	-	(subtraction) Subtracts the value of its
		argument. 
	*	(Multiplication) Multiplies 2 numbers.
	/	(Division) Divides 2 numbers.
	% 	(Modulus) Computes the integer remainder
		of dividing 2 numbers.
	+= 	Adds 2 numbers and assigns the result to
		the first.
	-= 	Subtracts 2 numbers and assigns the result to the first.
	*= 	Multiplies 2 numbers and assigns the
		result to the first.
	/= 	Divides 2 numbers and assigns the result
		to the first.
	%= 	Computes the modulus of 2 numbers and
		assigns the result to the first.
	++	(Increment) Adds one to a variable
		representing a number 
		(returning either the new or old value
		of the variable)
	-- 	(Decrement) Subtracts one from a
		variable representing a number 
		(returning either the new or old value
		of the variable)

Bitwise Operators: 
	~ 	(Bitwise NOT) Flips the bits of its
		operand.
	| 	(Bitwise OR) Returns a one in a bit if
		bits of either operand is one.
	& 	(Bitwise AND) Returns a one in each bit
		position if bits of both operands are ones.
	^	(Bitwise XOR) Returns a one in a bit
		position if bits of one but not both operands are one.	 
	<< 	(Left shift) Shifts its first operand in
		binary representation the number of bits to the left
		specified in the second operand, shifting in zeros from
		the right.
	>> 	(Sign-propagating right shift) Shifts
		the first operand in binary representation the number of
		bits to the right specified in the second operand,
		discarding bits shifted off.
	|= 	Performs a bitwise OR and assigns the
		result to the first operand.
	&= 	Performs a bitwise AND and assigns the
		result to the first operand.
	^= 	Performs a bitwise XOR and assigns the
		result to the first operand.
	<<= 	Performs a left shift and assigns the
		result to the first operand.
	>>= 	Performs a sign-propagating right shift
		and assigns the result to the first operand.

String operators:: 
	@ 	Concatenates one or more values together
		to form a new value
	NL 	Concatenates one value together with a
		new line to form a new value
	TAB 	Concatenates one value together with a
		tab to form a new value
	SPC 	Concatenates one value together with a
		space to form a new value

Logical Operators: 
	!	evaluates the opposite of the value
		specified
	&& 	requires both values to be true for the
		result to be true.
	|| 	requires only one value to be true for
		the result to be true. 
	        Relational Operators:
	== 	value1 and value2 are equal
	!= 	value1 and value2 are not equal
	< 	value1 is less than value2
	> 	value1 is greater than value2
	<= 	value1 is less than or equal to value2
	>= 	value1 is greater than or equal to value2

String comparison Operators: 
	$= 	string1 is equal to string2
	!$=	string1 is not equal to string2



OpenALInitDriver()
	-Used to initializes the sound driver
	-Returns a numeric value

   if(!OpenALInitDriver())
         error("   Failed to initialize driver.");
		
OpenALShutdownDriver()
	-Used to Disable the sound driver
	-No return value

         function OpenALShutdown()
         {
         OpenALShutdownDriver();
         }

OpenALRegisterExtensions()
	-This function does not have a function body or
	any other associated engine or script code
	-No return value

	function OpenALRegister()
	{
		OpenALRegisterExtensions();
	}

alGetString(ALenum)
	-Used to return the string representing the specified ALenum passed
	-Returns a string value

         function OptAudioUpdate()
         {
         	// set the driver text
         	%text =   "Vendor: " @ alGetString("AL_VENDOR") @
         	"\nVersion: " @ alGetString "AL_VERSION") @
	 	"\nRenderer: " @ alGetString "AL_RENDERER") @
	 	"\nExtensions: " @ alGetString "AL_EXTENSIONS");
	 	OptAudioInfo.setText(%text);
         }

-Ron

GG Staff:
Is this what you are looking for in the form of documentation?
Does this meet your requirements etc?
#58
05/07/2002 (8:34 am)
As someone who will probably use the heck outta the documentation: Looks good to me. Covers the nessiary information quickly and concisely.
#59
05/07/2002 (9:31 am)
Hmm.. yes, I think it will do, I specially like that there is an example on the use, I maybe asking to much
but if you could use some crossref, it would be great.
(a link below like: Sound functions index, OpenAl, etc)

if not, this one is pretty good. good job.
#60
05/07/2002 (9:41 am)
BurningRose;

Maybe its my stupidity or ignorance, but I am not following you with you suggestion. Could you possibly provide an example? Currently I have "footnotes" in the document giving credit to the resources I used etc. I have added a footnote to the OpenAL website, giving them just credit etc.

-Ron