diff 06/ecl.xml @ 7:2a7b9d62c0c4

Fix details, and details and documentation for a few instructions
author Thibaut Girka <thib@sitedethib.com>
date Tue, 23 Aug 2011 11:58:03 +0200
parents 578e67aa3c03
children 79dfd9765a67
line wrap: on
line diff
--- a/06/ecl.xml
+++ b/06/ecl.xml
@@ -8,13 +8,9 @@
 	<text>
 		<div xmlns="http://www.w3.org/1999/xhtml">
 			<h2>Lvalues and Rvalues / direct vs memory indirect addressing</h2>
-			<p>In EoSD, most 32-bits arguments passed to instructions may be actual values or variable/register indexes.<br/>
-			[TODO: verify] values inferior to -10000 are variable/register indexes, whereas values superior to this are actual values.<br/>
-			Values passed through variable/register indexes are Lvalues, other values are not. Some instructions require some of their operands to be Lvalues.<br/>
-			Another way to look at it would be C++-style references. <code>ins_20</code> would then be <code>ins_20(int32 &amp;value, float a, float b);</code></p>
-
-			<p>Note: variables seems to be somehow superposed to the enemy's state structure, with <code>-10015 = x</code> and <code>-10016 = y</code>.</p>
-
+			<p>In EoSD, most 32-bits arguments passed to instructions may be actual values or variable indexes.<br/>
+			Values comprised between -10025 and -10001 are variable indexes, whereas other values are actual values.
+			Values passed through variable/register indexes are Lvalues, other values are not. Some instructions require some of their operands to be Lvalues.</p>
 
 			<h2>Accessing values</h2>
 			<p>[TODO: verify] How the game accesses values passed as argument is as follows:<br/>
@@ -29,6 +25,7 @@ else
 			<p>Only variables in the range [-10001, -10025] without -10014, -10020 and -10023 are used in the game.</p>
 
 			<h3>Local variables</h3>
+			<p>Local variables may be read or written by the script, they are local to a subroutine, and put on a stack when a subroutine is called. They are not used by the game engine itself.</p>
 			<table>
 				<tr><th>Number</th><th>Type</th></tr>
 				<tr><td>-10001</td><td>int</td></tr>
@@ -46,6 +43,7 @@ else
 			</table>
 
 			<h3>Special variables</h3>
+			<p>Special variables are game or enemy-scoped variables and most of them cannot be overriden by the script.</p>
 			<table>
 				<tr><th>Number</th><th>Type</th>	<th>Name</th>		<th>RW/RO</th>	<th>Notes</th></tr>
 				<tr><td>-10013</td><td>int</td>		<td>rank</td>		<td>ro</td>	<td></td></tr>
@@ -232,8 +230,8 @@ else
 		<name>add</name>
 		<params>
 			<param type="S" name="variable" unit="var_id" var="must"/>
-			<param type="f" name="a"/>
-			<param type="f" name="b"/>
+			<param type="f" var="can" name="a"/>
+			<param type="f" var="can" name="b"/>
 		</params>
 		<desc>variable = a + b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc>
 	</op>
@@ -243,8 +241,8 @@ else
 		<name></name>
 		<params>
 			<param type="S" name="variable" unit="var_id" var="must"/>
-			<param type="f" name="a"/>
-			<param type="f" name="b"/>
+			<param type="f" var="can" name="a"/>
+			<param type="f" var="can" name="b"/>
 		</params>
 		<desc>variable = a - b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc>
 	</op>
@@ -286,8 +284,8 @@ else
 		<num>27</num>
 		<name>compare_ints</name>
 		<params>
-			<param type="S" name="a"/>
-			<param type="S" name="b"/>
+			<param type="S" var="can" name="a"/>
+			<param type="S" var="can" name="b"/>
 		</params>
 		<desc>Compare a and b, store the result (-1 if a &lt; b, 0 if a == b, 1 if a > b) in the "comparison register".</desc>
 	</op>
