comparison 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
comparison
equal deleted inserted replaced
6:578e67aa3c03 7:2a7b9d62c0c4
6 <title>ECL Sub format</title> 6 <title>ECL Sub format</title>
7 7
8 <text> 8 <text>
9 <div xmlns="http://www.w3.org/1999/xhtml"> 9 <div xmlns="http://www.w3.org/1999/xhtml">
10 <h2>Lvalues and Rvalues / direct vs memory indirect addressing</h2> 10 <h2>Lvalues and Rvalues / direct vs memory indirect addressing</h2>
11 <p>In EoSD, most 32-bits arguments passed to instructions may be actual values or variable/register indexes.<br/> 11 <p>In EoSD, most 32-bits arguments passed to instructions may be actual values or variable indexes.<br/>
12 [TODO: verify] values inferior to -10000 are variable/register indexes, whereas values superior to this are actual values.<br/> 12 Values comprised between -10025 and -10001 are variable indexes, whereas other values are actual values.
13 Values passed through variable/register indexes are Lvalues, other values are not. Some instructions require some of their operands to be Lvalues.<br/> 13 Values passed through variable/register indexes are Lvalues, other values are not. Some instructions require some of their operands to be Lvalues.</p>
14 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>
15
16 <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>
17
18 14
19 <h2>Accessing values</h2> 15 <h2>Accessing values</h2>
20 <p>[TODO: verify] How the game accesses values passed as argument is as follows:<br/> 16 <p>[TODO: verify] How the game accesses values passed as argument is as follows:<br/>
21 TYPE is the type of the argument (float, int32, ...):</p> 17 TYPE is the type of the argument (float, int32, ...):</p>
22 18
27 23
28 <h2>Variables</h2> 24 <h2>Variables</h2>
29 <p>Only variables in the range [-10001, -10025] without -10014, -10020 and -10023 are used in the game.</p> 25 <p>Only variables in the range [-10001, -10025] without -10014, -10020 and -10023 are used in the game.</p>
30 26
31 <h3>Local variables</h3> 27 <h3>Local variables</h3>
28 <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>
32 <table> 29 <table>
33 <tr><th>Number</th><th>Type</th></tr> 30 <tr><th>Number</th><th>Type</th></tr>
34 <tr><td>-10001</td><td>int</td></tr> 31 <tr><td>-10001</td><td>int</td></tr>
35 <tr><td>-10002</td><td>int</td></tr> 32 <tr><td>-10002</td><td>int</td></tr>
36 <tr><td>-10003</td><td>int</td></tr> 33 <tr><td>-10003</td><td>int</td></tr>
44 <tr><td>-10011</td><td>int</td></tr> 41 <tr><td>-10011</td><td>int</td></tr>
45 <tr><td>-10012</td><td>int</td></tr> 42 <tr><td>-10012</td><td>int</td></tr>
46 </table> 43 </table>
47 44
48 <h3>Special variables</h3> 45 <h3>Special variables</h3>
46 <p>Special variables are game or enemy-scoped variables and most of them cannot be overriden by the script.</p>
49 <table> 47 <table>
50 <tr><th>Number</th><th>Type</th> <th>Name</th> <th>RW/RO</th> <th>Notes</th></tr> 48 <tr><th>Number</th><th>Type</th> <th>Name</th> <th>RW/RO</th> <th>Notes</th></tr>
51 <tr><td>-10013</td><td>int</td> <td>rank</td> <td>ro</td> <td></td></tr> 49 <tr><td>-10013</td><td>int</td> <td>rank</td> <td>ro</td> <td></td></tr>
52 <tr><td>-10014</td><td>int</td> <td>difficulty</td> <td>ro</td> <td>Unused.</td></tr> 50 <tr><td>-10014</td><td>int</td> <td>difficulty</td> <td>ro</td> <td>Unused.</td></tr>
53 <tr><td>-10015</td><td>float</td> <td>x</td> <td>rw</td> <td></td></tr> 51 <tr><td>-10015</td><td>float</td> <td>x</td> <td>rw</td> <td></td></tr>
230 <op> 228 <op>
231 <num>20</num> 229 <num>20</num>
232 <name>add</name> 230 <name>add</name>
233 <params> 231 <params>
234 <param type="S" name="variable" unit="var_id" var="must"/> 232 <param type="S" name="variable" unit="var_id" var="must"/>
235 <param type="f" name="a"/> 233 <param type="f" var="can" name="a"/>
236 <param type="f" name="b"/> 234 <param type="f" var="can" name="b"/>
237 </params> 235 </params>
238 <desc>variable = a + b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc> 236 <desc>variable = a + b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc>
239 </op> 237 </op>
240 238
241 <op> 239 <op>
242 <num>21</num> 240 <num>21</num>
243 <name></name> 241 <name></name>
244 <params> 242 <params>
245 <param type="S" name="variable" unit="var_id" var="must"/> 243 <param type="S" name="variable" unit="var_id" var="must"/>
246 <param type="f" name="a"/> 244 <param type="f" var="can" name="a"/>
247 <param type="f" name="b"/> 245 <param type="f" var="can" name="b"/>
248 </params> 246 </params>
249 <desc>variable = a - b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc> 247 <desc>variable = a - b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc>
250 </op> 248 </op>
251 249
252 <op> 250 <op>
284 282
285 <op> 283 <op>
286 <num>27</num> 284 <num>27</num>
287 <name>compare_ints</name> 285 <name>compare_ints</name>
288 <params> 286 <params>
289 <param type="S" name="a"/> 287 <param type="S" var="can" name="a"/>
290 <param type="S" name="b"/> 288 <param type="S" var="can" name="b"/>
291 </params> 289 </params>
292 <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> 290 <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>
293 </op> 291 </op>
294 292
295 <op> 293 <op>
398 <params> 396 <params>
399 <param type="f" name="x"/> 397 <param type="f" name="x"/>
400 <param type="f" name="y"/> 398 <param type="f" name="y"/>
401 <param type="f" name="y" values="0">Ignored</param> 399 <param type="f" name="y" values="0">Ignored</param>
402 </params> 400 </params>
403 <desc>Move the enemy to a new position, using interpolation.</desc> 401 <desc>Move the enemy to a new position, used for interpolation.</desc>
404 </op> 402 </op>
405 403
406 <op> 404 <op>
407 <num>45</num> 405 <num>45</num>
408 <name>set_angle_speed</name> 406 <name>set_angle_speed</name>
460 <desc></desc> 458 <desc></desc>
461 </op> 459 </op>
462 460
463 <op> 461 <op>
464 <num>51</num> 462 <num>51</num>
465 <name>set_speed_forward_player</name> 463 <name>set_speed_towards_player</name>
466 <params> 464 <params>
467 <param type="S" value="0">Ignored</param> 465 <param type="S" value="0">Ignored</param>
468 <param type="f" name="speed" unit="pixels/frame"/> 466 <param type="f" name="speed" unit="pixels/frame"/>
469 </params> 467 </params>
470 <desc>Sets the speed of the enemy, and change its direction to where the player is at that frame. Used only one time in <stage>2</stage>.</desc> 468 <desc>Sets the speed of the enemy, and change its direction to where the player is at that frame. Used only one time in <stage>2</stage>.</desc>
500 <param type="S" name="duration" unit="frames"/> 498 <param type="S" name="duration" unit="frames"/>
501 <param type="f" name="x" unit="pixels"/> 499 <param type="f" name="x" unit="pixels"/>
502 <param type="f" name="y" unit="pixels"/> 500 <param type="f" name="y" unit="pixels"/>
503 <param type="f" name="z" unit="pixels" values="0.0f">Ignored</param> 501 <param type="f" name="z" unit="pixels" values="0.0f">Ignored</param>
504 </params> 502 </params>
505 <desc>Move the enemy to the new position in this amount of frames.</desc> 503 <desc>Move the enemy to the new position in this amount of frames. TODO: find the exact interpolation method</desc>
506 </op> 504 </op>
507 505
508 <op> 506 <op>
509 <num>59</num> 507 <num>59</num>
510 <name>move_to2</name> 508 <name>move_to2</name>
748 <num>85</num> 746 <num>85</num>
749 <name>laser</name> 747 <name>laser</name>
750 <params> 748 <params>
751 <param type="s"/> 749 <param type="s"/>
752 <param type="s"/> 750 <param type="s"/>
753 <param type="f"/> 751 <param type="f" name="angle" unit="radian">clockwise, from the +x axis</param>
754 <param type="S"/> 752 <param type="S" name="speed" unit="pixels/frame">speed of the laser along its axis</param>
755 <param type="f"/> 753 <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>
756 <param type="f"/> 754 <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>
757 <param type="f"/> 755 <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>
758 <param type="f"/> 756 <param type="f" name="width" unit="pixels"/>
759 <param type="S"/> 757 <param type="S" name="start_duration" unit="frames"/>
760 <param type="S"/> 758 <param type="S" name="duration" unit="frames"/>
761 <param type="S"/> 759 <param type="S" name="stop_duration" unit="frames"/>
762 <param type="S"/> 760 <param type="S" name="grazing_dealy" unit="frames">how long to wait before allowing grazing</param>
763 <param type="S"/> 761 <param type="S" name="grazing_extra_duration" unit="frames">how long to allow grazing after the laser started to disappear</param>
764 <param type="S" values="0"/> 762 <param type="S" values="0"/>
765 </params> 763 </params>
766 <desc></desc> 764 <desc></desc>
767 </op> 765 </op>
768 766
769 <op> 767 <op>
770 <num>86</num> 768 <num>86</num>
771 <name></name> 769 <name>laser_towards_player</name>
772 <params> 770 <params>
773 <param type="s"/> 771 <param type="s"/>
774 <param type="s"/> 772 <param type="s"/>
775 <param type="f"/> 773 <param type="f" name="angle" unit="radian">clockwise, from the enemy->player axis</param>
776 <param type="f"/> 774 <param type="S" name="speed" unit="pixels/frame">speed of the laser along its axis</param>
777 <param type="S"/> 775 <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>
778 <param type="f"/> 776 <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>
779 <param type="f"/> 777 <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>
780 <param type="f"/> 778 <param type="f" name="width" unit="pixels"/>
781 <param type="S"/> 779 <param type="S" name="start_duration" unit="frames"/>
782 <param type="S"/> 780 <param type="S" name="duration" unit="frames"/>
783 <param type="S"/> 781 <param type="S" name="stop_duration" unit="frames"/>
784 <param type="S"/> 782 <param type="S" name="grazing_dealy" unit="frames">how long to wait before allowing grazing</param>
785 <param type="S"/> 783 <param type="S" name="grazing_extra_duration" unit="frames">how long to allow grazing after the laser started to disappear</param>
786 <param type="S" values="0"/> 784 <param type="S" values="0"/>
787 </params> 785 </params>
788 <desc></desc> 786 <desc></desc>
789 </op> 787 </op>
790 788