4458 lines
201 KiB
HTML
Executable File
4458 lines
201 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||
xmlns="http://www.w3.org/TR/REC-html40">
|
||
|
||
|
||
<head>
|
||
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
|
||
<meta name=ProgId content=Word.Document>
|
||
<meta name=Generator content="Microsoft Word 9">
|
||
<meta name=Originator content="Microsoft Word 9">
|
||
<link rel=File-List href="./ScriptingManual2-Dateien/filelist.xml">
|
||
<link rel=Edit-Time-Data href="./ScriptingManual2-Dateien/editdata.mso">
|
||
<!--[if !mso]>
|
||
<style>
|
||
v\:* {behavior:url(#default#VML);}
|
||
o\:* {behavior:url(#default#VML);}
|
||
w\:* {behavior:url(#default#VML);}
|
||
.shape {behavior:url(#default#VML);}
|
||
</style>
|
||
<![endif]-->
|
||
<title>AI scripting language manual for Warzone 2100</title>
|
||
<!--[if gte mso 9]><xml>
|
||
<o:DocumentProperties>
|
||
<o:Author>Dennis</o:Author>
|
||
<o:LastAuthor>Dennis</o:LastAuthor>
|
||
<o:Revision>2</o:Revision>
|
||
<o:Created>2008-08-01T19:22:00Z</o:Created>
|
||
<o:LastSaved>2008-08-01T19:22:00Z</o:LastSaved>
|
||
<o:Pages>34</o:Pages>
|
||
<o:Words>11839</o:Words>
|
||
<o:Characters>67484</o:Characters>
|
||
<o:Company>keine</o:Company>
|
||
<o:Lines>562</o:Lines>
|
||
<o:Paragraphs>134</o:Paragraphs>
|
||
<o:CharactersWithSpaces>82875</o:CharactersWithSpaces>
|
||
<o:Version>9.6926</o:Version>
|
||
</o:DocumentProperties>
|
||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||
<w:WordDocument>
|
||
<w:HyphenationZone>21</w:HyphenationZone>
|
||
</w:WordDocument>
|
||
</xml><![endif]-->
|
||
<style>
|
||
<!--
|
||
/* Font Definitions */
|
||
@font-face
|
||
{font-family:Wingdings;
|
||
panose-1:5 0 0 0 0 0 0 0 0 0;
|
||
mso-font-charset:2;
|
||
mso-generic-font-family:auto;
|
||
mso-font-pitch:variable;
|
||
mso-font-signature:0 268435456 0 0 -2147483648 0;}
|
||
/* Style Definitions */
|
||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||
{mso-style-parent:"";
|
||
margin:0cm;
|
||
margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:12.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
a:link, span.MsoHyperlink
|
||
{color:blue;
|
||
text-decoration:underline;
|
||
text-underline:single;}
|
||
a:visited, span.MsoHyperlinkFollowed
|
||
{color:blue;
|
||
text-decoration:underline;
|
||
text-underline:single;}
|
||
p
|
||
{margin-right:0cm;
|
||
mso-margin-top-alt:auto;
|
||
mso-margin-bottom-alt:auto;
|
||
margin-left:0cm;
|
||
mso-pagination:widow-orphan;
|
||
font-size:12.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
code
|
||
{mso-ascii-font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New";
|
||
mso-hansi-font-family:"Courier New";
|
||
mso-bidi-font-family:"Courier New";}
|
||
pre
|
||
{margin:0cm;
|
||
margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
|
||
font-size:10.0pt;
|
||
font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New";}
|
||
p.note, li.note, div.note
|
||
{mso-style-name:note;
|
||
margin-right:0cm;
|
||
mso-margin-top-alt:auto;
|
||
mso-margin-bottom-alt:auto;
|
||
margin-left:0cm;
|
||
mso-pagination:widow-orphan;
|
||
font-size:12.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
span.note1
|
||
{mso-style-name:note1;}
|
||
@page Section1
|
||
{size:595.3pt 841.9pt;
|
||
margin:70.85pt 70.85pt 2.0cm 70.85pt;
|
||
mso-header-margin:35.4pt;
|
||
mso-footer-margin:35.4pt;
|
||
mso-paper-source:0;}
|
||
div.Section1
|
||
{page:Section1;}
|
||
/* List Definitions */
|
||
@list l0
|
||
{mso-list-id:184560223;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:1902568122 2095449626 1787078386 557224690 -1051133810 -294902256 -1131536702 936801786 1939256200 -265918050;}
|
||
@list l0:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l1
|
||
{mso-list-id:306670909;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:772980796 1147709418 1640249844 -1921460042 1706615042 -1410203490 -16605626 2100059664 -215724852 -1689733590;}
|
||
@list l1:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l2
|
||
{mso-list-id:481315899;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:1843434138 -1336909662 -1319320076 -1725280364 1948581492 1565395218 1903097882 -1508193072 -274856122 1760959524;}
|
||
@list l2:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l3
|
||
{mso-list-id:770857335;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-669330088 176476416 1868494938 641787016 -1248401316 -933957120 -1911915290 12060746 1737681426 1425933596;}
|
||
@list l3:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l3:level2
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:o;
|
||
mso-level-tab-stop:72.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:"Courier New";
|
||
mso-bidi-font-family:"Times New Roman";}
|
||
@list l3:level3
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0A7;
|
||
mso-level-tab-stop:108.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Wingdings;}
|
||
@list l4
|
||
{mso-list-id:886062463;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-190041216 171763150 -1670626198 355387668 -2133005724 -1196375016 1562529904 827349608 -1173329332 1800275710;}
|
||
@list l5
|
||
{mso-list-id:955256320;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-1646484758 1582100216 655804842 367419174 -1177025550 -616272606 803269486 -2071934408 -2101700620 -675007052;}
|
||
@list l5:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l6
|
||
{mso-list-id:1091272331;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-298291446 957152874 -504736706 1373900404 -1284632722 1084030042 -1429325718 -1395196294 1537099820 636682200;}
|
||
@list l6:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l7
|
||
{mso-list-id:1251887845;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-836219388 1072623234 -1625371122 -1590818370 963257114 154050174 -970040488 -986392910 536636040 -2132087116;}
|
||
@list l7:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l8
|
||
{mso-list-id:1316841726;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:662598466 624585380 -1461315958 121430624 1122133236 1675532626 1678151738 1778393484 2109871614 761665292;}
|
||
@list l8:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l9
|
||
{mso-list-id:1344892553;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-1997627588 1768059370 -2007736350 -520305574 1556219474 -1093533060 -1257732566 -1840901816 1920375948 378984806;}
|
||
@list l9:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l10
|
||
{mso-list-id:1483616885;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-910282408 1764113988 48513894 827881614 1525154300 -1803900100 -1967099862 -1863651960 461787892 -877607806;}
|
||
@list l10:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l11
|
||
{mso-list-id:1584801046;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:239915996 755411762 1390848348 -633859066 1947662940 918062024 177486068 1861929768 1543954336 -1796425062;}
|
||
@list l11:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
@list l12
|
||
{mso-list-id:2078817045;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-1199769606 -556607678 -1478440602 23464918 -1839589848 1528840864 1070868120 378057038 2092831036 -1978514068;}
|
||
@list l12:level1
|
||
{mso-level-number-format:bullet;
|
||
mso-level-text:\F0B7;
|
||
mso-level-tab-stop:36.0pt;
|
||
mso-level-number-position:left;
|
||
text-indent:-18.0pt;
|
||
mso-ansi-font-size:10.0pt;
|
||
font-family:Symbol;}
|
||
ol
|
||
{margin-bottom:0cm;}
|
||
ul
|
||
{margin-bottom:0cm;}
|
||
-->
|
||
</style>
|
||
<meta http-equiv=content-language content=en>
|
||
<meta http-equiv=content-style-type content="text/css; charset=iso-8859-1">
|
||
<meta name=author content=Troman>
|
||
</head>
|
||
|
||
|
||
|
||
<body lang=DE link=blue vlink=blue style='tab-interval:35.4pt'>
|
||
|
||
<div id=content>
|
||
|
||
<div id=navigation>
|
||
|
||
<div class=Section1>
|
||
|
||
<h1 id=top>Content</h1>
|
||
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
mso-list:l3 level1 lfo3;tab-stops:list 36.0pt'><a href="#aimanual">Warzone
|
||
2100 - AI scripting language manual</a> </li>
|
||
<ul type=circle>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#introduction">Introduction</a> </li>
|
||
<ul type=square>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#comments">Comments</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#vlo">Vlo
|
||
files</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#slo">Slo
|
||
files</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#concept_event_trigger">Event/trigger concept</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#triggers">Triggers</a></li>
|
||
</ul>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a href="#expressions">Expressions</a>
|
||
</li>
|
||
<ul type=square>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#string_expressions">String expressions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#numeric_expressions">Numeric expressions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#boolean_expressions">Boolean expressions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#floatingpoint_expressions">Floating point expressions</a></li>
|
||
</ul>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a href="#assignment">Assignment</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#if_statements">If statements</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#while_statements">While statements</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a href="#casts">Casts</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#custom_functions">Custom functions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#local_variables">Local variables</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a href="#macros">Macros</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a href="#data_types">Data
|
||
types</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#script_functions">Appendix A: Script functions</a> </li>
|
||
<ul type=square>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_standard_functions">Standard functions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_type_conversion">Type conversion</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_objects">Objects</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_structures">Structures</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_features">Features</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#sf_droids">Droids</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_templates">Templates</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_research">Research</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_components">Components</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#sf_power">Power</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_environment_map">Environment/Map</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_game_states">Game states</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_diplomacy">Diplomacy</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_strategy">Strategy</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a href="#sf_gui"><acronym>GUI</acronym></a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_multimedia">Multimedia</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level3 lfo3;tab-stops:list 108.0pt'><a
|
||
href="#sf_unsorted">Unsorted</a></li>
|
||
</ul>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#debugging_script_functions">Appendix B: Debugging script functions</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#script_function_constants">Appendix C: Script function constants</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#script_function_externals">Appendix D: Script function externals</a></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l3 level2 lfo3;tab-stops:list 72.0pt'><a
|
||
href="#script_function_callbacks">Appendix E: Script function callbacks</a></li>
|
||
</ul>
|
||
</ul>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h1 id=aimanual>Warzone 2100 - AI scripting language manual<o:p></o:p></h1>
|
||
|
||
<h2 id=introduction>Introduction</h2>
|
||
|
||
<p>In order for Warzone scripts to function properly two files are required: a
|
||
file with a .slo extension and a file with a .vlo extension.</p>
|
||
|
||
<p>A .slo file is the main part of the script and holds executable instructions
|
||
while the .vlo file holds additional variable declarations necessary for the
|
||
.slo file to function properly.</p>
|
||
|
||
<p>It is common for a script to deal with new or existing game components such
|
||
as research topics, structures, unit bodies, propulsions, weapons etc. All
|
||
these components are defined in appropriate text files like body.txt,
|
||
structure.txt etc. If you want to use any of these components in your script -
|
||
in your .slo file - like for example if you want to place certain structures on
|
||
the map using scripts or enable certain research, you must first make these
|
||
components available to your script by defining them in a .vlo file.</p>
|
||
|
||
<p>Roughly said a .slo file is equivalent to a ".c" file and .vlo to
|
||
a header file in C/C++.</p>
|
||
|
||
<p>Specific skirmish/multiplayer notes:</p>
|
||
|
||
<p>Some of the file below does not apply to skirmish scripts! Make your changes
|
||
to player0.slo and vlo -> player7.slo and vlo.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id=comments>Comments</h3>
|
||
|
||
<p>There are two type of comment for the script language. A multi-line comment
|
||
is started by the characters /* and finishes with */. A single line comment is
|
||
started by //.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id=vlo>Vlo files</h3>
|
||
|
||
<p>When writing a script it is usually known what data (as defined in data .txt
|
||
files, located in 'stats' folder) will be used in the script, so it is a good
|
||
idea to start writing the script with a .vlo file.</p>
|
||
|
||
<p>Vlo files are structured as follows:</p>
|
||
|
||
<pre>script "myScript.slo"</pre><pre>run</pre><pre>{</pre><pre> <variable_definitions></pre><pre>}</pre>
|
||
|
||
<p>In the first line a .slo file is attached to this particular .vlo file.
|
||
variable_definitions that resides inside the curly braces is the heart of every
|
||
.vlo file, it contains definitions of the data that will be used in the main
|
||
script part - the .slo file. Each variable definition starts on a new line and
|
||
is structured as follows:</p>
|
||
|
||
<pre><variable_name> <variable_type> <variable_value></pre>
|
||
|
||
<p class=note>NOTE: Available data types are covered later.</p>
|
||
|
||
<p>For example if you want to have access to certain droid bodies, like "Python"
|
||
in your script you have to define it in your .vlo file and assign it to a
|
||
variable of type BODY with some descriptive name, like:</p>
|
||
|
||
<pre>myPythonBody BODY "Body11ABT"</pre>
|
||
|
||
<p>"Body11ABT" is an internal name of the "Python" body
|
||
used by warzone, it is defined in the body.txt file. Since it is a string it
|
||
must be put inside quotation marks. All components, be it some research,
|
||
structure, droid template or a weapon is referred by its internal name in the
|
||
game and are defined in the appropriate txt data files.</p>
|
||
|
||
<p>Each variable definition in a .vlo file starts on the new line and ends at
|
||
the end of the line.</p>
|
||
|
||
<p>It is also possible to define arrays of some data type. For example if you
|
||
want to use the following 3 research topics in your script you might want to
|
||
define them like this:</p>
|
||
|
||
<pre>myResearch[0] RESEARCHSTAt "R-Vehicle-Body11"</pre><pre>myResearch[1] RESEARCHSTAt "R-Vehicle-Prop-Tracks"</pre><pre>myResearch[2] RESEARCHSTAt "R-Vehicle-Prop-Hover"</pre>
|
||
|
||
<p>This defines an array of size 3 of type RESEARCHSTAT.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id=slo>Slo files</h3>
|
||
|
||
<p>As already mentioned .slo file is the heart of every script, it is the place
|
||
for the executable code. Slo files can be devided into 3 main parts:</p>
|
||
|
||
<ol start=1 type=1>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
mso-list:l4 level1 lfo6;tab-stops:list 36.0pt'>Variable declarations</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
mso-list:l4 level1 lfo6;tab-stops:list 36.0pt'>Event and function
|
||
declaration</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
mso-list:l4 level1 lfo6;tab-stops:list 36.0pt'>Executable code</li>
|
||
</ol>
|
||
|
||
<p>Variables used throughout the script are defined in the Variable
|
||
declarations part, with exception of the local variables, which are explained
|
||
later.</p>
|
||
|
||
<p>For the .slo file to be able to access variables declared in the .vlo file
|
||
they must be declared as public variables in the corresponding .slo file.</p>
|
||
|
||
<p>Coming back to the two examples above you will have to add following lines
|
||
to the .slo file:</p>
|
||
|
||
<pre>public BODy myPythonBody;</pre><pre>public RESEARCHSTAT myResearch[3];</pre>
|
||
|
||
<p>Keyword <code><span style='font-size:10.0pt;font-family:"Courier New"'>public</span></code>
|
||
signals that the variable is defined in the corresponding .vlo files. Note that
|
||
unlike in .vlo files variable declarations in .slo files end with a semicolon
|
||
and unlike in .vlo files it is possible to declare more than one variable of
|
||
the same type at once.</p>
|
||
|
||
<p>More generally a variable declaration in a .slo file looks like this:</p>
|
||
|
||
<pre><storage> <variable_type> <variable_name1> [, <variable_name2>, ...];</pre>
|
||
|
||
<p><code><span style='font-size:10.0pt;font-family:"Courier New"'>storage</span></code>
|
||
is one of <code><span style='font-size:10.0pt;font-family:"Courier New"'>public</span></code>
|
||
or <code><span style='font-size:10.0pt;font-family:"Courier New"'>private</span></code>.
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>public</span></code>
|
||
means that the variable is declared and defined in the corresponding .vlo file.
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>private</span></code>
|
||
means the value is only used in the .slo file. Unlike local variables public
|
||
and private variables are global variables that can be access from anywhere in
|
||
the .slo file.</p>
|
||
|
||
<p class=note>NOTE: All variables are initialized to their default values when
|
||
created. STRUCTURE/DROID/FEATURE variables are initialized to NULLOBJECT,
|
||
STRINGs to "", FLOATs to 0.0, INTs to 0, BOOLs to FALSE etc.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="concept_event_trigger">Event/trigger concept</h3>
|
||
|
||
<p>In Warzone 2100 scripts executable code consists of events. An event is a
|
||
list of instructions activated by some trigger attached to it. Event defines
|
||
what to do, a trigger defines when to run an event, i. e. when to execute the
|
||
code inside an event.</p>
|
||
|
||
<p>All events are structured as follows:</p>
|
||
|
||
<pre>event <event_name>(<trigger>)</pre><pre>{</pre><pre> <code></pre><pre>}</pre>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>event myFirstEvent(every, 50)</pre><pre>{</pre><pre> console("Hello world!");</pre><pre>}</pre>
|
||
|
||
<p>This piece of code will output "Hello world!" to the game console
|
||
every 5 seconds. Note that triggers are put inside the round braces after the
|
||
event name while code that is to be executed resides inside the curly braces.
|
||
The syntax of the executable code is very close to the C/C++ syntax.</p>
|
||
|
||
<p>The only difference between a WZ event and a function as used in programming
|
||
languages like C/C++ is that an event is not called or activated by another function,
|
||
but rather by a trigger attached to it.</p>
|
||
|
||
<p>It is always possible to interrupt execution of an event with the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>exit</span></code> keyword,
|
||
which is a counterpart of the <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>return</span></code> keyword used for functions; <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>exit</span></code> keyword
|
||
does not deactivate an event.</p>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>event myEvent(every, 10) //run every second</pre><pre>{</pre><pre> console ("this text will be printed every second");</pre><pre> if((gameTime / 10) > 60) //did more than a minute pass?</pre><pre><span
|
||
style='mso-tab-count:1'> </span>{</pre><pre><span
|
||
style='mso-tab-count:1'> </span> exit; //anything that comes after 'exit' will not be executed</pre><pre><span
|
||
style='mso-tab-count:1'> </span> console("this text will only get printed in the first");</pre><pre><span
|
||
style='mso-tab-count:1'> </span>}</pre><pre>}</pre>
|
||
|
||
<p>Events must be defined before they can be referenced. If event definition
|
||
comes after the place where this event is referenced it is necessary to declare
|
||
this event beforehand in the event and function declaration section.</p>
|
||
|
||
<p>Events are declared like this:</p>
|
||
|
||
<pre>event <event_name>;</pre>
|
||
|
||
<p>Such a declaration reserves identifier used as event name.</p>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>event myEvent; //declaration of the event</pre><pre>...</pre><pre>// another event that references myEvent</pre><pre>event anotherEvent(wait, 10)</pre><pre>{</pre><pre> setEventTrigger(myEvent, inactive); //deactivate myEvent</pre><pre>}</pre><pre>...</pre><pre>// myEvent is defined after being referenced by anotherEvent, </pre><pre>// but it works, since we declared myEvent beforehand</pre><pre>event myEvent(wait, 20)</pre><pre>{</pre><pre> console("It all compiles, because I was declared beforehand!");</pre><pre>}</pre>
|
||
|
||
<p>If myEvent was not declared before being referenced by anotherEvent then
|
||
this example would not compile.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id=triggers>Triggers</h3>
|
||
|
||
<p>In Warzone 2100 triggers are usually simple timers that repeatedly trigger
|
||
execution of events, but triggers can also be callbacks (special events that
|
||
occur in the game, like destruction of a building) that are listed and
|
||
explained later.</p>
|
||
|
||
<p>Here are available trigger types:</p>
|
||
|
||
<table border=0 cellpadding=0 style='mso-cellspacing:1.5pt;mso-padding-alt:
|
||
0cm 0cm 0cm 0cm'>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Trigger type<o:p></o:p></b></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Effect<o:p></o:p></b></p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>wait,
|
||
<time></span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Run the event after delay <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'><time></span></code>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>every,
|
||
<time></span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Run the event at every <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'><time></span></code> interval.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'><callback></span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Run when <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>callback</span></code> occurs.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'><bool
|
||
exp>, <time></span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Run the event if <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'><bool exp></span></code> is true, checking
|
||
every <code><span style='font-size:10.0pt;font-family:"Courier New"'><time></span></code>
|
||
interval.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>init</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Run the event when the script starts.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>inactive</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Do not run the event until a trigger is assigned to it.</p>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p class=note>NOTE: All time intervals are in 1/10 of a second.</p>
|
||
|
||
<p>For example <code><span style='font-size:10.0pt;font-family:"Courier New"'>every,
|
||
10</span></code> will trigger every second while <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>wait, 50</span></code> will only activate
|
||
once: 5 seconds after the game has started. If an event has <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>inactive</span></code>
|
||
assigned as a trigger this event will never execute unless its trigger is
|
||
reassigned by some other event with <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>setEventTrigger(<event>, <trigger>)</span></code>
|
||
function.</p>
|
||
|
||
<p class=note>NOTE: Complete function and callback listings are given below.</p>
|
||
|
||
<p>A few examples:</p>
|
||
|
||
<pre>// 1. output text to game console every second</pre><pre>event everySecond(every, 10)</pre><pre>{</pre><pre> console("The game has started " + gameTime/10 + " seconds ago");</pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>// 2. Code inside this event will never execute unless its event is reassigned later</pre><pre>event inactiveEvent(inactive)</pre><pre>{</pre><pre> console("Someone has just reactivated me!");</pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>// 3. CALL_NEWDROID callback with parameters</pre><pre>event droidBuilt(CALL_NEWDROID, 5, ref newDroid, ref myFactory)</pre><pre>{</pre><pre> console("We got a new droid at coordinates " &</pre><pre><span style="mso-spacerun: yes"> </span>newDroid.x & "-" & newDroid.y);</pre><pre>}</pre>
|
||
|
||
<p>In the last example <code><span style='font-size:10.0pt;font-family:"Courier New"'>droidBuilt</span></code>
|
||
event will be triggered everytime a factory belonging to player 5 produces a
|
||
new droid. <code><span style='font-size:10.0pt;font-family:"Courier New"'>newDroid</span></code>
|
||
variable refers to the new droid that was just built and <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>myFactory</span></code> to
|
||
the factory that build this droid. This example assumes that <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>newDroid</span></code> and <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>myFactory</span></code> were
|
||
correctly defined in the variable declarations section. For more callbacks see <a
|
||
href="#script_function_callbacks">Script function callbacks</a>.</p>
|
||
|
||
<p class=note>NOTE: <code><span style='font-size:10.0pt;font-family:"Courier New"'>ref</span></code>
|
||
keyword means that a pointer to the provided variable is passed to the
|
||
interpreter, so that a callback can modify value of the variable.</p>
|
||
|
||
<p>It is possible to reuse a trigger for more than one event if a trigger is
|
||
declared in the event and function declaration. Trigger declaration has
|
||
following syntax:</p>
|
||
|
||
<pre>trigger <trigger_name> (<trigger>);</pre>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>trigger everySecond (every, 10); //trigger declaration</pre><pre>...</pre><pre>event eventOne(everySecond) // uses the trigger we declared above</pre><pre>{</pre><pre> ...</pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>event eventTwo(everySecond) // uses the trigger we declared above</pre><pre>{</pre><pre> ...</pre><pre>}</pre>
|
||
|
||
<p>In this example <code><span style='font-size:10.0pt;font-family:"Courier New"'>everySecond</span></code>
|
||
trigger is defined outside of an event. Such a trigger can be reused by its
|
||
name. Note that trigger declaration ends with a semicolon.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id=expressions>Expressions<o:p></o:p></h2>
|
||
|
||
<h3 id="string_Expressions">String expressions</h3>
|
||
|
||
<p>Strings are put inside quotation marks: <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>"some text inside quotation marks is a legal
|
||
string"</span></code>.</p>
|
||
|
||
<p>Strings can be easily concatenated using the <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>&</span></code> operator.</p>
|
||
|
||
<p>For example: <code><span style='font-size:10.0pt;font-family:"Courier New"'>"String1"
|
||
& "String2"</span></code> will result in
|
||
"String1String2".</p>
|
||
|
||
<p>Strings can be compared using <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>==</span></code> operator (case insensitive comparison)
|
||
or <code><span style='font-size:10.0pt;font-family:"Courier New"'>strcmp()</span></code>
|
||
function.</p>
|
||
|
||
<p>Such data types as integers, booleans and floats are automatically converted
|
||
to strings when it is required, so given the following variable declaration:</p>
|
||
|
||
<pre>private float pi;</pre><pre>private int myInteger;</pre><pre>private string myString;</pre><pre>private bool myBool;</pre>
|
||
|
||
<p>The following line is a valid string expression:</p>
|
||
|
||
<pre>console("value of pi is " & pi & ", value of myInteger is " & myInteger & ", </pre><pre>value of myString is " & myString & ", value of myBool is " & myBool);</pre>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="numeric_expressions">Numeric expressions</h3>
|
||
|
||
<p>Numeric expressions are made up of int variables, numeric constants and
|
||
functions that return int values, e. g.:</p>
|
||
|
||
<pre>power * 32 - basePower</pre><pre>numDroids(player) + 5</pre>
|
||
|
||
<p>The possible operators are: <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>+</span></code> <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>-</span></code> <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>*</span></code> <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>/</span></code></p>
|
||
|
||
<p>Increment and decrement operators can only be applied to the integer
|
||
variables outside of the expression context:</p>
|
||
|
||
<pre>myInteger++;</pre><pre>myInteger--;</pre>
|
||
|
||
<p>There are also a number of operators that compare numeric expressions to
|
||
give a boolean</p>
|
||
|
||
<table border=0 cellpadding=0 style='mso-cellspacing:1.5pt;mso-padding-alt:
|
||
0cm 0cm 0cm 0cm'>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Operator<o:p></o:p></b></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Meaning<o:p></o:p></b></p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'><</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Less than</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>></span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Greater than</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'><=</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Less than or equal</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>>=</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Greater than or equal</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>==</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Equal</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>!=</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Not equal</p>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="boolean_expressions">Boolean expressions</h3>
|
||
|
||
<p>Boolean expressions are made up of bool variables, the boolean constants
|
||
TRUE and FALSE and game functions that return a boolean value e.g.:</p>
|
||
|
||
<pre>not droidSeen and attackDroid</pre>
|
||
|
||
<p>The possible operators are:</p>
|
||
|
||
<table border=0 cellpadding=0 style='mso-cellspacing:1.5pt;mso-padding-alt:
|
||
0cm 0cm 0cm 0cm'>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Operator<o:p></o:p></b></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Meaning<o:p></o:p></b></p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool1
|
||
and bool2</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>True if <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>bool1</span></code> and <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>bool2</span></code> are true</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool1
|
||
or bool2</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>True if at least one of <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>bool1</span></code> and <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>bool2</span></code> is
|
||
true</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>not
|
||
bool1</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>True becomes false and false becomes true</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>==</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Can also be used with user defined type variables</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>!=</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Can also be used with user defined type variables</p>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="floatingpoint_expressions">Floating point expressions</h3>
|
||
|
||
<p>Floating point expressions are very similar to integer expressions. There are
|
||
some differences though: it is not possible to use increment/decrement
|
||
operators with floating point variables. The integral and fractional parts of
|
||
the float constant must be separated by a dot, even if fractional part is 0.</p>
|
||
|
||
<p>Examples:</p>
|
||
|
||
<pre>myFloat = 1.0 + pi / 2.0 + 3.6;</pre>
|
||
|
||
<p>Floating point expressions cannot be mixed with integer or boolean
|
||
expressions. To use integers or booleans in floating point expressions they
|
||
must be cast to FLOATs first.</p>
|
||
|
||
<p>For more information about casts refer to <a href="#casts">casts</a>.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id=assignment>Assignment</h2>
|
||
|
||
<p>The value of a variable or an expression can be assigned to another using
|
||
the = character, e.g.:</p>
|
||
|
||
<pre>currentDroid = foundDroid;</pre><pre>index = base + found * 4;</pre><pre>myString = "some text";</pre><pre>myFloat = 2.0 + pi / 2.0;</pre>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="if_statements">If statements</h2>
|
||
|
||
<p>If statements are used to control which bits of code are executed. The
|
||
simplest form is:</p>
|
||
|
||
<pre>if (<bool exp>)</pre><pre>{</pre><pre> <code></pre><pre>}</pre>
|
||
|
||
<p>In this form if <code><span style='font-size:10.0pt;font-family:"Courier New"'><bool
|
||
exp></span></code> evaluates to true then the script code <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'><code></span></code>
|
||
is executed, otherwise the code is ignored.</p>
|
||
|
||
<p>Examples:</p>
|
||
|
||
<pre>if (<bool exp>)</pre><pre>{</pre><pre> <code></pre><pre>}</pre><pre>else</pre><pre>{</pre><pre> <other code></pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>if (<bool exp>)</pre><pre>{</pre><pre> <code></pre><pre>}</pre><pre>else if (<other bool exp>)</pre><pre>{</pre><pre> <other code></pre><pre>}</pre><pre>else</pre><pre>{</pre><pre> <yet another code></pre><pre>}</pre>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="while_statements">While statements</h2>
|
||
|
||
<p>While statements allow <code><span style='font-size:10.0pt;font-family:"Courier New"'><code></span></code>
|
||
to be executed while <code><span style='font-size:10.0pt;font-family:"Courier New"'><bool
|
||
exp></span></code> evaluates to TRUE:</p>
|
||
|
||
<pre>while (<bool exp>)</pre><pre>{</pre><pre> <code></pre><pre>}</pre>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id=casts>Casts</h2>
|
||
|
||
<p>Casts convert one data type into a different one. In Warzone 2100 casts are
|
||
mostly used to convert float to int, int to float and bool to float. To perform
|
||
a cast write the required data type in pare nothesis.</p>
|
||
|
||
<p>Examples:</p>
|
||
|
||
<pre>myFloat = (float)myInteger + 2.3 + (float)500 + 500.0;</pre><pre>myInteger = 100 + numPlayers + (int)myFloat;</pre>
|
||
|
||
<p>NOTE: Both <code><span style='font-size:10.0pt;font-family:"Courier New"'>(float)500</span></code>
|
||
and <code><span style='font-size:10.0pt;font-family:"Courier New"'>500.0</span></code>
|
||
represent the same value. When converting FLOATs to INTs fractional part is
|
||
discarded.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="custom_functions">Custom functions</h2>
|
||
|
||
<p>It is possible to define custom script functions to reuse certain
|
||
functionality throughout the script.</p>
|
||
|
||
<p>Functions have following syntax:</p>
|
||
|
||
<pre>function <return type> <function name> ([ <argument type> < argument name>, ... ])</pre><pre>{</pre><pre> <code></pre><pre> return ... ;</pre><pre>}</pre>
|
||
|
||
<p>Examples:</p>
|
||
|
||
<pre>function void displayVictoryMessage(int winner)</pre><pre>{</pre><pre> console ("Player " & getPlayerName(winner) & " has won the game");</pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>function float calculateMinimum (float f1, float f2)</pre><pre>{</pre><pre> if (f1 < f2)</pre><pre> {</pre><pre><span style="mso-spacerun: yes"> </span>return f1;</pre><pre> }</pre><pre> return f2;</pre><pre>}</pre>
|
||
|
||
<p>Functions look almost identical to their C counterparts, except that the
|
||
beginning of a function is marked with <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>function</span></code> keyword.</p>
|
||
|
||
<p>It is possible to declare functions like with events it is done in the event
|
||
and function declaration section:</p>
|
||
|
||
<pre>function void displayVictoryMessage(int winner);</pre><pre>function float calculateMinimum (float f1, float f2);</pre>
|
||
|
||
<p>Declared this way it is possible to use a function before it is defined
|
||
later in the script. To call a function simply provide its name with parameters
|
||
in pare nothesis:</p>
|
||
|
||
<pre>displayVictoryMessage(0);</pre><pre>...</pre><pre>console("Minimum of 2 and 2.1 is " & calculateMinimum(2.0, 2.1));</pre>
|
||
|
||
<p>Like in C <code><span style='font-size:10.0pt;font-family:"Courier New"'>return
|
||
<return expression>;</span></code> or for void functions just <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>return;</span></code>
|
||
returns execution to the caller.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="local_variables">Local variables</h2>
|
||
|
||
<p>Local variables belong either to a function or event where they were declared
|
||
and are not accessible outside of it. Local variables must be declared at the
|
||
beginning of the function or event. Like public/private variables local
|
||
variables of the same type can be declared on the same line separated by a
|
||
comma.</p>
|
||
|
||
<p>Declaration of a local variable looks as follows:</p>
|
||
|
||
<pre>local <variable type> <variable name> [, <variablename>, ...] ;</pre>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>event myEvent(myTrigger)</pre><pre>{</pre><pre> local int count;</pre><pre> <code></pre><pre>}</pre><pre><![if !supportEmptyParas]> <![endif]><o:p></o:p></pre><pre>function void myFunction()</pre><pre>{</pre><pre> local DROID myDroid1, myDroid2;</pre><pre> local string myString;</pre><pre> <code></pre><pre>}</pre>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id=macros>Macros</h2>
|
||
|
||
<p>The Warzone 2100 Scripting language supports nested macros (current max.
|
||
depth is 10). Parametrized macros are not supported. Macros are defined as
|
||
follows:</p>
|
||
|
||
<pre>#define <macro name> <macro body></pre>
|
||
|
||
<p>Example:</p>
|
||
|
||
<pre>#define pi 3.14</pre>
|
||
|
||
<p>Example of a nested macro:</p>
|
||
|
||
<pre>#define CURRENT_PLAYER 0</pre><pre>#define CURRENT_PLAYER_NAMe getPlayerName(CURRENT_PLAYER)</pre>
|
||
|
||
<p>During the compilation process macro names are replaced with the actual
|
||
code.</p>
|
||
|
||
<p>If any other text but "define" follows after # character then
|
||
anything between # and end of the line is ignored by compiler making it
|
||
possible to use #region and other tags in your favorite IDE.</p>
|
||
|
||
<p class=note>NOTE: "#include" is reserved but not fully supported
|
||
yet.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="data_types">Data types</h2>
|
||
|
||
<p>Apart from standard data types like string (string), integer (int), boolean
|
||
(bool) and floating point (float) there are some Warzone 2100-specific data
|
||
types available:</p>
|
||
|
||
<table border=0 cellpadding=0 style='mso-cellspacing:1.5pt;mso-padding-alt:
|
||
0cm 0cm 0cm 0cm'>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Data type<o:p></o:p></b></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal align=center style='text-align:center'><b>Meaning<o:p></o:p></b></p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>INTMESSAGE</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a message as defined in Messages.txt, used
|
||
mostly for campaign. In most cases it is easier to use a string instead.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BASEOBJ</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Complex. Any of a DROID, FEATURE or STRUCTURE. It is a
|
||
pointer to some droid/feature/structure on the map, can be NULLOBJECT if it was
|
||
not assigned to a particular droid/feature/structure. You have access to the
|
||
following variables: </p>
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.x</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.y</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.z</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.id</span></code>
|
||
- unique ID number</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.player</span></code>
|
||
- player ID</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.type</span></code>
|
||
- one of OBJ_DROID, OBJ_STRUCTURE, OBJ_FEATURE</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.health</span></code>
|
||
- %age number of body points left</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.clusterID</span></code>
|
||
- the cluster the object is a member of</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l9 level1 lfo9;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>baseobj.target</span></code>
|
||
- target of the object (in case of a multi-turret object returns target
|
||
of the default weapon)</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Complex. Defined by the ID got from the world editor. It
|
||
is a pointer to a particular droid on the map, can be NULLOBJECT when no
|
||
droid is assigned to the DROID variable. You have access to following
|
||
variables: </p>
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.x</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.y</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.z</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.id</span></code>
|
||
- unique ID number</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.player</span></code>
|
||
- player ID</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.type</span></code>
|
||
- one of OBJ_DROID, OBJ_STRUCTURE, OBJ_FEATURE</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.health</span></code>
|
||
- %age number of body points left</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.clusterID</span></code>
|
||
- the cluster the object is a member of</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.target</span></code>
|
||
- target of the object (in case of a multi-turret object returns target
|
||
of the default weapon)</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.order</span></code>
|
||
- current order of the droid</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.orderx</span></code>
|
||
- target location of the droid order</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.ordery</span></code>
|
||
- target location of the droid order</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.action</span></code>
|
||
- current action of the droid</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.body</span></code>
|
||
- the BODY of the droid</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.propulsion</span></code>
|
||
- the PROPULSION of the droid</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.weapon</span></code>
|
||
- the WEAPON of the droid DROIDID - (simple) literally just an Id of a
|
||
droid</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.selected</span></code>
|
||
- holds TRUE if droid is currently selected</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l10 level1 lfo12;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid.group</span></code>
|
||
- the GROUP droid belongs to</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>FEATURE</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Complex. Defined by the ID got from the world editor. It
|
||
is a pointer to a map decoration, like a tree, wrecked building, oil resource
|
||
etc, can be NULLOBJECT. You have access to following variables: </p>
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.x</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.y</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.z</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.id</span></code>
|
||
- unique ID number</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.player</span></code>
|
||
- player ID</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.type</span></code>
|
||
- one of OBJ_DROID, OBJ_STRUCTURE, OBJ_FEATURE</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.health</span></code>
|
||
- %age number of body points left</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.clusterID</span></code>
|
||
- the cluster the object is a member of</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l2 level1 lfo15;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>feature.target</span></code>
|
||
- target of the object (in case of a multi-turret object returns target
|
||
of the default weapon)</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>FEATURESTAT</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Type of a feature as defined in features.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>TEMPLATE</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a template as defined in templates.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Complex. Defined by the ID got from the world editor. It
|
||
is a pointer to a particular structure on the map, can be NULLOBJECT when no
|
||
structure is assigned to the STRUCTURE variable. You have access to the
|
||
foillowing variables: </p>
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.x</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.y</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.z</span></code></li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.id</span></code>
|
||
- unique ID number</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.player</span></code>
|
||
- player ID</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.type</span></code>
|
||
- one of OBJ_DROID, OBJ_STRUCTURE, OBJ_FEATURE</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.health</span></code>
|
||
- %age number of body points left</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.clusterID</span></code>
|
||
- the cluster the object is a member of</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.target</span></code>
|
||
- target of the object (in case of a multi-turret object returns target
|
||
of the default weapon)</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.stat</span></code>
|
||
- the STRUCTURESTAT of the structure, defined in structures.txt</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l0 level1 lfo18;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>structure.stattype</span></code>
|
||
- structure type (likeREF_HQ etc.; refers to <a
|
||
href="#script_function_constants">Script function constants</a>)</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTUREID</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Literally just an ID of a struct.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURESTAT</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Type of a structure as defined in structures.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BODY</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a body as defined in body.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>PROPULSION</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a propulsion as defined in propulsion.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>ECM</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of an ECM as defined in ecm.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>SENSOR</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a sensor as defined in sensor.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CONSTRUCT</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a construct as defined in construct.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>WEAPON</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a weapon as defined in weapons.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>REPAIR</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a repair type as defined in Repair.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BRAIN</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a brain type as defined in Brain.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>SOUND</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. ID of sound used in playSound().</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>LEVEL</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. ID of a level as defined in GameDesc.lev.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>RESEARCHSTAT</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Simple. Name of a research topic as defined in
|
||
research.txt.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>GROUP</span></code></p>
|
||
</td>
|
||
<td style='padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal>Complex. A group of droids. Do not confuse GROUP with in-game
|
||
units' groups that can be accessed with CTRL-<number>, they have
|
||
nothing in common. GROUP is an internal structure used to simplify unit
|
||
management. You have access to following variables: </p>
|
||
<ul type=disc>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.x</span></code>
|
||
- average x coord</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.y</span></code>
|
||
- average y coord</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.members</span></code>
|
||
- number of units in the group</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.health</span></code>
|
||
- average %age health of the units</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.type</span></code>
|
||
- type of the group, one of: <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>GT_NORMAL</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>GT_COMMAND</span></code>
|
||
or <code><span style='font-size:10.0pt;font-family:"Courier New"'>GT_TRANSPORTER</span></code>
|
||
(refer to <a href="#script_function_constants">Script function constants</a>)</li>
|
||
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
|
||
auto;mso-list:l5 level1 lfo21;tab-stops:list 36.0pt'><code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>group.commander</span></code>
|
||
- commander of the group, if type == <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>GT_COMMAND</span></code> or <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>NULLOBJECT</span></code></li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p class=note>NOTE: The functions objToDroid, objToStructure and objToFeature
|
||
exist to convert a BASEOBJ to a droid, structure or feature if the base obj is of
|
||
the right type.</p>
|
||
|
||
<p class=note>NOTE: Transporters and commanders cannot be added to a GROUP.</p>
|
||
|
||
<p>With a complex object it is possible to access information specific to the
|
||
instance of this object. Acomplex object is usually a pointer to a C structure in
|
||
the code. For example a DROID is a complex object - its x, y, z can be queried
|
||
whereas a DROIDID (a simple object - an integer) is just a placeholder for the
|
||
numeric value of the ID.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="script_functions">Appendix A: Script functions<o:p></o:p></h2>
|
||
|
||
<h3 id="sf_standard_functions">Standard functions</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
random(range)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return a random number between 0
|
||
and range - 1.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>randomiseSeed()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Generate a new random seed for
|
||
the random number generator.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
distBetweenTwoPoints(int x1, int y1, int x2, int y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns the distance between the
|
||
two points given.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
max(int value1, int value2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns maximum of two integer
|
||
values.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
min(int value1, int value2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns minimum of two integer
|
||
values.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>float
|
||
fmax(float value1, float value2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns maximum of two float
|
||
values.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>float
|
||
fmin(float value1, float value2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns minimum of two float
|
||
values.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
modulo(int divident, int divisor)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns result of calculation
|
||
(divident modulo divisor).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>float
|
||
toPow(float base, float exponent)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns floating point result of
|
||
calculation base^exponent.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>float
|
||
exp(float exponent)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Exponential function. Returns the
|
||
result of e^exponent.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>float
|
||
sqrt(float argument)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Square root function. Returns
|
||
square root of the argument: √argument.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
strcmp(string string1, string string2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if string1 and string2
|
||
are identical. Comparison is case-sensitive.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_type_conversion">Type conversion</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID
|
||
objToDroid(BASEOBJ)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Convert a BASEOBJ to DROID when
|
||
BASEOBJ.type == OBJ_DROID. Returns NULLOBJECT otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
objToStructure(BASEOBJ)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Convert a BASEOBJ to STRUCTURE
|
||
when BASEOBJ.type == OBJ_STRUCTURE. Returns NULLOBJECT otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>FEATURE
|
||
objToFeature(BASEOBJ)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Convert a BASEOBJ to FEATURE when
|
||
BASEOBJ.type == OBJ_FEATURE. Returns NULLOBJECT otherwise.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_objects">Objects</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
objectInRange(PLAYER, X, Y, RANGE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when an
|
||
object belonging to a player is within range of a position. PLAYER is the id of
|
||
the player whose unit is checked for in range. X, Y is the position to check from
|
||
in world coords. RANGE is in world coords - 128 units = 1 tile.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
objectInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when an
|
||
object belonging to a player is in a square area. PLAYER is the id of the
|
||
player whose droid is checked for in area. X1, Y1, X2, Y2 is the area to check
|
||
in world coords. X1, Y1 should be smaller than X2, Y2.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>centreView(OBJECT)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function centres the view on
|
||
the object supplied. OBJECT is any type of DROID, FEATURE, STRUCTURE.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numObjectsInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the number of player
|
||
objects in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
losTwoObjects(BASEOBJ source, BASEOBJ target, bool wallsMatter)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Decides whether object source can
|
||
see object target and you can specify whether walls matter or not. Note that
|
||
whilst target can be anything, source needs to be something that can actually
|
||
see - i. e. - have a sensor like a unit or structure. Returns TRUE or FALSE.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
forceDamageObject(BASEOBJ obj, int damage)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>obj</span></code> to be <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>damage</span></code> percent
|
||
damaged. <code><span style='font-size:10.0pt;font-family:"Courier New"'>obj</span></code>
|
||
must be a feature, droid or structure. <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>damage</span></code> ≥ 0 ⊥ <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>damage</span></code> ≤ 100.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
fireWeaponAtObj(WEAPON weap, BASEOBJ target)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Fire a single shot of the weapon
|
||
weap at the object target.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BASEOBJECT
|
||
skLocateEnemy(int pl)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return a baseobject of interest
|
||
belonging to player pl.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
skFireLassat (int pl, BASEOBJECT obj)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Fire lassat of player <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>pl</span></code>'s at object
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>obj</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numEnemyWeapObjInRange(int lookingPlayer, int x, int y, int range, bool
|
||
includeVTOLs, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of enemy
|
||
military structures and droids at location <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>y</span></code> and within <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code>. Units
|
||
belonging to <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
and his allies are ignored. If <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>includeVTOLs</span></code> is set to FALSE, then VTOLs are
|
||
ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>onlyFinishedStructs</span></code>
|
||
is set to TRUE, then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numFriendlyWeapObjInRange(int lookingPlayer, int x, int y, int range, bool
|
||
includeVTOLs, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of friendly
|
||
military objects structures and droids at location <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y</span></code> and within <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code>. Units
|
||
belonging to enemies of <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
are ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>onlyFinishedStructs</span></code> is set to TRUE,
|
||
then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numPlayerWeapObjInRange(int targetPlayer, int lookingPlayer, int x, int y, int
|
||
range, bool includeVTOLs, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total number of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>'s
|
||
military structures and droids at location <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>y</span></code> and within <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code> that are
|
||
visible visible by <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.
|
||
If <code><span style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>onlyFinishedStructs</span></code> is set to TRUE,
|
||
then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numEnemyObjInRange(int lookingPlayer, int, x, int y, int range, bool
|
||
includeVTOLs, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total number of enemy
|
||
objects (structures and units) at location <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>y</span></code> within range <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code> that are
|
||
visible to <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.
|
||
If <code><span style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>onlyFinishedStructs</span></code> is set to TRUE,
|
||
then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
objHasWeapon(BASEOBJ object)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>object</span></code> has a
|
||
weapon.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
objectHasIndirectWeapon(BASEOBj object)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>object</span></code> has an
|
||
indirect weapon.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
enemyWeapObjCostInRange(int lookingPlayer, int rangeX, int rangeY, int range,
|
||
bool includeVtols, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total cost (in power) of
|
||
enemy objects with a weapon in a certain area. If <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>includeVTOLs</span></code> is set to FALSE,
|
||
then VTOLs are ignored. If <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>onlyFinishedStructs</span></code> is set to TRUE, then
|
||
unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
friendlyWeapObjCostInRange(int lookingPlayer, int rangeX, int rangeY, int
|
||
range, bool includeVtols, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total cost (in power) of
|
||
friendly objects with a weapon in a certain area. If <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>onlyFinishedStructs</span></code> is set to TRUE,
|
||
then unfinished structures will be ignored.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_structures">Structures</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setStructureLimits(STRUCTURESTAT,
|
||
LIMIT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This sets a limit for a specific
|
||
structure on how many can be built on a map. STRUCTURESTAT is defined by the
|
||
name from Access. LIMIT is a number between 0 and 255. PLAYER is the id of the
|
||
player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setAllStructureLimits(LIMIT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This sets a limit for all
|
||
structures on how many can be built on a map. LIMIT is a number between 0 and
|
||
255. PLAYER is the id of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
buildingDestroyed(STRUCTUREID, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks that a
|
||
structure (given by the id) no longer exists for the player. STRUCTUREID is the
|
||
id of the structure. Note that this is different to an object of type
|
||
STRUCTURE. PLAYER is the id of the player whose list is checked for the
|
||
building.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structureIdle(STRUCTURE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks whether the
|
||
structure is doing anything. Returns TRUE if idle. STRUCTURE is a valid structure
|
||
defined by ID.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structureBeingBuilt(STRUCTURESTAT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks that a
|
||
structure of type STRUCTURESTAT is currently being built for the specified
|
||
PLAYER. STRUCTURESTAT is defined by the name from Access. PLAYER is the id of
|
||
the player who gets the structure.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structureBuilt(STRUCTURESTAT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks that a
|
||
structure of type STRUCTURESTAT is currently built for the specified PLAYER.
|
||
STRUCTURESTAT is defined by the name from Access. PLAYER is the id of the player
|
||
who gets the structure.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when a
|
||
structure belonging to a player is in a square area. PLAYER is the id of the
|
||
player whose droid is checked for in area. X1, Y1, X2, Y2 is the area to check
|
||
in world coords. X1, Y1 should be smaller than X2, Y2.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structInRange(PLAYER, X, Y, RANGE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when a
|
||
structure belonging to a player is within range of a position. PLAYER is the id
|
||
of the player whose unit is checked for in range. X, Y is the position to check
|
||
from in world coords. RANGE is in world coords - 128 units = 1 tile.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setAssemblyPoint(X,
|
||
Y, STRUCTURE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This sets the location of where
|
||
new units assemble at for a specific factory. X, Y are the x and y in world
|
||
coordinates. STRUCTURE is a valid structure defined by ID.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
addStructure(STRUCTURESTAT, PLAYER, X, Y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Builds a structure belonging to
|
||
PLAYER centred at (X, Y). The structure must be previously enabled via
|
||
enableStructure(). The structure identifier is returned - this can be used in
|
||
e.g. destroyStructure.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>destroyStructure(STRUCTURE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This removes the structure from
|
||
the world. STRUCTURE is a structure defined by ID.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
getStructure(STRUCTURESTAT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function returns the first
|
||
STRUCTURE based on the stat for the player it can find. To use it create a
|
||
STRUCTURE variable and assign it to the result of the function call. For
|
||
example: </p>
|
||
|
||
<pre style='margin-left:36.0pt'>STRUCTURE myNewStructure;</pre><pre
|
||
style='margin-left:36.0pt'>STRUCTURESTAT Factory;</pre><pre style='margin-left:
|
||
36.0pt'>myNewStructure = getStructure(Factory, 0);</pre>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This will look through the player
|
||
0 list of structures to find a Factory and return a variable of type STRUCTURE.
|
||
You will then be able to access the x, y, and z. If a structure cannot be found
|
||
than NULL is returned . It will be worth checking that the STRUCTURE does not
|
||
equal NULL before using it. For example: </p>
|
||
|
||
<pre style='margin-left:36.0pt'>if (myNewStructure == NULLOBJECT)</pre><pre
|
||
style='margin-left:36.0pt'>{</pre><pre style='margin-left:36.0pt'> do something</pre><pre
|
||
style='margin-left:36.0pt'>}</pre>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
initEnumStruct(bool any, STRUCTURESTAT type, int targetPlayer, int
|
||
lookingPlayer)</span></code><span style='font-size:10.0pt;font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><br>
|
||
<code>STRUCTURE enumStruct()</code></span></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Enumerate through visible
|
||
structures of given <code><span style='font-size:10.0pt;font-family:"Courier New"'>type</span></code>
|
||
of player <code><span style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>
|
||
that are visible to <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.
|
||
Returns NULLOBJECT when no more exist. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>any</span></code> is set to TRUE, then <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>type</span></code> is
|
||
ignored and all structure types will be iterated.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>anyStructButWallsLeft(PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>checks the specified player for any
|
||
structures except walls - returns TRUE if some exist, FALSE if they have all
|
||
been destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>anyFactoriesLeft(PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if player has a
|
||
factory/cyborg factory/ vtol factory.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
structureBuiltInRange(STRUCTURESTAT, X, Y, RANGE, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Checks to see if a Structure has
|
||
been built within a specified range of x, y. The first structure. to be found
|
||
within this range will be returned. Check the result of the function for being
|
||
NULLOBJECT before using. STRUCTURE is a return value (structure defined by ID).
|
||
STRUCTURESTAT is defined by the name from Access. X, Y, RANGE are all in world
|
||
coords. PLAYER is the id of the player whose structure list is searched.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structButNoWallsInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>See if there are any player
|
||
structures excluding walls in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numStructsInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the number of player
|
||
structures in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numStructsButNotWallsInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the number of player
|
||
structures excluding walls in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numStructsByTypeInArea(PLAYER, TYPE, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the number of structures
|
||
of a certain type in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
pickStructLocation(STRUCTURESTAT, ref x, ref y, player);</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if structure of type
|
||
structurestat can be built at x, y. If a structure can be built nearby then
|
||
returns true and modifies x and y to the coords of acceptable location. Player
|
||
trying to build uses this for the visibility.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
seenStructInArea(int player, int enemy, bool walls, int x1, int y1, int x2, int
|
||
y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if player has seen a
|
||
structure belonging to enemy in area specified. Call with walls = true/false to
|
||
include/exclude walls in the search. Similar to StructInArea.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
killStructsInArea(int player, int buildingRef (like REF_WALL etc), int x1, int
|
||
y1, int x2, int y2, bool bSeeEffect, bool bTakeFeatures).</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Blows up all the buildings of the
|
||
specified reference within the specified area. If bSeeEffect is set, then you
|
||
will see it blow up (provided you can see the building in question of course).
|
||
If bTakeFeatures is set, then it will also kill features of type BUILDING.
|
||
Returns 'nowt.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
testStructureModule(int playerNumber, ST_STRUCTURE structureToTest, int ref)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if the structure in
|
||
question has a module attached - presently the <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>ref</span></code> id is unused but could be
|
||
later on. At the moment it returns true if the structure has _any_ number of
|
||
modules attached. If the structure pointer that is sent in is NULL (i. e. - no
|
||
structure is specified), then it will return TRUE if _any_ of the player's
|
||
structures possess _any_ module. In all other cases, it will return FALSE.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
takeOverSingleStructure(STRUCTURE structToTakeOver, int playerToGain)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This replaces the existing
|
||
structure (structToTakeOver) by a new one for the playerToGain. The new
|
||
structure is passed back to the script. Test for NULLOBJECT BEFORE calling this
|
||
function.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
takeOverStructsInArea(int fromPlayer, int toPlayer, int x1, int y1, int x2, int
|
||
y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'><code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>x1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x2</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y2</span></code> are in
|
||
world units. checks for structures belonging to <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>fromPlayer</span></code> and if they are in
|
||
the area they are given to the <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>toPlayer</span></code>. This will NOT WORK for the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>selectedPlayer</span></code>
|
||
on any Factory. The structure limits will be increased if necessary.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
resetStructTargets()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Reset the structure preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setStructTarPref(int type)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set a preferred structure target
|
||
type, repeated calls combine the effect.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setStructTarIgnore(int type)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set structure target ignore
|
||
types.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
structTargetInArea(int targetPlayer, int visibleToPlayer, int x1, int y1, int
|
||
x2, int y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get a structure target in an area
|
||
using the preferences. targetPlayer is the player to choose targets from,
|
||
visibleToPlayer specifies the. player that has to be able to see the target or
|
||
-1 for no visibility check.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>STRUCTURE
|
||
structTargetOnMap(int targetPlayer, int visibleToPlayer)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get a structure target on the map
|
||
using the preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
isStructureAvailable(STRUCTURESTAT stat, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if structure is
|
||
available to player, false otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
structureComplete(STRUCTURE struct)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if the structure is
|
||
completely built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
skGetFactoryCapacity(STRUCTURE str)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the capacity of factory <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>str</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
skDefenseLocation (ref int x, ref int y, STRUCTURESTAT defenceStat,
|
||
STRUCTURESTAT wallstat, DROID unit, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Given a starting <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x</span></code> and <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>, make unit <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>unit</span></code> belonging
|
||
to <code><span style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>
|
||
build either a <code><span style='font-size:10.0pt;font-family:"Courier New"'>defenceStat</span></code>
|
||
or a row of <code><span style='font-size:10.0pt;font-family:"Courier New"'>wallStat</span></code>.
|
||
Returns modified <code><span style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>
|
||
and <code><span style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>s.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numEnemyWeapStructsInRange(int lookingPlayer, int x, int y, int range, bool
|
||
onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of enemy
|
||
military structures at location <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>y</span></code> and within <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>range</span></code>. Units belonging to <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
and his allies are ignored. If <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>includeVTOLs</span></code> is set to FALSE, then VTOLs are
|
||
ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>onlyFinishedStructs</span></code>
|
||
is set to TRUE, then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numFriendlyWeapStructsInRange(int lookingPlayer, int x, int y, int range, bool
|
||
onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of friendly
|
||
military structures at location <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>y</span></code> and within <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>range</span></code>. Units belonging to enemies of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
are ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>onlyFinishedStructs</span></code>
|
||
is set to TRUE, then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numPlayerWeapStructsInRange(int targetPlayer, int lookingPlayer, int x, int y,
|
||
int range, bool onlyFinishedStructs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total number of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>'s
|
||
military objects (either structures, droids or both) at location <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y</span></code> and within <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code> that are
|
||
visible visible by <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.
|
||
If <code><span style='font-size:10.0pt;font-family:"Courier New"'>onlyFinishedStructs</span></code>
|
||
is set to TRUE, then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numAAinRange(int targetPlayer, int lookingPlayer, int x, int y, int range)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns number of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>'s
|
||
AA defences at location <code><span style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>,
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>
|
||
within range <code><span style='font-size:10.0pt;font-family:"Courier New"'>range</span></code>
|
||
that are visible to <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_features">Features</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>FEATURE
|
||
addFeature(FEATURESTAT, X, Y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Builds a feature at position (x, y).
|
||
FEATURESTAT is the name of a feature stat defined in features.txt. The feature
|
||
identifier is returned - this can be used in e.g. destroyFeature.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>destroyFeature(FEATURE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This removes the feature from the
|
||
world. FEATURE is a feature defined by ID.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>initGetFeature(STRUCTURESTAT,
|
||
PLAYER, BUCKET)</span></code><span style='font-size:10.0pt;font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><br>
|
||
<code>getFeature(BUCKET)</code></span></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>enumerate features of a single
|
||
feature type. PLAYER is the player to use, Only features visible to that player
|
||
are returned. BUCKET is an int of range 0-MAX_PLAYERS(8), so up to 8 feature
|
||
enumerations can be going on at any time! getFeature returns NULLOBJECT when no
|
||
more features are visible.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_droids">Droids</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>addDroid(TEMPLATE,
|
||
X, Y, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function adds a unit for the
|
||
player based on the template passed in. The unit is placed at x, y. TEMPLATE is
|
||
a valid template (does not have to belong to the player!). X, Y are in world
|
||
coords. PLAYER is the id of the player whose the unit belongs to.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>buildDroid(TEMPLATE,
|
||
STRUCTURE, PLAYER, QUANTITY)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function sets a factory
|
||
defined by STRUCTURE to build units based on the TEMPLATE for the PLAYER.
|
||
TEMPLATE is a valid template (does not have to belong to the player!).
|
||
STRUCTURE is a structure defined by ID and MUST BE A FACTORY. PLAYER is the id
|
||
of the player whose the unit belongs to. QUANTITY is the number of units that
|
||
will be built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
droidInRange(PLAYER, X, Y, RANGE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when a
|
||
droid belonging to a player is within range of a position. PLAYER is the id of
|
||
the player whose unit is checked for in range. X, Y is the position to check
|
||
from in world coords. RANGE is in world coords - 128 units = 1 tile.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
droidInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function checks for when a
|
||
droid belonging to a player is in a square area. PLAYER is the id of the player
|
||
whose droid is checked for in area. X1, Y1, X2, Y2 is the area to check in
|
||
world coords. X1, Y1 should be smaller than X2, Y2.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
droidHasSeen(OBJECT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This functions checks for when a
|
||
player has seen a given object - either by unit or structure. OBJECT is any
|
||
type of DROID, FEATURE, STRUCTURE. PLAYER is the id of the player to check for
|
||
having seen.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
selectDroidByID(DROIDID, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This selects a unit defined by
|
||
the ID since we cannot guarantee the name! Only the list of units belonging to
|
||
PLAYER will be checked. This returns TRUE if the unit could be found - it will
|
||
be worth checking it exists! DROIDID is a valid unit defined by ID.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
InitEnumDroids(int targetPlayer, int lookingPlayer)</span></code><span
|
||
style='font-size:10.0pt;font-family:"Courier New";mso-fareast-font-family:"Courier New"'><br>
|
||
<code>DROID EnumDroid()</code></span></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Enumerate through all <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>'s
|
||
droids that are visible to <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>lookingPlayer</span></code>. Returns NULLOBJECT when no more
|
||
exist.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>anyDroidsLeft(PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>checks the specified player for
|
||
any units - returns TRUE if some exist, FALSE if they have all been destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>groupAddDroid(GROUP,
|
||
DROID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Add a unit to a group.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>groupAddArea(GROUP,
|
||
PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Add all the units inside the
|
||
rectangle X1, Y1, X2, Y2. Only units belonging to player PLAYER are added.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>groupAddAreaNoGroup(GROUP,
|
||
PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>as above but does not add units
|
||
that are already grouped.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>groupAddGroup(group1,
|
||
group2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Add all the units in group2 to
|
||
group1. All the units are removed from group2.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
hasGroup(DROID droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid</span></code> belongs
|
||
to any group, returns FALSE otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderDroid(DROID,
|
||
order)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give a unit an order currently
|
||
one of: </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_STOP</span></code>
|
||
- stop current order</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_RETREAT</span></code>
|
||
- retreat</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_DESTRUCT</span></code>
|
||
- self destruct</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_RTR</span></code>
|
||
- return to repair</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_RTB</span></code>
|
||
- return to base</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l6 level1 lfo23;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_RUN</span></code>
|
||
- run away for a bit (moral failure)</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderDroidLoc(DROID,
|
||
order, x, y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give a unit an order with a
|
||
location. </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l8 level1 lfo25;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_MOVE</span></code>
|
||
- move to location</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderDroidObj(DROID,
|
||
order, BASEOBJ)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give a unit an order with an
|
||
object. </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_ATTACK</span></code>
|
||
- attack the object</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_HELPBUILD</span></code>
|
||
- help construct the object</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_DEMOLISH</span></code>
|
||
- demolish structure</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_REPAIR</span></code>
|
||
- repair structure</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_OBSERVE</span></code>
|
||
- (sensor units) keep a target in sensor range</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_EMBARK</span></code>
|
||
- get onto a transporter</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l7 level1 lfo27;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_FIRESUPPORT</span></code>
|
||
- follow this sensor unit and attack anything it <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>DORDER_OBSERVE</span></code>'s</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderDroidStatsLoc(DROID,
|
||
int order, STRUCTURESTAT stats, int x, int y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give a unit an order with stats
|
||
and a location. </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l12 level1 lfo29;tab-stops:
|
||
list 36.0pt'><![if !supportLists]><span style='font-size:10.0pt;mso-bidi-font-size:
|
||
12.0pt;font-family:Symbol'><EFBFBD><span style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>DORDER_BUILD</span></code>
|
||
- build a structure at the location.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderGroup(GROUP,
|
||
order)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give all the units in the group
|
||
an order.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderGroupLoc(GROUP,
|
||
order, x, y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give all the units in the group
|
||
an order with a location.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>orderGroupObj(GROUP,
|
||
order, BASEOBJ)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Give all the units in the group
|
||
an order with an object.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setDroidSecondary(DROID
|
||
droid, int secondaryOrder, int secondaryState)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set the state of a secondary
|
||
order for a droid (values in <a href="#script_function_constants">Script
|
||
function constants</a>).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setGroupSecondary(GROUP
|
||
group, int secondaryOrder, int secondaryState)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set the state of a secondary
|
||
order for a group (values in <a href="#script_function_constants">Script
|
||
function constants</a>).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
idleGroup(GROUP group)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns number of units in group
|
||
not doing anything.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
groupMember(GROUP group, DROID droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns whether a unit is a
|
||
member of a group.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>initIterateGroup(GROUP
|
||
group)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Prepare a group to iterate
|
||
through the units in it.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID
|
||
iterateGroup(GROUP group)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get the next unit from the group.
|
||
Must be called after an initial initGroupIterate. To reset a group back to the
|
||
start call initGroupIterate.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>droidLeaveGroup(DROID
|
||
droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Make a unit leave the group it is
|
||
a member of (if any).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numDroidsInArea(PLAYER, X1, Y1, X2, Y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the number of player units
|
||
in an area.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>cmdDroidAddDroid(DROID
|
||
commander, DROID droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>adds the unit droid to the command
|
||
group of the command unit commander.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>cmdDroidMaxGroup(DROID
|
||
commander)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns max number of droids <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>commander</span></code> can
|
||
have in his group.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
vanishUnit(DROID droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Will remove <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid</span></code> from the
|
||
world without any graphical hoo ha.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID
|
||
takeOverSingleDroid(DROID droidToTakeOver, int playerToGain)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This replaces the existing droid
|
||
(droidToTakeOver) by a new one for the playerToGain. The new droid is passed
|
||
back to the script. Test for NULLOBJECT BEFORE calling this function.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
takeOverDroidsInArea(int fromPlayer, int toPlayer, int x1, int y1, int x2, int
|
||
y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'><code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>x1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x2</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y2</span></code> are in
|
||
world units. Checks for units belonging to <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>fromPlayer</span></code> and if they are in the area
|
||
they are given to the <code><span style='font-size:10.0pt;font-family:"Courier New"'>toPlayer</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
takeOverDroidsInAreaExp(int fromPlayer, int toPlayer, int x1, int y1, int x2,
|
||
int y2, int level, int max)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'><code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>x1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y1</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x2</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y2</span></code> are in
|
||
world units. Checks for units belonging to <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>fromPlayer</span></code> and if they are in the area
|
||
they are given to the <code><span style='font-size:10.0pt;font-family:"Courier New"'>toPlayer</span></code>.
|
||
If their experience level is less than or equal to <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>level</span></code>. <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>max</span></code> specifies
|
||
the maximum number of units to take over.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
resetDroidTargets()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Reset the unit preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setDroidTarPref(int type)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set prefered unit target types.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setDroidTarIgnore(int type)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set unit target ignore types.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID
|
||
droidTargetInArea(int targetPlayer, int visibleToPlayer, int x1, int y1, int
|
||
x2, int y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get a unit target in an area
|
||
using the preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>DROID
|
||
droidTargetOnMap(int targetPlayer, int visibleToPlayer)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get a unit target on the map
|
||
using the preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
getDroidCount(int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns the number of units on
|
||
the current map for the specified player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setDroidKills(DROID
|
||
droid, int kills)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the number of kills for a
|
||
unit. currently the level boundaries are:. 4, 8, 16, 32, 64, 128, 256, 512.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
killDroidsInArea(int x1, int y1, int x2, int y2, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Kills all the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>'s units
|
||
within the area defined. Returns how many it wiped out.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numEnemyWeapDroidsInRange(int lookingPlayer, int x, int y, int range, bool
|
||
includeVTOLs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of enemy military
|
||
droids at location <code><span style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>,
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>
|
||
and within <code><span style='font-size:10.0pt;font-family:"Courier New"'>range</span></code>.
|
||
Units belonging to <code><span style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
and his allies are ignored. If <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>includeVTOLs</span></code> is set to FALSE, then VTOLs are
|
||
ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>onlyFinishedStructs</span></code>
|
||
is set to TRUE, then unfinished structures will be ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numFriendlyWeapDroidsInRange(int lookingPlayer, int x, int y, int range, bool
|
||
includeVTOLs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return total number of friendly
|
||
military droids at location <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>y</span></code> and within <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>range</span></code>. Units belonging to enemies of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>
|
||
are ignored. If <code><span style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numPlayerWeapDroidsInRange(int targetPlayer, int lookingPlayer, int x, int y,
|
||
int range, bool includeVTOLs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns total number of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>targetPlayer</span></code>'s
|
||
military droids at location <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>x</span></code>, <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>y</span></code> and within <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>range</span></code> that are visible visible by <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>lookingPlayer</span></code>.
|
||
If <code><span style='font-size:10.0pt;font-family:"Courier New"'>includeVTOLs</span></code>
|
||
is set to FALSE, then VTOLs are ignored.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
selectDroid(DROID droid, bool select)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Depending on value of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>select</span></code> selects
|
||
or deselects droid <code><span style='font-size:10.0pt;font-family:"Courier New"'>droid</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
selectGroup(GROUP group, bool select)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Depending on value of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>select</span></code> selects
|
||
or deselects all droids belonging to group <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>group</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
calcDroidPower(DROID droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns cost of the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>boolisVtol(DROID
|
||
droid)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>droid</span></code> is a
|
||
vtol.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_templates">Templates</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>TEMPLATE
|
||
getTemplate(COMPONENT, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function returns the first
|
||
TEMPLATE based on the stat for the player it can find. It can be any type of
|
||
component. To use it create a TEMPLATE variable and assign it to the result of
|
||
the function call. For example: </p>
|
||
|
||
<pre style='margin-left:36.0pt'>TEMPLATE myNewTemplate;</pre><pre
|
||
style='margin-left:36.0pt'>WEAPON Rocket;</pre><pre style='margin-left:36.0pt'>myNewTemplate = getStructure(Rocket, 0);</pre>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This will look through the player
|
||
0 list of template to find one which contains a rocket and then return a
|
||
variable of type TEMPLATE. You will then be able to access its attributes. If a
|
||
template cannot be found than NULL is returned . It will be worth checking that
|
||
the TEMPLATE does not equal NULL before using it. For example: </p>
|
||
|
||
<pre style='margin-left:36.0pt'>if (myNewTemplate == NULLTEMPLATE)</pre><pre
|
||
style='margin-left:36.0pt'>{</pre><pre style='margin-left:36.0pt'> do something</pre><pre
|
||
style='margin-left:36.0pt'>}</pre>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
addTemplate(TEMPLATE, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Given a template, gives the player
|
||
the template so that build droid can be used. At least one player must have the
|
||
template.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
skCanBuildTemplate (int pl, STRUCTURE str, TEMPLATE tem)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>True when player pl can build
|
||
design <code><span style='font-size:10.0pt;font-family:"Courier New"'>tem</span></code>
|
||
with structure <code><span style='font-size:10.0pt;font-family:"Courier New"'>str</span></code>.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_research">Research</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>enableResearch(RESEARCHSTAT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function makes a research
|
||
topic available to a player regardless of its pre-requisites. RESEARCHSTAT is
|
||
defined by the name from Access. PLAYER is the id of the player who gets the
|
||
research.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>completeResearch(RESEARCHSTAT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function acts as if the
|
||
research was performed by the player giving them the results. RESEARCHSTAT is
|
||
defined by the name from Access. PLAYER is the id of the player who gets the
|
||
research.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
skDoResearch (STRUCTURE str, int pl, int bias)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Make player pl do some research
|
||
with structure <code><span style='font-size:10.0pt;font-family:"Courier New"'>str</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
pursueResearch(STRUCTURE resFac, int player, RESEARCH targetResearch)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Makes <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>resFac</span></code> start
|
||
researching the first prerequisite necessary for <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>targetResearch</span></code>. If no
|
||
prerequisites are left, then <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>targetResearch</span></code> will be researched. Must be called
|
||
again for the next prerequisite. <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>resFac</span></code> must be a valid research
|
||
facility. Returns TRUE if started researching, FALSE otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
numResearchLeft(int player, RESEARCH research)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns number of research topics
|
||
that are left for player <code><span style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>
|
||
to research in order for a certain research <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>research</span></code> to become available.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
researchFinished(RESEARCh research, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>player</span></code> has
|
||
researched <code><span style='font-size:10.0pt;font-family:"Courier New"'>research</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
researchStarted(RESEARCH research, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>research</span></code> is
|
||
currently being researched by <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>player</span></code>.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_components">Components</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>enableComponent(COMPONENT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function makes a component
|
||
found to a player - so that they can research a topic that requires the
|
||
component <code><span style='font-size:10.0pt;font-family:"Courier New"'>COMPONENT</span></code>
|
||
is any type of Body, Propulsion, Weapon, ECM, Sensor, Construct etc. PLAYER is
|
||
the id of the player who gets the component.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>makeComponentAvailable(COMPONENT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function makes a component
|
||
available to a player - so that they can build Units using this component. <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>COMPONENT</span></code> is
|
||
any type of Body, Propulsion, Weapon, ECM, Sensor, Construct etc. PLAYER is the
|
||
id of the player who gets the component.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>enableStructure(STRUCTURESTAT,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function makes a structure
|
||
available to a player - so that they can research a topic that requires the
|
||
structure or build the structure STRUCTURESTAT is defined by the name from
|
||
Access. PLAYER is the id of the player who gets the structure.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_power">Power</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>turnPowerOn()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Literally makes the power
|
||
calculations be used.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>turnPowerOff()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Literally stops the power
|
||
calculations being used.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setPowerLevel(POWER,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the power level for a player
|
||
- this overrides any current setting there is. <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>POWER</span></code> is the value to set the
|
||
player's power to. <code><span style='font-size:10.0pt;font-family:"Courier New"'>PLAYER</span></code>
|
||
is the id of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>addPower(POWER,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Adds the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>POWER</span></code> amount
|
||
to the <code><span style='font-size:10.0pt;font-family:"Courier New"'>PLAYER</span></code>'s
|
||
current level. <code><span style='font-size:10.0pt;font-family:"Courier New"'>POWER</span></code>
|
||
is the value to add to the player's power. <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>PLAYER</span></code> is the id of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
playerPower(int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns
|
||
aspower[player].currentPower (players current power)</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_environment_map">Environment/Map</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setSnow(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function switches snow on or
|
||
off. TRUE will turn snow on, FALSE will turn snow off. If rain is on when snow
|
||
is started the rain will be turned off.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setRain(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function switchs rain on or
|
||
off. TRUE will turn rain on, FALSE will turn rain off. If snow is on when rain
|
||
is started the snow will be turned off.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setBackgroundFog(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function switchs background
|
||
fog on or off. This sets the backdrop to the current fogcolour and fogs the
|
||
edge of the visible world. TRUE will turn background fog on, FALSE will turn
|
||
background fog off.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setDepthFog(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function switchs depth fog
|
||
on or off. This sets the sets fog ramping up from zero in the middle of the
|
||
view to full fog at the edge of the visible world. TRUE will turn depth fog on,
|
||
FALSE will turn depth fog off.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setFogColour(RED,
|
||
GREEN, BLUE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function sets the fog
|
||
colour, to be used when fog is enabled. This colour is also used in the
|
||
background clear when fog is enabled. The colour is specified as RED, GREEN and
|
||
BLUE components each in the range 0 to 255. This yields a 24 bit colour value.
|
||
Colour values outside the range 0 to 255 will have an indeterminate effect.</p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Warning: Setting the fog colour
|
||
to black (0, 0, 0) does not turn fog off and should be avoided.</p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Standard values: </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l11 level1 lfo31;tab-stops:
|
||
list 36.0pt'><![if !supportLists]><span style='font-size:10.0pt;mso-bidi-font-size:
|
||
12.0pt;font-family:Symbol'><EFBFBD><span style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]>Arizona: 204, 149, 70 (CC9546) (old: 176, 143, 95
|
||
(B08F5F))</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l11 level1 lfo31;tab-stops:
|
||
list 36.0pt'><![if !supportLists]><span style='font-size:10.0pt;mso-bidi-font-size:
|
||
12.0pt;font-family:Symbol'><EFBFBD><span style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]>Urban: 201, 146, 15 (C9920F)</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l11 level1 lfo31;tab-stops:
|
||
list 36.0pt'><![if !supportLists]><span style='font-size:10.0pt;mso-bidi-font-size:
|
||
12.0pt;font-family:Symbol'><EFBFBD><span style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]>Rockies: 182, 225, 236 (B6E1EC)</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setScrollParams(minX,
|
||
minY, maxX, maxY)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This literally sets the scroll
|
||
settings for the current map - be careful not to set the maxX/maxY greater than
|
||
that possible for the map! minX, minY, maxX, maxY are all numbers. These are in
|
||
TILE COORDINATES!!!!!!.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setScrollMinX(minX)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This just sets the one variable.
|
||
These are in TILE COORDINATES!!!!!! minX is a number.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setScrollMinY(minY)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This just sets the one variable.
|
||
These are in TILE COORDINATES!!!!!! minY is a number.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setScrollMaxX(maxX)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This just sets the one variable.
|
||
These are in TILE COORDINATES!!!!!! maxX is a number.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setScrollMaxY(maxY)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This just sets the one variable.
|
||
These are in TILE COORDINATES!!!!!! maxY is a number.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setDefaultSensor(SENSOR,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This sets which sensor will be
|
||
used as the default when designing units in game for the specified player. The
|
||
SENSOR must be a valid DEFAULT sensor.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setDefaultECM(ECM,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Like the above functionm, this
|
||
sets which ECM will be used as the default when designing units. Again the ECM
|
||
must be a valid DEFAULT ECM.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>initAllNoGoAreas()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Initialises all the no go areas
|
||
to 0. Should be called when a new map is loaded.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setNoGoArea(x1,
|
||
y1, x2, y2, areaNum)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Defines an area that cannot be
|
||
built on - used for enemy landing zones. areaNum is a number between 0 and 7.
|
||
If 0, then this function is the same as calling setlandingZone.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setTransporterExit(PLAYER,
|
||
exitTileX, exitTiley)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Setup transporter exit point on
|
||
map for PLAYER.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>flyTransporterIn(PLAYER,
|
||
entryTileX, entryTileY, bool bTrackTransporter)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>flys <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>PLAYER</span></code>'s
|
||
transporter in from entry point on map; set <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>bTrackTransporter</span></code> true to track it
|
||
onto the map.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setLandingZone(x1,
|
||
y1, x2, y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the landing zone for the
|
||
map. The coords are in tile units and must all be less than 255.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setLimboLanding(x1,
|
||
y1, x2, y2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the landing zone for the
|
||
Limbo Units. The coords are in tile units and must all be less than 255. The
|
||
units from the Limbo list are then placed at this location - so call in CALL_GAME_INIT
|
||
of the mission you want them to appear in.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setWaterTile(int tileNum)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the tile to use for
|
||
underwater. Count from the top of the tileset pcx - presently 17 for arizona.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
getPlayerColour(int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns the colour of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setPlayerColour(int colour, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the colour to use for the <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>
|
||
specified - <code><span style='font-size:10.0pt;font-family:"Courier New"'>colour</span></code>
|
||
must be 0 to (MAX_PLAYERS-1).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
fireWeaponAtLoc(WEAPON weap, int x, int y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Fire a single shot of the weapon
|
||
weap at the location x, y.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
applyLimitSet (void)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Apply the limits set in the
|
||
structure limits screen.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
fogTileInRange(ref int tileX, ref int tileY, int x, int y, int rangeX, int
|
||
rangeY, int searchRange, int player, int threatRange)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Fills <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>tileX</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>tileY</span></code> with coordinates
|
||
of the unrevealed location in range with starting location <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>, range <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>searchRange</span></code>
|
||
and closest to location <code><span style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>,
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>.
|
||
If <code><span style='font-size:10.0pt;font-family:"Courier New"'>searchRange</span></code>
|
||
is -1, then entire map is being searched. <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>player</span></code> is the player who is looking
|
||
for an unrevealed map location. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>threatRange</span></code> != -1 then also checks for
|
||
enemy presence. Locations with enemy presence are ignored then. Returns TRUE if
|
||
any locations satisfying the search conditions were found, returns FALSE
|
||
otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
mapRevealedInRange(int x, int y, int range, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if there are no
|
||
unrevealed tiles left in locations for player <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>player</span></code> with center <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>, <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>y</span></code> and radius <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code>. All
|
||
coordinates are in world units.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_game_states">Game states</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>tutorialEnd()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>A bit of a hack to notify the
|
||
game when the last of the tutorial events has been run so that the console
|
||
messages can be turned back on to how they will appear for the rest of the
|
||
game.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>gameOver(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>function to call for ending the
|
||
game. bool - true or false depending on whether the player has won or not.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>startMission(MISSION_TYPE,
|
||
LEVEL)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Starts a mission for the
|
||
currently selected player - NB Transporters must be filled if you want units to
|
||
appear on the Mission map. MISSION_TYPE is a predefined type - see <a
|
||
href="#script_function_constants">Script function constants</a>. LEVEL is the
|
||
name of the level to load as defined in GameDesc.lev.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>endMission(bool)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Ends the current mission the
|
||
selected player is on - returns all Units that have been loaded onto the
|
||
Transporter. False if player lost, true if player won????.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
myResponsibility(PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if this machine is
|
||
responsible for <code><span style='font-size:10.0pt;font-family:"Courier New"'>PLAYER</span></code>
|
||
in multiplayer games.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setMissionTime(int
|
||
time)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Used to specify how long an OffWorld
|
||
mission will last for - used in conjunction with the callback CALL_MISSION_TIME
|
||
so that end conditions can be displayed if the player has not managed to finish
|
||
the mission. If time < 0, there is no limit. Time is in 10th of a second.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
missionTimeRemaining()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns how long left for the
|
||
current mission. If the mission time has not been set it will return 0. The
|
||
value returned is in 10ths of a second.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setReinforcementTime(int
|
||
time)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this defines how long it will
|
||
take for reinforcements to arrive for an OffWorld mission. If time < 0,
|
||
there can be no reinforcements. Time is in 10th of a second. Set time to
|
||
LZ_COMPROMISED_TIME to display '--:--' to indicate the Transporter is unable to
|
||
land.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
getGameStatus(int StatusRequired)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Gets the status of some of the
|
||
game TRUE/FALSE variables. Can be used to find if the reticule is up or the
|
||
battle map is open, that sort of thing. Examples: </p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo33;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>getGameStatus(STATUS_ReticuleIsOpen);</span></code>
|
||
will return TRUE if the reticule is open (on screen) or FALSE if the reticule
|
||
is not (disabled)</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo33;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>getGameStatus(STATUS_BattleMapViewEnabled);</span></code>
|
||
will return TRUE if we are in the battle map mode</p>
|
||
|
||
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
||
margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo33;tab-stops:list 36.0pt'><![if !supportLists]><span
|
||
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'><EFBFBD><span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span><![endif]><code><span style='font-size:10.0pt;font-family:"Courier New"'>getGameStatus(STATUS_DeliveryResposInProgress);</span></code>
|
||
will return TRUE if we are repositioning the delivery point</p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>These are currently the only two
|
||
options implemented ... for other game modes (like design screen or
|
||
intelligence map modes) use the externed variable intMode.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>resetPlayerVisibility(int
|
||
player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Reset the visibility for a
|
||
player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
resetLimboMission(void)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This can only be called mid Limbo
|
||
Expand mission - the units that were stored in the mission list at the start of
|
||
the mission are added back into the map, and the mission type is changed to an
|
||
Expand Mission.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
skDifficultyModifier(int pl)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Apply the frontend slider
|
||
settings to player pl.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>string
|
||
getPlayerName(int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns in-game name of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
setPlayerName(int player, string newName)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set player's name to <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>newName</span></code>.
|
||
Returns TRUE on success.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_diplomacy">Diplomacy</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
allianceExists()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if two or more
|
||
players are in alliance. returns false otherwise.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
dominatingAlliance()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if there is a single
|
||
dominating alliance, using all multi-players.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
playerInAlliance()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true if player is in an
|
||
alliance.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>createAlliance(int
|
||
player1, int player2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Create an alliance between two
|
||
players.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>breakAlliance(int
|
||
player1, int player2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Breake an alliance between two
|
||
players.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
offerAlliance (int p1, int p2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Make p1 offer p2 an alliance.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
allianceExistsBetween (int p1, int p2)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>True if alliance exists between
|
||
p1 and p2.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
alliancesLocked()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if the game does not
|
||
allow to break alliances (i. e. when team mode is on).</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_strategy">Strategy</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>int
|
||
getThreatInArea(int playerLooking, int playerTarget, int x1, int y1, int x2,
|
||
int y2, int ldThreat, int mdThreat, int hdThreat)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns the threat value of all
|
||
units of a specified player within a certain area for a specified player. The
|
||
user can 'calibrate' this threat value by specifying the relative weights
|
||
attached to the threats of small, medium and heavy units respectively as the
|
||
last three parameters to this function. The final boolean parameter allows the
|
||
user to say whether they care about whether or not the units in question are presently
|
||
visible. TRUE means they only add to the threat if <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>PlayerLooking</span></code>
|
||
can see this unit (owned by <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>playerTarget</span></code>), FALSE means they add to the threat
|
||
if even they cannot see that unit.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
isHumanPlayer (int pl)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns true is pl is human.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
skVtolEnableCheck(int pl)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>True when player <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>pl</span></code> is actively
|
||
using vtols.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
threatInRange(int player, int rangeX, int rangeY, int range, bool includeVTOLs)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Returns TRUE if there is a danger
|
||
for <code><span style='font-size:10.0pt;font-family:"Courier New"'>player</span></code>
|
||
at location x/y within radius <code><span style='font-size:10.0pt;font-family:
|
||
"Courier New"'>range</span></code>. If <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>includeVTOLs</span></code> is set to FALSE then
|
||
VTOLs are ignored. All coordinates are in world units. If <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>range</span></code> == -1
|
||
then entire map will be searched.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_gui"><acronym>GUI</acronym></h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>addReticuleButton(BUTTONID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function adds a reticule
|
||
button to the interface. BUTTONID is the id of a button - see <a
|
||
href="#script_function_constants">Script function constants</a>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>removeReticuleButton(BUTTONID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This function removes a reticule
|
||
button from the interface. BUTTONID is the id of a button - see <a
|
||
href="#script_function_constants">Script function constants</a>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>addMessage(INTMESSAGE,
|
||
MESSAGETYPE, PLAYER, PLAY_IMMEDIATE)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This adds a message to the
|
||
interface for the PLAYER. INTMESSAGE is a variable defined in the values file.
|
||
MESSAGETYPE is a predefined type - see <a href="#script_function_constants">Script
|
||
function constants</a>. PLAYER is the player who gets the message.
|
||
PLAY_IMMEDIATE is a bool for whether to bring the Intelligence Screen up with
|
||
the message immediately or just store it.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>removeMessage(INTMESSAGE,
|
||
MESSAGETYPE, PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This removes a message from the
|
||
interface for the PLAYER. INTMESSAGE is a variable defined in the values file.
|
||
MESSAGETYPE is a predefined type - see <a href="#script_function_constants">Script
|
||
function constants</a>. PLAYER is the player who loses the message.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>flashOn(int
|
||
buttonID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>turn on flashing for a button
|
||
(ids in <a href="#script_function_constants">Script function constants</a>).
|
||
Works for all buttons not just reticule buttons.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>flashOff(int
|
||
buttonID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>turn off flashing for a button.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setRadarZoom(int
|
||
level)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>level is the zoom level between 0
|
||
.. 2 on the PC and 0 .. 1 on PSX. 0 is the most zoomed out, 2 the most zoomed
|
||
in. 2 is mapped to 1 if the script is run on the PSX.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
dropBeacon (string msg, int forPlayer, int, fromPlayer, int x, int y, int z)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Put a flashing beacon on the map
|
||
for player <code><span style='font-size:10.0pt;font-family:"Courier New"'>forPlayer</span></code>
|
||
on position <code><span style='font-size:10.0pt;font-family:"Courier New"'>x</span></code>,
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>y</span></code>,
|
||
<code><span style='font-size:10.0pt;font-family:"Courier New"'>z</span></code>.
|
||
Unless removed manually the beacon is removed automatically from the map after
|
||
a timeout.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
removeBeacon (int forPlayer, int fromPlayer)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Remove a previously placed beacon
|
||
from the map.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_multimedia">Multimedia</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>playSound(SOUND,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Plays a '2D' sound i. e. speech
|
||
and is audible for the player identified. SOUND is a defined type. PLAYER is
|
||
the id of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>playSoundPos(SOUND,
|
||
PLAYER, x, y, z)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Plays a '2D' sound i. e. speech
|
||
and is audible for the player identified. Position of sound is saved so camera
|
||
can move to object playing sound if required. SOUND is a defined type. PLAYER
|
||
is the id of the player. x, y, z is the position of the object in game units.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>addConsoleText(TEXTSTRING,
|
||
PLAYER)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Adds console text to the top of
|
||
the screen (centre justified) for the player concerned. <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>TEXTSTRING</span></code> is
|
||
a string ID obtained from strings.txt. <code><span style='font-size:10.0pt;
|
||
font-family:"Courier New"'>PLAYER</span></code> is the id of the player.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>flushConsoleMessages()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Clear all the console messages.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
console(string message)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Outputs <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>message</span></code> to
|
||
game console.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
msg(string message, int playerFrom, int playerTo)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sends a chat message from <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>playerFrom</span></code> to <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>playerTo</span></code>.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="sf_unsorted">Unsorted</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setRetreatPoint(PLAYER,
|
||
x, y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the position for a players
|
||
units to retreat to.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setGroupRetreatPoint(GROUP
|
||
group, int x, int y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Set the retreat position for a
|
||
group.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setRetreatForce(int
|
||
player, int level)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the percentage of the
|
||
current force below which units for a side will retreat.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setGroupRetreatForce(GROUP
|
||
group, int level)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the percentage of the
|
||
current force below which units for a side will retreat.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setRetreatLeadership(int
|
||
player, int level)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the leadership level (chance
|
||
to run away) for a player (1-100).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>setGroupRetreatLeadership(GROUP
|
||
group, int level)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Sets the leadership level (chance
|
||
to run away) for a player (1-100).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>bool
|
||
getNearestGateway(int x, int y, ref rX, ref rY)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Puts the coordinates of the
|
||
nearest gateway into reference variables rX and rY. It might not though if
|
||
there are no gateways on the present map. So make sure you look at the return
|
||
value. If it is FALSE, then the values in rX and rY will be meaningless - unchanged
|
||
actually, assuming the scripting works this way. Otherwise, they will be the
|
||
coordinates of the midpoint of the nearest gateway.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>initIterateCluster(int
|
||
clusterID)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get ready to iterate a cluster.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BASEOBJ
|
||
iterateCluster()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Return the next object in the cluster
|
||
or NULLOBJ if none left.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>BASEOBJ
|
||
targetInCluster(int clusterID, int visibleToPlayer)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Get a target from a cluster using
|
||
the preferences.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>traceOn()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>View the script debug info to
|
||
stdout.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>traceOff()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Stop viewing the script debug
|
||
info to stdout.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>centreViewPos(int
|
||
x, int y)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Center the view on the world
|
||
coordinates x, y.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
setEventTrigger(EVENT event, TRIGGER newTrigger)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Assigns <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>newTrigger</span></code> as
|
||
new trigger for event <code><span style='font-size:10.0pt;font-family:"Courier New"'>event</span></code>.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="debugging_script_functions">Appendix B: Debugging script functions</h2>
|
||
|
||
<p>The following functions can be used to debug Warzone 2100 AI scripts.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
dbgMsgOn(int player, bool on)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Depending on the value of <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>on</span></code> turns
|
||
on/off debug output of dbg() and ASSERT() function which are listed below.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
dbg(string debugMessage, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Outputs <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>debugMessage</span></code>
|
||
to the game console if debug output for player <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>player</span></code> was previously turned on
|
||
with dbgMsgOn().</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
ASSERT(bool assertExpression, string assertMessage, int player)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>If <code><span style='font-size:
|
||
10.0pt;font-family:"Courier New"'>assertExpression</span></code> evaluates to
|
||
FALSE, then <code><span style='font-size:10.0pt;font-family:"Courier New"'>assertMessage</span></code>
|
||
is output to the game console. Must turn on debug output for <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>player</span></code> with <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>dbgMsgOn()</span></code>
|
||
first. <span class=note1>NOTE: In debug game builds failed assertion will cause
|
||
game assertion.</span>.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
debug(string debugText)</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Writes <code><span
|
||
style='font-size:10.0pt;font-family:"Courier New"'>debugText</span></code> to
|
||
the standart output (usually a log file).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>void
|
||
printCallStack()</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Outputs script call stack to the
|
||
standard log file.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="script_function_constants">Appendix C: Script function constants</h2>
|
||
|
||
<p>These values are used to represent numbers that are constant throughout the
|
||
game.</p>
|
||
|
||
<p>NULLOBJECT- used to check that a BASEOBJECT/FEATURE/STRUCTURE has been
|
||
assigned by a function</p>
|
||
|
||
<p>NULLTEMPLATE- used to check that a TEMPLATE has been assigned by a function</p>
|
||
|
||
<p>NULLSTAT- used to check that a BASESTAT has been assigned by a function</p>
|
||
|
||
<p>BARBARIAN1- this can used to represent enemy1 (PC:player 6, PSX:player2)</p>
|
||
|
||
<p>BARBARIAN2- this can used to represent enemy2 (PC:player 7, PSX:player3)</p>
|
||
|
||
<p>BUTTONID - these values are used when a particular reticule button needs to
|
||
be identified</p>
|
||
|
||
<p>OPTIONs - NOTE - this currently references the command button</p>
|
||
|
||
<p>CANCEL</p>
|
||
|
||
<p>BUILD</p>
|
||
|
||
<p>MANUFACTURE</p>
|
||
|
||
<p>RESEARCH</p>
|
||
|
||
<p>INTELMAP</p>
|
||
|
||
<p>DESIGN</p>
|
||
|
||
<p>COMMAND</p>
|
||
|
||
<p>- When flashing an icon - with scrFlashOn() scrFlashOff()</p>
|
||
|
||
<p>you can additional use</p>
|
||
|
||
<p>IDRET_OPTIONS</p>
|
||
|
||
<p>IDRET_CANCEl</p>
|
||
|
||
<p>IDRET_BUILD</p>
|
||
|
||
<p>IDRET_MANUFACTURE</p>
|
||
|
||
<p>IDRET_RESEARCH</p>
|
||
|
||
<p>IDRET_INTEL_MAP</p>
|
||
|
||
<p>IDRET_DESIGN</p>
|
||
|
||
<p>IDRET_COMMAND</p>
|
||
|
||
<p>IDDES_TEMPLSTART</p>
|
||
|
||
<p>IDDES_SYSTEMBUTTON</p>
|
||
|
||
<p>IDDES_BODYBUTTON</p>
|
||
|
||
<p>IDDES_PROPBUTTON</p>
|
||
|
||
<p>MESSAGETYPE - these values are used when a type of message needs to be
|
||
identified</p>
|
||
|
||
<p>RES_MSG</p>
|
||
|
||
<p>CAMP_MSG</p>
|
||
|
||
<p>MISS_MSG</p>
|
||
|
||
<p>PROX_MSG</p>
|
||
|
||
<p>Multiplayer alliance types:</p>
|
||
|
||
<p>NO_ALLIANCES- alliances are disallowed</p>
|
||
|
||
<p>ALLIANCES- alliances are allowed</p>
|
||
|
||
<p>ALLIANCES_TEAMS- team mode, locked alliances</p>
|
||
|
||
<p>MISSIONTYPE - these values are used when a type of mission needs to be
|
||
identified</p>
|
||
|
||
<p>CAMP_START - used for the starting point of a campaign</p>
|
||
|
||
<p>CAMP_EXPAND - used to expand a current campaign map</p>
|
||
|
||
<p>OFF_KEEP - used to load up an off world map, but keeping access</p>
|
||
|
||
<p>to factories and research facilities back at home base</p>
|
||
|
||
<p>OFF_CLEAR - used to load up an off world map, but having no access to home
|
||
base</p>
|
||
|
||
<p>LZ_COMPROMISED_TIME- value to set the reinforcement time with to display
|
||
'--:--'</p>
|
||
|
||
<p>when the Transporter is unable to land</p>
|
||
|
||
<p>Droid Orders:</p>
|
||
|
||
<p>DORDER_NONE- no order assigned</p>
|
||
|
||
<p>DORDER_STOP- stop current order</p>
|
||
|
||
<p>DORDER_RETREAT- retreat</p>
|
||
|
||
<p>DORDER_DESTRUCT- self destruct</p>
|
||
|
||
<p>DORDER_RTR- return to repair</p>
|
||
|
||
<p>DORDER_RTB- return to base</p>
|
||
|
||
<p>DORDER_RUN- run away for a bit (moral failure)</p>
|
||
|
||
<p>DORDER_MOVE- move to location</p>
|
||
|
||
<p>DORDER_ATTACK- attack the object</p>
|
||
|
||
<p>DORDER_HELPBUILD- help construct the object</p>
|
||
|
||
<p>DORDER_DEMOLISH- demolish structure</p>
|
||
|
||
<p>DORDER_REPAIR- repair structure</p>
|
||
|
||
<p>DORDER_OBSERVE- (sensor units) keep a target in sensor range</p>
|
||
|
||
<p>DORDER_EMBARK- get onto a transporter</p>
|
||
|
||
<p>DORDER_FIRESUPPORT- follow this sensor unit and attack anything it
|
||
DORDER_OBSERVE's</p>
|
||
|
||
<p>DORDER_SCOUT- same as move, but stop if enemy units are encountered.</p>
|
||
|
||
<p>Unit secondary orders:</p>
|
||
|
||
<p>DSO_ATTACK_RANGE</p>
|
||
|
||
<p>DSO_REPAIR_LEVEL</p>
|
||
|
||
<p>DSO_ATTACK_LEVEL</p>
|
||
|
||
<p>DSO_RECYCLE</p>
|
||
|
||
<p>DSO_PATROL- patrol between current pos and next move target</p>
|
||
|
||
<p>DSO_HALTTYPE- what to do when stopped</p>
|
||
|
||
<p>DSO_RETURN_TO_LOC- return to various locations</p>
|
||
|
||
<p>Unit secondary states:</p>
|
||
|
||
<p>DSS_ARANGE_SHORT</p>
|
||
|
||
<p>DSS_ARANGE_LONG</p>
|
||
|
||
<p>DSS_ARANGE_DEFAULT</p>
|
||
|
||
<p>DSS_REPLEV_LOW- Medium Damage Taken</p>
|
||
|
||
<p>DSS_REPLEV_HIGH- Heavy Damage Taken</p>
|
||
|
||
<p>DSS_REPLEV_NEVER- Never Repair</p>
|
||
|
||
<p>DSS_ALEV_ALWAYS</p>
|
||
|
||
<p>DSS_ALEV_ATTACKED</p>
|
||
|
||
<p>DSS_ALEV_NEVER</p>
|
||
|
||
<p>DSS_PATROL_SET(0 to clear)</p>
|
||
|
||
<p>DSS_HALT_HOLD</p>
|
||
|
||
<p>DSS_HALT_GUARD</p>
|
||
|
||
<p>DSS_HALT_PERSUE</p>
|
||
|
||
<p>DSS_RECYCLE_SET(0 to clear)</p>
|
||
|
||
<p>DSS_RTL_REPAIR(0 to clear)</p>
|
||
|
||
<p>DSS_RTL_BASE(0 to clear)</p>
|
||
|
||
<p>DSS_RTL_TRANSPORT(0 to clear)</p>
|
||
|
||
<p>Button ID's:</p>
|
||
|
||
<p>IDRET_OPTIONS- option button</p>
|
||
|
||
<p>IDRET_BUILD- build button</p>
|
||
|
||
<p>IDRET_MANUFACTURE- manufacture button</p>
|
||
|
||
<p>IDRET_RESEARCH- research button</p>
|
||
|
||
<p>IDRET_INTEL_MAP- intelligence map button</p>
|
||
|
||
<p>IDRET_DESIGN- design units button</p>
|
||
|
||
<p>IDRET_CANCEL- central cancel button</p>
|
||
|
||
<p>Unit types:</p>
|
||
|
||
<p>DROID_WEAPON- Weapon unit</p>
|
||
|
||
<p>DROID_SENSOR- Sensor unit</p>
|
||
|
||
<p>DROID_ECM- ECM unit</p>
|
||
|
||
<p>DROID_CONSTRUCt - Constructor unit</p>
|
||
|
||
<p>DROID_PERSON- person</p>
|
||
|
||
<p>DROID_CYBORG- cyborg/super cyborg</p>
|
||
|
||
<p>DROID_TRANSPORTER- guess what this is!</p>
|
||
|
||
<p>DROID_COMMAND- Command unit</p>
|
||
|
||
<p>DROID_REPAIR- Repair Unit</p>
|
||
|
||
<p>DROID_CYBORG_CONSTRUCT- Cyborg engineer</p>
|
||
|
||
<p>DROID_CYBORG_REPAIR- Cyborg mechanic</p>
|
||
|
||
<p>Structure types:</p>
|
||
|
||
<p>REF_HQ</p>
|
||
|
||
<p>REF_FACTORY</p>
|
||
|
||
<p>REF_FACTORY_MODULe</p>
|
||
|
||
<p>REF_POWER_GEN</p>
|
||
|
||
<p>REF_POWER_MODULE</p>
|
||
|
||
<p>REF_RESOURCE_EXTRACTOR</p>
|
||
|
||
<p>REF_DEFENSE</p>
|
||
|
||
<p>REF_WALL</p>
|
||
|
||
<p>REF_WALLCORNER- corner wall - no gun</p>
|
||
|
||
<p>REF_RESEARCh</p>
|
||
|
||
<p>REF_RESEARCH_MODULe</p>
|
||
|
||
<p>REF_REPAIR_FACILITY</p>
|
||
|
||
<p>REF_COMMAND_CONTROL- control centre for command units</p>
|
||
|
||
<p>REF_CYBORG_FACTORY</p>
|
||
|
||
<p>REF_VTOL_FACTORY</p>
|
||
|
||
<p>REF_REARM_PAD</p>
|
||
|
||
<p>REF_MISSILE_SILO</p>
|
||
|
||
<p>Multiplayer Game Types:</p>
|
||
|
||
<p>SKIRMISH</p>
|
||
|
||
<p>DMATCH</p>
|
||
|
||
<p>CAMPAIGN</p>
|
||
|
||
<p>TEAMPLAY</p>
|
||
|
||
<p>MultiPlayer Base Configurtations:</p>
|
||
|
||
<p>CAMP_CLEAN- build units only</p>
|
||
|
||
<p>CAMP_BASE- small base</p>
|
||
|
||
<p>CAMP_WALLS- defensive base</p>
|
||
|
||
<p>Cursor Mode (possible values of cursorType):</p>
|
||
|
||
<p>IMAGE_CURSOR_SELECT</p>
|
||
|
||
<p>IMAGE_CURSOR_ATTACK</p>
|
||
|
||
<p>IMAGE_CURSOR_MOVE</p>
|
||
|
||
<p>IMAGE_CURSOR_JAM</p>
|
||
|
||
<p>IMAGE_CURSOR_PICKUP</p>
|
||
|
||
<p>IMAGE_CURSOR_DEFAULT</p>
|
||
|
||
<p>IMAGE_CURSOR_SEEKREPAIR</p>
|
||
|
||
<p>IMAGE_CURSOR_BUILD</p>
|
||
|
||
<p>IMAGE_CURSOR_GUARD</p>
|
||
|
||
<p>IMAGE_CURSOR_BRIDGE</p>
|
||
|
||
<p>IMAGE_CURSOR_ATTACH</p>
|
||
|
||
<p>IMAGE_CURSOR_LOCKON</p>
|
||
|
||
<p>IMAGE_CURSOR_FIX</p>
|
||
|
||
<p>IMAGE_CURSOR_EMBARK</p>
|
||
|
||
<p>Game mode - possible values for intMode external variable</p>
|
||
|
||
<p>int_NORMAL- Standard mode (just the reticule)</p>
|
||
|
||
<p>int_OPTION- Option screen</p>
|
||
|
||
<p>int_EDITSTAT- Stat screen up for placing objects</p>
|
||
|
||
<p>int_EDIT- Edit mode</p>
|
||
|
||
<p>int_OBJECT- Object screen</p>
|
||
|
||
<p>int_STAT- Object screen with stat screen</p>
|
||
|
||
<p>int_CMDORDER- Object screen with command units and orders screen</p>
|
||
|
||
<p>int_DESIGN- Design screen</p>
|
||
|
||
<p>int_INTELMAP- Intelligence Map</p>
|
||
|
||
<p>int_ORDER</p>
|
||
|
||
<p>int_INGAMEOP- in game options.</p>
|
||
|
||
<p>int_TRANSPORTER- Loading/unloading a Transporter</p>
|
||
|
||
<p>int_MISSIONRES- Results of a mission display.</p>
|
||
|
||
<p>int_MULTIMENU- multiplayer only, player stats etc...</p>
|
||
|
||
<p>Possible options for getGameStatus():</p>
|
||
|
||
<p>STATUS_ReticuleIsOpen- returns true is the reticule is open</p>
|
||
|
||
<p>STATUS_BattleMapViewEnabled- returns true if we are in battlemap mode</p>
|
||
|
||
<p>Possible values for targetedObjectType:</p>
|
||
|
||
<p>MT_TERRAIN</p>
|
||
|
||
<p>MT_RESOURCE</p>
|
||
|
||
<p>MT_BLOCKING</p>
|
||
|
||
<p>MT_RIVER</p>
|
||
|
||
<p>MT_TRENCH</p>
|
||
|
||
<p>MT_OWNSTRDAM</p>
|
||
|
||
<p>MT_OWNSTROK</p>
|
||
|
||
<p>MT_OWNSTRINCOMP</p>
|
||
|
||
<p>MT_REPAIR</p>
|
||
|
||
<p>MT_REPAIRDAM</p>
|
||
|
||
<p>MT_ENEMYSTR</p>
|
||
|
||
<p>MT_TRANDROID</p>
|
||
|
||
<p>MT_OWNDROID</p>
|
||
|
||
<p>MT_OWNDROIDDAM</p>
|
||
|
||
<p>MT_ENEMYDROID</p>
|
||
|
||
<p>MT_COMMAND</p>
|
||
|
||
<p>MT_ARTIFACT</p>
|
||
|
||
<p>MT_DAMFEATURE</p>
|
||
|
||
<p>MT_SENSOR</p>
|
||
|
||
<p>MT_WRECKFEATURE</p>
|
||
|
||
<p>Structure Target preference types:</p>
|
||
|
||
<p>ST_HQ</p>
|
||
|
||
<p>ST_FACTORY</p>
|
||
|
||
<p>ST_POWER_GEN</p>
|
||
|
||
<p>ST_RESOURCE_EXTRACTOR</p>
|
||
|
||
<p>ST_WALL</p>
|
||
|
||
<p>ST_RESEARCH</p>
|
||
|
||
<p>ST_REPAIR_FACILITY</p>
|
||
|
||
<p>ST_COMMAND_CONTROL</p>
|
||
|
||
<p>ST_CYBORG_FACTORY</p>
|
||
|
||
<p>ST_VTOL_FACTORY</p>
|
||
|
||
<p>ST_REARM_PAD</p>
|
||
|
||
<p>ST_SENSOR</p>
|
||
|
||
<p>ST_DEF_GROUND</p>
|
||
|
||
<p>ST_DEF_AIR</p>
|
||
|
||
<p>ST_DEF_IDF</p>
|
||
|
||
<p>ST_DEF_ALL- ground/air/idf structures</p>
|
||
|
||
<p>Unit target preference types:</p>
|
||
|
||
<p>turret types:</p>
|
||
|
||
<p>DT_COMMAND</p>
|
||
|
||
<p>DT_SENSOR</p>
|
||
|
||
<p>DT_CONSTRUCT</p>
|
||
|
||
<p>DT_REPAIR</p>
|
||
|
||
<p>DT_WEAP_GROUND</p>
|
||
|
||
<p>DT_WEAP_AIR</p>
|
||
|
||
<p>DT_WEAP_IDF</p>
|
||
|
||
<p>DT_WEAP_ALL- ground/air/idf units</p>
|
||
|
||
<p>Body types:</p>
|
||
|
||
<p>DT_LIGHT</p>
|
||
|
||
<p>DT_MEDIUM</p>
|
||
|
||
<p>DT_HEAVY</p>
|
||
|
||
<p>DT_SUPER_HEAVy - transporter only</p>
|
||
|
||
<p>Propulsion:</p>
|
||
|
||
<p>DT_TRACK</p>
|
||
|
||
<p>DT_HTRACK</p>
|
||
|
||
<p>DT_WHEEL</p>
|
||
|
||
<p>DT_LEGS</p>
|
||
|
||
<p>DT_GROUND</p>
|
||
|
||
<p>DT_VTOL</p>
|
||
|
||
<p>DT_HOVER</p>
|
||
|
||
<p>Group types:</p>
|
||
|
||
<p>GT_NORMAL</p>
|
||
|
||
<p>GT_COMMAND</p>
|
||
|
||
<p>GT_TRANSPORTER</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="script_function_externals">Appendix D: Script function externals</h2>
|
||
|
||
<p>These represent variables that are defined in the game which can be accessed
|
||
in the scripts. It will only be possible to set the value that is held for some
|
||
of the variables.</p>
|
||
|
||
<p>mapWidth- (get) - field to hold the width of the map</p>
|
||
|
||
<p>mapHeight- (get) - field to hold the height of the map</p>
|
||
|
||
<p>gameInitialised- (get) flag to specify when all initialisation has been
|
||
performed for the game - use it in place of a bool i. e. can be considered to
|
||
equal true or false</p>
|
||
|
||
<p>selectedPlayer- (get) field to hold the currently selected player</p>
|
||
|
||
<p>gameTime- (get) the current time in the game (in 1/10 sec)</p>
|
||
|
||
<p>multiPlayerGameType - (get) the type of multiplayer game underway.</p>
|
||
|
||
<p>multiPlayerMaxPlayers - max number of human players in this game.(see
|
||
constants for return values)</p>
|
||
|
||
<p>multiPlayerBaseType - campaign game base type. (see constants for return
|
||
values)</p>
|
||
|
||
<p>multiPlayerAlliancesType- (get) alliance type (eg NO_ALLIANCES etc, see <a
|
||
href="#script_function_constants">Script function constants</a>)</p>
|
||
|
||
<p>scrollX- (get/set) field to hold the starting x coordinate where the player
|
||
can scroll</p>
|
||
|
||
<p>scrollY- (get/set) field to hold the starting y coordinate where the player
|
||
can scroll</p>
|
||
|
||
<p>scrollWidth- (get/set) field to hold the width the player can scroll</p>
|
||
|
||
<p>scrollHeight- (get/set) field to hold the height the player can scroll</p>
|
||
|
||
<p>cursorType- (get) - Gets the current mode that the cursor is in (e.g.
|
||
IMAGE_CURSOR_BUILD ... see <a href="#script_function_constants">Script function
|
||
constants</a>)</p>
|
||
|
||
<p>intMode- (get) - Get the current game mode (e.g. int_DESIGN when the design
|
||
screen is active) ... see <a href="#script_function_constants">Script function
|
||
constants</a>)</p>
|
||
|
||
<p>targetedObjectType- (get) - The type of the object currently under the
|
||
cursor (one of MT_... see <a href="#script_function_constants">Script function
|
||
constants</a>)</p>
|
||
|
||
<p>boolextraVictoryFlag- use to mark additional victory conditions have been
|
||
met - reset to FALSE at start of each level</p>
|
||
|
||
<p>boolextraFailFlag- use to mark additional failure conditions have been met -
|
||
reset to FALSE at start of each level</p>
|
||
|
||
<p>GameLevel(get/set) - set single player difficulty.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<h2 id="script_function_callbacks">Appendix E: Script function callbacks</h2>
|
||
|
||
<p>These are used in the place of a trigger and are for events that are to be
|
||
called at specific times in the game. They will cause the event they are
|
||
associated with to be called every time unless the trigger for the event is set
|
||
to inactive.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_GAMEINIT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when the game
|
||
has initialised.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DROIDDESIGNED</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when the player
|
||
saves a template design.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DROIDBUILT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a unit has
|
||
been built via a factory.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_POWERGEN_BUILT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a Power
|
||
generatot has been built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_RESEX_BUILT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a Resource
|
||
Extractor has been built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_RESEARCH_BUILT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a Research
|
||
Facility has been built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_FACTORY_BUILT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a Factory
|
||
has been built.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_MISSION_START</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when CTRL + 'M'
|
||
is pressed so that the script can start a mission.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_MISSION_END</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when CTRL + 'B'
|
||
is pressed so that the script can end a mission.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_VIDEO_QUIT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when the
|
||
CURRENT video sequence is over, either end of anim or when 'ESC' has been
|
||
pressed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_LAUNCH_TRANSPORTER</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when the
|
||
'Launch' button is pressed on the Transporter interface.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_START_NEXT_LEVEL</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a new
|
||
level is desired.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_TRANSPORTER_REINFORCE</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when a
|
||
transporter carrying reinforcements for player 0 enters the map.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_MISSION_TIME</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>this is triggered when the time
|
||
specified by setMissionTime() has elapsed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_ELECTRONIC_TAKEOVER</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a unit or a
|
||
structure for the selectedPlayer are taken over using Electronic weapons.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="callbacks_with_parameters">Callbacks with parameters</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_RESEARCHCOMPLETED,
|
||
ref RESEARCHSTAT, ref STRUCTURE</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>This is triggered when a research
|
||
topic is complete - major or minor.. RESEARCHSTAt is the research topic that
|
||
was complete, STRUCTURE is research facility that has completed research.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_NEWDROID,
|
||
player, ref DROID, ref STRUCTURE</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a unit for player
|
||
is built by a factory. DROID is the unit that was built. structure is the
|
||
factory that built it, do not assume that the factory is still there!!.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_STRUCT_ATTACKED,
|
||
player, ref STRUCTURE, ref BASEOBJ</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a structure for
|
||
player is attacked. STRUCTURE is the attacked structure, . BASEOBJ is the unit
|
||
that attacked the structure (could be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DROID_ATTACKED,
|
||
player, ref DROID, ref BASEOBJ</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a unit for player
|
||
is attacked. DROID is the attacked unit, . BASEOBJ is the unit that attacked
|
||
(could be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_ATTACKED,
|
||
player, ref BASEOBJ, ref BASEOBJ</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a structure or
|
||
unit for player is attacked. BASEOBJ is the attacked unit, . BASEOBJ is the
|
||
unit that attacked (could be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_TRANSPORTER_OFFMAP,
|
||
player</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a transporter for
|
||
player exits the map.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_TRANSPORTER_LANDED,
|
||
GROUP, player</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when transporter for
|
||
player lands; units on transporter are unloaded. into the given GROUP.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="tutorial_callbacks">Tutorial Callbacks</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_BUILDLIST</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Build structures interface up.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_BUILDGRID</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Place structure cursor up.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_RESEARCHLIST</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Choose research interface up.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_MANURUN</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Number of units to manufacture
|
||
has changed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_MANULIST</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Choose manufacturing interface
|
||
up.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_BUTTON_PRESSED,
|
||
buttonID</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when an interface
|
||
button with id buttonID is pressed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_QUIT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when the design screen
|
||
is closed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_OBJ_DESTROYED,
|
||
int player, ref BASEOBJ object</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when either a unit or a
|
||
structure for player is destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DROID_DESTROYED,
|
||
int player, ref DROID droid</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a unit for player
|
||
is destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_STRUCT_DESTROYED,
|
||
int player, ref STRUCTURE structure</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a structure for
|
||
player is destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_FEATURE_DESTROYED,
|
||
ref FEATURe feature</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when either a unit or a
|
||
structure for player is destroyed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_OBJ_SEEN,
|
||
int player, ref BASEOBj object, ref BASEOBJ viewer</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when either a unit or a
|
||
structure is seen by a unit belonging to player.. object is the thing that was
|
||
seen, viewer is the thing that saw it (may be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DROID_SEEN,
|
||
int player, ref BASEOBJ object, ref BASEOBJ viewer</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a unit is seen by
|
||
a unit belonging to player.. object is the thing that was seen, viewer is the
|
||
thing that saw it (may be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_STRUCT_SEEN,
|
||
int player, ref BASEOBJ object, ref BASEOBJ viewer</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>triggered when a structure is
|
||
seen by a unit belonging to player.. object is the thing that was seen, viewer
|
||
is the thing that saw it (may be NULLOBJECT).</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_NO_REINFORCEMENTS_LEFT</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>called when the player has
|
||
transferred all reinforcements from one level to the next.</p>
|
||
|
||
<p><a href="#top">back to top</a><o:p></o:p></p>
|
||
|
||
<h3 id="tutorial_callbacks_tutonly">Tutorial callbacks (tutorial only)</h3>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_WEAPON</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>a weapon button pressed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_SYSTEM</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>a system
|
||
(constructor/ecm/sensor/etc) button pressed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_COMMAND</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>a command droid turret pressed.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_BODY</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>a body selected.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_DESIGN_PROPULSION</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>a propulsion selected.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_ALL_ONSCREEN_DROIDS_SELECTED</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>does exactly when it says on the
|
||
box.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_UNITTAKEOVER,
|
||
ref unit</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Unit has been taken over by nexus
|
||
link.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_PLAYERLEFT,
|
||
ref int player</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>Player has left the multiplayer
|
||
game.</p>
|
||
|
||
<p class=MsoNormal><code><span style='font-size:10.0pt;font-family:"Courier New"'>CALL_ALLIANCEOFFER,
|
||
ref int one, ref int two</span></code></p>
|
||
|
||
<p class=MsoNormal style='margin-left:36.0pt'>One offers two an alliance.</p>
|
||
|
||
<p><a href="#top">back to top</a></p>
|
||
|
||
|
||
<div class=MsoNormal align=center style='text-align:center'>
|
||
|
||
<hr size=2 width="100%" align=center>
|
||
|
||
</div>
|
||
|
||
|
||
<p>Warzone2100. Script language notes.</p>
|
||
|
||
<p>Original Author: Pumpkin Studios. 1999</p>
|
||
|
||
<p>Last Author: $Author$</p>
|
||
|
||
<p>Last update: $Date$, $Revision$, <a href="http://wz2100.net/">Warzone 2100
|
||
Resurrection Project</a></p>
|
||
|
||
<p>Note from Pumpkin Studios: making any modifications to Warzone 2100 will
|
||
void any technical support open to you. We will not answer questions or help
|
||
you in any way if you have modified Warzone 2100. Pumpkin Studios and Eidos
|
||
will not take responsibility for any damage resulting from modifcation of
|
||
Warzone 2100.<o:p></o:p></p>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</body>
|
||
|
||
</html>
|