
                          C  The Martial Arts Academy  C
                                   708/967-7503
Origin System's OMEGA
Cybertank Command Language (CCL) Reference
with the Quick Syntax Guide and Assorted Lists
as prepared by Illinois Smith
10/16/90
-----------------------------------------------------------------------
(all REAL credit goes to Stuart B. Marks & the OSI Design Team)
-----------------------------------------------------------------------

	Before moving right into the CCL commands, several basic and fundamental concepts must be covered.

------------------------
1.1  General Definitions
------------------------
	The Cybertank Command Language (CCL) was designed by OSI language engineers to facilitate the creation of cybertank artificial intelligence (AI).  The Cybertank Command Language was modeled after the English language for maximum comphrehension and utilization.

	There is usually more than one command that can be used to perform a given function.  The CCL designers created simple commands for common functions nomrally executed using traditional programming structure.  Take, for example, the need to turn your cybertank to face in the direction of a scanned enemy.  The traditional command structure requires the use of "System Variables" as follows:

		Turn Tank To EnemyX EnemyY

	Noting the frequency that cybertank engineers utilized the above command, OSI designers added the following command to the CCl to perform the same function:

		Turn Tank To Face Enemy Tank

	Obviously, this command is easier to understand.

------------------------
1.2  Cycle Count
------------------------
	All commands require a period of time to execute.  Command execution time is measured in cycles.  There are two fundamental types of commands in the CCL:  1) action commands that require physical or mechanical actions by the cybertank, such as turning to face a new direction, and 2) logic commands that do not have the cybertank perform physical or mechanical actions.  Logic commands execute in 1 cycle, while action commands vary in execution time.  Rotating the scanner, for example, requires less time than turning the entire cybertank.

	Always keep cycle counts in mind when designing your cybertank's AI.  For example, a cybertank using 10 cycles in its firing intelligence fires twice as fast as one with 20 cycles.  Reducing cycle counts usually improves performance.  It should also be noted that the cycle counts given in this handbook are base figures.  For example, the command ROTATE SCANNER LEFT 1 takes 10 cycles to execute, but the command ROTATE SCANNER LEFT 4 takes 40 cycles to execute (10 cycles per angle of rotation times 4 angles).

------------------------
1.3  Reserved Words
------------------------
	CCL commands, operators, and System Variables are "reserved" for specific purposes and cannot be incorporated in user-defined variables.  (See EOF for a list of Reserved Words - I.S.)

------------------------
1.4  Structure Conventions
------------------------
	The following are used throughout this section for descriptive purposes:

	"Tank" for the sake of brevity, all CCL commands refer to cybertanks as tanks.

	[]  Optional words in CCL commands are enclosed in square brackets.  Commands will execute correctly with or without the bracketed words.

	"User Variable"  This designates where a User Variable name is to be used.

	"Any Variable"  This designates where either a User Variable or a System Variable name is to be used.

	"#"  This designates where a User Variable name, a System Variable name, or a numeric digit is to be used.

	"Label"  This designates where a label name is to be used.

	: (colon)  This designates an alternative.  For example, [Branch To : Do] indicates that either Branch To or Do can be used.

	cyc  This designates a command's cycle count.  All initial command definitions include their cycle count.

	"X"  This designates that an X-coordinate on the map is to be used.

	"Y"  This designates that a Y-coordinate on the map is to be used.

------------------------
1.5  Labels
------------------------
	Labels used to designate the beginning of an AI segment can be executed with either the Do (Gosub) or Branch To (Goto) commands.  A label may be composed of any alphanumeric character or symbol, with a 10 character maximum length.  A label may contain a reserved word.  If, during the Authorization process, you receive an "Out of label memory space" error message, try shortening the length of your labels.

------------------------
1.6  System Variables
------------------------
	System Variables are used by the CCL for internal operations.  They can be used in computations, but cannot be altered.  System Variables are very useful, and often neccessary, in designing cybertank AI.  (See EOF for a list of all the System Variables -I.S.)

