-
-
Notifications
You must be signed in to change notification settings - Fork 525
/
ScriptingManual.htm
executable file
·4457 lines (3310 loc) · 201 KB
/
ScriptingManual.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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>