@@ -400,7 +398,7 @@ else
 			<param type="f" name="y"/>
 			<param type="f" name="y" values="0">Ignored</param>
 		</params>
-		<desc>Move the enemy to a new position, using interpolation.</desc>
+		<desc>Move the enemy to a new position, used for interpolation.</desc>
 	</op>
 
 	<op>
@@ -462,7 +460,7 @@ else
 
 	<op>
 		<num>51</num>
-		<name>set_speed_forward_player</name>
+		<name>set_speed_towards_player</name>
 		<params>
 			<param type="S" value="0">Ignored</param>
 			<param type="f" name="speed" unit="pixels/frame"/>
@@ -502,7 +500,7 @@ else
 			<param type="f" name="y" unit="pixels"/>
 			<param type="f" name="z" unit="pixels" values="0.0f">Ignored</param>
 		</params>
-		<desc>Move the enemy to the new position in this amount of frames.</desc>
+		<desc>Move the enemy to the new position in this amount of frames. TODO: find the exact interpolation method</desc>
 	</op>
 
 	<op>
@@ -750,17 +748,17 @@ else
 		<params>
 			<param type="s"/>
 			<param type="s"/>
-			<param type="f"/>
-			<param type="S"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
+			<param type="f" name="angle" unit="radian">clockwise, from the +x axis</param>
+			<param type="S" name="speed" unit="pixels/frame">speed of the laser along its axis</param>
+			<param type="f" name="start_offset" unit="pixels">offset along the laser axis, relative to the enemy. If negative, it is considered as 0.</param>
+			<param type="f" name="end_offset" unit="pixels">offset along the laser axis, relative to the enemy. Can be negative. In case end_offset &lt; start_offset, the laser will be in the oposite direction.</param>
+			<param type="f" name="length" unit="pixels">TODO: Not really a length, something really odd. The laser starts at max(start_offset, end_offset - length) and ends at end_offset.</param>
+			<param type="f" name="width" unit="pixels"/>
+			<param type="S" name="start_duration" unit="frames"/>
+			<param type="S" name="duration" unit="frames"/>
+			<param type="S" name="stop_duration" unit="frames"/>
+			<param type="S" name="grazing_dealy" unit="frames">how long to wait before allowing grazing</param>
+			<param type="S" name="grazing_extra_duration" unit="frames">how long to allow grazing after the laser started to disappear</param>
 			<param type="S" values="0"/>
 		</params>
 		<desc></desc>
@@ -768,21 +766,21 @@ else
 
 	<op>
 		<num>86</num>
-		<name></name>
+		<name>laser_towards_player</name>
 		<params>
 			<param type="s"/>
 			<param type="s"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="S"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="f"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
-			<param type="S"/>
+			<param type="f" name="angle" unit="radian">clockwise, from the enemy->player axis</param>
+			<param type="S" name="speed" unit="pixels/frame">speed of the laser along its axis</param>
+			<param type="f" name="start_offset" unit="pixels">offset along the laser axis, relative to the enemy. If negative, it is considered as 0.</param>
+			<param type="f" name="end_offset" unit="pixels">offset along the laser axis, relative to the enemy. Can be negative. In case end_offset &lt; start_offset, the laser will be in the oposite direction.</param>
+			<param type="f" name="length" unit="pixels">TODO: Not really a length, something really odd. The laser starts at max(start_offset, end_offset - length) and ends at end_offset.</param>
+			<param type="f" name="width" unit="pixels"/>
+			<param type="S" name="start_duration" unit="frames"/>
+			<param type="S" name="duration" unit="frames"/>
+			<param type="S" name="stop_duration" unit="frames"/>
+			<param type="S" name="grazing_dealy" unit="frames">how long to wait before allowing grazing</param>
+			<param type="S" name="grazing_extra_duration" unit="frames">how long to allow grazing after the laser started to disappear</param>
 			<param type="S" values="0"/>
 		</params>
 		<desc></desc>