------------------------
1.7  User Variables
------------------------
	A User Variable is defined by the employee (user).  Unlike System Variables, User Variables can be altered, can be composed of any alphanumeric character or symbol, and can be up to 15 characters in length.  A User Variable name can contain a reserved word, but cannot consist of a reserved word alone.  For example,  "Turn" is a reserved word while "MyTurn" is a legal User Variable name.

------------------------
1.8  Operators
------------------------
	CCL supports the operators:  "+"  (addition),  "-"  (subtraction),  "<"  (less than),  ">"  (greater than),  "="  (equals),  "<="  (less than or equal),  ">="  (greater than or equal),  and  "<>"  (not equal).  The operators are used as shown below

1 cyc	"User Variable" = "#"
1 cyc	"User Variable" = "Any Variable" + "#"
1 cyc	"User Variable" = "Any Variable" - "#"

	The above commands are called Assignment statements because the left side of the "=" is "assigned" the value of the right side.

1 cyc	If "Any Variable" = "#" Then [Branch To:Do] "Label"
1 cyc	If "Any Variable" = "Any Variable" + "#" Then [Branch
		To:Do] "Label"
1 cyc	If "Any Variable" = "Any Variable" - "#" Then [Branch
		To:Do] "Label"

	The above commands are called Conditional statements for (or If/THEN statements.)  These statements help control the flow of AI by checking various settings or conditions.  Note that anywhere the "="  is used in the above Conditional examples, any of the operators ("<", ">", "<=", ">=", "<>") can be substituted.

	Now for a few examples:

		MyTurn = TankDir + 1

	This sets the User Variable "MyTurn" to the System Variable "TankDir" plus one.  So, if "TankDir" is currently equal to three, then "MyTurn" would be assigned to the value of four.

		If MyTurn >= 2 Then Branch To Done

	This example causes the AI to branch to the label "Done" if and only if the User Variable "MyTurn" is greater than or equal to two.  Based upon the first example, "MyTurn" was set to four; therefore, the AI would indeed branch to the label "Done".

		If MyTurn = TankDir + 1 Then Branch To Done

	This line causes the AI to branch to the label "Done" if and only if the User Variable "MyTurn" is equal to the System Variable  "TankDir"  plus one.  So, the cybertank logic unit retrieves the value of "TankDir" and adds one to it.  It then compares this value to "MyTurn."  If they are equal, then the branch is taken.

	Note: Adding one to "TankDir" is only for purposes of comparison.  The value of "TankDir" does NOT change until an instruction is encountered which directs the cybertank to turn.

------------------------
Quick Syntax Guide
------------------------
Tank Movement
------------------------
MOVE [TANK] FORWARD "#"
MOVE [TANK] BACKWARD "#"
TURN [TANK] LEFT "#"
TURN [TANK] RIGHT "#"
TURN [TANK] TO "ANGLE"
TURN [TANK] TO "X" "Y"
TURN [TANK] TO FACE [ENEMY] [TANK]
TURN [TANK] TO FACE ENEMY HQ
ALIGN TANK [WITH SCANNER]
IF TANK [IS] FACING [ENEMY] TANK THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] NOT FACING [ENEMY] TANK THEN [BRANCH TO:DO]
	"LABEL"
IF TANK [IS] FACING ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] NOT FACING ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] FACING "X" "Y" THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] NOT FACING "X" "Y" THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] ALIGNED [WITH SCANNER] THEN [BRANCH TO:DO]
	"LABEL"
IF TANK [IS] NOT ALIGNED [WITH SCANNER] THEN [BRANCH TO:DO]
	"LABEL"
IF [MOVEMENT IS] OBSTRUCTED THEN [BRANCH TO:DO] "LABEL"
IF [MOVEMENT IS] NOT OBSTRUCTED THEN [BRANCH TO:DO] "LABEL"
IF OBSTRUCTION [IS] ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF OBSTRUCTION [IS] ALLY HQ THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] FACING [ENEMY] TANK THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] NOT FACING [ENEMY] TANK THEN [BRANCH TO:DO]
	"LABEL"
