User Tools

Site Tools


crpl:stuff:original_xml

Original XML used to create help and reference pages. Now probably obsolete.

crpl-lang-def.xml
<Crpl>
 
<preamble>
<![CDATA[
		<h1>CRPL Syntax Reference</h1>
		<h2>CRPL the Language</h2>
		<p>
		CRPL is a stack-based, Reverse Polish Notation language. There, now that we've 
		said it, what does it mean?</p>
		If you have ever programmed a HP calcualtor, or used the Forth language, you will know 
		instantly what this means. For the rest of us, here is a simple explanation. For a more 
		detailed explanation, , see the <a href="tutorial.html" target="_blank">CRPL Tutorial</a>.
		<p>
		Each CRPL instruction (term) uses one or more arguments that are on a "stack". The most 
		recent argument on the stack will be used first.</p>
		<p> You can place arguments on the stack by typing them, or an instruction that are 
		executed can push arguments on to the stack. So, for instance, you can type 2 4 5 and 
		then these three numbers are on the stack.</p>
		<p>
		As an illustration, imagine you want to add two of the numbers you entered above, then 
		the instruction to perform addition is "add," If you type "add" as your next instruction,
		then the instruction will read the two most recent arguments on the stack (4 and 5), 
		add then and push the sum on to the stack. After the instruction has competed, there 
		will be two numbers oin the stack. The "2" from your original entry, and "9" - the 
		sum of the two arguments added by the "add" instruction.
		</p>
		<h2>Comments</h2>
		<p>
		adding comments makes code easier to unserstand, and sometimes helps the programmer 
		or another reader to grasp complex pieces of logic.  Also, after an absence, it 
		refreshes one's mind about exctly what a certain piece of code was intended to do.
		</p> 
		<p>
		Comments in CRPL can be either a whole line or a partial line. The comment terminates 
		when a line ends.
		</p> 
		<p>
		Comments are indicated by the "hash" character (<strong>#</strong>),
		</p> 
		<code><br/>
		#this is a comment<br/>
		2 3 add  # add two numbers together<br/>
		</code>
		<p>
		<h2>Stack notation</h2>
		<p>Every CRPL operand takes one or more arguments from a "stack", pushes one or more 
		operands onto the "stacK, or does both. 
 
		In order to diagram the number of arguments consumed or produced, the following 
		notation is included in every description following:
		<ul>
		<li>The term is defined by two dashes: --</li>
		<li>Preceding the term are the number of arguments consumed from the stack.</li>
		<li>Following the term are the number of arguments pushed onto the stack.</li>
		</ul>
		<p>For instance, the instruction to add two numbers are </p>
		<p><code>4 5 add</code></p>
		<p>Stack notation to represent this will be:</p>
		<p><code>4 5 -- 9</code></p>
		<p>
		<strong>Note:</strong>Unless explicitly noted otherwise, all instructions are 
		destructive stack opeartions in that they will <strong>remove</strong> as many 
		argumants as is required for their execution from the stack and replace theose 
		with the output from their execution. In the example above, the original two items 
		on the stack has been replaced by the sum.
		</p>
		<p>
		Likewise, note that the most recent item pushed on to the stack will also be the 
		first item to be removed. This is refferred to as LIFO (Last In, First Out) processing.
		</p>
		<p>The following convention is followed to represent items on the stack notation</p>
		<table  style="width:60%;">
			<tr>
				<td style="width:15%;"><code>b</code></td><td><strong>Boolean</strong>
				; nominally a 1 or a zero, representing True or False
				</td>
			</tr>
			<tr>
				<td>i</td><td><strong>Integer</strong>
				; an integer. The CRPL run-time will, if possible, convert the argumant 
				to an integer.
				</td>
			</tr>
			<tr>
				<td>n</td><td><strong>Term</strong>
				; a generic argument. Any term that will be accepted by the instruction. 
				If possible, the CRPL run-time will attempt conversion between types.
				</td>
			</tr>
			<tr>
				<td>f</td><td><strong>Float</strong>
				; a floating point value. If possible, the CRPL run-time will 
				attempt conversion between types.
				</td>
			</tr>
			<tr>
				<td><code>x, y</code></td><td><strong>Coordinate</strong>
				; an integer that represents a valid X- or Y-coordinate on the map.
				</td>
			</tr>
			<tr>
				<td><code>s</code></td><td><strong>String</strong>
				; a string of one or more text characters. If possible, numeric 
				values will be converted at run-time.
				</td>
			</tr>
		</table>
 
		<h2>Typographical conventions</h2>
		<p>The following typographical conventions are used in this reference document:</p>
		<table style="width:60%;">
		<tr>
		<td style="width:20%;">Normal text</td>
		<td>Used in most instances.</td>
		</tr>
		<tr>
		<td><span class="instruction">Instruction</td>
		<td>Refers to a CRPL language element or instruction.</td>
		</tr>
		<tr>
		<td><span class="argument">Argument</td>
		<td>Refers to a an argument required for a CRPL instruction.</td>
		</tr>
		<td><span class="User">User</td>
		<td>Refers text that should be replaces with user-supplied values.</td>
		</tr>
		</table>
 
		<h2>Editing CRPL</h2>
		Any text editor can be used to edit crpl files.  However, syntax hightlight and auto
		completion support files are provided for the freely available Notepad++ editor.  Notepad++
		can be obtained from here:
		<p>
		<a href="http://notepad-plus-plus.org/">http://notepad-plus-plus.org/</a>
		<p>
		Once Notepad++ is installed you can add syntax hightlight for the CRPL langage by downloading
		this file.  RIGHT CLICK AND CHOOSE SAVE AS:
		<a href="/creeperworld3/CRPL/docs/CRPL-syntax.xml">CRPL-syntax.xml</a>
		<p>
		To install into Notepad++ select Language from the menu, then click 
		"Defined Your Language", then "import".
		<p>
		You can add keyword auto completion to Notepad++ by download this file. 
                RIGHT CLICK AND CHOOSE SAVE AS:
		<a href="/creeperworld3/CRPL/docs/CRPL.xml">CRPL.xml</a>
		<p>
		To install into Notepad++ you need to copy CRPL.xml to your Notepad++ install 
		directory\plugins\APIs directory.  Then, restart Notepad++.  
		Next, go to the Settings/Preferences menu in Notepad++.  
		Click the "Backup/Auto-Completion" tab.  Check the 
		"Enable auto-completion on each input" checkbox, and make sure the 
		"Function completion" radio button is selected.<p>
 
 
]]>
</preamble>
 
<commands>
 
<command autoKeyword="false" syntaxKeywordGroup="6">  <!-- INPUTVAR -->
	<name>$VARNAME:DEF_VAL</name>
	<altname>$</altname>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Defines an input variable.  Input variables are created at script start and 
	assigned either the default value, or a value specified in the editor.</desc>
	<examples>
<![CDATA[
$amtToEmit:10
$interval:15
 
CurrentCoords <-amtToEmit SetCreeper
<-interval Delay
]]>
	</examples>
</command>
 
<command autoKeyword="false" syntaxKeywordGroup="2">  <!-- read -->
	<name>&lt;-VARNAME</name>
	<altname>&lt;-</altname>
	<args></args>
	<notation>-- n1</notation>
	<result>An item read from VARNAME</result>
	<desc>Reads the contents of the local variable VARNAME and pushes it to the stack.
	If VARNAME does not exist, 0 is pushed to the stack.  Local variables persist across 
	script invocations.</desc>
	<examples>
<![CDATA[
# Increment a variable named 'i' by 1 and store the result back in 'i'
<-i 1 add ->i
]]>
	</examples>
</command>
 
<command autoKeyword="false" syntaxKeywordGroup="2">  <!-- write -->
	<name>-&gt;VARNAME</name>
	<altname>-&gt;</altname>
	<args>Some item on the stack</args>
	<notation>-- n1</notation>
	<result></result>
	<desc>Pops an item from the stack and stores it in the local variable named VARNAME.
	Local variables persist across script invocations.</desc>
	<examples>
<![CDATA[
# Store coordinate points in local variables. 
# The points are defined once and assigned to local variables. 
once 
	10 ->x1 
	20 ->y1 
	40 ->x2 
	50 ->y2 
endonce
]]>
	</examples>
</command>
 
<command autoKeyword="false" syntaxKeywordGroup="2">  <!-- exists -->
	<name>-?VARNAME</name>
	<altname>-?</altname>
	<args></args>
	<notation>-- b1</notation>
	<result>0 or 1 depending on if VARNAME exists</result>
	<desc>Checks to see if VARNAME exists (has been assigned). If so, 1 is pushed to 
	the stack else 0. Local variables persist across script invocations.</desc>
	<examples>
<![CDATA[
# check to see if variable "Spore" exists.
# If not, fire a spore and set the variable so no 
# further spores will launch.
 
-?Spore if
   CurrentCoords RandUnitCoords 1 20 CreateSpore
   "fired" ->Spore
endif
]]>
	</examples>
</command>
 
<command autoKeyword="false" ignoreSyntax="true">  <!-- refread -->
	<name>&lt;-!</name>
	<args></args>
	<notation>s1 -- n1</notation>
	<result>An item read from the variable named s1</result>
	<desc>Reads the contents of the local variable named s1 and pushes it to the stack.  
	Since s1's contents can vary, this allows dynamic reading of variables.</desc>
	<examples>
<![CDATA[
# Store a number in the variable named xyz
123 ->xyz
 
# Build a string by concatenating "12" and "3".
# The results is "123".  Use that as the name of a var and read its contents.
# The result of the read is pushed to the stack and traced.
 
"12" "3" concat <-!
trace
]]>
	</examples>
</command>
 
<command autoKeyword="false" ignoreSyntax="true">  <!-- refwrite -->
	<name>-&gt;!</name>
	<args></args>
	<notation>s1 n1 --</notation>
	<result></result>
	<desc>Pops a name of a variable and an item from the stack and stores the item 
	in the variable.</desc>
	<examples>
<![CDATA[
# Build a string by concatenating "xy" and "z".
# Store the number 123 in the variable named "xyz".
"xy" "z" concat 123 ->!
<-xyz trace
]]>
	</examples>
</command>
 
 
<command autoKeyword="false" ignoreSyntax="true">  <!-- refexists -->
	<name>-?!</name>
	<args></args>
	<notation>s1 -- b1</notation>
	<result>0 or 1 depending on if variable exists</result>
	<desc>Takes a string from the stack and uses it as a variable name.  Checks to 
	see if the varialbe exists (has been assigned). If so, 1 is pushed to the
	stack else 0.</desc>
	<examples>
<![CDATA[
# Build a string by concatenating "xy" and "z".
"xy" "z" concat -?!
trace
]]>
	</examples>
</command>
 
 
 
<command blockStatement="open"> <!-- if -->
	<name>if</name>
	<args>Cond</args>
	<notation>b1 --</notation>
	<result></result>
	<desc>Evaluate the first element on the stack. If True, then execute statements 
	that follow, up to the ehdif statement. If False, execution skips to the first 
	statement following the endif statement. Any nonzero value is consierered True, 
	a value of zero is False.</desc>
	<examples>
<![CDATA[
# Creates a runner at the units current coordinates 
# every three seconds, but only if there is digitalis underneath. 
CurrentCoords GetDigitalis if 
	CurrentCoords 2 10 20 CreateRunner 90 Delay 
endif
]]>
	</examples>
</command>
 
<command blockStatement="middle"> <!-- else -->
	<name>else</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>When the if statement evaluates to False, then the statements following 
	the else, up to the endif, are executed instead.</desc>
	<examples>
<![CDATA[
# Pick a random number.  If the random number is less than 95 emit 
# 10 Creeper, otherwise emit 100 Creeper 
0 100 RandInt lt if
	CurrentCoords 10 SetCreeper
else
	CurrentCoords 100 SetCreeper
endif
]]>
	</examples>
</command>
 
<command blockStatement="close">  <!-- endif -->
	<name>endif</name>
	<args>Cond</args>
	<notation>--</notation>
	<result></result>
	<desc>Delimits the scope of an if-else-statement. Instructions between the 
	if and endif statement are conditionally executed, depending on the results 
	of the if evaluation.</desc>
	<examples>
<![CDATA[
# See the examples at 'if' and 'else'
]]>
	</examples>
</command>
 
<command blockStatement="open">  <!-- do -->
	<name>do</name>
	<args>Limit and Index</args>
	<notation>i1 i2 --</notation>
	<result></result>
	<desc>The statements following the do, up to the loop statement, are executed 
	repeatedly. Each iteration (loop), the initial value (Index) is incremented 
	by one at the bottom of the loop and compared to Limit. When Index=Limit, 
	excecution will proceed at the first statement following Loop. Loops can be 
	nested, but no more than 3 deep. See also: I, J and K</desc>
	<examples>
<![CDATA[
# Show the trace log, clear it, then show the numbers 0 through 4 in the log 
ShowTraceLog 
ClearTraceLog 
5 0 do 
	I Trace 
loop
]]>
	</examples>
</command>
 
<command blockStatement="close">  <!-- loop -->
	<name>loop</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Terminates the Do instruction. Control flow will return to the Do instruction 
	until the Index is equal to the Limit.</desc>
	<examples>
<![CDATA[
# See example at the Do instruction.
]]>
	</examples>
</command>
 
<command>  <!-- I -->
	<name>I</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Current loop index</result>
	<desc>Current loop Index. Pushes the value of the current loop onto the stack.</desc>
	<examples>
<![CDATA[
# Show the trace log, clear it, then show the numbers 0 through 4 in the log
 
ShowTraceLog
ClearTraceLog
5 0 do 
	I Trace
loop	
]]>
	</examples>
</command>
 
<command>  <!-- J -->
	<name>J</name>
	<args></args>
	<notation>-- i1</notation>
	<result>First outer loop Index</result>
	<desc>First outer loop index. When loops are nested, this pushes the value 
	of the first (or only) outer loop onto the stack.</desc>
	<examples>
<![CDATA[
# Show the trace log, clear it, then showthe result of multiplying inner loop
# index and outer loop index.
 
ShowTraceLog
ClearTraceLog
2 1 do 
 4 3 do
   I J mult trace
 loop
loop
]]>
	</examples>
</command>
 
<command>  <!-- K -->
	<name>K</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Second outer loop Index</result>
	<desc>Outer loop index. When loops are nested, this pushes the value of the 
	outermost loop onto the stack.</desc>
	<examples>
<![CDATA[
# Show the trace log, clear it, then showthe result of multiplying 3 loop
# indexes 
 
ShowTraceLog
ClearTraceLog
2 1 do 
 4 3 do 
  6 5 do
   I J  k mult mult  trace
  loop
 loop
loop	
]]>
	</examples>
</command>
 
<command blockStatement="open">  <!-- while -->
	<name>while</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Beginning of a while loop. The statements between a 'while' and a 
	'repeat' should ultimately push a value to the stack that will determine 
	if the loop executes the body of the 'repeat' block</desc>
	<examples>
<![CDATA[
# outputs a set of sescending numbers on the trace stack
 
ShowTraceLog
ClearTraceLog
5 ->y              #create temp varialble "y"
while
	<-y 0 gt       # is y greater than zero?
repeat             #repeat this section of code
	<-y trace
	<-y 1 sub ->y  #subtract 1 from y so we don't end in infinite loop
endwhile           #rinse and repeat until y is zero.	
]]>
	</examples>
</command>
 
<command>  <!-- repeat -->
	<name>repeat</name>
	<args>An item on the stack that determines if the body executes</args>
	<notation>b1 --</notation>
	<result></result>
	<desc>Pops an item from the stack. If true, execute the following statements. 
	If false, jump to the statement following 'endwhile'.</desc>
	<examples>
<![CDATA[
See example at "while"	
]]>
	</examples>
</command>
 
<command blockStatement="close">  <!-- endwhile -->
	<name>endwhle</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Returns execution to the 'while' statement. Note that endwhile is only 
	executed, if 'repeat' evaluated to true.</desc>
	<examples>
<![CDATA[
See example at "while"	
]]>
	</examples>
</command>
 
<command>  <!-- break -->
	<name>break</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Immediately exits the body of a 'while/repeat/endwhile' block or a 
	'do/loop' block.</desc>
	<examples>
<![CDATA[
# Display only odd numbers on the trace log
 
ShowTraceLog
ClearTraceLog
5 0 do 
  I 2 mod  eq0  if  #divide inner loop with modulo 2 and test if zero
     Break
   endif
   I Trace
loop	
]]>
	</examples>
</command>
 
<command blockStatement="open">  <!-- once -->
	<name>once</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Start a block of instructions that are executed once only for the 
	lifetime of the tower the script is associated with.</desc>
	<examples>
<![CDATA[
#  Setup an initial movement to a random map coordinate.
 
once
   RandCoords  1 QueueMove
endonce	
]]>
	</examples>
</command>
 
<command blockStatement="close">  <!-- endonce -->
	<name>endonce</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Ends a block defined by once.</desc>
	<examples>
<![CDATA[
See example at "once"	
]]>
	</examples>
</command>
 
<command>  <!-- ClearLocals -->
	<name>ClearLocals</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Clears all local variables. Local variables persist across script invocations.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command autoKeyword="false" syntaxKeywordGroup="4">  <!-- :FUNC_NAME -->
	<name>:FUNC_NAME</name>
	<altname>:</altname>
	<args></args>
	<notation>(user defined)</notation>
	<result></result>
	<desc>Defines the beginning of a function block. Choose a unique name for 
	the function. Statements after a function block only execute if called by invoking the 
	function with an '@FUNC_NAME' call. The end of a function block is either the end of the 
	script or the beginning of another function, whichever comes first.</desc>
	<examples>
<![CDATA[
# --- Roll a 100 sided die--------------
# --- Return true or false randomly.
# --- The value on the stack is the percentage chance.
# --- [ Chance_in_100 -- true/false]
:chance
# Take an item from the stack, divide by 100, 
# then compare to a random float.
100.0 div RandFloat gt	
]]>
	</examples>
</command>
 
<command autoKeyword="false" syntaxKeywordGroup="3">  <!-- @FUNC_NAME -->
	<name>@FUNC_NAME</name>
	<altname>@</altname>
	<args></args>
	<notation>(user defined)</notation>
	<result></result>
	<desc>Invokes a function. Execution passes to the function that is named, and 
	returns to the statement after the call when the function is complete. Arguments 
	can be passed to and received from functions via the stack.</desc>
	<examples>
<![CDATA[
# invoke the function defined as an example at :FUNC_NAME
# with the value "35" to get a 35% chance of making 
# a rapid (speed 100) move.
 
35 @chance if
   100 @relocate  #Move quickly
endif	
]]>
	</examples>
</command>
 
<command autoKeyword="false" ignoreSyntax="true">  <!-- :destroyed -->
	<name>:destroyed</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Special function that is automatically called on the final invocation 
	of the core after it's destruction.</desc>
	<examples>
<![CDATA[
# When Destroyed, emit a bunch of Creeper and 
#choose 5 units and fire spores at them.
:destroyed
CurrentCoords 1000 AddCreeper
5 0 do
   CurrentCoords RandUnitCoords 1 20 CreateSpore
loop
]]>
	</examples>
</command>
 
<command>  <!-- dup -->
	<name>dup</name>
	<args>Some item on the stack</args>
	<notation>n1 -- n1 n1</notation>
	<result>Two copies of the item on the stack</result>
	<desc>Duplicates the item currently on the stack without removing the original item.</desc>
	<examples>
<![CDATA[
#Square  a number
 
5 dup mult	
]]>
	</examples>
</command>
 
<command>  <!-- dup2 -->
	<name>dup2</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n1 n2 n1 n2</notation>
	<result>A duplicate of the two original items</result>
	<desc>Duplicates the top two items currently on the stack without 
	removing the original pair.</desc>
	<examples>
<![CDATA[
# Create a set of 4 coordinates that define a square 
# of 10 dells either way from the unit's current coordinates
 
CurrentCoords dup2 10 add swap 10 add swap 	
]]>
	</examples>
</command>
 
<command>  <!-- swap -->
	<name>swap</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n2 n1</notation>
	<result>The original two items, in reversed order</result>
	<desc>Swaps the order of the top two items on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- pop -->
	<name>pop</name>
	<args>An item on the stack</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Removes the item at the top of the stack.</desc>
	<examples>
<![CDATA[
# remove an item from the stack
 
pop	
]]>
	</examples>
</command>
 
<command>  <!-- ClearStack -->
	<name>ClearStack</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Remove all items from the stack leaving it empty.</desc>
	<examples>
<![CDATA[
# clear the stack
 
Clearstack	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- asint -->
	<name>asint</name>
	<args>An item on the stack</args>
	<notation>n1 -- i1</notation>
	<result>Converted item</result>
	<desc>Converts an item on the stack to an integer, and pushes it back to the stack.</desc>
	<examples>
<![CDATA[
# get Creeper depth as an integer 
 
CurrentCoords GetCreeper asint	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- asfloat -->
	<name>asfloat</name>
	<args>An item on the stack</args>
	<notation>n1 -- f1</notation>
	<result>Converted item</result>
	<desc>Converts an item on the stack to a floating point number and pushes 
	it back onto the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- gt -->
	<name>gt</name>
	<args>Two Values</args>
	<notation>n1 n2 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Greater Than' comparison 
	is performed. 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
# Compares  numbers to 50. 
# Pointless, in programming, but here to illustrate a point.
 
100 50 gt   # True, 100 is greater than 50
45 50 gt     # False,  45 is not greater than 50
50 50 gt     # False, 50 is not greater than 50	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- gte -->
	<name>gte</name>
	<args>Two Values</args>
	<notation>n1 n2 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Greater Than or Equal' 
	comparison is performed. Â 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
# Compares  numbers to 50. 
# Pointless, in programming, but here to illustrate a point.
 
100 50 gte   # True, 100 is greater than 50
45 50 gte     # False,  45 is not greater than 50
50 50 gte     # True, 50 is equal to 50	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- lt -->
	<name>lt</name>
	<args>Two Values</args>
	<notation>n1 n2 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Less Than' comparison 
	is performed. 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
# Compares  numbers to 50. 
# Pointless, in programming, but here to illustrate a point.
 
100 50 lt   # False, 100 is not less than 50
45 50 lt     #True  45 is less than 50
50 50 lt     # False, 50 is not less than 50	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- lte -->
	<name>lte</name>
	<args>Two Values</args>
	<notation>n1 n2 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Less Than or Equal' 
	comparison is performed. 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
# Compares  numbers to 50. 
# Pointless, in programming, but here to illustrate a point.
 
100 50 lte   # False, 100 is not less than 50
45 50 lte     #True  45 is less than 50
50 50 let    # true, 50 is equal to 50	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- eq -->
	<name>eq</name>
	<args>Two Values</args>
	<notation>n1 n2 -- n3</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Equal' comparison 
	is performed. 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
# Compares  numbers to 100. 
# Pointless, in programming, but here to illustrate a point.
 
100 50 gt   # True, 100 is greater than 50
45 50 gt     # False,  45 is not greater than 50
50 50 gt     # False, 50 is not greater than 50	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- neq -->
	<name>neq</name>
	<args>Two Values</args>
	<notation>n1 n2 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top two items are popped from the stack and 'Not Equal' comparison 
	is performed. 0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- eq0 -->
	<name>eq0</name>
	<args>One Value</args>
	<notation>n1 -- i1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top item is popped from the stack and Compared to 0. 0 or 1 is pushed 
	back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- neq0 -->
	<name>neq0</name>
	<args>One Value</args>
	<notation>n1 -- b1</notation>
	<result>true or false (1 or 0)</result>
	<desc>Top item is popped from the stack and Compared to not being 0. 
	0 or 1 is pushed back to the stack where 1 indicates true.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- add -->
	<name>add</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The sum of two items</result>
	<desc>dds the two arguments together and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- sub -->
	<name>sub</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The difference of two items</result>
	<desc>Subtracts the two arguments together and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- mul -->
	<name>mul</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The product of two items</result>
	<desc>Multiplies the two arguments together and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- div -->
	<name>div</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The quotient of two items</result>
	<desc>Divides the two arguments together and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
xample goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- mod -->
	<name>mod</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The division remainder of two items</result>
	<desc>Calculates the remainder of the two arguments and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- abs -->
	<name>abs</name>
	<args>One item on the stack</args>
	<notation>n1 -- n2</notation>
	<result>The Absolute Value of the item</result>
	<desc>Calculates the absolute value of the item and pushes the result on the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- and -->
	<name>and</name>
	<args>Two items on the stack</args>
	<notation>n1 n2 -- n3</notation>
	<result>The conditional AND of the two arguments</result>
	<desc>Pops two items from the stack, treats them as boolean values, 'ands' them, 
	and pushes 0 or 1 back to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- or -->
	<name>or</name>
	<args>Two items on the stack</args>
	<notation>b1 b2 -- b3</notation>
	<result>The conditional OR of the two arguments</result>
	<desc>Pops two items from the stack, treats them as boolean values, 'ors' them, 
	and pushes 0 or 1 back to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- xor -->
	<name>xor</name>
	<args>Two items on the stack</args>
	<notation>b1 b2 -- b3</notation>
	<result>The conditional NOR of the two arguments</result>
	<desc>Pops two items from the stack, treats them as boolean values, 'xors' them, 
	and pushes 0 or 1 back to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- not -->
	<name>not</name>
	<args>One items on the stack</args>
	<notation>b1 -- b2</notation>
	<result>The NOT of the argument</result>
	<desc>Pops one items from the stack, treats it as a boolean value, 'nots' it, 
	and pushes 0 or 1 back to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- TRUE -->
	<name>TRUE</name>
	<args></args>
	<notation>-- b1</notation>
	<result>1</result>
	<desc>Pushes a 1 to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- FALSE -->
	<name>FALSE</name>
	<args></args>
	<notation>-- b1</notation>
	<result>0</result>
	<desc>Pushes a 0 to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- AbortMove -->
	<name>AbortMove</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Aborts the current unit movement, if any. Makes the next queued movement 
	the current movement.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- AddCreeper -->
	<name>AddCreeper</name>
	<args>X, Y, Amt</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Adds Amt Creeper to the coords specified by X,Y. Amt can be positive or negative.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- ClearQueuedMoves -->
	<name>ClearQueuedMoves</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Removes all queued movements, but does not abort or remove the current movement.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- CreateRunner -->
	<name>CreateRunner</name>
	<args>X, Y, Move, Health, Payload</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Creates a Runner at map coordinates X,Y. Movement speed in pixels per 
	second is specified by Move (2 would be typical). Health is number of hit 
	points with 10 being typical. The payload is the amount of Creeper the runner carries.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- CreateSpore -->
	<name>CreateSpore</name>
	<args>startX, startY, targetX, targetY, Health, Payload</args>
	<notation>x1 y1 x2 y2 n1 n2 --</notation>
	<result></result>
	<desc>Creates a spore at map coordinates startX,startY that moves to 
	targetX,targetY. Health is number of hit points with 1 being typical. 
	The payload is the amount of Creeper the spore carries. If any source or 
	target coordinate is off the map, the spore will not be created.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- CurrentCoords -->
	<name>CurrentCoords</name>
	<args></args>
	<notation>-- x1 y1</notation>
	<result>X and Y coord of unit</result>
	<desc>Pushes the current unit's X coordinate and Y coordinate to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- CurrentX -->
	<name>CurrentX</name>
	<args></args>
	<notation>-- x1</notation>
	<result>X coord of unit</result>
	<desc>Pushes the current unit's X coordinate to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- CurrentY -->
	<name>CurrentY</name>
	<args></args>
	<notation>-- y1</notation>
	<result>Y coord of unit</result>
	<desc>Pushes the current unit's Y coordinate to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetCurrentCoords -->
	<name>SetCurrentCoords</name>
	<args></args>
	<notation>x1 y1 --</notation>
	<result></result>
	<desc>Sets the current unit's X coordinate and Y coordinates.</desc>
	<examples>
<![CDATA[
RandCoords SetCurrentCoords
]]>
	</examples>
</command>
 
<command>  <!-- SetCurrentX -->
	<name>SetCurrentX</name>
	<args></args>
	<notation>x1 --</notation>
	<result></result>
	<desc>Sets the current unit's X coordinate.</desc>
	<examples>
<![CDATA[
50 SetCurrentX
]]>
	</examples>
</command>
 
<command>  <!-- SetCurrentY -->
	<name>SetCurrentY</name>
	<args></args>
	<notation>y1 --</notation>
	<result></result>
	<desc>Sets the current unit's Y coordinate.</desc>
	<examples>
<![CDATA[
25 SetCurrentY	
]]>
	</examples>
</command>
 
<command>  <!-- Delay -->
	<name>Delay</name>
	<args>Time</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>The number of game loops to wait before allowing execution to pass to 
	the next command.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Destroy -->
	<name>Destroy</name>
	<args>Explosion Mode (0,1,2)</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Destroys the current unit. WARNING: ENSURE YOU HAVE SAVED THE MAP BEFORE 
	CALLING THIS! This call will destroy the unit and your script along with it. 
	This call pops an int from the stack as an argument and uses that to determine 
	whether to create an explosion. 0 means no explosion, 1 means a small soundless 
	flash, 2 or higher means a full explosion with sound.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Distance -->
	<name>Distance</name>
	<args>Two sets of coordinates x1,y1 x2,y2</args>
	<notation>x1 y1 x2 y2-- f1</notation>
	<result></result>
	<desc>Calculates the distance between two map points (x1,y1) to (x2,y2) and 
	pushes the resulting floating point number to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetCommandNodeCount -->
	<name>GetCommandNodeCount</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Number of Command Nodes</result>
	<desc>Pushes the number of landed command nodes to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetCreeper -->
	<name>GetCreeper</name>
	<args>X, Y</args>
	<notation>x1 y1 -- n1</notation>
	<result>Amount of Creeper at Coordinates</result>
	<desc>Pushes the amount of Creeper at map coordinates X,Y.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetDigitalis -->
	<name>GetDigitalis</name>
	<args>X, Y</args>
	<notation>x1 y1 -- n1</notation>
	<result>Amount of Digitalis at Coordinates</result>
	<desc>Pushes the amount of digitalis at map coordinates X,Y. Digitalis will be 
	between 0 and 1. 0 means no Digitalis is present and 1 means full health Digitalis 
	is present.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetDigitalisGrowth -->
	<name>GetDigitalisGrowth</name>
	<args>X, Y</args>
	<notation>x1 y1 -- i1</notation>
	<result>Boolean representing if Digitalis growth area is preset at X,Y</result>
	<desc>Pushes a 1 if Digitalis growth is present, 0 otherwise.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetGlobalRunnerCount -->
	<name>GetGlobalRunnerCount</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Number of alive runners on the map.</result>
	<desc>Pushes to the stack the number of currently alive Runners.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetQueuedMoveCount -->
	<name>GetQueuedMoveCount</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Number of movement orders currently in the movement queue.</result>
	<desc>Looks at the movement queue and returns the number of movement orders. 
	If the queue is empty, there are no movement orders and the unit is stationary.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetRunnerCount -->
	<name>GetRunnerCount</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Number of alive runners created by this core.</result>
	<desc>Pushes to the stack the number of currently alive Runners that were 
	created by this core.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetTerrain -->
	<name>GetTerrain</name>
	<args>X, Y</args>
	<notation>x1 y1-- n1</notation>
	<result>Height of terrain.</result>
	<desc>Pushes to the stack the height of the terrain cell.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetTimer0 -->
	<name>GetTimer0</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Count for timer 0.</result>
	<desc>Gets the current value of timer 0. Timers are set to some value, and 
	then decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetTimer1 -->
	<name>GetTimer1</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Count for timer 1.</result>
	<desc>Gets the current value of timer 1. Timers are set to some value, and 
	then decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetTimer2 -->
	<name>GetTimer2</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Count for timer 2</result>
	<desc>Gets the current value of timer 2. Timers are set to some value, and 
	then decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetTimer3 -->
	<name>GetTimer3</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Count for timer 3</result>
	<desc>Gets the current value of timer 3. Timers are set to some value, and 
	then decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetUnitCountInRange -->
	<name>GetUnitCountInRange</name>
	<args>X, Y coordinate, and Range (radius)</args>
	<notation>x1 y1 n1 -- n2</notation>
	<result>Unit Count</result>
	<desc>The number of player units within range of the coordinates. Only landed 
	units are counted.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetUpdateCount -->
	<name>GetUpdateCount</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Update Count</result>
	<desc>Pushes the core's update count to the stack. The update count goes up 
	by one for each game update and starts at 0.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetVoid -->
	<name>GetVoid</name>
	<args>X, Y</args>
	<notation>x1 y1 -- i1</notation>
	<result>0 or 1.</result>
	<desc>If the terrain cell is void space a 1 is pushed to the stack, 0 otherwise.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- GetWall -->
	<name>GetWall</name>
	<args>X, Y</args>
	<notation>x1 y1 -- i1</notation>
	<result>0 to 1</result>
	<desc>Pushes to the stack the value of the wall at the cell coordinates. 
	0 represents no wall and 1 represents a wall of full health. Values in 
	between represent varying degrees of health for the wall.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- HideTraceLog -->
	<name>HideTraceLog</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Turns off the trace window.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- MapHeight -->
	<name>MapHeight</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Height of map</result>
	<desc>Pushes the map height to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- MapWidth -->
	<name>MapWidth</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Width of map</result>
	<desc>Pushes the map width to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- QueueMove -->
	<name>QueueMove</name>
	<args>X,Y coordinate to move to and the speed</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>X and Y are map coordinates and the speed is in pixels per second. 
	Queued movements go into a queue and are processed one at a time.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandFloat -->
	<name>RandFloat</name>
	<args></args>
	<notation>-- f1</notation>
	<result>Random Float between 0 and 1</result>
	<desc>Pushes a random float to stack where 0 &lt;= RandFloat &lt; 1.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandInt -->
	<name>RandInt</name>
	<args>Min, Max</args>
	<notation>n1 n2 -- n2</notation>
	<result>Random Integer</result>
	<desc>Pops Min and Max from the stack and pushes a random integer to 
	stack where min &lt;= RandInt &lt; max.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandCoords -->
	<name>RandCoords</name>
	<args></args>
	<notation>-- x1 y1</notation>
	<result>Random Map X and Y coords</result>
	<desc>Pushes two random integers to stack where 0 &lt;= RandNum &lt; Map Width.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandCoordsInRange -->
	<name>RandCoordsInRange</name>
	<args>X,Y center point and a range</args>
	<notation>x1 y1 n1 -- x2 y2</notation>
	<result>Random Map X and Y coords within range of source point</result>
	<desc>Pushes two random map coordinates to the stack where the coordinates 
	are within 'range' distance from the specified X,Y coordinates.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandUnitCoords -->
	<name>RandUnitCoords</name>
	<args></args>
	<notation>-- x1 y1</notation>
	<result>X, Y coords of a random player unit</result>
	<desc>Pushes the x and y coordinate of a randomly chosen player unit. 
	-1,-1 will be pushed if no unit is found.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandXCoord -->
	<name>RandXCoord</name>
	<args></args>
	<notation>-- x1</notation>
	<result>Random Map X coord</result>
	<desc>Pushes a random integer to stack where 0 &lt;= RandNum &lt; Map Width.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- RandYCoord -->
	<name>RandYCoord</name>
	<args></args>
	<notation>-- y1</notation>
	<result>Random Map Y coord</result>
	<desc>Pushes a random integer to stack where 0 &lt;= RandNum &lt; Map Height.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Round -->
	<name>Round</name>
	<args>A number, number of decimal places</args>
	<notation>n1 n2 -- n3</notation>
	<result>Rounded off number</result>
	<desc>Rounds off a number to the specified number of decimal places.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Self -->
	<name>Self</name>
	<args></args>
	<notation>-- n1</notation>
	<result>Unit UID for current unit</result>
	<desc>Pushes the unique unit ID (an int) for the current unit to the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetCreeper -->
	<name>SetCreeper</name>
	<args>X, Y, Amt</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Sets Amt of Creeper at coordinates. Positive values are Creeper 
	and negative values are AntiCreeper. Values are clipped to the range 
	of -2000 to 2000.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetCreeperNoLower -->
	<name>SetCreeperNoLower</name>
	<args>X, Y, Amt</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Same as SetCreeper, except the Creeper will not be lowered if the 
	existing Creeper in the cell is currently higher than the value being set. 
	Properly handles Creeper and AntiCreeper.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetDigitalis -->
	<name>SetDigitalis</name>
	<args>X, Y, Amt</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Sets Amt of Digitalis at coordinates. An Amt of 1 means fill health 
	Digitalis, and 0 means no Digitalis.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetDigitalisGrowth -->
	<name>SetDigitalGrowth</name>
	<args>X, Y, Present</args>
	<notation>x1 y1 b1 --</notation>
	<result></result>
	<desc>Set Digitalis Growth at coordinates. If 'Present' is 1, growth is created. 
	If 0, growth is removed.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetTerrain -->
	<name>SetTerrain</name>
	<args>X, Y, Level</args>
	<notation>x1 y1 n1 --</notation>
	<result></result>
	<desc>Sets the height of the terrain cell at X,Y. Level must be in the range of 0-9.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetTimer0 -->
	<name>SetTimer0</name>
	<args>The value to set timer 0 to.</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Sets the current value of timer 0. Timers are set to some value, 
	and the decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetTimer1 -->
	<name>SetTimer1</name>
	<args>The value to set timer 1 to.</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Sets the current value of timer 1. Timers are set to some value, 
	and the decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetTimer2 -->
	<name>SetTimer2</name>
	<args>The value to set timer 2 to.</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Sets the current value of timer 2. Timers are set to some value, 
	and the decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetTimer3 -->
	<name>SetTimer3</name>
	<args>The value to set timer 3 to.</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Sets the current value of timer 3. Timers are set to some value, 
	and the decrease by 1 each game frame (even if the core is in a Delay).</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetVoid -->
	<name>SetVoid</name>
	<args>X, Y</args>
	<notation>x1 y1 --</notation>
	<result></result>
	<desc>Sets the terrain cell at X,Y to void space.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- SetWall -->
	<name>SetWall</name>
	<args>X, Y, Amt(0-1)</args>
	<notation>x1 y1 b1 --</notation>
	<result></result>
	<desc>Sets wall values at specified coordinates. The amount must be in the 
	range of 0 to 1 where 0 means no wall, and 1 means a full health wall.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- ShowTraceLog -->
	<name>ShowTraceLog</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Turns on the trace window so that the user can see the trace log.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- ClearTraceLog -->
	<name>ClearTraceLog</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Clears the trace log.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
 
<command>  <!-- SuspendMove -->
	<name>SuspendMove</name>
	<args>Number of frames to delay movement</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Pops a delay from the stack and uses it to suspend the current unit 
	movement, if any. Movement automatically resumes after the suspension has expired.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Trace -->
	<name>Trace</name>
	<args>String or other data</args>
	<notation>n1 --</notation>
	<result></result>
	<desc>Pops an item from the stack and adds it to the trace log. The item 
	will be treated as a string. The trace log is limited to 512 entries and 
	will automatically purge older entries first.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Trace2 -->
	<name>Trace2</name>
	<args>Two items</args>
	<notation>n1 n2 --</notation>
	<result></result>
	<desc>Pops two items from the stack and adds them to the trace log, 
	separates by a space. The items will be treated as strings.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Trace3 -->
	<name>Trace3</name>
	<args>Two items</args>
	<notation>n1 n2 n3 --</notation>
	<result></result>
	<desc>Pops three items from the stack and adds them to the trace log, 
	separates by a space. The items will be treated as strings.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Trace4 -->
	<name>Trace4</name>
	<args>Two items</args>
	<notation>n1 n2 n3 n4--</notation>
	<result></result>
	<desc>Pops four items from the stack and adds them to the trace log, 
	separates by a space. The items will be treated as strings.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- Trace5 -->
	<name>Trace5</name>
	<args>Two items</args>
	<notation>n1 n2 n3 n4 n5--</notation>
	<result></result>
	<desc>Pops five items from the stack and adds them to the trace log, 
	separates by a space. The items will be treated as strings.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- TraceStack -->
	<name>TraceStack</name>
	<args></args>
	<notation>--</notation>
	<result></result>
	<desc>Dumps the stack to the trace log. Does not pop anything from the stack.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- IsDigitalisConnected -->
	<name>IsDigitalisConnected</name>
	<args>X and Y coordinate</args>
	<notation>x1 y1 -- b1</notation>
	<result>Boolean (0 or 1) indicating connected state of Digitalis.</result>
	<desc>Return a boolean (0 or 1) indicating if the digitalis at the specified 
	coordiantes is connected to a structure that supports the growth of Digitalis.</desc>
	<examples>
<![CDATA[
example goes here	
]]>
	</examples>
</command>
 
<command>  <!-- concat -->
	<name>concat</name>
	<args>Two strings</args>
	<notation>s1 s2 -- s3</notation>
	<result>A string that is the concatenated version of the two input strings.</result>
	<desc>Takes two strings from the stack and concatenates them.  The result is 
	pushed back to the stack.</desc>
	<examples>
<![CDATA[
# Merges "abc" and "xyz" into a single new string "abcxyz"
"abc" "xyz" concat trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- sin -->
	<name>sin</name>
	<args>A floating point angle, in radians</args>
	<notation>f1 -- f2</notation>
	<result>The sine of the input angle</result>
	<desc>Calculates the sine of the input angle</desc>
	<examples>
<![CDATA[
3.14159265 sin trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- cos -->
	<name>cos</name>
	<args>A floating point angle, in radians</args>
	<notation>f1 -- f2</notation>
	<result>The cosine of the input angle</result>
	<desc>Calculates the cosine of the input angle</desc>
	<examples>
<![CDATA[
3.14159265 cos trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- tan -->
	<name>tan</name>
	<args>A floating point angle, in radians</args>
	<notation>f1 -- f2</notation>
	<result>The tangent of the input angle</result>
	<desc>Calculates the tangent of the input angle</desc>
	<examples>
<![CDATA[
3.14159265 tan trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- asin -->
	<name>asin</name>
	<args>A floating point number</args>
	<notation>f1 -- f2</notation>
	<result>The arcsine of the input number</result>
	<desc>Calculates the arcsine of the input angle</desc>
	<examples>
<![CDATA[
0.5 asin trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- acos -->
	<name>acos</name>
	<args>A floating point number</args>
	<notation>f1 -- f2</notation>
	<result>The arccosine of the input number</result>
	<desc>Calculates the arccosine of the input angle</desc>
	<examples>
<![CDATA[
0.5 acos trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- atan -->
	<name>atan</name>
	<args>A floating point number</args>
	<notation>f1 -- f2</notation>
	<result>The arctangent of the input number</result>
	<desc>Calculates the arctanget of the input angle</desc>
	<examples>
<![CDATA[
0.5 atan trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- atan2 -->
	<name>atan2</name>
	<args>A floating point number</args>
	<notation>f1 f2 -- f3</notation>
	<result>The arctan of the input number</result>
	<desc>Computes and returns the angle of the point y/x in radians.  The return value 
	is between positive pi and negative pi. Note that the first parameter to atan2 is always 
	the y coordinate.</desc>
	<examples>
<![CDATA[
0.5 atan2 trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="5">  <!-- PI -->
	<name>PI</name>
	<args></args>
	<notation>-- f1</notation>
	<result>PI (3.14159265...)</result>
	<desc>Pushes the value of PI to the stack.</desc>
	<examples>
<![CDATA[
PI trace
]]>
	</examples>
</command>
 
 
<command>  <!-- SetImage -->
	<name>SetImage</name>
	<args>A unit UID, image slot, and custom unit name</args>
	<notation>i1 s1 s2 -- </notation>
	<result></result>
	<desc>Sets the unit image for the specified slot.  Slot is an arbitrary name 
	used to identify which image to set.  The slot named "main" refers to the primary 
	unit image (the one that can be set in the editor).  The image name must refer to 
	one of the image names that can be set on a unit.  The combo box in the editor for 
	setting the primary unit image contains a list of valid strings.
	</desc>
	<examples>
<![CDATA[
# Set the primary image for the current unit to whatever 
# image is loaded in "Custom0"
Self "main" "Custom0" SetImage
]]>
	</examples>
</command>
 
 
<command>  <!-- SetImagePosition -->
	<name>SetImagePosition</name>
	<args>A unit UID, image slot, X, Y, Z coordinates</args>
	<notation>i1 s1 f1 f2 f3 -- </notation>
	<result></result>
	<desc>Sets the coordinates (in floating point pixel space) of the image. 
	0,0,0 is the exact center of the unit.  Negative z values are closer to the camera.
	</desc>
	<examples>
<![CDATA[
# Set the location of "FlyingThing" to 10,10 
# (to the right and above the center of the unit). 
# Move the image slightly closer to the camera 
# (-0.01 on the z axis) so it appears in front of the 
# main image.
Self "FlyingThing" 10 10 -0.01 SetImagePosition
]]>
	</examples>
</command>
 
<command>  <!-- SetImagePositionX -->
	<name>SetImagePositionX</name>
	<args>A unit UID, image slot, X coordinate</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the X coordinate (in floating point pixel space) of the image.  
	0,0,0 is the exact center of the unit.  Leaves the Y and Z coordinate as is.
	</desc>
	<examples>
<![CDATA[
#Set the location of "FlyingThing" to X=10 (to the right of the unit). 
Self "FlyingThing" 10 SetImagePositionX
]]>
	</examples>
</command>
 
<command>  <!-- SetImagePositionY -->
	<name>SetImagePositionY</name>
	<args>A unit UID, image slot, Y coordinate</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the Y coordinate (in floating point pixel space) of the image.  
	0,0,0 is the exact center of the unit.  Leaves the X and Z coordinate as is.
	</desc>
	<examples>
<![CDATA[
#Set the location of "FlyingThing" to Y=10 (above of the unit). 
Self "FlyingThing" 10 SetImagePositionY
]]>
	</examples>
</command>
 
<command>  <!-- SetImagePositionZ -->
	<name>SetImagePositionZ</name>
	<args>A unit UID, image slot, Z coordinate</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the Z coordinate (in floating point pixel space) of the image.  
	0,0,0 is the exact center of the unit.  Leaves the X and Y coordinate as is.
	</desc>
	<examples>
<![CDATA[
# Set the location of "FlyingThing" to Z=-0.01 
# (In front of the images with higher z values). 
Self "FlyingThing" -0.01 SetImagePositionZ
]]>
	</examples>
</command>
 
<command>  <!-- SetImageRotation -->
	<name>SetImageRotation</name>
	<args>A unit UID, image slot, rotation in radians</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the rotation of the image (in radians).</desc>
	<examples>
<![CDATA[
# Rotate the image
Self "FlyingThing" 0.1 SetImageRotation
]]>
	</examples>
</command>
 
<command>  <!-- SetImageScale -->
	<name>SetImageScale</name>
	<args>A unit UID, image slot, x scale, y scale</args>
	<notation>i1 s1 f1 f2 -- </notation>
	<result></result>
	<desc>Sets the scale of the image.  A value of 1 means to show the image at 
	the normal size.  A value of 2 would be double size, and 0.5 would be half.</desc>
	<examples>
<![CDATA[
# Make the image twice as big
Self "FlyingThing" 2 2 SetImageScale
]]>
	</examples>
</command>
 
<command>  <!-- SetImageScaleX -->
	<name>SetImageScaleX</name>
	<args>A unit UID, image slot, x scale</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the X scale of the image.  A value of 1 means to show the image
	at the normal size.  A value of 2 would be double size, and 0.5 would be half.</desc>
	<examples>
<![CDATA[
# Make the image twice as wide
Self "FlyingThing" 2 etImageScaleX
]]>
	</examples>
</command>
 
<command>  <!-- SetImageScaleY -->
	<name>SetImageScaleY</name>
	<args>A unit UID, image slot, y scale</args>
	<notation>i1 s1 f1 -- </notation>
	<result></result>
	<desc>Sets the Y scale of the image.  A value of 1 means to show the image 
	at the normal size.  A value of 2 would be double size, and 0.5 would be half.</desc>
	<examples>
<![CDATA[
# Make the image twice as tall
Self "FlyingThing" 2 SetImageScaleY
]]>
	</examples>
</command>
 
<command>  <!-- SetImageColor -->
	<name>SetImageColor</name>
	<args>A unit UID, image slot, red, green, blue </args>
	<notation>i1 s1 i2 i3 i4 -- </notation>
	<result></result>
	<desc>Sets the color of the light shining on the sprite.  Red, Green, and 
	Blue values are in the range of 0-255.</desc>
	<examples>
<![CDATA[
# Make the image be viewed under a red light
Self "FlyingThing" 255 0 0 SetImageColor
]]>
	</examples>
</command>
 
 
<command syntaxKeywordGroup="7">  <!-- CONST_COORDX -->
	<name>CONST_COORDX</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the x coordinate when 
	using get/setattribute</desc>
	<examples>
<![CDATA[
# Get the X coordinate of the current unit.
Self CONST_COORDX GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_COORDY -->
	<name>CONST_COORDY</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the y coordinate when 
	using get/setattribute</desc>
	<examples>
<![CDATA[
# Get the Y coordinate of the current unit.
Self CONST_COORDY GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_HEALTH -->
	<name>CONST_HEALTH</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the helath when using 
	get/setattribute</desc>
	<examples>
<![CDATA[
# Get the health of the current unit.
Self CONST_HEALTH GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_MAXHEALTH -->
	<name>CONST_MAXHEALTH</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the maximum health when 
	using get/setattribute</desc>
	<examples>
<![CDATA[
# Get the max health of the current unit.
Self CONST_MAXHEALTH GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_AMMO -->
	<name>CONST_AMMO</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the ammo when using 
	get/setattribute</desc>
	<examples>
<![CDATA[
# Get the ammo of the current unit.
Self CONST_AMMO GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_MAXAMMO -->
	<name>CONST_MAXAMMO</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the maximum ammo when 
	using get/setattribute</desc>
	<examples>
<![CDATA[
# Get the max ammo of the current unit.
Self CONST_MAXAMMO GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_AMMOAC -->
	<name>CONST_AMMOAC</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the AC ammo when using 
	get/setattribute</desc>
	<examples>
<![CDATA[
# Get the AC ammo of the current unit.
Self CONST_AMMOAC GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_MAXAMMOAC -->
	<name>CONST_MAXAMMOAC</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for Get/SetAtrribute</result>
	<desc>Pushes the integer constant for getting/setting the maximum AC ammo when 
	using get/setattribute</desc>
	<examples>
<![CDATA[
# Get the max AC ammo of the current unit.
Self CONST_MAXAMMOAC GetAttribute trace
]]>
	</examples>
</command>
 
<command syntaxKeywordGroup="7">  <!-- CONST_ISDESTROYED -->
	<name>CONST_ISDESTROYED</name>
	<args></args>
	<notation>-- i1</notation>
	<result>Integer const for GetAtrribute</result>
	<desc>Pushes the integer constant for getting the destroyed state when using 
	getattribute.  This constant has no effect when used with SetAttribute.</desc>
	<examples>
<![CDATA[
# Get the destroyed state of a unit.
# Here, ProjectileUnit is the UID for some game object.
<-ProjectileUnit CONST_ISDESTROYED GetAttribute trace
]]>
	</examples>
</command>
 
<command>  <!-- CONST_GETATTRIBUTE -->
	<name>CONST_GETATTRIBUTE</name>
	<args>Unit UID, Attribute Constant</args>
	<notation>i1 i2 -- n1</notation>
	<result>The resulting value for the attribute</result>
	<desc>GetAtrribute allows you to query various attributes (see CONST* commands) on 
	different units.</desc>
	<examples>
<![CDATA[
# Get the max AC ammo of the current unit.
Self CONST_MAXAMMOAC GetAttribute trace
]]>
	</examples>
</command>
 
<command>  <!-- CONST_SETATTRIBUTE -->
	<name>CONST_SETATTRIBUTE</name>
	<args>Unit UID, Attribute Constant, Some Value</args>
	<notation>i1 i2 n1 -- </notation>
	<result></result>
	<desc>SetAtrribute allows you to set various attributes (see CONST* commands) on 
	different units.</desc>
	<examples>
<![CDATA[
# Set the max AC ammo of the current unit.
Self CONST_MAXAMMOAC 10 SetAttribute
]]>
	</examples>
</command>
 
 
<command>  <!-- CreateUnit -->
	<name>CreateUnit</name>
	<args>Unit Name, X, Y</args>
	<notation>s1 x1 y1 -- i2</notation>
	<result>The UID of the created unit.  0 if the unit was not created.</result>
	<desc>Create a unit at the X and Y coordinates.  The name of the unit must be 
one of the following.  Names are NOT case sensitive. [
		CRPLCORE
		COLLECTOR
		RELAY
		REACTOR
		OREMINE
		SIPHON
		TERP
		GUPPY
		PULSECANNON
		MORTAR
		STRAFER
		BOMBER
		SPRAYER
		NULLIFIER
		SHIELD
		BEAM
		SNIPER
		BERTHA
		POWERZONE
		OREDEPOSIT
		ENERGYDEPOSIT0
		ENERGYDEPOSIT1
		ENERGYDEPOSIT2
		ENERGYDEPOSIT3]
</desc>
	<examples>
<![CDATA[
# Creates an energy deposit at coordinates 10,10
"ENERGYDEPOSIT0" 10 10 CreateUnit
]]>
	</examples>
</command>
 
<command>  <!-- AddScriptToUnit -->
	<name>AddScriptToUnit</name>
	<args>Unit UID, Script Name</args>
	<notation>i1 s1 -- </notation>
	<result></result>
	<desc>Adds a script to a unit.  The script name must match (including extension) the name 
of a compiled script</desc>
	<examples>
<![CDATA[
# Add a script to a newly created unit
"CRPLCore" 10 10 CreateUnit ->unit
<-unit "Emitter.crpl" AddScriptToUnit
]]>
	</examples>
</command>
 
<command>  <!-- SetScriptVar -->
	<name>SetScriptVar</name>
	<args>Unit UID, Script Name, Var Name, Data to set</args>
	<notation>i1 s1 s2 d1 -- </notation>
	<result></result>
	<desc>Sets the value of some variable on a script.  Useful for setting up variables on 
newly created units, or for managing children units.</desc>
	<examples>
<![CDATA[
# Add a script to a newly created unit and set variables on the script
"CRPLCore" 10 10 CreateUnit ->unit
<-unit "Emitter.crpl" AddScriptToUnit
<-unit "Emitter.crpl" "amtToEmit" 50 SetScriptVar
<-unit "Emitter.crpl" "interval" 5 SetScriptVar
]]>
	</examples>
</command>
 
<command>  <!-- GetScriptVar -->
	<name>GetScriptVar</name>
	<args>Unit UID, Script Name, Var Name</args>
	<notation>i1 s1 s2 -- d1</notation>
	<result>Some value</result>
	<desc>Gets the value of some variable on a script.  Useful for getting variables on 
newly created units, or for managing children units.</desc>
	<examples>
<![CDATA[
# Add a script to a newly created unit and set variables on the script.
# Then, read a value back.
"CRPLCore" 10 10 CreateUnit ->unit
<-unit "Emitter.crpl" AddScriptToUnit
<-unit "Emitter.crpl" "amtToEmit" 50 SetScriptVar
<-unit "Emitter.crpl" "interval" 5 SetScriptVar
 
<-unit "Emitter.crpl" "interval" GetScriptVar trace
]]>
	</examples>
</command>
 
 
 
</commands>
 
</Crpl>
crpl/stuff/original_xml.txt · Last modified: 2014/10/01 15:02 by 127.0.0.1