This file is indexed.

/usr/share/doc/warzone2100/ScriptingManual.htm is in warzone2100-data 3.1~rc2-1ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
<!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 &quot;.c&quot; 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 -&gt; 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 &quot;myScript.slo&quot;</pre><pre>run</pre><pre>{</pre><pre> &lt;variable_definitions&gt;</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>&lt;variable_name&gt; &lt;variable_type&gt; &lt;variable_value&gt;</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 &quot;Python&quot;
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 &quot;Body11ABT&quot;</pre>

<p>&quot;Body11ABT&quot; is an internal name of the &quot;Python&quot; 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 &quot;R-Vehicle-Body11&quot;</pre><pre>myResearch[1] RESEARCHSTAt &quot;R-Vehicle-Prop-Tracks&quot;</pre><pre>myResearch[2] RESEARCHSTAt &quot;R-Vehicle-Prop-Hover&quot;</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>&lt;storage&gt; &lt;variable_type&gt; &lt;variable_name1&gt; [, &lt;variable_name2&gt;, ...];</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 &quot;&quot;, 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 &lt;event_name&gt;(&lt;trigger&gt;)</pre><pre>{</pre><pre> &lt;code&gt;</pre><pre>}</pre>

<p>Example:</p>

<pre>event myFirstEvent(every, 50)</pre><pre>{</pre><pre> console(&quot;Hello world!&quot;);</pre><pre>}</pre>

<p>This piece of code will output &quot;Hello world!&quot; 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 (&quot;this text will be printed every second&quot;);</pre><pre> if((gameTime / 10) &gt; 60) //did more than a minute pass?</pre><pre><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</pre><pre><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span> exit; //anything that comes after 'exit' will not be executed</pre><pre><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span> console(&quot;this text will only get printed in the first&quot;);</pre><pre><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </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 &lt;event_name&gt;;</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(&quot;It all compiles, because I was declared beforehand!&quot;);</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,
  &lt;time&gt;</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"'>&lt;time&gt;</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,
  &lt;time&gt;</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"'>&lt;time&gt;</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"'>&lt;callback&gt;</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"'>&lt;bool
  exp&gt;, &lt;time&gt;</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"'>&lt;bool exp&gt;</span></code> is true, checking
  every <code><span style='font-size:10.0pt;font-family:"Courier New"'>&lt;time&gt;</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(&lt;event&gt;, &lt;trigger&gt;)</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(&quot;The game has started &quot; + gameTime/10 + &quot; seconds ago&quot;);</pre><pre>}</pre><pre><![if !supportEmptyParas]>&nbsp;<![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(&quot;Someone has just reactivated me!&quot;);</pre><pre>}</pre><pre><![if !supportEmptyParas]>&nbsp;<![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(&quot;We got a new droid at coordinates &quot; &amp;</pre><pre><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>newDroid.x &amp; &quot;-&quot; &amp; 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 &lt;trigger_name&gt; (&lt;trigger&gt;);</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]>&nbsp;<![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"'>&quot;some text inside quotation marks is a legal
string&quot;</span></code>.</p>

<p>Strings can be easily concatenated using the <code><span style='font-size:
10.0pt;font-family:"Courier New"'>&amp;</span></code> operator.</p>

<p>For example: <code><span style='font-size:10.0pt;font-family:"Courier New"'>&quot;String1&quot;
&amp; &quot;String2&quot;</span></code> will result in
&quot;String1String2&quot;.</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(&quot;value of pi is &quot; &amp; pi &amp; &quot;, value of myInteger is &quot; &amp; myInteger &amp; &quot;, </pre><pre>value of myString is &quot; &amp; myString &amp; &quot;, value of myBool is &quot; &amp; 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"'>&lt;</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"'>&gt;</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"'>&lt;=</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"'>&gt;=</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 = &quot;some text&quot;;</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 (&lt;bool exp&gt;)</pre><pre>{</pre><pre> &lt;code&gt;</pre><pre>}</pre>

<p>In this form if <code><span style='font-size:10.0pt;font-family:"Courier New"'>&lt;bool
exp&gt;</span></code> evaluates to true then the script code <code><span
style='font-size:10.0pt;font-family:"Courier New"'>&lt;code&gt;</span></code>
is executed, otherwise the code is ignored.</p>

<p>Examples:</p>

<pre>if (&lt;bool exp&gt;)</pre><pre>{</pre><pre> &lt;code&gt;</pre><pre>}</pre><pre>else</pre><pre>{</pre><pre> &lt;other code&gt;</pre><pre>}</pre><pre><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></pre><pre>if (&lt;bool exp&gt;)</pre><pre>{</pre><pre> &lt;code&gt;</pre><pre>}</pre><pre>else if (&lt;other bool exp&gt;)</pre><pre>{</pre><pre> &lt;other code&gt;</pre><pre>}</pre><pre>else</pre><pre>{</pre><pre> &lt;yet another code&gt;</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"'>&lt;code&gt;</span></code>
to be executed while <code><span style='font-size:10.0pt;font-family:"Courier New"'>&lt;bool
exp&gt;</span></code> evaluates to TRUE:</p>

<pre>while (&lt;bool exp&gt;)</pre><pre>{</pre><pre> &lt;code&gt;</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 &lt;return type&gt; &lt;function name&gt; ([ &lt;argument type&gt; &lt; argument name&gt;, ... ])</pre><pre>{</pre><pre> &lt;code&gt;</pre><pre> return ... ;</pre><pre>}</pre>

<p>Examples:</p>

<pre>function void displayVictoryMessage(int winner)</pre><pre>{</pre><pre> console (&quot;Player &quot; &amp; getPlayerName(winner) &amp; &quot; has won the game&quot;);</pre><pre>}</pre><pre><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></pre><pre>function float calculateMinimum (float f1, float f2)</pre><pre>{</pre><pre> if (f1 &lt; f2)</pre><pre> {</pre><pre><span style="mso-spacerun: yes">&nbsp; </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(&quot;Minimum of 2 and 2.1 is &quot; &amp; calculateMinimum(2.0, 2.1));</pre>

<p>Like in C <code><span style='font-size:10.0pt;font-family:"Courier New"'>return
&lt;return expression&gt;;</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 &lt;variable type&gt; &lt;variable name&gt; [, &lt;variablename&gt;, ...] ;</pre>

<p>Example:</p>

<pre>event myEvent(myTrigger)</pre><pre>{</pre><pre> local int count;</pre><pre> &lt;code&gt;</pre><pre>}</pre><pre><![if !supportEmptyParas]>&nbsp;<![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> &lt;code&gt;</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 &lt;macro name&gt; &lt;macro body&gt;</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 &quot;define&quot; 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: &quot;#include&quot; 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-&lt;number&gt;, 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: &#8730;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> &#8805; 0 &#8869; <code><span
style='font-size:10.0pt;font-family:"Courier New"'>damage</span></code> &#8804; 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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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 &lt; 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 &lt; 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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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>