IF TANK [IS] FACING ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] NOT FACING ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF TANK [IS] FACING "X" "Y" THEN LABEL
IF TANK [IS] NOT FACING "X" "Y" THEN LABEL
DETECT [OBSTRUCTION] AT "#"
DETECT [OBSTRUCTION] AT TANK DIRECTION
DETECT [OBSTRUCTION] AT SCANNER DIRECTION
IF [TANK] TREADS [ARE] FUNCTIONAL THEN [BRANCH TO:DO] "LABEL"
IF [TANK] TREADS [ARE] NOT FUNCTIONAL THEN [BRANCH TO:DO]
	"LABEL"

Detecting Movement Obstructions
------------------------
DETECT [OBSTRUCTION] AT "#"
DETECT [OBSTRUCTION] AT TankDir
DETECT [OBSTRUCTION[ AT ScanDir
IF [MOVEMENT IS[ OBSTRUCTED THEN [BRANCH TO:DO] "LABEL"
IF [MOVEMENT IS] NOT OBSTRUCTED THEN [BRANCH TO:DO] "LABEL"
IF OBSTRUCTION [IS] ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF OBSTRUCTION [IS] ALLY HQ THEN [BRANCH TO:DO] "LABEL"

Using the Scanner
------------------------
ROTATE [SCANNER] LEFT "#"
ROTATE [SCANNER] RIGHT "#"
ROTATE [SCANNER] TO "ANGLE"
ROTATE [SCANNER] TO "X" "Y"
ROTATE [SCANNER] TO FACE [ENEMY] TANK
ALIGN SCANNER [WITH TANK]
SCAN FOR [ENEMY] TANK
SCAN FOR [CLOSEST] OBJECT
SCAN FOR ENEMY HQ
LOCK SCANNER
UNLOCK SCANNER
JAM [SCANNER SIGNAL]
LAUNCH [REMOTE SCANNER]
IF SCANNER [IS] FUNCTIONAL THEN [BRANCH TO:DO] "LABEL"
IF SCANNER [IS] NOT FUNCTIONAL THEN [BRANCH TO:DO] "LABEL"
IF SCANNER [IS] ALIGNED [WITH TANK] THEN [BRANCH TO:DO]
	"LABEL"
IF SCANNER [IS] NOT ALIGNED [WITH TANK] THEN [BRANCH TO:DO]
	"LABEL"
IF [ENEMY] TANK [WAS] FOUND THEN LABEL
IF [ENEMY] TANK [WAS] NOT FOUND THEN LABEL
IF [CLOSEST] OBJECT [WAS] FOUND THEN [BRANCH TO:DO] "LABEL"
IF [CLOSEST] OBJECT [WAS] NOT FOUND THEN [BRANCH TO:DO]
	"LABEL"
IF ENEMY HQ [WAS] FOUND THEN [BRANCH TO:DO] "LABEL"
IF ENEMY HQ [WAS] NOT FOUND THEN [BRANCH TO:DO] "LABEL"
IF [CLOSEST] OBJECT [IS] ENEMY HQ THEN [BRANCH TO:DO] "LABEL"
IF [CLOSEST] OBJECT [IS] ALLY HQ THEN [BRANCH TO:DO] "LABEL"
IF [SCANNER IS] LOCKED THEN LABEL
IF [SCANNER IS] UNLOCKED THEN LABEL
IF [TANK IS] BEING SCANNED THEN [BRANCH TO:DO] "LABEL"
IF [TANK IS] NOT BEING SCANNED THEN [BRANCH TO:DO] "LABEL"
IF REMOTE [SCANNER IS] AVAILABLE THEN [BRANCH TO:DO] "LABEL"
IF REMOTE [SCANNER IS] UNAVAILABLE THEN [BRANCH TO:DO]
	"LABEL"

Using the Weapon
------------------------
FIRE [WEAPON] AT [ENEMY] TANK
FIRE [WEAPON] AT [CLOSEST] OBJECT
FIRE [WEAPON] AT OBSTRUCTION
FIRE [WEAPON] AT "X" "Y"
FIRE [WEAPON] AT TANK DIRECTION
FIRE [WEAPON] AT SCANNER DIRECTION
FIRE [WEAPON] AT ENEMY HQ
IF WEAPON [IS] FUNCTIONAL THEN [BRANCH TO:DO] "LABEL"
IF WEAPON [IS] NOT FUNCTIONAL THEN [BRANCH TO:DO] "LABEL"
IF [ENEMY] TANK [IS] WITHIN [WEAPON] RANGE THEN [BRANCH TO:
	DO] "LABEL"
IF [ENEMY] TANK [IS] BEYOND [WEAPON] RANGE THEN [BRANCH TO:
	DO] "LABEL"
IF [CLOSEST] OBJECT [IS] WITHIN [WEAPON] RANGE THEN
	[BRANCH TO:DO] "LABEL"
IF [CLOSEST] OBJECT [IS] BEYOND [WEAPON] RANGE THEN
	[BRANCH TO:DO] "LABEL"
IF ENEMY HQ [IS] WITHIN [WEAPON] RANGE THEN [BRANCH TO:DO]
	"LABEL"
IF ENEMY HQ [IS] BEYOND [WEAPON] RANGE THEN [BRANCH TO:DO]
	"LABEL"

Tank Status
------------------------
IF FUEL [IS] REMAINING THEN [BRANCH TO:DO] "LABEL"
IF FUEL [IS] EMPTY THEN [BRANCH TO:DO] "LABEL"
SELF DESTRUCT

Defense Shield
------------------------
RAISE [SHIELD]
LOWER [SHIELD]
IF SHIELD [IS] UP THEN [BRANCH TO:DO] "LABEL"
IF SHIELD [IS] DOWN THEN [BRANCH TO:DO] "LABEL"

Tank Repairs
------------------------
REPAIR INTERNAL
REPAIR ARMOR
REPAIR TREADS
REPAIR SCANNER
REPAIR WEAPON
IF [REPAIR] KIT [IS] AVAILABLE THEN [BRANCH TO:DO] "LABEL"
IF [REPAIR] KIT [IS] UNAVAILABLE THEN [BRANCH TO:DO] "LABEL"

Using the Commlink
------------------------
TRANSMIT [CODE] "#" [TO TEAM]
CLEAR [COMMLINK] DATA
COPY [COMMLINK] DATA
SWITCH [COMMLINK] ON
SWITCH [COMMLINK] OFF
IF ALLY TANK "#" [IS] ACTIVE THEN [BRANCH TO:DO] LABEL
IF ALLY TANK "#" [IS] INACTIVE THEN [BRANCH TO:DO] LABEL

Miscellaneous Commands
------------------------
GET DISTANCE [TO] "X" "Y"
GET RANDOM [TO "#"]
BEEP
BREAK

Attaining Manual Control
------------------------
IF [LAST] KEY [PRESSED] THEN [BRANCH TO:DO] "LABEL"
IF [LAST] KEY [PRESSED] = "1 CHARACTER" THEN [BRANCH TO:DO]
	"LABEL"

System Commands
------------------------
BRANCH TO "LABEL"
GOTO "LABEL"
DO "LABEL"
GOSUB "LABEL"
RESUME

Using Library Capsules
------------------------
INCLUDE "CAPSULE FILENAME"

------------------------
CCL Reserved Words
------------------------
The following list of words cannot be employed
in User Defined Variables

ACTIVE		ALIGN		ALIGNED		ALLY
ARE			ARMOR		AT			AVAILABLE
BACKWARD	BEEP			BEING		BEYOND
BRANCH		BREAK		CLEAR		CLOSEST
CODE			COMMLINK	COPY			DATA
DESTRUCT		DETECT		DIRECTION		DISTANCE
DO			DOWN		EMPTY		ENEMY
FACE			FACING		FIRE			FOR
FORWARD		FOUND		FROM		FUEL
FUNCTIONAL	GET			GOSUB		GOTO
HQ			IF			INACTIVE		INCLUDE
INTERNAL		IS			JAM			KEY
KIT			LAST		LAUNCH		LEFT
LOCKED		LOWER		MOVE		MOVEMENT
NOT			OBJECT		OBSTRUCTED	OBSTRUCTION
OFF			ON			PRESSED		RAISE
RANDOM		RANGE		REMAINING	REMOTE
REPAIR		RESUME		RETURN		RIGHT
ROTATE		SCAN		SCANNED		SCANNER
SELF			SHIELD		SIGNAL		SWITCH
TANK		TEAM		THEN		TO
TRANSMIT	TREADS		TURN		UNAVAILABLE
UNLOCK		UNLOCKED		UP			WAS
WEAPON		WITH		WITHIN


------------------------
System Variables
------------------------
The following is a list of all CCL System Variables.  Feel free
to use them, but remember that they cannot be altered
or used as labels.

AllyCode		AllyDir		AllyDist		AllyEnemyDir
AllyEnemyDist	AllyEnemyX	AllyEnemyY	AllyHQX
AllyHQY		AllyNum		AllyX		AllyY
ArmorDamage	CopyCode		CopyDir		CopyDist
CopyEnemyDir	CopyEnemyDist	CopyEnemyX	CopyEnemyY
CopyNum		CopyX		CopyY		EnemyDist
EnemyHQDist	EnemyHQX		EnemyHQY		EnemyX
EnemyY		FuelLevel		IntDamage		KitsLeft
ObjDist		ObjType		ObjX			ObjY
ObstacleDist	ObstacleType	ObstacleX		ObstacleY
RandomNum	RemotesLeft	ScanDamage	ScanDir
TankDir		TankNum		TankX		TankY
TreadDamage	XYDist		WeapDamage


------------------------
BONUS! - Object Types!
------------------------
The following list should be used as an aid in incorporating a
system variable that reports an "object's type."

	TYPE NUMBER		DESCRIPTION
	---------------		--------------
	00				No Object
	01				Roads, grass, etc...
	02				Water
	03				Damaged Cybertanks, squashed trees
	04				Trees
	05				Houses, HQ
	06				Buildings, barriers
	Greater than 6		Cybertanks

Object types 3-5 are destructible while object type 6 (buildings, barriers) is indestructible.

Object types 2-6 are detectable by the MOS (Movement Obstruction Sensor).  Cybertanks are also detectable by the MOS as objects with types greater than 6.

Object types 3-6 can be detected with the CSS (Cybertank Scanner System).  Cybertanks are also detectable by the CSS as objects with types greater than 6.

Object types 4-6 block a scanner's line of sight when scanning for cybertanks and other objects.
-----------------------------------------------------------------------

*** Oh well, that's the file.  I actually ran across some confusing bits
of mis-spelling which I corrected (the CSS abbreviation for example - in the book it read CCS, but there isn't anything called CCS in the game!), and I added some of the detection commands for using the MOS which were not in the Quick Syntax Guide in the manual...
I strongly suggest if you wish to play the game you go out and buy it, it's well worth the money...  (ALSO, because this certainly isn't an exhaustive list, and it can't really WRITE the AIs for you - these are just the building blocks, you gotta supply the logic they get laid down in...)
					Hope it Helps!

								-Illinois Smith
-----------------------------------------------------------------------
Call these fine boards:
The Silver Toungue		708-759-1916	Sysop: Beowulf
Ripco II				312-528-5020	Sysop: Dr. Ripco
Martial Arts Academy		708-967-7503	Sysop: Windwalker
Magnetic Field Elite		708-966-0708	Sysop: The Magnet
The Eclectic Dialectic		708-705-6774	Sysop: Neredboijas
-----------------------------------------------------------------------


|Main| 