mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Compare commits
1640 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6d9c9d8cf | ||
|
|
7f572a1a9b | ||
|
|
68007306b3 | ||
|
|
0c3f97370c | ||
|
|
d62025dfe0 | ||
|
|
6bc766e95f | ||
|
|
07009630c6 | ||
|
|
c2aeb1ebcd | ||
|
|
865042a843 | ||
|
|
6243137d4c | ||
|
|
f00d0dc871 | ||
|
|
8695953d5a | ||
|
|
6afb68390b | ||
|
|
d6adcdf8bd | ||
|
|
8151700ad7 | ||
|
|
2c192fba30 | ||
|
|
97f11c93bb | ||
|
|
a3102a7381 | ||
|
|
d41b5e8ede | ||
|
|
a45856c925 | ||
|
|
f531fdaa70 | ||
|
|
f4b2f07656 | ||
|
|
81f8e84ca4 | ||
|
|
f7e64d98bc | ||
|
|
d74de11b8b | ||
|
|
4380c1be2e | ||
|
|
30f2097d7a | ||
|
|
db2d4e97a6 | ||
|
|
f903844059 | ||
|
|
b4653be54e | ||
|
|
68b2b452cc | ||
|
|
e2b6efde7a | ||
|
|
668d120d60 | ||
|
|
3eea17bc76 | ||
|
|
2894bcc833 | ||
|
|
7543f31c85 | ||
|
|
ff52197707 | ||
|
|
56d84e7b25 | ||
|
|
b025abaa88 | ||
|
|
ed2d3d856b | ||
|
|
dac637f360 | ||
|
|
1e5c3a3c21 | ||
|
|
861588205a | ||
|
|
37d5b6a0fc | ||
|
|
4d3fb2990e | ||
|
|
c58a954d18 | ||
|
|
cce878e759 | ||
|
|
0d481afa16 | ||
|
|
2dbad7cb1b | ||
|
|
016875d724 | ||
|
|
7a0fa629b5 | ||
|
|
5df0d60135 | ||
|
|
aee7bd8bb6 | ||
|
|
e77d61c4cb | ||
|
|
b1a40407b3 | ||
|
|
504142c585 | ||
|
|
0496571c92 | ||
|
|
62a0adce5a | ||
|
|
d1a1be1a9e | ||
|
|
80011f4e4e | ||
|
|
80df849d18 | ||
|
|
c2933b6bed | ||
|
|
fc4ba9f21d | ||
|
|
e74c79b5d6 | ||
|
|
f738ddfca8 | ||
|
|
5bbd122fa4 | ||
|
|
af45b0d709 | ||
|
|
928c20c867 | ||
|
|
4bd36a4786 | ||
|
|
e746617139 | ||
|
|
3105f7407d | ||
|
|
2f568bca17 | ||
|
|
ad7dba6fac | ||
|
|
9efe0fe243 | ||
|
|
2836d7a40f | ||
|
|
f1bf62e3c1 | ||
|
|
a560d65ce7 | ||
|
|
9de3cb73f7 | ||
|
|
757cc86a68 | ||
|
|
aeb1664134 | ||
|
|
2af1483724 | ||
|
|
b7702ab933 | ||
|
|
cc14f82e85 | ||
|
|
f23dd0a5dd | ||
|
|
5aea17e20e | ||
|
|
8336b744bb | ||
|
|
ad9eaea010 | ||
|
|
9c47e35d54 | ||
|
|
284a770daa | ||
|
|
16030d4fa1 | ||
|
|
37d2dd17d7 | ||
|
|
ccd190a8b1 | ||
|
|
36bf2436b6 | ||
|
|
19f6a8d8f6 | ||
|
|
b8e09afcce | ||
|
|
24264bd885 | ||
|
|
ed690ee6e9 | ||
|
|
872bb3d775 | ||
|
|
c0dcd12ada | ||
|
|
d36cd8e284 | ||
|
|
5d98672de5 | ||
|
|
eab643268f | ||
|
|
e2fa1f992b | ||
|
|
9356794112 | ||
|
|
bb865aef38 | ||
|
|
35c24810f9 | ||
|
|
875b5fb34d | ||
|
|
19187bcb14 | ||
|
|
ebe6e9fb9f | ||
|
|
a54944b021 | ||
|
|
5f7f75b1c9 | ||
|
|
bc9938d08a | ||
|
|
59963e152d | ||
|
|
b77f179acc | ||
|
|
e768ec3c17 | ||
|
|
90d20076c9 | ||
|
|
c307de67c2 | ||
|
|
a1fc18fd48 | ||
|
|
a962841528 | ||
|
|
8ecfb52c61 | ||
|
|
b9828fb713 | ||
|
|
09073244ad | ||
|
|
3c82e6700d | ||
|
|
69176c118f | ||
|
|
50bbea327b | ||
|
|
7ae98ef5f9 | ||
|
|
bbc539fac6 | ||
|
|
df93ca309c | ||
|
|
c1958b62ff | ||
|
|
6e27877949 | ||
|
|
a3864d5f32 | ||
|
|
9dc9b21b16 | ||
|
|
ef27584d0b | ||
|
|
4cb784cc18 | ||
|
|
ed82a4715d | ||
|
|
6a21db24c8 | ||
|
|
16655cf070 | ||
|
|
1802d0dc29 | ||
|
|
fc2a820a34 | ||
|
|
cb4eccf57f | ||
|
|
38e10331c9 | ||
|
|
d1b4f63eb7 | ||
|
|
2e82793c3b | ||
|
|
d17d263fa3 | ||
|
|
40053670ea | ||
|
|
e301efc690 | ||
|
|
e77bf1f10e | ||
|
|
ee37a325d4 | ||
|
|
4a36eea5e6 | ||
|
|
27b9f32758 | ||
|
|
37540bbbfb | ||
|
|
a63a15db1c | ||
|
|
f14457380f | ||
|
|
0369aa8080 | ||
|
|
4c8b367644 | ||
|
|
4f64ae6057 | ||
|
|
76294f11e4 | ||
|
|
da8ce95adf | ||
|
|
23697f4fe3 | ||
|
|
b4ceafca50 | ||
|
|
cc247a0f03 | ||
|
|
1c24580d3f | ||
|
|
801e03551f | ||
|
|
5dd4435b7d | ||
|
|
01bfd8e141 | ||
|
|
9d84042ce8 | ||
|
|
a63a8c78a8 | ||
|
|
e4a8c36754 | ||
|
|
37cbf212f7 | ||
|
|
c59bf3f334 | ||
|
|
9f581ee660 | ||
|
|
ba2bfd5599 | ||
|
|
fb31c25ab7 | ||
|
|
8effa153b0 | ||
|
|
086f687e32 | ||
|
|
8ae8c94b27 | ||
|
|
500fe37ac4 | ||
|
|
03cd390baf | ||
|
|
72303ffbad | ||
|
|
1f721ff9b4 | ||
|
|
e3f780fda7 | ||
|
|
490bfe6a46 | ||
|
|
50a38cf2a4 | ||
|
|
c2aa57c603 | ||
|
|
51e703326e | ||
|
|
273170b4f4 | ||
|
|
61e6ffa76c | ||
|
|
041cd238df | ||
|
|
d07107d937 | ||
|
|
5172ca7536 | ||
|
|
10088879ce | ||
|
|
42a9333c53 | ||
|
|
70622413dc | ||
|
|
ccf3093fe8 | ||
|
|
5596fab8e0 | ||
|
|
c3193fd6df | ||
|
|
124262667e | ||
|
|
d2d0659776 | ||
|
|
bb90ac58ba | ||
|
|
e32d6138b3 | ||
|
|
90a6b6216e | ||
|
|
f0e01845d3 | ||
|
|
8087c87027 | ||
|
|
a813f8299f | ||
|
|
de2bba63a5 | ||
|
|
e758a0418a | ||
|
|
31b76da69d | ||
|
|
e5bf7f104d | ||
|
|
c4738b24eb | ||
|
|
b47ba61762 | ||
|
|
0aff4bf98c | ||
|
|
15996b43e6 | ||
|
|
c73d8a6339 | ||
|
|
b6b99a2e99 | ||
|
|
d35c941748 | ||
|
|
cfc8312b21 | ||
|
|
c040d2fa3f | ||
|
|
04f2f7d34f | ||
|
|
5d6951ae11 | ||
|
|
f6b4e81111 | ||
|
|
c8da1277de | ||
|
|
91a0e992cd | ||
|
|
b890dc22a3 | ||
|
|
214cd3748c | ||
|
|
703589d8e4 | ||
|
|
379c31b28a | ||
|
|
6fb931a055 | ||
|
|
8a89ed5857 | ||
|
|
87b866eca1 | ||
|
|
b5d1cee96b | ||
|
|
6557a6cf0b | ||
|
|
0128381f4f | ||
|
|
4511a68a2b | ||
|
|
9ecaca365f | ||
|
|
e6aa341863 | ||
|
|
504e56e827 | ||
|
|
3595afe0cc | ||
|
|
cfc0cc66b2 | ||
|
|
2442adfd2f | ||
|
|
a833703731 | ||
|
|
0b21cb687e | ||
|
|
af85745433 | ||
|
|
ef58cae59f | ||
|
|
8a21fe80de | ||
|
|
86fc8db9e6 | ||
|
|
7bc7fee6d7 | ||
|
|
46c5b50077 | ||
|
|
5c54f47527 | ||
|
|
51eb3a2e82 | ||
|
|
d9aad161b0 | ||
|
|
fea2098c40 | ||
|
|
03f8b1e301 | ||
|
|
ec8bfb32b4 | ||
|
|
d298ed2a83 | ||
|
|
515ac2c060 | ||
|
|
6a31e47705 | ||
|
|
e6dda35f3d | ||
|
|
70e4454fa9 | ||
|
|
82b4f4ee58 | ||
|
|
925233709b | ||
|
|
0af15699f3 | ||
|
|
9d2896d088 | ||
|
|
5b596516fe | ||
|
|
036cc9d211 | ||
|
|
df6c97bec8 | ||
|
|
c7e73f3b1a | ||
|
|
ccc7b431dc | ||
|
|
079e60163d | ||
|
|
29fb03e903 | ||
|
|
6e917049af | ||
|
|
e6484c1598 | ||
|
|
c8d49916df | ||
|
|
32297da2b0 | ||
|
|
336ac9eddb | ||
|
|
1d64ac3469 | ||
|
|
26adb7934e | ||
|
|
c51a6da5ff | ||
|
|
5629a8fcd6 | ||
|
|
65c7b0d12f | ||
|
|
1a0e2e0ea1 | ||
|
|
f74c0e29a5 | ||
|
|
9f8e7f4f3c | ||
|
|
b215d0e7d4 | ||
|
|
6f3d9a497a | ||
|
|
13b272b6e5 | ||
|
|
f9031dba42 | ||
|
|
ead7844e5f | ||
|
|
29a4f7c160 | ||
|
|
d25d89afbb | ||
|
|
55a9c7e020 | ||
|
|
e30fb1c9bd | ||
|
|
84dd1fa21c | ||
|
|
64039ae770 | ||
|
|
42979093b8 | ||
|
|
0aa78ec0c8 | ||
|
|
edf7f4677c | ||
|
|
8958d7b71f | ||
|
|
6083191f32 | ||
|
|
34698a1b4e | ||
|
|
8e0446c594 | ||
|
|
083bedcc2d | ||
|
|
aad17f97fc | ||
|
|
6a83b48429 | ||
|
|
77a1150037 | ||
|
|
19ff7ce9a0 | ||
|
|
86508d49ee | ||
|
|
7e20a0a0dc | ||
|
|
58139b34a8 | ||
|
|
9ceb26c7b1 | ||
|
|
0058383e64 | ||
|
|
1549ca1cc4 | ||
|
|
7abb6680b4 | ||
|
|
9ca30fc00c | ||
|
|
9479b338c5 | ||
|
|
b6ac1e86e4 | ||
|
|
a4b187d561 | ||
|
|
335bd897d5 | ||
|
|
1ba1738aa0 | ||
|
|
c8cdbeac5c | ||
|
|
4b12b04840 | ||
|
|
c571d32d0e | ||
|
|
897a0d4f40 | ||
|
|
7229439d84 | ||
|
|
1be62b9c4e | ||
|
|
30fd2230b0 | ||
|
|
b350243e50 | ||
|
|
50ff9f162a | ||
|
|
e94a918bbe | ||
|
|
af261048a6 | ||
|
|
042b82d3a6 | ||
|
|
2fc2f5d798 | ||
|
|
ba41d6421d | ||
|
|
faadbdecfb | ||
|
|
62ef56684b | ||
|
|
21b5823bc0 | ||
|
|
81c38d2221 | ||
|
|
a994942a02 | ||
|
|
1033b975f8 | ||
|
|
bd6d23c7f8 | ||
|
|
f15e89e7aa | ||
|
|
7bb5e324f9 | ||
|
|
209149b8de | ||
|
|
b701fa61fa | ||
|
|
97abe32f75 | ||
|
|
11a05f1333 | ||
|
|
ef7d354109 | ||
|
|
f5551e202d | ||
|
|
796b71474b | ||
|
|
662412dd02 | ||
|
|
8cdf8677c1 | ||
|
|
e1706c94af | ||
|
|
97c1653614 | ||
|
|
07dc55b284 | ||
|
|
cc925271aa | ||
|
|
753cbaa2b9 | ||
|
|
b8f7cf44cc | ||
|
|
7d6f9fc4b5 | ||
|
|
f9f0a8e866 | ||
|
|
fe6d69fdcc | ||
|
|
af17265efc | ||
|
|
12b8740bad | ||
|
|
5e62791837 | ||
|
|
b60435fb2c | ||
|
|
754430ba75 | ||
|
|
85fc601a7a | ||
|
|
1d5f9cc4cc | ||
|
|
08745c910c | ||
|
|
1d8658122a | ||
|
|
344eff535a | ||
|
|
f4ae0c9547 | ||
|
|
4bddf16c82 | ||
|
|
cc414862a4 | ||
|
|
26d0f2f4e3 | ||
|
|
e010a13f85 | ||
|
|
cffca96755 | ||
|
|
97635f4bba | ||
|
|
a6568a955f | ||
|
|
2657c3aa52 | ||
|
|
7bac0f32fc | ||
|
|
17b1e08532 | ||
|
|
987f613aae | ||
|
|
dead785133 | ||
|
|
c225456cd4 | ||
|
|
3ea3dfb486 | ||
|
|
7dec189358 | ||
|
|
9df6467cd1 | ||
|
|
dd7c1a9245 | ||
|
|
593f21bd3b | ||
|
|
da8a02465e | ||
|
|
639c5bc71a | ||
|
|
f022c87f25 | ||
|
|
5d8260b28e | ||
|
|
d432ec8105 | ||
|
|
7a24b491e9 | ||
|
|
efca40d481 | ||
|
|
0e40dc70b2 | ||
|
|
52452b45b1 | ||
|
|
b9bfd781d0 | ||
|
|
662885aaa6 | ||
|
|
f1c03e1b86 | ||
|
|
5d67009b18 | ||
|
|
4ffe6a04c2 | ||
|
|
dfca4d8bec | ||
|
|
0bd245aee5 | ||
|
|
fe730da72f | ||
|
|
4179e63e30 | ||
|
|
b1f3cda7f7 | ||
|
|
522c5e4eaa | ||
|
|
1e9608de3a | ||
|
|
04b4f7cc0f | ||
|
|
00b8c39455 | ||
|
|
cd0e4bfb04 | ||
|
|
ad882dd72e | ||
|
|
d4d0dcec61 | ||
|
|
2a33aa029d | ||
|
|
c72f96be19 | ||
|
|
e7f270630c | ||
|
|
29a3c0d554 | ||
|
|
6df872eed2 | ||
|
|
bbae343b0e | ||
|
|
5f5b781f04 | ||
|
|
8e99f37306 | ||
|
|
65aeb56c2f | ||
|
|
47ad79b81d | ||
|
|
956035b856 | ||
|
|
c0ac5d1487 | ||
|
|
f8852ca759 | ||
|
|
2f957899e1 | ||
|
|
9b26ed7042 | ||
|
|
05b547b640 | ||
|
|
afa8d9c4d1 | ||
|
|
672f1ae2d6 | ||
|
|
0b607eb751 | ||
|
|
89d945037d | ||
|
|
235cbbe23a | ||
|
|
f771607f40 | ||
|
|
2cf7047617 | ||
|
|
1beb5934c2 | ||
|
|
5d00a2d806 | ||
|
|
5adb943939 | ||
|
|
13309663fb | ||
|
|
4baa593fde | ||
|
|
186b64ea81 | ||
|
|
c9fd56116e | ||
|
|
e21240e711 | ||
|
|
99d32a7854 | ||
|
|
620df5ad3e | ||
|
|
b9cb6dbffb | ||
|
|
be85aab755 | ||
|
|
fcb7a2c3e7 | ||
|
|
483cf09676 | ||
|
|
8ca9c4e7b8 | ||
|
|
bd28c10492 | ||
|
|
355230a97f | ||
|
|
bde5859879 | ||
|
|
630e02f1ce | ||
|
|
1ea2f091e0 | ||
|
|
7aa252e42f | ||
|
|
a52df9ae9a | ||
|
|
1b072e11ad | ||
|
|
0dec9418ca | ||
|
|
9a2174ac2b | ||
|
|
371b100672 | ||
|
|
eac87c97af | ||
|
|
00dc9969b6 | ||
|
|
f3ec69ac2a | ||
|
|
8a6cbeda74 | ||
|
|
13cdb77957 | ||
|
|
caedc314b7 | ||
|
|
d7963bb161 | ||
|
|
e86afefe79 | ||
|
|
d4daa54210 | ||
|
|
5c3081a7eb | ||
|
|
b66ff35b63 | ||
|
|
6ae2f6f105 | ||
|
|
c4deb317bd | ||
|
|
ada8629c01 | ||
|
|
efd48c87e9 | ||
|
|
35c1a76675 | ||
|
|
edf445de1a | ||
|
|
5b1cc052b6 | ||
|
|
ebb58cd976 | ||
|
|
e32b393f39 | ||
|
|
3d073891bc | ||
|
|
078137af4b | ||
|
|
0172772ead | ||
|
|
fa3a805172 | ||
|
|
b7ef0e57ab | ||
|
|
5881aa0ad3 | ||
|
|
755dde8e10 | ||
|
|
1856f89cf9 | ||
|
|
fc5d540ec6 | ||
|
|
032e73d382 | ||
|
|
5bf70d9950 | ||
|
|
94ca67feb9 | ||
|
|
1ef50f45f1 | ||
|
|
d76cd91d50 | ||
|
|
d7fd9d0968 | ||
|
|
9e112e6f2c | ||
|
|
a51329d3e7 | ||
|
|
7a19a81985 | ||
|
|
e359640bfd | ||
|
|
b3f7991269 | ||
|
|
1f18b6e2a9 | ||
|
|
43bc4ba681 | ||
|
|
b34597d732 | ||
|
|
503ca091f9 | ||
|
|
08ebcbf11d | ||
|
|
7239e2c5fa | ||
|
|
a7fcc95b71 | ||
|
|
66d00331ae | ||
|
|
5746213850 | ||
|
|
d9cfaaaa0d | ||
|
|
a472c4b3f8 | ||
|
|
1f220cab3e | ||
|
|
1e954de951 | ||
|
|
c36dbe1b09 | ||
|
|
93e344732c | ||
|
|
d291e7417d | ||
|
|
ad155ab071 | ||
|
|
ab56f903c2 | ||
|
|
04b2e9459d | ||
|
|
fd63edad37 | ||
|
|
6e12e8f9b9 | ||
|
|
bf82cd9e2a | ||
|
|
b952161794 | ||
|
|
b2e3e23182 | ||
|
|
13c0a42d5b | ||
|
|
a734cb8a7e | ||
|
|
7d708339a5 | ||
|
|
43e30ce426 | ||
|
|
fdfc21187c | ||
|
|
59c5acc1f2 | ||
|
|
1c293c2f62 | ||
|
|
0ad2226e47 | ||
|
|
5246647d62 | ||
|
|
1f74899f8a | ||
|
|
e97a5493e4 | ||
|
|
fa3e73e577 | ||
|
|
15cee84695 | ||
|
|
7c483b4bb6 | ||
|
|
9f2f1c7de7 | ||
|
|
62b2a9197b | ||
|
|
3b139a92fb | ||
|
|
e3e101b8ff | ||
|
|
525a11d21d | ||
|
|
eef41c067d | ||
|
|
48a0400213 | ||
|
|
48b20299b2 | ||
|
|
50094894aa | ||
|
|
e355a2f6d5 | ||
|
|
a1151584e1 | ||
|
|
25a5e821ef | ||
|
|
969a658e15 | ||
|
|
a66ad1f086 | ||
|
|
29ff59b128 | ||
|
|
fe2e257dc0 | ||
|
|
11551a9816 | ||
|
|
d5b7fdab24 | ||
|
|
7bd03d55ba | ||
|
|
d23347e14e | ||
|
|
e5112597a2 | ||
|
|
24271e6780 | ||
|
|
fb16a29392 | ||
|
|
5dd8bec6b9 | ||
|
|
5ee190602e | ||
|
|
02aee6f936 | ||
|
|
da45ee201e | ||
|
|
c4d8b64713 | ||
|
|
c90c5c3bfc | ||
|
|
5d9fc356e0 | ||
|
|
b03add80c6 | ||
|
|
d5322466e9 | ||
|
|
290609d581 | ||
|
|
c2a0b1c16b | ||
|
|
a5526d0c73 | ||
|
|
c408485c5b | ||
|
|
4762b88980 | ||
|
|
661094d113 | ||
|
|
6e06288228 | ||
|
|
f5f86e9ba6 | ||
|
|
f562130e96 | ||
|
|
35fbacb196 | ||
|
|
90d825c809 | ||
|
|
48f81d90cc | ||
|
|
68756681fa | ||
|
|
5c90afea76 | ||
|
|
b6b344a69a | ||
|
|
601c8165d8 | ||
|
|
b612c3a846 | ||
|
|
0bf1204499 | ||
|
|
36a6d5fede | ||
|
|
884b3c7b8d | ||
|
|
4dd6b956aa | ||
|
|
aedd2a6391 | ||
|
|
c2d5f9f428 | ||
|
|
54b49ff0d6 | ||
|
|
5680344dfd | ||
|
|
b0e0926b70 | ||
|
|
27158ee7e8 | ||
|
|
b1be1f5f71 | ||
|
|
6b020e011e | ||
|
|
7995940579 | ||
|
|
3ffdb4fe4b | ||
|
|
9211770056 | ||
|
|
57919704be | ||
|
|
20f881f0a9 | ||
|
|
7275a934a2 | ||
|
|
6a54056ec8 | ||
|
|
e5658b3298 | ||
|
|
cf4d35efa2 | ||
|
|
7e842fbd46 | ||
|
|
0009539eef | ||
|
|
1490eee0e9 | ||
|
|
45fb191483 | ||
|
|
cfe99341d7 | ||
|
|
0db96082a1 | ||
|
|
0d224ee2fd | ||
|
|
15482bb734 | ||
|
|
fd86b17b6d | ||
|
|
492900d5d1 | ||
|
|
fba19bc755 | ||
|
|
0c3caffe93 | ||
|
|
642824818c | ||
|
|
1a1c3a6c9f | ||
|
|
b90853f431 | ||
|
|
4ad51b8866 | ||
|
|
71f12f1856 | ||
|
|
b329bf8088 | ||
|
|
b8f5e55ac9 | ||
|
|
8171e3aad2 | ||
|
|
039be9790d | ||
|
|
1599b14beb | ||
|
|
170f97d013 | ||
|
|
8fa89753b6 | ||
|
|
67bd4429f5 | ||
|
|
98d131881f | ||
|
|
57ff653dc3 | ||
|
|
f8a3e7fc2e | ||
|
|
8910311c5c | ||
|
|
e5fbaeafcd | ||
|
|
90e7711788 | ||
|
|
29e255a7bd | ||
|
|
e36f5b3fbd | ||
|
|
04125cef3d | ||
|
|
55f35e7067 | ||
|
|
8fc6f511c8 | ||
|
|
d20101095c | ||
|
|
2d26c11ad7 | ||
|
|
fea05b552c | ||
|
|
e1ac5633f9 | ||
|
|
e3a577ad24 | ||
|
|
596334dab9 | ||
|
|
6d818cbc1d | ||
|
|
326621504b | ||
|
|
3a4c5e307c | ||
|
|
67cec4c564 | ||
|
|
0ef70d0b6a | ||
|
|
c11ca9df4d | ||
|
|
bfab0fa542 | ||
|
|
7938b8245e | ||
|
|
8c684c2f54 | ||
|
|
ec9119d1d0 | ||
|
|
7aa150f287 | ||
|
|
853ecf9add | ||
|
|
2be85fb187 | ||
|
|
0f57901b70 | ||
|
|
1ec5721198 | ||
|
|
d010c3a9fa | ||
|
|
c43e6f44fe | ||
|
|
c9b0632a46 | ||
|
|
d855788e19 | ||
|
|
e9d9578eee | ||
|
|
e913e83596 | ||
|
|
a48a31a469 | ||
|
|
9c624e6742 | ||
|
|
668ba51ba2 | ||
|
|
fdab492c98 | ||
|
|
c8ab26ab93 | ||
|
|
63acca90fd | ||
|
|
fc0c54c7fd | ||
|
|
831bde7042 | ||
|
|
2485b7766e | ||
|
|
c245505e58 | ||
|
|
6c204758e3 | ||
|
|
a437285c56 | ||
|
|
549abc88c4 | ||
|
|
c26dde326c | ||
|
|
af2517343d | ||
|
|
f967244834 | ||
|
|
33122a5bf9 | ||
|
|
52d1f0811d | ||
|
|
bc6c663f90 | ||
|
|
e42fed18ea | ||
|
|
3fba1ec1d5 | ||
|
|
f948a07d44 | ||
|
|
38e1ef95a3 | ||
|
|
a9e88d234b | ||
|
|
7e080f2fb0 | ||
|
|
0bebb791a8 | ||
|
|
42468f3505 | ||
|
|
9eee7e8c9d | ||
|
|
6c646dd331 | ||
|
|
945a81b745 | ||
|
|
dab220f897 | ||
|
|
4a2e824057 | ||
|
|
a50ee191e5 | ||
|
|
ec7dd6154d | ||
|
|
918aafa84c | ||
|
|
f2593fcecc | ||
|
|
8c57e9cb09 | ||
|
|
0cee9b78eb | ||
|
|
98b2320aa8 | ||
|
|
e60e8b37e6 | ||
|
|
e9266ed01c | ||
|
|
af3af14d77 | ||
|
|
e0eba9473e | ||
|
|
691d4c771a | ||
|
|
6fbe981ce1 | ||
|
|
99a55a3c8a | ||
|
|
32ded0b34f | ||
|
|
a199915731 | ||
|
|
e86413b031 | ||
|
|
3d0db6a800 | ||
|
|
ef4853d0ae | ||
|
|
9fbbb4ae02 | ||
|
|
99e7d6ae92 | ||
|
|
dcefbdc470 | ||
|
|
91fb98e32a | ||
|
|
26c5f7bf79 | ||
|
|
e9ab628173 | ||
|
|
911ea10f3c | ||
|
|
e8c7e62900 | ||
|
|
69c20e78fb | ||
|
|
22175456a5 | ||
|
|
58fa533f79 | ||
|
|
1f5f08a9ea | ||
|
|
b6c748064f | ||
|
|
1f4721b10e | ||
|
|
f6d3e01a9f | ||
|
|
2627b27e38 | ||
|
|
b61201a60f | ||
|
|
818b21d124 | ||
|
|
e36d6bb7b7 | ||
|
|
f8e3e7ff99 | ||
|
|
f2ce03e9ea | ||
|
|
05d9854df0 | ||
|
|
19465c7698 | ||
|
|
4e9f6487df | ||
|
|
83b0282ec0 | ||
|
|
4e19c91be5 | ||
|
|
f009b9adee | ||
|
|
77dd4f86b9 | ||
|
|
5eabc41256 | ||
|
|
dda2fc6ad5 | ||
|
|
9a2126dfc7 | ||
|
|
2f5598de5a | ||
|
|
d7c7a1a1dd | ||
|
|
2488c0dd05 | ||
|
|
37dab7b8bd | ||
|
|
3024d4b52f | ||
|
|
b33df5374f | ||
|
|
f5e3c843c4 | ||
|
|
dd57089fcf | ||
|
|
73a62d3a1a | ||
|
|
76493fb6d7 | ||
|
|
1e783fad29 | ||
|
|
f6af379be6 | ||
|
|
54277da8a5 | ||
|
|
12111c27ad | ||
|
|
b0c294b59b | ||
|
|
60dedb4cbe | ||
|
|
57b55246a6 | ||
|
|
ac4702b57c | ||
|
|
14ff3028e3 | ||
|
|
dd9752b6ed | ||
|
|
7978bbc612 | ||
|
|
9eb05fa447 | ||
|
|
454a6a8350 | ||
|
|
1f9cc15fb1 | ||
|
|
6db8ba9e2f | ||
|
|
a89c96e3c4 | ||
|
|
fc32252db7 | ||
|
|
fb15a10bc4 | ||
|
|
37dd629cea | ||
|
|
ed851ebc86 | ||
|
|
3d972411f1 | ||
|
|
c1cc36f18a | ||
|
|
9014e27edc | ||
|
|
da5a66d200 | ||
|
|
f246631d3f | ||
|
|
f922b94eb1 | ||
|
|
c7d8916085 | ||
|
|
76a7a7f6da | ||
|
|
264d7bd3a8 | ||
|
|
d3a3a14e96 | ||
|
|
f397b47a8f | ||
|
|
9f942e0fda | ||
|
|
540861dd25 | ||
|
|
2a63a128cd | ||
|
|
c1d42ef10c | ||
|
|
b737ebb962 | ||
|
|
34335d09b7 | ||
|
|
0e00e15578 | ||
|
|
51be801637 | ||
|
|
d09f409359 | ||
|
|
9df5e5165d | ||
|
|
96c1425ffe | ||
|
|
15a2d5bd73 | ||
|
|
f32784395c | ||
|
|
7d71b4f955 | ||
|
|
0bb95ef5a3 | ||
|
|
db02075b4b | ||
|
|
8b20f6cab2 | ||
|
|
9f08d53262 | ||
|
|
4b60d7a10e | ||
|
|
42229b956e | ||
|
|
078ffc9baf | ||
|
|
57ae54d665 | ||
|
|
59784c4af5 | ||
|
|
b962fc2a4c | ||
|
|
b32453bd9c | ||
|
|
b9606ceceb | ||
|
|
77488078bf | ||
|
|
02403251ce | ||
|
|
2483cadbbd | ||
|
|
fb4914a120 | ||
|
|
847df24ab0 | ||
|
|
92e9e5390b | ||
|
|
92575367ae | ||
|
|
7b57bf3ece | ||
|
|
9cb4f166f2 | ||
|
|
7913b83f20 | ||
|
|
e5dc191584 | ||
|
|
57ca4f37a3 | ||
|
|
40da0fbb1c | ||
|
|
3f6342f0c6 | ||
|
|
bb3675ad11 | ||
|
|
a7366103c9 | ||
|
|
d5a9f776f7 | ||
|
|
7f650913d9 | ||
|
|
c765070401 | ||
|
|
1e974c7d3a | ||
|
|
20f74c95bf | ||
|
|
b7159f7334 | ||
|
|
7a97fed8a1 | ||
|
|
1064f2123b | ||
|
|
6e72c4c40a | ||
|
|
b1823824c2 | ||
|
|
f0de6ca9e1 | ||
|
|
1e015fd988 | ||
|
|
408f9d9c0c | ||
|
|
afe54e1472 | ||
|
|
0f7c3533ba | ||
|
|
5221645b0b | ||
|
|
a3de5fc589 | ||
|
|
b8ffb626b9 | ||
|
|
b42990d65b | ||
|
|
07865f1b12 | ||
|
|
b5ff10d960 | ||
|
|
50eeae0b3f | ||
|
|
73e05872ea | ||
|
|
cdce54e855 | ||
|
|
a429f8c0aa | ||
|
|
d728afd6f2 | ||
|
|
3c252f01be | ||
|
|
d7788a2a2e | ||
|
|
07851f449a | ||
|
|
ff883f48e9 | ||
|
|
3ffb6e192a | ||
|
|
20f28d30c0 | ||
|
|
34dfb1e43f | ||
|
|
6035544193 | ||
|
|
9c0cbe2ef8 | ||
|
|
0139286dff | ||
|
|
d890b3fe92 | ||
|
|
52e83c7863 | ||
|
|
26f3a8cf64 | ||
|
|
8920f7e25f | ||
|
|
8dc008e428 | ||
|
|
06b983870f | ||
|
|
5f1451f012 | ||
|
|
73464a09f1 | ||
|
|
cb048bb406 | ||
|
|
07c86ec2dc | ||
|
|
443e853d2a | ||
|
|
d8bb2fe1f1 | ||
|
|
7558b7ee1d | ||
|
|
ab197699b6 | ||
|
|
12d23266c3 | ||
|
|
9451956914 | ||
|
|
c9cad84419 | ||
|
|
013a6f134e | ||
|
|
8dc601bf48 | ||
|
|
3f8c7eaa94 | ||
|
|
0c97bc5b59 | ||
|
|
dca57c97de | ||
|
|
400ae46e03 | ||
|
|
80817a1af3 | ||
|
|
3d44af3042 | ||
|
|
fd0f55099f | ||
|
|
c8a20afb87 | ||
|
|
8d37414eac | ||
|
|
aed6438648 | ||
|
|
00b466c6a5 | ||
|
|
ed7821ad1c | ||
|
|
8f71e6c5c4 | ||
|
|
7adf99f82e | ||
|
|
034c1aa481 | ||
|
|
40fa3afbde | ||
|
|
00c837c361 | ||
|
|
d6e3caaa9b | ||
|
|
98a11a8aad | ||
|
|
963b2f1b46 | ||
|
|
f602f05c5a | ||
|
|
3ea0cc6427 | ||
|
|
258f9f7bb7 | ||
|
|
6f673583ab | ||
|
|
0477ef669a | ||
|
|
b023ec2d3f | ||
|
|
3c9bf1de77 | ||
|
|
4e86197d62 | ||
|
|
816fd9b758 | ||
|
|
c1c7279e01 | ||
|
|
baf8edfc9c | ||
|
|
d2450ff776 | ||
|
|
f71039e840 | ||
|
|
01bd921d30 | ||
|
|
ad079cc416 | ||
|
|
1e966ee217 | ||
|
|
523c36100a | ||
|
|
fa4e3ebc7e | ||
|
|
3cc6f53374 | ||
|
|
03e1b28c97 | ||
|
|
2a761ff8d0 | ||
|
|
ed6a388a8e | ||
|
|
75529958f6 | ||
|
|
2e7cbe989a | ||
|
|
b0db51fa5a | ||
|
|
5886d154ae | ||
|
|
f6fcf41c70 | ||
|
|
a22ad88bda | ||
|
|
c173fe0cb8 | ||
|
|
7b027c0802 | ||
|
|
df05290180 | ||
|
|
dd41cd4b4f | ||
|
|
c4e3e4420c | ||
|
|
97809cdb65 | ||
|
|
4e44d979a1 | ||
|
|
0e0d22e7ce | ||
|
|
74f87b3f2d | ||
|
|
0e3d4205c9 | ||
|
|
fc44894bc0 | ||
|
|
cf34e7f165 | ||
|
|
ae7f27ed6f | ||
|
|
3bbfaad77b | ||
|
|
1282b03547 | ||
|
|
70a44217f5 | ||
|
|
88741d943e | ||
|
|
52764cc900 | ||
|
|
50b7fb0d5d | ||
|
|
0a812d8283 | ||
|
|
2afde85ef0 | ||
|
|
568f76b0b2 | ||
|
|
58f60dbf1b | ||
|
|
559c8d763b | ||
|
|
e6a7416acf | ||
|
|
f43924fbb0 | ||
|
|
da77741dab | ||
|
|
d367f85f06 | ||
|
|
d9c656f6d2 | ||
|
|
379dd44c04 | ||
|
|
d9a11588b7 | ||
|
|
cb6dd0d6c7 | ||
|
|
ab2e8efad5 | ||
|
|
0f5ea8516b | ||
|
|
7769ca8c3f | ||
|
|
2940eaed63 | ||
|
|
219e46793e | ||
|
|
0fa7897de4 | ||
|
|
fe120542f3 | ||
|
|
1644db1503 | ||
|
|
eb67e938f8 | ||
|
|
30cadf0d42 | ||
|
|
48b6b06503 | ||
|
|
6edac3c145 | ||
|
|
8df796b6db | ||
|
|
fd80339431 | ||
|
|
0ddf9ff807 | ||
|
|
c40f310e10 | ||
|
|
13f025aee1 | ||
|
|
675b1ef962 | ||
|
|
5fff8a60ba | ||
|
|
36ae5a6bc2 | ||
|
|
939160e8df | ||
|
|
0460cc7e3e | ||
|
|
e0acd4fd7d | ||
|
|
caf2fa4a5a | ||
|
|
a0e8f7f3a9 | ||
|
|
7f4baaae4d | ||
|
|
2ee8516427 | ||
|
|
4c2f71e818 | ||
|
|
d4942ab8f8 | ||
|
|
53712b8e40 | ||
|
|
4e4bd000d4 | ||
|
|
b873b7993e | ||
|
|
18296fb4b1 | ||
|
|
f66f135f79 | ||
|
|
bbae91bb6c | ||
|
|
cd7d307fc4 | ||
|
|
bda25fb4cf | ||
|
|
5231bc8372 | ||
|
|
f085a5423a | ||
|
|
2ccb4c128a | ||
|
|
9a9ac6f2e1 | ||
|
|
090de85388 | ||
|
|
9d4b5cfc0b | ||
|
|
9c7e42ed1e | ||
|
|
83aefc416a | ||
|
|
29947d69c3 | ||
|
|
3b2850e042 | ||
|
|
5c2b77cf76 | ||
|
|
9c95b91086 | ||
|
|
27fd726ce3 | ||
|
|
d58e93e2a4 | ||
|
|
9a695ef5bf | ||
|
|
b9828f3cd1 | ||
|
|
53952b1636 | ||
|
|
13ac4c386a | ||
|
|
6fa90c7f39 | ||
|
|
6fcaccdfb1 | ||
|
|
070cd6e7c6 | ||
|
|
64e87a906f | ||
|
|
1fbadd02f9 | ||
|
|
02fadaf17e | ||
|
|
c4a13f985e | ||
|
|
7367e15121 | ||
|
|
07cdc36181 | ||
|
|
69fc2dca42 | ||
|
|
e8432db26e | ||
|
|
e8ad649770 | ||
|
|
63770fdf79 | ||
|
|
b48d713fda | ||
|
|
77955bc03c | ||
|
|
99b41c6715 | ||
|
|
62e6eb91fc | ||
|
|
eba9c697e3 | ||
|
|
643ba17d80 | ||
|
|
301f49078e | ||
|
|
6c5cf814b4 | ||
|
|
45adc6160d | ||
|
|
0326bee7a3 | ||
|
|
ee7fca09b6 | ||
|
|
fd1257052b | ||
|
|
102a48bf97 | ||
|
|
2537fc44bb | ||
|
|
7dd270dc8b | ||
|
|
be3fc2c964 | ||
|
|
0d6fe49a41 | ||
|
|
ffcfc448be | ||
|
|
303a15eb50 | ||
|
|
ebf3d8d55e | ||
|
|
3909a4b2dc | ||
|
|
30f8a57556 | ||
|
|
03a18d5237 | ||
|
|
b3e9a2b64d | ||
|
|
23740d12eb | ||
|
|
52138eee98 | ||
|
|
c7a66e0f99 | ||
|
|
a2d3205701 | ||
|
|
e8ab86ab7f | ||
|
|
abf694aa81 | ||
|
|
24c58acf85 | ||
|
|
37cbafde3e | ||
|
|
8af5a532e3 | ||
|
|
a5fa33e72f | ||
|
|
925ac7907b | ||
|
|
c88bb3bbdb | ||
|
|
d005064c28 | ||
|
|
f8963b33a3 | ||
|
|
09f0c9e069 | ||
|
|
0d40b36613 | ||
|
|
ef17399128 | ||
|
|
cca8c31ff4 | ||
|
|
fde398e80b | ||
|
|
fd2e9fbafc | ||
|
|
15e93cc60d | ||
|
|
b2c95e37ae | ||
|
|
1da1b9d2cb | ||
|
|
978c953e0d | ||
|
|
27011f3ce6 | ||
|
|
cd5ac59c40 | ||
|
|
e2e2b44fb8 | ||
|
|
a8be273479 | ||
|
|
9e84c6af1b | ||
|
|
84e7460a67 | ||
|
|
8802709d3c | ||
|
|
253ed62d46 | ||
|
|
4d247e75f2 | ||
|
|
3d4eb1545e | ||
|
|
5006d01932 | ||
|
|
ccc11623c3 | ||
|
|
dd5399a41d | ||
|
|
9da6b2a4f5 | ||
|
|
23e71e991f | ||
|
|
8658804c82 | ||
|
|
77c4eb0d54 | ||
|
|
238640ec91 | ||
|
|
0a0a4684f8 | ||
|
|
a12f874e34 | ||
|
|
00f89f0855 | ||
|
|
4cc14b93b6 | ||
|
|
f5aa294c70 | ||
|
|
bb17e8cc1f | ||
|
|
69f2acae72 | ||
|
|
00ecbc98ba | ||
|
|
065c59f167 | ||
|
|
878169f51c | ||
|
|
d9ee3a2323 | ||
|
|
5afad6e313 | ||
|
|
631d82216e | ||
|
|
0b7148f675 | ||
|
|
b03f03bf06 | ||
|
|
cf39f494f8 | ||
|
|
ca9a5187f6 | ||
|
|
f8201ffed7 | ||
|
|
b70780162b | ||
|
|
da312cd5ac | ||
|
|
5938e1426e | ||
|
|
f695639839 | ||
|
|
016fbe0a10 | ||
|
|
dd496d35a8 | ||
|
|
158ffde780 | ||
|
|
402674470f | ||
|
|
31174ae97c | ||
|
|
4c7239c5ec | ||
|
|
93a63cc868 | ||
|
|
b5aa3dd869 | ||
|
|
a69e62a66b | ||
|
|
7c3fa4ebc2 | ||
|
|
668162845c | ||
|
|
c6051f30d0 | ||
|
|
f78354eedb | ||
|
|
d83079ecb8 | ||
|
|
f1b030f3d5 | ||
|
|
019e826515 | ||
|
|
16b9464da5 | ||
|
|
a33ca69368 | ||
|
|
c8c031d05f | ||
|
|
c84b54a214 | ||
|
|
f5fb179304 | ||
|
|
f2003fa75f | ||
|
|
bda0736527 | ||
|
|
439856945e | ||
|
|
3a81d449da | ||
|
|
a29dcbb956 | ||
|
|
265fb4a8e8 | ||
|
|
a4e576e26d | ||
|
|
a0219e4a08 | ||
|
|
a41ee3279e | ||
|
|
f8f1547f27 | ||
|
|
4724ae3566 | ||
|
|
e99917b8f7 | ||
|
|
96467d79b8 | ||
|
|
65357943e7 | ||
|
|
2470632e84 | ||
|
|
2a11b64de4 | ||
|
|
44bae0c3a2 | ||
|
|
d5eb97863b | ||
|
|
ad031a172d | ||
|
|
52bd4be012 | ||
|
|
a6af53d78c | ||
|
|
82a144b12e | ||
|
|
91d4f6a8b4 | ||
|
|
17e49b6a2f | ||
|
|
34d994beec | ||
|
|
c594ac1be1 | ||
|
|
7ae9fa3225 | ||
|
|
80fa8c1c05 | ||
|
|
6b34083af0 | ||
|
|
42d5421cd8 | ||
|
|
f093fef8f8 | ||
|
|
484fab26e0 | ||
|
|
2c164f3797 | ||
|
|
08c72df1e5 | ||
|
|
837d327308 | ||
|
|
fd562a1d9e | ||
|
|
019f2fe068 | ||
|
|
f1496d52c0 | ||
|
|
18a946d2cc | ||
|
|
e76d7e3234 | ||
|
|
0315530f2c | ||
|
|
5fdbfc17ca | ||
|
|
c3974e4b9d | ||
|
|
9d3e069090 | ||
|
|
8783c21cf1 | ||
|
|
9194a97756 | ||
|
|
62bca72c6d | ||
|
|
7409afb11f | ||
|
|
125ecb44c5 | ||
|
|
b6397b2926 | ||
|
|
0a7d520473 | ||
|
|
edf1e1a3e3 | ||
|
|
3e692d6677 | ||
|
|
28a44d9e05 | ||
|
|
7db7919207 | ||
|
|
095f2eef5d | ||
|
|
4bc4e631d8 | ||
|
|
3c2a4dcc70 | ||
|
|
5670764f3b | ||
|
|
d0e6a29486 | ||
|
|
a92790c9d0 | ||
|
|
0b692d045f | ||
|
|
7b58ca9134 | ||
|
|
8e6eb17ef5 | ||
|
|
93c92d49f7 | ||
|
|
70386811e6 | ||
|
|
55a055a047 | ||
|
|
9b62710d64 | ||
|
|
a1f028aa5e | ||
|
|
5187bc04c1 | ||
|
|
7959f650d5 | ||
|
|
6a9e868035 | ||
|
|
5da82a6b01 | ||
|
|
ffb6cbfb17 | ||
|
|
2b02f6659a | ||
|
|
6acf051539 | ||
|
|
8c083cccc8 | ||
|
|
d132447af8 | ||
|
|
985adc0267 | ||
|
|
39b94a2ac1 | ||
|
|
5f007be781 | ||
|
|
578b68f635 | ||
|
|
44b6315361 | ||
|
|
a3f9219460 | ||
|
|
65d3c3f277 | ||
|
|
250b12c041 | ||
|
|
b649ad73a8 | ||
|
|
bf50adaa22 | ||
|
|
055cbf4f7a | ||
|
|
6d9e2fbfe1 | ||
|
|
0ec039bb39 | ||
|
|
0823eb1ed0 | ||
|
|
c1ab696774 | ||
|
|
93d61a99fa | ||
|
|
c2b8261133 | ||
|
|
cb00a3fa38 | ||
|
|
48aaf8179d | ||
|
|
292bc790ee | ||
|
|
5a0a761c08 | ||
|
|
e44f61181a | ||
|
|
387aef6626 | ||
|
|
da93126d58 | ||
|
|
49c45f97fc | ||
|
|
b225e44cfa | ||
|
|
afa17f95f9 | ||
|
|
790f8ec127 | ||
|
|
b4d5650cb0 | ||
|
|
9ea831a0f2 | ||
|
|
f44893e4c1 | ||
|
|
10dd7eff78 | ||
|
|
02d63e244d | ||
|
|
dd10a49519 | ||
|
|
b250111d57 | ||
|
|
2dce134d15 | ||
|
|
b4793811a4 | ||
|
|
8a45f78251 | ||
|
|
7fec084227 | ||
|
|
3a120c0a3c | ||
|
|
c08b39f148 | ||
|
|
036b6b77b1 | ||
|
|
a4dd15013d | ||
|
|
2c411736e5 | ||
|
|
b81bf447a9 | ||
|
|
09a2a79a78 | ||
|
|
69ba31b44d | ||
|
|
710b488663 | ||
|
|
26fa0693b0 | ||
|
|
75b30ad2f9 | ||
|
|
9dac61cbb6 | ||
|
|
d504472418 | ||
|
|
375e4231aa | ||
|
|
e5c003a6bf | ||
|
|
fdf2d936f9 | ||
|
|
ab4bf1f0a8 | ||
|
|
332dcf9fe5 | ||
|
|
c2aee52bc0 | ||
|
|
14a851d582 | ||
|
|
58032b0075 | ||
|
|
3055793cff | ||
|
|
1e749747b4 | ||
|
|
3d86aee249 | ||
|
|
cd8845299f | ||
|
|
95d149274f | ||
|
|
3880c3deac | ||
|
|
8c68a6d9ce | ||
|
|
67cad1963f | ||
|
|
cad8f8678e | ||
|
|
cb0de264e8 | ||
|
|
30654806e8 | ||
|
|
b62058b36a | ||
|
|
a6c194f5c4 | ||
|
|
23553f0f4c | ||
|
|
6b7fe137ca | ||
|
|
d12def4a97 | ||
|
|
dcacba6803 | ||
|
|
df9a572656 | ||
|
|
8648b0a24d | ||
|
|
511ca918f4 | ||
|
|
a51176967c | ||
|
|
9a8727f499 | ||
|
|
03ea4ccd44 | ||
|
|
0b1c287f68 | ||
|
|
eef7675d95 | ||
|
|
a06f2f9731 | ||
|
|
b04624bd60 | ||
|
|
808fb4f5ac | ||
|
|
26d675dc26 | ||
|
|
144b50cfc9 | ||
|
|
28df12c1a9 | ||
|
|
44f6f0fd40 | ||
|
|
01cf713ec2 | ||
|
|
85422f3427 | ||
|
|
43123ec93e | ||
|
|
e5dd9661d7 | ||
|
|
6f5e6240bc | ||
|
|
581b5b3de9 | ||
|
|
5dd48cbd23 | ||
|
|
10eb512244 | ||
|
|
c232f8ccff | ||
|
|
cf4d6f46b5 | ||
|
|
4b19cbcf67 | ||
|
|
85aa46ad2b | ||
|
|
1b6169bf2e | ||
|
|
6b995f8b13 | ||
|
|
d56bc000a1 | ||
|
|
b38f167a27 | ||
|
|
16af086cc5 | ||
|
|
24cc5ca32d | ||
|
|
47f6f7e8cc | ||
|
|
dde458aea0 | ||
|
|
d34d902413 | ||
|
|
812aff7f2e | ||
|
|
39535cef7b | ||
|
|
d3ba0bbb22 | ||
|
|
f401179c57 | ||
|
|
0bd481d4f0 | ||
|
|
0942f02d2c | ||
|
|
659188e3cb | ||
|
|
9657976f63 | ||
|
|
97e44b2042 | ||
|
|
112457cb4b | ||
|
|
dcd9915fe0 | ||
|
|
4373ee8d13 | ||
|
|
8ed85795c6 | ||
|
|
671f4a131e | ||
|
|
9680f38dc8 | ||
|
|
d36ceb861a | ||
|
|
6fa3f0a11c | ||
|
|
144521936a | ||
|
|
1d3abdb268 | ||
|
|
a35d3e180b | ||
|
|
b811aa09a8 | ||
|
|
ecf4f14222 | ||
|
|
892be1b2cf | ||
|
|
41be279a89 | ||
|
|
56b7364a13 | ||
|
|
d12799a892 | ||
|
|
1f1efe553a | ||
|
|
65f8da77d2 | ||
|
|
193f83fcc3 | ||
|
|
972f079bd5 | ||
|
|
340c5abdb5 | ||
|
|
86ea757a16 | ||
|
|
c6f4c6f0fa | ||
|
|
849c6ae88b | ||
|
|
7ff5e13876 | ||
|
|
f833137455 | ||
|
|
68092e5966 | ||
|
|
e5a9bf6568 | ||
|
|
e74c377bfd | ||
|
|
669e55d435 | ||
|
|
3564843e1b | ||
|
|
56c9cb2978 | ||
|
|
aa072b5ad8 | ||
|
|
c08f79de50 | ||
|
|
9c665f83d3 | ||
|
|
a151c5587a | ||
|
|
676d942d54 | ||
|
|
a02d9817ce | ||
|
|
d88b31f43a | ||
|
|
b8e2d438c6 | ||
|
|
df4cf982dd | ||
|
|
21da2625e9 | ||
|
|
52d20ed8ef | ||
|
|
21e12068c7 | ||
|
|
9cf209d62b | ||
|
|
4368bef32f | ||
|
|
2e4f7956ac | ||
|
|
90eca9f6a3 | ||
|
|
7dc8285fd5 | ||
|
|
ba5b2e827c | ||
|
|
2c75ea1a18 | ||
|
|
047a108689 | ||
|
|
2fc2031665 | ||
|
|
aed8cb9cf5 | ||
|
|
96344e3abf | ||
|
|
73d53176d1 | ||
|
|
edb0f25449 | ||
|
|
2b572f4948 | ||
|
|
df901e7433 | ||
|
|
60d91cb2fb | ||
|
|
d011c8e72f | ||
|
|
3295dd3635 | ||
|
|
b7413f1dff | ||
|
|
7c689d0f5c | ||
|
|
3281b669ae | ||
|
|
2a4d339ff3 | ||
|
|
35c6e4b9fb | ||
|
|
65d25f6544 | ||
|
|
af0106d466 | ||
|
|
df94c89ce8 | ||
|
|
8faf911df8 | ||
|
|
136d4109f5 | ||
|
|
1a8f9fca26 | ||
|
|
2304ea3829 | ||
|
|
dd7dfcff68 | ||
|
|
959e4883df | ||
|
|
f7e42b6e31 | ||
|
|
0eb5834e1c | ||
|
|
6f02f67168 | ||
|
|
74b1a23ca8 | ||
|
|
592ca34923 | ||
|
|
d77c347f24 | ||
|
|
45b78a2e26 | ||
|
|
416ea2490c | ||
|
|
567c290117 | ||
|
|
aab22ef402 | ||
|
|
502a8a0186 | ||
|
|
591132deac | ||
|
|
709da6b6e6 | ||
|
|
67a2deb3a4 | ||
|
|
ed84d7453d | ||
|
|
6365298e4b | ||
|
|
f0bbc5a777 | ||
|
|
159f7f3b29 | ||
|
|
38b17ff66a | ||
|
|
484ea06c80 | ||
|
|
f1ff66b39c | ||
|
|
27a2f42e48 | ||
|
|
744427da46 | ||
|
|
3ae8b05e1f | ||
|
|
3907e49b9e | ||
|
|
4194614d65 | ||
|
|
ff10144ad7 | ||
|
|
54247d17c1 | ||
|
|
326733a312 | ||
|
|
fb203df364 | ||
|
|
8d5fe02105 | ||
|
|
dda96d8f05 | ||
|
|
e2bae31e55 | ||
|
|
dcaaa11608 | ||
|
|
b057e83898 | ||
|
|
17f2a3e79a | ||
|
|
071b72e3fd | ||
|
|
63aff9dcd1 | ||
|
|
1bc7e5d6cd | ||
|
|
c08d54c16b | ||
|
|
2eea8520d8 | ||
|
|
6f254b06b0 | ||
|
|
e512569d5c | ||
|
|
d805352a97 | ||
|
|
ce7a86842f | ||
|
|
13e5b03aa8 | ||
|
|
0e2ec4836a | ||
|
|
0c35cd9680 | ||
|
|
0839055b7e | ||
|
|
c8d2a0540f | ||
|
|
3ba981a890 | ||
|
|
e3e2c68114 | ||
|
|
4b0d48922d | ||
|
|
bb9ce9e26f | ||
|
|
feca5acc7e | ||
|
|
85cf78407c | ||
|
|
33f4ace038 | ||
|
|
b613f59b42 | ||
|
|
fc829c79c7 | ||
|
|
2925e0b8e3 | ||
|
|
911bfc44c1 | ||
|
|
7731b6c892 | ||
|
|
485b743208 | ||
|
|
a6c9ba2ec8 | ||
|
|
e0648b7f36 | ||
|
|
5db3775b96 | ||
|
|
a82252680d | ||
|
|
b6394ad7d3 | ||
|
|
59e436ba69 | ||
|
|
3308f16de6 | ||
|
|
4e79123c11 | ||
|
|
bf1fa581ba | ||
|
|
3214316663 | ||
|
|
6d92bff3e9 | ||
|
|
9cd2346cd5 | ||
|
|
19ec4af427 | ||
|
|
7e12a48a8a | ||
|
|
2bf5cc2369 | ||
|
|
30ce1aa907 | ||
|
|
4c073a30d7 | ||
|
|
f495a583eb | ||
|
|
7c724bdee7 | ||
|
|
59578a8868 | ||
|
|
dc239c8137 | ||
|
|
c0bc62d79a | ||
|
|
7428ad21ee | ||
|
|
fb52fb0517 | ||
|
|
53023c97c5 | ||
|
|
4263abae70 | ||
|
|
b40b4ec500 | ||
|
|
57f34f934c | ||
|
|
bacbf33d1d | ||
|
|
60a1ceb7a0 | ||
|
|
8279ac79c8 | ||
|
|
220e530bf3 | ||
|
|
b7552a6579 | ||
|
|
1bda9d40e1 | ||
|
|
6f2354f8fc | ||
|
|
d0b6791efd | ||
|
|
dc6159f90a | ||
|
|
751f84befd | ||
|
|
9a2829730c | ||
|
|
d6363d0f80 | ||
|
|
72085a7962 | ||
|
|
aaa956287f | ||
|
|
c659bc6f2f | ||
|
|
0323144248 | ||
|
|
19ca30527e | ||
|
|
2b6eba0106 | ||
|
|
c0845443d0 | ||
|
|
ff194b4425 | ||
|
|
6a22e03689 | ||
|
|
120b77d853 | ||
|
|
e2dce132df | ||
|
|
b7c572f800 | ||
|
|
44f7df2ea5 | ||
|
|
c9ab7dd8e7 | ||
|
|
22d98fe753 | ||
|
|
929f3d2e16 | ||
|
|
db85478381 | ||
|
|
8fa4c04b16 | ||
|
|
41cd3ea23c | ||
|
|
dae2da4a5d | ||
|
|
63a03dc361 | ||
|
|
94fb59f8bf | ||
|
|
6c7a5d1321 | ||
|
|
d9acce04b6 | ||
|
|
c351c446a0 | ||
|
|
ad49b051e1 | ||
|
|
ddde0f8629 | ||
|
|
6574544edc | ||
|
|
dd1cd3bc79 | ||
|
|
fb4f7acb16 | ||
|
|
ab42e506e8 | ||
|
|
3322609f87 | ||
|
|
c7baaa26f2 | ||
|
|
aefc655535 | ||
|
|
054fc7c5a6 | ||
|
|
c8600cd24b | ||
|
|
4cdcbdc6fa | ||
|
|
26025bb2a1 | ||
|
|
03dbdd5ed6 | ||
|
|
7d938ac8fa | ||
|
|
117e41dafb | ||
|
|
5e5f1398fa | ||
|
|
9121624c3c | ||
|
|
811c37549a | ||
|
|
c171e756f0 | ||
|
|
693497265a | ||
|
|
60d25ea131 | ||
|
|
716bb26800 | ||
|
|
8806c91dd9 | ||
|
|
e4002233ef | ||
|
|
4355b3a2c8 | ||
|
|
bc7345704d | ||
|
|
d17f4cf46c | ||
|
|
737465064b | ||
|
|
24b2794696 | ||
|
|
ba6f16943d | ||
|
|
0698ba3a18 | ||
|
|
b6358933b2 | ||
|
|
276805ab28 | ||
|
|
31882458dc | ||
|
|
22a5f05e32 | ||
|
|
69b70bfed6 | ||
|
|
8d2660508b | ||
|
|
13d9562bcd | ||
|
|
a908e159e2 | ||
|
|
9f7729fa0f | ||
|
|
9ebc4fd5fe | ||
|
|
4f4182f574 | ||
|
|
3585a40d56 | ||
|
|
273858a34a | ||
|
|
d2872bebe9 | ||
|
|
d8b0c1903f | ||
|
|
0df1e58e16 | ||
|
|
282b199754 | ||
|
|
c461c1e2e3 | ||
|
|
5b5380c746 | ||
|
|
255a28cdf8 | ||
|
|
ab0a722f2c | ||
|
|
6226a2a2d7 | ||
|
|
9ca2a2f624 | ||
|
|
498b7a033f | ||
|
|
83a7055065 | ||
|
|
b6fb7d94c8 | ||
|
|
4dbfef028e | ||
|
|
439f858a82 | ||
|
|
2f62ae4e8b | ||
|
|
acab17a21f | ||
|
|
53380409de | ||
|
|
3890375272 | ||
|
|
e4f1e1a57a | ||
|
|
04abebfa10 | ||
|
|
93abef86dc | ||
|
|
2d2f901545 | ||
|
|
24df7c02f6 | ||
|
|
e97c294849 | ||
|
|
8d8bd162b3 | ||
|
|
3dc7e458e1 | ||
|
|
91d2e43671 | ||
|
|
5d6488bfa4 | ||
|
|
f8fa6acc60 | ||
|
|
9ad4ce7a49 | ||
|
|
247377e98c | ||
|
|
612419e615 | ||
|
|
949e1fc013 | ||
|
|
34b80727a2 | ||
|
|
825e88353a | ||
|
|
31cd125954 | ||
|
|
3bc274a651 | ||
|
|
eed41a121c |
2
.github/workflows/build-includes.yml
vendored
2
.github/workflows/build-includes.yml
vendored
@@ -5,6 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
- Apple/Develop
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
- 'Moose Setup/**/*.lua'
|
- 'Moose Setup/**/*.lua'
|
||||||
- 'Moose Development/**/*.lua'
|
- 'Moose Development/**/*.lua'
|
||||||
|
|||||||
14
Moose Development/Moose/.vscode/settings.json
vendored
14
Moose Development/Moose/.vscode/settings.json
vendored
@@ -1,7 +1,17 @@
|
|||||||
{
|
{
|
||||||
"Lua.workspace.preloadFileSize": 1000,
|
"Lua.workspace.preloadFileSize": 10000,
|
||||||
"Lua.diagnostics.disable": [
|
"Lua.diagnostics.disable": [
|
||||||
"undefined-doc-name"
|
"undefined-doc-name",
|
||||||
|
"duplicate-set-field",
|
||||||
|
"trailing-space",
|
||||||
|
"need-check-nil",
|
||||||
|
"ambiguity-1",
|
||||||
|
"undefined-doc-param",
|
||||||
|
"redundant-parameter",
|
||||||
|
"param-type-mismatch",
|
||||||
|
"deprecated",
|
||||||
|
"undefined-global",
|
||||||
|
"lowercase-global"
|
||||||
],
|
],
|
||||||
"Lua.diagnostics.globals": [
|
"Lua.diagnostics.globals": [
|
||||||
"BASE",
|
"BASE",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
-- @module AI.AI_A2A_Cap
|
-- @module AI.AI_A2A_Cap
|
||||||
-- @image AI_Combat_Air_Patrol.JPG
|
-- @image AI_Combat_Air_Patrol.JPG
|
||||||
|
|
||||||
--- @type AI_A2A_CAP
|
-- @type AI_A2A_CAP
|
||||||
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
||||||
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_A2A_GCI
|
-- @type AI_A2A_GCI
|
||||||
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
-- @extends AI.AI_A2A#AI_A2A
|
||||||
|
|
||||||
|
|
||||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||||
@@ -39,6 +39,8 @@
|
|||||||
--
|
--
|
||||||
-- ## 2. AI_A2A_GCI is a FSM
|
-- ## 2. AI_A2A_GCI is a FSM
|
||||||
--
|
--
|
||||||
|
-- 
|
||||||
|
--
|
||||||
-- ### 2.1 AI_A2A_GCI States
|
-- ### 2.1 AI_A2A_GCI States
|
||||||
--
|
--
|
||||||
-- * **None** ( Group ): The process is not started yet.
|
-- * **None** ( Group ): The process is not started yet.
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
-- @image AI_Air_Patrolling.JPG
|
-- @image AI_Air_Patrolling.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_A2A_PATROL
|
-- @type AI_A2A_PATROL
|
||||||
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
-- @extends AI.AI_A2A#AI_A2A
|
||||||
|
|
||||||
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}.
|
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}.
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -11,9 +11,8 @@
|
|||||||
-- @module AI.AI_A2G_BAI
|
-- @module AI.AI_A2G_BAI
|
||||||
-- @image AI_Air_To_Ground_Engage.JPG
|
-- @image AI_Air_To_Ground_Engage.JPG
|
||||||
|
|
||||||
--- @type AI_A2G_BAI
|
-- @type AI_A2G_BAI
|
||||||
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
-- @extends AI.AI_A2A_Engage#AI_A2A_Engage -- TODO: Documentation. This class does not exist, unable to determine what it extends.
|
||||||
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
|
||||||
|
|
||||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||||
--
|
--
|
||||||
@@ -47,7 +46,7 @@ AI_A2G_BAI = {
|
|||||||
function AI_A2G_BAI:New2( AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
function AI_A2G_BAI:New2( AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
||||||
|
|
||||||
local AI_Air = AI_AIR:New( AIGroup )
|
local AI_Air = AI_AIR:New( AIGroup )
|
||||||
local AI_Air_Patrol = AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
local AI_Air_Patrol = AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType ) -- #AI_AIR_PATROL
|
||||||
local AI_Air_Engage = AI_AIR_ENGAGE:New( AI_Air_Patrol, AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType )
|
local AI_Air_Engage = AI_AIR_ENGAGE:New( AI_Air_Patrol, AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType )
|
||||||
local self = BASE:Inherit( self, AI_Air_Engage )
|
local self = BASE:Inherit( self, AI_Air_Engage )
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,8 @@
|
|||||||
-- @module AI.AI_A2G_CAS
|
-- @module AI.AI_A2G_CAS
|
||||||
-- @image AI_Air_To_Ground_Engage.JPG
|
-- @image AI_Air_To_Ground_Engage.JPG
|
||||||
|
|
||||||
--- @type AI_A2G_CAS
|
-- @type AI_A2G_CAS
|
||||||
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
-- @extends AI.AI_A2G_Patrol#AI_AIR_PATROL TODO: Documentation. This class does not exist, unable to determine what it extends.
|
||||||
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
|
||||||
|
|
||||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||||
--
|
--
|
||||||
@@ -47,7 +46,7 @@ AI_A2G_CAS = {
|
|||||||
function AI_A2G_CAS:New2( AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
function AI_A2G_CAS:New2( AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
||||||
|
|
||||||
local AI_Air = AI_AIR:New( AIGroup )
|
local AI_Air = AI_AIR:New( AIGroup )
|
||||||
local AI_Air_Patrol = AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
|
local AI_Air_Patrol = AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType ) -- #AI_AIR_PATROL
|
||||||
local AI_Air_Engage = AI_AIR_ENGAGE:New( AI_Air_Patrol, AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType )
|
local AI_Air_Engage = AI_AIR_ENGAGE:New( AI_Air_Patrol, AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType )
|
||||||
local self = BASE:Inherit( self, AI_Air_Engage )
|
local self = BASE:Inherit( self, AI_Air_Engage )
|
||||||
|
|
||||||
|
|||||||
@@ -3895,10 +3895,14 @@ do -- AI_A2G_DISPATCHER
|
|||||||
|
|
||||||
if Squadron then
|
if Squadron then
|
||||||
local FirstUnit = AttackSetUnit:GetRandomSurely()
|
local FirstUnit = AttackSetUnit:GetRandomSurely()
|
||||||
|
if FirstUnit then
|
||||||
local Coordinate = FirstUnit:GetCoordinate() -- Core.Point#COORDINATE
|
local Coordinate = FirstUnit:GetCoordinate() -- Core.Point#COORDINATE
|
||||||
if self.SetSendPlayerMessages then
|
if self.SetSendPlayerMessages then
|
||||||
Dispatcher:MessageToPlayers( Squadron, DefenderName .. ", on route to ground target at " .. Coordinate:ToStringA2G( DefenderGroup ), DefenderGroup )
|
Dispatcher:MessageToPlayers( Squadron, DefenderName .. ", on route to ground target at " .. Coordinate:ToStringA2G( DefenderGroup ), DefenderGroup )
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self:GetParent(self).onafterEngageRoute( self, DefenderGroup, From, Event, To, AttackSetUnit )
|
self:GetParent(self).onafterEngageRoute( self, DefenderGroup, From, Event, To, AttackSetUnit )
|
||||||
end
|
end
|
||||||
@@ -4784,4 +4788,5 @@ end
|
|||||||
Squadron.ResourceCount = Squadron.ResourceCount - Amount
|
Squadron.ResourceCount = Squadron.ResourceCount - Amount
|
||||||
end
|
end
|
||||||
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -13,9 +13,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_A2G_SEAD
|
-- @type AI_A2G_SEAD
|
||||||
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
|
-- @extends AI.AI_A2G_Patrol#AI_AIR_PATROL
|
||||||
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
|
|
||||||
|
|
||||||
|
|
||||||
--- Implements the core functions to SEAD intruders. Use the Engage trigger to intercept intruders.
|
--- Implements the core functions to SEAD intruders. Use the Engage trigger to intercept intruders.
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
-- @module AI.AI_Air
|
-- @module AI.AI_Air
|
||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
|
---
|
||||||
-- @type AI_AIR
|
-- @type AI_AIR
|
||||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
-- @module AI.AI_Air_Patrol
|
-- @module AI.AI_Air_Patrol
|
||||||
-- @image AI_Air_To_Ground_Patrol.JPG
|
-- @image AI_Air_To_Ground_Patrol.JPG
|
||||||
|
|
||||||
--- @type AI_AIR_PATROL
|
-- @type AI_AIR_PATROL
|
||||||
-- @extends AI.AI_Air#AI_AIR
|
-- @extends AI.AI_Air#AI_AIR
|
||||||
|
|
||||||
--- The AI_AIR_PATROL class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group}
|
--- The AI_AIR_PATROL class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group}
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ function AI_BAI_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
-- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
function _NewEngageRoute( AIControllable )
|
function _NewEngageRoute( AIControllable )
|
||||||
|
|
||||||
AIControllable:T( "NewEngageRoute" )
|
AIControllable:T( "NewEngageRoute" )
|
||||||
@@ -417,7 +417,7 @@ function _NewEngageRoute( AIControllable )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -429,7 +429,7 @@ function AI_BAI_ZONE:onbeforeEngage( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -478,7 +478,7 @@ function AI_BAI_ZONE:onafterTarget( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -488,7 +488,7 @@ function AI_BAI_ZONE:onafterAbort( Controllable, From, Event, To )
|
|||||||
self:__Route( 1 )
|
self:__Route( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -612,7 +612,7 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -623,7 +623,7 @@ function AI_BAI_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -637,7 +637,7 @@ function AI_BAI_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_BAI_ZONE self
|
-- @param #AI_BAI_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_BAI_ZONE:OnEventDead( EventData )
|
function AI_BAI_ZONE:OnEventDead( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
-- @module AI.AI_Balancer
|
-- @module AI.AI_Balancer
|
||||||
-- @image AI_Balancing.JPG
|
-- @image AI_Balancing.JPG
|
||||||
|
|
||||||
--- @type AI_BALANCER
|
-- @type AI_BALANCER
|
||||||
-- @field Core.Set#SET_CLIENT SetClient
|
-- @field Core.Set#SET_CLIENT SetClient
|
||||||
-- @field Core.Spawn#SPAWN SpawnAI
|
-- @field Core.Spawn#SPAWN SpawnAI
|
||||||
-- @field Wrapper.Group#GROUP Test
|
-- @field Wrapper.Group#GROUP Test
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
-- @module AI.AI_CAP
|
-- @module AI.AI_CAP
|
||||||
-- @image AI_Combat_Air_Patrol.JPG
|
-- @image AI_Combat_Air_Patrol.JPG
|
||||||
|
|
||||||
--- @type AI_CAP_ZONE
|
-- @type AI_CAP_ZONE
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
|
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
|
||||||
-- @field Core.Zone#ZONE_BASE TargetZone The @{Core.Zone} where the patrol needs to be executed.
|
-- @field Core.Zone#ZONE_BASE TargetZone The @{Core.Zone} where the patrol needs to be executed.
|
||||||
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
|
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
|
||||||
@@ -344,7 +344,7 @@ function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param AI.AI_CAP#AI_CAP_ZONE
|
-- @param AI.AI_CAP#AI_CAP_ZONE
|
||||||
-- @param Wrapper.Group#GROUP EngageGroup
|
-- @param Wrapper.Group#GROUP EngageGroup
|
||||||
function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm )
|
function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm )
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -367,7 +367,7 @@ function AI_CAP_ZONE:onbeforeEngage( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -395,7 +395,7 @@ function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -405,7 +405,7 @@ function AI_CAP_ZONE:onafterAbort( Controllable, From, Event, To )
|
|||||||
self:__Route( 1 )
|
self:__Route( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -505,7 +505,7 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -515,7 +515,7 @@ function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
self:SetDetectionOff()
|
self:SetDetectionOff()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -528,7 +528,7 @@ function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
-- @param #AI_CAP_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_CAP_ZONE:OnEventDead( EventData )
|
function AI_CAP_ZONE:OnEventDead( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param AI.AI_CAS#AI_CAS_ZONE
|
-- @param AI.AI_CAS#AI_CAS_ZONE
|
||||||
-- @param Wrapper.Group#GROUP EngageGroup
|
-- @param Wrapper.Group#GROUP EngageGroup
|
||||||
function AI_CAS_ZONE.EngageRoute( EngageGroup, Fsm )
|
function AI_CAS_ZONE.EngageRoute( EngageGroup, Fsm )
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ function AI_CAS_ZONE.EngageRoute( EngageGroup, Fsm )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -387,7 +387,7 @@ function AI_CAS_ZONE:onbeforeEngage( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -420,7 +420,7 @@ function AI_CAS_ZONE:onafterTarget( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -430,7 +430,7 @@ function AI_CAS_ZONE:onafterAbort( Controllable, From, Event, To )
|
|||||||
self:__Route( 1 )
|
self:__Route( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -530,7 +530,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To,
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -541,7 +541,7 @@ function AI_CAS_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -555,7 +555,7 @@ function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
-- @param #AI_CAS_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_CAS_ZONE:OnEventDead( EventData )
|
function AI_CAS_ZONE:OnEventDead( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
-- @module AI.AI_Cargo_APC
|
-- @module AI.AI_Cargo_APC
|
||||||
-- @image AI_Cargo_Dispatching_For_APC.JPG
|
-- @image AI_Cargo_Dispatching_For_APC.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_APC
|
-- @type AI_CARGO_APC
|
||||||
-- @extends AI.AI_Cargo#AI_CARGO
|
-- @extends AI.AI_Cargo#AI_CARGO
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
-- @module AI.AI_Cargo_Airplane
|
-- @module AI.AI_Cargo_Airplane
|
||||||
-- @image AI_Cargo_Dispatching_For_Airplanes.JPG
|
-- @image AI_Cargo_Dispatching_For_Airplanes.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_AIRPLANE
|
-- @type AI_CARGO_AIRPLANE
|
||||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
-- @module AI.AI_Cargo_Dispatcher_APC
|
-- @module AI.AI_Cargo_Dispatcher_APC
|
||||||
-- @image AI_Cargo_Dispatching_For_APC.JPG
|
-- @image AI_Cargo_Dispatching_For_APC.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_DISPATCHER_APC
|
-- @type AI_CARGO_DISPATCHER_APC
|
||||||
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
-- @image AI_Cargo_Dispatching_For_Airplanes.JPG
|
-- @image AI_Cargo_Dispatching_For_Airplanes.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_CARGO_DISPATCHER_AIRPLANE
|
-- @type AI_CARGO_DISPATCHER_AIRPLANE
|
||||||
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
-- @module AI.AI_Cargo_Dispatcher_Helicopter
|
-- @module AI.AI_Cargo_Dispatcher_Helicopter
|
||||||
-- @image AI_Cargo_Dispatching_For_Helicopters.JPG
|
-- @image AI_Cargo_Dispatching_For_Helicopters.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_DISPATCHER_HELICOPTER
|
-- @type AI_CARGO_DISPATCHER_HELICOPTER
|
||||||
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
-- @module AI.AI_Cargo_Dispatcher_Ship
|
-- @module AI.AI_Cargo_Dispatcher_Ship
|
||||||
-- @image AI_Cargo_Dispatcher.JPG
|
-- @image AI_Cargo_Dispatcher.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_DISPATCHER_SHIP
|
-- @type AI_CARGO_DISPATCHER_SHIP
|
||||||
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
||||||
|
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ AI_CARGO_DISPATCHER_SHIP = {
|
|||||||
-- local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart()
|
-- local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart()
|
||||||
-- local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart()
|
-- local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart()
|
||||||
-- NEED MORE THOUGHT - ShippingLane is part of Warehouse.......
|
-- NEED MORE THOUGHT - ShippingLane is part of Warehouse.......
|
||||||
-- local ShippingLane = GROUP:New():FilterPrefixes( "ShippingLane" ):FilterStart()
|
-- local ShippingLane = SET_GROUP:New():FilterPrefixes( "ShippingLane" ):FilterOnce():GetSetObjects()
|
||||||
--
|
--
|
||||||
-- AICargoDispatcherShip = AI_CARGO_DISPATCHER_SHIP:New( SetShip, SetCargoInfantry, SetPickupZones, SetDeployZones, ShippingLane )
|
-- AICargoDispatcherShip = AI_CARGO_DISPATCHER_SHIP:New( SetShip, SetCargoInfantry, SetPickupZones, SetDeployZones, ShippingLane )
|
||||||
-- AICargoDispatcherShip:Start()
|
-- AICargoDispatcherShip:Start()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
-- @module AI.AI_Cargo_Helicopter
|
-- @module AI.AI_Cargo_Helicopter
|
||||||
-- @image AI_Cargo_Dispatching_For_Helicopters.JPG
|
-- @image AI_Cargo_Dispatching_For_Helicopters.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_HELICOPTER
|
-- @type AI_CARGO_HELICOPTER
|
||||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ function AI_CARGO_HELICOPTER:SetLandingSpeedAndHeight(speed, height)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CARGO_HELICOPTER self
|
-- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
-- @param From
|
-- @param From
|
||||||
-- @param Event
|
-- @param Event
|
||||||
@@ -326,7 +326,7 @@ function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CARGO_HELICOPTER self
|
-- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
-- @param From
|
-- @param From
|
||||||
-- @param Event
|
-- @param Event
|
||||||
@@ -409,7 +409,7 @@ function AI_CARGO_HELICOPTER:onafterQueue( Helicopter, From, Event, To, Coordina
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CARGO_HELICOPTER self
|
-- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
-- @param From
|
-- @param From
|
||||||
-- @param Event
|
-- @param Event
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
-- @module AI.AI_Cargo_Ship
|
-- @module AI.AI_Cargo_Ship
|
||||||
-- @image AI_Cargo_Dispatcher.JPG
|
-- @image AI_Cargo_Dispatcher.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO_SHIP
|
-- @type AI_CARGO_SHIP
|
||||||
-- @extends AI.AI_Cargo#AI_CARGO
|
-- @extends AI.AI_Cargo#AI_CARGO
|
||||||
|
|
||||||
--- Brings a dynamic cargo handling capability for an AI naval group.
|
--- Brings a dynamic cargo handling capability for an AI naval group.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_ESCORT_DISPATCHER_REQUEST
|
-- @type AI_ESCORT_DISPATCHER_REQUEST
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ AI_ESCORT_DISPATCHER_REQUEST = {
|
|||||||
ClassName = "AI_ESCORT_DISPATCHER_REQUEST",
|
ClassName = "AI_ESCORT_DISPATCHER_REQUEST",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field #list
|
-- @field #list
|
||||||
AI_ESCORT_DISPATCHER_REQUEST.AI_Escorts = {}
|
AI_ESCORT_DISPATCHER_REQUEST.AI_Escorts = {}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ function AI_ESCORT_DISPATCHER_REQUEST:onafterStart( From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_DISPATCHER_REQUEST self
|
-- @param #AI_ESCORT_DISPATCHER_REQUEST self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_ESCORT_DISPATCHER_REQUEST:OnEventExit( EventData )
|
function AI_ESCORT_DISPATCHER_REQUEST:OnEventExit( EventData )
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ function AI_ESCORT_DISPATCHER_REQUEST:OnEventExit( EventData )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_DISPATCHER_REQUEST self
|
-- @param #AI_ESCORT_DISPATCHER_REQUEST self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_ESCORT_DISPATCHER_REQUEST:OnEventBirth( EventData )
|
function AI_ESCORT_DISPATCHER_REQUEST:OnEventBirth( EventData )
|
||||||
|
|
||||||
|
|||||||
@@ -136,12 +136,12 @@
|
|||||||
--
|
--
|
||||||
-- Escort groups can have their own mission. This menu item will allow the escort group to resume their Mission from a given waypoint.
|
-- Escort groups can have their own mission. This menu item will allow the escort group to resume their Mission from a given waypoint.
|
||||||
-- Note that this is really fantastic, as you now have the dynamic of taking control of the escort groups, and allowing them to resume their path or mission.
|
-- Note that this is really fantastic, as you now have the dynamic of taking control of the escort groups, and allowing them to resume their path or mission.
|
||||||
--
|
--
|
||||||
-- # Developer Note
|
-- # Developer Note
|
||||||
--
|
--
|
||||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||||
-- Therefore, this class is considered to be deprecated
|
-- Therefore, this class is considered to be deprecated
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- ### Authors: **FlightControl**
|
-- ### Authors: **FlightControl**
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_ESCORT_REQUEST
|
-- @type AI_ESCORT_REQUEST
|
||||||
-- @extends AI.AI_Escort#AI_ESCORT
|
-- @extends AI.AI_Escort#AI_ESCORT
|
||||||
|
|
||||||
--- AI_ESCORT_REQUEST class
|
--- AI_ESCORT_REQUEST class
|
||||||
@@ -228,7 +228,7 @@ function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortNa
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_REQUEST self
|
-- @param #AI_ESCORT_REQUEST self
|
||||||
function AI_ESCORT_REQUEST:SpawnEscort()
|
function AI_ESCORT_REQUEST:SpawnEscort()
|
||||||
|
|
||||||
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Hot )
|
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Hot )
|
||||||
@@ -253,7 +253,7 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
|||||||
self:_InitEscortMenus( EscortGroup )
|
self:_InitEscortMenus( EscortGroup )
|
||||||
self:_InitEscortRoute( EscortGroup )
|
self:_InitEscortRoute( EscortGroup )
|
||||||
|
|
||||||
--- @param #AI_ESCORT self
|
-- @param #AI_ESCORT self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function EscortGroup:OnEventDeadOrCrash( EventData )
|
function EscortGroup:OnEventDeadOrCrash( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
@@ -268,7 +268,7 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_REQUEST self
|
-- @param #AI_ESCORT_REQUEST self
|
||||||
-- @param Core.Set#SET_GROUP EscortGroupSet
|
-- @param Core.Set#SET_GROUP EscortGroupSet
|
||||||
function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
||||||
|
|
||||||
@@ -290,14 +290,14 @@ function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_REQUEST self
|
-- @param #AI_ESCORT_REQUEST self
|
||||||
-- @param Core.Set#SET_GROUP EscortGroupSet
|
-- @param Core.Set#SET_GROUP EscortGroupSet
|
||||||
function AI_ESCORT_REQUEST:onafterStop( EscortGroupSet )
|
function AI_ESCORT_REQUEST:onafterStop( EscortGroupSet )
|
||||||
|
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
EscortGroupSet:ForEachGroup(
|
EscortGroupSet:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP EscortGroup
|
-- @param Core.Group#GROUP EscortGroup
|
||||||
function( EscortGroup )
|
function( EscortGroup )
|
||||||
EscortGroup:WayPointInitialize()
|
EscortGroup:WayPointInitialize()
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
-- @field Core.Scheduler#SCHEDULER FollowScheduler The instance of the SCHEDULER class.
|
-- @field Core.Scheduler#SCHEDULER FollowScheduler The instance of the SCHEDULER class.
|
||||||
-- @field #number FollowDistance The current follow distance.
|
-- @field #number FollowDistance The current follow distance.
|
||||||
-- @field #boolean ReportTargets If true, nearby targets are reported.
|
-- @field #boolean ReportTargets If true, nearby targets are reported.
|
||||||
-- @field DCS#AI.Option.Air.val.ROE OptionROE Which ROE is set to the FollowGroup.
|
-- @Field DCSTypes#AI.Option.Air.val.ROE OptionROE Which ROE is set to the FollowGroup.
|
||||||
-- @field DCS#AI.Option.Air.val.REACTION_ON_THREAT OptionReactionOnThreat Which REACTION_ON_THREAT is set to the FollowGroup.
|
-- @field DCSTypes#AI.Option.Air.val.REACTION_ON_THREAT OptionReactionOnThreat Which REACTION_ON_THREAT is set to the FollowGroup.
|
||||||
-- @field #number dtFollow Time step between position updates.
|
-- @field #number dtFollow Time step between position updates.
|
||||||
|
|
||||||
|
|
||||||
@@ -92,12 +92,12 @@
|
|||||||
-- local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" )
|
-- local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" )
|
||||||
-- LargeFormation:FormationCenterWing( 500, 50, 0, 250, 250 )
|
-- LargeFormation:FormationCenterWing( 500, 50, 0, 250, 250 )
|
||||||
-- LargeFormation:__Start( 1 )
|
-- LargeFormation:__Start( 1 )
|
||||||
--
|
--
|
||||||
-- # Developer Note
|
-- # Developer Note
|
||||||
--
|
--
|
||||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||||
-- Therefore, this class is considered to be deprecated
|
-- Therefore, this class is considered to be deprecated
|
||||||
--
|
--
|
||||||
-- @field #AI_FORMATION
|
-- @field #AI_FORMATION
|
||||||
AI_FORMATION = {
|
AI_FORMATION = {
|
||||||
ClassName = "AI_FORMATION",
|
ClassName = "AI_FORMATION",
|
||||||
@@ -117,7 +117,7 @@ AI_FORMATION = {
|
|||||||
|
|
||||||
AI_FORMATION.__Enum = {}
|
AI_FORMATION.__Enum = {}
|
||||||
|
|
||||||
--- @type AI_FORMATION.__Enum.Formation
|
-- @type AI_FORMATION.__Enum.Formation
|
||||||
-- @field #number None
|
-- @field #number None
|
||||||
-- @field #number Line
|
-- @field #number Line
|
||||||
-- @field #number Trail
|
-- @field #number Trail
|
||||||
@@ -142,7 +142,7 @@ AI_FORMATION.__Enum.Formation = {
|
|||||||
Box = 10,
|
Box = 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @type AI_FORMATION.__Enum.Mode
|
-- @type AI_FORMATION.__Enum.Mode
|
||||||
-- @field #number Mission
|
-- @field #number Mission
|
||||||
-- @field #number Formation
|
-- @field #number Formation
|
||||||
AI_FORMATION.__Enum.Mode = {
|
AI_FORMATION.__Enum.Mode = {
|
||||||
@@ -152,13 +152,13 @@ AI_FORMATION.__Enum.Mode = {
|
|||||||
Reconnaissance = "R",
|
Reconnaissance = "R",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @type AI_FORMATION.__Enum.ReportType
|
-- @type AI_FORMATION.__Enum.ReportType
|
||||||
-- @field #number All
|
-- @field #number All
|
||||||
-- @field #number Airborne
|
-- @field #number Airborne
|
||||||
-- @field #number GroundRadar
|
-- @field #number GroundRadar
|
||||||
-- @field #number Ground
|
-- @field #number Ground
|
||||||
AI_FORMATION.__Enum.ReportType = {
|
AI_FORMATION.__Enum.ReportType = {
|
||||||
Airborne = "*",
|
All = "*",
|
||||||
Airborne = "A",
|
Airborne = "A",
|
||||||
GroundRadar = "R",
|
GroundRadar = "R",
|
||||||
Ground = "G",
|
Ground = "G",
|
||||||
@@ -996,7 +996,7 @@ function AI_FORMATION:SetFlightModeMission( FollowGroup )
|
|||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
|
||||||
else
|
else
|
||||||
self.FollowGroupSet:ForSomeGroupAlive(
|
self.FollowGroupSet:ForSomeGroupAlive(
|
||||||
--- @param Wrapper.Group#GROUP EscortGroup
|
-- @param Core.Group#GROUP EscortGroup
|
||||||
function( FollowGroup )
|
function( FollowGroup )
|
||||||
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
|
||||||
@@ -1020,7 +1020,7 @@ function AI_FORMATION:SetFlightModeAttack( FollowGroup )
|
|||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
|
||||||
else
|
else
|
||||||
self.FollowGroupSet:ForSomeGroupAlive(
|
self.FollowGroupSet:ForSomeGroupAlive(
|
||||||
--- @param Wrapper.Group#GROUP EscortGroup
|
-- @param Core.Group#GROUP EscortGroup
|
||||||
function( FollowGroup )
|
function( FollowGroup )
|
||||||
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
|
||||||
@@ -1044,7 +1044,7 @@ function AI_FORMATION:SetFlightModeFormation( FollowGroup )
|
|||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
||||||
else
|
else
|
||||||
self.FollowGroupSet:ForSomeGroupAlive(
|
self.FollowGroupSet:ForSomeGroupAlive(
|
||||||
--- @param Wrapper.Group#GROUP EscortGroup
|
-- @param Core.Group#GROUP EscortGroup
|
||||||
function( FollowGroup )
|
function( FollowGroup )
|
||||||
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
|
||||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
||||||
@@ -1222,7 +1222,7 @@ function AI_FORMATION:FollowMe(FollowGroup, ClientUnit, CT1, CV1, CT2, CV2)
|
|||||||
local CVI = {
|
local CVI = {
|
||||||
x = CV2.x + CS * 10 * math.sin(Ca),
|
x = CV2.x + CS * 10 * math.sin(Ca),
|
||||||
y = GH2.y + Inclination, -- + FollowFormation.y,
|
y = GH2.y + Inclination, -- + FollowFormation.y,
|
||||||
y = GH2.y,
|
--y = GH2.y,
|
||||||
z = CV2.z + CS * 10 * math.cos(Ca),
|
z = CV2.z + CS * 10 * math.cos(Ca),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ do -- ACT_ACCOUNT_DEADS
|
|||||||
|
|
||||||
--- DCS Events
|
--- DCS Events
|
||||||
|
|
||||||
--- @param #ACT_ACCOUNT_DEADS self
|
-- @param #ACT_ACCOUNT_DEADS self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function ACT_ACCOUNT_DEADS:OnEventHit( EventData )
|
function ACT_ACCOUNT_DEADS:OnEventHit( EventData )
|
||||||
self:T( { "EventDead", EventData } )
|
self:T( { "EventDead", EventData } )
|
||||||
@@ -285,7 +285,7 @@ do -- ACT_ACCOUNT_DEADS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #ACT_ACCOUNT_DEADS self
|
-- @param #ACT_ACCOUNT_DEADS self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function ACT_ACCOUNT_DEADS:onfuncEventDead( EventData )
|
function ACT_ACCOUNT_DEADS:onfuncEventDead( EventData )
|
||||||
self:T( { "EventDead", EventData } )
|
self:T( { "EventDead", EventData } )
|
||||||
@@ -297,7 +297,7 @@ do -- ACT_ACCOUNT_DEADS
|
|||||||
|
|
||||||
--- DCS Events
|
--- DCS Events
|
||||||
|
|
||||||
--- @param #ACT_ACCOUNT_DEADS self
|
-- @param #ACT_ACCOUNT_DEADS self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function ACT_ACCOUNT_DEADS:onfuncEventCrash( EventData )
|
function ACT_ACCOUNT_DEADS:onfuncEventCrash( EventData )
|
||||||
self:T( { "EventDead", EventData } )
|
self:T( { "EventDead", EventData } )
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ do -- ACT_ASSIST_SMOKE_TARGETS_ZONE
|
|||||||
function ACT_ASSIST_SMOKE_TARGETS_ZONE:onenterSmoking( ProcessUnit, From, Event, To )
|
function ACT_ASSIST_SMOKE_TARGETS_ZONE:onenterSmoking( ProcessUnit, From, Event, To )
|
||||||
|
|
||||||
self.TargetSetUnit:ForEachUnit(
|
self.TargetSetUnit:ForEachUnit(
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
-- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( SmokeUnit )
|
function( SmokeUnit )
|
||||||
if math.random( 1, ( 100 * self.TargetSetUnit:Count() ) / 4 ) <= 100 then
|
if math.random( 1, ( 100 * self.TargetSetUnit:Count() ) / 4 ) <= 100 then
|
||||||
SCHEDULER:New( self,
|
SCHEDULER:New( self,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ do -- CARGO_CRATE
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #CARGO_CRATE self
|
-- @param #CARGO_CRATE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function CARGO_CRATE:OnEventCargoDead( EventData )
|
function CARGO_CRATE:OnEventCargoDead( EventData )
|
||||||
|
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ do -- CARGO_GROUP
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get the amount of cargo units in the group.
|
--- Get the underlying GROUP object from the CARGO_GROUP.
|
||||||
-- @param #CARGO_GROUP self
|
-- @param #CARGO_GROUP self
|
||||||
-- @return #CARGO_GROUP
|
-- @return #CARGO_GROUP
|
||||||
function CARGO_GROUP:GetGroup( Cargo )
|
function CARGO_GROUP:GetGroup( Cargo )
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ do -- CARGO_SLINGLOAD
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #CARGO_SLINGLOAD self
|
-- @param #CARGO_SLINGLOAD self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function CARGO_SLINGLOAD:OnEventCargoDead( EventData )
|
function CARGO_SLINGLOAD:OnEventCargoDead( EventData )
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
-- @module Core.Base
|
-- @module Core.Base
|
||||||
-- @image Core_Base.JPG
|
-- @image Core_Base.JPG
|
||||||
|
|
||||||
local _TraceOnOff = true
|
local _TraceOnOff = false -- default to no tracing
|
||||||
local _TraceLevel = 1
|
local _TraceLevel = 1
|
||||||
local _TraceAll = false
|
local _TraceAll = false
|
||||||
local _TraceClass = {}
|
local _TraceClass = {}
|
||||||
@@ -741,7 +741,31 @@ do -- Event Handling
|
|||||||
-- @function [parent=#BASE] OnEventPlayerEnterAircraft
|
-- @function [parent=#BASE] OnEventPlayerEnterAircraft
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||||
|
|
||||||
|
--- Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
|
||||||
|
-- *** NOTE *** this is a workarounf for DCS not creating these events as of Aug 2024.
|
||||||
|
-- @function [parent=#BASE] OnEventNewDynamicCargo
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||||
|
|
||||||
|
--- Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
|
||||||
|
-- *** NOTE *** this is a workarounf for DCS not creating these events as of Aug 2024.
|
||||||
|
-- @function [parent=#BASE] OnEventDynamicCargoLoaded
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||||
|
|
||||||
|
--- Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
|
||||||
|
-- *** NOTE *** this is a workarounf for DCS not creating these events as of Aug 2024.
|
||||||
|
-- @function [parent=#BASE] OnEventDynamicCargoUnloaded
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||||
|
|
||||||
|
--- Occurs when a dynamic cargo crate is removed.
|
||||||
|
-- *** NOTE *** this is a workarounf for DCS not creating these events as of Aug 2024.
|
||||||
|
-- @function [parent=#BASE] OnEventDynamicCargoRemoved
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Creation of a Birth Event.
|
--- Creation of a Birth Event.
|
||||||
@@ -862,6 +886,62 @@ end
|
|||||||
|
|
||||||
world.onEvent(Event)
|
world.onEvent(Event)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function BASE:CreateEventNewDynamicCargo(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.NewDynamicCargo,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function BASE:CreateEventDynamicCargoLoaded(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoLoaded,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function BASE:CreateEventDynamicCargoUnloaded(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoUnloaded,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function BASE:CreateEventDynamicCargoRemoved(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoRemoved,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
--- The main event handling function... This function captures all events generated for the class.
|
--- The main event handling function... This function captures all events generated for the class.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
@@ -1200,7 +1280,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:F( Arguments )
|
function BASE:F( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
@@ -1215,7 +1295,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:F2( Arguments )
|
function BASE:F2( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true and _TraceLevel >= 2 then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
@@ -1230,7 +1310,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:F3( Arguments )
|
function BASE:F3( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true and _TraceLevel >= 3 then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
@@ -1274,7 +1354,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:T( Arguments )
|
function BASE:T( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
@@ -1289,7 +1369,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:T2( Arguments )
|
function BASE:T2( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true and _TraceLevel >= 2 then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
@@ -1304,7 +1384,7 @@ end
|
|||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
function BASE:T3( Arguments )
|
function BASE:T3( Arguments )
|
||||||
|
|
||||||
if BASE.Debug and _TraceOnOff then
|
if BASE.Debug and _TraceOnOff == true and _TraceLevel >= 3 then
|
||||||
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
local DebugInfoCurrent = BASE.Debug.getinfo( 2, "nl" )
|
||||||
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
local DebugInfoFrom = BASE.Debug.getinfo( 3, "l" )
|
||||||
|
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ end
|
|||||||
CLIENTMENUMANAGER = {
|
CLIENTMENUMANAGER = {
|
||||||
ClassName = "CLIENTMENUMANAGER",
|
ClassName = "CLIENTMENUMANAGER",
|
||||||
lid = "",
|
lid = "",
|
||||||
version = "0.1.5a",
|
version = "0.1.6",
|
||||||
name = nil,
|
name = nil,
|
||||||
clientset = nil,
|
clientset = nil,
|
||||||
menutree = {},
|
menutree = {},
|
||||||
@@ -740,7 +740,7 @@ function CLIENTMENUMANAGER:AddEntry(Entry,Client)
|
|||||||
for _,_client in pairs(Set) do
|
for _,_client in pairs(Set) do
|
||||||
local client = _client -- Wrapper.Client#CLIENT
|
local client = _client -- Wrapper.Client#CLIENT
|
||||||
if client and client:IsAlive() then
|
if client and client:IsAlive() then
|
||||||
local playername = client:GetPlayerName()
|
local playername = client:GetPlayerName() or "None"
|
||||||
local unitname = client:GetName()
|
local unitname = client:GetName()
|
||||||
if not knownunits[unitname] then
|
if not knownunits[unitname] then
|
||||||
knownunits[unitname] = true
|
knownunits[unitname] = true
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
-- * Manage database of hits to units and statics.
|
-- * Manage database of hits to units and statics.
|
||||||
-- * Manage database of destroys of units and statics.
|
-- * Manage database of destroys of units and statics.
|
||||||
-- * Manage database of @{Core.Zone#ZONE_BASE} objects.
|
-- * Manage database of @{Core.Zone#ZONE_BASE} objects.
|
||||||
|
-- * Manage database of @{Wrapper.DynamicCargo#DYNAMICCARGO} objects alive in the mission.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@@ -39,6 +40,7 @@
|
|||||||
-- @field #table STORAGES DCS warehouse storages.
|
-- @field #table STORAGES DCS warehouse storages.
|
||||||
-- @field #table STNS Used Link16 octal numbers for F16/15/18/AWACS planes.
|
-- @field #table STNS Used Link16 octal numbers for F16/15/18/AWACS planes.
|
||||||
-- @field #table SADL Used Link16 octal numbers for A10/C-II planes.
|
-- @field #table SADL Used Link16 octal numbers for A10/C-II planes.
|
||||||
|
-- @field #table DYNAMICCARGO Dynamic Cargo objects.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Contains collections of wrapper objects defined within MOOSE that reflect objects within the simulator.
|
--- Contains collections of wrapper objects defined within MOOSE that reflect objects within the simulator.
|
||||||
@@ -54,6 +56,7 @@
|
|||||||
-- * PLAYERS
|
-- * PLAYERS
|
||||||
-- * CARGOS
|
-- * CARGOS
|
||||||
-- * STORAGES (DCS warehouses)
|
-- * STORAGES (DCS warehouses)
|
||||||
|
-- * DYNAMICCARGO
|
||||||
--
|
--
|
||||||
-- On top, for internal MOOSE administration purposes, the DATABASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
|
-- On top, for internal MOOSE administration purposes, the DATABASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
|
||||||
--
|
--
|
||||||
@@ -97,6 +100,7 @@ DATABASE = {
|
|||||||
STORAGES = {},
|
STORAGES = {},
|
||||||
STNS={},
|
STNS={},
|
||||||
SADL={},
|
SADL={},
|
||||||
|
DYNAMICCARGO={},
|
||||||
}
|
}
|
||||||
|
|
||||||
local _DATABASECoalition =
|
local _DATABASECoalition =
|
||||||
@@ -135,7 +139,7 @@ function DATABASE:New()
|
|||||||
self:HandleEvent( EVENTS.Dead, self._EventOnDeadOrCrash )
|
self:HandleEvent( EVENTS.Dead, self._EventOnDeadOrCrash )
|
||||||
self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash )
|
self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash )
|
||||||
self:HandleEvent( EVENTS.RemoveUnit, self._EventOnDeadOrCrash )
|
self:HandleEvent( EVENTS.RemoveUnit, self._EventOnDeadOrCrash )
|
||||||
--self:HandleEvent( EVENTS.UnitLost, self._EventOnDeadOrCrash ) -- DCS 2.7.1 for Aerial units no dead event ATM
|
self:HandleEvent( EVENTS.UnitLost, self._EventOnDeadOrCrash ) -- DCS 2.7.1 for Aerial units no dead event ATM
|
||||||
self:HandleEvent( EVENTS.Hit, self.AccountHits )
|
self:HandleEvent( EVENTS.Hit, self.AccountHits )
|
||||||
self:HandleEvent( EVENTS.NewCargo )
|
self:HandleEvent( EVENTS.NewCargo )
|
||||||
self:HandleEvent( EVENTS.DeleteCargo )
|
self:HandleEvent( EVENTS.DeleteCargo )
|
||||||
@@ -143,6 +147,8 @@ function DATABASE:New()
|
|||||||
self:HandleEvent( EVENTS.DeleteZone )
|
self:HandleEvent( EVENTS.DeleteZone )
|
||||||
--self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit ) -- This is not working anymore!, handling this through the birth event.
|
--self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit ) -- This is not working anymore!, handling this through the birth event.
|
||||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit )
|
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit )
|
||||||
|
-- DCS 2.9.7 Moose own dynamic cargo events
|
||||||
|
self:HandleEvent( EVENTS.DynamicCargoRemoved, self._EventOnDynamicCargoRemoved)
|
||||||
|
|
||||||
self:_RegisterTemplates()
|
self:_RegisterTemplates()
|
||||||
self:_RegisterGroupsAndUnits()
|
self:_RegisterGroupsAndUnits()
|
||||||
@@ -170,24 +176,30 @@ end
|
|||||||
--- Adds a Unit based on the Unit Name in the DATABASE.
|
--- Adds a Unit based on the Unit Name in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string DCSUnitName Unit name.
|
-- @param #string DCSUnitName Unit name.
|
||||||
|
-- @param #boolean force
|
||||||
-- @return Wrapper.Unit#UNIT The added unit.
|
-- @return Wrapper.Unit#UNIT The added unit.
|
||||||
function DATABASE:AddUnit( DCSUnitName )
|
function DATABASE:AddUnit( DCSUnitName, force )
|
||||||
|
|
||||||
if not self.UNITS[DCSUnitName] then
|
local DCSunitName = DCSUnitName
|
||||||
|
|
||||||
|
if type(DCSunitName) == "number" then DCSunitName = string.format("%d",DCSUnitName) end
|
||||||
|
|
||||||
|
if not self.UNITS[DCSunitName] or force == true then
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T( { "Add UNIT:", DCSUnitName } )
|
self:T( { "Add UNIT:", DCSunitName } )
|
||||||
|
|
||||||
-- Register unit
|
-- Register unit
|
||||||
self.UNITS[DCSUnitName]=UNIT:Register(DCSUnitName)
|
self.UNITS[DCSunitName]=UNIT:Register(DCSunitName)
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.UNITS[DCSUnitName]
|
return self.UNITS[DCSunitName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Deletes a Unit from the DATABASE based on the Unit Name.
|
--- Deletes a Unit from the DATABASE based on the Unit Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:DeleteUnit( DCSUnitName )
|
function DATABASE:DeleteUnit( DCSUnitName )
|
||||||
|
self:T("DeleteUnit "..tostring(DCSUnitName))
|
||||||
self.UNITS[DCSUnitName] = nil
|
self.UNITS[DCSUnitName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -222,6 +234,34 @@ function DATABASE:FindStatic( StaticName )
|
|||||||
return StaticFound
|
return StaticFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add a DynamicCargo to the database.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string Name Name of the dynamic cargo.
|
||||||
|
-- @return Wrapper.DynamicCargo#DYNAMICCARGO The dynamic cargo object.
|
||||||
|
function DATABASE:AddDynamicCargo( Name )
|
||||||
|
if not self.DYNAMICCARGO[Name] then
|
||||||
|
self.DYNAMICCARGO[Name] = DYNAMICCARGO:Register(Name)
|
||||||
|
return self.DYNAMICCARGO[Name]
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Finds a DYNAMICCARGO based on the Dynamic Cargo Name.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string DynamicCargoName
|
||||||
|
-- @return Wrapper.DynamicCargo#DYNAMICCARGO The found DYNAMICCARGO.
|
||||||
|
function DATABASE:FindDynamicCargo( DynamicCargoName )
|
||||||
|
local StaticFound = self.DYNAMICCARGO[DynamicCargoName]
|
||||||
|
return StaticFound
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Deletes a DYNAMICCARGO from the DATABASE based on the Dynamic Cargo Name.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
function DATABASE:DeleteDynamicCargo( DynamicCargoName )
|
||||||
|
self.DYNAMICCARGO[DynamicCargoName] = nil
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Adds a Airbase based on the Airbase Name in the DATABASE.
|
--- Adds a Airbase based on the Airbase Name in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string AirbaseName The name of the airbase.
|
-- @param #string AirbaseName The name of the airbase.
|
||||||
@@ -813,14 +853,19 @@ end
|
|||||||
--- Adds a CLIENT based on the ClientName in the DATABASE.
|
--- Adds a CLIENT based on the ClientName in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string ClientName Name of the Client unit.
|
-- @param #string ClientName Name of the Client unit.
|
||||||
|
-- @param #boolean Force (optional) Force registration of client.
|
||||||
-- @return Wrapper.Client#CLIENT The client object.
|
-- @return Wrapper.Client#CLIENT The client object.
|
||||||
function DATABASE:AddClient( ClientName )
|
function DATABASE:AddClient( ClientName, Force )
|
||||||
|
|
||||||
if not self.CLIENTS[ClientName] then
|
local DCSUnitName = ClientName
|
||||||
self.CLIENTS[ClientName] = CLIENT:Register( ClientName )
|
|
||||||
|
if type(DCSUnitName) == "number" then DCSUnitName = string.format("%d",ClientName) end
|
||||||
|
|
||||||
|
if not self.CLIENTS[DCSUnitName] or Force == true then
|
||||||
|
self.CLIENTS[DCSUnitName] = CLIENT:Register( DCSUnitName )
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.CLIENTS[ClientName]
|
return self.CLIENTS[DCSUnitName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -831,15 +876,25 @@ end
|
|||||||
function DATABASE:FindGroup( GroupName )
|
function DATABASE:FindGroup( GroupName )
|
||||||
|
|
||||||
local GroupFound = self.GROUPS[GroupName]
|
local GroupFound = self.GROUPS[GroupName]
|
||||||
|
|
||||||
|
if GroupFound == nil and GroupName ~= nil and self.Templates.Groups[GroupName] == nil then
|
||||||
|
-- see if the group exists in the API, maybe a dynamic slot
|
||||||
|
self:_RegisterDynamicGroup(GroupName)
|
||||||
|
return self.GROUPS[GroupName]
|
||||||
|
end
|
||||||
|
|
||||||
return GroupFound
|
return GroupFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Adds a GROUP based on the GroupName in the DATABASE.
|
--- Adds a GROUP based on the GroupName in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:AddGroup( GroupName )
|
-- @param #string GroupName
|
||||||
|
-- @param #boolean force
|
||||||
|
-- @return Wrapper.Group#GROUP The Group
|
||||||
|
function DATABASE:AddGroup( GroupName, force )
|
||||||
|
|
||||||
if not self.GROUPS[GroupName] then
|
if not self.GROUPS[GroupName] or force == true then
|
||||||
self:T( { "Add GROUP:", GroupName } )
|
self:T( { "Add GROUP:", GroupName } )
|
||||||
self.GROUPS[GroupName] = GROUP:Register( GroupName )
|
self.GROUPS[GroupName] = GROUP:Register( GroupName )
|
||||||
end
|
end
|
||||||
@@ -850,9 +905,11 @@ end
|
|||||||
--- Adds a player based on the Player Name in the DATABASE.
|
--- Adds a player based on the Player Name in the DATABASE.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:AddPlayer( UnitName, PlayerName )
|
function DATABASE:AddPlayer( UnitName, PlayerName )
|
||||||
|
|
||||||
|
if type(UnitName) == "number" then UnitName = string.format("%d",UnitName) end
|
||||||
|
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
self:T( { "Add player for unit:", UnitName, PlayerName } )
|
self:I( { "Add player for unit:", UnitName, PlayerName } )
|
||||||
self.PLAYERS[PlayerName] = UnitName
|
self.PLAYERS[PlayerName] = UnitName
|
||||||
self.PLAYERUNITS[PlayerName] = self:FindUnit( UnitName )
|
self.PLAYERUNITS[PlayerName] = self:FindUnit( UnitName )
|
||||||
self.PLAYERSJOINED[PlayerName] = PlayerName
|
self.PLAYERSJOINED[PlayerName] = PlayerName
|
||||||
@@ -860,6 +917,21 @@ function DATABASE:AddPlayer( UnitName, PlayerName )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get a PlayerName by UnitName from PLAYERS in DATABASE.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @return #string PlayerName
|
||||||
|
-- @return Wrapper.Unit#UNIT PlayerUnit
|
||||||
|
function DATABASE:_FindPlayerNameByUnitName(UnitName)
|
||||||
|
if UnitName then
|
||||||
|
for playername,unitname in pairs(self.PLAYERS) do
|
||||||
|
if unitname == UnitName and self.PLAYERUNITS[playername] and self.PLAYERUNITS[playername]:IsAlive() then
|
||||||
|
return playername, self.PLAYERUNITS[playername]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
--- Deletes a player from the DATABASE based on the Player Name.
|
--- Deletes a player from the DATABASE based on the Player Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
function DATABASE:DeletePlayer( UnitName, PlayerName )
|
function DATABASE:DeletePlayer( UnitName, PlayerName )
|
||||||
@@ -1198,6 +1270,43 @@ function DATABASE:_RegisterStaticTemplate( StaticTemplate, CoalitionID, Category
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get a generic static cargo group template from scratch for dynamic cargo spawns register. Does not register the template!
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string Name Name of the static.
|
||||||
|
-- @param #string Typename Typename of the static. Defaults to "container_cargo".
|
||||||
|
-- @param #number Mass Mass of the static. Defaults to 0.
|
||||||
|
-- @param #number Coalition Coalition of the static. Defaults to coalition.side.BLUE.
|
||||||
|
-- @param #number Country Country of the static. Defaults to country.id.GERMANY.
|
||||||
|
-- @return #table Static template table.
|
||||||
|
function DATABASE:_GetGenericStaticCargoGroupTemplate(Name,Typename,Mass,Coalition,Country)
|
||||||
|
local StaticTemplate = {}
|
||||||
|
StaticTemplate.name = Name or "None"
|
||||||
|
StaticTemplate.units = { [1] = {
|
||||||
|
name = Name,
|
||||||
|
resourcePayload = {
|
||||||
|
["weapons"] = {},
|
||||||
|
["aircrafts"] = {},
|
||||||
|
["gasoline"] = 0,
|
||||||
|
["diesel"] = 0,
|
||||||
|
["methanol_mixture"] = 0,
|
||||||
|
["jet_fuel"] = 0,
|
||||||
|
},
|
||||||
|
["mass"] = Mass or 0,
|
||||||
|
["category"] = "Cargos",
|
||||||
|
["canCargo"] = true,
|
||||||
|
["type"] = Typename or "container_cargo",
|
||||||
|
["rate"] = 100,
|
||||||
|
["y"] = 0,
|
||||||
|
["x"] = 0,
|
||||||
|
["heading"] = 0,
|
||||||
|
}}
|
||||||
|
StaticTemplate.CategoryID = "static"
|
||||||
|
StaticTemplate.CoalitionID = Coalition or coalition.side.BLUE
|
||||||
|
StaticTemplate.CountryID = Country or country.id.GERMANY
|
||||||
|
--UTILS.PrintTableToLog(StaticTemplate)
|
||||||
|
return StaticTemplate
|
||||||
|
end
|
||||||
|
|
||||||
--- Get static group template.
|
--- Get static group template.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string StaticName Name of the static.
|
-- @param #string StaticName Name of the static.
|
||||||
@@ -1271,7 +1380,11 @@ end
|
|||||||
-- @param #string ClientName Name of the Client.
|
-- @param #string ClientName Name of the Client.
|
||||||
-- @return #number Coalition ID.
|
-- @return #number Coalition ID.
|
||||||
function DATABASE:GetCoalitionFromClientTemplate( ClientName )
|
function DATABASE:GetCoalitionFromClientTemplate( ClientName )
|
||||||
return self.Templates.ClientsByName[ClientName].CoalitionID
|
if self.Templates.ClientsByName[ClientName] then
|
||||||
|
return self.Templates.ClientsByName[ClientName].CoalitionID
|
||||||
|
end
|
||||||
|
self:E("WARNING: Template does not exist for client "..tostring(ClientName))
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get category ID from client name.
|
--- Get category ID from client name.
|
||||||
@@ -1279,7 +1392,11 @@ end
|
|||||||
-- @param #string ClientName Name of the Client.
|
-- @param #string ClientName Name of the Client.
|
||||||
-- @return #number Category ID.
|
-- @return #number Category ID.
|
||||||
function DATABASE:GetCategoryFromClientTemplate( ClientName )
|
function DATABASE:GetCategoryFromClientTemplate( ClientName )
|
||||||
return self.Templates.ClientsByName[ClientName].CategoryID
|
if self.Templates.ClientsByName[ClientName] then
|
||||||
|
return self.Templates.ClientsByName[ClientName].CategoryID
|
||||||
|
end
|
||||||
|
self:E("WARNING: Template does not exist for client "..tostring(ClientName))
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get country ID from client name.
|
--- Get country ID from client name.
|
||||||
@@ -1287,7 +1404,11 @@ end
|
|||||||
-- @param #string ClientName Name of the Client.
|
-- @param #string ClientName Name of the Client.
|
||||||
-- @return #number Country ID.
|
-- @return #number Country ID.
|
||||||
function DATABASE:GetCountryFromClientTemplate( ClientName )
|
function DATABASE:GetCountryFromClientTemplate( ClientName )
|
||||||
return self.Templates.ClientsByName[ClientName].CountryID
|
if self.Templates.ClientsByName[ClientName] then
|
||||||
|
return self.Templates.ClientsByName[ClientName].CountryID
|
||||||
|
end
|
||||||
|
self:E("WARNING: Template does not exist for client "..tostring(ClientName))
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Airbase
|
--- Airbase
|
||||||
@@ -1333,6 +1454,36 @@ function DATABASE:_RegisterPlayers()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Private method that registers a single dynamic slot Group and Units within in the mission.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @return #DATABASE self
|
||||||
|
function DATABASE:_RegisterDynamicGroup(Groupname)
|
||||||
|
local DCSGroup = Group.getByName(Groupname)
|
||||||
|
if DCSGroup and DCSGroup:isExist() then
|
||||||
|
|
||||||
|
-- Group name.
|
||||||
|
local DCSGroupName = DCSGroup:getName()
|
||||||
|
|
||||||
|
-- Add group.
|
||||||
|
self:I(string.format("Register Group: %s", tostring(DCSGroupName)))
|
||||||
|
self:AddGroup( DCSGroupName, true )
|
||||||
|
|
||||||
|
-- Loop over units in group.
|
||||||
|
for DCSUnitId, DCSUnit in pairs( DCSGroup:getUnits() ) do
|
||||||
|
|
||||||
|
-- Get unit name.
|
||||||
|
local DCSUnitName = DCSUnit:getName()
|
||||||
|
|
||||||
|
-- Add unit.
|
||||||
|
self:I(string.format("Register Unit: %s", tostring(DCSUnitName)))
|
||||||
|
self:AddUnit( tostring(DCSUnitName), true )
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:E({"Group does not exist: ", DCSGroup})
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Private method that registers all Groups and Units within in the mission.
|
--- Private method that registers all Groups and Units within in the mission.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
@@ -1476,7 +1627,7 @@ end
|
|||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnBirth( Event )
|
function DATABASE:_EventOnBirth( Event )
|
||||||
self:F( { Event } )
|
self:T( { Event } )
|
||||||
|
|
||||||
if Event.IniDCSUnit then
|
if Event.IniDCSUnit then
|
||||||
|
|
||||||
@@ -1484,7 +1635,17 @@ function DATABASE:_EventOnBirth( Event )
|
|||||||
|
|
||||||
-- Add static object to DB.
|
-- Add static object to DB.
|
||||||
self:AddStatic( Event.IniDCSUnitName )
|
self:AddStatic( Event.IniDCSUnitName )
|
||||||
|
|
||||||
|
elseif Event.IniObjectCategory == Object.Category.CARGO and string.match(Event.IniUnitName,".+|%d%d:%d%d|PKG%d+") then
|
||||||
|
|
||||||
|
-- Add dynamic cargo object to DB
|
||||||
|
|
||||||
|
local cargo = self:AddDynamicCargo(Event.IniDCSUnitName)
|
||||||
|
|
||||||
|
self:I(string.format("Adding dynamic cargo %s", tostring(Event.IniDCSUnitName)))
|
||||||
|
|
||||||
|
self:CreateEventNewDynamicCargo( cargo )
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if Event.IniObjectCategory == Object.Category.UNIT then
|
if Event.IniObjectCategory == Object.Category.UNIT then
|
||||||
@@ -1505,9 +1666,9 @@ function DATABASE:_EventOnBirth( Event )
|
|||||||
end
|
end
|
||||||
|
|
||||||
if Event.IniObjectCategory == Object.Category.UNIT then
|
if Event.IniObjectCategory == Object.Category.UNIT then
|
||||||
|
|
||||||
Event.IniUnit = self:FindUnit( Event.IniDCSUnitName )
|
|
||||||
Event.IniGroup = self:FindGroup( Event.IniDCSGroupName )
|
Event.IniGroup = self:FindGroup( Event.IniDCSGroupName )
|
||||||
|
Event.IniUnit = self:FindUnit( Event.IniDCSUnitName )
|
||||||
|
|
||||||
-- Client
|
-- Client
|
||||||
local client=self.CLIENTS[Event.IniDCSUnitName] --Wrapper.Client#CLIENT
|
local client=self.CLIENTS[Event.IniDCSUnitName] --Wrapper.Client#CLIENT
|
||||||
@@ -1523,10 +1684,10 @@ function DATABASE:_EventOnBirth( Event )
|
|||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:I(string.format("Player '%s' joined unit '%s' of group '%s'", tostring(PlayerName), tostring(Event.IniDCSUnitName), tostring(Event.IniDCSGroupName)))
|
self:I(string.format("Player '%s' joined unit '%s' of group '%s'", tostring(PlayerName), tostring(Event.IniDCSUnitName), tostring(Event.IniDCSGroupName)))
|
||||||
|
|
||||||
-- Add client in case it does not exist already.
|
-- Add client in case it does not exist already.
|
||||||
if not client then
|
if client == nil or (client and client:CountPlayers() == 0) then
|
||||||
client=self:AddClient(Event.IniDCSUnitName)
|
client=self:AddClient(Event.IniDCSUnitName, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add player.
|
-- Add player.
|
||||||
@@ -1536,14 +1697,19 @@ function DATABASE:_EventOnBirth( Event )
|
|||||||
if not self.PLAYERS[PlayerName] then
|
if not self.PLAYERS[PlayerName] then
|
||||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Player settings.
|
local function SetPlayerSettings(self,PlayerName,IniUnit)
|
||||||
local Settings = SETTINGS:Set( PlayerName )
|
-- Player settings.
|
||||||
Settings:SetPlayerMenu(Event.IniUnit)
|
local Settings = SETTINGS:Set( PlayerName )
|
||||||
|
--Settings:SetPlayerMenu(Event.IniUnit)
|
||||||
-- Create an event.
|
Settings:SetPlayerMenu(IniUnit)
|
||||||
self:CreateEventPlayerEnterAircraft(Event.IniUnit)
|
-- Create an event.
|
||||||
|
self:CreateEventPlayerEnterAircraft(IniUnit)
|
||||||
|
--self:CreateEventPlayerEnterAircraft(Event.IniUnit)
|
||||||
|
end
|
||||||
|
|
||||||
|
self:ScheduleOnce(1,SetPlayerSettings,self,PlayerName,Event.IniUnit)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1557,7 +1723,6 @@ end
|
|||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Core.Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnDeadOrCrash( Event )
|
function DATABASE:_EventOnDeadOrCrash( Event )
|
||||||
|
|
||||||
if Event.IniDCSUnit then
|
if Event.IniDCSUnit then
|
||||||
|
|
||||||
local name=Event.IniDCSUnitName
|
local name=Event.IniDCSUnitName
|
||||||
@@ -1565,7 +1730,7 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
|||||||
if Event.IniObjectCategory == 3 then
|
if Event.IniObjectCategory == 3 then
|
||||||
|
|
||||||
---
|
---
|
||||||
-- STATICS
|
-- STATICS
|
||||||
---
|
---
|
||||||
|
|
||||||
if self.STATICS[Event.IniDCSUnitName] then
|
if self.STATICS[Event.IniDCSUnitName] then
|
||||||
@@ -1575,7 +1740,7 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
|||||||
---
|
---
|
||||||
-- Maybe a UNIT?
|
-- Maybe a UNIT?
|
||||||
---
|
---
|
||||||
|
|
||||||
-- Delete unit.
|
-- Delete unit.
|
||||||
if self.UNITS[Event.IniDCSUnitName] then
|
if self.UNITS[Event.IniDCSUnitName] then
|
||||||
self:T("STATIC Event for UNIT "..tostring(Event.IniDCSUnitName))
|
self:T("STATIC Event for UNIT "..tostring(Event.IniDCSUnitName))
|
||||||
@@ -1598,7 +1763,8 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
|||||||
|
|
||||||
-- Delete unit.
|
-- Delete unit.
|
||||||
if self.UNITS[Event.IniDCSUnitName] then
|
if self.UNITS[Event.IniDCSUnitName] then
|
||||||
self:DeleteUnit(Event.IniDCSUnitName)
|
self:ScheduleOnce(1,self.DeleteUnit,self,Event.IniDCSUnitName)
|
||||||
|
--self:DeleteUnit(Event.IniDCSUnitName)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Remove client players.
|
-- Remove client players.
|
||||||
@@ -1665,6 +1831,15 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Handles the OnDynamicCargoRemoved event to clean the active dynamic cargo table.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param Core.Event#EVENTDATA Event
|
||||||
|
function DATABASE:_EventOnDynamicCargoRemoved( Event )
|
||||||
|
self:T( { Event } )
|
||||||
|
if Event.IniDynamicCargoName then
|
||||||
|
self:DeleteDynamicCargo(Event.IniDynamicCargoName)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
@@ -1706,6 +1881,7 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
|||||||
local client=self.CLIENTS[Event.IniDCSUnitName] --Wrapper.Client#CLIENT
|
local client=self.CLIENTS[Event.IniDCSUnitName] --Wrapper.Client#CLIENT
|
||||||
if client then
|
if client then
|
||||||
client:RemovePlayer(PlayerName)
|
client:RemovePlayer(PlayerName)
|
||||||
|
--self.PLAYERSETTINGS[PlayerName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -194,6 +194,11 @@ world.event.S_EVENT_NEW_ZONE_GOAL = world.event.S_EVENT_MAX + 1004
|
|||||||
world.event.S_EVENT_DELETE_ZONE_GOAL = world.event.S_EVENT_MAX + 1005
|
world.event.S_EVENT_DELETE_ZONE_GOAL = world.event.S_EVENT_MAX + 1005
|
||||||
world.event.S_EVENT_REMOVE_UNIT = world.event.S_EVENT_MAX + 1006
|
world.event.S_EVENT_REMOVE_UNIT = world.event.S_EVENT_MAX + 1006
|
||||||
world.event.S_EVENT_PLAYER_ENTER_AIRCRAFT = world.event.S_EVENT_MAX + 1007
|
world.event.S_EVENT_PLAYER_ENTER_AIRCRAFT = world.event.S_EVENT_MAX + 1007
|
||||||
|
-- dynamic cargo
|
||||||
|
world.event.S_EVENT_NEW_DYNAMIC_CARGO = world.event.S_EVENT_MAX + 1008
|
||||||
|
world.event.S_EVENT_DYNAMIC_CARGO_LOADED = world.event.S_EVENT_MAX + 1009
|
||||||
|
world.event.S_EVENT_DYNAMIC_CARGO_UNLOADED = world.event.S_EVENT_MAX + 1010
|
||||||
|
world.event.S_EVENT_DYNAMIC_CARGO_REMOVED = world.event.S_EVENT_MAX + 1011
|
||||||
|
|
||||||
|
|
||||||
--- The different types of events supported by MOOSE.
|
--- The different types of events supported by MOOSE.
|
||||||
@@ -261,17 +266,29 @@ EVENTS = {
|
|||||||
SimulationStart = world.event.S_EVENT_SIMULATION_START or -1,
|
SimulationStart = world.event.S_EVENT_SIMULATION_START or -1,
|
||||||
WeaponRearm = world.event.S_EVENT_WEAPON_REARM or -1,
|
WeaponRearm = world.event.S_EVENT_WEAPON_REARM or -1,
|
||||||
WeaponDrop = world.event.S_EVENT_WEAPON_DROP or -1,
|
WeaponDrop = world.event.S_EVENT_WEAPON_DROP or -1,
|
||||||
-- Added with DCS 2.9.0
|
-- Added with DCS 2.9.x
|
||||||
UnitTaskTimeout = world.event.S_EVENT_UNIT_TASK_TIMEOUT or -1,
|
--UnitTaskTimeout = world.event.S_EVENT_UNIT_TASK_TIMEOUT or -1,
|
||||||
|
UnitTaskComplete = world.event.S_EVENT_UNIT_TASK_COMPLETE or -1,
|
||||||
UnitTaskStage = world.event.S_EVENT_UNIT_TASK_STAGE or -1,
|
UnitTaskStage = world.event.S_EVENT_UNIT_TASK_STAGE or -1,
|
||||||
MacSubtaskScore = world.event.S_EVENT_MAC_SUBTASK_SCORE or -1,
|
--MacSubtaskScore = world.event.S_EVENT_MAC_SUBTASK_SCORE or -1,
|
||||||
MacExtraScore = world.event.S_EVENT_MAC_EXTRA_SCORE or -1,
|
MacExtraScore = world.event.S_EVENT_MAC_EXTRA_SCORE or -1,
|
||||||
MissionRestart = world.event.S_EVENT_MISSION_RESTART or -1,
|
MissionRestart = world.event.S_EVENT_MISSION_RESTART or -1,
|
||||||
MissionWinner = world.event.S_EVENT_MISSION_WINNER or -1,
|
MissionWinner = world.event.S_EVENT_MISSION_WINNER or -1,
|
||||||
PostponedTakeoff = world.event.S_EVENT_POSTPONED_TAKEOFF or -1,
|
RunwayTakeoff = world.event.S_EVENT_RUNWAY_TAKEOFF or -1,
|
||||||
PostponedLand = world.event.S_EVENT_POSTPONED_LAND or -1,
|
RunwayTouch = world.event.S_EVENT_RUNWAY_TOUCH or -1,
|
||||||
|
MacLMSRestart = world.event.S_EVENT_MAC_LMS_RESTART or -1,
|
||||||
|
SimulationFreeze = world.event.S_EVENT_SIMULATION_FREEZE or -1,
|
||||||
|
SimulationUnfreeze = world.event.S_EVENT_SIMULATION_UNFREEZE or -1,
|
||||||
|
HumanAircraftRepairStart = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_START or -1,
|
||||||
|
HumanAircraftRepairFinish = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH or -1,
|
||||||
|
-- dynamic cargo
|
||||||
|
NewDynamicCargo = world.event.S_EVENT_NEW_DYNAMIC_CARGO or -1,
|
||||||
|
DynamicCargoLoaded = world.event.S_EVENT_DYNAMIC_CARGO_LOADED or -1,
|
||||||
|
DynamicCargoUnloaded = world.event.S_EVENT_DYNAMIC_CARGO_UNLOADED or -1,
|
||||||
|
DynamicCargoRemoved = world.event.S_EVENT_DYNAMIC_CARGO_REMOVED or -1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- The Event structure
|
--- The Event structure
|
||||||
-- Note that at the beginning of each field description, there is an indication which field will be populated depending on the object type involved in the Event:
|
-- Note that at the beginning of each field description, there is an indication which field will be populated depending on the object type involved in the Event:
|
||||||
--
|
--
|
||||||
@@ -327,6 +344,9 @@ EVENTS = {
|
|||||||
--
|
--
|
||||||
-- @field Core.Zone#ZONE Zone The zone object.
|
-- @field Core.Zone#ZONE Zone The zone object.
|
||||||
-- @field #string ZoneName The name of the zone.
|
-- @field #string ZoneName The name of the zone.
|
||||||
|
--
|
||||||
|
-- @field Wrapper.DynamicCargo#DYNAMICCARGO IniDynamicCargo The dynamic cargo object.
|
||||||
|
-- @field #string IniDynamicCargoName The dynamic cargo unit name.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -646,24 +666,24 @@ local _EVENTMETA = {
|
|||||||
Text = "S_EVENT_WEAPON_DROP"
|
Text = "S_EVENT_WEAPON_DROP"
|
||||||
},
|
},
|
||||||
-- DCS 2.9
|
-- DCS 2.9
|
||||||
[EVENTS.UnitTaskTimeout] = {
|
--[EVENTS.UnitTaskTimeout] = {
|
||||||
Order = 1,
|
-- Order = 1,
|
||||||
Side = "I",
|
-- Side = "I",
|
||||||
Event = "OnEventUnitTaskTimeout",
|
-- Event = "OnEventUnitTaskTimeout",
|
||||||
Text = "S_EVENT_UNIT_TASK_TIMEOUT "
|
-- Text = "S_EVENT_UNIT_TASK_TIMEOUT "
|
||||||
},
|
--},
|
||||||
[EVENTS.UnitTaskStage] = {
|
[EVENTS.UnitTaskStage] = {
|
||||||
Order = 1,
|
Order = 1,
|
||||||
Side = "I",
|
Side = "I",
|
||||||
Event = "OnEventUnitTaskStage",
|
Event = "OnEventUnitTaskStage",
|
||||||
Text = "S_EVENT_UNIT_TASK_STAGE "
|
Text = "S_EVENT_UNIT_TASK_STAGE "
|
||||||
},
|
},
|
||||||
[EVENTS.MacSubtaskScore] = {
|
--[EVENTS.MacSubtaskScore] = {
|
||||||
Order = 1,
|
-- Order = 1,
|
||||||
Side = "I",
|
--Side = "I",
|
||||||
Event = "OnEventMacSubtaskScore",
|
--Event = "OnEventMacSubtaskScore",
|
||||||
Text = "S_EVENT_MAC_SUBTASK_SCORE"
|
--Text = "S_EVENT_MAC_SUBTASK_SCORE"
|
||||||
},
|
--},
|
||||||
[EVENTS.MacExtraScore] = {
|
[EVENTS.MacExtraScore] = {
|
||||||
Order = 1,
|
Order = 1,
|
||||||
Side = "I",
|
Side = "I",
|
||||||
@@ -682,20 +702,76 @@ local _EVENTMETA = {
|
|||||||
Event = "OnEventMissionWinner",
|
Event = "OnEventMissionWinner",
|
||||||
Text = "S_EVENT_MISSION_WINNER"
|
Text = "S_EVENT_MISSION_WINNER"
|
||||||
},
|
},
|
||||||
[EVENTS.PostponedTakeoff] = {
|
[EVENTS.RunwayTakeoff] = {
|
||||||
Order = 1,
|
Order = 1,
|
||||||
Side = "I",
|
Side = "I",
|
||||||
Event = "OnEventPostponedTakeoff",
|
Event = "OnEventRunwayTakeoff",
|
||||||
Text = "S_EVENT_POSTPONED_TAKEOFF"
|
Text = "S_EVENT_RUNWAY_TAKEOFF"
|
||||||
},
|
},
|
||||||
[EVENTS.PostponedLand] = {
|
[EVENTS.RunwayTouch] = {
|
||||||
Order = 1,
|
Order = 1,
|
||||||
Side = "I",
|
Side = "I",
|
||||||
Event = "OnEventPostponedLand",
|
Event = "OnEventRunwayTouch",
|
||||||
Text = "S_EVENT_POSTPONED_LAND"
|
Text = "S_EVENT_RUNWAY_TOUCH"
|
||||||
|
},
|
||||||
|
[EVENTS.MacLMSRestart] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventMacLMSRestart",
|
||||||
|
Text = "S_EVENT_MAC_LMS_RESTART"
|
||||||
|
},
|
||||||
|
[EVENTS.SimulationFreeze] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventSimulationFreeze",
|
||||||
|
Text = "S_EVENT_SIMULATION_FREEZE"
|
||||||
|
},
|
||||||
|
[EVENTS.SimulationUnfreeze] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventSimulationUnfreeze",
|
||||||
|
Text = "S_EVENT_SIMULATION_UNFREEZE"
|
||||||
|
},
|
||||||
|
[EVENTS.HumanAircraftRepairStart] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventHumanAircraftRepairStart",
|
||||||
|
Text = "S_EVENT_HUMAN_AIRCRAFT_REPAIR_START"
|
||||||
|
},
|
||||||
|
[EVENTS.HumanAircraftRepairFinish] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventHumanAircraftRepairFinish",
|
||||||
|
Text = "S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH"
|
||||||
|
},
|
||||||
|
-- dynamic cargo
|
||||||
|
[EVENTS.NewDynamicCargo] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventNewDynamicCargo",
|
||||||
|
Text = "S_EVENT_NEW_DYNAMIC_CARGO"
|
||||||
|
},
|
||||||
|
[EVENTS.DynamicCargoLoaded] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventDynamicCargoLoaded",
|
||||||
|
Text = "S_EVENT_DYNAMIC_CARGO_LOADED"
|
||||||
|
},
|
||||||
|
[EVENTS.DynamicCargoUnloaded] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventDynamicCargoUnloaded",
|
||||||
|
Text = "S_EVENT_DYNAMIC_CARGO_UNLOADED"
|
||||||
|
},
|
||||||
|
[EVENTS.DynamicCargoRemoved] = {
|
||||||
|
Order = 1,
|
||||||
|
Side = "I",
|
||||||
|
Event = "OnEventDynamicCargoRemoved",
|
||||||
|
Text = "S_EVENT_DYNAMIC_CARGO_REMOVED"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- The Events structure
|
--- The Events structure
|
||||||
-- @type EVENT.Events
|
-- @type EVENT.Events
|
||||||
-- @field #number IniUnit
|
-- @field #number IniUnit
|
||||||
@@ -1108,7 +1184,63 @@ do -- Event Creation
|
|||||||
|
|
||||||
world.onEvent( Event )
|
world.onEvent( Event )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
|
||||||
|
-- @param #EVENT self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function EVENT:CreateEventNewDynamicCargo(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.NewDynamicCargo,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
|
||||||
|
-- @param #EVENT self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function EVENT:CreateEventDynamicCargoLoaded(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoLoaded,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
|
||||||
|
-- @param #EVENT self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function EVENT:CreateEventDynamicCargoUnloaded(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoUnloaded,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
|
||||||
|
-- @param #EVENT self
|
||||||
|
-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo the dynamic cargo object
|
||||||
|
function EVENT:CreateEventDynamicCargoRemoved(DynamicCargo)
|
||||||
|
self:F({DynamicCargo})
|
||||||
|
local Event = {
|
||||||
|
id = EVENTS.DynamicCargoRemoved,
|
||||||
|
time = timer.getTime(),
|
||||||
|
dynamiccargo = DynamicCargo,
|
||||||
|
initiator = DynamicCargo:GetDCSObject(),
|
||||||
|
}
|
||||||
|
world.onEvent( Event )
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Main event function.
|
--- Main event function.
|
||||||
@@ -1223,7 +1355,13 @@ function EVENT:onEvent( Event )
|
|||||||
Event.IniDCSUnit = Event.initiator
|
Event.IniDCSUnit = Event.initiator
|
||||||
Event.IniDCSUnitName = Event.IniDCSUnit:getName()
|
Event.IniDCSUnitName = Event.IniDCSUnit:getName()
|
||||||
Event.IniUnitName = Event.IniDCSUnitName
|
Event.IniUnitName = Event.IniDCSUnitName
|
||||||
Event.IniUnit = CARGO:FindByName( Event.IniDCSUnitName )
|
if string.match(Event.IniUnitName,".+|%d%d:%d%d|PKG%d+") then
|
||||||
|
Event.IniDynamicCargo = DYNAMICCARGO:FindByName(Event.IniUnitName)
|
||||||
|
Event.IniDynamicCargoName = Event.IniUnitName
|
||||||
|
Event.IniPlayerName = string.match(Event.IniUnitName,"^(.+)|%d%d:%d%d|PKG%d+")
|
||||||
|
else
|
||||||
|
Event.IniUnit = CARGO:FindByName( Event.IniDCSUnitName )
|
||||||
|
end
|
||||||
Event.IniCoalition = Event.IniDCSUnit:getCoalition()
|
Event.IniCoalition = Event.IniDCSUnit:getCoalition()
|
||||||
Event.IniCategory = Event.IniDCSUnit:getDesc().category
|
Event.IniCategory = Event.IniDCSUnit:getDesc().category
|
||||||
Event.IniTypeName = Event.IniDCSUnit:getTypeName()
|
Event.IniTypeName = Event.IniDCSUnit:getTypeName()
|
||||||
@@ -1344,15 +1482,15 @@ function EVENT:onEvent( Event )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Weapon.
|
-- Weapon.
|
||||||
if Event.weapon then
|
if Event.weapon and type(Event.weapon) == "table" and Event.weapon.isExist and Event.weapon:isExist() then
|
||||||
Event.Weapon = Event.weapon
|
Event.Weapon = Event.weapon
|
||||||
Event.WeaponName = Event.Weapon:getTypeName()
|
Event.WeaponName = Event.weapon:isExist() and Event.weapon:getTypeName() or "Unknown Weapon"
|
||||||
Event.WeaponUNIT = CLIENT:Find( Event.Weapon, '', true ) -- Sometimes, the weapon is a player unit!
|
Event.WeaponUNIT = CLIENT:Find( Event.Weapon, '', true ) -- Sometimes, the weapon is a player unit!
|
||||||
Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon.getPlayerName and Event.Weapon:getPlayerName()
|
Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon.getPlayerName and Event.Weapon:getPlayerName()
|
||||||
--Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon:getPlayerName()
|
--Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon:getPlayerName()
|
||||||
Event.WeaponCoalition = Event.WeaponUNIT and Event.Weapon:getCoalition()
|
Event.WeaponCoalition = Event.WeaponUNIT and Event.Weapon.getCoalition and Event.Weapon:getCoalition()
|
||||||
Event.WeaponCategory = Event.WeaponUNIT and Event.Weapon:getDesc().category
|
Event.WeaponCategory = Event.WeaponUNIT and Event.Weapon.getDesc and Event.Weapon:getDesc().category
|
||||||
Event.WeaponTypeName = Event.WeaponUNIT and Event.Weapon:getTypeName()
|
Event.WeaponTypeName = Event.WeaponUNIT and Event.Weapon.getTypeName and Event.Weapon:getTypeName()
|
||||||
--Event.WeaponTgtDCSUnit = Event.Weapon:getTarget()
|
--Event.WeaponTgtDCSUnit = Event.Weapon:getTarget()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1387,6 +1525,15 @@ function EVENT:onEvent( Event )
|
|||||||
Event.Cargo = Event.cargo
|
Event.Cargo = Event.cargo
|
||||||
Event.CargoName = Event.cargo.Name
|
Event.CargoName = Event.cargo.Name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Dynamic cargo Object
|
||||||
|
if Event.dynamiccargo then
|
||||||
|
Event.IniDynamicCargo = Event.dynamiccargo
|
||||||
|
Event.IniDynamicCargoName = Event.IniDynamicCargo.StaticName
|
||||||
|
if Event.IniDynamicCargo.Owner or Event.IniUnitName then
|
||||||
|
Event.IniPlayerName = Event.IniDynamicCargo.Owner or string.match(Event.IniUnitName or "None|00:00|PKG00","^(.+)|%d%d:%d%d|PKG%d+")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Zone object.
|
-- Zone object.
|
||||||
if Event.zone then
|
if Event.zone then
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
do -- FSM
|
do -- FSM
|
||||||
|
|
||||||
--- @type FSM
|
-- @type FSM
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @field Core.Scheduler#SCHEDULER CallScheduler Call scheduler.
|
-- @field Core.Scheduler#SCHEDULER CallScheduler Call scheduler.
|
||||||
-- @field #table options Options.
|
-- @field #table options Options.
|
||||||
@@ -949,7 +949,7 @@ end
|
|||||||
|
|
||||||
do -- FSM_CONTROLLABLE
|
do -- FSM_CONTROLLABLE
|
||||||
|
|
||||||
--- @type FSM_CONTROLLABLE
|
-- @type FSM_CONTROLLABLE
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
@@ -1082,7 +1082,7 @@ end
|
|||||||
|
|
||||||
do -- FSM_PROCESS
|
do -- FSM_PROCESS
|
||||||
|
|
||||||
--- @type FSM_PROCESS
|
-- @type FSM_PROCESS
|
||||||
-- @field Tasking.Task#TASK Task
|
-- @field Tasking.Task#TASK Task
|
||||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
do -- Goal
|
do -- Goal
|
||||||
|
|
||||||
--- @type GOAL
|
-- @type GOAL
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- Models processes that have an objective with a defined achievement. Derived classes implement the ways how the achievements can be realized.
|
--- Models processes that have an objective with a defined achievement. Derived classes implement the ways how the achievements can be realized.
|
||||||
@@ -71,10 +71,10 @@ do -- Goal
|
|||||||
ClassName = "GOAL",
|
ClassName = "GOAL",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field #table GOAL.Players
|
-- @field #table GOAL.Players
|
||||||
GOAL.Players = {}
|
GOAL.Players = {}
|
||||||
|
|
||||||
--- @field #number GOAL.TotalContributions
|
-- @field #number GOAL.TotalContributions
|
||||||
GOAL.TotalContributions = 0
|
GOAL.TotalContributions = 0
|
||||||
|
|
||||||
--- GOAL Constructor.
|
--- GOAL Constructor.
|
||||||
@@ -145,7 +145,7 @@ do -- Goal
|
|||||||
self.TotalContributions = self.TotalContributions + 1
|
self.TotalContributions = self.TotalContributions + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #GOAL self
|
-- @param #GOAL self
|
||||||
-- @param #number Player contribution.
|
-- @param #number Player contribution.
|
||||||
function GOAL:GetPlayerContribution( PlayerName )
|
function GOAL:GetPlayerContribution( PlayerName )
|
||||||
return self.Players[PlayerName] or 0
|
return self.Players[PlayerName] or 0
|
||||||
|
|||||||
@@ -177,40 +177,22 @@ end
|
|||||||
--
|
--
|
||||||
-- -- Send the 2 messages created with the @{New} method to the Client Group.
|
-- -- Send the 2 messages created with the @{New} method to the Client Group.
|
||||||
-- -- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
|
-- -- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
|
||||||
-- ClientGroup = Group.getByName( "ClientGroup" )
|
-- Client = CLIENT:FindByName("NameOfClientUnit")
|
||||||
--
|
--
|
||||||
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
|
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" ):ToClient( Client )
|
||||||
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
|
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score" ):ToClient( Client )
|
||||||
-- or
|
-- or
|
||||||
-- MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25 ):ToClient( ClientGroup )
|
-- MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score"):ToClient( Client )
|
||||||
-- MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25 ):ToClient( ClientGroup )
|
-- MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score"):ToClient( Client )
|
||||||
-- or
|
-- or
|
||||||
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25 )
|
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score")
|
||||||
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25 )
|
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")
|
||||||
-- MessageClient1:ToClient( ClientGroup )
|
-- MessageClient1:ToClient( Client )
|
||||||
-- MessageClient2:ToClient( ClientGroup )
|
-- MessageClient2:ToClient( Client )
|
||||||
--
|
--
|
||||||
function MESSAGE:ToClient( Client, Settings )
|
function MESSAGE:ToClient( Client, Settings )
|
||||||
self:F( Client )
|
self:F( Client )
|
||||||
|
self:ToUnit(Client,Settings)
|
||||||
if Client and Client:GetClientGroupID() then
|
|
||||||
|
|
||||||
if self.MessageType then
|
|
||||||
local Settings = Settings or ( Client and _DATABASE:GetPlayerSettings( Client:GetPlayerName() ) ) or _SETTINGS -- Core.Settings#SETTINGS
|
|
||||||
self.MessageDuration = Settings:GetMessageTime( self.MessageType )
|
|
||||||
self.MessageCategory = "" -- self.MessageType .. ": "
|
|
||||||
end
|
|
||||||
|
|
||||||
local Unit = Client:GetClient()
|
|
||||||
|
|
||||||
if self.MessageDuration ~= 0 then
|
|
||||||
local ClientGroupID = Client:GetClientGroupID()
|
|
||||||
self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration )
|
|
||||||
--trigger.action.outTextForGroup( ClientGroupID, self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen)
|
|
||||||
trigger.action.outTextForUnit( Unit:GetID(), self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -257,6 +239,7 @@ function MESSAGE:ToUnit( Unit, Settings )
|
|||||||
|
|
||||||
if self.MessageDuration ~= 0 then
|
if self.MessageDuration ~= 0 then
|
||||||
self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration )
|
self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration )
|
||||||
|
local ID = Unit:GetID()
|
||||||
trigger.action.outTextForUnit( Unit:GetID(), self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration, self.ClearScreen )
|
trigger.action.outTextForUnit( Unit:GetID(), self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration, self.ClearScreen )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -305,11 +288,11 @@ end
|
|||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Send a message created with the @{New} method to the BLUE coalition.
|
-- -- Send a message created with the @{New} method to the BLUE coalition.
|
||||||
-- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25):ToBlue()
|
-- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToBlue()
|
||||||
-- or
|
-- or
|
||||||
-- MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 ):ToBlue()
|
-- MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToBlue()
|
||||||
-- or
|
-- or
|
||||||
-- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 )
|
-- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", 25, "Penalty")
|
||||||
-- MessageBLUE:ToBlue()
|
-- MessageBLUE:ToBlue()
|
||||||
--
|
--
|
||||||
function MESSAGE:ToBlue()
|
function MESSAGE:ToBlue()
|
||||||
@@ -326,11 +309,11 @@ end
|
|||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Send a message created with the @{New} method to the RED coalition.
|
-- -- Send a message created with the @{New} method to the RED coalition.
|
||||||
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 ):ToRed()
|
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToRed()
|
||||||
-- or
|
-- or
|
||||||
-- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 ):ToRed()
|
-- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToRed()
|
||||||
-- or
|
-- or
|
||||||
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 )
|
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty")
|
||||||
-- MessageRED:ToRed()
|
-- MessageRED:ToRed()
|
||||||
--
|
--
|
||||||
function MESSAGE:ToRed()
|
function MESSAGE:ToRed()
|
||||||
@@ -349,11 +332,11 @@ end
|
|||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Send a message created with the @{New} method to the RED coalition.
|
-- -- Send a message created with the @{New} method to the RED coalition.
|
||||||
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 ):ToCoalition( coalition.side.RED )
|
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToCoalition( coalition.side.RED )
|
||||||
-- or
|
-- or
|
||||||
-- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 ):ToCoalition( coalition.side.RED )
|
-- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty"):ToCoalition( coalition.side.RED )
|
||||||
-- or
|
-- or
|
||||||
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25 )
|
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty")
|
||||||
-- MessageRED:ToCoalition( coalition.side.RED )
|
-- MessageRED:ToCoalition( coalition.side.RED )
|
||||||
--
|
--
|
||||||
function MESSAGE:ToCoalition( CoalitionSide, Settings )
|
function MESSAGE:ToCoalition( CoalitionSide, Settings )
|
||||||
@@ -399,13 +382,13 @@ end
|
|||||||
-- @return #MESSAGE self
|
-- @return #MESSAGE self
|
||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Send a message created to all players.
|
-- -- Send a message created to all players.
|
||||||
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25 ):ToAll()
|
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission"):ToAll()
|
||||||
-- or
|
-- or
|
||||||
-- MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25 ):ToAll()
|
-- MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission"):ToAll()
|
||||||
-- or
|
-- or
|
||||||
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25 )
|
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission")
|
||||||
-- MessageAll:ToAll()
|
-- MessageAll:ToAll()
|
||||||
--
|
--
|
||||||
function MESSAGE:ToAll( Settings, Delay )
|
function MESSAGE:ToAll( Settings, Delay )
|
||||||
self:F()
|
self:F()
|
||||||
|
|||||||
@@ -2233,7 +2233,7 @@ do -- COORDINATE
|
|||||||
-- local MarkGroup = GROUP:FindByName( "AttackGroup" )
|
-- local MarkGroup = GROUP:FindByName( "AttackGroup" )
|
||||||
-- local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup )
|
-- local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup )
|
||||||
-- <<< logic >>>
|
-- <<< logic >>>
|
||||||
-- RemoveMark( MarkID ) -- The mark is now removed
|
-- TargetCoord:RemoveMark( MarkID ) -- The mark is now removed
|
||||||
function COORDINATE:RemoveMark( MarkID )
|
function COORDINATE:RemoveMark( MarkID )
|
||||||
trigger.action.removeMark( MarkID )
|
trigger.action.removeMark( MarkID )
|
||||||
end
|
end
|
||||||
@@ -2669,9 +2669,9 @@ do -- COORDINATE
|
|||||||
local date=UTILS.GetDCSMissionDate()
|
local date=UTILS.GetDCSMissionDate()
|
||||||
|
|
||||||
-- Debug output.
|
-- Debug output.
|
||||||
--self:I(string.format("Sun rise at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff))
|
--self:I(string.format("Sun rise at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%s sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), tonumber(sunrise) or "0", Tdiff))
|
||||||
|
|
||||||
if InSeconds then
|
if InSeconds or type(sunrise) == "string" then
|
||||||
return sunrise
|
return sunrise
|
||||||
else
|
else
|
||||||
return UTILS.SecondsToClock(sunrise, true)
|
return UTILS.SecondsToClock(sunrise, true)
|
||||||
@@ -2747,7 +2747,10 @@ do -- COORDINATE
|
|||||||
|
|
||||||
local sunrise=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, true, Tdiff)
|
local sunrise=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, true, Tdiff)
|
||||||
local sunset=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, false, Tdiff)
|
local sunset=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, false, Tdiff)
|
||||||
|
|
||||||
|
if sunrise == "N/R" then return false end
|
||||||
|
if sunrise == "N/S" then return true end
|
||||||
|
|
||||||
local time=UTILS.ClockToSeconds(clock)
|
local time=UTILS.ClockToSeconds(clock)
|
||||||
|
|
||||||
-- Check if time is between sunrise and sunset.
|
-- Check if time is between sunrise and sunset.
|
||||||
@@ -2834,9 +2837,9 @@ do -- COORDINATE
|
|||||||
local date=UTILS.GetDCSMissionDate()
|
local date=UTILS.GetDCSMissionDate()
|
||||||
|
|
||||||
-- Debug output.
|
-- Debug output.
|
||||||
--self:I(string.format("Sun set at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff))
|
--self:I(string.format("Sun set at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%s sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), tostring(sunrise) or "0", Tdiff))
|
||||||
|
|
||||||
if InSeconds then
|
if InSeconds or type(sunrise) == "string" then
|
||||||
return sunrise
|
return sunrise
|
||||||
else
|
else
|
||||||
return UTILS.SecondsToClock(sunrise, true)
|
return UTILS.SecondsToClock(sunrise, true)
|
||||||
@@ -3411,7 +3414,7 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param #number Radius (Optional) Radius to check around the coordinate, defaults to 50m (100m diameter)
|
-- @param #number Radius (Optional) Radius to check around the coordinate, defaults to 50m (100m diameter)
|
||||||
-- @param #number Minelevation (Optional) Elevation from which on a area is defined as steep, defaults to 8% (8m height gain across 100 meters)
|
-- @param #number Minelevation (Optional) Elevation from which on a area is defined as steep, defaults to 8% (8m height gain across 100 meters)
|
||||||
-- @return #boolen IsSteep If true, area is steep
|
-- @return #boolean IsSteep If true, area is steep
|
||||||
-- @return #number MaxElevation Elevation in meters measured over 100m
|
-- @return #number MaxElevation Elevation in meters measured over 100m
|
||||||
function COORDINATE:IsInSteepArea(Radius,Minelevation)
|
function COORDINATE:IsInSteepArea(Radius,Minelevation)
|
||||||
local steep = false
|
local steep = false
|
||||||
@@ -3443,7 +3446,7 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param #number Radius (Optional) Radius to check around the coordinate, defaults to 50m (100m diameter)
|
-- @param #number Radius (Optional) Radius to check around the coordinate, defaults to 50m (100m diameter)
|
||||||
-- @param #number Minelevation (Optional) Elevation from which on a area is defined as steep, defaults to 8% (8m height gain across 100 meters)
|
-- @param #number Minelevation (Optional) Elevation from which on a area is defined as steep, defaults to 8% (8m height gain across 100 meters)
|
||||||
-- @return #boolen IsFlat If true, area is flat
|
-- @return #boolean IsFlat If true, area is flat
|
||||||
-- @return #number MaxElevation Elevation in meters measured over 100m
|
-- @return #number MaxElevation Elevation in meters measured over 100m
|
||||||
function COORDINATE:IsInFlatArea(Radius,Minelevation)
|
function COORDINATE:IsInFlatArea(Radius,Minelevation)
|
||||||
local steep, elev = self:IsInSteepArea(Radius,Minelevation)
|
local steep, elev = self:IsInSteepArea(Radius,Minelevation)
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
-- @module Core.Report
|
-- @module Core.Report
|
||||||
-- @image Core_Report.JPG
|
-- @image Core_Report.JPG
|
||||||
|
|
||||||
--- @type REPORT
|
---
|
||||||
|
-- @type REPORT
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Provides a handy means to create messages and reports.
|
--- Provides a handy means to create messages and reports.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--- **Core** - SCHEDULEDISPATCHER dispatches the different schedules.
|
---- **Core** - SCHEDULEDISPATCHER dispatches the different schedules.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,9 @@
|
|||||||
-- @module Core.Settings
|
-- @module Core.Settings
|
||||||
-- @image Core_Settings.JPG
|
-- @image Core_Settings.JPG
|
||||||
|
|
||||||
--- @type SETTINGS
|
|
||||||
|
---
|
||||||
|
-- @type SETTINGS
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Takes care of various settings that influence the behavior of certain functionalities and classes within the MOOSE framework.
|
--- Takes care of various settings that influence the behavior of certain functionalities and classes within the MOOSE framework.
|
||||||
@@ -218,7 +220,8 @@ SETTINGS = {
|
|||||||
|
|
||||||
SETTINGS.__Enum = {}
|
SETTINGS.__Enum = {}
|
||||||
|
|
||||||
--- @type SETTINGS.__Enum.Era
|
---
|
||||||
|
-- @type SETTINGS.__Enum.Era
|
||||||
-- @field #number WWII
|
-- @field #number WWII
|
||||||
-- @field #number Korea
|
-- @field #number Korea
|
||||||
-- @field #number Cold
|
-- @field #number Cold
|
||||||
@@ -491,7 +494,7 @@ do -- SETTINGS
|
|||||||
return (self.A2ASystem and self.A2ASystem == "MGRS") or (not self.A2ASystem and _SETTINGS:IsA2A_MGRS())
|
return (self.A2ASystem and self.A2ASystem == "MGRS") or (not self.A2ASystem and _SETTINGS:IsA2A_MGRS())
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
-- @param Wrapper.Group#GROUP MenuGroup Group for which to add menus.
|
-- @param Wrapper.Group#GROUP MenuGroup Group for which to add menus.
|
||||||
-- @param #table RootMenu Root menu table
|
-- @param #table RootMenu Root menu table
|
||||||
-- @return #SETTINGS
|
-- @return #SETTINGS
|
||||||
@@ -737,8 +740,8 @@ do -- SETTINGS
|
|||||||
if _SETTINGS.ShowPlayerMenu == true then
|
if _SETTINGS.ShowPlayerMenu == true then
|
||||||
|
|
||||||
local PlayerGroup = PlayerUnit:GetGroup()
|
local PlayerGroup = PlayerUnit:GetGroup()
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName() or "None"
|
||||||
local PlayerNames = PlayerGroup:GetPlayerNames()
|
--local PlayerNames = PlayerGroup:GetPlayerNames()
|
||||||
|
|
||||||
local PlayerMenu = MENU_GROUP:New( PlayerGroup, 'Settings "' .. PlayerName .. '"' )
|
local PlayerMenu = MENU_GROUP:New( PlayerGroup, 'Settings "' .. PlayerName .. '"' )
|
||||||
|
|
||||||
@@ -945,49 +948,49 @@ do -- SETTINGS
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:A2GMenuSystem( MenuGroup, RootMenu, A2GSystem )
|
function SETTINGS:A2GMenuSystem( MenuGroup, RootMenu, A2GSystem )
|
||||||
self.A2GSystem = A2GSystem
|
self.A2GSystem = A2GSystem
|
||||||
MESSAGE:New( string.format( "Settings: Default A2G coordinate system set to %s for all players!", A2GSystem ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default A2G coordinate system set to %s for all players!", A2GSystem ), 5 ):ToAll()
|
||||||
self:SetSystemMenu( MenuGroup, RootMenu )
|
self:SetSystemMenu( MenuGroup, RootMenu )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:A2AMenuSystem( MenuGroup, RootMenu, A2ASystem )
|
function SETTINGS:A2AMenuSystem( MenuGroup, RootMenu, A2ASystem )
|
||||||
self.A2ASystem = A2ASystem
|
self.A2ASystem = A2ASystem
|
||||||
MESSAGE:New( string.format( "Settings: Default A2A coordinate system set to %s for all players!", A2ASystem ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default A2A coordinate system set to %s for all players!", A2ASystem ), 5 ):ToAll()
|
||||||
self:SetSystemMenu( MenuGroup, RootMenu )
|
self:SetSystemMenu( MenuGroup, RootMenu )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuLL_DDM_Accuracy( MenuGroup, RootMenu, LL_Accuracy )
|
function SETTINGS:MenuLL_DDM_Accuracy( MenuGroup, RootMenu, LL_Accuracy )
|
||||||
self.LL_Accuracy = LL_Accuracy
|
self.LL_Accuracy = LL_Accuracy
|
||||||
MESSAGE:New( string.format( "Settings: Default LL accuracy set to %s for all players!", LL_Accuracy ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default LL accuracy set to %s for all players!", LL_Accuracy ), 5 ):ToAll()
|
||||||
self:SetSystemMenu( MenuGroup, RootMenu )
|
self:SetSystemMenu( MenuGroup, RootMenu )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuMGRS_Accuracy( MenuGroup, RootMenu, MGRS_Accuracy )
|
function SETTINGS:MenuMGRS_Accuracy( MenuGroup, RootMenu, MGRS_Accuracy )
|
||||||
self.MGRS_Accuracy = MGRS_Accuracy
|
self.MGRS_Accuracy = MGRS_Accuracy
|
||||||
MESSAGE:New( string.format( "Settings: Default MGRS accuracy set to %s for all players!", MGRS_Accuracy ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default MGRS accuracy set to %s for all players!", MGRS_Accuracy ), 5 ):ToAll()
|
||||||
self:SetSystemMenu( MenuGroup, RootMenu )
|
self:SetSystemMenu( MenuGroup, RootMenu )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuMWSystem( MenuGroup, RootMenu, MW )
|
function SETTINGS:MenuMWSystem( MenuGroup, RootMenu, MW )
|
||||||
self.Metric = MW
|
self.Metric = MW
|
||||||
MESSAGE:New( string.format( "Settings: Default measurement format set to %s for all players!", MW and "Metric" or "Imperial" ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default measurement format set to %s for all players!", MW and "Metric" or "Imperial" ), 5 ):ToAll()
|
||||||
self:SetSystemMenu( MenuGroup, RootMenu )
|
self:SetSystemMenu( MenuGroup, RootMenu )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuMessageTimingsSystem( MenuGroup, RootMenu, MessageType, MessageTime )
|
function SETTINGS:MenuMessageTimingsSystem( MenuGroup, RootMenu, MessageType, MessageTime )
|
||||||
self:SetMessageTime( MessageType, MessageTime )
|
self:SetMessageTime( MessageType, MessageTime )
|
||||||
MESSAGE:New( string.format( "Settings: Default message time set for %s to %d.", MessageType, MessageTime ), 5 ):ToAll()
|
MESSAGE:New( string.format( "Settings: Default message time set for %s to %d.", MessageType, MessageTime ), 5 ):ToAll()
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupA2GSystem( PlayerUnit, PlayerGroup, PlayerName, A2GSystem )
|
function SETTINGS:MenuGroupA2GSystem( PlayerUnit, PlayerGroup, PlayerName, A2GSystem )
|
||||||
--BASE:E( {PlayerUnit:GetName(), A2GSystem } )
|
--BASE:E( {PlayerUnit:GetName(), A2GSystem } )
|
||||||
self.A2GSystem = A2GSystem
|
self.A2GSystem = A2GSystem
|
||||||
@@ -998,7 +1001,7 @@ do -- SETTINGS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupA2ASystem( PlayerUnit, PlayerGroup, PlayerName, A2ASystem )
|
function SETTINGS:MenuGroupA2ASystem( PlayerUnit, PlayerGroup, PlayerName, A2ASystem )
|
||||||
self.A2ASystem = A2ASystem
|
self.A2ASystem = A2ASystem
|
||||||
MESSAGE:New( string.format( "Settings: A2A format set to %s for player %s.", A2ASystem, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
MESSAGE:New( string.format( "Settings: A2A format set to %s for player %s.", A2ASystem, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
||||||
@@ -1008,7 +1011,7 @@ do -- SETTINGS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupLL_DDM_AccuracySystem( PlayerUnit, PlayerGroup, PlayerName, LL_Accuracy )
|
function SETTINGS:MenuGroupLL_DDM_AccuracySystem( PlayerUnit, PlayerGroup, PlayerName, LL_Accuracy )
|
||||||
self.LL_Accuracy = LL_Accuracy
|
self.LL_Accuracy = LL_Accuracy
|
||||||
MESSAGE:New( string.format( "Settings: LL format accuracy set to %d decimal places for player %s.", LL_Accuracy, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
MESSAGE:New( string.format( "Settings: LL format accuracy set to %d decimal places for player %s.", LL_Accuracy, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
||||||
@@ -1018,7 +1021,7 @@ do -- SETTINGS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupMGRS_AccuracySystem( PlayerUnit, PlayerGroup, PlayerName, MGRS_Accuracy )
|
function SETTINGS:MenuGroupMGRS_AccuracySystem( PlayerUnit, PlayerGroup, PlayerName, MGRS_Accuracy )
|
||||||
self.MGRS_Accuracy = MGRS_Accuracy
|
self.MGRS_Accuracy = MGRS_Accuracy
|
||||||
MESSAGE:New( string.format( "Settings: MGRS format accuracy set to %d for player %s.", MGRS_Accuracy, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
MESSAGE:New( string.format( "Settings: MGRS format accuracy set to %d for player %s.", MGRS_Accuracy, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
||||||
@@ -1028,7 +1031,7 @@ do -- SETTINGS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupMWSystem( PlayerUnit, PlayerGroup, PlayerName, MW )
|
function SETTINGS:MenuGroupMWSystem( PlayerUnit, PlayerGroup, PlayerName, MW )
|
||||||
self.Metric = MW
|
self.Metric = MW
|
||||||
MESSAGE:New( string.format( "Settings: Measurement format set to %s for player %s.", MW and "Metric" or "Imperial", PlayerName ), 5 ):ToGroup( PlayerGroup )
|
MESSAGE:New( string.format( "Settings: Measurement format set to %s for player %s.", MW and "Metric" or "Imperial", PlayerName ), 5 ):ToGroup( PlayerGroup )
|
||||||
@@ -1038,7 +1041,7 @@ do -- SETTINGS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
-- @param #SETTINGS self
|
||||||
function SETTINGS:MenuGroupMessageTimingsSystem( PlayerUnit, PlayerGroup, PlayerName, MessageType, MessageTime )
|
function SETTINGS:MenuGroupMessageTimingsSystem( PlayerUnit, PlayerGroup, PlayerName, MessageType, MessageTime )
|
||||||
self:SetMessageTime( MessageType, MessageTime )
|
self:SetMessageTime( MessageType, MessageTime )
|
||||||
MESSAGE:New( string.format( "Settings: Default message time set for %s to %d.", MessageType, MessageTime ), 5 ):ToGroup( PlayerGroup )
|
MESSAGE:New( string.format( "Settings: Default message time set for %s to %d.", MessageType, MessageTime ), 5 ):ToGroup( PlayerGroup )
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -189,6 +189,7 @@ function SPAWNSTATIC:NewFromType(StaticType, StaticCategory, CountryID)
|
|||||||
self.InitStaticCategory=StaticCategory
|
self.InitStaticCategory=StaticCategory
|
||||||
self.CountryID=CountryID or country.id.USA
|
self.CountryID=CountryID or country.id.USA
|
||||||
self.SpawnTemplatePrefix=self.InitStaticType
|
self.SpawnTemplatePrefix=self.InitStaticType
|
||||||
|
self.TemplateStaticUnit = {}
|
||||||
|
|
||||||
self.InitStaticCoordinate=COORDINATE:New(0, 0, 0)
|
self.InitStaticCoordinate=COORDINATE:New(0, 0, 0)
|
||||||
self.InitStaticHeading=0
|
self.InitStaticHeading=0
|
||||||
@@ -196,6 +197,61 @@ function SPAWNSTATIC:NewFromType(StaticType, StaticCategory, CountryID)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (Internal/Cargo) Init the resource table for STATIC object that should be spawned containing storage objects.
|
||||||
|
-- NOTE that you have to init many other parameters as the resources.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #number CombinedWeight The weight this cargo object should have (some have fixed weights!), defaults to 1kg.
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:_InitResourceTable(CombinedWeight)
|
||||||
|
if not self.TemplateStaticUnit.resourcePayload then
|
||||||
|
self.TemplateStaticUnit.resourcePayload = {
|
||||||
|
["weapons"] = {},
|
||||||
|
["aircrafts"] = {},
|
||||||
|
["gasoline"] = 0,
|
||||||
|
["diesel"] = 0,
|
||||||
|
["methanol_mixture"] = 0,
|
||||||
|
["jet_fuel"] = 0,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
self:InitCargo(true)
|
||||||
|
self:InitCargoMass(CombinedWeight or 1)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- (User/Cargo) Add to resource table for STATIC object that should be spawned containing storage objects. Inits the object table if necessary and sets it to be cargo for helicopters.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #string Type Type of cargo. Known types are: STORAGE.Type.WEAPONS, STORAGE.Type.LIQUIDS, STORAGE.Type.AIRCRAFT. Liquids are fuel.
|
||||||
|
-- @param #string Name Name of the cargo type. Liquids can be STORAGE.LiquidName.JETFUEL, STORAGE.LiquidName.GASOLINE, STORAGE.LiquidName.MW50 and STORAGE.LiquidName.DIESEL. The currently available weapon items are available in the `ENUMS.Storage.weapons`, e.g. `ENUMS.Storage.weapons.bombs.Mk_82Y`. Aircraft go by their typename.
|
||||||
|
-- @param #number Amount of tons (liquids) or number (everything else) to add.
|
||||||
|
-- @param #number CombinedWeight Combined weight to be set to this static cargo object. NOTE - some static cargo objects have fixed weights!
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:AddCargoResource(Type,Name,Amount,CombinedWeight)
|
||||||
|
if not self.TemplateStaticUnit.resourcePayload then
|
||||||
|
self:_InitResourceTable(CombinedWeight)
|
||||||
|
end
|
||||||
|
if Type == STORAGE.Type.LIQUIDS and type(Name) == "string" then
|
||||||
|
self.TemplateStaticUnit.resourcePayload[Name] = Amount
|
||||||
|
else
|
||||||
|
self.TemplateStaticUnit.resourcePayload[Type] = {
|
||||||
|
[Name] = {
|
||||||
|
["amount"] = Amount,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
UTILS.PrintTableToLog(self.TemplateStaticUnit)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- (User/Cargo) Resets resource table to zero for STATIC object that should be spawned containing storage objects. Inits the object table if necessary and sets it to be cargo for helicopters.
|
||||||
|
-- Handy if you spawn from cargo statics which have resources already set.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:ResetCargoResources()
|
||||||
|
self.TemplateStaticUnit.resourcePayload = nil
|
||||||
|
self:_InitResourceTable()
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Initialize heading of the spawned static.
|
--- Initialize heading of the spawned static.
|
||||||
-- @param #SPAWNSTATIC self
|
-- @param #SPAWNSTATIC self
|
||||||
-- @param Core.Point#COORDINATE Coordinate Position where the static is spawned.
|
-- @param Core.Point#COORDINATE Coordinate Position where the static is spawned.
|
||||||
@@ -317,6 +373,25 @@ function SPAWNSTATIC:InitLinkToUnit(Unit, OffsetX, OffsetY, OffsetAngle)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Allows to place a CallFunction hook when a new static spawns.
|
||||||
|
-- The provided method will be called when a new group is spawned, including its given parameters.
|
||||||
|
-- The first parameter of the SpawnFunction is the @{Wrapper.Static#STATIC} that was spawned.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #function SpawnCallBackFunction The function to be called when a group spawns.
|
||||||
|
-- @param SpawnFunctionArguments A random amount of arguments to be provided to the function when the group spawns.
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:OnSpawnStatic( SpawnCallBackFunction, ... )
|
||||||
|
self:F( "OnSpawnStatic" )
|
||||||
|
|
||||||
|
self.SpawnFunctionHook = SpawnCallBackFunction
|
||||||
|
self.SpawnFunctionArguments = {}
|
||||||
|
if arg then
|
||||||
|
self.SpawnFunctionArguments = arg
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Spawn a new STATIC object.
|
--- Spawn a new STATIC object.
|
||||||
-- @param #SPAWNSTATIC self
|
-- @param #SPAWNSTATIC self
|
||||||
-- @param #number Heading (Optional) The heading of the static, which is a number in degrees from 0 to 360. Default is the heading of the template.
|
-- @param #number Heading (Optional) The heading of the static, which is a number in degrees from 0 to 360. Default is the heading of the template.
|
||||||
@@ -488,7 +563,7 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
-- ED's dirty way to spawn FARPS.
|
-- ED's dirty way to spawn FARPS.
|
||||||
Static=coalition.addGroup(CountryID, -1, TemplateGroup)
|
Static=coalition.addGroup(CountryID, -1, TemplateGroup)
|
||||||
|
|
||||||
-- Currently DCS 2.8 does not trigger birth events if FAPRS are spawned!
|
-- Currently DCS 2.8 does not trigger birth events if FARPS are spawned!
|
||||||
-- We create such an event. The airbase is registered in Core.Event
|
-- We create such an event. The airbase is registered in Core.Event
|
||||||
local Event = {
|
local Event = {
|
||||||
id = EVENTS.Birth,
|
id = EVENTS.Birth,
|
||||||
@@ -503,6 +578,12 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
self:T2({Template=Template})
|
self:T2({Template=Template})
|
||||||
Static=coalition.addStaticObject(CountryID, Template)
|
Static=coalition.addStaticObject(CountryID, Template)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- If there is a SpawnFunction hook defined, call it.
|
||||||
|
if self.SpawnFunctionHook then
|
||||||
|
-- delay calling this for .3 seconds so that it hopefully comes after the BIRTH event of the group.
|
||||||
|
self:ScheduleOnce(0.3,self.SpawnFunctionHook,mystatic, unpack(self.SpawnFunctionArguments))
|
||||||
|
end
|
||||||
|
|
||||||
return mystatic
|
return mystatic
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
do -- UserFlag
|
do -- UserFlag
|
||||||
|
|
||||||
--- @type USERFLAG
|
-- @type USERFLAG
|
||||||
-- @field #string ClassName Name of the class
|
-- @field #string ClassName Name of the class
|
||||||
-- @field #string UserFlagName Name of the flag.
|
-- @field #string UserFlagName Name of the flag.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
@@ -58,7 +58,7 @@ do -- UserFlag
|
|||||||
|
|
||||||
--- Set the userflag to a given Number.
|
--- Set the userflag to a given Number.
|
||||||
-- @param #USERFLAG self
|
-- @param #USERFLAG self
|
||||||
-- @param #number Number The number value to be checked if it is the same as the userflag.
|
-- @param #number Number The number value to set the flag to.
|
||||||
-- @param #number Delay Delay in seconds, before the flag is set.
|
-- @param #number Delay Delay in seconds, before the flag is set.
|
||||||
-- @return #USERFLAG The userflag instance.
|
-- @return #USERFLAG The userflag instance.
|
||||||
-- @usage
|
-- @usage
|
||||||
@@ -104,4 +104,4 @@ do -- UserFlag
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
do -- Velocity
|
do -- Velocity
|
||||||
|
|
||||||
--- @type VELOCITY
|
-- @type VELOCITY
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ end
|
|||||||
|
|
||||||
do -- VELOCITY_POSITIONABLE
|
do -- VELOCITY_POSITIONABLE
|
||||||
|
|
||||||
--- @type VELOCITY_POSITIONABLE
|
-- @type VELOCITY_POSITIONABLE
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ ZONE_BASE = {
|
|||||||
-- @return #ZONE_BASE self
|
-- @return #ZONE_BASE self
|
||||||
function ZONE_BASE:New( ZoneName )
|
function ZONE_BASE:New( ZoneName )
|
||||||
local self = BASE:Inherit( self, FSM:New() )
|
local self = BASE:Inherit( self, FSM:New() )
|
||||||
self:F( ZoneName )
|
--self:F( ZoneName )
|
||||||
|
|
||||||
self.ZoneName = ZoneName
|
self.ZoneName = ZoneName
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ end
|
|||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @return #string The name of the zone.
|
-- @return #string The name of the zone.
|
||||||
function ZONE_BASE:GetName()
|
function ZONE_BASE:GetName()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
return self.ZoneName
|
return self.ZoneName
|
||||||
end
|
end
|
||||||
@@ -167,7 +167,7 @@ end
|
|||||||
-- @param #string ZoneName The name of the zone.
|
-- @param #string ZoneName The name of the zone.
|
||||||
-- @return #ZONE_BASE
|
-- @return #ZONE_BASE
|
||||||
function ZONE_BASE:SetName( ZoneName )
|
function ZONE_BASE:SetName( ZoneName )
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
self.ZoneName = ZoneName
|
self.ZoneName = ZoneName
|
||||||
end
|
end
|
||||||
@@ -177,7 +177,7 @@ end
|
|||||||
-- @param DCS#Vec2 Vec2 The Vec2 to test.
|
-- @param DCS#Vec2 Vec2 The Vec2 to test.
|
||||||
-- @return #boolean true if the Vec2 is within the zone.
|
-- @return #boolean true if the Vec2 is within the zone.
|
||||||
function ZONE_BASE:IsVec2InZone( Vec2 )
|
function ZONE_BASE:IsVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
--self:F2( Vec2 )
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -232,13 +232,13 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return Core.Point#POINT_VEC2 The PointVec2 of the zone.
|
-- @return Core.Point#POINT_VEC2 The PointVec2 of the zone.
|
||||||
function ZONE_BASE:GetPointVec2()
|
function ZONE_BASE:GetPointVec2()
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
local Vec2 = self:GetVec2()
|
local Vec2 = self:GetVec2()
|
||||||
|
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
|
|
||||||
self:T2( { PointVec2 } )
|
--self:T2( { PointVec2 } )
|
||||||
|
|
||||||
return PointVec2
|
return PointVec2
|
||||||
end
|
end
|
||||||
@@ -248,7 +248,7 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return DCS#Vec3 The Vec3 of the zone.
|
-- @return DCS#Vec3 The Vec3 of the zone.
|
||||||
function ZONE_BASE:GetVec3( Height )
|
function ZONE_BASE:GetVec3( Height )
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
Height = Height or 0
|
Height = Height or 0
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ function ZONE_BASE:GetVec3( Height )
|
|||||||
|
|
||||||
local Vec3 = { x = Vec2.x, y = Height and Height or land.getHeight( self:GetVec2() ), z = Vec2.y }
|
local Vec3 = { x = Vec2.x, y = Height and Height or land.getHeight( self:GetVec2() ), z = Vec2.y }
|
||||||
|
|
||||||
self:T2( { Vec3 } )
|
--self:T2( { Vec3 } )
|
||||||
|
|
||||||
return Vec3
|
return Vec3
|
||||||
end
|
end
|
||||||
@@ -266,13 +266,13 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return Core.Point#POINT_VEC3 The PointVec3 of the zone.
|
-- @return Core.Point#POINT_VEC3 The PointVec3 of the zone.
|
||||||
function ZONE_BASE:GetPointVec3( Height )
|
function ZONE_BASE:GetPointVec3( Height )
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
local Vec3 = self:GetVec3( Height )
|
local Vec3 = self:GetVec3( Height )
|
||||||
|
|
||||||
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
||||||
|
|
||||||
self:T2( { PointVec3 } )
|
--self:T2( { PointVec3 } )
|
||||||
|
|
||||||
return PointVec3
|
return PointVec3
|
||||||
end
|
end
|
||||||
@@ -282,7 +282,7 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return Core.Point#COORDINATE The Coordinate of the zone.
|
-- @return Core.Point#COORDINATE The Coordinate of the zone.
|
||||||
function ZONE_BASE:GetCoordinate( Height ) --R2.1
|
function ZONE_BASE:GetCoordinate( Height ) --R2.1
|
||||||
self:F2(self.ZoneName)
|
--self:F2(self.ZoneName)
|
||||||
|
|
||||||
local Vec3 = self:GetVec3( Height )
|
local Vec3 = self:GetVec3( Height )
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@ end
|
|||||||
--- Bound the zone boundaries with a tires.
|
--- Bound the zone boundaries with a tires.
|
||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
function ZONE_BASE:BoundZone()
|
function ZONE_BASE:BoundZone()
|
||||||
self:F2()
|
--self:F2()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set draw coalition of zone.
|
--- Set draw coalition of zone.
|
||||||
@@ -510,7 +510,7 @@ end
|
|||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color.
|
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color.
|
||||||
function ZONE_BASE:SmokeZone( SmokeColor )
|
function ZONE_BASE:SmokeZone( SmokeColor )
|
||||||
self:F2( SmokeColor )
|
--self:F2( SmokeColor )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -519,7 +519,7 @@ end
|
|||||||
-- @param #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
-- @param #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
||||||
-- @return #ZONE_BASE self
|
-- @return #ZONE_BASE self
|
||||||
function ZONE_BASE:SetZoneProbability( ZoneProbability )
|
function ZONE_BASE:SetZoneProbability( ZoneProbability )
|
||||||
self:F( { self:GetName(), ZoneProbability = ZoneProbability } )
|
--self:F( { self:GetName(), ZoneProbability = ZoneProbability } )
|
||||||
|
|
||||||
self.ZoneProbability = ZoneProbability or 1
|
self.ZoneProbability = ZoneProbability or 1
|
||||||
return self
|
return self
|
||||||
@@ -529,7 +529,7 @@ end
|
|||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @return #number A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
-- @return #number A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
||||||
function ZONE_BASE:GetZoneProbability()
|
function ZONE_BASE:GetZoneProbability()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
return self.ZoneProbability
|
return self.ZoneProbability
|
||||||
end
|
end
|
||||||
@@ -560,7 +560,7 @@ end
|
|||||||
-- -- The result should be that Zone1 would be more probable selected than Zone2.
|
-- -- The result should be that Zone1 would be more probable selected than Zone2.
|
||||||
--
|
--
|
||||||
function ZONE_BASE:GetZoneMaybe()
|
function ZONE_BASE:GetZoneMaybe()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
local Randomization = math.random()
|
local Randomization = math.random()
|
||||||
if Randomization <= self.ZoneProbability then
|
if Randomization <= self.ZoneProbability then
|
||||||
@@ -791,7 +791,7 @@ function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone )
|
|||||||
|
|
||||||
-- Inherit ZONE_BASE.
|
-- Inherit ZONE_BASE.
|
||||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) ) -- #ZONE_RADIUS
|
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) ) -- #ZONE_RADIUS
|
||||||
self:F( { ZoneName, Vec2, Radius } )
|
--self:F( { ZoneName, Vec2, Radius } )
|
||||||
|
|
||||||
self.Radius = Radius
|
self.Radius = Radius
|
||||||
self.Vec2 = Vec2
|
self.Vec2 = Vec2
|
||||||
@@ -947,7 +947,7 @@ end
|
|||||||
-- @param #number AddOffSet (optional) The angle to be added for the smoking start position.
|
-- @param #number AddOffSet (optional) The angle to be added for the smoking start position.
|
||||||
-- @return #ZONE_RADIUS self
|
-- @return #ZONE_RADIUS self
|
||||||
function ZONE_RADIUS:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset )
|
function ZONE_RADIUS:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset )
|
||||||
self:F2( SmokeColor )
|
--self:F2( SmokeColor )
|
||||||
|
|
||||||
local Point = {}
|
local Point = {}
|
||||||
local Vec2 = self:GetVec2()
|
local Vec2 = self:GetVec2()
|
||||||
@@ -978,7 +978,7 @@ end
|
|||||||
-- @param #number AddHeight (optional) The height to be added for the smoke.
|
-- @param #number AddHeight (optional) The height to be added for the smoke.
|
||||||
-- @return #ZONE_RADIUS self
|
-- @return #ZONE_RADIUS self
|
||||||
function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth, AddHeight )
|
function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth, AddHeight )
|
||||||
self:F2( { FlareColor, Azimuth } )
|
--self:F2( { FlareColor, Azimuth } )
|
||||||
|
|
||||||
local Point = {}
|
local Point = {}
|
||||||
local Vec2 = self:GetVec2()
|
local Vec2 = self:GetVec2()
|
||||||
@@ -1004,9 +1004,9 @@ end
|
|||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @return DCS#Distance The radius of the zone.
|
-- @return DCS#Distance The radius of the zone.
|
||||||
function ZONE_RADIUS:GetRadius()
|
function ZONE_RADIUS:GetRadius()
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
self:T2( { self.Radius } )
|
--self:T2( { self.Radius } )
|
||||||
|
|
||||||
return self.Radius
|
return self.Radius
|
||||||
end
|
end
|
||||||
@@ -1016,10 +1016,10 @@ end
|
|||||||
-- @param DCS#Distance Radius The radius of the zone.
|
-- @param DCS#Distance Radius The radius of the zone.
|
||||||
-- @return DCS#Distance The radius of the zone.
|
-- @return DCS#Distance The radius of the zone.
|
||||||
function ZONE_RADIUS:SetRadius( Radius )
|
function ZONE_RADIUS:SetRadius( Radius )
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
self.Radius = Radius
|
self.Radius = Radius
|
||||||
self:T2( { self.Radius } )
|
--self:T2( { self.Radius } )
|
||||||
|
|
||||||
return self.Radius
|
return self.Radius
|
||||||
end
|
end
|
||||||
@@ -1028,9 +1028,9 @@ end
|
|||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @return DCS#Vec2 The location of the zone.
|
-- @return DCS#Vec2 The location of the zone.
|
||||||
function ZONE_RADIUS:GetVec2()
|
function ZONE_RADIUS:GetVec2()
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
self:T2( { self.Vec2 } )
|
--self:T2( { self.Vec2 } )
|
||||||
|
|
||||||
return self.Vec2
|
return self.Vec2
|
||||||
end
|
end
|
||||||
@@ -1040,11 +1040,11 @@ end
|
|||||||
-- @param DCS#Vec2 Vec2 The new location of the zone.
|
-- @param DCS#Vec2 Vec2 The new location of the zone.
|
||||||
-- @return DCS#Vec2 The new location of the zone.
|
-- @return DCS#Vec2 The new location of the zone.
|
||||||
function ZONE_RADIUS:SetVec2( Vec2 )
|
function ZONE_RADIUS:SetVec2( Vec2 )
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
self.Vec2 = Vec2
|
self.Vec2 = Vec2
|
||||||
|
|
||||||
self:T2( { self.Vec2 } )
|
--self:T2( { self.Vec2 } )
|
||||||
|
|
||||||
return self.Vec2
|
return self.Vec2
|
||||||
end
|
end
|
||||||
@@ -1054,14 +1054,14 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return DCS#Vec3 The point of the zone.
|
-- @return DCS#Vec3 The point of the zone.
|
||||||
function ZONE_RADIUS:GetVec3( Height )
|
function ZONE_RADIUS:GetVec3( Height )
|
||||||
self:F2( { self.ZoneName, Height } )
|
--self:F2( { self.ZoneName, Height } )
|
||||||
|
|
||||||
Height = Height or 0
|
Height = Height or 0
|
||||||
local Vec2 = self:GetVec2()
|
local Vec2 = self:GetVec2()
|
||||||
|
|
||||||
local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y }
|
local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y }
|
||||||
|
|
||||||
self:T2( { Vec3 } )
|
--self:T2( { Vec3 } )
|
||||||
|
|
||||||
return Vec3
|
return Vec3
|
||||||
end
|
end
|
||||||
@@ -1138,7 +1138,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
|
|||||||
|
|
||||||
self.ScanData.Units[ZoneObject] = ZoneObject
|
self.ScanData.Units[ZoneObject] = ZoneObject
|
||||||
|
|
||||||
self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
--self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1149,7 +1149,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
|
|||||||
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
||||||
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( tostring(SceneryName), ZoneObject)
|
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( tostring(SceneryName), ZoneObject)
|
||||||
table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName] )
|
table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName] )
|
||||||
self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
--self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1203,7 +1203,7 @@ function ZONE_RADIUS:GetScannedSetUnit()
|
|||||||
if FoundUnit then
|
if FoundUnit then
|
||||||
SetUnit:AddUnit( FoundUnit )
|
SetUnit:AddUnit( FoundUnit )
|
||||||
else
|
else
|
||||||
local FoundStatic = STATIC:FindByName( UnitObject:getName() )
|
local FoundStatic = STATIC:FindByName( UnitObject:getName(), false )
|
||||||
if FoundStatic then
|
if FoundStatic then
|
||||||
SetUnit:AddUnit( FoundStatic )
|
SetUnit:AddUnit( FoundStatic )
|
||||||
end
|
end
|
||||||
@@ -1409,7 +1409,7 @@ function ZONE_RADIUS:SearchZone( EvaluateFunction, ObjectCategories )
|
|||||||
local ZoneCoord = self:GetCoordinate()
|
local ZoneCoord = self:GetCoordinate()
|
||||||
local ZoneRadius = self:GetRadius()
|
local ZoneRadius = self:GetRadius()
|
||||||
|
|
||||||
self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
--self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
||||||
|
|
||||||
local SphereSearch = {
|
local SphereSearch = {
|
||||||
id = world.VolumeType.SPHERE,
|
id = world.VolumeType.SPHERE,
|
||||||
@@ -1436,7 +1436,7 @@ end
|
|||||||
-- @param DCS#Vec2 Vec2 The location to test.
|
-- @param DCS#Vec2 Vec2 The location to test.
|
||||||
-- @return #boolean true if the location is within the zone.
|
-- @return #boolean true if the location is within the zone.
|
||||||
function ZONE_RADIUS:IsVec2InZone( Vec2 )
|
function ZONE_RADIUS:IsVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
--self:F2( Vec2 )
|
||||||
|
|
||||||
if not Vec2 then return false end
|
if not Vec2 then return false end
|
||||||
|
|
||||||
@@ -1456,7 +1456,7 @@ end
|
|||||||
-- @param DCS#Vec3 Vec3 The point to test.
|
-- @param DCS#Vec3 Vec3 The point to test.
|
||||||
-- @return #boolean true if the point is within the zone.
|
-- @return #boolean true if the point is within the zone.
|
||||||
function ZONE_RADIUS:IsVec3InZone( Vec3 )
|
function ZONE_RADIUS:IsVec3InZone( Vec3 )
|
||||||
self:F2( Vec3 )
|
--self:F2( Vec3 )
|
||||||
if not Vec3 then return false end
|
if not Vec3 then return false end
|
||||||
local InZone = self:IsVec2InZone( { x = Vec3.x, y = Vec3.z } )
|
local InZone = self:IsVec2InZone( { x = Vec3.x, y = Vec3.z } )
|
||||||
|
|
||||||
@@ -1521,11 +1521,11 @@ end
|
|||||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||||
function ZONE_RADIUS:GetRandomPointVec2( inner, outer )
|
function ZONE_RADIUS:GetRandomPointVec2( inner, outer )
|
||||||
self:F( self.ZoneName, inner, outer )
|
--self:F( self.ZoneName, inner, outer )
|
||||||
|
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||||
|
|
||||||
self:T3( { PointVec2 } )
|
--self:T3( { PointVec2 } )
|
||||||
|
|
||||||
return PointVec2
|
return PointVec2
|
||||||
end
|
end
|
||||||
@@ -1536,11 +1536,11 @@ end
|
|||||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||||
-- @return DCS#Vec3 The random location within the zone.
|
-- @return DCS#Vec3 The random location within the zone.
|
||||||
function ZONE_RADIUS:GetRandomVec3( inner, outer )
|
function ZONE_RADIUS:GetRandomVec3( inner, outer )
|
||||||
self:F( self.ZoneName, inner, outer )
|
--self:F( self.ZoneName, inner, outer )
|
||||||
|
|
||||||
local Vec2 = self:GetRandomVec2( inner, outer )
|
local Vec2 = self:GetRandomVec2( inner, outer )
|
||||||
|
|
||||||
self:T3( { x = Vec2.x, y = self.y, z = Vec2.y } )
|
--self:T3( { x = Vec2.x, y = self.y, z = Vec2.y } )
|
||||||
|
|
||||||
return { x = Vec2.x, y = self.y, z = Vec2.y }
|
return { x = Vec2.x, y = self.y, z = Vec2.y }
|
||||||
end
|
end
|
||||||
@@ -1552,11 +1552,11 @@ end
|
|||||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||||
-- @return Core.Point#POINT_VEC3 The @{Core.Point#POINT_VEC3} object reflecting the random 3D location within the zone.
|
-- @return Core.Point#POINT_VEC3 The @{Core.Point#POINT_VEC3} object reflecting the random 3D location within the zone.
|
||||||
function ZONE_RADIUS:GetRandomPointVec3( inner, outer )
|
function ZONE_RADIUS:GetRandomPointVec3( inner, outer )
|
||||||
self:F( self.ZoneName, inner, outer )
|
--self:F( self.ZoneName, inner, outer )
|
||||||
|
|
||||||
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||||
|
|
||||||
self:T3( { PointVec3 } )
|
--self:T3( { PointVec3 } )
|
||||||
|
|
||||||
return PointVec3
|
return PointVec3
|
||||||
end
|
end
|
||||||
@@ -1685,7 +1685,7 @@ function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,ma
|
|||||||
|
|
||||||
T1=timer.getTime()
|
T1=timer.getTime()
|
||||||
|
|
||||||
self:T(string.format("Found a coordinate: %s | Iterations: %d | Time: %.3f",tostring(found),iterations,T1-T0))
|
--self:T(string.format("Found a coordinate: %s | Iterations: %d | Time: %.3f",tostring(found),iterations,T1-T0))
|
||||||
|
|
||||||
if found then return rcoord else return nil end
|
if found then return rcoord else return nil end
|
||||||
|
|
||||||
@@ -1754,7 +1754,7 @@ function ZONE:New( ZoneName )
|
|||||||
|
|
||||||
-- Create a new ZONE_RADIUS.
|
-- Create a new ZONE_RADIUS.
|
||||||
local self=BASE:Inherit( self, ZONE_RADIUS:New(ZoneName, {x=Zone.point.x, y=Zone.point.z}, Zone.radius, true))
|
local self=BASE:Inherit( self, ZONE_RADIUS:New(ZoneName, {x=Zone.point.x, y=Zone.point.z}, Zone.radius, true))
|
||||||
self:F(ZoneName)
|
--self:F(ZoneName)
|
||||||
|
|
||||||
-- Color of zone.
|
-- Color of zone.
|
||||||
self.Color={1, 0, 0, 0.15}
|
self.Color={1, 0, 0, 0.15}
|
||||||
@@ -1824,7 +1824,7 @@ function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius, Offset)
|
|||||||
self.relative_to_unit = Offset.relative_to_unit or false
|
self.relative_to_unit = Offset.relative_to_unit or false
|
||||||
end
|
end
|
||||||
|
|
||||||
self:F( { ZoneName, ZoneUNIT:GetVec2(), Radius } )
|
--self:F( { ZoneName, ZoneUNIT:GetVec2(), Radius } )
|
||||||
|
|
||||||
self.ZoneUNIT = ZoneUNIT
|
self.ZoneUNIT = ZoneUNIT
|
||||||
self.LastVec2 = ZoneUNIT:GetVec2()
|
self.LastVec2 = ZoneUNIT:GetVec2()
|
||||||
@@ -1840,7 +1840,7 @@ end
|
|||||||
-- @param #ZONE_UNIT self
|
-- @param #ZONE_UNIT self
|
||||||
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Unit#UNIT}location and the offset, if any.
|
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Unit#UNIT}location and the offset, if any.
|
||||||
function ZONE_UNIT:GetVec2()
|
function ZONE_UNIT:GetVec2()
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
local ZoneVec2 = self.ZoneUNIT:GetVec2()
|
local ZoneVec2 = self.ZoneUNIT:GetVec2()
|
||||||
if ZoneVec2 then
|
if ZoneVec2 then
|
||||||
@@ -1873,7 +1873,7 @@ function ZONE_UNIT:GetVec2()
|
|||||||
return self.LastVec2
|
return self.LastVec2
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T2( { ZoneVec2 } )
|
--self:T2( { ZoneVec2 } )
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@@ -1882,7 +1882,7 @@ end
|
|||||||
-- @param #ZONE_UNIT self
|
-- @param #ZONE_UNIT self
|
||||||
-- @return DCS#Vec2 The random location within the zone.
|
-- @return DCS#Vec2 The random location within the zone.
|
||||||
function ZONE_UNIT:GetRandomVec2()
|
function ZONE_UNIT:GetRandomVec2()
|
||||||
self:F( self.ZoneName )
|
--self:F( self.ZoneName )
|
||||||
|
|
||||||
local RandomVec2 = {}
|
local RandomVec2 = {}
|
||||||
--local Vec2 = self.ZoneUNIT:GetVec2() -- FF: This does not take care of the new offset feature!
|
--local Vec2 = self.ZoneUNIT:GetVec2() -- FF: This does not take care of the new offset feature!
|
||||||
@@ -1896,7 +1896,7 @@ function ZONE_UNIT:GetRandomVec2()
|
|||||||
RandomVec2.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
RandomVec2.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
||||||
RandomVec2.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
RandomVec2.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
||||||
|
|
||||||
self:T( { RandomVec2 } )
|
--self:T( { RandomVec2 } )
|
||||||
|
|
||||||
return RandomVec2
|
return RandomVec2
|
||||||
end
|
end
|
||||||
@@ -1906,7 +1906,7 @@ end
|
|||||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||||
-- @return DCS#Vec3 The point of the zone.
|
-- @return DCS#Vec3 The point of the zone.
|
||||||
function ZONE_UNIT:GetVec3( Height )
|
function ZONE_UNIT:GetVec3( Height )
|
||||||
self:F2( self.ZoneName )
|
--self:F2( self.ZoneName )
|
||||||
|
|
||||||
Height = Height or 0
|
Height = Height or 0
|
||||||
|
|
||||||
@@ -1914,7 +1914,7 @@ function ZONE_UNIT:GetVec3( Height )
|
|||||||
|
|
||||||
local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y }
|
local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y }
|
||||||
|
|
||||||
self:T2( { Vec3 } )
|
--self:T2( { Vec3 } )
|
||||||
|
|
||||||
return Vec3
|
return Vec3
|
||||||
end
|
end
|
||||||
@@ -1940,7 +1940,7 @@ ZONE_GROUP = {
|
|||||||
-- @return #ZONE_GROUP self
|
-- @return #ZONE_GROUP self
|
||||||
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
||||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius, true ) )
|
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius, true ) )
|
||||||
self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
|
--self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
|
||||||
|
|
||||||
self._.ZoneGROUP = ZoneGROUP
|
self._.ZoneGROUP = ZoneGROUP
|
||||||
self._.ZoneVec2Cache = self._.ZoneGROUP:GetVec2()
|
self._.ZoneVec2Cache = self._.ZoneGROUP:GetVec2()
|
||||||
@@ -1956,7 +1956,7 @@ end
|
|||||||
-- @param #ZONE_GROUP self
|
-- @param #ZONE_GROUP self
|
||||||
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location.
|
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location.
|
||||||
function ZONE_GROUP:GetVec2()
|
function ZONE_GROUP:GetVec2()
|
||||||
self:F( self.ZoneName )
|
--self:F( self.ZoneName )
|
||||||
|
|
||||||
local ZoneVec2 = nil
|
local ZoneVec2 = nil
|
||||||
|
|
||||||
@@ -1967,7 +1967,7 @@ function ZONE_GROUP:GetVec2()
|
|||||||
ZoneVec2 = self._.ZoneVec2Cache
|
ZoneVec2 = self._.ZoneVec2Cache
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { ZoneVec2 } )
|
--self:T( { ZoneVec2 } )
|
||||||
|
|
||||||
return ZoneVec2
|
return ZoneVec2
|
||||||
end
|
end
|
||||||
@@ -1976,7 +1976,7 @@ end
|
|||||||
-- @param #ZONE_GROUP self
|
-- @param #ZONE_GROUP self
|
||||||
-- @return DCS#Vec2 The random location of the zone based on the @{Wrapper.Group} location.
|
-- @return DCS#Vec2 The random location of the zone based on the @{Wrapper.Group} location.
|
||||||
function ZONE_GROUP:GetRandomVec2()
|
function ZONE_GROUP:GetRandomVec2()
|
||||||
self:F( self.ZoneName )
|
--self:F( self.ZoneName )
|
||||||
|
|
||||||
local Point = {}
|
local Point = {}
|
||||||
local Vec2 = self._.ZoneGROUP:GetVec2()
|
local Vec2 = self._.ZoneGROUP:GetVec2()
|
||||||
@@ -1985,7 +1985,7 @@ function ZONE_GROUP:GetRandomVec2()
|
|||||||
Point.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
Point.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
||||||
Point.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
Point.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
||||||
|
|
||||||
self:T( { Point } )
|
--self:T( { Point } )
|
||||||
|
|
||||||
return Point
|
return Point
|
||||||
end
|
end
|
||||||
@@ -1996,11 +1996,11 @@ end
|
|||||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||||
function ZONE_GROUP:GetRandomPointVec2( inner, outer )
|
function ZONE_GROUP:GetRandomPointVec2( inner, outer )
|
||||||
self:F( self.ZoneName, inner, outer )
|
--self:F( self.ZoneName, inner, outer )
|
||||||
|
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||||
|
|
||||||
self:T3( { PointVec2 } )
|
--self:T3( { PointVec2 } )
|
||||||
|
|
||||||
return PointVec2
|
return PointVec2
|
||||||
end
|
end
|
||||||
@@ -2183,7 +2183,7 @@ function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
|
|||||||
|
|
||||||
-- Inherit ZONE_BASE.
|
-- Inherit ZONE_BASE.
|
||||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
||||||
self:F( { ZoneName, PointsArray } )
|
--self:F( { ZoneName, PointsArray } )
|
||||||
|
|
||||||
if PointsArray then
|
if PointsArray then
|
||||||
|
|
||||||
@@ -2351,7 +2351,7 @@ end
|
|||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location.
|
-- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location.
|
||||||
function ZONE_POLYGON_BASE:GetVec2()
|
function ZONE_POLYGON_BASE:GetVec2()
|
||||||
self:F( self.ZoneName )
|
--self:F( self.ZoneName )
|
||||||
|
|
||||||
local Bounds = self:GetBoundingSquare()
|
local Bounds = self:GetBoundingSquare()
|
||||||
|
|
||||||
@@ -2434,9 +2434,9 @@ end
|
|||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return #ZONE_POLYGON_BASE self
|
-- @return #ZONE_POLYGON_BASE self
|
||||||
function ZONE_POLYGON_BASE:Flush()
|
function ZONE_POLYGON_BASE:Flush()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
self:F( { Polygon = self.ZoneName, Coordinates = self._.Polygon } )
|
--self:F( { Polygon = self.ZoneName, Coordinates = self._.Polygon } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -2455,7 +2455,7 @@ function ZONE_POLYGON_BASE:BoundZone( UnBound )
|
|||||||
j = #self._.Polygon
|
j = #self._.Polygon
|
||||||
|
|
||||||
while i <= #self._.Polygon do
|
while i <= #self._.Polygon do
|
||||||
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
--self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
||||||
|
|
||||||
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
||||||
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
||||||
@@ -2707,7 +2707,7 @@ end
|
|||||||
-- @param #number Segments (Optional) Number of segments within boundary line. Default 10.
|
-- @param #number Segments (Optional) Number of segments within boundary line. Default 10.
|
||||||
-- @return #ZONE_POLYGON_BASE self
|
-- @return #ZONE_POLYGON_BASE self
|
||||||
function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments )
|
function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments )
|
||||||
self:F2( SmokeColor )
|
--self:F2( SmokeColor )
|
||||||
|
|
||||||
Segments=Segments or 10
|
Segments=Segments or 10
|
||||||
|
|
||||||
@@ -2715,7 +2715,7 @@ function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments )
|
|||||||
local j=#self._.Polygon
|
local j=#self._.Polygon
|
||||||
|
|
||||||
while i <= #self._.Polygon do
|
while i <= #self._.Polygon do
|
||||||
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
--self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
||||||
|
|
||||||
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
||||||
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
||||||
@@ -2740,7 +2740,7 @@ end
|
|||||||
-- @param #number AddHeight (optional) The height to be added for the smoke.
|
-- @param #number AddHeight (optional) The height to be added for the smoke.
|
||||||
-- @return #ZONE_POLYGON_BASE self
|
-- @return #ZONE_POLYGON_BASE self
|
||||||
function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight )
|
function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight )
|
||||||
self:F2(FlareColor)
|
--self:F2(FlareColor)
|
||||||
|
|
||||||
Segments=Segments or 10
|
Segments=Segments or 10
|
||||||
|
|
||||||
@@ -2750,7 +2750,7 @@ function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight )
|
|||||||
local j=#self._.Polygon
|
local j=#self._.Polygon
|
||||||
|
|
||||||
while i <= #self._.Polygon do
|
while i <= #self._.Polygon do
|
||||||
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
--self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
||||||
|
|
||||||
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
||||||
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
||||||
@@ -2773,7 +2773,7 @@ end
|
|||||||
-- @param DCS#Vec2 Vec2 The location to test.
|
-- @param DCS#Vec2 Vec2 The location to test.
|
||||||
-- @return #boolean true if the location is within the zone.
|
-- @return #boolean true if the location is within the zone.
|
||||||
function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 )
|
function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
--self:F2( Vec2 )
|
||||||
if not Vec2 then return false end
|
if not Vec2 then return false end
|
||||||
local Next
|
local Next
|
||||||
local Prev
|
local Prev
|
||||||
@@ -2783,18 +2783,18 @@ function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 )
|
|||||||
Prev = #self._.Polygon
|
Prev = #self._.Polygon
|
||||||
|
|
||||||
while Next <= #self._.Polygon do
|
while Next <= #self._.Polygon do
|
||||||
self:T( { Next, Prev, self._.Polygon[Next], self._.Polygon[Prev] } )
|
--self:T( { Next, Prev, self._.Polygon[Next], self._.Polygon[Prev] } )
|
||||||
if ( ( ( self._.Polygon[Next].y > Vec2.y ) ~= ( self._.Polygon[Prev].y > Vec2.y ) ) and
|
if ( ( ( self._.Polygon[Next].y > Vec2.y ) ~= ( self._.Polygon[Prev].y > Vec2.y ) ) and
|
||||||
( Vec2.x < ( self._.Polygon[Prev].x - self._.Polygon[Next].x ) * ( Vec2.y - self._.Polygon[Next].y ) / ( self._.Polygon[Prev].y - self._.Polygon[Next].y ) + self._.Polygon[Next].x )
|
( Vec2.x < ( self._.Polygon[Prev].x - self._.Polygon[Next].x ) * ( Vec2.y - self._.Polygon[Next].y ) / ( self._.Polygon[Prev].y - self._.Polygon[Next].y ) + self._.Polygon[Next].x )
|
||||||
) then
|
) then
|
||||||
InPolygon = not InPolygon
|
InPolygon = not InPolygon
|
||||||
end
|
end
|
||||||
self:T2( { InPolygon = InPolygon } )
|
--self:T2( { InPolygon = InPolygon } )
|
||||||
Prev = Next
|
Prev = Next
|
||||||
Next = Next + 1
|
Next = Next + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { InPolygon = InPolygon } )
|
--self:T( { InPolygon = InPolygon } )
|
||||||
return InPolygon
|
return InPolygon
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2803,7 +2803,7 @@ end
|
|||||||
-- @param DCS#Vec3 Vec3 The point to test.
|
-- @param DCS#Vec3 Vec3 The point to test.
|
||||||
-- @return #boolean true if the point is within the zone.
|
-- @return #boolean true if the point is within the zone.
|
||||||
function ZONE_POLYGON_BASE:IsVec3InZone( Vec3 )
|
function ZONE_POLYGON_BASE:IsVec3InZone( Vec3 )
|
||||||
self:F2( Vec3 )
|
--self:F2( Vec3 )
|
||||||
|
|
||||||
if not Vec3 then return false end
|
if not Vec3 then return false end
|
||||||
|
|
||||||
@@ -2838,11 +2838,11 @@ end
|
|||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return @{Core.Point#POINT_VEC2}
|
-- @return @{Core.Point#POINT_VEC2}
|
||||||
function ZONE_POLYGON_BASE:GetRandomPointVec2()
|
function ZONE_POLYGON_BASE:GetRandomPointVec2()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||||
|
|
||||||
self:T2( PointVec2 )
|
--self:T2( PointVec2 )
|
||||||
|
|
||||||
return PointVec2
|
return PointVec2
|
||||||
end
|
end
|
||||||
@@ -2851,11 +2851,11 @@ end
|
|||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return @{Core.Point#POINT_VEC3}
|
-- @return @{Core.Point#POINT_VEC3}
|
||||||
function ZONE_POLYGON_BASE:GetRandomPointVec3()
|
function ZONE_POLYGON_BASE:GetRandomPointVec3()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2() )
|
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2() )
|
||||||
|
|
||||||
self:T2( PointVec3 )
|
--self:T2( PointVec3 )
|
||||||
|
|
||||||
return PointVec3
|
return PointVec3
|
||||||
end
|
end
|
||||||
@@ -2865,11 +2865,11 @@ end
|
|||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return Core.Point#COORDINATE
|
-- @return Core.Point#COORDINATE
|
||||||
function ZONE_POLYGON_BASE:GetRandomCoordinate()
|
function ZONE_POLYGON_BASE:GetRandomCoordinate()
|
||||||
self:F2()
|
--self:F2()
|
||||||
|
|
||||||
local Coordinate = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
local Coordinate = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
||||||
|
|
||||||
self:T2( Coordinate )
|
--self:T2( Coordinate )
|
||||||
|
|
||||||
return Coordinate
|
return Coordinate
|
||||||
end
|
end
|
||||||
@@ -2886,7 +2886,7 @@ function ZONE_POLYGON_BASE:GetBoundingSquare()
|
|||||||
local y2 = self._.Polygon[1].y
|
local y2 = self._.Polygon[1].y
|
||||||
|
|
||||||
for i = 2, #self._.Polygon do
|
for i = 2, #self._.Polygon do
|
||||||
self:T2( { self._.Polygon[i], x1, y1, x2, y2 } )
|
--self:T2( { self._.Polygon[i], x1, y1, x2, y2 } )
|
||||||
x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1
|
x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1
|
||||||
x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2
|
x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2
|
||||||
y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1
|
y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1
|
||||||
@@ -2909,7 +2909,7 @@ function ZONE_POLYGON_BASE:GetBoundingVec2()
|
|||||||
local y2 = self._.Polygon[1].y
|
local y2 = self._.Polygon[1].y
|
||||||
|
|
||||||
for i = 2, #self._.Polygon do
|
for i = 2, #self._.Polygon do
|
||||||
self:T2( { self._.Polygon[i], x1, y1, x2, y2 } )
|
--self:T2( { self._.Polygon[i], x1, y1, x2, y2 } )
|
||||||
x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1
|
x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1
|
||||||
x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2
|
x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2
|
||||||
y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1
|
y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1
|
||||||
@@ -2948,7 +2948,7 @@ function ZONE_POLYGON_BASE:Boundary(Coalition, Color, Radius, Alpha, Segments, C
|
|||||||
Limit = #self._.Polygon
|
Limit = #self._.Polygon
|
||||||
end
|
end
|
||||||
while i <= #self._.Polygon do
|
while i <= #self._.Polygon do
|
||||||
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
--self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
|
||||||
if j ~= Limit then
|
if j ~= Limit then
|
||||||
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
|
||||||
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
|
||||||
@@ -3019,7 +3019,7 @@ function ZONE_POLYGON:New( ZoneName, ZoneGroup )
|
|||||||
local GroupPoints = ZoneGroup:GetTaskRoute()
|
local GroupPoints = ZoneGroup:GetTaskRoute()
|
||||||
|
|
||||||
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, GroupPoints ) )
|
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, GroupPoints ) )
|
||||||
self:F( { ZoneName, ZoneGroup, self._.Polygon } )
|
--self:F( { ZoneName, ZoneGroup, self._.Polygon } )
|
||||||
|
|
||||||
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
||||||
_EVENTDISPATCHER:CreateEventNewZone( self )
|
_EVENTDISPATCHER:CreateEventNewZone( self )
|
||||||
@@ -3035,7 +3035,7 @@ end
|
|||||||
function ZONE_POLYGON:NewFromPointsArray( ZoneName, PointsArray )
|
function ZONE_POLYGON:NewFromPointsArray( ZoneName, PointsArray )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, PointsArray ) )
|
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, PointsArray ) )
|
||||||
self:F( { ZoneName, self._.Polygon } )
|
--self:F( { ZoneName, self._.Polygon } )
|
||||||
|
|
||||||
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
||||||
_EVENTDISPATCHER:CreateEventNewZone( self )
|
_EVENTDISPATCHER:CreateEventNewZone( self )
|
||||||
@@ -3055,7 +3055,7 @@ function ZONE_POLYGON:NewFromGroupName( GroupName )
|
|||||||
local GroupPoints = ZoneGroup:GetTaskRoute()
|
local GroupPoints = ZoneGroup:GetTaskRoute()
|
||||||
|
|
||||||
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( GroupName, GroupPoints ) )
|
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( GroupName, GroupPoints ) )
|
||||||
self:F( { GroupName, ZoneGroup, self._.Polygon } )
|
--self:F( { GroupName, ZoneGroup, self._.Polygon } )
|
||||||
|
|
||||||
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
||||||
_EVENTDISPATCHER:CreateEventNewZone( self )
|
_EVENTDISPATCHER:CreateEventNewZone( self )
|
||||||
@@ -3221,7 +3221,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
|
|||||||
|
|
||||||
self.ScanData.Units[ZoneObject] = ZoneObject
|
self.ScanData.Units[ZoneObject] = ZoneObject
|
||||||
|
|
||||||
self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
--self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3232,7 +3232,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
|
|||||||
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
||||||
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
||||||
table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName])
|
table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName])
|
||||||
self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
--self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -3573,7 +3573,7 @@ do -- ZONE_ELASTIC
|
|||||||
function ZONE_ELASTIC:Update(Delay, Draw)
|
function ZONE_ELASTIC:Update(Delay, Draw)
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T(string.format("Updating ZONE_ELASTIC %s", tostring(self.ZoneName)))
|
--self:T(string.format("Updating ZONE_ELASTIC %s", tostring(self.ZoneName)))
|
||||||
|
|
||||||
-- Copy all points.
|
-- Copy all points.
|
||||||
local points=UTILS.DeepCopy(self.points or {})
|
local points=UTILS.DeepCopy(self.points or {})
|
||||||
@@ -3641,7 +3641,7 @@ do -- ZONE_ELASTIC
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Create a convec hull.
|
--- Create a convex hull.
|
||||||
-- @param #ZONE_ELASTIC self
|
-- @param #ZONE_ELASTIC self
|
||||||
-- @param #table pl Points
|
-- @param #table pl Points
|
||||||
-- @return #table Points
|
-- @return #table Points
|
||||||
@@ -3987,7 +3987,7 @@ do -- ZONE_AIRBASE
|
|||||||
-- @param #ZONE_AIRBASE self
|
-- @param #ZONE_AIRBASE self
|
||||||
-- @return DCS#Vec2 The location of the zone based on the AIRBASE location.
|
-- @return DCS#Vec2 The location of the zone based on the AIRBASE location.
|
||||||
function ZONE_AIRBASE:GetVec2()
|
function ZONE_AIRBASE:GetVec2()
|
||||||
self:F( self.ZoneName )
|
--self:F( self.ZoneName )
|
||||||
|
|
||||||
local ZoneVec2 = nil
|
local ZoneVec2 = nil
|
||||||
|
|
||||||
@@ -3998,7 +3998,7 @@ do -- ZONE_AIRBASE
|
|||||||
ZoneVec2 = self._.ZoneVec2Cache
|
ZoneVec2 = self._.ZoneVec2Cache
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { ZoneVec2 } )
|
--self:T( { ZoneVec2 } )
|
||||||
|
|
||||||
return ZoneVec2
|
return ZoneVec2
|
||||||
end
|
end
|
||||||
@@ -4009,11 +4009,11 @@ do -- ZONE_AIRBASE
|
|||||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||||
function ZONE_AIRBASE:GetRandomPointVec2( inner, outer )
|
function ZONE_AIRBASE:GetRandomPointVec2( inner, outer )
|
||||||
self:F( self.ZoneName, inner, outer )
|
--self:F( self.ZoneName, inner, outer )
|
||||||
|
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||||
|
|
||||||
self:T3( { PointVec2 } )
|
--self:T3( { PointVec2 } )
|
||||||
|
|
||||||
return PointVec2
|
return PointVec2
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
-- @module Core.Zone_Detection
|
-- @module Core.Zone_Detection
|
||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
--- @type ZONE_DETECTION
|
---
|
||||||
|
-- @type ZONE_DETECTION
|
||||||
-- @field DCS#Vec2 Vec2 The current location of the zone.
|
-- @field DCS#Vec2 Vec2 The current location of the zone.
|
||||||
-- @field DCS#Distance Radius The radius of the zone.
|
-- @field DCS#Distance Radius The radius of the zone.
|
||||||
-- @extends #ZONE_BASE
|
-- @extends #ZONE_BASE
|
||||||
|
|||||||
@@ -25,38 +25,68 @@ do -- world
|
|||||||
|
|
||||||
--- [https://wiki.hoggitworld.com/view/DCS_enum_world](https://wiki.hoggitworld.com/view/DCS_enum_world)
|
--- [https://wiki.hoggitworld.com/view/DCS_enum_world](https://wiki.hoggitworld.com/view/DCS_enum_world)
|
||||||
-- @type world.event
|
-- @type world.event
|
||||||
-- @field S_EVENT_INVALID
|
-- @field S_EVENT_INVALID = 0
|
||||||
-- @field S_EVENT_SHOT [https://wiki.hoggitworld.com/view/DCS_event_shot](https://wiki.hoggitworld.com/view/DCS_event_shot)
|
-- @field S_EVENT_SHOT = 1
|
||||||
-- @field S_EVENT_HIT [https://wiki.hoggitworld.com/view/DCS_event_hit](https://wiki.hoggitworld.com/view/DCS_event_hit)
|
-- @field S_EVENT_HIT = 2
|
||||||
-- @field S_EVENT_TAKEOFF [https://wiki.hoggitworld.com/view/DCS_event_takeoff](https://wiki.hoggitworld.com/view/DCS_event_takeoff)
|
-- @field S_EVENT_TAKEOFF = 3
|
||||||
-- @field S_EVENT_LAND [https://wiki.hoggitworld.com/view/DCS_event_land](https://wiki.hoggitworld.com/view/DCS_event_land)
|
-- @field S_EVENT_LAND = 4
|
||||||
-- @field S_EVENT_CRASH [https://wiki.hoggitworld.com/view/DCS_event_crash](https://wiki.hoggitworld.com/view/DCS_event_crash)
|
-- @field S_EVENT_CRASH = 5
|
||||||
-- @field S_EVENT_EJECTION [https://wiki.hoggitworld.com/view/DCS_event_ejection](https://wiki.hoggitworld.com/view/DCS_event_ejection)
|
-- @field S_EVENT_EJECTION = 6
|
||||||
-- @field S_EVENT_REFUELING [https://wiki.hoggitworld.com/view/DCS_event_refueling](https://wiki.hoggitworld.com/view/DCS_event_refueling)
|
-- @field S_EVENT_REFUELING = 7
|
||||||
-- @field S_EVENT_DEAD [https://wiki.hoggitworld.com/view/DCS_event_dead](https://wiki.hoggitworld.com/view/DCS_event_dead)
|
-- @field S_EVENT_DEAD = 8
|
||||||
-- @field S_EVENT_PILOT_DEAD [https://wiki.hoggitworld.com/view/DCS_event_pilot_dead](https://wiki.hoggitworld.com/view/DCS_event_pilot_dead)
|
-- @field S_EVENT_PILOT_DEAD = 9
|
||||||
-- @field S_EVENT_BASE_CAPTURED [https://wiki.hoggitworld.com/view/DCS_event_base_captured](https://wiki.hoggitworld.com/view/DCS_event_base_captured)
|
-- @field S_EVENT_BASE_CAPTURED = 10
|
||||||
-- @field S_EVENT_MISSION_START [https://wiki.hoggitworld.com/view/DCS_event_mission_start](https://wiki.hoggitworld.com/view/DCS_event_mission_start)
|
-- @field S_EVENT_MISSION_START = 11
|
||||||
-- @field S_EVENT_MISSION_END [https://wiki.hoggitworld.com/view/DCS_event_mission_end](https://wiki.hoggitworld.com/view/DCS_event_mission_end)
|
-- @field S_EVENT_MISSION_END = 12
|
||||||
-- @field S_EVENT_TOOK_CONTROL
|
-- @field S_EVENT_TOOK_CONTROL = 13
|
||||||
-- @field S_EVENT_REFUELING_STOP [https://wiki.hoggitworld.com/view/DCS_event_refueling_stop](https://wiki.hoggitworld.com/view/DCS_event_refueling_stop)
|
-- @field S_EVENT_REFUELING_STOP = 14
|
||||||
-- @field S_EVENT_BIRTH [https://wiki.hoggitworld.com/view/DCS_event_birth](https://wiki.hoggitworld.com/view/DCS_event_birth)
|
-- @field S_EVENT_BIRTH = 15
|
||||||
-- @field S_EVENT_HUMAN_FAILURE [https://wiki.hoggitworld.com/view/DCS_event_human_failure](https://wiki.hoggitworld.com/view/DCS_event_human_failure)
|
-- @field S_EVENT_HUMAN_FAILURE = 16
|
||||||
-- @field S_EVENT_ENGINE_STARTUP [https://wiki.hoggitworld.com/view/DCS_event_engine_startup](https://wiki.hoggitworld.com/view/DCS_event_engine_startup)
|
-- @field S_EVENT_DETAILED_FAILURE = 17
|
||||||
-- @field S_EVENT_ENGINE_SHUTDOWN [https://wiki.hoggitworld.com/view/DCS_event_engine_shutdown](https://wiki.hoggitworld.com/view/DCS_event_engine_shutdown)
|
-- @field S_EVENT_ENGINE_STARTUP = 18
|
||||||
-- @field S_EVENT_PLAYER_ENTER_UNIT [https://wiki.hoggitworld.com/view/DCS_event_player_enter_unit](https://wiki.hoggitworld.com/view/DCS_event_player_enter_unit)
|
-- @field S_EVENT_ENGINE_SHUTDOWN = 19
|
||||||
-- @field S_EVENT_PLAYER_LEAVE_UNIT [https://wiki.hoggitworld.com/view/DCS_event_player_leave_unit](https://wiki.hoggitworld.com/view/DCS_event_player_leave_unit)
|
-- @field S_EVENT_PLAYER_ENTER_UNIT = 20
|
||||||
-- @field S_EVENT_PLAYER_COMMENT
|
-- @field S_EVENT_PLAYER_LEAVE_UNIT = 21
|
||||||
-- @field S_EVENT_SHOOTING_START [https://wiki.hoggitworld.com/view/DCS_event_shooting_start](https://wiki.hoggitworld.com/view/DCS_event_shooting_start)
|
-- @field S_EVENT_PLAYER_COMMENT = 22
|
||||||
-- @field S_EVENT_SHOOTING_END [https://wiki.hoggitworld.com/view/DCS_event_shooting_end](https://wiki.hoggitworld.com/view/DCS_event_shooting_end)
|
-- @field S_EVENT_SHOOTING_START = 23
|
||||||
-- @field S_EVENT_MARK ADDED [https://wiki.hoggitworld.com/view/DCS_event_mark_added](https://wiki.hoggitworld.com/view/DCS_event_mark_added) DCS>=2.5.1
|
-- @field S_EVENT_SHOOTING_END = 24
|
||||||
-- @field S_EVENT_MARK CHANGE [https://wiki.hoggitworld.com/view/DCS_event_mark_change](https://wiki.hoggitworld.com/view/DCS_event_mark_change) DCS>=2.5.1
|
-- @field S_EVENT_MARK_ADDED = 25
|
||||||
-- @field S_EVENT_MARK REMOVE [https://wiki.hoggitworld.com/view/DCS_event_mark_remove](https://wiki.hoggitworld.com/view/DCS_event_mark_remove) DCS>=2.5.1
|
-- @field S_EVENT_MARK_CHANGE = 26
|
||||||
-- @field S_EVENT_KILL [https://wiki.hoggitworld.com/view/DCS_event_kill](https://wiki.hoggitworld.com/view/DCS_event_kill) DCS>=2.5.6
|
-- @field S_EVENT_MARK_REMOVED = 27
|
||||||
-- @field S_EVENT_SCORE [https://wiki.hoggitworld.com/view/DCS_event_score](https://wiki.hoggitworld.com/view/DCS_event_score) DCS>=2.5.6
|
-- @field S_EVENT_KILL = 28
|
||||||
-- @field S_EVENT_UNIT_LOST [https://wiki.hoggitworld.com/view/DCS_event_unit_lost](https://wiki.hoggitworld.com/view/DCS_event_unit_lost) DCS>=2.5.6
|
-- @field S_EVENT_SCORE = 29
|
||||||
-- @field S_EVENT_LANDING_AFTER_EJECTION [https://wiki.hoggitworld.com/view/DCS_event_landing_after_ejection](https://wiki.hoggitworld.com/view/DCS_event_landing_after_ejection) DCS>=2.5.6
|
-- @field S_EVENT_UNIT_LOST = 30
|
||||||
-- @field S_EVENT_MAX
|
-- @field S_EVENT_LANDING_AFTER_EJECTION = 31
|
||||||
|
-- @field S_EVENT_PARATROOPER_LENDING = 32 -- who's lending whom what? ;)
|
||||||
|
-- @field S_EVENT_DISCARD_CHAIR_AFTER_EJECTION = 33
|
||||||
|
-- @field S_EVENT_WEAPON_ADD = 34
|
||||||
|
-- @field S_EVENT_TRIGGER_ZONE = 35
|
||||||
|
-- @field S_EVENT_LANDING_QUALITY_MARK = 36
|
||||||
|
-- @field S_EVENT_BDA = 37 -- battle damage assessment
|
||||||
|
-- @field S_EVENT_AI_ABORT_MISSION = 38
|
||||||
|
-- @field S_EVENT_DAYNIGHT = 39
|
||||||
|
-- @field S_EVENT_FLIGHT_TIME = 40
|
||||||
|
-- @field S_EVENT_PLAYER_SELF_KILL_PILOT = 41
|
||||||
|
-- @field S_EVENT_PLAYER_CAPTURE_AIRFIELD = 42
|
||||||
|
-- @field S_EVENT_EMERGENCY_LANDING = 43
|
||||||
|
-- @field S_EVENT_UNIT_CREATE_TASK = 44
|
||||||
|
-- @field S_EVENT_UNIT_DELETE_TASK = 45
|
||||||
|
-- @field S_EVENT_SIMULATION_START = 46
|
||||||
|
-- @field S_EVENT_WEAPON_REARM = 47
|
||||||
|
-- @field S_EVENT_WEAPON_DROP = 48
|
||||||
|
-- @field S_EVENT_UNIT_TASK_COMPLETE = 49
|
||||||
|
-- @field S_EVENT_UNIT_TASK_STAGE = 50
|
||||||
|
-- @field S_EVENT_MAC_EXTRA_SCORE= 51 -- not sure what this is
|
||||||
|
-- @field S_EVENT_MISSION_RESTART= 52
|
||||||
|
-- @field S_EVENT_MISSION_WINNER = 53
|
||||||
|
-- @field S_EVENT_RUNWAY_TAKEOFF= 54
|
||||||
|
-- @field S_EVENT_RUNWAY_TOUCH= 55
|
||||||
|
-- @field S_EVENT_MAC_LMS_RESTART= 56 -- not sure what this is
|
||||||
|
-- @field S_EVENT_SIMULATION_FREEZE = 57
|
||||||
|
-- @field S_EVENT_SIMULATION_UNFREEZE = 58
|
||||||
|
-- @field S_EVENT_HUMAN_AIRCRAFT_REPAIR_START = 59
|
||||||
|
-- @field S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH = 60
|
||||||
|
-- @field S_EVENT_MAX = 61
|
||||||
|
|
||||||
--- The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
|
--- The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
|
||||||
-- @type world.BirthPlace
|
-- @type world.BirthPlace
|
||||||
@@ -1665,6 +1695,7 @@ do -- AI
|
|||||||
-- @field ALARM_STATE @{#AI.Option.Ground.val.ALARM_STATE}
|
-- @field ALARM_STATE @{#AI.Option.Ground.val.ALARM_STATE}
|
||||||
-- @field ENGAGE_AIR_WEAPONS
|
-- @field ENGAGE_AIR_WEAPONS
|
||||||
-- @field AC_ENGAGEMENT_RANGE_RESTRICTION
|
-- @field AC_ENGAGEMENT_RANGE_RESTRICTION
|
||||||
|
-- @field EVASION_OF_ARM
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @type AI.Option.Ground.mid -- Moose added
|
-- @type AI.Option.Ground.mid -- Moose added
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
-- ammotruck.monitor = -60 -- 1 minute - AMMOTRUCK checks run every one minute
|
-- ammotruck.monitor = -60 -- 1 minute - AMMOTRUCK checks run every one minute
|
||||||
-- ammotruck.routeonroad = true -- Trucks will **try** to drive on roads
|
-- ammotruck.routeonroad = true -- Trucks will **try** to drive on roads
|
||||||
-- ammotruck.usearmygroup = false -- If true, will make use of ARMYGROUP in the background (if used in DEV branch)
|
-- ammotruck.usearmygroup = false -- If true, will make use of ARMYGROUP in the background (if used in DEV branch)
|
||||||
-- ammotruck.reloads = 5 -- Maxn re-arms a truck can do before he needs to go home and restock. Set to -1 for unlimited
|
-- ammotruck.reloads = 5 -- Maxn re-arms a truck can do before he needs to go home and restock. Set to -1 for unlimited
|
||||||
--
|
--
|
||||||
-- ## 3 FSM Events to shape mission
|
-- ## 3 FSM Events to shape mission
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
-- @field #table currentMove Holds the current commanded move, if there is one assigned.
|
-- @field #table currentMove Holds the current commanded move, if there is one assigned.
|
||||||
-- @field #number Nammo0 Initial amount total ammunition (shells+rockets+missiles) of the whole group.
|
-- @field #number Nammo0 Initial amount total ammunition (shells+rockets+missiles) of the whole group.
|
||||||
-- @field #number Nshells0 Initial amount of shells of the whole group.
|
-- @field #number Nshells0 Initial amount of shells of the whole group.
|
||||||
|
-- @field #number Narty0 Initial amount of artillery shells of the whole group.
|
||||||
-- @field #number Nrockets0 Initial amount of rockets of the whole group.
|
-- @field #number Nrockets0 Initial amount of rockets of the whole group.
|
||||||
-- @field #number Nmissiles0 Initial amount of missiles of the whole group.
|
-- @field #number Nmissiles0 Initial amount of missiles of the whole group.
|
||||||
-- @field #number Nukes0 Initial amount of tactical nukes of the whole group. Default is 0.
|
-- @field #number Nukes0 Initial amount of tactical nukes of the whole group. Default is 0.
|
||||||
@@ -415,7 +416,7 @@
|
|||||||
-- arty set, battery "Paladin Alpha", rearming place
|
-- arty set, battery "Paladin Alpha", rearming place
|
||||||
--
|
--
|
||||||
-- Setting the rearming group is independent of the position of the mark. Just create one anywhere on the map and type
|
-- Setting the rearming group is independent of the position of the mark. Just create one anywhere on the map and type
|
||||||
-- arty set, battery "Mortar Bravo", rearming group "Ammo Truck M818"
|
-- arty set, battery "Mortar Bravo", rearming group "Ammo Truck M939"
|
||||||
-- Note that the name of the rearming group has to be given in quotation marks and spelt exactly as the group name defined in the mission editor.
|
-- Note that the name of the rearming group has to be given in quotation marks and spelt exactly as the group name defined in the mission editor.
|
||||||
--
|
--
|
||||||
-- ## Transporting
|
-- ## Transporting
|
||||||
@@ -453,7 +454,7 @@
|
|||||||
-- -- Creat a new ARTY object from a Paladin group.
|
-- -- Creat a new ARTY object from a Paladin group.
|
||||||
-- paladin=ARTY:New(GROUP:FindByName("Blue Paladin"))
|
-- paladin=ARTY:New(GROUP:FindByName("Blue Paladin"))
|
||||||
--
|
--
|
||||||
-- -- Define a rearming group. This is a Transport M818 truck.
|
-- -- Define a rearming group. This is a Transport M939 truck.
|
||||||
-- paladin:SetRearmingGroup(GROUP:FindByName("Blue Ammo Truck"))
|
-- paladin:SetRearmingGroup(GROUP:FindByName("Blue Ammo Truck"))
|
||||||
--
|
--
|
||||||
-- -- Set the max firing range. A Paladin unit has a range of 20 km.
|
-- -- Set the max firing range. A Paladin unit has a range of 20 km.
|
||||||
@@ -694,7 +695,7 @@ ARTY.db={
|
|||||||
|
|
||||||
--- Arty script version.
|
--- Arty script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ARTY.version="1.3.0"
|
ARTY.version="1.3.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -707,7 +708,7 @@ ARTY.version="1.3.0"
|
|||||||
-- DONE: Add user defined rearm weapon types.
|
-- DONE: Add user defined rearm weapon types.
|
||||||
-- DONE: Check if target is in range. Maybe this requires a data base with the ranges of all arty units. <solved by user function>
|
-- DONE: Check if target is in range. Maybe this requires a data base with the ranges of all arty units. <solved by user function>
|
||||||
-- DONE: Make ARTY move to rearming position.
|
-- DONE: Make ARTY move to rearming position.
|
||||||
-- DONE: Check that right rearming vehicle is specified. Blue M818, Red Ural-375. Are there more? <user needs to know!>
|
-- DONE: Check that right rearming vehicle is specified. Blue M939, Red Ural-375. Are there more? <user needs to know!>
|
||||||
-- DONE: Check if ARTY group is still alive.
|
-- DONE: Check if ARTY group is still alive.
|
||||||
-- DONE: Handle dead events.
|
-- DONE: Handle dead events.
|
||||||
-- DONE: Abort firing task if no shooting event occured with 5(?) minutes. Something went wrong then. Min/max range for example.
|
-- DONE: Abort firing task if no shooting event occured with 5(?) minutes. Something went wrong then. Min/max range for example.
|
||||||
@@ -1532,7 +1533,7 @@ end
|
|||||||
|
|
||||||
--- Assign a group, which is responsible for rearming the ARTY group. If the group is too far away from the ARTY group it will be guided towards the ARTY group.
|
--- Assign a group, which is responsible for rearming the ARTY group. If the group is too far away from the ARTY group it will be guided towards the ARTY group.
|
||||||
-- @param #ARTY self
|
-- @param #ARTY self
|
||||||
-- @param Wrapper.Group#GROUP group Group that is supposed to rearm the ARTY group. For the blue coalition, this is often a unarmed M818 transport whilst for red an unarmed Ural-375 transport can be used.
|
-- @param Wrapper.Group#GROUP group Group that is supposed to rearm the ARTY group. For the blue coalition, this is often a unarmed M939 transport whilst for red an unarmed Ural-375 transport can be used.
|
||||||
-- @return self
|
-- @return self
|
||||||
function ARTY:SetRearmingGroup(group)
|
function ARTY:SetRearmingGroup(group)
|
||||||
self:F({group=group})
|
self:F({group=group})
|
||||||
@@ -1887,7 +1888,7 @@ function ARTY:onafterStart(Controllable, From, Event, To)
|
|||||||
MESSAGE:New(text, 5):ToAllIf(self.Debug)
|
MESSAGE:New(text, 5):ToAllIf(self.Debug)
|
||||||
|
|
||||||
-- Get Ammo.
|
-- Get Ammo.
|
||||||
self.Nammo0, self.Nshells0, self.Nrockets0, self.Nmissiles0=self:GetAmmo(self.Debug)
|
self.Nammo0, self.Nshells0, self.Nrockets0, self.Nmissiles0, self.Narty0=self:GetAmmo(self.Debug)
|
||||||
|
|
||||||
-- Init nuclear explosion parameters if they were not set by user.
|
-- Init nuclear explosion parameters if they were not set by user.
|
||||||
if self.nukerange==nil then
|
if self.nukerange==nil then
|
||||||
@@ -2093,7 +2094,7 @@ function ARTY:_StatusReport(display)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Get Ammo.
|
-- Get Ammo.
|
||||||
local Nammo, Nshells, Nrockets, Nmissiles=self:GetAmmo()
|
local Nammo, Nshells, Nrockets, Nmissiles, Narty=self:GetAmmo()
|
||||||
local Nnukes=self.Nukes
|
local Nnukes=self.Nukes
|
||||||
local Nillu=self.Nillu
|
local Nillu=self.Nillu
|
||||||
local Nsmoke=self.Nsmoke
|
local Nsmoke=self.Nsmoke
|
||||||
@@ -2106,7 +2107,7 @@ function ARTY:_StatusReport(display)
|
|||||||
text=text..string.format("Clock = %s\n", Clock)
|
text=text..string.format("Clock = %s\n", Clock)
|
||||||
text=text..string.format("FSM state = %s\n", self:GetState())
|
text=text..string.format("FSM state = %s\n", self:GetState())
|
||||||
text=text..string.format("Total ammo count = %d\n", Nammo)
|
text=text..string.format("Total ammo count = %d\n", Nammo)
|
||||||
text=text..string.format("Number of shells = %d\n", Nshells)
|
text=text..string.format("Number of shells = %d\n", Narty)
|
||||||
text=text..string.format("Number of rockets = %d\n", Nrockets)
|
text=text..string.format("Number of rockets = %d\n", Nrockets)
|
||||||
text=text..string.format("Number of missiles = %d\n", Nmissiles)
|
text=text..string.format("Number of missiles = %d\n", Nmissiles)
|
||||||
text=text..string.format("Number of nukes = %d\n", Nnukes)
|
text=text..string.format("Number of nukes = %d\n", Nnukes)
|
||||||
@@ -2293,19 +2294,19 @@ function ARTY:OnEventShot(EventData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Get current ammo.
|
-- Get current ammo.
|
||||||
local _nammo,_nshells,_nrockets,_nmissiles=self:GetAmmo()
|
local _nammo,_nshells,_nrockets,_nmissiles,_narty=self:GetAmmo()
|
||||||
|
|
||||||
-- Decrease available nukes because we just fired one.
|
-- Decrease available nukes because we just fired one.
|
||||||
if self.currentTarget.weapontype==ARTY.WeaponType.TacticalNukes then
|
if self.currentTarget.weapontype==ARTY.WeaponType.TacticalNukes then
|
||||||
self.Nukes=self.Nukes-1
|
self.Nukes=self.Nukes-1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Decrease available illuminatin shells because we just fired one.
|
-- Decrease available illumination shells because we just fired one.
|
||||||
if self.currentTarget.weapontype==ARTY.WeaponType.IlluminationShells then
|
if self.currentTarget.weapontype==ARTY.WeaponType.IlluminationShells then
|
||||||
self.Nillu=self.Nillu-1
|
self.Nillu=self.Nillu-1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Decrease available illuminatin shells because we just fired one.
|
-- Decrease available smoke shells because we just fired one.
|
||||||
if self.currentTarget.weapontype==ARTY.WeaponType.SmokeShells then
|
if self.currentTarget.weapontype==ARTY.WeaponType.SmokeShells then
|
||||||
self.Nsmoke=self.Nsmoke-1
|
self.Nsmoke=self.Nsmoke-1
|
||||||
end
|
end
|
||||||
@@ -2323,7 +2324,7 @@ function ARTY:OnEventShot(EventData)
|
|||||||
|
|
||||||
-- Weapon type name for current target.
|
-- Weapon type name for current target.
|
||||||
local _weapontype=self:_WeaponTypeName(self.currentTarget.weapontype)
|
local _weapontype=self:_WeaponTypeName(self.currentTarget.weapontype)
|
||||||
self:T(self.lid..string.format("Group %s ammo: total=%d, shells=%d, rockets=%d, missiles=%d", self.groupname, _nammo, _nshells, _nrockets, _nmissiles))
|
self:T(self.lid..string.format("Group %s ammo: total=%d, shells=%d, rockets=%d, missiles=%d", self.groupname, _nammo, _narty, _nrockets, _nmissiles))
|
||||||
self:T(self.lid..string.format("Group %s uses weapontype %s for current target.", self.groupname, _weapontype))
|
self:T(self.lid..string.format("Group %s uses weapontype %s for current target.", self.groupname, _weapontype))
|
||||||
|
|
||||||
-- Default switches for cease fire and relocation.
|
-- Default switches for cease fire and relocation.
|
||||||
@@ -2771,7 +2772,7 @@ function ARTY:onafterStatus(Controllable, From, Event, To)
|
|||||||
self:_EventFromTo("onafterStatus", Event, From, To)
|
self:_EventFromTo("onafterStatus", Event, From, To)
|
||||||
|
|
||||||
-- Get ammo.
|
-- Get ammo.
|
||||||
local nammo, nshells, nrockets, nmissiles=self:GetAmmo()
|
local nammo, nshells, nrockets, nmissiles, narty=self:GetAmmo()
|
||||||
|
|
||||||
-- We have a cargo group ==> check if group was loaded into a carrier.
|
-- We have a cargo group ==> check if group was loaded into a carrier.
|
||||||
if self.iscargo and self.cargogroup then
|
if self.iscargo and self.cargogroup then
|
||||||
@@ -2788,7 +2789,7 @@ function ARTY:onafterStatus(Controllable, From, Event, To)
|
|||||||
|
|
||||||
-- FSM state.
|
-- FSM state.
|
||||||
local fsmstate=self:GetState()
|
local fsmstate=self:GetState()
|
||||||
self:T(self.lid..string.format("Status %s, Ammo total=%d: shells=%d [smoke=%d, illu=%d, nukes=%d*%.3f kT], rockets=%d, missiles=%d", fsmstate, nammo, nshells, self.Nsmoke, self.Nillu, self.Nukes, self.nukewarhead/1000000, nrockets, nmissiles))
|
self:T(self.lid..string.format("Status %s, Ammo total=%d: shells=%d [smoke=%d, illu=%d, nukes=%d*%.3f kT], rockets=%d, missiles=%d", fsmstate, nammo, narty, self.Nsmoke, self.Nillu, self.Nukes, self.nukewarhead/1000000, nrockets, nmissiles))
|
||||||
|
|
||||||
if self.Controllable and self.Controllable:IsAlive() then
|
if self.Controllable and self.Controllable:IsAlive() then
|
||||||
|
|
||||||
@@ -2871,20 +2872,19 @@ function ARTY:onafterStatus(Controllable, From, Event, To)
|
|||||||
if self.currentTarget then
|
if self.currentTarget then
|
||||||
self:CeaseFire(self.currentTarget)
|
self:CeaseFire(self.currentTarget)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Open fire on timed target.
|
if self:is("CombatReady") then
|
||||||
self:OpenFire(_timedTarget)
|
-- Open fire on timed target.
|
||||||
|
self:OpenFire(_timedTarget)
|
||||||
|
end
|
||||||
elseif _normalTarget then
|
elseif _normalTarget then
|
||||||
|
|
||||||
-- Open fire on normal target.
|
if self:is("CombatReady") then
|
||||||
self:OpenFire(_normalTarget)
|
-- Open fire on normal target.
|
||||||
|
self:OpenFire(_normalTarget)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get ammo.
|
|
||||||
--local nammo, nshells, nrockets, nmissiles=self:GetAmmo()
|
|
||||||
|
|
||||||
-- Check if we have a target in the queue for which weapons are still available.
|
-- Check if we have a target in the queue for which weapons are still available.
|
||||||
local gotsome=false
|
local gotsome=false
|
||||||
if #self.targets>0 then
|
if #self.targets>0 then
|
||||||
@@ -3045,14 +3045,14 @@ function ARTY:onafterOpenFire(Controllable, From, Event, To, target)
|
|||||||
local range=Controllable:GetCoordinate():Get2DDistance(target.coord)
|
local range=Controllable:GetCoordinate():Get2DDistance(target.coord)
|
||||||
|
|
||||||
-- Get ammo.
|
-- Get ammo.
|
||||||
local Nammo, Nshells, Nrockets, Nmissiles=self:GetAmmo()
|
local Nammo, Nshells, Nrockets, Nmissiles, Narty=self:GetAmmo()
|
||||||
local nfire=Nammo
|
local nfire=Narty
|
||||||
local _type="shots"
|
local _type="shots"
|
||||||
if target.weapontype==ARTY.WeaponType.Auto then
|
if target.weapontype==ARTY.WeaponType.Auto then
|
||||||
nfire=Nammo
|
nfire=Narty
|
||||||
_type="shots"
|
_type="shots"
|
||||||
elseif target.weapontype==ARTY.WeaponType.Cannon then
|
elseif target.weapontype==ARTY.WeaponType.Cannon then
|
||||||
nfire=Nshells
|
nfire=Narty
|
||||||
_type="shells"
|
_type="shells"
|
||||||
elseif target.weapontype==ARTY.WeaponType.TacticalNukes then
|
elseif target.weapontype==ARTY.WeaponType.TacticalNukes then
|
||||||
nfire=self.Nukes
|
nfire=self.Nukes
|
||||||
@@ -3337,7 +3337,7 @@ function ARTY:_CheckRearmed()
|
|||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
-- Get current ammo.
|
-- Get current ammo.
|
||||||
local nammo,nshells,nrockets,nmissiles=self:GetAmmo()
|
local nammo,nshells,nrockets,nmissiles,narty=self:GetAmmo()
|
||||||
|
|
||||||
-- Number of units still alive.
|
-- Number of units still alive.
|
||||||
local units=self.Controllable:GetUnits()
|
local units=self.Controllable:GetUnits()
|
||||||
@@ -3603,7 +3603,11 @@ function ARTY:_FireAtCoord(coord, radius, nshells, weapontype)
|
|||||||
if weapontype==ARTY.WeaponType.TacticalNukes or weapontype==ARTY.WeaponType.IlluminationShells or weapontype==ARTY.WeaponType.SmokeShells then
|
if weapontype==ARTY.WeaponType.TacticalNukes or weapontype==ARTY.WeaponType.IlluminationShells or weapontype==ARTY.WeaponType.SmokeShells then
|
||||||
weapontype=ARTY.WeaponType.Cannon
|
weapontype=ARTY.WeaponType.Cannon
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if group:HasTask() then
|
||||||
|
group:ClearTasks()
|
||||||
|
end
|
||||||
|
|
||||||
-- Set ROE to weapon free.
|
-- Set ROE to weapon free.
|
||||||
group:OptionROEOpenFire()
|
group:OptionROEOpenFire()
|
||||||
|
|
||||||
@@ -3614,7 +3618,7 @@ function ARTY:_FireAtCoord(coord, radius, nshells, weapontype)
|
|||||||
local fire=group:TaskFireAtPoint(vec2, radius, nshells, weapontype)
|
local fire=group:TaskFireAtPoint(vec2, radius, nshells, weapontype)
|
||||||
|
|
||||||
-- Execute task.
|
-- Execute task.
|
||||||
group:SetTask(fire)
|
group:SetTask(fire,1)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set task for attacking a group.
|
--- Set task for attacking a group.
|
||||||
@@ -3631,7 +3635,11 @@ function ARTY:_AttackGroup(target)
|
|||||||
if weapontype==ARTY.WeaponType.TacticalNukes or weapontype==ARTY.WeaponType.IlluminationShells or weapontype==ARTY.WeaponType.SmokeShells then
|
if weapontype==ARTY.WeaponType.TacticalNukes or weapontype==ARTY.WeaponType.IlluminationShells or weapontype==ARTY.WeaponType.SmokeShells then
|
||||||
weapontype=ARTY.WeaponType.Cannon
|
weapontype=ARTY.WeaponType.Cannon
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if group:HasTask() then
|
||||||
|
group:ClearTasks()
|
||||||
|
end
|
||||||
|
|
||||||
-- Set ROE to weapon free.
|
-- Set ROE to weapon free.
|
||||||
group:OptionROEOpenFire()
|
group:OptionROEOpenFire()
|
||||||
|
|
||||||
@@ -3642,7 +3650,7 @@ function ARTY:_AttackGroup(target)
|
|||||||
local fire=group:TaskAttackGroup(targetgroup, weapontype, AI.Task.WeaponExpend.ONE, 1)
|
local fire=group:TaskAttackGroup(targetgroup, weapontype, AI.Task.WeaponExpend.ONE, 1)
|
||||||
|
|
||||||
-- Execute task.
|
-- Execute task.
|
||||||
group:SetTask(fire)
|
group:SetTask(fire,1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -3709,51 +3717,6 @@ function ARTY:_NuclearBlast(_coord)
|
|||||||
ignite(_fires)
|
ignite(_fires)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
|
||||||
local ZoneNuke=ZONE_RADIUS:New("Nukezone", _coord:GetVec2(), 2000)
|
|
||||||
|
|
||||||
-- Scan for Scenery objects.
|
|
||||||
ZoneNuke:Scan(Object.Category.SCENERY)
|
|
||||||
|
|
||||||
-- Array with all possible hideouts, i.e. scenery objects in the vicinity of the group.
|
|
||||||
local scenery={}
|
|
||||||
|
|
||||||
for SceneryTypeName, SceneryData in pairs(ZoneNuke:GetScannedScenery()) do
|
|
||||||
for SceneryName, SceneryObject in pairs(SceneryData) do
|
|
||||||
|
|
||||||
local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY
|
|
||||||
|
|
||||||
-- Position of the scenery object.
|
|
||||||
local spos=SceneryObject:GetCoordinate()
|
|
||||||
|
|
||||||
-- Distance from group to impact point.
|
|
||||||
local distance= spos:Get2DDistance(_coord)
|
|
||||||
|
|
||||||
-- Place markers on every possible scenery object.
|
|
||||||
if self.Debug then
|
|
||||||
local MarkerID=spos:MarkToAll(string.format("%s scenery object %s", self.Controllable:GetName(), SceneryObject:GetTypeName()))
|
|
||||||
local text=string.format("%s scenery: %s, Coord %s", self.Controllable:GetName(), SceneryObject:GetTypeName(), SceneryObject:GetCoordinate():ToStringLLDMS())
|
|
||||||
self:T2(SUPPRESSION.id..text)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add to table.
|
|
||||||
table.insert(scenery, {object=SceneryObject, distance=distance})
|
|
||||||
|
|
||||||
--SceneryObject:Destroy()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Sort scenery wrt to distance from impact point.
|
|
||||||
-- local _sort = function(a,b) return a.distance < b.distance end
|
|
||||||
-- table.sort(scenery,_sort)
|
|
||||||
|
|
||||||
-- for _,object in pairs(scenery) do
|
|
||||||
-- local sobject=object -- Wrapper.Scenery#SCENERY
|
|
||||||
-- sobject:Destroy()
|
|
||||||
-- end
|
|
||||||
|
|
||||||
]]
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Route group to a certain point.
|
--- Route group to a certain point.
|
||||||
@@ -3915,6 +3878,7 @@ end
|
|||||||
-- @return #number Number of shells the group has left.
|
-- @return #number Number of shells the group has left.
|
||||||
-- @return #number Number of rockets the group has left.
|
-- @return #number Number of rockets the group has left.
|
||||||
-- @return #number Number of missiles the group has left.
|
-- @return #number Number of missiles the group has left.
|
||||||
|
-- @return #number Number of artillery shells the group has left.
|
||||||
function ARTY:GetAmmo(display)
|
function ARTY:GetAmmo(display)
|
||||||
self:F3({display=display})
|
self:F3({display=display})
|
||||||
|
|
||||||
@@ -3928,6 +3892,7 @@ function ARTY:GetAmmo(display)
|
|||||||
local nshells=0
|
local nshells=0
|
||||||
local nrockets=0
|
local nrockets=0
|
||||||
local nmissiles=0
|
local nmissiles=0
|
||||||
|
local nartyshells=0
|
||||||
|
|
||||||
-- Get all units.
|
-- Get all units.
|
||||||
local units=self.Controllable:GetUnits()
|
local units=self.Controllable:GetUnits()
|
||||||
@@ -4030,7 +3995,8 @@ function ARTY:GetAmmo(display)
|
|||||||
|
|
||||||
-- Add up all shells.
|
-- Add up all shells.
|
||||||
nshells=nshells+Nammo
|
nshells=nshells+Nammo
|
||||||
|
local _,_,_,_,_,shells = unit:GetAmmunition()
|
||||||
|
nartyshells=nartyshells+shells
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
text=text..string.format("- %d shells of type %s\n", Nammo, _weaponName)
|
text=text..string.format("- %d shells of type %s\n", Nammo, _weaponName)
|
||||||
|
|
||||||
@@ -4076,7 +4042,7 @@ function ARTY:GetAmmo(display)
|
|||||||
-- Total amount of ammunition.
|
-- Total amount of ammunition.
|
||||||
nammo=nshells+nrockets+nmissiles
|
nammo=nshells+nrockets+nmissiles
|
||||||
|
|
||||||
return nammo, nshells, nrockets, nmissiles
|
return nammo, nshells, nrockets, nmissiles, nartyshells
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns a name of a missile category.
|
--- Returns a name of a missile category.
|
||||||
@@ -4827,7 +4793,10 @@ function ARTY:_CheckShootingStarted()
|
|||||||
|
|
||||||
-- Check if we waited long enough and no shot was fired.
|
-- Check if we waited long enough and no shot was fired.
|
||||||
--if dt > self.WaitForShotTime and self.Nshots==0 then
|
--if dt > self.WaitForShotTime and self.Nshots==0 then
|
||||||
if dt > self.WaitForShotTime and (self.Nshots==0 or self.currentTarget.nshells >= self.Nshots) then --https://github.com/FlightControl-Master/MOOSE/issues/1356
|
|
||||||
|
self:T(string.format("dt = %d WaitTime = %d | shots = %d TargetShells = %d",dt,self.WaitForShotTime,self.Nshots,self.currentTarget.nshells))
|
||||||
|
|
||||||
|
if (dt > self.WaitForShotTime and self.Nshots==0) or (self.currentTarget.nshells <= self.Nshots) then --https://github.com/FlightControl-Master/MOOSE/issues/1356
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T(self.lid..string.format("%s, no shot event after %d seconds. Removing current target %s from list.", self.groupname, self.WaitForShotTime, name))
|
self:T(self.lid..string.format("%s, no shot event after %d seconds. Removing current target %s from list.", self.groupname, self.WaitForShotTime, name))
|
||||||
@@ -4889,7 +4858,7 @@ end
|
|||||||
function ARTY:_CheckOutOfAmmo(targets)
|
function ARTY:_CheckOutOfAmmo(targets)
|
||||||
|
|
||||||
-- Get current ammo.
|
-- Get current ammo.
|
||||||
local _nammo,_nshells,_nrockets,_nmissiles=self:GetAmmo()
|
local _nammo,_nshells,_nrockets,_nmissiles,_narty=self:GetAmmo()
|
||||||
|
|
||||||
-- Special weapon type requested ==> Check if corresponding ammo is empty.
|
-- Special weapon type requested ==> Check if corresponding ammo is empty.
|
||||||
local _partlyoutofammo=false
|
local _partlyoutofammo=false
|
||||||
@@ -4901,7 +4870,7 @@ function ARTY:_CheckOutOfAmmo(targets)
|
|||||||
self:T(self.lid..string.format("Group %s, auto weapon requested for target %s but all ammo is empty.", self.groupname, Target.name))
|
self:T(self.lid..string.format("Group %s, auto weapon requested for target %s but all ammo is empty.", self.groupname, Target.name))
|
||||||
_partlyoutofammo=true
|
_partlyoutofammo=true
|
||||||
|
|
||||||
elseif Target.weapontype==ARTY.WeaponType.Cannon and _nshells==0 then
|
elseif Target.weapontype==ARTY.WeaponType.Cannon and _narty==0 then
|
||||||
|
|
||||||
self:T(self.lid..string.format("Group %s, cannons requested for target %s but shells empty.", self.groupname, Target.name))
|
self:T(self.lid..string.format("Group %s, cannons requested for target %s but shells empty.", self.groupname, Target.name))
|
||||||
_partlyoutofammo=true
|
_partlyoutofammo=true
|
||||||
@@ -4945,14 +4914,14 @@ end
|
|||||||
function ARTY:_CheckWeaponTypeAvailable(target)
|
function ARTY:_CheckWeaponTypeAvailable(target)
|
||||||
|
|
||||||
-- Get current ammo of group.
|
-- Get current ammo of group.
|
||||||
local Nammo, Nshells, Nrockets, Nmissiles=self:GetAmmo()
|
local Nammo, Nshells, Nrockets, Nmissiles, Narty=self:GetAmmo()
|
||||||
|
|
||||||
-- Check if enough ammo is there for the selected weapon type.
|
-- Check if enough ammo is there for the selected weapon type.
|
||||||
local nfire=Nammo
|
local nfire=Nammo
|
||||||
if target.weapontype==ARTY.WeaponType.Auto then
|
if target.weapontype==ARTY.WeaponType.Auto then
|
||||||
nfire=Nammo
|
nfire=Nammo
|
||||||
elseif target.weapontype==ARTY.WeaponType.Cannon then
|
elseif target.weapontype==ARTY.WeaponType.Cannon then
|
||||||
nfire=Nshells
|
nfire=Narty
|
||||||
elseif target.weapontype==ARTY.WeaponType.TacticalNukes then
|
elseif target.weapontype==ARTY.WeaponType.TacticalNukes then
|
||||||
nfire=self.Nukes
|
nfire=self.Nukes
|
||||||
elseif target.weapontype==ARTY.WeaponType.IlluminationShells then
|
elseif target.weapontype==ARTY.WeaponType.IlluminationShells then
|
||||||
|
|||||||
@@ -52,11 +52,13 @@
|
|||||||
-- @module Functional.CleanUp
|
-- @module Functional.CleanUp
|
||||||
-- @image CleanUp_Airbases.JPG
|
-- @image CleanUp_Airbases.JPG
|
||||||
|
|
||||||
--- @type CLEANUP_AIRBASE.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-)
|
---
|
||||||
|
-- @type CLEANUP_AIRBASE.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-)
|
||||||
-- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.
|
-- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- @type CLEANUP_AIRBASE
|
---
|
||||||
|
-- @type CLEANUP_AIRBASE
|
||||||
-- @extends #CLEANUP_AIRBASE.__
|
-- @extends #CLEANUP_AIRBASE.__
|
||||||
|
|
||||||
--- Keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.
|
--- Keeps airbases clean, and tries to guarantee continuous airbase operations, even under combat.
|
||||||
@@ -93,7 +95,7 @@ CLEANUP_AIRBASE = {
|
|||||||
-- @field #CLEANUP_AIRBASE.__
|
-- @field #CLEANUP_AIRBASE.__
|
||||||
CLEANUP_AIRBASE.__ = {}
|
CLEANUP_AIRBASE.__ = {}
|
||||||
|
|
||||||
--- @field #CLEANUP_AIRBASE.__.Airbases
|
-- @field #CLEANUP_AIRBASE.__.Airbases
|
||||||
CLEANUP_AIRBASE.__.Airbases = {}
|
CLEANUP_AIRBASE.__.Airbases = {}
|
||||||
|
|
||||||
--- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
|
--- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
|
||||||
@@ -240,7 +242,8 @@ function CLEANUP_AIRBASE.__:DestroyMissile( MissileObject )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #CLEANUP_AIRBASE self
|
---
|
||||||
|
-- @param #CLEANUP_AIRBASE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function CLEANUP_AIRBASE.__:OnEventBirth( EventData )
|
function CLEANUP_AIRBASE.__:OnEventBirth( EventData )
|
||||||
self:F( { EventData } )
|
self:F( { EventData } )
|
||||||
|
|||||||
687
Moose Development/Moose/Functional/ClientWatch.lua
Normal file
687
Moose Development/Moose/Functional/ClientWatch.lua
Normal file
@@ -0,0 +1,687 @@
|
|||||||
|
--- **Functional** - Manage and track client slots easily to add your own client-based menus and modules to.
|
||||||
|
--
|
||||||
|
-- The @{#CLIENTWATCH} class adds a simplified way to create scripts and menus for individual clients. Instead of creating large algorithms and juggling multiple event handlers, you can simply provide one or more prefixes to the class and use the callback functions on spawn, despawn, and any aircraft related events to script to your hearts content.
|
||||||
|
--
|
||||||
|
-- ===
|
||||||
|
--
|
||||||
|
-- ## Features:
|
||||||
|
--
|
||||||
|
-- * Find clients by prefixes or by providing a Wrapper.CLIENT object
|
||||||
|
-- * Trigger functions when the client spawns and despawns
|
||||||
|
-- * Create multiple client instances without overwriting event handlers between instances
|
||||||
|
-- * More reliable aircraft lost events for when DCS thinks the aircraft id dead but a dead event fails to trigger
|
||||||
|
-- * Easily manage clients spawned in dynamic slots
|
||||||
|
--
|
||||||
|
-- ====
|
||||||
|
--
|
||||||
|
-- ### Author: **Statua**
|
||||||
|
--
|
||||||
|
-- ### Contributions: **FlightControl**: Wrapper.CLIENT
|
||||||
|
--
|
||||||
|
-- ====
|
||||||
|
-- @module Functional.ClientWatch
|
||||||
|
-- @image clientwatch.jpg
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
--- CLIENTWATCH class
|
||||||
|
-- @type CLIENTWATCH
|
||||||
|
-- @field #string ClassName Name of the class.
|
||||||
|
-- @field #boolean Debug Write Debug messages to DCS log file and send Debug messages to all players.
|
||||||
|
-- @field #string lid String for DCS log file.
|
||||||
|
-- @field #number FilterCoalition If not nil, will only activate for aircraft of the given coalition value.
|
||||||
|
-- @field #number FilterCategory If not nil, will only activate for aircraft of the given category value.
|
||||||
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
--- Manage and track client slots easily to add your own client-based menus and modules to.
|
||||||
|
--
|
||||||
|
-- ## Creating a new instance
|
||||||
|
--
|
||||||
|
-- To start, you must first create a new instance of the client manager and provide it with either a Wrapper.Client#CLIENT object, a string prefix of the unit name, or a table of string prefixes for unit names. These are used to capture the client unit when it spawns and apply your scripted functions to it. Only fixed wing and rotary wing aircraft controlled by players can be used by this class.
|
||||||
|
-- **This will not work if the client aircraft is alive!**
|
||||||
|
--
|
||||||
|
-- ### Examples
|
||||||
|
--
|
||||||
|
-- -- Create an instance with a Wrapper.Client#CLIENT object
|
||||||
|
-- local heliClient = CLIENT:FindByName('Rotary1-1')
|
||||||
|
-- local clientInstance = CLIENTWATCH:New(heliClient)
|
||||||
|
--
|
||||||
|
-- -- Create an instance with part of the unit name in the Mission Editor
|
||||||
|
-- local clientInstance = CLIENTWATCH:New("Rotary")
|
||||||
|
--
|
||||||
|
-- -- Create an instance using prefixes for a few units as well as a FARP name for any dynamic spawns coming out of it
|
||||||
|
-- local clientInstance = CLIENTWATCH:New({"Rescue","UH-1H","FARP ALPHA"})
|
||||||
|
--
|
||||||
|
-- ## Applying functions and methods to client aircraft when they spawn
|
||||||
|
--
|
||||||
|
-- Once the instance is created, it will watch for birth events. If the unit name of the client aircraft matches the one provided in the instance, the callback method @{#CLIENTWATCH:OnAfterSpawn}() can be used to apply functions and methods to the client object.
|
||||||
|
--
|
||||||
|
-- In the OnAfterSpawn() callback method are four values. From, Event, To, and ClientObject. From,Event,To are standard FSM strings for the state changes. ClientObject is where the magic happens. This is a special object which you can use to access all the data of the client aircraft. The following entries in ClientObject are available for you to use:
|
||||||
|
--
|
||||||
|
-- * **ClientObject.Unit**: The Moose @{Wrapper.Unit#UNIT} of the client aircraft
|
||||||
|
-- * **ClientObject.Group**: The Moose @{Wrapper.Group#GRUP} of the client aircraft
|
||||||
|
-- * **ClientObject.Client**: The Moose @{Wrapper.Client#CLIENT} of the client aircraft
|
||||||
|
-- * **ClientObject.PlayerName**: A #string of the player controlling the aircraft
|
||||||
|
-- * **ClientObject.UnitName**: A #string of the client aircraft unit.
|
||||||
|
-- * **ClientObject.GroupName**: A #string of the client aircraft group.
|
||||||
|
--
|
||||||
|
-- ### Examples
|
||||||
|
--
|
||||||
|
-- -- Create an instance with a client unit prefix and send them a message when they spawn
|
||||||
|
-- local clientInstance = CLIENTWATCH:New("Rotary")
|
||||||
|
-- function clientInstance:OnAfterSpawn(From,Event,To,ClientObject,EventData)
|
||||||
|
-- MESSAGE:New("Welcome to your aircraft!",10):ToUnit(ClientObject.Unit)
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- ## Using event callbacks
|
||||||
|
--
|
||||||
|
-- In a normal setting, you can only use a callback function for a specific option in one location. If you have multiple scripts that rely on the same callback from the same object, this can get quite messy. With the ClientWatch module, these callbacks are isolated t the instances and therefore open the possibility to use many instances with the same callback doing different things. ClientWatch instances subscribe to all events that are applicable to player controlled aircraft and provides callbacks for each, forwarding the EventData in the callback function.
|
||||||
|
--
|
||||||
|
-- The following event callbacks can be used inside the OnAfterSpawn() callback:
|
||||||
|
--
|
||||||
|
-- * **:OnAfterDespawn(From,Event,To)**: Triggers whenever DCS no longer sees the aircraft as 'alive'. No event data is given in this callback as it is derived from other events
|
||||||
|
-- * **:OnAfterHit(From,Event,To,EventData)**: Triggers every time the aircraft takes damage or is struck by a weapon/explosion
|
||||||
|
-- * **:OnAfterKill(From,Event,To,EventData)**: Triggers after the aircraft kills something with its weapons
|
||||||
|
-- * **:OnAfterScore(From,Event,To,EventData)**: Triggers after accumulating score
|
||||||
|
-- * **:OnAfterShot(From,Event,To,EventData)**: Triggers after a single-shot weapon is released
|
||||||
|
-- * **:OnAfterShootingStart(From,Event,To,EventData)**: Triggers when an automatic weapon begins firing
|
||||||
|
-- * **:OnAfterShootingEnd(From,Event,To,EventData)**: Triggers when an automatic weapon stops firing
|
||||||
|
-- * **:OnAfterLand(From,Event,To,EventData)**: Triggers when an aircraft transitions from being airborne to on the ground
|
||||||
|
-- * **:OnAfterTakeoff(From,Event,To,EventData)**: Triggers when an aircraft transitions from being on the ground to airborne
|
||||||
|
-- * **:OnAfterRunwayTakeoff(From,Event,To,EventData)**: Triggers after lifting off from a runway
|
||||||
|
-- * **:OnAfterRunwayTouch(From,Event,To,EventData)**: Triggers when an aircraft's gear makes contact with a runway
|
||||||
|
-- * **:OnAfterRefueling(From,Event,To,EventData)**: Triggers when an aircraft begins taking on fuel
|
||||||
|
-- * **:OnAfterRefuelingStop(From,Event,To,EventData)**: Triggers when an aircraft stops taking on fuel
|
||||||
|
-- * **:OnAfterPlayerLeaveUnit(From,Event,To,EventData)**: Triggers when a player leaves an operational aircraft
|
||||||
|
-- * **:OnAfterCrash(From,Event,To,EventData)**: Triggers when an aircraft is destroyed (may fail to trigger if the aircraft is only partially destroyed)
|
||||||
|
-- * **:OnAfterDead(From,Event,To,EventData)**: Triggers when an aircraft is considered dead (may fail to trigger if the aircraft was partially destroyed first)
|
||||||
|
-- * **:OnAfterPilotDead(From,Event,To,EventData)**: Triggers when the pilot is killed (may fail to trigger if the aircraft was partially destroyed first)
|
||||||
|
-- * **:OnAfterUnitLost(From,Event,To,EventData)**: Triggers when an aircraft is lost for any reason (may fail to trigger if the aircraft was partially destroyed first)
|
||||||
|
-- * **:OnAfterEjection(From,Event,To,EventData)**: Triggers when a pilot ejects from an aircraft
|
||||||
|
-- * **:OnAfterHumanFailure(From,Event,To,EventData)**: Triggers when an aircraft or system is damaged from any source or action by the player
|
||||||
|
-- * **:OnAfterHumanAircraftRepairStart(From,Event,To,EventData)**: Triggers when an aircraft repair is started
|
||||||
|
-- * **:OnAfterHumanAircraftRepairFinish(From,Event,To,EventData)**: Triggers when an aircraft repair is completed
|
||||||
|
-- * **:OnAfterEngineStartup(From,Event,To,EventData)**: Triggers when the engine enters what DCS considers to be a started state. Parameters vary by aircraft
|
||||||
|
-- * **:OnAfterEngineShutdown(From,Event,To,EventData)**: Triggers when the engine enters what DCS considers to be a stopped state. Parameters vary by aircraft
|
||||||
|
-- * **:OnAfterWeaponAdd(From,Event,To,EventData)**: Triggers when an item is added to an aircraft's payload
|
||||||
|
-- * **:OnAfterWeaponDrop(From,Event,To,EventData)**: Triggers when an item is jettisoned or dropped from an aircraft (unconfirmed)
|
||||||
|
-- * **:OnAfterWeaponRearm(From,Event,To,EventData)**: Triggers when an item with internal supply is restored (unconfirmed)
|
||||||
|
--
|
||||||
|
-- ### Examples
|
||||||
|
--
|
||||||
|
-- -- Show a message to player when they take damage from a weapon
|
||||||
|
-- local clientInstance = CLIENTWATCH:New("Rotary")
|
||||||
|
-- function clientInstance:OnAfterSpawn(From,Event,To,ClientObject,EventData)
|
||||||
|
-- function ClientObject:OnAfterHit(From,Event,To,EventData)
|
||||||
|
-- local typeShooter = EventData.IniTypeName
|
||||||
|
-- local nameWeapon = EventData.weapon_name
|
||||||
|
-- MESSAGE:New("A "..typeShooter.." hit you with a "..nameWeapon,20):ToUnit(ClientObject.Unit)
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- @field #CLIENTWATCH
|
||||||
|
CLIENTWATCH = {}
|
||||||
|
CLIENTWATCH.ClassName = "CLIENTWATCH"
|
||||||
|
CLIENTWATCH.Debug = false
|
||||||
|
CLIENTWATCH.DebugEventData = false
|
||||||
|
CLIENTWATCH.lid = nil
|
||||||
|
|
||||||
|
-- @type CLIENTWATCHTools
|
||||||
|
-- @field #table Unit Wrapper.UNIT of the cient object
|
||||||
|
-- @field #table Group Wrapper.GROUP of the cient object
|
||||||
|
-- @field #table Client Wrapper.CLIENT of the cient object
|
||||||
|
-- @field #string PlayerName Name of the player controlling the client object
|
||||||
|
-- @field #string UnitName Name of the unit that is the client object
|
||||||
|
-- @field #string GroupName Name of the group the client object belongs to
|
||||||
|
CLIENTWATCHTools = {}
|
||||||
|
|
||||||
|
--- CLIENTWATCH version
|
||||||
|
-- @field #string version
|
||||||
|
CLIENTWATCH.version="1.0.1"
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--- Creates a new instance of CLIENTWATCH to add scripts to. Can be used multiple times with the same client/prefixes if you need it for multiple scripts.
|
||||||
|
-- @param #CLIENTWATCH self
|
||||||
|
-- @param #string Will watch for clients whos UNIT NAME or GROUP NAME matches part of the #string as a prefix.
|
||||||
|
-- @param #table Put strings in a table to use multiple prefixes for the above method.
|
||||||
|
-- @param Wrapper.Client#CLIENT Provide a Moose CLIENT object to apply to that specific aircraft slot (static slots only!)
|
||||||
|
-- @param #nil Leave blank to activate for ALL CLIENTS
|
||||||
|
-- @return #CLIENTWATCH self
|
||||||
|
function CLIENTWATCH:New(client)
|
||||||
|
--Init FSM
|
||||||
|
local self=BASE:Inherit(self, FSM:New())
|
||||||
|
self:SetStartState( "Idle" )
|
||||||
|
self:AddTransition( "*", "Spawn", "*" )
|
||||||
|
|
||||||
|
self.FilterCoalition = nil
|
||||||
|
self.FilterCategory = nil
|
||||||
|
|
||||||
|
--- User function for OnAfter "Spawn" event.
|
||||||
|
-- @function [parent=#CLIENTWATCH] OnAfterSpawn
|
||||||
|
-- @param #CLIENTWATCH self
|
||||||
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable Controllable of the group.
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #table clientObject Custom object that handles events and stores Moose object data. See top documentation for more details.
|
||||||
|
-- @param #table eventdata Data from EVENTS.Birth.
|
||||||
|
|
||||||
|
--Set up spawn tracking
|
||||||
|
if not client then
|
||||||
|
if self.Debug then self:I({"New client instance created. ClientType = All clients"}) end
|
||||||
|
self:HandleEvent(EVENTS.Birth)
|
||||||
|
function self:OnEventBirth(eventdata)
|
||||||
|
if (eventdata.IniCategory == 0 or eventdata.IniCategory == 1) and eventdata.IniPlayerName
|
||||||
|
and (not self.FilterCoalition or self.FilterCoalition == eventdata.IniCoalition)
|
||||||
|
and (not self.FilterCategory or self.FilterCategory == eventdata.IniCategory) then
|
||||||
|
if self.Debug then
|
||||||
|
self:I({"Client spawned in.",IniCategory = eventdata.IniCategory})
|
||||||
|
end
|
||||||
|
local clientWatchDebug = self.Debug
|
||||||
|
local clientObject = CLIENTWATCHTools:_newClient(clientWatchDebug,eventdata)
|
||||||
|
self:Spawn(clientObject,eventdata)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif type(client) == "table" or type(client) == "string" then
|
||||||
|
if type(client) == "table" then
|
||||||
|
|
||||||
|
--CLIENT TABLE
|
||||||
|
if client.ClassName == "CLIENT" then
|
||||||
|
if self.Debug then self:I({"New client instance created. ClientType = Wrapper.CLIENT",client}) end
|
||||||
|
self.ClientName = client:GetName()
|
||||||
|
self:HandleEvent(EVENTS.Birth)
|
||||||
|
function self:OnEventBirth(eventdata)
|
||||||
|
if (eventdata.IniCategory == 0 or eventdata.IniCategory == 1) and eventdata.IniPlayerName
|
||||||
|
and (not self.FilterCoalition or self.FilterCoalition == eventdata.IniCoalition)
|
||||||
|
and (not self.FilterCategory or self.FilterCategory == eventdata.IniCategory) then
|
||||||
|
if self.ClientName == eventdata.IniUnitName then
|
||||||
|
if self.Debug then
|
||||||
|
self:I({"Client spawned in.",IniCategory = eventdata.IniCategory})
|
||||||
|
end
|
||||||
|
local clientWatchDebug = self.Debug
|
||||||
|
local clientObject = CLIENTWATCHTools:_newClient(clientWatchDebug,eventdata)
|
||||||
|
self:Spawn(clientObject,eventdata)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--STRING TABLE
|
||||||
|
else
|
||||||
|
if self.Debug then self:I({"New client instance created. ClientType = Multiple Prefixes",client}) end
|
||||||
|
local tableValid = true
|
||||||
|
for _,entry in pairs(client) do
|
||||||
|
if type(entry) ~= "string" then
|
||||||
|
tableValid = false
|
||||||
|
self:E({"The base handler failed to start because at least one entry in param1's table is not a string!",InvalidEntry = entry})
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if tableValid then
|
||||||
|
self:HandleEvent(EVENTS.Birth)
|
||||||
|
function self:OnEventBirth(eventdata)
|
||||||
|
for _,entry in pairs(client) do
|
||||||
|
if (eventdata.IniCategory == 0 or eventdata.IniCategory == 1) and eventdata.IniPlayerName
|
||||||
|
and (not self.FilterCoalition or self.FilterCoalition == eventdata.IniCoalition)
|
||||||
|
and (not self.FilterCategory or self.FilterCategory == eventdata.IniCategory) then
|
||||||
|
if string.match(eventdata.IniUnitName,entry) or string.match(eventdata.IniGroupName,entry) then
|
||||||
|
if self.Debug then
|
||||||
|
self:I({"Client spawned in.",IniCategory = eventdata.IniCategory})
|
||||||
|
end
|
||||||
|
local clientWatchDebug = self.Debug
|
||||||
|
local clientObject = CLIENTWATCHTools:_newClient(clientWatchDebug,eventdata)
|
||||||
|
self:Spawn(clientObject,eventdata)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if self.Debug then self:I({"New client instance created. ClientType = Single Prefix",client}) end
|
||||||
|
|
||||||
|
--SOLO STRING
|
||||||
|
self:HandleEvent(EVENTS.Birth)
|
||||||
|
function self:OnEventBirth(eventdata)
|
||||||
|
if (eventdata.IniCategory == 0 or eventdata.IniCategory == 1) and eventdata.IniPlayerName
|
||||||
|
and (not self.FilterCoalition or self.FilterCoalition == eventdata.IniCoalition)
|
||||||
|
and (not self.FilterCategory or self.FilterCategory == eventdata.IniCategory) then
|
||||||
|
if string.match(eventdata.IniUnitName,client) or string.match(eventdata.IniGroupName,client) then
|
||||||
|
if self.Debug then
|
||||||
|
self:I({"Client spawned in.",IniCategory = eventdata.IniCategory})
|
||||||
|
end
|
||||||
|
local clientWatchDebug = self.Debug
|
||||||
|
local clientObject = CLIENTWATCHTools:_newClient(clientWatchDebug,eventdata)
|
||||||
|
self:Spawn(clientObject,eventdata)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:E({"The base handler failed to start because param1 is not a CLIENT object or a prefix string!",param1 = client})
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Filter out all clients not belonging to the provided coalition
|
||||||
|
-- @param #CLIENTWATCH self
|
||||||
|
-- @param #number Coalition number (1 = red, 2 = blue)
|
||||||
|
-- @param #string Coalition string ('red' or 'blue')
|
||||||
|
function CLIENTWATCH:FilterByCoalition(value)
|
||||||
|
if value == 1 or value == "red" then
|
||||||
|
self.FilterCoalition = 1
|
||||||
|
else
|
||||||
|
self.FilterCoalition = 2
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Filter out all clients that are not of the given category
|
||||||
|
-- @param #CLIENTWATCH self
|
||||||
|
-- @param #number Category number (0 = airplane, 1 = helicopter)
|
||||||
|
-- @param #string Category string ('airplane' or 'helicopter')
|
||||||
|
function CLIENTWATCH:FilterByCategory(value)
|
||||||
|
if value == 1 or value == "helicopter" then
|
||||||
|
self.FilterCategory = 1
|
||||||
|
else
|
||||||
|
self.FilterCategory = 0
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--- Internal function for creating a new client on birth. Do not use!!!.
|
||||||
|
-- @param #CLIENTWATCHTools self
|
||||||
|
-- @param #EVENTS.Birth EventData
|
||||||
|
-- @return #CLIENTWATCHTools self
|
||||||
|
function CLIENTWATCHTools:_newClient(clientWatchDebug,eventdata)
|
||||||
|
--Init FSM
|
||||||
|
local self=BASE:Inherit(self, FSM:New())
|
||||||
|
self:SetStartState( "Alive" )
|
||||||
|
self:AddTransition( "Alive", "Despawn", "Dead" )
|
||||||
|
|
||||||
|
self.Unit = eventdata.IniUnit
|
||||||
|
self.Group = self.Unit:GetGroup()
|
||||||
|
self.Client = self.Unit:GetClient()
|
||||||
|
self.PlayerName = self.Unit:GetPlayerName()
|
||||||
|
self.UnitName = self.Unit:GetName()
|
||||||
|
self.GroupName = self.Group:GetName()
|
||||||
|
|
||||||
|
--Event events
|
||||||
|
self:AddTransition( "*", "Hit", "*" )
|
||||||
|
self:AddTransition( "*", "Kill", "*" )
|
||||||
|
self:AddTransition( "*", "Score", "*" )
|
||||||
|
self:AddTransition( "*", "Shot", "*" )
|
||||||
|
self:AddTransition( "*", "ShootingStart", "*" )
|
||||||
|
self:AddTransition( "*", "ShootingEnd", "*" )
|
||||||
|
self:AddTransition( "*", "Land", "*" )
|
||||||
|
self:AddTransition( "*", "Takeoff", "*" )
|
||||||
|
self:AddTransition( "*", "RunwayTakeoff", "*" )
|
||||||
|
self:AddTransition( "*", "RunwayTouch", "*" )
|
||||||
|
self:AddTransition( "*", "Refueling", "*" )
|
||||||
|
self:AddTransition( "*", "RefuelingStop", "*" )
|
||||||
|
self:AddTransition( "*", "PlayerLeaveUnit", "*" )
|
||||||
|
self:AddTransition( "*", "Crash", "*" )
|
||||||
|
self:AddTransition( "*", "Dead", "*" )
|
||||||
|
self:AddTransition( "*", "PilotDead", "*" )
|
||||||
|
self:AddTransition( "*", "UnitLost", "*" )
|
||||||
|
self:AddTransition( "*", "Ejection", "*" )
|
||||||
|
self:AddTransition( "*", "HumanFailure", "*" )
|
||||||
|
self:AddTransition( "*", "HumanAircraftRepairFinish", "*" )
|
||||||
|
self:AddTransition( "*", "HumanAircraftRepairStart", "*" )
|
||||||
|
self:AddTransition( "*", "EngineShutdown", "*" )
|
||||||
|
self:AddTransition( "*", "EngineStartup", "*" )
|
||||||
|
self:AddTransition( "*", "WeaponAdd", "*" )
|
||||||
|
self:AddTransition( "*", "WeaponDrop", "*" )
|
||||||
|
self:AddTransition( "*", "WeaponRearm", "*" )
|
||||||
|
|
||||||
|
--Event Handlers
|
||||||
|
self:HandleEvent( EVENTS.Hit )
|
||||||
|
self:HandleEvent( EVENTS.Kill )
|
||||||
|
self:HandleEvent( EVENTS.Score )
|
||||||
|
self:HandleEvent( EVENTS.Shot )
|
||||||
|
self:HandleEvent( EVENTS.ShootingStart )
|
||||||
|
self:HandleEvent( EVENTS.ShootingEnd )
|
||||||
|
self:HandleEvent( EVENTS.Land )
|
||||||
|
self:HandleEvent( EVENTS.Takeoff )
|
||||||
|
self:HandleEvent( EVENTS.RunwayTakeoff )
|
||||||
|
self:HandleEvent( EVENTS.RunwayTouch )
|
||||||
|
self:HandleEvent( EVENTS.Refueling )
|
||||||
|
self:HandleEvent( EVENTS.RefuelingStop )
|
||||||
|
self:HandleEvent( EVENTS.PlayerLeaveUnit )
|
||||||
|
self:HandleEvent( EVENTS.Crash )
|
||||||
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
self:HandleEvent( EVENTS.PilotDead )
|
||||||
|
self:HandleEvent( EVENTS.UnitLost )
|
||||||
|
self:HandleEvent( EVENTS.Ejection )
|
||||||
|
self:HandleEvent( EVENTS.HumanFailure )
|
||||||
|
self:HandleEvent( EVENTS.HumanAircraftRepairFinish )
|
||||||
|
self:HandleEvent( EVENTS.HumanAircraftRepairStart )
|
||||||
|
self:HandleEvent( EVENTS.EngineShutdown )
|
||||||
|
self:HandleEvent( EVENTS.EngineStartup )
|
||||||
|
self:HandleEvent( EVENTS.WeaponAdd )
|
||||||
|
self:HandleEvent( EVENTS.WeaponDrop )
|
||||||
|
self:HandleEvent( EVENTS.WeaponRearm )
|
||||||
|
|
||||||
|
function self:OnEventHit(EventData)
|
||||||
|
if EventData.TgtUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered hit event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Hit(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventKill(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered kill event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Kill(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventScore(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered score event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Score(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventShot(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered shot event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Shot(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventShootingStart(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered shooting start event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:ShootingStart(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventShootingEnd(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered shooting end event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:ShootingEnd(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventLand(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered land event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Land(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventTakeoff(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered takeoff event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Takeoff(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventRunwayTakeoff(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered runway takeoff event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:RunwayTakeoff(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventRunwayTouch(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered runway touch event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:RunwayTouch(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventRefueling(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered refueling event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Refueling(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventRefuelingStop(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered refueling event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:RefuelingStop(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventPlayerLeaveUnit(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered leave unit event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:PlayerLeaveUnit(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventCrash(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered crash event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Crash(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventDead(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered dead event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Dead(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventPilotDead(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered pilot dead event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:PilotDead(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventUnitLost(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered unit lost event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:UnitLost(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventEjection(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered ejection event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:Ejection(EventData)
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventHumanFailure(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered human failure event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:HumanFailure(EventData)
|
||||||
|
if not self.Unit:IsAlive() then
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventHumanAircraftRepairFinish(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered repair finished event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:HumanAircraftRepairFinish(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventHumanAircraftRepairStart(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered repair start event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:HumanAircraftRepairStart(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventEngineShutdown(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered engine shutdown event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:EngineShutdown(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventEngineStartup(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered engine startup event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:EngineStartup(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventWeaponAdd(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered weapon add event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:WeaponAdd(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventWeaponDrop(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered weapon drop event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:WeaponDrop(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function self:OnEventWeaponRearm(EventData)
|
||||||
|
if EventData.IniUnitName == self.UnitName then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client triggered weapon rearm event.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
|
||||||
|
end
|
||||||
|
self:WeaponRearm(EventData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--Fallback timer
|
||||||
|
self.FallbackTimer = TIMER:New(function()
|
||||||
|
if not self.Unit:IsAlive() then
|
||||||
|
if clientWatchDebug then
|
||||||
|
self:I({"Client is registered as dead without an event trigger. Running fallback dead routine.",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName})
|
||||||
|
end
|
||||||
|
self._deadRoutine()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
self.FallbackTimer:Start(5,5)
|
||||||
|
|
||||||
|
--Stop event handlers and trigger Despawn
|
||||||
|
function self._deadRoutine()
|
||||||
|
if clientWatchDebug then self:I({"Client dead routine triggered. Shutting down tracking...",Player = self.PlayerName,Group = self.GroupName,Unit = self.UnitName}) end
|
||||||
|
self:UnHandleEvent( EVENTS.Hit )
|
||||||
|
self:UnHandleEvent( EVENTS.Kill )
|
||||||
|
self:UnHandleEvent( EVENTS.Score )
|
||||||
|
self:UnHandleEvent( EVENTS.Shot )
|
||||||
|
self:UnHandleEvent( EVENTS.ShootingStart )
|
||||||
|
self:UnHandleEvent( EVENTS.ShootingEnd )
|
||||||
|
self:UnHandleEvent( EVENTS.Land )
|
||||||
|
self:UnHandleEvent( EVENTS.Takeoff )
|
||||||
|
self:UnHandleEvent( EVENTS.RunwayTakeoff )
|
||||||
|
self:UnHandleEvent( EVENTS.RunwayTouch )
|
||||||
|
self:UnHandleEvent( EVENTS.Refueling )
|
||||||
|
self:UnHandleEvent( EVENTS.RefuelingStop )
|
||||||
|
self:UnHandleEvent( EVENTS.PlayerLeaveUnit )
|
||||||
|
self:UnHandleEvent( EVENTS.Crash )
|
||||||
|
self:UnHandleEvent( EVENTS.Dead )
|
||||||
|
self:UnHandleEvent( EVENTS.PilotDead )
|
||||||
|
self:UnHandleEvent( EVENTS.UnitLost )
|
||||||
|
self:UnHandleEvent( EVENTS.Ejection )
|
||||||
|
self:UnHandleEvent( EVENTS.HumanFailure )
|
||||||
|
self:UnHandleEvent( EVENTS.HumanAircraftRepairFinish )
|
||||||
|
self:UnHandleEvent( EVENTS.HumanAircraftRepairStart )
|
||||||
|
self:UnHandleEvent( EVENTS.EngineShutdown )
|
||||||
|
self:UnHandleEvent( EVENTS.EngineStartup )
|
||||||
|
self:UnHandleEvent( EVENTS.WeaponAdd )
|
||||||
|
self:UnHandleEvent( EVENTS.WeaponDrop )
|
||||||
|
self:UnHandleEvent( EVENTS.WeaponRearm )
|
||||||
|
self.FallbackTimer:Stop()
|
||||||
|
self:Despawn()
|
||||||
|
end
|
||||||
|
|
||||||
|
self:I({"Detected client spawn and applied internal functions and events.", PlayerName = self.PlayerName, UnitName = self.UnitName, GroupName = self.GroupName})
|
||||||
|
return self
|
||||||
|
end
|
||||||
@@ -595,7 +595,8 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
@@ -604,7 +605,7 @@ do -- DETECTION_BASE
|
|||||||
-- @param #number DetectionTimeStamp Time stamp of detection event.
|
-- @param #number DetectionTimeStamp Time stamp of detection event.
|
||||||
function DETECTION_BASE:onafterDetection( From, Event, To, Detection, DetectionTimeStamp )
|
function DETECTION_BASE:onafterDetection( From, Event, To, Detection, DetectionTimeStamp )
|
||||||
|
|
||||||
self:I( { DetectedObjects = self.DetectedObjects } )
|
self:T( { DetectedObjects = self.DetectedObjects } )
|
||||||
|
|
||||||
self.DetectionRun = self.DetectionRun + 1
|
self.DetectionRun = self.DetectionRun + 1
|
||||||
|
|
||||||
@@ -612,10 +613,10 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
if Detection and Detection:IsAlive() then
|
if Detection and Detection:IsAlive() then
|
||||||
|
|
||||||
self:I( { "DetectionGroup is Alive", Detection:GetName() } )
|
self:T( { "DetectionGroup is Alive", Detection:GetName() } )
|
||||||
|
|
||||||
local DetectionGroupName = Detection:GetName()
|
local DetectionGroupName = Detection:GetName()
|
||||||
local DetectionUnit = Detection:GetUnit( 1 )
|
local DetectionUnit = Detection:GetFirstUnitAlive()
|
||||||
|
|
||||||
local DetectedUnits = {}
|
local DetectedUnits = {}
|
||||||
|
|
||||||
@@ -628,24 +629,24 @@ do -- DETECTION_BASE
|
|||||||
self.DetectDLINK
|
self.DetectDLINK
|
||||||
)
|
)
|
||||||
|
|
||||||
--self:I( { DetectedTargets = DetectedTargets } )
|
--self:T( { DetectedTargets = DetectedTargets } )
|
||||||
--self:I(UTILS.PrintTableToLog(DetectedTargets))
|
--self:T(UTILS.PrintTableToLog(DetectedTargets))
|
||||||
|
|
||||||
|
|
||||||
for DetectionObjectID, Detection in pairs( DetectedTargets ) do
|
for DetectionObjectID, Detection in pairs( DetectedTargets or {}) do
|
||||||
local DetectedObject = Detection.object -- DCS#Object
|
local DetectedObject = Detection.object -- DCS#Object
|
||||||
|
|
||||||
if DetectedObject and DetectedObject:isExist() and DetectedObject.id_ < 50000000 then -- and ( DetectedObject:getCategory() == Object.Category.UNIT or DetectedObject:getCategory() == Object.Category.STATIC ) then
|
if DetectedObject and DetectedObject:isExist() and DetectedObject.id_ < 50000000 then -- and ( DetectedObject:getCategory() == Object.Category.UNIT or DetectedObject:getCategory() == Object.Category.STATIC ) then
|
||||||
local DetectedObjectName = DetectedObject:getName()
|
local DetectedObjectName = DetectedObject:getName()
|
||||||
if not self.DetectedObjects[DetectedObjectName] then
|
if not self.DetectedObjects[DetectedObjectName] then
|
||||||
self.DetectedObjects[DetectedObjectName] = self.DetectedObjects[DetectedObjectName] or {}
|
self.DetectedObjects[DetectedObjectName] = self.DetectedObjects[DetectedObjectName] or {}
|
||||||
self.DetectedObjects[DetectedObjectName].Name = DetectedObjectName
|
self.DetectedObjects[DetectedObjectName].Name = DetectedObjectName
|
||||||
self.DetectedObjects[DetectedObjectName].Object = DetectedObject
|
self.DetectedObjects[DetectedObjectName].Object = DetectedObject
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for DetectionObjectName, DetectedObjectData in pairs( self.DetectedObjects ) do
|
for DetectionObjectName, DetectedObjectData in pairs( self.DetectedObjects or {}) do
|
||||||
|
|
||||||
local DetectedObject = DetectedObjectData.Object
|
local DetectedObject = DetectedObjectData.Object
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
do -- DETECTION_ZONES
|
do -- DETECTION_ZONES
|
||||||
|
|
||||||
--- @type DETECTION_ZONES
|
-- @type DETECTION_ZONES
|
||||||
-- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
-- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||||
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Core.Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Core.Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
||||||
-- @extends Functional.Detection#DETECTION_BASE
|
-- @extends Functional.Detection#DETECTION_BASE
|
||||||
@@ -68,7 +68,7 @@ do -- DETECTION_ZONES
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #DETECTION_ZONES self
|
-- @param #DETECTION_ZONES self
|
||||||
-- @param #number The amount of alive recce.
|
-- @param #number The amount of alive recce.
|
||||||
function DETECTION_ZONES:CountAliveRecce()
|
function DETECTION_ZONES:CountAliveRecce()
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ do -- DETECTION_ZONES
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #DETECTION_ZONES self
|
-- @param #DETECTION_ZONES self
|
||||||
function DETECTION_ZONES:ForEachAliveRecce( IteratorFunction, ... )
|
function DETECTION_ZONES:ForEachAliveRecce( IteratorFunction, ... )
|
||||||
self:F2( arg )
|
self:F2( arg )
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ do -- DETECTION_ZONES
|
|||||||
--DetectedSet:Flush( self )
|
--DetectedSet:Flush( self )
|
||||||
|
|
||||||
DetectedSet:ForEachUnit(
|
DetectedSet:ForEachUnit(
|
||||||
--- @param Wrapper.Unit#UNIT DetectedUnit
|
-- @param Wrapper.Unit#UNIT DetectedUnit
|
||||||
function( DetectedUnit )
|
function( DetectedUnit )
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
--self:T( "Detected Set #" .. DetectedItem.ID .. ":" .. DetectedUnit:GetName() )
|
--self:T( "Detected Set #" .. DetectedItem.ID .. ":" .. DetectedUnit:GetName() )
|
||||||
@@ -380,7 +380,7 @@ do -- DETECTION_ZONES
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #DETECTION_ZONES self
|
-- @param #DETECTION_ZONES self
|
||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ FOX = {
|
|||||||
explosiondist = 200,
|
explosiondist = 200,
|
||||||
explosiondist2 = 500,
|
explosiondist2 = 500,
|
||||||
bigmissilemass = 50,
|
bigmissilemass = 50,
|
||||||
destroy = nil,
|
--destroy = nil,
|
||||||
dt50 = 5,
|
dt50 = 5,
|
||||||
dt10 = 1,
|
dt10 = 1,
|
||||||
dt05 = 0.5,
|
dt05 = 0.5,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
-- @module Functional.Mantis
|
-- @module Functional.Mantis
|
||||||
-- @image Functional.Mantis.jpg
|
-- @image Functional.Mantis.jpg
|
||||||
--
|
--
|
||||||
-- Last Update: May 2024
|
-- Last Update: July 2024
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **MANTIS** class, extends Core.Base#BASE
|
--- **MANTIS** class, extends Core.Base#BASE
|
||||||
@@ -59,6 +59,7 @@
|
|||||||
-- @field #number ShoradTime Timer in seconds, how long #SHORAD will be active after a detection inside of the defense range
|
-- @field #number ShoradTime Timer in seconds, how long #SHORAD will be active after a detection inside of the defense range
|
||||||
-- @field #number ShoradActDistance Distance of an attacker in meters from a Mantis SAM site, on which Shorad will be switched on. Useful to not give away Shorad sites too early. Default 15km. Should be smaller than checkradius.
|
-- @field #number ShoradActDistance Distance of an attacker in meters from a Mantis SAM site, on which Shorad will be switched on. Useful to not give away Shorad sites too early. Default 15km. Should be smaller than checkradius.
|
||||||
-- @field #boolean checkforfriendlies If true, do not activate a SAM installation if a friendly aircraft is in firing range.
|
-- @field #boolean checkforfriendlies If true, do not activate a SAM installation if a friendly aircraft is in firing range.
|
||||||
|
-- @field #table FilterZones Table of Core.Zone#ZONE Zones Consider SAM groups in this zone(s) only for this MANTIS instance, must be handed as #table of Zone objects.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@
|
|||||||
--
|
--
|
||||||
-- Use this option if you want to make use of or allow advanced SEAD tactics.
|
-- Use this option if you want to make use of or allow advanced SEAD tactics.
|
||||||
--
|
--
|
||||||
-- # 5. Integrate SHORAD [classic mode]
|
-- # 5. Integrate SHORAD [classic mode, not necessary in automode]
|
||||||
--
|
--
|
||||||
-- You can also choose to integrate Mantis with @{Functional.Shorad#SHORAD} for protection against HARMs and AGMs. When SHORAD detects a missile fired at one of MANTIS' SAM sites, it will activate SHORAD systems in
|
-- You can also choose to integrate Mantis with @{Functional.Shorad#SHORAD} for protection against HARMs and AGMs. When SHORAD detects a missile fired at one of MANTIS' SAM sites, it will activate SHORAD systems in
|
||||||
-- the given defense checkradius around that SAM site. Create a SHORAD object first, then integrate with MANTIS like so:
|
-- the given defense checkradius around that SAM site. Create a SHORAD object first, then integrate with MANTIS like so:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--- **Functional** - Create random airtraffic in your missions.
|
--- **Functional** - Create random air traffic in your missions.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@@ -179,8 +179,8 @@
|
|||||||
-- * Climb rate is set to a moderate value of ~1500 ft/min.
|
-- * Climb rate is set to a moderate value of ~1500 ft/min.
|
||||||
-- * The standard descent rate follows the 3:1 rule, i.e. 1000 ft decent per 3 miles of travel. Hence, angle of descent is ~3.6 degrees.
|
-- * The standard descent rate follows the 3:1 rule, i.e. 1000 ft decent per 3 miles of travel. Hence, angle of descent is ~3.6 degrees.
|
||||||
-- * A holding point is randomly selected at a distance between 5 and 10 km away from destination airport.
|
-- * A holding point is randomly selected at a distance between 5 and 10 km away from destination airport.
|
||||||
-- * The altitude of theholding point is ~1200 m AGL. Holding patterns might or might not happen with variable duration.
|
-- * The altitude of the holding point is ~1200 m AGL. Holding patterns might or might not happen with variable duration.
|
||||||
-- * If an aircraft is spawned in air, the procedure omitts taxi and take-off and starts with the climb/cruising part.
|
-- * If an aircraft is spawned in air, the procedure omits taxi and take-off and starts with the climb/cruising part.
|
||||||
-- * All values are randomized for each spawned aircraft.
|
-- * All values are randomized for each spawned aircraft.
|
||||||
--
|
--
|
||||||
-- ## Mission Editor Setup
|
-- ## Mission Editor Setup
|
||||||
@@ -196,13 +196,13 @@
|
|||||||
-- Voilà, your already done!
|
-- Voilà, your already done!
|
||||||
--
|
--
|
||||||
-- Optionally, you can set a specific livery for the aircraft or give it some weapons.
|
-- Optionally, you can set a specific livery for the aircraft or give it some weapons.
|
||||||
-- However, the aircraft will by default not engage any enemies. Think of them as beeing on a peaceful or ferry mission.
|
-- However, the aircraft will by default not engage any enemies. Think of them as being on a peaceful or ferry mission.
|
||||||
--
|
--
|
||||||
-- ## Basic Lua Script
|
-- ## Basic Lua Script
|
||||||
--
|
--
|
||||||
-- 
|
-- 
|
||||||
--
|
--
|
||||||
-- The basic Lua script for one template group consits of two simple lines as shown in the picture above.
|
-- The basic Lua script for one template group consists of two simple lines as shown in the picture above.
|
||||||
--
|
--
|
||||||
-- * **Line 2** creates a new RAT object "yak". The only required parameter for the constructor @{#RAT.New}() is the name of the group as defined in the mission editor. In this example it is "RAT_YAK".
|
-- * **Line 2** creates a new RAT object "yak". The only required parameter for the constructor @{#RAT.New}() is the name of the group as defined in the mission editor. In this example it is "RAT_YAK".
|
||||||
-- * **Line 5** trigger the command to spawn the aircraft. The (optional) parameter for the @{#RAT.Spawn}() function is the number of aircraft to be spawned of this object.
|
-- * **Line 5** trigger the command to spawn the aircraft. The (optional) parameter for the @{#RAT.Spawn}() function is the number of aircraft to be spawned of this object.
|
||||||
@@ -216,9 +216,9 @@
|
|||||||
-- ## Parking Problems
|
-- ## Parking Problems
|
||||||
--
|
--
|
||||||
-- One big issue in DCS is that not all aircraft can be spawned on every airport or airbase. In particular, bigger aircraft might not have a valid parking spot at smaller airports and
|
-- One big issue in DCS is that not all aircraft can be spawned on every airport or airbase. In particular, bigger aircraft might not have a valid parking spot at smaller airports and
|
||||||
-- airstripes. This can lead to multiple problems in DCS.
|
-- airstrips. This can lead to multiple problems in DCS.
|
||||||
--
|
--
|
||||||
-- * Landing: When an aircraft tries to land at an airport where it does not have a valid parking spot, it is immidiately despawned the moment its wheels touch the runway, i.e.
|
-- * Landing: When an aircraft tries to land at an airport where it does not have a valid parking spot, it is immediately despawned the moment its wheels touch the runway, i.e.
|
||||||
-- when a landing event is triggered. This leads to the loss of the RAT aircraft. On possible way to circumvent the this problem is to let another RAT aircraft spawn at landing
|
-- when a landing event is triggered. This leads to the loss of the RAT aircraft. On possible way to circumvent the this problem is to let another RAT aircraft spawn at landing
|
||||||
-- and not when it shuts down its engines. See the @{#RAT.RespawnAfterLanding}() function.
|
-- and not when it shuts down its engines. See the @{#RAT.RespawnAfterLanding}() function.
|
||||||
-- * Spawning: When a big aircraft is dynamically spawned on a small airbase a few things can go wrong. For example, it could be spawned at a parking spot with a shelter.
|
-- * Spawning: When a big aircraft is dynamically spawned on a small airbase a few things can go wrong. For example, it could be spawned at a parking spot with a shelter.
|
||||||
@@ -246,9 +246,9 @@
|
|||||||
-- c17:Spawn(5)
|
-- c17:Spawn(5)
|
||||||
--
|
--
|
||||||
-- This would randomly spawn five C-17s but only on airports which have big open air parking spots. Note that also only destination airports are allowed
|
-- This would randomly spawn five C-17s but only on airports which have big open air parking spots. Note that also only destination airports are allowed
|
||||||
-- which do have this type of parking spot. This should ensure that the aircraft is able to land at the destination without beeing despawned immidiately.
|
-- which do have this type of parking spot. This should ensure that the aircraft is able to land at the destination without being despawned immediately.
|
||||||
--
|
--
|
||||||
-- Also, the aircraft are spawned only on the requested parking spot types and not on any other type. If no parking spot of this type is availabe at the
|
-- Also, the aircraft are spawned only on the requested parking spot types and not on any other type. If no parking spot of this type is available at the
|
||||||
-- moment of spawning, the group is automatically spawned in air above the selected airport.
|
-- moment of spawning, the group is automatically spawned in air above the selected airport.
|
||||||
--
|
--
|
||||||
-- ## Examples
|
-- ## Examples
|
||||||
@@ -274,7 +274,7 @@
|
|||||||
--
|
--
|
||||||
-- It is also possible to make aircraft "commute" between two airports, i.e. flying from airport A to B and then back from B to A, etc.
|
-- It is also possible to make aircraft "commute" between two airports, i.e. flying from airport A to B and then back from B to A, etc.
|
||||||
-- This can be done by the @{#RAT.Commute}() function. Note that if no departure or destination airports are specified, the first departure and destination are chosen randomly.
|
-- This can be done by the @{#RAT.Commute}() function. Note that if no departure or destination airports are specified, the first departure and destination are chosen randomly.
|
||||||
-- Then the aircraft will fly back and forth between those two airports indefinetly.
|
-- Then the aircraft will fly back and forth between those two airports indefinitely.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- ### Spawn in Air
|
-- ### Spawn in Air
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
-- * @{#RAT.SetTakeoff}("cold"), which means that all aircraft are spawned with their engines off,
|
-- * @{#RAT.SetTakeoff}("cold"), which means that all aircraft are spawned with their engines off,
|
||||||
-- * @{#RAT.SetTakeoff}("hot"), which means that all aircraft are spawned with their engines on,
|
-- * @{#RAT.SetTakeoff}("hot"), which means that all aircraft are spawned with their engines on,
|
||||||
-- * @{#RAT.SetTakeoff}("runway"), which means that all aircraft are spawned already at the runway ready to takeoff.
|
-- * @{#RAT.SetTakeoff}("runway"), which means that all aircraft are spawned already at the runway ready to takeoff.
|
||||||
-- Note that in this case the default spawn intervall is set to 180 seconds in order to avoid aircraft jamms on the runway. Generally, this takeoff at runways should be used with care and problems are to be expected.
|
-- Note that in this case the default spawn intervall is set to 180 seconds in order to avoid aircraft jams on the runway. Generally, this takeoff at runways should be used with care and problems are to be expected.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- The options @{#RAT.SetMinDistance}() and @{#RAT.SetMaxDistance}() can be used to restrict the range from departure to destination. For example
|
-- The options @{#RAT.SetMinDistance}() and @{#RAT.SetMaxDistance}() can be used to restrict the range from departure to destination. For example
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
--
|
--
|
||||||
-- * @{#RAT.SetFLcruise}(300) will cause most planes fly around FL300.
|
-- * @{#RAT.SetFLcruise}(300) will cause most planes fly around FL300.
|
||||||
-- * @{#RAT.SetFLmin}(100) restricts the cruising alt such that no plane will fly below FL100. Note that this automatically changes the minimum distance from departure to destination.
|
-- * @{#RAT.SetFLmin}(100) restricts the cruising alt such that no plane will fly below FL100. Note that this automatically changes the minimum distance from departure to destination.
|
||||||
-- That means that only destinations are possible for which the aircraft has had enought time to reach that flight level and descent again.
|
-- That means that only destinations are possible for which the aircraft has had enough time to reach that flight level and descent again.
|
||||||
-- * @{#RAT.SetFLmax}(200) will restrict the cruise alt to maximum FL200, i.e. no aircraft will travel above this height.
|
-- * @{#RAT.SetFLmax}(200) will restrict the cruise alt to maximum FL200, i.e. no aircraft will travel above this height.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
@@ -762,10 +762,10 @@ function RAT:Spawn(naircraft)
|
|||||||
-- Set the coalition table based on choice of self.coalition and self.friendly.
|
-- Set the coalition table based on choice of self.coalition and self.friendly.
|
||||||
self:_SetCoalitionTable()
|
self:_SetCoalitionTable()
|
||||||
|
|
||||||
-- Get all airports of this map beloning to friendly coalition(s).
|
-- Get all airports of this map belonging to friendly coalition(s).
|
||||||
self:_GetAirportsOfCoalition()
|
self:_GetAirportsOfCoalition()
|
||||||
|
|
||||||
-- Set submenuname if it has not been set by user.
|
-- Set sub-menu name if it has not been set by user.
|
||||||
if not self.SubMenuName then
|
if not self.SubMenuName then
|
||||||
self.SubMenuName=self.alias
|
self.SubMenuName=self.alias
|
||||||
end
|
end
|
||||||
@@ -1302,9 +1302,9 @@ end
|
|||||||
|
|
||||||
--- Set name of destination airports or zones for the AI aircraft.
|
--- Set name of destination airports or zones for the AI aircraft.
|
||||||
-- @param #RAT self
|
-- @param #RAT self
|
||||||
-- @param #string destinationnames Name of the destination airport or table of destination airports.
|
-- @param #string destinationnames Name of the destination airport or #table of destination airports.
|
||||||
-- @return #RAT RAT self object.
|
-- @return #RAT RAT self object.
|
||||||
-- @usage RAT:SetDestination("Krymsk") makes all aircraft of this RAT oject fly to Krymsk airport.
|
-- @usage RAT:SetDestination("Krymsk") makes all aircraft of this RAT object fly to Krymsk airport.
|
||||||
function RAT:SetDestination(destinationnames)
|
function RAT:SetDestination(destinationnames)
|
||||||
self:F2(destinationnames)
|
self:F2(destinationnames)
|
||||||
|
|
||||||
@@ -1564,7 +1564,7 @@ function RAT:NoRespawn()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Number of tries to respawn an aircraft in case it has accitentally been spawned on runway.
|
--- Number of tries to respawn an aircraft in case it has accidentally been spawned on runway.
|
||||||
-- @param #RAT self
|
-- @param #RAT self
|
||||||
-- @param #number n Number of retries. Default is 3.
|
-- @param #number n Number of retries. Default is 3.
|
||||||
-- @return #RAT RAT self object.
|
-- @return #RAT RAT self object.
|
||||||
@@ -1621,7 +1621,7 @@ function RAT:RespawnInAirNotAllowed()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Check if aircraft have accidentally been spawned on the runway. If so they will be removed immediatly.
|
--- Check if aircraft have accidentally been spawned on the runway. If so they will be removed immediately.
|
||||||
-- @param #RAT self
|
-- @param #RAT self
|
||||||
-- @param #boolean switch If true, check is performed. If false, this check is omitted.
|
-- @param #boolean switch If true, check is performed. If false, this check is omitted.
|
||||||
-- @param #number radius Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m.
|
-- @param #number radius Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m.
|
||||||
@@ -2135,7 +2135,12 @@ function RAT:_InitAircraft(DCSgroup)
|
|||||||
self.aircraft.length=16
|
self.aircraft.length=16
|
||||||
self.aircraft.height=5
|
self.aircraft.height=5
|
||||||
self.aircraft.width=9
|
self.aircraft.width=9
|
||||||
|
elseif DCStype == "Saab340" then -- <- These lines added
|
||||||
|
self.aircraft.length=19.73 -- <- These lines added
|
||||||
|
self.aircraft.height=6.97 -- <- These lines added
|
||||||
|
self.aircraft.width=21.44 -- <- These lines added
|
||||||
end
|
end
|
||||||
|
|
||||||
self.aircraft.box=math.max(self.aircraft.length,self.aircraft.width)
|
self.aircraft.box=math.max(self.aircraft.length,self.aircraft.width)
|
||||||
|
|
||||||
-- info message
|
-- info message
|
||||||
|
|||||||
@@ -106,6 +106,7 @@
|
|||||||
-- @field Sound.SRS#MSRS instructmsrs SRS wrapper for range instructor.
|
-- @field Sound.SRS#MSRS instructmsrs SRS wrapper for range instructor.
|
||||||
-- @field Sound.SRS#MSRSQUEUE instructsrsQ SRS queue for range instructor.
|
-- @field Sound.SRS#MSRSQUEUE instructsrsQ SRS queue for range instructor.
|
||||||
-- @field #number Coalition Coalition side for the menu, if any.
|
-- @field #number Coalition Coalition side for the menu, if any.
|
||||||
|
-- @field Core.Menu#MENU_MISSION menuF10root Specific user defined root F10 menu.
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *Don't only practice your art, but force your way into its secrets; art deserves that, for it and knowledge can raise man to the Divine.* - Ludwig van Beethoven
|
--- *Don't only practice your art, but force your way into its secrets; art deserves that, for it and knowledge can raise man to the Divine.* - Ludwig van Beethoven
|
||||||
@@ -593,13 +594,14 @@ RANGE.MenuF10Root = nil
|
|||||||
|
|
||||||
--- Range script version.
|
--- Range script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RANGE.version = "2.7.3"
|
RANGE.version = "2.8.0"
|
||||||
|
|
||||||
-- TODO list:
|
-- TODO list:
|
||||||
-- TODO: Verbosity level for messages.
|
-- TODO: Verbosity level for messages.
|
||||||
-- TODO: Add option for default settings such as smoke off.
|
-- TODO: Add option for default settings such as smoke off.
|
||||||
-- TODO: Add custom weapons, which can be specified by the user.
|
-- TODO: Add custom weapons, which can be specified by the user.
|
||||||
-- TODO: Check if units are still alive.
|
-- TODO: Check if units are still alive.
|
||||||
|
-- TODO: Option for custom sound files.
|
||||||
-- DONE: Scenery as targets.
|
-- DONE: Scenery as targets.
|
||||||
-- DONE: Add statics for strafe pits.
|
-- DONE: Add statics for strafe pits.
|
||||||
-- DONE: Add missiles.
|
-- DONE: Add missiles.
|
||||||
@@ -858,16 +860,16 @@ function RANGE:onafterStart()
|
|||||||
self.rangecontrol.schedonce = true
|
self.rangecontrol.schedonce = true
|
||||||
|
|
||||||
-- Init numbers.
|
-- Init numbers.
|
||||||
self.rangecontrol:SetDigit( 0, RANGE.Sound.RC0.filename, RANGE.Sound.RC0.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 0, self.Sound.RC0.filename, self.Sound.RC0.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 1, RANGE.Sound.RC1.filename, RANGE.Sound.RC1.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 1, self.Sound.RC1.filename, self.Sound.RC1.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 2, RANGE.Sound.RC2.filename, RANGE.Sound.RC2.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 2, self.Sound.RC2.filename, self.Sound.RC2.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 3, RANGE.Sound.RC3.filename, RANGE.Sound.RC3.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 3, self.Sound.RC3.filename, self.Sound.RC3.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 4, RANGE.Sound.RC4.filename, RANGE.Sound.RC4.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 4, self.Sound.RC4.filename, self.Sound.RC4.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 5, RANGE.Sound.RC5.filename, RANGE.Sound.RC5.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 5, self.Sound.RC5.filename, self.Sound.RC5.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 6, RANGE.Sound.RC6.filename, RANGE.Sound.RC6.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 6, self.Sound.RC6.filename, self.Sound.RC6.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 7, RANGE.Sound.RC7.filename, RANGE.Sound.RC7.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 7, self.Sound.RC7.filename, self.Sound.RC7.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 8, RANGE.Sound.RC8.filename, RANGE.Sound.RC8.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 8, self.Sound.RC8.filename, self.Sound.RC8.duration, self.soundpath )
|
||||||
self.rangecontrol:SetDigit( 9, RANGE.Sound.RC9.filename, RANGE.Sound.RC9.duration, self.soundpath )
|
self.rangecontrol:SetDigit( 9, self.Sound.RC9.filename, self.Sound.RC9.duration, self.soundpath )
|
||||||
|
|
||||||
-- Set location where the messages are transmitted from.
|
-- Set location where the messages are transmitted from.
|
||||||
self.rangecontrol:SetSenderCoordinate( self.location )
|
self.rangecontrol:SetSenderCoordinate( self.location )
|
||||||
@@ -884,16 +886,16 @@ function RANGE:onafterStart()
|
|||||||
self.instructor.schedonce = true
|
self.instructor.schedonce = true
|
||||||
|
|
||||||
-- Init numbers.
|
-- Init numbers.
|
||||||
self.instructor:SetDigit( 0, RANGE.Sound.IR0.filename, RANGE.Sound.IR0.duration, self.soundpath )
|
self.instructor:SetDigit( 0, self.Sound.IR0.filename, self.Sound.IR0.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 1, RANGE.Sound.IR1.filename, RANGE.Sound.IR1.duration, self.soundpath )
|
self.instructor:SetDigit( 1, self.Sound.IR1.filename, self.Sound.IR1.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 2, RANGE.Sound.IR2.filename, RANGE.Sound.IR2.duration, self.soundpath )
|
self.instructor:SetDigit( 2, self.Sound.IR2.filename, self.Sound.IR2.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 3, RANGE.Sound.IR3.filename, RANGE.Sound.IR3.duration, self.soundpath )
|
self.instructor:SetDigit( 3, self.Sound.IR3.filename, self.Sound.IR3.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 4, RANGE.Sound.IR4.filename, RANGE.Sound.IR4.duration, self.soundpath )
|
self.instructor:SetDigit( 4, self.Sound.IR4.filename, self.Sound.IR4.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 5, RANGE.Sound.IR5.filename, RANGE.Sound.IR5.duration, self.soundpath )
|
self.instructor:SetDigit( 5, self.Sound.IR5.filename, self.Sound.IR5.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 6, RANGE.Sound.IR6.filename, RANGE.Sound.IR6.duration, self.soundpath )
|
self.instructor:SetDigit( 6, self.Sound.IR6.filename, self.Sound.IR6.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 7, RANGE.Sound.IR7.filename, RANGE.Sound.IR7.duration, self.soundpath )
|
self.instructor:SetDigit( 7, self.Sound.IR7.filename, self.Sound.IR7.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 8, RANGE.Sound.IR8.filename, RANGE.Sound.IR8.duration, self.soundpath )
|
self.instructor:SetDigit( 8, self.Sound.IR8.filename, self.Sound.IR8.duration, self.soundpath )
|
||||||
self.instructor:SetDigit( 9, RANGE.Sound.IR9.filename, RANGE.Sound.IR9.duration, self.soundpath )
|
self.instructor:SetDigit( 9, self.Sound.IR9.filename, self.Sound.IR9.duration, self.soundpath )
|
||||||
|
|
||||||
-- Set location where the messages are transmitted from.
|
-- Set location where the messages are transmitted from.
|
||||||
self.instructor:SetSenderCoordinate( self.location )
|
self.instructor:SetSenderCoordinate( self.location )
|
||||||
@@ -920,13 +922,23 @@ function RANGE:onafterStart()
|
|||||||
self.rangezone:SmokeZone( SMOKECOLOR.White )
|
self.rangezone:SmokeZone( SMOKECOLOR.White )
|
||||||
end
|
end
|
||||||
|
|
||||||
self:__Status( -60 )
|
self:__Status( -10 )
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- User Functions
|
-- User Functions
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--- Set the root F10 menu under which the range F10 menu is created.
|
||||||
|
-- @param #RANGE self
|
||||||
|
-- @param Core.Menu#MENU_MISSION menu The root F10 menu.
|
||||||
|
-- @return #RANGE self
|
||||||
|
function RANGE:SetMenuRoot(menu)
|
||||||
|
self.menuF10root=menu
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Set maximal strafing altitude. Player entering a strafe pit above that altitude are not registered for a valid pass.
|
--- Set maximal strafing altitude. Player entering a strafe pit above that altitude are not registered for a valid pass.
|
||||||
-- @param #RANGE self
|
-- @param #RANGE self
|
||||||
-- @param #number maxalt Maximum altitude in meters AGL. Default is 914 m = 3000 ft.
|
-- @param #number maxalt Maximum altitude in meters AGL. Default is 914 m = 3000 ft.
|
||||||
@@ -1066,6 +1078,9 @@ end
|
|||||||
-- @param Core.Zone#ZONE zone MOOSE zone defining the range perimeters.
|
-- @param Core.Zone#ZONE zone MOOSE zone defining the range perimeters.
|
||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
function RANGE:SetRangeZone( zone )
|
function RANGE:SetRangeZone( zone )
|
||||||
|
if zone and type(zone)=="string" then
|
||||||
|
zone=ZONE:FindByName(zone)
|
||||||
|
end
|
||||||
self.rangezone = zone
|
self.rangezone = zone
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -1224,10 +1239,12 @@ function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume,
|
|||||||
self.instructmsrs:SetLabel("RANGEI")
|
self.instructmsrs:SetLabel("RANGEI")
|
||||||
self.instructmsrs:SetVolume(Volume or 1.0)
|
self.instructmsrs:SetVolume(Volume or 1.0)
|
||||||
self.instructsrsQ = MSRSQUEUE:New("INSTRUCT")
|
self.instructsrsQ = MSRSQUEUE:New("INSTRUCT")
|
||||||
|
|
||||||
if PathToGoogleKey then
|
if PathToGoogleKey then
|
||||||
self.controlmsrs:SetGoogle(PathToGoogleKey)
|
self.controlmsrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||||
self.instructmsrs:SetGoogle(PathToGoogleKey)
|
self.controlmsrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
|
self.instructmsrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||||
|
self.instructmsrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -1323,10 +1340,57 @@ end
|
|||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
function RANGE:SetSoundfilesPath( path )
|
function RANGE:SetSoundfilesPath( path )
|
||||||
self.soundpath = tostring( path or "Range Soundfiles/" )
|
self.soundpath = tostring( path or "Range Soundfiles/" )
|
||||||
self:I( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) )
|
self:T2( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set the path to the csv file that contains information about the used sound files.
|
||||||
|
-- The parameter file has to be located on your local disk (**not** inside the miz file).
|
||||||
|
-- @param #RANGE self
|
||||||
|
-- @param #string csvfile Full path to the csv file on your local disk.
|
||||||
|
-- @return #RANGE self
|
||||||
|
function RANGE:SetSoundfilesInfo( csvfile )
|
||||||
|
|
||||||
|
--- Local function to return the ATIS.Soundfile for a given file name
|
||||||
|
local function getSound(filename)
|
||||||
|
for key,_soundfile in pairs(self.Sound) do
|
||||||
|
local soundfile=_soundfile --#RANGE.Soundfile
|
||||||
|
if filename==soundfile.filename then
|
||||||
|
return soundfile
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Read csv file
|
||||||
|
local data=UTILS.ReadCSV(csvfile)
|
||||||
|
|
||||||
|
if data then
|
||||||
|
|
||||||
|
for i,sound in pairs(data) do
|
||||||
|
|
||||||
|
-- Get the ATIS.Soundfile
|
||||||
|
local soundfile=getSound(sound.filename..".ogg") --#RANGE.Soundfile
|
||||||
|
|
||||||
|
if soundfile then
|
||||||
|
|
||||||
|
-- Set duration
|
||||||
|
soundfile.duration=tonumber(sound.duration)
|
||||||
|
|
||||||
|
else
|
||||||
|
self:E(string.format("ERROR: Could not get info for sound file %s", sound.filename))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:E(string.format("ERROR: Could not read sound csv file!"))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Add new strafe pit. For a strafe pit, hits from guns are counted. One pit can consist of several units.
|
--- Add new strafe pit. For a strafe pit, hits from guns are counted. One pit can consist of several units.
|
||||||
-- A strafe run approach is only valid if the player enters via a zone in front of the pit, which is defined by boxlength, boxwidth, and heading.
|
-- A strafe run approach is only valid if the player enters via a zone in front of the pit, which is defined by boxlength, boxwidth, and heading.
|
||||||
-- Furthermore, the player must not be too high and fly in the direction of the pit to make a valid target apporoach.
|
-- Furthermore, the player must not be too high and fly in the direction of the pit to make a valid target apporoach.
|
||||||
@@ -1572,9 +1636,9 @@ function RANGE:AddBombingTargetUnit( unit, goodhitrange, randommove )
|
|||||||
|
|
||||||
-- Debug or error output.
|
-- Debug or error output.
|
||||||
if _isstatic == true then
|
if _isstatic == true then
|
||||||
self:I( self.lid .. string.format( "Adding STATIC bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) )
|
self:T( self.lid .. string.format( "Adding STATIC bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) )
|
||||||
elseif _isstatic == false then
|
elseif _isstatic == false then
|
||||||
self:I( self.lid .. string.format( "Adding UNIT bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) )
|
self:T( self.lid .. string.format( "Adding UNIT bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) )
|
||||||
else
|
else
|
||||||
self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found. Carefully check all UNIT and STATIC names defined in the mission editor!", name ) )
|
self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found. Carefully check all UNIT and STATIC names defined in the mission editor!", name ) )
|
||||||
end
|
end
|
||||||
@@ -1642,7 +1706,7 @@ function RANGE:AddBombingTargetScenery( scenery, goodhitrange)
|
|||||||
|
|
||||||
-- Debug or error output.
|
-- Debug or error output.
|
||||||
if name then
|
if name then
|
||||||
self:I( self.lid .. string.format( "Adding SCENERY bombing target %s with good hit range %d", name, goodhitrange) )
|
self:T( self.lid .. string.format( "Adding SCENERY bombing target %s with good hit range %d", name, goodhitrange) )
|
||||||
else
|
else
|
||||||
self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found!", name ) )
|
self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found!", name ) )
|
||||||
end
|
end
|
||||||
@@ -1665,12 +1729,16 @@ end
|
|||||||
|
|
||||||
--- Add all units of a group as bombing targets.
|
--- Add all units of a group as bombing targets.
|
||||||
-- @param #RANGE self
|
-- @param #RANGE self
|
||||||
-- @param Wrapper.Group#GROUP group Group of bombing targets.
|
-- @param Wrapper.Group#GROUP group Group of bombing targets. Can also be given as group name.
|
||||||
-- @param #number goodhitrange Max distance from unit which is considered as a good hit.
|
-- @param #number goodhitrange Max distance from unit which is considered as a good hit.
|
||||||
-- @param #boolean randommove If true, unit will move randomly within the range. Default is false.
|
-- @param #boolean randommove If true, unit will move randomly within the range. Default is false.
|
||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
function RANGE:AddBombingTargetGroup( group, goodhitrange, randommove )
|
function RANGE:AddBombingTargetGroup( group, goodhitrange, randommove )
|
||||||
self:F( { group = group, goodhitrange = goodhitrange, randommove = randommove } )
|
self:F( { group = group, goodhitrange = goodhitrange, randommove = randommove } )
|
||||||
|
|
||||||
|
if group and type(group)=="string" then
|
||||||
|
group=GROUP:FindByName(group)
|
||||||
|
end
|
||||||
|
|
||||||
if group then
|
if group then
|
||||||
|
|
||||||
@@ -1743,7 +1811,7 @@ function RANGE:OnEventBirth( EventData )
|
|||||||
if not EventData.IniPlayerName then return end
|
if not EventData.IniPlayerName then return end
|
||||||
|
|
||||||
local _unitName = EventData.IniUnitName
|
local _unitName = EventData.IniUnitName
|
||||||
local _unit, _playername = self:_GetPlayerUnitAndName( _unitName )
|
local _unit, _playername = self:_GetPlayerUnitAndName( _unitName, EventData.IniPlayerName )
|
||||||
|
|
||||||
self:T3( self.lid .. "BIRTH: unit = " .. tostring( EventData.IniUnitName ) )
|
self:T3( self.lid .. "BIRTH: unit = " .. tostring( EventData.IniUnitName ) )
|
||||||
self:T3( self.lid .. "BIRTH: group = " .. tostring( EventData.IniGroupName ) )
|
self:T3( self.lid .. "BIRTH: group = " .. tostring( EventData.IniGroupName ) )
|
||||||
@@ -1899,7 +1967,9 @@ end
|
|||||||
-- @param #number attackAlt Attack altitude.
|
-- @param #number attackAlt Attack altitude.
|
||||||
-- @param #number attackVel Attack velocity.
|
-- @param #number attackVel Attack velocity.
|
||||||
function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackVel)
|
function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackVel)
|
||||||
|
|
||||||
|
if not playerData then return end
|
||||||
|
|
||||||
-- Get closet target to last position.
|
-- Get closet target to last position.
|
||||||
local _closetTarget = nil -- #RANGE.BombTarget
|
local _closetTarget = nil -- #RANGE.BombTarget
|
||||||
local _distance = nil
|
local _distance = nil
|
||||||
@@ -1916,13 +1986,13 @@ function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackV
|
|||||||
-- Coordinate of impact point.
|
-- Coordinate of impact point.
|
||||||
local impactcoord = weapon:GetImpactCoordinate()
|
local impactcoord = weapon:GetImpactCoordinate()
|
||||||
|
|
||||||
-- Check if impact happened in range zone.
|
-- Check if impact happened in range zone.+
|
||||||
local insidezone = self.rangezone:IsCoordinateInZone( impactcoord )
|
local insidezone = self.rangezone:IsCoordinateInZone( impactcoord )
|
||||||
|
|
||||||
|
|
||||||
-- Smoke impact point of bomb.
|
-- Smoke impact point of bomb.
|
||||||
if playerData.smokebombimpact and insidezone then
|
if playerData and playerData.smokebombimpact and insidezone then
|
||||||
if playerData.delaysmoke then
|
if playerData and playerData.delaysmoke then
|
||||||
timer.scheduleFunction( self._DelayedSmoke, { coord = impactcoord, color = playerData.smokecolor }, timer.getTime() + self.TdelaySmoke )
|
timer.scheduleFunction( self._DelayedSmoke, { coord = impactcoord, color = playerData.smokecolor }, timer.getTime() + self.TdelaySmoke )
|
||||||
else
|
else
|
||||||
impactcoord:Smoke( playerData.smokecolor )
|
impactcoord:Smoke( playerData.smokecolor )
|
||||||
@@ -2016,7 +2086,7 @@ function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackV
|
|||||||
if self.useSRS then
|
if self.useSRS then
|
||||||
self.controlsrsQ:NewTransmission(_message,nil,self.controlmsrs,nil,1)
|
self.controlsrsQ:NewTransmission(_message,nil,self.controlmsrs,nil,1)
|
||||||
else
|
else
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCWeaponImpactedTooFar.filename, RANGE.Sound.RCWeaponImpactedTooFar.duration, self.soundpath, nil, nil, _message, self.subduration )
|
self.rangecontrol:NewTransmission( self.Sound.RCWeaponImpactedTooFar.filename, self.Sound.RCWeaponImpactedTooFar.duration, self.soundpath, nil, nil, _message, self.subduration )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2047,7 +2117,7 @@ function RANGE:OnEventShot( EventData )
|
|||||||
local _unitName = EventData.IniUnitName
|
local _unitName = EventData.IniUnitName
|
||||||
|
|
||||||
-- Get player unit and name.
|
-- Get player unit and name.
|
||||||
local _unit, _playername = self:_GetPlayerUnitAndName( _unitName )
|
local _unit, _playername = self:_GetPlayerUnitAndName( _unitName, EventData.IniPlayerName )
|
||||||
|
|
||||||
-- Distance Player-to-Range. Set this to larger value than the threshold.
|
-- Distance Player-to-Range. Set this to larger value than the threshold.
|
||||||
local dPR = self.BombtrackThreshold * 2
|
local dPR = self.BombtrackThreshold * 2
|
||||||
@@ -2059,11 +2129,13 @@ function RANGE:OnEventShot( EventData )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Only track if distance player to range is < 25 km. Also check that a player shot. No need to track AI weapons.
|
-- Only track if distance player to range is < 25 km. Also check that a player shot. No need to track AI weapons.
|
||||||
if _track and dPR <= self.BombtrackThreshold and _unit and _playername then
|
if _track and dPR <= self.BombtrackThreshold and _unit and _playername and self.PlayerSettings[_playername] then
|
||||||
|
|
||||||
-- Player data.
|
-- Player data.
|
||||||
local playerData = self.PlayerSettings[_playername] -- #RANGE.PlayerData
|
local playerData = self.PlayerSettings[_playername] -- #RANGE.PlayerData
|
||||||
|
|
||||||
|
if not playerData then return end
|
||||||
|
|
||||||
-- Attack parameters.
|
-- Attack parameters.
|
||||||
local attackHdg=_unit:GetHeading()
|
local attackHdg=_unit:GetHeading()
|
||||||
local attackAlt=_unit:GetHeight()
|
local attackAlt=_unit:GetHeight()
|
||||||
@@ -2124,7 +2196,7 @@ function RANGE:onafterStatus( From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check range status.
|
-- Check range status.
|
||||||
self:I( self.lid .. text )
|
self:T( self.lid .. text )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2163,15 +2235,15 @@ function RANGE:onafterEnterRange( From, Event, To, player )
|
|||||||
-- Radio message that player entered the range
|
-- Radio message that player entered the range
|
||||||
|
|
||||||
-- You entered the bombing range. For hit assessment, contact the range controller at xy MHz
|
-- You entered the bombing range. For hit assessment, contact the range controller at xy MHz
|
||||||
self.instructor:NewTransmission( RANGE.Sound.IREnterRange.filename, RANGE.Sound.IREnterRange.duration, self.soundpath )
|
self.instructor:NewTransmission( self.Sound.IREnterRange.filename, self.Sound.IREnterRange.duration, self.soundpath )
|
||||||
self.instructor:Number2Transmission( RF[1] )
|
self.instructor:Number2Transmission( RF[1] )
|
||||||
|
|
||||||
if tonumber( RF[2] ) > 0 then
|
if tonumber( RF[2] ) > 0 then
|
||||||
self.instructor:NewTransmission( RANGE.Sound.IRDecimal.filename, RANGE.Sound.IRDecimal.duration, self.soundpath )
|
self.instructor:NewTransmission( self.Sound.IRDecimal.filename, self.Sound.IRDecimal.duration, self.soundpath )
|
||||||
self.instructor:Number2Transmission( RF[2] )
|
self.instructor:Number2Transmission( RF[2] )
|
||||||
end
|
end
|
||||||
|
|
||||||
self.instructor:NewTransmission( RANGE.Sound.IRMegaHertz.filename, RANGE.Sound.IRMegaHertz.duration, self.soundpath )
|
self.instructor:NewTransmission( self.Sound.IRMegaHertz.filename, self.Sound.IRMegaHertz.duration, self.soundpath )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2207,7 +2279,7 @@ function RANGE:onafterExitRange( From, Event, To, player )
|
|||||||
|
|
||||||
self.instructsrsQ:NewTransmission(text, nil, self.instructmsrs, nil, 1, {player.client:GetGroup()}, text, 10)
|
self.instructsrsQ:NewTransmission(text, nil, self.instructmsrs, nil, 1, {player.client:GetGroup()}, text, 10)
|
||||||
else
|
else
|
||||||
self.instructor:NewTransmission( RANGE.Sound.IRExitRange.filename, RANGE.Sound.IRExitRange.duration, self.soundpath )
|
self.instructor:NewTransmission( self.Sound.IRExitRange.filename, self.Sound.IRExitRange.duration, self.soundpath )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2243,20 +2315,20 @@ function RANGE:onafterImpact( From, Event, To, result, player )
|
|||||||
local group = player.client:GetGroup()
|
local group = player.client:GetGroup()
|
||||||
self.controlsrsQ:NewTransmission(text,nil,self.controlmsrs,nil,1,{group},text,10)
|
self.controlsrsQ:NewTransmission(text,nil,self.controlmsrs,nil,1,{group},text,10)
|
||||||
else
|
else
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCImpact.filename, RANGE.Sound.RCImpact.duration, self.soundpath, nil, nil, text, self.subduration )
|
self.rangecontrol:NewTransmission( self.Sound.RCImpact.filename, self.Sound.RCImpact.duration, self.soundpath, nil, nil, text, self.subduration )
|
||||||
self.rangecontrol:Number2Transmission( string.format( "%03d", result.radial ), nil, 0.1 )
|
self.rangecontrol:Number2Transmission( string.format( "%03d", result.radial ), nil, 0.1 )
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCDegrees.filename, RANGE.Sound.RCDegrees.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCDegrees.filename, self.Sound.RCDegrees.duration, self.soundpath )
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCFor.filename, RANGE.Sound.RCFor.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCFor.filename, self.Sound.RCFor.duration, self.soundpath )
|
||||||
self.rangecontrol:Number2Transmission( string.format( "%d", UTILS.MetersToFeet( result.distance ) ) )
|
self.rangecontrol:Number2Transmission( string.format( "%d", UTILS.MetersToFeet( result.distance ) ) )
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCFeet.filename, RANGE.Sound.RCFeet.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCFeet.filename, self.Sound.RCFeet.duration, self.soundpath )
|
||||||
if result.quality == "POOR" then
|
if result.quality == "POOR" then
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCPoorHit.filename, RANGE.Sound.RCPoorHit.duration, self.soundpath, nil, 0.5 )
|
self.rangecontrol:NewTransmission( self.Sound.RCPoorHit.filename, self.Sound.RCPoorHit.duration, self.soundpath, nil, 0.5 )
|
||||||
elseif result.quality == "INEFFECTIVE" then
|
elseif result.quality == "INEFFECTIVE" then
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCIneffectiveHit.filename, RANGE.Sound.RCIneffectiveHit.duration, self.soundpath, nil, 0.5 )
|
self.rangecontrol:NewTransmission( self.Sound.RCIneffectiveHit.filename, self.Sound.RCIneffectiveHit.duration, self.soundpath, nil, 0.5 )
|
||||||
elseif result.quality == "GOOD" then
|
elseif result.quality == "GOOD" then
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCGoodHit.filename, RANGE.Sound.RCGoodHit.duration, self.soundpath, nil, 0.5 )
|
self.rangecontrol:NewTransmission( self.Sound.RCGoodHit.filename, self.Sound.RCGoodHit.duration, self.soundpath, nil, 0.5 )
|
||||||
elseif result.quality == "EXCELLENT" then
|
elseif result.quality == "EXCELLENT" then
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCExcellentHit.filename, RANGE.Sound.RCExcellentHit.duration, self.soundpath, nil, 0.5 )
|
self.rangecontrol:NewTransmission( self.Sound.RCExcellentHit.filename, self.Sound.RCExcellentHit.duration, self.soundpath, nil, 0.5 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2325,14 +2397,14 @@ function RANGE:onafterSave( From, Event, To )
|
|||||||
if f then
|
if f then
|
||||||
f:write( data )
|
f:write( data )
|
||||||
f:close()
|
f:close()
|
||||||
self:I( self.lid .. string.format( "Saving player results to file %s", tostring( filename ) ) )
|
self:T( self.lid .. string.format( "Saving player results to file %s", tostring( filename ) ) )
|
||||||
else
|
else
|
||||||
self:E( self.lid .. string.format( "ERROR: Could not save results to file %s", tostring( filename ) ) )
|
self:E( self.lid .. string.format( "ERROR: Could not save results to file %s", tostring( filename ) ) )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Path.
|
-- Path.
|
||||||
local path = lfs.writedir() .. [[Logs\]]
|
local path = self.targetpath or lfs.writedir() .. [[Logs\]]
|
||||||
|
|
||||||
-- Set file name.
|
-- Set file name.
|
||||||
local filename = path .. string.format( "RANGE-%s_BombingResults.csv", self.rangename )
|
local filename = path .. string.format( "RANGE-%s_BombingResults.csv", self.rangename )
|
||||||
@@ -2397,14 +2469,14 @@ function RANGE:onafterLoad( From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Path in DCS log file.
|
-- Path in DCS log file.
|
||||||
local path = lfs.writedir() .. [[Logs\]]
|
local path = self.targetpath or lfs.writedir() .. [[Logs\]]
|
||||||
|
|
||||||
-- Set file name.
|
-- Set file name.
|
||||||
local filename = path .. string.format( "RANGE-%s_BombingResults.csv", self.rangename )
|
local filename = path .. string.format( "RANGE-%s_BombingResults.csv", self.rangename )
|
||||||
|
|
||||||
-- Info message.
|
-- Info message.
|
||||||
local text = string.format( "Loading player bomb results from file %s", filename )
|
local text = string.format( "Loading player bomb results from file %s", filename )
|
||||||
self:I( self.lid .. text )
|
self:T( self.lid .. text )
|
||||||
|
|
||||||
-- Load asset data from file.
|
-- Load asset data from file.
|
||||||
local data = _loadfile( filename )
|
local data = _loadfile( filename )
|
||||||
@@ -2777,7 +2849,7 @@ function RANGE:_DisplayRangeInfo( _unitname )
|
|||||||
|
|
||||||
-- Check if we have a player.
|
-- Check if we have a player.
|
||||||
if unit and playername then
|
if unit and playername then
|
||||||
self:I(playername)
|
--self:I(playername)
|
||||||
-- Message text.
|
-- Message text.
|
||||||
local text = ""
|
local text = ""
|
||||||
|
|
||||||
@@ -3152,7 +3224,7 @@ function RANGE:_CheckInZone( _unitName )
|
|||||||
self.controlsrsQ:NewTransmission(text,nil,self.controlmsrs,nil,1)
|
self.controlsrsQ:NewTransmission(text,nil,self.controlmsrs,nil,1)
|
||||||
else
|
else
|
||||||
-- You left the strafing zone too quickly! No score!
|
-- You left the strafing zone too quickly! No score!
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCLeftStrafePitTooQuickly.filename, RANGE.Sound.RCLeftStrafePitTooQuickly.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCLeftStrafePitTooQuickly.filename, self.Sound.RCLeftStrafePitTooQuickly.duration, self.soundpath )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -3179,23 +3251,23 @@ function RANGE:_CheckInZone( _unitName )
|
|||||||
local resulttext=""
|
local resulttext=""
|
||||||
if _result.pastfoulline == true then --
|
if _result.pastfoulline == true then --
|
||||||
resulttext = "* INVALID - PASSED FOUL LINE *"
|
resulttext = "* INVALID - PASSED FOUL LINE *"
|
||||||
_sound = RANGE.Sound.RCPoorPass --
|
_sound = self.Sound.RCPoorPass --
|
||||||
else
|
else
|
||||||
if accur >= 90 then
|
if accur >= 90 then
|
||||||
resulttext = "DEADEYE PASS"
|
resulttext = "DEADEYE PASS"
|
||||||
_sound = RANGE.Sound.RCExcellentPass
|
_sound = self.Sound.RCExcellentPass
|
||||||
elseif accur >= 75 then
|
elseif accur >= 75 then
|
||||||
resulttext = "EXCELLENT PASS"
|
resulttext = "EXCELLENT PASS"
|
||||||
_sound = RANGE.Sound.RCExcellentPass
|
_sound = self.Sound.RCExcellentPass
|
||||||
elseif accur >= 50 then
|
elseif accur >= 50 then
|
||||||
resulttext = "GOOD PASS"
|
resulttext = "GOOD PASS"
|
||||||
_sound = RANGE.Sound.RCGoodPass
|
_sound = self.Sound.RCGoodPass
|
||||||
elseif accur >= 25 then
|
elseif accur >= 25 then
|
||||||
resulttext = "INEFFECTIVE PASS"
|
resulttext = "INEFFECTIVE PASS"
|
||||||
_sound = RANGE.Sound.RCIneffectivePass
|
_sound = self.Sound.RCIneffectivePass
|
||||||
else
|
else
|
||||||
resulttext = "POOR PASS"
|
resulttext = "POOR PASS"
|
||||||
_sound = RANGE.Sound.RCPoorPass
|
_sound = self.Sound.RCPoorPass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3242,14 +3314,14 @@ function RANGE:_CheckInZone( _unitName )
|
|||||||
if self.useSRS then
|
if self.useSRS then
|
||||||
self.controlsrsQ:NewTransmission(ttstext,nil,self.controlmsrs,nil,1)
|
self.controlsrsQ:NewTransmission(ttstext,nil,self.controlmsrs,nil,1)
|
||||||
else
|
else
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCHitsOnTarget.filename, RANGE.Sound.RCHitsOnTarget.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCHitsOnTarget.filename, self.Sound.RCHitsOnTarget.duration, self.soundpath )
|
||||||
self.rangecontrol:Number2Transmission( string.format( "%d", _result.hits ) )
|
self.rangecontrol:Number2Transmission( string.format( "%d", _result.hits ) )
|
||||||
if shots and accur then
|
if shots and accur then
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCTotalRoundsFired.filename, RANGE.Sound.RCTotalRoundsFired.duration, self.soundpath, nil, 0.2 )
|
self.rangecontrol:NewTransmission( self.Sound.RCTotalRoundsFired.filename, self.Sound.RCTotalRoundsFired.duration, self.soundpath, nil, 0.2 )
|
||||||
self.rangecontrol:Number2Transmission( string.format( "%d", shots ), nil, 0.2 )
|
self.rangecontrol:Number2Transmission( string.format( "%d", shots ), nil, 0.2 )
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCAccuracy.filename, RANGE.Sound.RCAccuracy.duration, self.soundpath, nil, 0.2 )
|
self.rangecontrol:NewTransmission( self.Sound.RCAccuracy.filename, self.Sound.RCAccuracy.duration, self.soundpath, nil, 0.2 )
|
||||||
self.rangecontrol:Number2Transmission( string.format( "%d", UTILS.Round( accur, 0 ) ) )
|
self.rangecontrol:Number2Transmission( string.format( "%d", UTILS.Round( accur, 0 ) ) )
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCPercent.filename, RANGE.Sound.RCPercent.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCPercent.filename, self.Sound.RCPercent.duration, self.soundpath )
|
||||||
end
|
end
|
||||||
self.rangecontrol:NewTransmission( _sound.filename, _sound.duration, self.soundpath, nil, 0.5 )
|
self.rangecontrol:NewTransmission( _sound.filename, _sound.duration, self.soundpath, nil, 0.5 )
|
||||||
end
|
end
|
||||||
@@ -3294,7 +3366,7 @@ function RANGE:_CheckInZone( _unitName )
|
|||||||
if self.useSRS then
|
if self.useSRS then
|
||||||
self.controlsrsQ:NewTransmission(_msg,nil,self.controlmsrs,nil,1)
|
self.controlsrsQ:NewTransmission(_msg,nil,self.controlmsrs,nil,1)
|
||||||
else
|
else
|
||||||
self.rangecontrol:NewTransmission( RANGE.Sound.RCRollingInOnStrafeTarget.filename, RANGE.Sound.RCRollingInOnStrafeTarget.duration, self.soundpath )
|
self.rangecontrol:NewTransmission( self.Sound.RCRollingInOnStrafeTarget.filename, self.Sound.RCRollingInOnStrafeTarget.duration, self.soundpath )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3343,16 +3415,23 @@ function RANGE:_AddF10Commands( _unitName )
|
|||||||
self.MenuAddedTo[_gid] = true
|
self.MenuAddedTo[_gid] = true
|
||||||
|
|
||||||
-- Range root menu path.
|
-- Range root menu path.
|
||||||
local _rangePath = nil
|
local _rootMenu = nil
|
||||||
|
|
||||||
if RANGE.MenuF10Root then
|
|
||||||
|
|
||||||
|
if self.menuF10root then
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
-- MISSION LEVEL --
|
-- MISSION LEVEL --
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
--_rootMenu = MENU_GROUP:New( group, self.rangename, self.menuF10root )
|
||||||
|
_rootMenu = self.menuF10root
|
||||||
|
self:T2(self.lid..string.format("Creating F10 menu for group %s", group:GetName()))
|
||||||
|
|
||||||
-- _rangePath = missionCommands.addSubMenuForGroup(_gid, self.rangename, RANGE.MenuF10Root)
|
elseif RANGE.MenuF10Root then
|
||||||
_rangePath = MENU_GROUP:New( group, "On the Range" )
|
|
||||||
|
-- Main F10 menu: F10/<RANGE.MenuF10Root>/<Range Name>
|
||||||
|
--_rootMenu = MENU_GROUP:New( group, self.rangename, RANGE.MenuF10Root )
|
||||||
|
_rootMenu = RANGE.MenuF10Root
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -3362,12 +3441,17 @@ function RANGE:_AddF10Commands( _unitName )
|
|||||||
|
|
||||||
-- Main F10 menu: F10/On the Range/<Range Name>/
|
-- Main F10 menu: F10/On the Range/<Range Name>/
|
||||||
if RANGE.MenuF10[_gid] == nil then
|
if RANGE.MenuF10[_gid] == nil then
|
||||||
-- RANGE.MenuF10[_gid]=missionCommands.addSubMenuForGroup(_gid, "On the Range")
|
self:T2(self.lid..string.format("Creating F10 menu 'On the Range' for group %s", group:GetName()))
|
||||||
RANGE.MenuF10[_gid] = MENU_GROUP:New( group, "On the Range" )
|
else
|
||||||
|
self:T2(self.lid..string.format("F10 menu 'On the Range' already EXISTS for group %s", group:GetName()))
|
||||||
end
|
end
|
||||||
-- _rangePath = missionCommands.addSubMenuForGroup(_gid, self.rangename, RANGE.MenuF10[_gid])
|
|
||||||
_rangePath = MENU_GROUP:New( group, self.rangename, RANGE.MenuF10[_gid] )
|
_rootMenu=RANGE.MenuF10[_gid] or MENU_GROUP:New( group, "On the Range" )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Range menu
|
||||||
|
local _rangePath = MENU_GROUP:New( group, self.rangename, _rootMenu )
|
||||||
|
|
||||||
local _statsPath = MENU_GROUP:New( group, "Statistics", _rangePath )
|
local _statsPath = MENU_GROUP:New( group, "Statistics", _rangePath )
|
||||||
local _markPath = MENU_GROUP:New( group, "Mark Targets", _rangePath )
|
local _markPath = MENU_GROUP:New( group, "Mark Targets", _rangePath )
|
||||||
@@ -3776,13 +3860,13 @@ function RANGE:_TargetsheetOnOff( _unitname )
|
|||||||
|
|
||||||
-- Inform player.
|
-- Inform player.
|
||||||
if playerData and playerData.targeton == true then
|
if playerData and playerData.targeton == true then
|
||||||
text = string.format( "roger, your targetsheets are now SAVED." )
|
text = string.format( "Roger, your targetsheets are now SAVED." )
|
||||||
else
|
else
|
||||||
text = string.format( "affirm, your targetsheets are NOT SAVED." )
|
text = string.format( "Affirm, your targetsheets are NOT SAVED." )
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
text = "negative, target sheet data recorder is broken on this range."
|
text = "Negative, target sheet data recorder is broken on this range."
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Message to player.
|
-- Message to player.
|
||||||
@@ -4019,8 +4103,8 @@ end
|
|||||||
-- @return Wrapper.Unit#UNIT Unit of player.
|
-- @return Wrapper.Unit#UNIT Unit of player.
|
||||||
-- @return #string Name of the player.
|
-- @return #string Name of the player.
|
||||||
-- @return #boolean If true, group has > 1 player in it
|
-- @return #boolean If true, group has > 1 player in it
|
||||||
function RANGE:_GetPlayerUnitAndName( _unitName )
|
function RANGE:_GetPlayerUnitAndName( _unitName, PlayerName )
|
||||||
self:F2( _unitName )
|
--self:I( _unitName )
|
||||||
|
|
||||||
if _unitName ~= nil then
|
if _unitName ~= nil then
|
||||||
|
|
||||||
@@ -4029,9 +4113,9 @@ function RANGE:_GetPlayerUnitAndName( _unitName )
|
|||||||
-- Get DCS unit from its name.
|
-- Get DCS unit from its name.
|
||||||
local DCSunit = Unit.getByName( _unitName )
|
local DCSunit = Unit.getByName( _unitName )
|
||||||
|
|
||||||
if DCSunit then
|
if DCSunit and DCSunit.getPlayerName then
|
||||||
|
|
||||||
local playername = DCSunit:getPlayerName()
|
local playername = DCSunit:getPlayerName() or PlayerName or "None"
|
||||||
local unit = UNIT:Find( DCSunit )
|
local unit = UNIT:Find( DCSunit )
|
||||||
|
|
||||||
self:T2( { DCSunit = DCSunit, unit = unit, playername = playername } )
|
self:T2( { DCSunit = DCSunit, unit = unit, playername = playername } )
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
TIRESIAS = {
|
TIRESIAS = {
|
||||||
ClassName = "TIRESIAS",
|
ClassName = "TIRESIAS",
|
||||||
debug = false,
|
debug = false,
|
||||||
version = "0.0.4",
|
version = "0.0.5",
|
||||||
Interval = 20,
|
Interval = 20,
|
||||||
GroundSet = nil,
|
GroundSet = nil,
|
||||||
VehicleSet = nil,
|
VehicleSet = nil,
|
||||||
@@ -187,7 +187,7 @@ function TIRESIAS:SetAAARanges(FiringRange,SwitchAAA)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- [USER] Add a SET_GROUP of GROUP objects as exceptions. Can be done multiple times.
|
--- [USER] Add a SET_GROUP of GROUP objects as exceptions. Can be done multiple times. Does **not** work work for GROUP objects spawned into the SET after start, i.e. the groups need to exist in the game already.
|
||||||
-- @param #TIRESIAS self
|
-- @param #TIRESIAS self
|
||||||
-- @param Core.Set#SET_GROUP Set to add to the exception list.
|
-- @param Core.Set#SET_GROUP Set to add to the exception list.
|
||||||
-- @return #TIRESIAS self
|
-- @return #TIRESIAS self
|
||||||
@@ -203,7 +203,7 @@ function TIRESIAS:AddExceptionSet(Set)
|
|||||||
}
|
}
|
||||||
exceptions:AddGroup(grp,true)
|
exceptions:AddGroup(grp,true)
|
||||||
end
|
end
|
||||||
BASE:I("TIRESIAS: Added exception group: "..grp:GetName())
|
BASE:T("TIRESIAS: Added exception group: "..grp:GetName())
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
@@ -391,6 +391,7 @@ function TIRESIAS:_SwitchOnGroups(group,radius)
|
|||||||
if ground:CountAlive() > 0 then
|
if ground:CountAlive() > 0 then
|
||||||
ground:ForEachGroupAlive(
|
ground:ForEachGroupAlive(
|
||||||
function(grp)
|
function(grp)
|
||||||
|
local name = grp:GetName()
|
||||||
if grp.Tiresias and grp.Tiresias.type and (not grp.Tiresias.exception == true ) then
|
if grp.Tiresias and grp.Tiresias.type and (not grp.Tiresias.exception == true ) then
|
||||||
if grp.Tiresias.invisible == true then
|
if grp.Tiresias.invisible == true then
|
||||||
grp:SetCommandInvisible(false)
|
grp:SetCommandInvisible(false)
|
||||||
@@ -407,7 +408,7 @@ function TIRESIAS:_SwitchOnGroups(group,radius)
|
|||||||
end
|
end
|
||||||
--BASE:I(string.format("TIRESIAS - Switch on %s %s (Exception %s)",tostring(grp.Tiresias.type),grp:GetName(),tostring(grp.Tiresias.exception)))
|
--BASE:I(string.format("TIRESIAS - Switch on %s %s (Exception %s)",tostring(grp.Tiresias.type),grp:GetName(),tostring(grp.Tiresias.exception)))
|
||||||
else
|
else
|
||||||
BASE:E("TIRESIAS - This group has not been initialized or is an exception!")
|
BASE:T("TIRESIAS - This group "..tostring(name).. " has not been initialized or is an exception!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6732,7 +6732,7 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP deadgroup Group of unit that died.
|
-- @param Wrapper.Group#GROUP deadgroup Group of unit that died.
|
||||||
-- @param #WAREHOUSE.Pendingitem request Request that needs to be updated.
|
-- @param #WAREHOUSE.Pendingitem request Request that needs to be updated.
|
||||||
function WAREHOUSE:_UnitDead(deadunit, deadgroup, request)
|
function WAREHOUSE:_UnitDead(deadunit, deadgroup, request)
|
||||||
self:F(self.lid.."FF unit dead "..deadunit:GetName())
|
--self:F(self.lid.."FF unit dead "..deadunit:GetName())
|
||||||
|
|
||||||
-- Find opsgroup.
|
-- Find opsgroup.
|
||||||
local opsgroup=_DATABASE:FindOpsGroup(deadgroup)
|
local opsgroup=_DATABASE:FindOpsGroup(deadgroup)
|
||||||
@@ -7946,10 +7946,12 @@ function WAREHOUSE:_FindParkingForAssets(airbase, assets)
|
|||||||
local clients=_DATABASE.CLIENTS
|
local clients=_DATABASE.CLIENTS
|
||||||
for clientname, client in pairs(clients) do
|
for clientname, client in pairs(clients) do
|
||||||
local template=_DATABASE:GetGroupTemplateFromUnitName(clientname)
|
local template=_DATABASE:GetGroupTemplateFromUnitName(clientname)
|
||||||
local units=template.units
|
if template then
|
||||||
for i,unit in pairs(units) do
|
local units=template.units
|
||||||
local coord=COORDINATE:New(unit.x, unit.alt, unit.y)
|
for i,unit in pairs(units) do
|
||||||
coords[unit.name]=coord
|
local coord=COORDINATE:New(unit.x, unit.alt, unit.y)
|
||||||
|
coords[unit.name]=coord
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
do -- ZONE_CAPTURE_COALITION
|
do -- ZONE_CAPTURE_COALITION
|
||||||
|
|
||||||
--- @type ZONE_CAPTURE_COALITION
|
-- @type ZONE_CAPTURE_COALITION
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @field #number MarkBlue ID of blue F10 mark.
|
-- @field #number MarkBlue ID of blue F10 mark.
|
||||||
-- @field #number MarkRed ID of red F10 mark.
|
-- @field #number MarkRed ID of red F10 mark.
|
||||||
@@ -161,7 +161,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- The mission designer can use these values to alter the logic.
|
-- The mission designer can use these values to alter the logic.
|
||||||
-- For example:
|
-- For example:
|
||||||
--
|
--
|
||||||
-- --- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
||||||
-- if From ~= "Empty" then
|
-- if From ~= "Empty" then
|
||||||
-- -- Display a message
|
-- -- Display a message
|
||||||
@@ -172,7 +172,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
--
|
--
|
||||||
-- ## Example Event Handler.
|
-- ## Example Event Handler.
|
||||||
--
|
--
|
||||||
-- --- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
||||||
-- if From ~= To then
|
-- if From ~= To then
|
||||||
-- local Coalition = self:GetCoalition()
|
-- local Coalition = self:GetCoalition()
|
||||||
@@ -273,7 +273,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- Depending on the zone ownership, different messages are sent.
|
-- Depending on the zone ownership, different messages are sent.
|
||||||
-- Note the methods `ZoneCaptureCoalition:GetZoneName()`.
|
-- Note the methods `ZoneCaptureCoalition:GetZoneName()`.
|
||||||
--
|
--
|
||||||
-- --- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
-- function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To )
|
||||||
-- if From ~= To then
|
-- if From ~= To then
|
||||||
-- local Coalition = self:GetCoalition()
|
-- local Coalition = self:GetCoalition()
|
||||||
@@ -294,7 +294,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- Next is the Event Handler when the **Empty** state transition is triggered.
|
-- Next is the Event Handler when the **Empty** state transition is triggered.
|
||||||
-- Now we smoke the ZoneCaptureCoalition with a green color, using `self:Smoke( SMOKECOLOR.Green )`.
|
-- Now we smoke the ZoneCaptureCoalition with a green color, using `self:Smoke( SMOKECOLOR.Green )`.
|
||||||
--
|
--
|
||||||
-- --- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterEmpty()
|
-- function ZoneCaptureCoalition:OnEnterEmpty()
|
||||||
-- self:Smoke( SMOKECOLOR.Green )
|
-- self:Smoke( SMOKECOLOR.Green )
|
||||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
-- US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||||
@@ -304,7 +304,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- The next Event Handlers speak for itself.
|
-- The next Event Handlers speak for itself.
|
||||||
-- When the zone is Attacked, we smoke the zone white and send some messages to each coalition.
|
-- When the zone is Attacked, we smoke the zone white and send some messages to each coalition.
|
||||||
--
|
--
|
||||||
-- --- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterAttacked()
|
-- function ZoneCaptureCoalition:OnEnterAttacked()
|
||||||
-- ZoneCaptureCoalition:Smoke( SMOKECOLOR.White )
|
-- ZoneCaptureCoalition:Smoke( SMOKECOLOR.White )
|
||||||
-- local Coalition = self:GetCoalition()
|
-- local Coalition = self:GetCoalition()
|
||||||
@@ -321,7 +321,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- When the zone is Captured, we send some victory or loss messages to the correct coalition.
|
-- When the zone is Captured, we send some victory or loss messages to the correct coalition.
|
||||||
-- And we add some score.
|
-- And we add some score.
|
||||||
--
|
--
|
||||||
-- --- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterCaptured()
|
-- function ZoneCaptureCoalition:OnEnterCaptured()
|
||||||
-- local Coalition = self:GetCoalition()
|
-- local Coalition = self:GetCoalition()
|
||||||
-- self:E({Coalition = Coalition})
|
-- self:E({Coalition = Coalition})
|
||||||
@@ -641,7 +641,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
--
|
--
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- For example, one could stop the monitoring when the zone was captured!
|
-- -- For example, one could stop the monitoring when the zone was captured!
|
||||||
-- --- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
-- -- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
||||||
-- function ZoneCaptureCoalition:OnEnterCaptured()
|
-- function ZoneCaptureCoalition:OnEnterCaptured()
|
||||||
-- local Coalition = self:GetCoalition()
|
-- local Coalition = self:GetCoalition()
|
||||||
-- self:E({Coalition = Coalition})
|
-- self:E({Coalition = Coalition})
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
do -- Zone
|
do -- Zone
|
||||||
|
|
||||||
--- @type ZONE_GOAL
|
-- @type ZONE_GOAL
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @field Core.Goal#GOAL Goal The goal object.
|
-- @field Core.Goal#GOAL Goal The goal object.
|
||||||
-- @field #number SmokeTime Time stamp in seconds when the last smoke of the zone was triggered.
|
-- @field #number SmokeTime Time stamp in seconds when the last smoke of the zone was triggered.
|
||||||
@@ -178,7 +178,7 @@ do -- Zone
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #ZONE_GOAL self
|
-- @param #ZONE_GOAL self
|
||||||
-- @param Core.Event#EVENTDATA EventData Event data table.
|
-- @param Core.Event#EVENTDATA EventData Event data table.
|
||||||
function ZONE_GOAL:__Destroyed( EventData )
|
function ZONE_GOAL:__Destroyed( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
do -- ZoneGoal
|
do -- ZoneGoal
|
||||||
|
|
||||||
--- @type ZONE_GOAL_CARGO
|
-- @type ZONE_GOAL_CARGO
|
||||||
-- @extends Functional.ZoneGoal#ZONE_GOAL
|
-- @extends Functional.ZoneGoal#ZONE_GOAL
|
||||||
|
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ do -- ZoneGoal
|
|||||||
ClassName = "ZONE_GOAL_CARGO",
|
ClassName = "ZONE_GOAL_CARGO",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field #table ZONE_GOAL_CARGO.States
|
-- @field #table ZONE_GOAL_CARGO.States
|
||||||
ZONE_GOAL_CARGO.States = {}
|
ZONE_GOAL_CARGO.States = {}
|
||||||
|
|
||||||
--- ZONE_GOAL_CARGO Constructor.
|
--- ZONE_GOAL_CARGO Constructor.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
do -- ZoneGoal
|
do -- ZoneGoal
|
||||||
|
|
||||||
--- @type ZONE_GOAL_COALITION
|
-- @type ZONE_GOAL_COALITION
|
||||||
-- @field #string ClassName Name of the Class.
|
-- @field #string ClassName Name of the Class.
|
||||||
-- @field #number Coalition The current coalition ID of the zone owner.
|
-- @field #number Coalition The current coalition ID of the zone owner.
|
||||||
-- @field #number PreviousCoalition The previous owner of the zone.
|
-- @field #number PreviousCoalition The previous owner of the zone.
|
||||||
@@ -48,7 +48,7 @@ do -- ZoneGoal
|
|||||||
ObjectCategories = nil,
|
ObjectCategories = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field #table ZONE_GOAL_COALITION.States
|
-- @field #table ZONE_GOAL_COALITION.States
|
||||||
ZONE_GOAL_COALITION.States = {}
|
ZONE_GOAL_COALITION.States = {}
|
||||||
|
|
||||||
--- ZONE_GOAL_COALITION Constructor.
|
--- ZONE_GOAL_COALITION Constructor.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Enums.lua' )
|
|||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Utils.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Utils.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Profiler.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Profiler.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Templates.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Templates.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/STTS.lua' )
|
--__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/STTS.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/FiFo.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/FiFo.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Socket.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Socket.lua' )
|
||||||
|
|
||||||
@@ -49,6 +49,7 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Marker.lua' )
|
|||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Weapon.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Weapon.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Net.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Net.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Storage.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/Storage.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Wrapper/DynamicCargo.lua' )
|
||||||
|
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/Cargo.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/Cargo.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/CargoUnit.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/CargoUnit.lua' )
|
||||||
@@ -84,6 +85,7 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Autolase.lua' )
|
|||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/ZoneGoalCargo.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/ZoneGoalCargo.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Tiresias.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Tiresias.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Stratego.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Stratego.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/ClientWatch.lua')
|
||||||
|
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/Airboss.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/Airboss.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RecoveryTanker.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RecoveryTanker.lua' )
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
__Moose.Include( 'Utilities\\Enums.lua' )
|
__Moose.Include( 'Utilities\\Enums.lua' )
|
||||||
__Moose.Include( 'Utilities\\Routines.lua' )
|
|
||||||
__Moose.Include( 'Utilities\\Utils.lua' )
|
__Moose.Include( 'Utilities\\Utils.lua' )
|
||||||
__Moose.Include( 'Utilities\\Profiler.lua' )
|
__Moose.Include( 'Utilities\\Profiler.lua' )
|
||||||
__Moose.Include( 'Utilities\\Templates.lua' )
|
--__Moose.Include( 'Utilities\\STTS.lua' )
|
||||||
__Moose.Include( 'Utilities\\STTS.lua' )
|
|
||||||
__Moose.Include( 'Utilities\\FiFo.lua' )
|
__Moose.Include( 'Utilities\\FiFo.lua' )
|
||||||
__Moose.Include( 'Utilities\\Socket.lua' )
|
__Moose.Include( 'Utilities\\Socket.lua' )
|
||||||
|
|
||||||
@@ -17,11 +15,11 @@ __Moose.Include( 'Core\\Event.lua' )
|
|||||||
__Moose.Include( 'Core\\Settings.lua' )
|
__Moose.Include( 'Core\\Settings.lua' )
|
||||||
__Moose.Include( 'Core\\Menu.lua' )
|
__Moose.Include( 'Core\\Menu.lua' )
|
||||||
__Moose.Include( 'Core\\Zone.lua' )
|
__Moose.Include( 'Core\\Zone.lua' )
|
||||||
__Moose.Include( 'Core\\Zone_Detection.lua' )
|
__Moose.Include( 'Core\\Velocity.lua' )
|
||||||
__Moose.Include( 'Core\\Database.lua' )
|
__Moose.Include( 'Core\\Database.lua' )
|
||||||
__Moose.Include( 'Core\\Set.lua' )
|
__Moose.Include( 'Core\\Set.lua' )
|
||||||
__Moose.Include( 'Core\\Point.lua' )
|
__Moose.Include( 'Core\\Point.lua' )
|
||||||
__Moose.Include( 'Core\\Velocity.lua' )
|
__Moose.Include( 'Core\\Pathline.lua' )
|
||||||
__Moose.Include( 'Core\\Message.lua' )
|
__Moose.Include( 'Core\\Message.lua' )
|
||||||
__Moose.Include( 'Core\\Fsm.lua' )
|
__Moose.Include( 'Core\\Fsm.lua' )
|
||||||
__Moose.Include( 'Core\\Spawn.lua' )
|
__Moose.Include( 'Core\\Spawn.lua' )
|
||||||
@@ -46,6 +44,10 @@ __Moose.Include( 'Wrapper\\Static.lua' )
|
|||||||
__Moose.Include( 'Wrapper\\Airbase.lua' )
|
__Moose.Include( 'Wrapper\\Airbase.lua' )
|
||||||
__Moose.Include( 'Wrapper\\Scenery.lua' )
|
__Moose.Include( 'Wrapper\\Scenery.lua' )
|
||||||
__Moose.Include( 'Wrapper\\Marker.lua' )
|
__Moose.Include( 'Wrapper\\Marker.lua' )
|
||||||
|
__Moose.Include( 'Wrapper\\Net.lua' )
|
||||||
|
__Moose.Include( 'Wrapper\\Weapon.lua' )
|
||||||
|
__Moose.Include( 'Wrapper\\Storage.lua' )
|
||||||
|
__Moose.Include( 'Wrapper\\DynamicCargo.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'Cargo\\Cargo.lua' )
|
__Moose.Include( 'Cargo\\Cargo.lua' )
|
||||||
__Moose.Include( 'Cargo\\CargoUnit.lua' )
|
__Moose.Include( 'Cargo\\CargoUnit.lua' )
|
||||||
@@ -77,6 +79,10 @@ __Moose.Include( 'Functional\\Mantis.lua' )
|
|||||||
__Moose.Include( 'Functional\\Shorad.lua' )
|
__Moose.Include( 'Functional\\Shorad.lua' )
|
||||||
__Moose.Include( 'Functional\\Autolase.lua' )
|
__Moose.Include( 'Functional\\Autolase.lua' )
|
||||||
__Moose.Include( 'Functional\\AICSAR.lua' )
|
__Moose.Include( 'Functional\\AICSAR.lua' )
|
||||||
|
__Moose.Include( 'Functional\\AmmoTruck.lua' )
|
||||||
|
__Moose.Include( 'Functional\\Tiresias.lua' )
|
||||||
|
__Moose.Include( 'Functional\\Stratego.lua' )
|
||||||
|
__Moose.Include( 'Functional\\ClientWatch.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'Ops\\Airboss.lua' )
|
__Moose.Include( 'Ops\\Airboss.lua' )
|
||||||
__Moose.Include( 'Ops\\RecoveryTanker.lua' )
|
__Moose.Include( 'Ops\\RecoveryTanker.lua' )
|
||||||
@@ -107,6 +113,9 @@ __Moose.Include( 'Ops\\Awacs.lua' )
|
|||||||
__Moose.Include( 'Ops\\PlayerTask.lua' )
|
__Moose.Include( 'Ops\\PlayerTask.lua' )
|
||||||
__Moose.Include( 'Ops\\Operation.lua' )
|
__Moose.Include( 'Ops\\Operation.lua' )
|
||||||
__Moose.Include( 'Ops\\FlightControl.lua' )
|
__Moose.Include( 'Ops\\FlightControl.lua' )
|
||||||
|
__Moose.Include( 'Ops\\PlayerRecce.lua' )
|
||||||
|
__Moose.Include( 'Ops\\EasyGCICAP.lua' )
|
||||||
|
__Moose.Include( 'Ops\\EasyA2G.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'AI\\AI_Balancer.lua' )
|
__Moose.Include( 'AI\\AI_Balancer.lua' )
|
||||||
__Moose.Include( 'AI\\AI_Air.lua' )
|
__Moose.Include( 'AI\\AI_Air.lua' )
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
-- @field #number power Radio power in Watts. Default 100 W.
|
-- @field #number power Radio power in Watts. Default 100 W.
|
||||||
-- @field Sound.RadioQueue#RADIOQUEUE radioqueue Radio queue for broadcasing messages.
|
-- @field Sound.RadioQueue#RADIOQUEUE radioqueue Radio queue for broadcasing messages.
|
||||||
-- @field #string soundpath Path to sound files.
|
-- @field #string soundpath Path to sound files.
|
||||||
|
-- @field #string soundpathAirports Path to airport names sound files.
|
||||||
|
-- @field #string soundpathNato Path to NATO alphabet sound files.
|
||||||
-- @field #string relayunitname Name of the radio relay unit.
|
-- @field #string relayunitname Name of the radio relay unit.
|
||||||
-- @field #table towerfrequency Table with tower frequencies.
|
-- @field #table towerfrequency Table with tower frequencies.
|
||||||
-- @field #string activerunway The active runway specified by the user.
|
-- @field #string activerunway The active runway specified by the user.
|
||||||
@@ -315,18 +317,18 @@
|
|||||||
-- atis:Start()
|
-- atis:Start()
|
||||||
--
|
--
|
||||||
-- This uses a male voice with US accent. It requires SRS to be installed in the `D:\DCS\_SRS\` directory. Note that backslashes need to be escaped or simply use slashes (as in linux).
|
-- This uses a male voice with US accent. It requires SRS to be installed in the `D:\DCS\_SRS\` directory. Note that backslashes need to be escaped or simply use slashes (as in linux).
|
||||||
--
|
--
|
||||||
-- ### SRS can use multiple frequencies:
|
-- ### SRS can use multiple frequencies:
|
||||||
--
|
--
|
||||||
-- atis=ATIS:New("Batumi", {305,103.85}, {radio.modulation.AM,radio.modulation.FM})
|
-- atis=ATIS:New("Batumi", {305,103.85}, {radio.modulation.AM,radio.modulation.FM})
|
||||||
-- atis:SetSRS("D:\\DCS\\_SRS\\", "male", "en-US")
|
-- atis:SetSRS("D:\\DCS\\_SRS\\", "male", "en-US")
|
||||||
-- atis:Start()
|
-- atis:Start()
|
||||||
--
|
--
|
||||||
-- ### SRS Localization
|
-- ### SRS Localization
|
||||||
--
|
--
|
||||||
-- You can localize the SRS output, all you need is to provide a table of translations and set the `locale` of your instance. You need to provide the translations in your script **before you instantiate your ATIS**.
|
-- You can localize the SRS output, all you need is to provide a table of translations and set the `locale` of your instance. You need to provide the translations in your script **before you instantiate your ATIS**.
|
||||||
-- The German localization (already provided in the code) e.g. looks like follows:
|
-- The German localization (already provided in the code) e.g. looks like follows:
|
||||||
--
|
--
|
||||||
-- ATIS.Messages.DE =
|
-- ATIS.Messages.DE =
|
||||||
-- {
|
-- {
|
||||||
-- HOURS = "Uhr",
|
-- HOURS = "Uhr",
|
||||||
@@ -387,13 +389,13 @@
|
|||||||
-- FARP = "Farp",
|
-- FARP = "Farp",
|
||||||
-- DELIMITER = "Komma", -- decimal delimiter
|
-- DELIMITER = "Komma", -- decimal delimiter
|
||||||
-- }
|
-- }
|
||||||
--
|
--
|
||||||
-- Then set up your ATIS and set the locale:
|
-- Then set up your ATIS and set the locale:
|
||||||
--
|
--
|
||||||
-- atis=ATIS:New("Batumi", 305, radio.modulation.AM)
|
-- atis=ATIS:New("Batumi", 305, radio.modulation.AM)
|
||||||
-- atis:SetSRS("D:\\DCS\\_SRS\\", "female", "de_DE")
|
-- atis:SetSRS("D:\\DCS\\_SRS\\", "female", "de_DE")
|
||||||
-- atis:SetLocale("de") -- available locales from source are "en", "de" and "es"
|
-- atis:SetLocale("de") -- available locales from source are "en", "de" and "es"
|
||||||
-- atis:Start()
|
-- atis:Start()
|
||||||
--
|
--
|
||||||
-- ## FARPS
|
-- ## FARPS
|
||||||
--
|
--
|
||||||
@@ -495,7 +497,7 @@ ATIS.Alphabet = {
|
|||||||
-- @field #number TheChannel -10° (West).
|
-- @field #number TheChannel -10° (West).
|
||||||
-- @field #number Syria +5° (East).
|
-- @field #number Syria +5° (East).
|
||||||
-- @field #number MarianaIslands +2° (East).
|
-- @field #number MarianaIslands +2° (East).
|
||||||
-- @field #number SinaiMao +5° (East).
|
-- @field #number SinaiMap +5° (East).
|
||||||
ATIS.RunwayM2T = {
|
ATIS.RunwayM2T = {
|
||||||
Caucasus = 0,
|
Caucasus = 0,
|
||||||
Nevada = 12,
|
Nevada = 12,
|
||||||
@@ -618,6 +620,8 @@ ATIS.ICAOPhraseology = {
|
|||||||
-- @field #ATIS.Soundfile VORFrequency
|
-- @field #ATIS.Soundfile VORFrequency
|
||||||
ATIS.Sound = {
|
ATIS.Sound = {
|
||||||
ActiveRunway = { filename = "ActiveRunway.ogg", duration = 0.99 },
|
ActiveRunway = { filename = "ActiveRunway.ogg", duration = 0.99 },
|
||||||
|
ActiveRunwayDeparture = { filename = "ActiveRunwayDeparture.ogg", duration = 0.99 },
|
||||||
|
ActiveRunwayArrival = { filename = "ActiveRunwayArrival.ogg", duration = 0.99 },
|
||||||
AdviceOnInitial = { filename = "AdviceOnInitial.ogg", duration = 3.00 },
|
AdviceOnInitial = { filename = "AdviceOnInitial.ogg", duration = 3.00 },
|
||||||
Airport = { filename = "Airport.ogg", duration = 0.66 },
|
Airport = { filename = "Airport.ogg", duration = 0.66 },
|
||||||
Altimeter = { filename = "Altimeter.ogg", duration = 0.68 },
|
Altimeter = { filename = "Altimeter.ogg", duration = 0.68 },
|
||||||
@@ -878,6 +882,66 @@ ATIS.Messages = {
|
|||||||
FARP = "Farp",
|
FARP = "Farp",
|
||||||
DELIMITER = "Punto", -- decimal delimiter
|
DELIMITER = "Punto", -- decimal delimiter
|
||||||
},
|
},
|
||||||
|
-- French messages thanks to @Wojtech and Bing
|
||||||
|
FR = {
|
||||||
|
HOURS = "Heures",
|
||||||
|
TIME = "Temps",
|
||||||
|
NOCLOUDINFO = "Informations sur la couverture nuageuse non disponibles",
|
||||||
|
OVERCAST = "Ciel couvert",
|
||||||
|
BROKEN = "Nuages fragmentés",
|
||||||
|
SCATTERED = "Nuages épars",
|
||||||
|
FEWCLOUDS = "Nuages rares",
|
||||||
|
NOCLOUDS = "Clair",
|
||||||
|
AIRPORT = "Aéroport",
|
||||||
|
INFORMATION ="Information",
|
||||||
|
SUNRISEAT = "Levé du soleil à %s heure locale",
|
||||||
|
SUNSETAT = "Couché du soleil à %s heure locale",
|
||||||
|
WINDFROMMS = "Vent du %s pour %s mètres par seconde",
|
||||||
|
WINDFROMKNOTS = "Vent du %s pour %s noeuds",
|
||||||
|
GUSTING = "Rafale de vent",
|
||||||
|
VISIKM = "Visibilité %s kilomètres",
|
||||||
|
VISISM = "Visibilité %s Miles",
|
||||||
|
RAIN = "Pluie",
|
||||||
|
TSTORM = "Orage",
|
||||||
|
SNOW = "Neige",
|
||||||
|
SSTROM = "Tempête de neige",
|
||||||
|
FOG = "Brouillard",
|
||||||
|
DUST = "Poussière",
|
||||||
|
PHENOMENA = "Phénomène météorologique",
|
||||||
|
CLOUDBASEM = "Couverture nuageuse de %s à %s mètres",
|
||||||
|
CLOUDBASEFT = "Couverture nuageuse de %s à %s pieds",
|
||||||
|
TEMPERATURE = "Température",
|
||||||
|
DEWPOINT = "Point de rosée",
|
||||||
|
ALTIMETER = "Altimètre",
|
||||||
|
ACTIVERUN = "Décollages piste",
|
||||||
|
ACTIVELANDING = "Atterrissages piste",
|
||||||
|
LEFT = "Gauche",
|
||||||
|
RIGHT = "Droite",
|
||||||
|
RWYLENGTH = "Longueur de piste",
|
||||||
|
METERS = "Mètre",
|
||||||
|
FEET = "Pieds",
|
||||||
|
ELEVATION = "Hauteur",
|
||||||
|
TOWERFREQ = "Fréquences de la tour",
|
||||||
|
ILSFREQ = "Fréquences ILS",
|
||||||
|
OUTERNDB = "Fréquences Outer NDB",
|
||||||
|
INNERNDB = "Fréquences Inner NDB",
|
||||||
|
VORFREQ = "Fréquences VOR",
|
||||||
|
VORFREQTTS = "Fréquences V O R",
|
||||||
|
TACANCH = "Canal TACAN %d",
|
||||||
|
RSBNCH = "Canal RSBN",
|
||||||
|
PRMGCH = "Canal PRMG",
|
||||||
|
ADVISE = "Informez le contrôle que vous avez copié l'information",
|
||||||
|
STATUTE = "Statute Miles",
|
||||||
|
DEGREES = "Degré celcius",
|
||||||
|
FAHRENHEIT = "Degré Fahrenheit",
|
||||||
|
INCHHG = "Pouces de mercure",
|
||||||
|
MMHG = "Millimètres de mercure",
|
||||||
|
HECTO = "Hectopascals",
|
||||||
|
METERSPER = "Mètres par seconde",
|
||||||
|
TACAN = "TAKAN",
|
||||||
|
FARP = "FARPE",
|
||||||
|
DELIMITER = "Décimal", -- decimal delimiter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -897,6 +961,7 @@ ATIS.version = "1.0.0"
|
|||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- TODO: Correct fog for elevation.
|
-- TODO: Correct fog for elevation.
|
||||||
|
-- TODO: Generalize sound files input to be able to use custom made sounds.
|
||||||
-- DONE: Option to add multiple frequencies for SRS
|
-- DONE: Option to add multiple frequencies for SRS
|
||||||
-- DONE: Zulu time --> Zulu in output.
|
-- DONE: Zulu time --> Zulu in output.
|
||||||
-- DONE: Fix for AB not having a runway - Helopost like Naqoura
|
-- DONE: Fix for AB not having a runway - Helopost like Naqoura
|
||||||
@@ -1056,7 +1121,7 @@ end
|
|||||||
-- @return #ATIS self
|
-- @return #ATIS self
|
||||||
function ATIS:_InitLocalization()
|
function ATIS:_InitLocalization()
|
||||||
self:T(self.lid.."_InitLocalization")
|
self:T(self.lid.."_InitLocalization")
|
||||||
self.gettext = TEXTANDSOUND:New("AWACS","en") -- Core.TextAndSound#TEXTANDSOUND
|
self.gettext = TEXTANDSOUND:New("ATIS","en") -- Core.TextAndSound#TEXTANDSOUND
|
||||||
self.locale = "en"
|
self.locale = "en"
|
||||||
for locale,table in pairs(self.Messages) do
|
for locale,table in pairs(self.Messages) do
|
||||||
local Locale = string.lower(tostring(locale))
|
local Locale = string.lower(tostring(locale))
|
||||||
@@ -1078,16 +1143,74 @@ function ATIS:SetLocale(locale)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set sound files folder within miz file.
|
--- Set sound files folder within miz file (not your local hard drive!).
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #string path Path for sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!
|
-- @param #string pathMain Path to folder containing main sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!
|
||||||
|
-- @param #string pathAirports Path folder containing the airport names sound files. Default is `"ATIS Soundfiles/<Map Name>"`, *e.g.* `"ATIS Soundfiles/Caucasus/"`.
|
||||||
|
-- @param #string pathNato Path folder containing the NATO alphabet sound files. Default is "ATIS Soundfiles/NATO Alphabet/".
|
||||||
-- @return #ATIS self
|
-- @return #ATIS self
|
||||||
function ATIS:SetSoundfilesPath( path )
|
function ATIS:SetSoundfilesPath( pathMain, pathAirports, pathNato )
|
||||||
self.soundpath = tostring( path or "ATIS Soundfiles/" )
|
self.soundpath = tostring( pathMain or "ATIS Soundfiles/" )
|
||||||
|
if pathAirports==nil then
|
||||||
|
self.soundpathAirports=self.soundpath..env.mission.theatre.."/"
|
||||||
|
else
|
||||||
|
self.soundpathAirports=pathAirports
|
||||||
|
end
|
||||||
|
if pathNato==nil then
|
||||||
|
self.soundpathNato=self.soundpath.."NATO Alphabet/"
|
||||||
|
else
|
||||||
|
self.soundpathNato=pathNato
|
||||||
|
end
|
||||||
self:T( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) )
|
self:T( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set the path to the csv file that contains information about the used sound files.
|
||||||
|
-- The parameter file has to be located on your local disk (**not** inside the miz file).
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string csvfile Full path to the csv file on your local disk.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetSoundfilesInfo( csvfile )
|
||||||
|
|
||||||
|
--- Local function to return the ATIS.Soundfile for a given file name
|
||||||
|
local function getSound(filename)
|
||||||
|
for key,_soundfile in pairs(self.Sound) do
|
||||||
|
local soundfile=_soundfile --#ATIS.Soundfile
|
||||||
|
if filename==soundfile.filename then
|
||||||
|
return soundfile
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Read csv file
|
||||||
|
local data=UTILS.ReadCSV(csvfile)
|
||||||
|
|
||||||
|
if data then
|
||||||
|
|
||||||
|
for i,sound in pairs(data) do
|
||||||
|
|
||||||
|
-- Get the ATIS.Soundfile
|
||||||
|
local soundfile=getSound(sound.filename..".ogg") --#ATIS.Soundfile
|
||||||
|
|
||||||
|
if soundfile then
|
||||||
|
|
||||||
|
-- Set duration
|
||||||
|
soundfile.duration=tonumber(sound.duration)
|
||||||
|
|
||||||
|
else
|
||||||
|
self:E(string.format("ERROR: Could not get info for sound file %s", sound.filename))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:E(string.format("ERROR: Could not read sound csv file!"))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set airborne unit (airplane or helicopter), used to transmit radio messages including subtitles.
|
--- Set airborne unit (airplane or helicopter), used to transmit radio messages including subtitles.
|
||||||
-- Best is to place the unit on a parking spot of the airbase and set it to *uncontrolled* in the mission editor.
|
-- Best is to place the unit on a parking spot of the airbase and set it to *uncontrolled* in the mission editor.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
@@ -1538,13 +1661,13 @@ end
|
|||||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
||||||
--if PathToSRS or MSRS.path then
|
--if PathToSRS or MSRS.path then
|
||||||
self.useSRS=true
|
self.useSRS=true
|
||||||
|
|
||||||
local path = PathToSRS or MSRS.path
|
local path = PathToSRS or MSRS.path
|
||||||
local gender = Gender or MSRS.gender
|
local gender = Gender or MSRS.gender
|
||||||
local culture = Culture or MSRS.culture
|
local culture = Culture or MSRS.culture
|
||||||
local voice = Voice or MSRS.voice
|
local voice = Voice or MSRS.voice
|
||||||
local port = Port or MSRS.port or 5002
|
local port = Port or MSRS.port or 5002
|
||||||
|
|
||||||
self.msrs=MSRS:New(path, self.frequency, self.modulation)
|
self.msrs=MSRS:New(path, self.frequency, self.modulation)
|
||||||
self.msrs:SetGender(gender)
|
self.msrs:SetGender(gender)
|
||||||
self.msrs:SetCulture(culture)
|
self.msrs:SetCulture(culture)
|
||||||
@@ -1653,16 +1776,16 @@ function ATIS:onafterStart( From, Event, To )
|
|||||||
self.radioqueue:SetRadioPower( self.power )
|
self.radioqueue:SetRadioPower( self.power )
|
||||||
|
|
||||||
-- Init numbers.
|
-- Init numbers.
|
||||||
self.radioqueue:SetDigit( 0, ATIS.Sound.N0.filename, ATIS.Sound.N0.duration, self.soundpath )
|
self.radioqueue:SetDigit( 0, self.Sound.N0.filename, self.Sound.N0.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 1, ATIS.Sound.N1.filename, ATIS.Sound.N1.duration, self.soundpath )
|
self.radioqueue:SetDigit( 1, self.Sound.N1.filename, self.Sound.N1.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 2, ATIS.Sound.N2.filename, ATIS.Sound.N2.duration, self.soundpath )
|
self.radioqueue:SetDigit( 2, self.Sound.N2.filename, self.Sound.N2.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 3, ATIS.Sound.N3.filename, ATIS.Sound.N3.duration, self.soundpath )
|
self.radioqueue:SetDigit( 3, self.Sound.N3.filename, self.Sound.N3.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 4, ATIS.Sound.N4.filename, ATIS.Sound.N4.duration, self.soundpath )
|
self.radioqueue:SetDigit( 4, self.Sound.N4.filename, self.Sound.N4.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 5, ATIS.Sound.N5.filename, ATIS.Sound.N5.duration, self.soundpath )
|
self.radioqueue:SetDigit( 5, self.Sound.N5.filename, self.Sound.N5.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 6, ATIS.Sound.N6.filename, ATIS.Sound.N6.duration, self.soundpath )
|
self.radioqueue:SetDigit( 6, self.Sound.N6.filename, self.Sound.N6.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 7, ATIS.Sound.N7.filename, ATIS.Sound.N7.duration, self.soundpath )
|
self.radioqueue:SetDigit( 7, self.Sound.N7.filename, self.Sound.N7.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 8, ATIS.Sound.N8.filename, ATIS.Sound.N8.duration, self.soundpath )
|
self.radioqueue:SetDigit( 8, self.Sound.N8.filename, self.Sound.N8.duration, self.soundpath )
|
||||||
self.radioqueue:SetDigit( 9, ATIS.Sound.N9.filename, ATIS.Sound.N9.duration, self.soundpath )
|
self.radioqueue:SetDigit( 9, self.Sound.N9.filename, self.Sound.N9.duration, self.soundpath )
|
||||||
|
|
||||||
-- Start radio queue.
|
-- Start radio queue.
|
||||||
self.radioqueue:Start( 1, 0.1 )
|
self.radioqueue:Start( 1, 0.1 )
|
||||||
@@ -1909,20 +2032,28 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--------------------------
|
--------------------------
|
||||||
--- Sunrise and Sunset ---
|
--- Sunrise and Sunset ---
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
local hours = self.gettext:GetEntry("HOURS",self.locale)
|
local hours = self.gettext:GetEntry("HOURS",self.locale)
|
||||||
local sunrise = coord:GetSunrise()
|
local sunrise = coord:GetSunrise()
|
||||||
sunrise = UTILS.Split( sunrise, ":" )
|
--self:I(sunrise)
|
||||||
local SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] )
|
local SUNRISE = "no time"
|
||||||
if self.useSRS then
|
if tostring(sunrise) ~= "N/S" and tostring(sunrise) ~= "N/R" then
|
||||||
SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours )
|
sunrise = UTILS.Split( sunrise, ":" )
|
||||||
|
SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] )
|
||||||
|
if self.useSRS then
|
||||||
|
SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local sunset = coord:GetSunset()
|
local sunset = coord:GetSunset()
|
||||||
sunset = UTILS.Split( sunset, ":" )
|
--self:I(sunset)
|
||||||
local SUNSET = string.format( "%s%s", sunset[1], sunset[2] )
|
local SUNSET = "no time"
|
||||||
if self.useSRS then
|
if tostring(sunset) ~= "N/S" and tostring(sunset) ~= "N/R" then
|
||||||
SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours )
|
sunset = UTILS.Split( sunset, ":" )
|
||||||
|
SUNSET = string.format( "%s%s", sunset[1], sunset[2] )
|
||||||
|
if self.useSRS then
|
||||||
|
SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------
|
---------------------------------
|
||||||
@@ -2006,14 +2137,79 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
local cloudbase = clouds.base
|
local cloudbase = clouds.base
|
||||||
local cloudceil = clouds.base + clouds.thickness
|
local cloudceil = clouds.base + clouds.thickness
|
||||||
local clouddens = clouds.density
|
local clouddens = clouds.density
|
||||||
|
|
||||||
-- Cloud preset (DCS 2.7)
|
-- Cloud preset (DCS 2.7)
|
||||||
local cloudspreset = clouds.preset or "Nothing"
|
local cloudspreset = clouds.preset or "Nothing"
|
||||||
|
|
||||||
-- Precepitation: 0=None, 1=Rain, 2=Thunderstorm, 3=Snow, 4=Snowstorm.
|
-- Precepitation: 0=None, 1=Rain, 2=Thunderstorm, 3=Snow, 4=Snowstorm.
|
||||||
local precepitation = 0
|
local precepitation = 0
|
||||||
|
|
||||||
if cloudspreset:find( "Preset10" ) then
|
if cloudspreset:find( "RainyPreset1" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 9
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset2" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 9
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset3" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 9
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset4" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 5
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset5" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 5
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset6" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 5
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
-- NEWRAINPRESET4
|
||||||
|
elseif cloudspreset:find( "NEWRAINPRESET4" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 5
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "RainyPreset" ) then
|
||||||
|
-- Overcast + Rain
|
||||||
|
clouddens = 9
|
||||||
|
if temperature > 5 then
|
||||||
|
precepitation = 1 -- rain
|
||||||
|
else
|
||||||
|
precepitation = 3 -- snow
|
||||||
|
end
|
||||||
|
elseif cloudspreset:find( "Preset10" ) then
|
||||||
-- Scattered 5
|
-- Scattered 5
|
||||||
clouddens = 4
|
clouddens = 4
|
||||||
elseif cloudspreset:find( "Preset11" ) then
|
elseif cloudspreset:find( "Preset11" ) then
|
||||||
@@ -2094,38 +2290,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
elseif cloudspreset:find( "Preset9" ) then
|
elseif cloudspreset:find( "Preset9" ) then
|
||||||
-- Scattered 4
|
-- Scattered 4
|
||||||
clouddens = 4
|
clouddens = 4
|
||||||
elseif cloudspreset:find( "RainyPreset" ) then
|
else
|
||||||
-- Overcast + Rain
|
self:E(string.format("WARNING! Unknown weather preset: %s", tostring(cloudspreset)))
|
||||||
clouddens = 9
|
|
||||||
if temperature > 5 then
|
|
||||||
precepitation = 1 -- rain
|
|
||||||
else
|
|
||||||
precepitation = 3 -- snow
|
|
||||||
end
|
|
||||||
elseif cloudspreset:find( "RainyPreset1" ) then
|
|
||||||
-- Overcast + Rain
|
|
||||||
clouddens = 9
|
|
||||||
if temperature > 5 then
|
|
||||||
precepitation = 1 -- rain
|
|
||||||
else
|
|
||||||
precepitation = 3 -- snow
|
|
||||||
end
|
|
||||||
elseif cloudspreset:find( "RainyPreset2" ) then
|
|
||||||
-- Overcast + Rain
|
|
||||||
clouddens = 9
|
|
||||||
if temperature > 5 then
|
|
||||||
precepitation = 1 -- rain
|
|
||||||
else
|
|
||||||
precepitation = 3 -- snow
|
|
||||||
end
|
|
||||||
elseif cloudspreset:find( "RainyPreset3" ) then
|
|
||||||
-- Overcast + Rain
|
|
||||||
clouddens = 9
|
|
||||||
if temperature > 5 then
|
|
||||||
precepitation = 1 -- rain
|
|
||||||
else
|
|
||||||
precepitation = 3 -- snow
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local CLOUDBASE = string.format( "%d", UTILS.MetersToFeet( cloudbase ) )
|
local CLOUDBASE = string.format( "%d", UTILS.MetersToFeet( cloudbase ) )
|
||||||
@@ -2147,36 +2313,36 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
|
|
||||||
-- No cloud info for dynamic weather.
|
-- No cloud info for dynamic weather.
|
||||||
local CloudCover = {} -- #ATIS.Soundfile
|
local CloudCover = {} -- #ATIS.Soundfile
|
||||||
CloudCover = ATIS.Sound.CloudsNotAvailable
|
CloudCover = self.Sound.CloudsNotAvailable
|
||||||
--local CLOUDSsub = "Cloud coverage information not available"
|
--local CLOUDSsub = "Cloud coverage information not available"
|
||||||
local CLOUDSsub = self.gettext:GetEntry("NOCLOUDINFO",self.locale)
|
local CLOUDSsub = self.gettext:GetEntry("NOCLOUDINFO",self.locale)
|
||||||
-- Only valid for static weather.
|
-- Only valid for static weather.
|
||||||
if static then
|
if static then
|
||||||
if clouddens >= 9 then
|
if clouddens >= 9 then
|
||||||
-- Overcast 9,10
|
-- Overcast 9,10
|
||||||
CloudCover = ATIS.Sound.CloudsOvercast
|
CloudCover = self.Sound.CloudsOvercast
|
||||||
--CLOUDSsub = "Overcast"
|
--CLOUDSsub = "Overcast"
|
||||||
CLOUDSsub = self.gettext:GetEntry("OVERCAST",self.locale)
|
CLOUDSsub = self.gettext:GetEntry("OVERCAST",self.locale)
|
||||||
elseif clouddens >= 7 then
|
elseif clouddens >= 7 then
|
||||||
-- Broken 7,8
|
-- Broken 7,8
|
||||||
CloudCover = ATIS.Sound.CloudsBroken
|
CloudCover = self.Sound.CloudsBroken
|
||||||
--CLOUDSsub = "Broken clouds"
|
--CLOUDSsub = "Broken clouds"
|
||||||
CLOUDSsub = self.gettext:GetEntry("BROKEN",self.locale)
|
CLOUDSsub = self.gettext:GetEntry("BROKEN",self.locale)
|
||||||
elseif clouddens >= 4 then
|
elseif clouddens >= 4 then
|
||||||
-- Scattered 4,5,6
|
-- Scattered 4,5,6
|
||||||
CloudCover = ATIS.Sound.CloudsScattered
|
CloudCover = self.Sound.CloudsScattered
|
||||||
--CLOUDSsub = "Scattered clouds"
|
--CLOUDSsub = "Scattered clouds"
|
||||||
CLOUDSsub = self.gettext:GetEntry("SCATTERED",self.locale)
|
CLOUDSsub = self.gettext:GetEntry("SCATTERED",self.locale)
|
||||||
elseif clouddens >= 1 then
|
elseif clouddens >= 1 then
|
||||||
-- Few 1,2,3
|
-- Few 1,2,3
|
||||||
CloudCover = ATIS.Sound.CloudsFew
|
CloudCover = self.Sound.CloudsFew
|
||||||
--CLOUDSsub = "Few clouds"
|
--CLOUDSsub = "Few clouds"
|
||||||
CLOUDSsub = self.gettext:GetEntry("FEWCLOUDS",self.locale)
|
CLOUDSsub = self.gettext:GetEntry("FEWCLOUDS",self.locale)
|
||||||
else
|
else
|
||||||
-- No clouds
|
-- No clouds
|
||||||
CLOUDBASE = nil
|
CLOUDBASE = nil
|
||||||
CLOUDCEIL = nil
|
CLOUDCEIL = nil
|
||||||
CloudCover = ATIS.Sound.CloudsNo
|
CloudCover = self.Sound.CloudsNo
|
||||||
--CLOUDSsub = "No clouds"
|
--CLOUDSsub = "No clouds"
|
||||||
CLOUDSsub = self.gettext:GetEntry("NOCLOUDS",self.locale)
|
CLOUDSsub = self.gettext:GetEntry("NOCLOUDS",self.locale)
|
||||||
end
|
end
|
||||||
@@ -2200,7 +2366,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
--self:I(string.format( "%s/%s.ogg", self.theatre, self.airbasename ))
|
--self:I(string.format( "%s/%s.ogg", self.theatre, self.airbasename ))
|
||||||
self.radioqueue:NewTransmission( string.format( "%s/%s.ogg", self.theatre, self.airbasename ), 3.0, self.soundpath, nil, nil, subtitle, self.subduration )
|
self.radioqueue:NewTransmission( string.format( "%s.ogg", self.airbasename ), 3.0, self.soundpathAirports, nil, nil, subtitle, self.subduration )
|
||||||
end
|
end
|
||||||
local alltext = subtitle
|
local alltext = subtitle
|
||||||
|
|
||||||
@@ -2210,8 +2376,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
subtitle = string.format( "%s %s", information, NATO )
|
subtitle = string.format( "%s %s", information, NATO )
|
||||||
local _INFORMATION = subtitle
|
local _INFORMATION = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Information, 0.5, subtitle )
|
self:Transmission( self.Sound.Information, 0.5, subtitle )
|
||||||
self.radioqueue:NewTransmission( string.format( "NATO Alphabet/%s.ogg", NATO ), 0.75, self.soundpath )
|
self.radioqueue:NewTransmission( string.format( "%s.ogg", NATO ), 0.75, self.soundpathNato )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
@@ -2219,7 +2385,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
subtitle = string.format( "%s Zulu", ZULU )
|
subtitle = string.format( "%s Zulu", ZULU )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self.radioqueue:Number2Transmission( ZULU, nil, 0.5 )
|
self.radioqueue:Number2Transmission( ZULU, nil, 0.5 )
|
||||||
self:Transmission( ATIS.Sound.Zulu, 0.2, subtitle )
|
self:Transmission( self.Sound.Zulu, 0.2, subtitle )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
@@ -2230,9 +2396,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Sunrise at %s local time", SUNRISE )
|
--subtitle = string.format( "Sunrise at %s local time", SUNRISE )
|
||||||
subtitle = string.format( sunrise, SUNRISE )
|
subtitle = string.format( sunrise, SUNRISE )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.SunriseAt, 0.5, subtitle )
|
self:Transmission( self.Sound.SunriseAt, 0.5, subtitle )
|
||||||
self.radioqueue:Number2Transmission( SUNRISE, nil, 0.2 )
|
self.radioqueue:Number2Transmission( SUNRISE, nil, 0.2 )
|
||||||
self:Transmission( ATIS.Sound.TimeLocal, 0.2 )
|
self:Transmission( self.Sound.TimeLocal, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
@@ -2241,9 +2407,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Sunset at %s local time", SUNSET )
|
--subtitle = string.format( "Sunset at %s local time", SUNSET )
|
||||||
subtitle = string.format( sunset, SUNSET )
|
subtitle = string.format( sunset, SUNSET )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.SunsetAt, 0.5, subtitle )
|
self:Transmission( self.Sound.SunsetAt, 0.5, subtitle )
|
||||||
self.radioqueue:Number2Transmission( SUNSET, nil, 0.5 )
|
self.radioqueue:Number2Transmission( SUNSET, nil, 0.5 )
|
||||||
self:Transmission( ATIS.Sound.TimeLocal, 0.2 )
|
self:Transmission( self.Sound.TimeLocal, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2268,17 +2434,17 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
local _WIND = subtitle
|
local _WIND = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.WindFrom, 1.0, subtitle )
|
self:Transmission( self.Sound.WindFrom, 1.0, subtitle )
|
||||||
self.radioqueue:Number2Transmission( WINDFROM )
|
self.radioqueue:Number2Transmission( WINDFROM )
|
||||||
self:Transmission( ATIS.Sound.At, 0.2 )
|
self:Transmission( self.Sound.At, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( WINDSPEED )
|
self.radioqueue:Number2Transmission( WINDSPEED )
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.MetersPerSecond, 0.2 )
|
self:Transmission( self.Sound.MetersPerSecond, 0.2 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.Knots, 0.2 )
|
self:Transmission( self.Sound.Knots, 0.2 )
|
||||||
end
|
end
|
||||||
if turbulence > 0 then
|
if turbulence > 0 then
|
||||||
self:Transmission( ATIS.Sound.Gusting, 0.2 )
|
self:Transmission( self.Sound.Gusting, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2294,12 +2460,12 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
subtitle = string.format( visi, VISIBILITY )
|
subtitle = string.format( visi, VISIBILITY )
|
||||||
end
|
end
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Visibilty, 1.0, subtitle )
|
self:Transmission( self.Sound.Visibilty, 1.0, subtitle )
|
||||||
self.radioqueue:Number2Transmission( VISIBILITY )
|
self.radioqueue:Number2Transmission( VISIBILITY )
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.Kilometers, 0.2 )
|
self:Transmission( self.Sound.Kilometers, 0.2 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.StatuteMiles, 0.2 )
|
self:Transmission( self.Sound.StatuteMiles, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2350,21 +2516,21 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Weather phenomena: %s", wpsub )
|
--subtitle = string.format( "Weather phenomena: %s", wpsub )
|
||||||
subtitle = string.format( "%s: %s", phenos, wpsub )
|
subtitle = string.format( "%s: %s", phenos, wpsub )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.WeatherPhenomena, 1.0, subtitle )
|
self:Transmission( self.Sound.WeatherPhenomena, 1.0, subtitle )
|
||||||
if precepitation == 1 then
|
if precepitation == 1 then
|
||||||
self:Transmission( ATIS.Sound.Rain, 0.5 )
|
self:Transmission( self.Sound.Rain, 0.5 )
|
||||||
elseif precepitation == 2 then
|
elseif precepitation == 2 then
|
||||||
self:Transmission( ATIS.Sound.ThunderStorm, 0.5 )
|
self:Transmission( self.Sound.ThunderStorm, 0.5 )
|
||||||
elseif precepitation == 3 then
|
elseif precepitation == 3 then
|
||||||
self:Transmission( ATIS.Sound.Snow, 0.5 )
|
self:Transmission( self.Sound.Snow, 0.5 )
|
||||||
elseif precepitation == 4 then
|
elseif precepitation == 4 then
|
||||||
self:Transmission( ATIS.Sound.SnowStorm, 0.5 )
|
self:Transmission( self.Sound.SnowStorm, 0.5 )
|
||||||
end
|
end
|
||||||
if fog then
|
if fog then
|
||||||
self:Transmission( ATIS.Sound.Fog, 0.5 )
|
self:Transmission( self.Sound.Fog, 0.5 )
|
||||||
end
|
end
|
||||||
if dust then
|
if dust then
|
||||||
self:Transmission( ATIS.Sound.Dust, 0.5 )
|
self:Transmission( self.Sound.Dust, 0.5 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2390,29 +2556,29 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
subtitle = string.format( cloudbase, cbase, cceil )
|
subtitle = string.format( cloudbase, cbase, cceil )
|
||||||
end
|
end
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.CloudBase, 1.0, subtitle )
|
self:Transmission( self.Sound.CloudBase, 1.0, subtitle )
|
||||||
if tonumber( CLOUDBASE1000 ) > 0 then
|
if tonumber( CLOUDBASE1000 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( CLOUDBASE1000 )
|
self.radioqueue:Number2Transmission( CLOUDBASE1000 )
|
||||||
self:Transmission( ATIS.Sound.Thousand, 0.1 )
|
self:Transmission( self.Sound.Thousand, 0.1 )
|
||||||
end
|
end
|
||||||
if tonumber( CLOUDBASE0100 ) > 0 then
|
if tonumber( CLOUDBASE0100 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( CLOUDBASE0100 )
|
self.radioqueue:Number2Transmission( CLOUDBASE0100 )
|
||||||
self:Transmission( ATIS.Sound.Hundred, 0.1 )
|
self:Transmission( self.Sound.Hundred, 0.1 )
|
||||||
end
|
end
|
||||||
-- Ceiling
|
-- Ceiling
|
||||||
self:Transmission( ATIS.Sound.CloudCeiling, 0.5 )
|
self:Transmission( self.Sound.CloudCeiling, 0.5 )
|
||||||
if tonumber( CLOUDCEIL1000 ) > 0 then
|
if tonumber( CLOUDCEIL1000 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( CLOUDCEIL1000 )
|
self.radioqueue:Number2Transmission( CLOUDCEIL1000 )
|
||||||
self:Transmission( ATIS.Sound.Thousand, 0.1 )
|
self:Transmission( self.Sound.Thousand, 0.1 )
|
||||||
end
|
end
|
||||||
if tonumber( CLOUDCEIL0100 ) > 0 then
|
if tonumber( CLOUDCEIL0100 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( CLOUDCEIL0100 )
|
self.radioqueue:Number2Transmission( CLOUDCEIL0100 )
|
||||||
self:Transmission( ATIS.Sound.Hundred, 0.1 )
|
self:Transmission( self.Sound.Hundred, 0.1 )
|
||||||
end
|
end
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.Meters, 0.1 )
|
self:Transmission( self.Sound.Meters, 0.1 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.Feet, 0.1 )
|
self:Transmission( self.Sound.Feet, 0.1 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2440,15 +2606,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
local _TEMPERATURE = subtitle
|
local _TEMPERATURE = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Temperature, 1.0, subtitle )
|
self:Transmission( self.Sound.Temperature, 1.0, subtitle )
|
||||||
if temperature < 0 then
|
if temperature < 0 then
|
||||||
self:Transmission( ATIS.Sound.Minus, 0.2 )
|
self:Transmission( self.Sound.Minus, 0.2 )
|
||||||
end
|
end
|
||||||
self.radioqueue:Number2Transmission( TEMPERATURE )
|
self.radioqueue:Number2Transmission( TEMPERATURE )
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
self:Transmission( ATIS.Sound.DegreesFahrenheit, 0.2 )
|
self:Transmission( self.Sound.DegreesFahrenheit, 0.2 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
self:Transmission( self.Sound.DegreesCelsius, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2474,15 +2640,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
local _DEWPOINT = subtitle
|
local _DEWPOINT = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.DewPoint, 1.0, subtitle )
|
self:Transmission( self.Sound.DewPoint, 1.0, subtitle )
|
||||||
if dewpoint < 0 then
|
if dewpoint < 0 then
|
||||||
self:Transmission( ATIS.Sound.Minus, 0.2 )
|
self:Transmission( self.Sound.Minus, 0.2 )
|
||||||
end
|
end
|
||||||
self.radioqueue:Number2Transmission( DEWPOINT )
|
self.radioqueue:Number2Transmission( DEWPOINT )
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
self:Transmission( ATIS.Sound.DegreesFahrenheit, 0.2 )
|
self:Transmission( self.Sound.DegreesFahrenheit, 0.2 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
self:Transmission( self.Sound.DegreesCelsius, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2529,33 +2695,33 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
|
|
||||||
local _ALTIMETER = subtitle
|
local _ALTIMETER = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Altimeter, 1.0, subtitle )
|
self:Transmission( self.Sound.Altimeter, 1.0, subtitle )
|
||||||
if not self.qnhonly then
|
if not self.qnhonly then
|
||||||
self:Transmission( ATIS.Sound.QNH, 0.5 )
|
self:Transmission( self.Sound.QNH, 0.5 )
|
||||||
end
|
end
|
||||||
self.radioqueue:Number2Transmission( QNH[1] )
|
self.radioqueue:Number2Transmission( QNH[1] )
|
||||||
|
|
||||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
end
|
end
|
||||||
self.radioqueue:Number2Transmission( QNH[2] )
|
self.radioqueue:Number2Transmission( QNH[2] )
|
||||||
|
|
||||||
if not self.qnhonly then
|
if not self.qnhonly then
|
||||||
self:Transmission( ATIS.Sound.QFE, 0.75 )
|
self:Transmission( self.Sound.QFE, 0.75 )
|
||||||
self.radioqueue:Number2Transmission( QFE[1] )
|
self.radioqueue:Number2Transmission( QFE[1] )
|
||||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
end
|
end
|
||||||
self.radioqueue:Number2Transmission( QFE[2] )
|
self.radioqueue:Number2Transmission( QFE[2] )
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.PmmHg then
|
if self.PmmHg then
|
||||||
self:Transmission( ATIS.Sound.MillimetersOfMercury, 0.1 )
|
self:Transmission( self.Sound.MillimetersOfMercury, 0.1 )
|
||||||
else
|
else
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.HectoPascal, 0.1 )
|
self:Transmission( self.Sound.HectoPascal, 0.1 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.InchesOfMercury, 0.1 )
|
self:Transmission( self.Sound.InchesOfMercury, 0.1 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2566,41 +2732,55 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
if not self.ATISforFARPs then
|
if not self.ATISforFARPs then
|
||||||
-- Active runway.
|
-- Active runway.
|
||||||
local subtitle = ""
|
local subtitle = ""
|
||||||
if runwayLanding then
|
if runwayLanding and runwayLanding ~= runwayTakeoff then
|
||||||
|
|
||||||
local actrun = self.gettext:GetEntry("ACTIVELANDING",self.locale)
|
local actrun = self.gettext:GetEntry("ACTIVELANDING",self.locale)
|
||||||
--subtitle=string.format("Active runway landing %s", runwayLanding)
|
|
||||||
subtitle=string.format("%s %s", actrun, runwayLanding)
|
subtitle=string.format("%s %s", actrun, runwayLanding)
|
||||||
if rwyLandingLeft==true then
|
if rwyLandingLeft==true then
|
||||||
--subtitle=subtitle.." Left"
|
|
||||||
subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale)
|
subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale)
|
||||||
elseif rwyLandingLeft==false then
|
elseif rwyLandingLeft==false then
|
||||||
--subtitle=subtitle.." Right"
|
|
||||||
subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale)
|
subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale)
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
|
||||||
|
if not self.useSRS then
|
||||||
|
self:Transmission(self.Sound.ActiveRunwayArrival, 1.0, subtitle)
|
||||||
|
self.radioqueue:Number2Transmission(runwayLanding)
|
||||||
|
if rwyLandingLeft==true then
|
||||||
|
self:Transmission(self.Sound.Left, 0.2)
|
||||||
|
elseif rwyLandingLeft==false then
|
||||||
|
self:Transmission(self.Sound.Right, 0.2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
if runwayTakeoff then
|
if runwayTakeoff then
|
||||||
|
|
||||||
local actrun = self.gettext:GetEntry("ACTIVERUN",self.locale)
|
local actrun = self.gettext:GetEntry("ACTIVERUN",self.locale)
|
||||||
--subtitle=string.format("Active runway %s", runwayLanding)
|
|
||||||
subtitle=string.format("%s %s", actrun, runwayTakeoff)
|
subtitle=string.format("%s %s", actrun, runwayTakeoff)
|
||||||
if rwyTakeoffLeft==true then
|
if rwyTakeoffLeft==true then
|
||||||
--subtitle=subtitle.." Left"
|
|
||||||
subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale)
|
subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale)
|
||||||
elseif rwyTakeoffLeft==false then
|
elseif rwyTakeoffLeft==false then
|
||||||
--subtitle=subtitle.." Right"
|
|
||||||
subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale)
|
subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale)
|
||||||
end
|
end
|
||||||
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
|
if not self.useSRS then
|
||||||
|
self:Transmission(self.Sound.ActiveRunwayDeparture, 1.0, subtitle)
|
||||||
|
self.radioqueue:Number2Transmission(runwayTakeoff)
|
||||||
|
if rwyTakeoffLeft==true then
|
||||||
|
self:Transmission(self.Sound.Left, 0.2)
|
||||||
|
elseif rwyTakeoffLeft==false then
|
||||||
|
self:Transmission(self.Sound.Right, 0.2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
_RUNACT = subtitle
|
_RUNACT = subtitle
|
||||||
if not self.useSRS then
|
|
||||||
self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle)
|
|
||||||
self.radioqueue:Number2Transmission(runwayLanding)
|
|
||||||
if rwyLandingLeft==true then
|
|
||||||
self:Transmission(ATIS.Sound.Left, 0.2)
|
|
||||||
elseif rwyLandingLeft==false then
|
|
||||||
self:Transmission(ATIS.Sound.Right, 0.2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
-- Runway length.
|
-- Runway length.
|
||||||
@@ -2629,31 +2809,32 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
|
|
||||||
-- Transmit.
|
-- Transmit.
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.RunwayLength, 1.0, subtitle )
|
self:Transmission( self.Sound.RunwayLength, 1.0, subtitle )
|
||||||
if tonumber( L1000 ) > 0 then
|
if tonumber( L1000 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( L1000 )
|
self.radioqueue:Number2Transmission( L1000 )
|
||||||
self:Transmission( ATIS.Sound.Thousand, 0.1 )
|
self:Transmission( self.Sound.Thousand, 0.1 )
|
||||||
end
|
end
|
||||||
if tonumber( L0100 ) > 0 then
|
if tonumber( L0100 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( L0100 )
|
self.radioqueue:Number2Transmission( L0100 )
|
||||||
self:Transmission( ATIS.Sound.Hundred, 0.1 )
|
self:Transmission( self.Sound.Hundred, 0.1 )
|
||||||
end
|
end
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.Meters, 0.1 )
|
self:Transmission( self.Sound.Meters, 0.1 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.Feet, 0.1 )
|
self:Transmission( self.Sound.Feet, 0.1 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Airfield elevation
|
-- Airfield elevation
|
||||||
if self.elevation then
|
if self.elevation then
|
||||||
|
|
||||||
local elev = self.gettext:GetEntry("ELEVATION",self.locale)
|
local elev = self.gettext:GetEntry("ELEVATION",self.locale)
|
||||||
local meters = self.gettext:GetEntry("METERS",self.locale)
|
local meters = self.gettext:GetEntry("METERS",self.locale)
|
||||||
local feet = self.gettext:GetEntry("FEET",self.locale)
|
local feet = self.gettext:GetEntry("FEET",self.locale)
|
||||||
|
|
||||||
local elevation = self.airbase:GetHeight()
|
local elevation = self.airbase:GetHeight()
|
||||||
if not self.metric then
|
if not self.metric then
|
||||||
elevation = UTILS.MetersToFeet( elevation )
|
elevation = UTILS.MetersToFeet( elevation )
|
||||||
@@ -2673,19 +2854,19 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
|
|
||||||
-- Transmit.
|
-- Transmit.
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Elevation, 1.0, subtitle )
|
self:Transmission( self.Sound.Elevation, 1.0, subtitle )
|
||||||
if tonumber( L1000 ) > 0 then
|
if tonumber( L1000 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( L1000 )
|
self.radioqueue:Number2Transmission( L1000 )
|
||||||
self:Transmission( ATIS.Sound.Thousand, 0.1 )
|
self:Transmission( self.Sound.Thousand, 0.1 )
|
||||||
end
|
end
|
||||||
if tonumber( L0100 ) > 0 then
|
if tonumber( L0100 ) > 0 then
|
||||||
self.radioqueue:Number2Transmission( L0100 )
|
self.radioqueue:Number2Transmission( L0100 )
|
||||||
self:Transmission( ATIS.Sound.Hundred, 0.1 )
|
self:Transmission( self.Sound.Hundred, 0.1 )
|
||||||
end
|
end
|
||||||
if self.metric then
|
if self.metric then
|
||||||
self:Transmission( ATIS.Sound.Meters, 0.1 )
|
self:Transmission( self.Sound.Meters, 0.1 )
|
||||||
else
|
else
|
||||||
self:Transmission( ATIS.Sound.Feet, 0.1 )
|
self:Transmission( self.Sound.Feet, 0.1 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2704,16 +2885,16 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Tower frequency %s", freqs )
|
--subtitle = string.format( "Tower frequency %s", freqs )
|
||||||
subtitle = string.format( "%s %s", twrfrq, freqs )
|
subtitle = string.format( "%s %s", twrfrq, freqs )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.TowerFrequency, 1.0, subtitle )
|
self:Transmission( self.Sound.TowerFrequency, 1.0, subtitle )
|
||||||
for _, freq in pairs( self.towerfrequency ) do
|
for _, freq in pairs( self.towerfrequency ) do
|
||||||
local f = string.format( "%.3f", freq )
|
local f = string.format( "%.3f", freq )
|
||||||
f = UTILS.Split( f, "." )
|
f = UTILS.Split( f, "." )
|
||||||
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
||||||
if tonumber( f[2] ) > 0 then
|
if tonumber( f[2] ) > 0 then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( f[2] )
|
self.radioqueue:Number2Transmission( f[2] )
|
||||||
end
|
end
|
||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( self.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2726,15 +2907,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "ILS frequency %.2f MHz", ils.frequency )
|
--subtitle = string.format( "ILS frequency %.2f MHz", ils.frequency )
|
||||||
subtitle = string.format( "%s %.2f MHz", ilstxt, ils.frequency )
|
subtitle = string.format( "%s %.2f MHz", ilstxt, ils.frequency )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.ILSFrequency, 1.0, subtitle )
|
self:Transmission( self.Sound.ILSFrequency, 1.0, subtitle )
|
||||||
local f = string.format( "%.2f", ils.frequency )
|
local f = string.format( "%.2f", ils.frequency )
|
||||||
f = UTILS.Split( f, "." )
|
f = UTILS.Split( f, "." )
|
||||||
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
||||||
if tonumber( f[2] ) > 0 then
|
if tonumber( f[2] ) > 0 then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( f[2] )
|
self.radioqueue:Number2Transmission( f[2] )
|
||||||
end
|
end
|
||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( self.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2746,15 +2927,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Outer NDB frequency %.2f MHz", ndb.frequency )
|
--subtitle = string.format( "Outer NDB frequency %.2f MHz", ndb.frequency )
|
||||||
subtitle = string.format( "%s %.2f MHz", ndbtxt, ndb.frequency )
|
subtitle = string.format( "%s %.2f MHz", ndbtxt, ndb.frequency )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.OuterNDBFrequency, 1.0, subtitle )
|
self:Transmission( self.Sound.OuterNDBFrequency, 1.0, subtitle )
|
||||||
local f = string.format( "%.2f", ndb.frequency )
|
local f = string.format( "%.2f", ndb.frequency )
|
||||||
f = UTILS.Split( f, "." )
|
f = UTILS.Split( f, "." )
|
||||||
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
||||||
if tonumber( f[2] ) > 0 then
|
if tonumber( f[2] ) > 0 then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( f[2] )
|
self.radioqueue:Number2Transmission( f[2] )
|
||||||
end
|
end
|
||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( self.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2766,15 +2947,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Inner NDB frequency %.2f MHz", ndb.frequency )
|
--subtitle = string.format( "Inner NDB frequency %.2f MHz", ndb.frequency )
|
||||||
subtitle = string.format( "%s %.2f MHz", ndbtxt, ndb.frequency )
|
subtitle = string.format( "%s %.2f MHz", ndbtxt, ndb.frequency )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.InnerNDBFrequency, 1.0, subtitle )
|
self:Transmission( self.Sound.InnerNDBFrequency, 1.0, subtitle )
|
||||||
local f = string.format( "%.2f", ndb.frequency )
|
local f = string.format( "%.2f", ndb.frequency )
|
||||||
f = UTILS.Split( f, "." )
|
f = UTILS.Split( f, "." )
|
||||||
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
||||||
if tonumber( f[2] ) > 0 then
|
if tonumber( f[2] ) > 0 then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( f[2] )
|
self.radioqueue:Number2Transmission( f[2] )
|
||||||
end
|
end
|
||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( self.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2790,15 +2971,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
subtitle = string.format( "%s %.2f MHz", vorttstxt, self.vor )
|
subtitle = string.format( "%s %.2f MHz", vorttstxt, self.vor )
|
||||||
end
|
end
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.VORFrequency, 1.0, subtitle )
|
self:Transmission( self.Sound.VORFrequency, 1.0, subtitle )
|
||||||
local f = string.format( "%.2f", self.vor )
|
local f = string.format( "%.2f", self.vor )
|
||||||
f = UTILS.Split( f, "." )
|
f = UTILS.Split( f, "." )
|
||||||
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
self.radioqueue:Number2Transmission( f[1], nil, 0.5 )
|
||||||
if tonumber( f[2] ) > 0 then
|
if tonumber( f[2] ) > 0 then
|
||||||
self:Transmission( ATIS.Sound.Decimal, 0.2 )
|
self:Transmission( self.Sound.Decimal, 0.2 )
|
||||||
self.radioqueue:Number2Transmission( f[2] )
|
self.radioqueue:Number2Transmission( f[2] )
|
||||||
end
|
end
|
||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( self.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2809,9 +2990,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle=string.format("TACAN channel %dX Ray", self.tacan)
|
--subtitle=string.format("TACAN channel %dX Ray", self.tacan)
|
||||||
subtitle=string.format(tactxt, self.tacan)
|
subtitle=string.format(tactxt, self.tacan)
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.TACANChannel, 1.0, subtitle )
|
self:Transmission( self.Sound.TACANChannel, 1.0, subtitle )
|
||||||
self.radioqueue:Number2Transmission( tostring( self.tacan ), nil, 0.2 )
|
self.radioqueue:Number2Transmission( tostring( self.tacan ), nil, 0.2 )
|
||||||
self.radioqueue:NewTransmission( "NATO Alphabet/Xray.ogg", 0.75, self.soundpath, nil, 0.2 )
|
self.radioqueue:NewTransmission( "Xray.ogg", 0.75, self.soundpathNato, nil, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
@@ -2822,7 +3003,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "RSBN channel %d", self.rsbn )
|
--subtitle = string.format( "RSBN channel %d", self.rsbn )
|
||||||
subtitle = string.format( "%s %d", rsbntxt, self.rsbn )
|
subtitle = string.format( "%s %d", rsbntxt, self.rsbn )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.RSBNChannel, 1.0, subtitle )
|
self:Transmission( self.Sound.RSBNChannel, 1.0, subtitle )
|
||||||
self.radioqueue:Number2Transmission( tostring( self.rsbn ), nil, 0.2 )
|
self.radioqueue:Number2Transmission( tostring( self.rsbn ), nil, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2835,7 +3016,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "PRMG channel %d", ndb.frequency )
|
--subtitle = string.format( "PRMG channel %d", ndb.frequency )
|
||||||
subtitle = string.format( "%s %d", prmtxt, ndb.frequency )
|
subtitle = string.format( "%s %d", prmtxt, ndb.frequency )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.PRMGChannel, 1.0, subtitle )
|
self:Transmission( self.Sound.PRMGChannel, 1.0, subtitle )
|
||||||
self.radioqueue:Number2Transmission( tostring( ndb.frequency ), nil, 0.5 )
|
self.radioqueue:Number2Transmission( tostring( ndb.frequency ), nil, 0.5 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
@@ -2851,8 +3032,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
--subtitle = string.format( "Advise on initial contact, you have information %s", NATO )
|
--subtitle = string.format( "Advise on initial contact, you have information %s", NATO )
|
||||||
subtitle = string.format( "%s %s", advtxt, NATO )
|
subtitle = string.format( "%s %s", advtxt, NATO )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.AdviceOnInitial, 0.5, subtitle )
|
self:Transmission( self.Sound.AdviceOnInitial, 0.5, subtitle )
|
||||||
self.radioqueue:NewTransmission( string.format( "NATO Alphabet/%s.ogg", NATO ), 0.75, self.soundpath )
|
self.radioqueue:NewTransmission( string.format( "%s.ogg", NATO ), 0.75, self.soundpathNato )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
@@ -2891,8 +3072,8 @@ function ATIS:onafterReport( From, Event, To, Text )
|
|||||||
local emes = self.gettext:GetEntry("METERSPER",self.locale)
|
local emes = self.gettext:GetEntry("METERSPER",self.locale)
|
||||||
local tacan = self.gettext:GetEntry("TACAN",self.locale)
|
local tacan = self.gettext:GetEntry("TACAN",self.locale)
|
||||||
local farp = self.gettext:GetEntry("FARP",self.locale)
|
local farp = self.gettext:GetEntry("FARP",self.locale)
|
||||||
|
|
||||||
|
|
||||||
local text = string.gsub( text, "SM", statute )
|
local text = string.gsub( text, "SM", statute )
|
||||||
text = string.gsub( text, "°C", degc )
|
text = string.gsub( text, "°C", degc )
|
||||||
text = string.gsub( text, "°F", degf )
|
text = string.gsub( text, "°F", degf )
|
||||||
@@ -2902,13 +3083,13 @@ function ATIS:onafterReport( From, Event, To, Text )
|
|||||||
text = string.gsub( text, "m/s", emes )
|
text = string.gsub( text, "m/s", emes )
|
||||||
text = string.gsub( text, "TACAN", tacan )
|
text = string.gsub( text, "TACAN", tacan )
|
||||||
text = string.gsub( text, "FARP", farp )
|
text = string.gsub( text, "FARP", farp )
|
||||||
|
|
||||||
local delimiter = self.gettext:GetEntry("DELIMITER",self.locale)
|
local delimiter = self.gettext:GetEntry("DELIMITER",self.locale)
|
||||||
|
|
||||||
if string.lower(self.locale) ~= "en" then
|
if string.lower(self.locale) ~= "en" then
|
||||||
text = string.gsub(text,"(%d+)(%.)(%d+)","%1 "..delimiter.." %3")
|
text = string.gsub(text,"(%d+)(%.)(%d+)","%1 "..delimiter.." %3")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Replace ";" by "."
|
-- Replace ";" by "."
|
||||||
local text = string.gsub( text, ";", " . " )
|
local text = string.gsub( text, ";", " . " )
|
||||||
|
|
||||||
@@ -2916,7 +3097,7 @@ function ATIS:onafterReport( From, Event, To, Text )
|
|||||||
self:T( "SRS TTS: " .. text )
|
self:T( "SRS TTS: " .. text )
|
||||||
|
|
||||||
-- Play text-to-speech report.
|
-- Play text-to-speech report.
|
||||||
local duration = STTS.getSpeechTime(text,0.95)
|
local duration = MSRS.getSpeechTime(text,0.95)
|
||||||
self.msrsQ:NewTransmission(text,duration,self.msrs,nil,2)
|
self.msrsQ:NewTransmission(text,duration,self.msrs,nil,2)
|
||||||
--self.msrs:PlayText( text )
|
--self.msrs:PlayText( text )
|
||||||
self.SRSText = text
|
self.SRSText = text
|
||||||
@@ -3107,7 +3288,7 @@ end
|
|||||||
-- @param #ATIS.Soundfile sound ATIS sound object.
|
-- @param #ATIS.Soundfile sound ATIS sound object.
|
||||||
-- @param #number interval Interval in seconds after the last transmission finished.
|
-- @param #number interval Interval in seconds after the last transmission finished.
|
||||||
-- @param #string subtitle Subtitle of the transmission.
|
-- @param #string subtitle Subtitle of the transmission.
|
||||||
-- @param #string path Path to sound file. Default self.soundpath.
|
-- @param #string path Path to sound file. Default `self.soundpath`.
|
||||||
function ATIS:Transmission( sound, interval, subtitle, path )
|
function ATIS:Transmission( sound, interval, subtitle, path )
|
||||||
self.radioqueue:NewTransmission( sound.filename, sound.duration, path or self.soundpath, nil, interval, subtitle, self.subduration )
|
self.radioqueue:NewTransmission( sound.filename, sound.duration, path or self.soundpath, nil, interval, subtitle, self.subduration )
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1041,6 +1041,9 @@ function AIRWING:onafterStatus(From, Event, To)
|
|||||||
|
|
||||||
-- Check Recon missions.
|
-- Check Recon missions.
|
||||||
self:CheckRECON()
|
self:CheckRECON()
|
||||||
|
|
||||||
|
-- Display tactival overview.
|
||||||
|
self:_TacticalOverview()
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
-- Transport ---
|
-- Transport ---
|
||||||
|
|||||||
@@ -3623,6 +3623,7 @@ function AIRBOSS:onafterStart( From, Event, To )
|
|||||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._PlayerLeft )
|
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._PlayerLeft )
|
||||||
self:HandleEvent( EVENTS.MissionEnd )
|
self:HandleEvent( EVENTS.MissionEnd )
|
||||||
self:HandleEvent( EVENTS.RemoveUnit )
|
self:HandleEvent( EVENTS.RemoveUnit )
|
||||||
|
self:HandleEvent( EVENTS.UnitLost, self.OnEventRemoveUnit )
|
||||||
|
|
||||||
-- self.StatusScheduler=SCHEDULER:New(self)
|
-- self.StatusScheduler=SCHEDULER:New(self)
|
||||||
-- self.StatusScheduler:Schedule(self, self._Status, {}, 1, 0.5)
|
-- self.StatusScheduler:Schedule(self, self._Status, {}, 1, 0.5)
|
||||||
@@ -14679,7 +14680,7 @@ function AIRBOSS:_GetPlayerUnitAndName( _unitName )
|
|||||||
-- Get DCS unit from its name.
|
-- Get DCS unit from its name.
|
||||||
local DCSunit = Unit.getByName( _unitName )
|
local DCSunit = Unit.getByName( _unitName )
|
||||||
|
|
||||||
if DCSunit then
|
if DCSunit and DCSunit.getPlayerName then
|
||||||
|
|
||||||
-- Get player name if any.
|
-- Get player name if any.
|
||||||
local playername = DCSunit:getPlayerName()
|
local playername = DCSunit:getPlayerName()
|
||||||
@@ -15650,7 +15651,7 @@ function AIRBOSS:_Number2Sound( playerData, sender, number, delay )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Split string into characters.
|
-- Split string into characters.
|
||||||
local numbers = _split( number )
|
local numbers = _split( tostring(number) )
|
||||||
|
|
||||||
local wait = 0
|
local wait = 0
|
||||||
for i = 1, #numbers do
|
for i = 1, #numbers do
|
||||||
@@ -15718,7 +15719,7 @@ function AIRBOSS:_Number2Radio( radio, number, delay, interval, pilotcall )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Split string into characters.
|
-- Split string into characters.
|
||||||
local numbers = _split( number )
|
local numbers = _split( tostring(number) )
|
||||||
|
|
||||||
local wait = 0
|
local wait = 0
|
||||||
for i = 1, #numbers do
|
for i = 1, #numbers do
|
||||||
@@ -18086,7 +18087,7 @@ function AIRBOSS:_MarkCaseZones( _unitName, flare )
|
|||||||
self:_GetZoneArcIn( case ):FlareZone( FLARECOLOR.White, 45 )
|
self:_GetZoneArcIn( case ):FlareZone( FLARECOLOR.White, 45 )
|
||||||
text = text .. "\n* arc turn in with WHITE flares"
|
text = text .. "\n* arc turn in with WHITE flares"
|
||||||
self:_GetZoneArcOut( case ):FlareZone( FLARECOLOR.White, 45 )
|
self:_GetZoneArcOut( case ):FlareZone( FLARECOLOR.White, 45 )
|
||||||
text = text .. "\n* arc trun out with WHITE flares"
|
text = text .. "\n* arc turn out with WHITE flares"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -18138,7 +18139,7 @@ function AIRBOSS:_MarkCaseZones( _unitName, flare )
|
|||||||
self:_GetZoneArcIn( case ):SmokeZone( SMOKECOLOR.Blue, 45 )
|
self:_GetZoneArcIn( case ):SmokeZone( SMOKECOLOR.Blue, 45 )
|
||||||
text = text .. "\n* arc turn in with BLUE smoke"
|
text = text .. "\n* arc turn in with BLUE smoke"
|
||||||
self:_GetZoneArcOut( case ):SmokeZone( SMOKECOLOR.Blue, 45 )
|
self:_GetZoneArcOut( case ):SmokeZone( SMOKECOLOR.Blue, 45 )
|
||||||
text = text .. "\n* arc trun out with BLUE smoke"
|
text = text .. "\n* arc turn out with BLUE smoke"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ function ARMYGROUP:New(group)
|
|||||||
self:HandleEvent(EVENTS.Birth, self.OnEventBirth)
|
self:HandleEvent(EVENTS.Birth, self.OnEventBirth)
|
||||||
self:HandleEvent(EVENTS.Dead, self.OnEventDead)
|
self:HandleEvent(EVENTS.Dead, self.OnEventDead)
|
||||||
self:HandleEvent(EVENTS.RemoveUnit, self.OnEventRemoveUnit)
|
self:HandleEvent(EVENTS.RemoveUnit, self.OnEventRemoveUnit)
|
||||||
|
self:HandleEvent(EVENTS.UnitLost, self.OnEventRemoveUnit)
|
||||||
self:HandleEvent(EVENTS.Hit, self.OnEventHit)
|
self:HandleEvent(EVENTS.Hit, self.OnEventHit)
|
||||||
|
|
||||||
-- Start the status monitoring.
|
-- Start the status monitoring.
|
||||||
|
|||||||
@@ -93,6 +93,7 @@
|
|||||||
-- @field #number engageWeaponType Weapon type used.
|
-- @field #number engageWeaponType Weapon type used.
|
||||||
-- @field #number engageWeaponExpend How many weapons are used.
|
-- @field #number engageWeaponExpend How many weapons are used.
|
||||||
-- @field #boolean engageAsGroup Group attack.
|
-- @field #boolean engageAsGroup Group attack.
|
||||||
|
-- @field #number engageLength Length of engage (carpet or strafing) in meters.
|
||||||
-- @field #number engageMaxDistance Max engage distance.
|
-- @field #number engageMaxDistance Max engage distance.
|
||||||
-- @field #number refuelSystem Refuel type (boom or probe) for TANKER missions.
|
-- @field #number refuelSystem Refuel type (boom or probe) for TANKER missions.
|
||||||
--
|
--
|
||||||
@@ -239,6 +240,10 @@
|
|||||||
-- ## Bombing Carpet
|
-- ## Bombing Carpet
|
||||||
--
|
--
|
||||||
-- A carpet bombing mission can be created with the @{#AUFTRAG.NewBOMBCARPET}() function.
|
-- A carpet bombing mission can be created with the @{#AUFTRAG.NewBOMBCARPET}() function.
|
||||||
|
--
|
||||||
|
-- ## Strafing
|
||||||
|
--
|
||||||
|
-- A strafing mission can be created with the @{#AUFTRAG.NewSTRAFING}() function.
|
||||||
--
|
--
|
||||||
-- ## CAP
|
-- ## CAP
|
||||||
--
|
--
|
||||||
@@ -445,6 +450,7 @@ _AUFTRAGSNR=0
|
|||||||
-- @field #string CAPTUREZONE Capture zone mission.
|
-- @field #string CAPTUREZONE Capture zone mission.
|
||||||
-- @field #string NOTHING Nothing.
|
-- @field #string NOTHING Nothing.
|
||||||
-- @field #string PATROLRACETRACK Patrol Racetrack.
|
-- @field #string PATROLRACETRACK Patrol Racetrack.
|
||||||
|
-- @field #string STRAFING Strafing run.
|
||||||
AUFTRAG.Type={
|
AUFTRAG.Type={
|
||||||
ANTISHIP="Anti Ship",
|
ANTISHIP="Anti Ship",
|
||||||
AWACS="AWACS",
|
AWACS="AWACS",
|
||||||
@@ -491,6 +497,7 @@ AUFTRAG.Type={
|
|||||||
CAPTUREZONE="Capture Zone",
|
CAPTUREZONE="Capture Zone",
|
||||||
NOTHING="Nothing",
|
NOTHING="Nothing",
|
||||||
PATROLRACETRACK="Patrol Racetrack",
|
PATROLRACETRACK="Patrol Racetrack",
|
||||||
|
STRAFING="Strafing",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Special task description.
|
--- Special task description.
|
||||||
@@ -1062,8 +1069,10 @@ end
|
|||||||
-- @param #number Time Time in seconds to stay. Default 300 seconds.
|
-- @param #number Time Time in seconds to stay. Default 300 seconds.
|
||||||
-- @param #number Speed Speed in knots to fly to the target coordinate. Default 150kn.
|
-- @param #number Speed Speed in knots to fly to the target coordinate. Default 150kn.
|
||||||
-- @param #number MissionAlt Altitude to fly towards the mission in feet AGL. Default 1000ft.
|
-- @param #number MissionAlt Altitude to fly towards the mission in feet AGL. Default 1000ft.
|
||||||
|
-- @param #boolean CombatLanding (Optional) If true, set the Combat Landing option.
|
||||||
|
-- @param #number DirectionAfterLand (Optional) Heading after landing in degrees.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:NewLANDATCOORDINATE(Coordinate, OuterRadius, InnerRadius, Time, Speed, MissionAlt)
|
function AUFTRAG:NewLANDATCOORDINATE(Coordinate, OuterRadius, InnerRadius, Time, Speed, MissionAlt, CombatLanding, DirectionAfterLand)
|
||||||
|
|
||||||
local mission=AUFTRAG:New(AUFTRAG.Type.LANDATCOORDINATE)
|
local mission=AUFTRAG:New(AUFTRAG.Type.LANDATCOORDINATE)
|
||||||
|
|
||||||
@@ -1071,6 +1080,8 @@ function AUFTRAG:NewLANDATCOORDINATE(Coordinate, OuterRadius, InnerRadius, Time,
|
|||||||
|
|
||||||
mission.stayTime = Time or 300
|
mission.stayTime = Time or 300
|
||||||
mission.stayAt = Coordinate
|
mission.stayAt = Coordinate
|
||||||
|
mission.combatLand = CombatLanding
|
||||||
|
mission.directionAfter = DirectionAfterLand
|
||||||
self:SetMissionSpeed(Speed or 150)
|
self:SetMissionSpeed(Speed or 150)
|
||||||
self:SetMissionAltitude(MissionAlt or 1000)
|
self:SetMissionAltitude(MissionAlt or 1000)
|
||||||
|
|
||||||
@@ -1734,6 +1745,7 @@ function AUFTRAG:NewSTRIKE(Target, Altitude)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- **[AIR]** Create a BOMBING mission. Flight will drop bombs a specified coordinate.
|
--- **[AIR]** Create a BOMBING mission. Flight will drop bombs a specified coordinate.
|
||||||
|
-- See [DCS task bombing](https://wiki.hoggitworld.com/view/DCS_task_bombing).
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC or TARGET object.
|
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC or TARGET object.
|
||||||
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
||||||
@@ -1767,6 +1779,44 @@ function AUFTRAG:NewBOMBING(Target, Altitude)
|
|||||||
return mission
|
return mission
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- **[AIR]** Create a STRAFING mission. Assigns a point on the ground for which the AI will do a strafing run with guns or rockets.
|
||||||
|
-- See [DCS task strafing](https://wiki.hoggitworld.com/view/DCS_task_strafing).
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC or TARGET object.
|
||||||
|
-- @param #number Altitude Engage altitude in feet. Default 1000 ft.
|
||||||
|
-- @param #number Length The total length of the strafing target in meters. Default `nil`.
|
||||||
|
-- @return #AUFTRAG self
|
||||||
|
function AUFTRAG:NewSTRAFING(Target, Altitude, Length)
|
||||||
|
|
||||||
|
local mission=AUFTRAG:New(AUFTRAG.Type.STRAFING)
|
||||||
|
|
||||||
|
mission:_TargetFromObject(Target)
|
||||||
|
|
||||||
|
-- DCS task options:
|
||||||
|
mission.engageWeaponType=805337088 -- Corresponds to guns/cannons (805306368) + any rocket (30720). This is the default when selecting this task in the ME.
|
||||||
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
|
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 1000)
|
||||||
|
mission.engageLength=Length
|
||||||
|
|
||||||
|
-- Mission options:
|
||||||
|
mission.missionTask=ENUMS.MissionTask.GROUNDATTACK
|
||||||
|
mission.missionAltitude=mission.engageAltitude*0.8
|
||||||
|
mission.missionFraction=0.5
|
||||||
|
mission.optionROE=ENUMS.ROE.OpenFire
|
||||||
|
mission.optionROT=ENUMS.ROT.NoReaction -- No reaction is better.
|
||||||
|
|
||||||
|
-- Evaluate result after 5 min. We might need time until the bombs have dropped and targets have been detroyed.
|
||||||
|
mission.dTevaluate=5*60
|
||||||
|
|
||||||
|
mission.categories={AUFTRAG.Category.AIRCRAFT}
|
||||||
|
|
||||||
|
-- Get DCS task.
|
||||||
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
|
return mission
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- **[AIR]** Create a BOMBRUNWAY mission.
|
--- **[AIR]** Create a BOMBRUNWAY mission.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Wrapper.Airbase#AIRBASE Airdrome The airbase to bomb. This must be an airdrome (not a FARP or ship) as these to not have a runway.
|
-- @param Wrapper.Airbase#AIRBASE Airdrome The airbase to bomb. This must be an airdrome (not a FARP or ship) as these to not have a runway.
|
||||||
@@ -1821,7 +1871,7 @@ function AUFTRAG:NewBOMBCARPET(Target, Altitude, CarpetLength)
|
|||||||
mission.engageWeaponType=ENUMS.WeaponFlag.Auto
|
mission.engageWeaponType=ENUMS.WeaponFlag.Auto
|
||||||
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 25000)
|
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 25000)
|
||||||
mission.engageCarpetLength=CarpetLength or 500
|
mission.engageLength=CarpetLength or 500
|
||||||
mission.engageAsGroup=false -- Looks like this must be false or the task is not executed. It is not available in the ME anyway but in the task of the mission file.
|
mission.engageAsGroup=false -- Looks like this must be false or the task is not executed. It is not available in the ME anyway but in the task of the mission file.
|
||||||
mission.engageDirection=nil -- This is also not available in the ME.
|
mission.engageDirection=nil -- This is also not available in the ME.
|
||||||
|
|
||||||
@@ -2611,6 +2661,8 @@ function AUFTRAG:NewFromTarget(Target, MissionType)
|
|||||||
mission=self:NewBOMBING(Target, Altitude)
|
mission=self:NewBOMBING(Target, Altitude)
|
||||||
elseif MissionType==AUFTRAG.Type.BOMBRUNWAY then
|
elseif MissionType==AUFTRAG.Type.BOMBRUNWAY then
|
||||||
mission=self:NewBOMBRUNWAY(Target, Altitude)
|
mission=self:NewBOMBRUNWAY(Target, Altitude)
|
||||||
|
elseif MissionType==AUFTRAG.Type.STRAFING then
|
||||||
|
mission=self:NewSTRAFING(Target, Altitude)
|
||||||
elseif MissionType==AUFTRAG.Type.CAS then
|
elseif MissionType==AUFTRAG.Type.CAS then
|
||||||
mission=self:NewCAS(ZONE_RADIUS:New(Target:GetName(),Target:GetVec2(),1000), Altitude, Speed, Target:GetAverageCoordinate(), Heading, Leg, TargetTypes)
|
mission=self:NewCAS(ZONE_RADIUS:New(Target:GetName(),Target:GetVec2(),1000), Altitude, Speed, Target:GetAverageCoordinate(), Heading, Leg, TargetTypes)
|
||||||
elseif MissionType==AUFTRAG.Type.CASENHANCED then
|
elseif MissionType==AUFTRAG.Type.CASENHANCED then
|
||||||
@@ -5952,6 +6004,16 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local DCStask=CONTROLLABLE.TaskBombing(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType, Divebomb)
|
local DCStask=CONTROLLABLE.TaskBombing(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType, Divebomb)
|
||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
|
elseif self.type==AUFTRAG.Type.STRAFING then
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
-- STRAFING Mission --
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
local DCStask=CONTROLLABLE.TaskStrafing(nil,self:GetTargetVec2(), self.engageQuantity, self.engageLength,self.engageWeaponType,self.engageWeaponExpend,self.engageDirection,self.engageAsGroup)
|
||||||
|
|
||||||
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
elseif self.type==AUFTRAG.Type.BOMBRUNWAY then
|
elseif self.type==AUFTRAG.Type.BOMBRUNWAY then
|
||||||
|
|
||||||
@@ -5969,7 +6031,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
-- BOMBCARPET Mission --
|
-- BOMBCARPET Mission --
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
local DCStask=CONTROLLABLE.TaskCarpetBombing(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType, self.engageCarpetLength)
|
local DCStask=CONTROLLABLE.TaskCarpetBombing(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType, self.engageLength)
|
||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
@@ -6492,8 +6554,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
|
|
||||||
local DCStask={}
|
local DCStask={}
|
||||||
local Vec2 = self.stayAt:GetVec2()
|
local Vec2 = self.stayAt:GetVec2()
|
||||||
local DCStask = CONTROLLABLE.TaskLandAtVec2(nil,Vec2,self.stayTime)
|
local DCStask = CONTROLLABLE.TaskLandAtVec2(nil,Vec2,self.stayTime, self.combatLand, self.directionAfter)
|
||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
elseif self.type==AUFTRAG.Type.ONGUARD or self.type==AUFTRAG.Type.ARMOREDGUARD then
|
elseif self.type==AUFTRAG.Type.ONGUARD or self.type==AUFTRAG.Type.ARMOREDGUARD then
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- ### Author: **applevangelist**
|
-- ### Author: **applevangelist**
|
||||||
-- @date Last Update Jan 2024
|
-- @date Last Update July 2024
|
||||||
-- @module Ops.AWACS
|
-- @module Ops.AWACS
|
||||||
-- @image OPS_AWACS.jpg
|
-- @image OPS_AWACS.jpg
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ do
|
|||||||
-- @field #AWACS
|
-- @field #AWACS
|
||||||
AWACS = {
|
AWACS = {
|
||||||
ClassName = "AWACS", -- #string
|
ClassName = "AWACS", -- #string
|
||||||
version = "0.2.64", -- #string
|
version = "0.2.65", -- #string
|
||||||
lid = "", -- #string
|
lid = "", -- #string
|
||||||
coalition = coalition.side.BLUE, -- #number
|
coalition = coalition.side.BLUE, -- #number
|
||||||
coalitiontxt = "blue", -- #string
|
coalitiontxt = "blue", -- #string
|
||||||
@@ -935,7 +935,7 @@ AWACS.TaskStatus = {
|
|||||||
--@field #boolean FromAI
|
--@field #boolean FromAI
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO-List 0.2.53
|
-- TODO-List 0.2.54
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- DONE - WIP - Player tasking, VID
|
-- DONE - WIP - Player tasking, VID
|
||||||
@@ -1626,7 +1626,7 @@ function AWACS:_NewRadioEntry(TextTTS, TextScreen,GID,IsGroup,ToScreen,IsNew,Fro
|
|||||||
RadioEntry.TextScreen = TextScreen or TextTTS
|
RadioEntry.TextScreen = TextScreen or TextTTS
|
||||||
RadioEntry.GroupID = GID
|
RadioEntry.GroupID = GID
|
||||||
RadioEntry.ToScreen = ToScreen
|
RadioEntry.ToScreen = ToScreen
|
||||||
RadioEntry.Duration = STTS.getSpeechTime(TextTTS,0.95,false) or 8
|
RadioEntry.Duration = MSRS.getSpeechTime(TextTTS,0.95,false) or 8
|
||||||
RadioEntry.FromAI = FromAI
|
RadioEntry.FromAI = FromAI
|
||||||
RadioEntry.IsGroup = IsGroup
|
RadioEntry.IsGroup = IsGroup
|
||||||
if Tactical then
|
if Tactical then
|
||||||
@@ -5585,6 +5585,12 @@ function AWACS:_ThreatRangeCall(GID,Contact)
|
|||||||
local grptxt = self.gettext:GetEntry("GROUP",self.locale)
|
local grptxt = self.gettext:GetEntry("GROUP",self.locale)
|
||||||
local thrt = self.gettext:GetEntry("THREAT",self.locale)
|
local thrt = self.gettext:GetEntry("THREAT",self.locale)
|
||||||
local text = string.format("%s. %s. %s %s, %s. %s",self.callsigntxt,pilotcallsign,contacttag,grptxt, thrt, BRATExt)
|
local text = string.format("%s. %s. %s %s, %s. %s",self.callsigntxt,pilotcallsign,contacttag,grptxt, thrt, BRATExt)
|
||||||
|
-- DONE MS TTS - fix spelling out B-R-A in this case
|
||||||
|
if string.find(text,"BRAA",1,true) then
|
||||||
|
text = string.gsub(text,"BRAA","brah")
|
||||||
|
elseif string.find(text,"BRA",1,true) then
|
||||||
|
text = string.gsub(text,"BRA","brah")
|
||||||
|
end
|
||||||
if IsSub == false then
|
if IsSub == false then
|
||||||
self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true)
|
self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -491,6 +491,9 @@ function BRIGADE:onafterStatus(From, Event, To)
|
|||||||
-- Info ---
|
-- Info ---
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
-- Display tactival overview.
|
||||||
|
self:_TacticalOverview()
|
||||||
|
|
||||||
-- General info:
|
-- General info:
|
||||||
if self.verbose>=1 then
|
if self.verbose>=1 then
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
-- @image OPS_CSAR.jpg
|
-- @image OPS_CSAR.jpg
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Last Update April 2024
|
-- Last Update Sep 2024
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
-- @field #string lid Class id string for output to DCS log file.
|
-- @field #string lid Class id string for output to DCS log file.
|
||||||
-- @field #number coalition Coalition side number, e.g. `coalition.side.RED`.
|
-- @field #number coalition Coalition side number, e.g. `coalition.side.RED`.
|
||||||
-- @field Core.Set#SET_GROUP allheligroupset Set of CSAR heli groups.
|
-- @field Core.Set#SET_GROUP allheligroupset Set of CSAR heli groups.
|
||||||
|
-- @field Core.Set#SET_GROUP UserSetGroup Set of CSAR heli groups as designed by the mission designer (if any set).
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *Combat search and rescue (CSAR) are search and rescue operations that are carried out during war that are within or near combat zones.* (Wikipedia)
|
--- *Combat search and rescue (CSAR) are search and rescue operations that are carried out during war that are within or near combat zones.* (Wikipedia)
|
||||||
@@ -116,8 +117,17 @@
|
|||||||
-- mycsar.topmenuname = "CSAR" -- set the menu entry name
|
-- mycsar.topmenuname = "CSAR" -- set the menu entry name
|
||||||
-- mycsar.ADFRadioPwr = 1000 -- ADF Beacons sending with 1KW as default
|
-- mycsar.ADFRadioPwr = 1000 -- ADF Beacons sending with 1KW as default
|
||||||
-- mycsar.PilotWeight = 80 -- Loaded pilots weigh 80kgs each
|
-- mycsar.PilotWeight = 80 -- Loaded pilots weigh 80kgs each
|
||||||
|
-- mycsar.AllowIRStrobe = false -- Allow a menu item to request an IR strobe to find a downed pilot at night (requires NVGs to see it).
|
||||||
|
-- mycsar.IRStrobeRuntime = 300 -- If an IR Strobe is activated, it runs for 300 seconds (5 mins).
|
||||||
|
--
|
||||||
|
-- ## 2.1 Create own SET_GROUP to manage CTLD Pilot groups
|
||||||
|
--
|
||||||
|
-- -- Parameter: Set The SET_GROUP object created by the mission designer/user to represent the CSAR pilot groups.
|
||||||
|
-- -- Needs to be set before starting the CSAR instance.
|
||||||
|
-- local myset = SET_GROUP:New():FilterPrefixes("Helikopter"):FilterCoalitions("red"):FilterStart()
|
||||||
|
-- mycsar:SetOwnSetPilotGroups(myset)
|
||||||
--
|
--
|
||||||
-- ## 2.1 SRS Features and Other Features
|
-- ## 2.2 SRS Features and Other Features
|
||||||
--
|
--
|
||||||
-- mycsar.useSRS = false -- Set true to use FF\'s SRS integration
|
-- mycsar.useSRS = false -- Set true to use FF\'s SRS integration
|
||||||
-- mycsar.SRSPath = "C:\\Progra~1\\DCS-SimpleRadio-Standalone\\" -- adjust your own path in your SRS installation -- server(!)
|
-- mycsar.SRSPath = "C:\\Progra~1\\DCS-SimpleRadio-Standalone\\" -- adjust your own path in your SRS installation -- server(!)
|
||||||
@@ -136,6 +146,7 @@
|
|||||||
-- mycsar.csarUsePara = false -- If set to true, will use the LandingAfterEjection Event instead of Ejection. Requires mycsar.enableForAI to be set to true. --shagrat
|
-- mycsar.csarUsePara = false -- If set to true, will use the LandingAfterEjection Event instead of Ejection. Requires mycsar.enableForAI to be set to true. --shagrat
|
||||||
-- mycsar.wetfeettemplate = "man in floating thingy" -- if you use a mod to have a pilot in a rescue float, put the template name in here for wet feet spawns. Note: in conjunction with csarUsePara this might create dual ejected pilots in edge cases.
|
-- mycsar.wetfeettemplate = "man in floating thingy" -- if you use a mod to have a pilot in a rescue float, put the template name in here for wet feet spawns. Note: in conjunction with csarUsePara this might create dual ejected pilots in edge cases.
|
||||||
-- mycsar.allowbronco = false -- set to true to use the Bronco mod as a CSAR plane
|
-- mycsar.allowbronco = false -- set to true to use the Bronco mod as a CSAR plane
|
||||||
|
-- mycsar.CreateRadioBeacons = true -- set to false to disallow creating ADF radio beacons.
|
||||||
--
|
--
|
||||||
-- ## 3. Results
|
-- ## 3. Results
|
||||||
--
|
--
|
||||||
@@ -256,6 +267,10 @@ CSAR = {
|
|||||||
topmenuname = "CSAR",
|
topmenuname = "CSAR",
|
||||||
ADFRadioPwr = 1000,
|
ADFRadioPwr = 1000,
|
||||||
PilotWeight = 80,
|
PilotWeight = 80,
|
||||||
|
CreateRadioBeacons = true,
|
||||||
|
UserSetGroup = nil,
|
||||||
|
AllowIRStrobe = false,
|
||||||
|
IRStrobeRuntime = 300,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Downed pilots info.
|
--- Downed pilots info.
|
||||||
@@ -272,6 +287,7 @@ CSAR = {
|
|||||||
-- @field #number timestamp Timestamp for approach process.
|
-- @field #number timestamp Timestamp for approach process.
|
||||||
-- @field #boolean alive Group is alive or dead/rescued.
|
-- @field #boolean alive Group is alive or dead/rescued.
|
||||||
-- @field #boolean wetfeet Group is spawned over (deep) water.
|
-- @field #boolean wetfeet Group is spawned over (deep) water.
|
||||||
|
-- @field #string BeaconName Name of radio beacon - if any.
|
||||||
|
|
||||||
--- All slot / Limit settings
|
--- All slot / Limit settings
|
||||||
-- @type CSAR.AircraftType
|
-- @type CSAR.AircraftType
|
||||||
@@ -292,11 +308,12 @@ CSAR.AircraftType["AH-64D_BLK_II"] = 2
|
|||||||
CSAR.AircraftType["Bronco-OV-10A"] = 2
|
CSAR.AircraftType["Bronco-OV-10A"] = 2
|
||||||
CSAR.AircraftType["MH-60R"] = 10
|
CSAR.AircraftType["MH-60R"] = 10
|
||||||
CSAR.AircraftType["OH-6A"] = 2
|
CSAR.AircraftType["OH-6A"] = 2
|
||||||
CSAR.AircraftType["OH58D"] = 2
|
CSAR.AircraftType["OH-58D"] = 2
|
||||||
|
CSAR.AircraftType["CH-47Fbl1"] = 31
|
||||||
|
|
||||||
--- CSAR class version.
|
--- CSAR class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CSAR.version="1.0.24"
|
CSAR.version="1.0.29"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@@ -455,6 +472,9 @@ function CSAR:New(Coalition, Template, Alias)
|
|||||||
|
|
||||||
-- added 1.0.16
|
-- added 1.0.16
|
||||||
self.PilotWeight = 80
|
self.PilotWeight = 80
|
||||||
|
|
||||||
|
-- Own SET_GROUP if any
|
||||||
|
self.UserSetGroup = nil
|
||||||
|
|
||||||
-- WARNING - here\'ll be dragons
|
-- WARNING - here\'ll be dragons
|
||||||
-- for this to work you need to de-sanitize your mission environment in <DCS root>\Scripts\MissionScripting.lua
|
-- for this to work you need to de-sanitize your mission environment in <DCS root>\Scripts\MissionScripting.lua
|
||||||
@@ -633,7 +653,7 @@ end
|
|||||||
-- @param #string Playername Name of Player (if applicable)
|
-- @param #string Playername Name of Player (if applicable)
|
||||||
-- @param #boolean Wetfeet Ejected over water
|
-- @param #boolean Wetfeet Ejected over water
|
||||||
-- @return #CSAR self.
|
-- @return #CSAR self.
|
||||||
function CSAR:_CreateDownedPilotTrack(Group,Groupname,Side,OriginalUnit,Description,Typename,Frequency,Playername,Wetfeet)
|
function CSAR:_CreateDownedPilotTrack(Group,Groupname,Side,OriginalUnit,Description,Typename,Frequency,Playername,Wetfeet,BeaconName)
|
||||||
self:T({"_CreateDownedPilotTrack",Groupname,Side,OriginalUnit,Description,Typename,Frequency,Playername})
|
self:T({"_CreateDownedPilotTrack",Groupname,Side,OriginalUnit,Description,Typename,Frequency,Playername})
|
||||||
|
|
||||||
-- create new entry
|
-- create new entry
|
||||||
@@ -641,7 +661,7 @@ function CSAR:_CreateDownedPilotTrack(Group,Groupname,Side,OriginalUnit,Descript
|
|||||||
DownedPilot.desc = Description or ""
|
DownedPilot.desc = Description or ""
|
||||||
DownedPilot.frequency = Frequency or 0
|
DownedPilot.frequency = Frequency or 0
|
||||||
DownedPilot.index = self.downedpilotcounter
|
DownedPilot.index = self.downedpilotcounter
|
||||||
DownedPilot.name = Groupname or ""
|
DownedPilot.name = Groupname or Playername or ""
|
||||||
DownedPilot.originalUnit = OriginalUnit or ""
|
DownedPilot.originalUnit = OriginalUnit or ""
|
||||||
DownedPilot.player = Playername or ""
|
DownedPilot.player = Playername or ""
|
||||||
DownedPilot.side = Side or 0
|
DownedPilot.side = Side or 0
|
||||||
@@ -650,6 +670,7 @@ function CSAR:_CreateDownedPilotTrack(Group,Groupname,Side,OriginalUnit,Descript
|
|||||||
DownedPilot.timestamp = 0
|
DownedPilot.timestamp = 0
|
||||||
DownedPilot.alive = true
|
DownedPilot.alive = true
|
||||||
DownedPilot.wetfeet = Wetfeet or false
|
DownedPilot.wetfeet = Wetfeet or false
|
||||||
|
DownedPilot.BeaconName = BeaconName
|
||||||
|
|
||||||
-- Add Pilot
|
-- Add Pilot
|
||||||
local PilotTable = self.downedPilots
|
local PilotTable = self.downedPilots
|
||||||
@@ -736,7 +757,6 @@ function CSAR:_SpawnPilotInField(country,point,frequency,wetfeet)
|
|||||||
:NewWithAlias(template,alias)
|
:NewWithAlias(template,alias)
|
||||||
:InitCoalition(coalition)
|
:InitCoalition(coalition)
|
||||||
:InitCountry(country)
|
:InitCountry(country)
|
||||||
--:InitAIOnOff(pilotcacontrol)
|
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
:SpawnFromCoordinate(point)
|
:SpawnFromCoordinate(point)
|
||||||
|
|
||||||
@@ -818,8 +838,18 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local BeaconName
|
||||||
|
|
||||||
|
if _playerName then
|
||||||
|
BeaconName = _unitName..math.random(1,10000)
|
||||||
|
elseif _unitName then
|
||||||
|
BeaconName = _playerName..math.random(1,10000)
|
||||||
|
else
|
||||||
|
BeaconName = "Ghost-1-1"..math.random(1,10000)
|
||||||
|
end
|
||||||
|
|
||||||
if (_freq and _freq ~= 0) then --shagrat only add beacon if _freq is NOT 0
|
if (_freq and _freq ~= 0) then --shagrat only add beacon if _freq is NOT 0
|
||||||
self:_AddBeaconToGroup(_spawnedGroup, _freq)
|
self:_AddBeaconToGroup(_spawnedGroup, _freq, BeaconName)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:_AddSpecialOptions(_spawnedGroup)
|
self:_AddSpecialOptions(_spawnedGroup)
|
||||||
@@ -844,7 +874,7 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
|
|||||||
|
|
||||||
local _GroupName = _spawnedGroup:GetName() or _alias
|
local _GroupName = _spawnedGroup:GetName() or _alias
|
||||||
|
|
||||||
self:_CreateDownedPilotTrack(_spawnedGroup,_GroupName,_coalition,_unitName,_text,_typeName,_freq,_playerName,wetfeet)
|
self:_CreateDownedPilotTrack(_spawnedGroup,_GroupName,_coalition,_unitName,_text,_typeName,_freq,_playerName,wetfeet,BeaconName)
|
||||||
|
|
||||||
self:_InitSARForPilot(_spawnedGroup, _unitName, _freq, noMessage, _playerName) --shagrat use unitName to have the aircraft callsign / descriptive "name" etc.
|
self:_InitSARForPilot(_spawnedGroup, _unitName, _freq, noMessage, _playerName) --shagrat use unitName to have the aircraft callsign / descriptive "name" etc.
|
||||||
|
|
||||||
@@ -962,7 +992,6 @@ end
|
|||||||
-- @param Core.Point#COORDINATE Point
|
-- @param Core.Point#COORDINATE Point
|
||||||
-- @param #number Coalition Coalition.
|
-- @param #number Coalition Coalition.
|
||||||
-- @param #string Description (optional) Description.
|
-- @param #string Description (optional) Description.
|
||||||
-- @param #boolean addBeacon (optional) yes or no.
|
|
||||||
-- @param #boolean Nomessage (optional) If true, don\'t send a message to SAR.
|
-- @param #boolean Nomessage (optional) If true, don\'t send a message to SAR.
|
||||||
-- @param #string Unitname (optional) Name of the lost unit.
|
-- @param #string Unitname (optional) Name of the lost unit.
|
||||||
-- @param #string Typename (optional) Type of plane.
|
-- @param #string Typename (optional) Type of plane.
|
||||||
@@ -1792,9 +1821,6 @@ function CSAR:_DisplayMessageToSAR(_unit, _text, _time, _clear, _speak, _overrid
|
|||||||
end
|
end
|
||||||
_text = string.gsub(_text,"km"," kilometer")
|
_text = string.gsub(_text,"km"," kilometer")
|
||||||
_text = string.gsub(_text,"nm"," nautical miles")
|
_text = string.gsub(_text,"nm"," nautical miles")
|
||||||
--self.msrs:SetVoice(self.SRSVoice)
|
|
||||||
--self.SRSQueue:NewTransmission(_text,nil,self.msrs,nil,1)
|
|
||||||
--self:I("Voice = "..self.SRSVoice)
|
|
||||||
self.SRSQueue:NewTransmission(_text,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,self.SRSVoice,volume,label,coord)
|
self.SRSQueue:NewTransmission(_text,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,self.SRSVoice,volume,label,coord)
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
@@ -1855,11 +1881,11 @@ function CSAR:_DisplayActiveSAR(_unitName)
|
|||||||
else
|
else
|
||||||
distancetext = string.format("%.1fkm", _distance/1000.0)
|
distancetext = string.format("%.1fkm", _distance/1000.0)
|
||||||
end
|
end
|
||||||
if _value.frequency == 0 then--shagrat insert CASEVAC without Frequency
|
if _value.frequency == 0 or self.CreateRadioBeacons == false then--shagrat insert CASEVAC without Frequency
|
||||||
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %s ", _value.desc, _coordinatesText, distancetext) })
|
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %s ", _value.desc, _coordinatesText, distancetext) })
|
||||||
else
|
else
|
||||||
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %.2f KHz ADF - %s ", _value.desc, _coordinatesText, _value.frequency / 1000, distancetext) })
|
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %.2f KHz ADF - %s ", _value.desc, _coordinatesText, _value.frequency / 1000, distancetext) })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1940,7 +1966,7 @@ function CSAR:_SignalFlare(_unitName)
|
|||||||
else
|
else
|
||||||
_distance = string.format("%.1fkm",_closest.distance/1000)
|
_distance = string.format("%.1fkm",_closest.distance/1000)
|
||||||
end
|
end
|
||||||
local _msg = string.format("%s - Popping signal flare at your %s o\'clock. Distance %s", self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
local _msg = string.format("%s - Firing signal flare at your %s o\'clock. Distance %s", self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||||
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||||
|
|
||||||
local _coord = _closest.pilot:GetCoordinate()
|
local _coord = _closest.pilot:GetCoordinate()
|
||||||
@@ -1974,7 +2000,7 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
|
|||||||
if self.msrs:GetProvider() == MSRS.Provider.WINDOWS then
|
if self.msrs:GetProvider() == MSRS.Provider.WINDOWS then
|
||||||
voice = self.CSARVoiceMS or MSRS.Voices.Microsoft.Hedda
|
voice = self.CSARVoiceMS or MSRS.Voices.Microsoft.Hedda
|
||||||
end
|
end
|
||||||
self:F("Voice = "..voice)
|
--self:F("Voice = "..voice)
|
||||||
self.SRSQueue:NewTransmission(_message,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,voice,volume,label,self.coordinate)
|
self.SRSQueue:NewTransmission(_message,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,voice,volume,label,self.coordinate)
|
||||||
end
|
end
|
||||||
if ToScreen == true or ToScreen == nil then
|
if ToScreen == true or ToScreen == nil then
|
||||||
@@ -1988,6 +2014,41 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---(Internal) Request IR Strobe at closest downed pilot.
|
||||||
|
--@param #CSAR self
|
||||||
|
--@param #string _unitName Name of the helicopter
|
||||||
|
function CSAR:_ReqIRStrobe( _unitName )
|
||||||
|
self:T(self.lid .. " _ReqIRStrobe")
|
||||||
|
local _heli = self:_GetSARHeli(_unitName)
|
||||||
|
if _heli == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local smokedist = 8000
|
||||||
|
if smokedist < self.approachdist_far then smokedist = self.approachdist_far end
|
||||||
|
local _closest = self:_GetClosestDownedPilot(_heli)
|
||||||
|
if _closest ~= nil and _closest.pilot ~= nil and _closest.distance > 0 and _closest.distance < smokedist then
|
||||||
|
local _clockDir = self:_GetClockDirection(_heli, _closest.pilot)
|
||||||
|
local _distance = string.format("%.1fkm",_closest.distance/1000)
|
||||||
|
if _SETTINGS:IsImperial() then
|
||||||
|
_distance = string.format("%.1fnm",UTILS.MetersToNM(_closest.distance))
|
||||||
|
else
|
||||||
|
_distance = string.format("%.1fkm",_closest.distance/1000)
|
||||||
|
end
|
||||||
|
local _msg = string.format("%s - IR Strobe active at your %s o\'clock. Distance %s", self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||||
|
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||||
|
_closest.pilot:NewIRMarker(true,self.IRStrobeRuntime or 300)
|
||||||
|
else
|
||||||
|
local _distance = string.format("%.1fkm",smokedist/1000)
|
||||||
|
if _SETTINGS:IsImperial() then
|
||||||
|
_distance = string.format("%.1fnm",UTILS.MetersToNM(smokedist))
|
||||||
|
else
|
||||||
|
_distance = string.format("%.1fkm",smokedist/1000)
|
||||||
|
end
|
||||||
|
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",_distance), self.messageTime, false, false, true)
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
---(Internal) Request smoke at closest downed pilot.
|
---(Internal) Request smoke at closest downed pilot.
|
||||||
--@param #CSAR self
|
--@param #CSAR self
|
||||||
--@param #string _unitName Name of the helicopter
|
--@param #string _unitName Name of the helicopter
|
||||||
@@ -2111,12 +2172,12 @@ function CSAR:_AddMedevacMenuItem()
|
|||||||
local coalition = self.coalition
|
local coalition = self.coalition
|
||||||
local allheligroupset = self.allheligroupset -- Core.Set#SET_GROUP
|
local allheligroupset = self.allheligroupset -- Core.Set#SET_GROUP
|
||||||
local _allHeliGroups = allheligroupset:GetSetObjects()
|
local _allHeliGroups = allheligroupset:GetSetObjects()
|
||||||
|
|
||||||
-- rebuild units table
|
-- rebuild units table
|
||||||
local _UnitList = {}
|
local _UnitList = {}
|
||||||
for _key, _group in pairs (_allHeliGroups) do
|
for _key, _group in pairs (_allHeliGroups) do
|
||||||
local _unit = _group:GetUnit(1) -- Asume that there is only one unit in the flight for players
|
local _unit = _group:GetFirstUnitAlive() -- Asume that there is only one unit in the flight for players
|
||||||
if _unit then
|
if _unit then
|
||||||
|
--self:T("Unitname ".._unit:GetName().." IsAlive "..tostring(_unit:IsAlive()).." IsPlayer "..tostring(_unit:IsPlayer()))
|
||||||
if _unit:IsAlive() and _unit:IsPlayer() then
|
if _unit:IsAlive() and _unit:IsPlayer() then
|
||||||
local unitName = _unit:GetName()
|
local unitName = _unit:GetName()
|
||||||
_UnitList[unitName] = unitName
|
_UnitList[unitName] = unitName
|
||||||
@@ -2139,7 +2200,12 @@ function CSAR:_AddMedevacMenuItem()
|
|||||||
local _rootMenu1 = MENU_GROUP_COMMAND:New(_group,"List Active CSAR",_rootPath, self._DisplayActiveSAR,self,_unitName)
|
local _rootMenu1 = MENU_GROUP_COMMAND:New(_group,"List Active CSAR",_rootPath, self._DisplayActiveSAR,self,_unitName)
|
||||||
local _rootMenu2 = MENU_GROUP_COMMAND:New(_group,"Check Onboard",_rootPath, self._CheckOnboard,self,_unitName)
|
local _rootMenu2 = MENU_GROUP_COMMAND:New(_group,"Check Onboard",_rootPath, self._CheckOnboard,self,_unitName)
|
||||||
local _rootMenu3 = MENU_GROUP_COMMAND:New(_group,"Request Signal Flare",_rootPath, self._SignalFlare,self,_unitName)
|
local _rootMenu3 = MENU_GROUP_COMMAND:New(_group,"Request Signal Flare",_rootPath, self._SignalFlare,self,_unitName)
|
||||||
local _rootMenu4 = MENU_GROUP_COMMAND:New(_group,"Request Smoke",_rootPath, self._Reqsmoke,self,_unitName):Refresh()
|
local _rootMenu4 = MENU_GROUP_COMMAND:New(_group,"Request Smoke",_rootPath, self._Reqsmoke,self,_unitName)
|
||||||
|
if self.AllowIRStrobe then
|
||||||
|
local _rootMenu5 = MENU_GROUP_COMMAND:New(_group,"Request IR Strobe",_rootPath, self._ReqIRStrobe,self,_unitName):Refresh()
|
||||||
|
else
|
||||||
|
_rootMenu4:Refresh()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2230,9 +2296,13 @@ end
|
|||||||
-- @param #CSAR self
|
-- @param #CSAR self
|
||||||
-- @param Wrapper.Group#GROUP _group Group #GROUP object.
|
-- @param Wrapper.Group#GROUP _group Group #GROUP object.
|
||||||
-- @param #number _freq Frequency to use
|
-- @param #number _freq Frequency to use
|
||||||
function CSAR:_AddBeaconToGroup(_group, _freq)
|
-- @param #string _name Beacon Name to use
|
||||||
|
-- @return #CSAR self
|
||||||
|
function CSAR:_AddBeaconToGroup(_group, _freq, _name)
|
||||||
self:T(self.lid .. " _AddBeaconToGroup")
|
self:T(self.lid .. " _AddBeaconToGroup")
|
||||||
|
if self.CreateRadioBeacons == false then return end
|
||||||
local _group = _group
|
local _group = _group
|
||||||
|
|
||||||
if _group == nil then
|
if _group == nil then
|
||||||
--return frequency to pool of available
|
--return frequency to pool of available
|
||||||
for _i, _current in ipairs(self.UsedVHFFrequencies) do
|
for _i, _current in ipairs(self.UsedVHFFrequencies) do
|
||||||
@@ -2247,22 +2317,24 @@ function CSAR:_AddBeaconToGroup(_group, _freq)
|
|||||||
if _group:IsAlive() then
|
if _group:IsAlive() then
|
||||||
local _radioUnit = _group:GetUnit(1)
|
local _radioUnit = _group:GetUnit(1)
|
||||||
if _radioUnit then
|
if _radioUnit then
|
||||||
local name = _radioUnit:GetName()
|
local name = _radioUnit:GetName()
|
||||||
local Frequency = _freq -- Freq in Hertz
|
local Frequency = _freq -- Freq in Hertz
|
||||||
local name = _radioUnit:GetName()
|
local name = _radioUnit:GetName()
|
||||||
local Sound = "l10n/DEFAULT/"..self.radioSound
|
local Sound = "l10n/DEFAULT/"..self.radioSound
|
||||||
local vec3 = _radioUnit:GetVec3() or _radioUnit:GetPositionVec3() or {x=0,y=0,z=0}
|
local vec3 = _radioUnit:GetVec3() or _radioUnit:GetPositionVec3() or {x=0,y=0,z=0}
|
||||||
trigger.action.radioTransmission(Sound, vec3, 0, false, Frequency, self.ADFRadioPwr or 1000,name..math.random(1,10000)) -- Beacon in MP only runs for exactly 30secs straight
|
trigger.action.radioTransmission(Sound, vec3, 0, false, Frequency, self.ADFRadioPwr or 1000,_name) -- Beacon in MP only runs for exactly 30secs straight
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (Internal) Helper function to (re-)add beacon to downed pilot.
|
--- (Internal) Helper function to (re-)add beacon to downed pilot.
|
||||||
-- @param #CSAR self
|
-- @param #CSAR self
|
||||||
-- @param #table _args Arguments
|
-- @return #CSAR self
|
||||||
function CSAR:_RefreshRadioBeacons()
|
function CSAR:_RefreshRadioBeacons()
|
||||||
self:T(self.lid .. " _RefreshRadioBeacons")
|
self:T(self.lid .. " _RefreshRadioBeacons")
|
||||||
|
if self.CreateRadioBeacons == false then return end
|
||||||
if self:_CountActiveDownedPilots() > 0 then
|
if self:_CountActiveDownedPilots() > 0 then
|
||||||
local PilotTable = self.downedPilots
|
local PilotTable = self.downedPilots
|
||||||
for _,_pilot in pairs (PilotTable) do
|
for _,_pilot in pairs (PilotTable) do
|
||||||
@@ -2270,8 +2342,10 @@ function CSAR:_RefreshRadioBeacons()
|
|||||||
local pilot = _pilot -- #CSAR.DownedPilot
|
local pilot = _pilot -- #CSAR.DownedPilot
|
||||||
local group = pilot.group
|
local group = pilot.group
|
||||||
local frequency = pilot.frequency or 0 -- thanks to @Thrud
|
local frequency = pilot.frequency or 0 -- thanks to @Thrud
|
||||||
|
local bname = pilot.BeaconName or pilot.name..math.random(1,100000)
|
||||||
|
trigger.action.stopRadioTransmission(bname)
|
||||||
if group and group:IsAlive() and frequency > 0 then
|
if group and group:IsAlive() and frequency > 0 then
|
||||||
self:_AddBeaconToGroup(group,frequency)
|
self:_AddBeaconToGroup(group,frequency,bname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2308,6 +2382,16 @@ function CSAR:_ReachedPilotLimit()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment.
|
||||||
|
-- Needs to be set before starting the CSAR instance.
|
||||||
|
-- @param #CSAR self
|
||||||
|
-- @param Core.Set#SET_GROUP Set The SET_GROUP object created by the mission designer/user to represent the CSAR pilot groups.
|
||||||
|
-- @return #CSAR self
|
||||||
|
function CSAR:SetOwnSetPilotGroups(Set)
|
||||||
|
self.UserSetGroup = Set
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
--- FSM internal Functions ---
|
--- FSM internal Functions ---
|
||||||
------------------------------
|
------------------------------
|
||||||
@@ -2329,7 +2413,9 @@ function CSAR:onafterStart(From, Event, To)
|
|||||||
self:HandleEvent(EVENTS.PlayerEnterUnit, self._EventHandler)
|
self:HandleEvent(EVENTS.PlayerEnterUnit, self._EventHandler)
|
||||||
self:HandleEvent(EVENTS.PilotDead, self._EventHandler)
|
self:HandleEvent(EVENTS.PilotDead, self._EventHandler)
|
||||||
|
|
||||||
if self.allowbronco then
|
if self.UserSetGroup then
|
||||||
|
self.allheligroupset = self.UserSetGroup
|
||||||
|
elseif self.allowbronco then
|
||||||
local prefixes = self.csarPrefix or {}
|
local prefixes = self.csarPrefix or {}
|
||||||
self.allheligroupset = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(prefixes):FilterStart()
|
self.allheligroupset = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(prefixes):FilterStart()
|
||||||
elseif self.useprefix then
|
elseif self.useprefix then
|
||||||
@@ -2338,7 +2424,9 @@ function CSAR:onafterStart(From, Event, To)
|
|||||||
else
|
else
|
||||||
self.allheligroupset = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterCategoryHelicopter():FilterStart()
|
self.allheligroupset = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterCategoryHelicopter():FilterStart()
|
||||||
end
|
end
|
||||||
|
|
||||||
self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() -- currently only GROUP objects, maybe support STATICs also?
|
self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() -- currently only GROUP objects, maybe support STATICs also?
|
||||||
|
|
||||||
if not self.coordinate then
|
if not self.coordinate then
|
||||||
local csarhq = self.mash:GetRandom()
|
local csarhq = self.mash:GetRandom()
|
||||||
if csarhq then
|
if csarhq then
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@
|
|||||||
-- @field Ops.Commander#COMMANDER commander Commander of assigned legions.
|
-- @field Ops.Commander#COMMANDER commander Commander of assigned legions.
|
||||||
-- @field #number Nsuccess Number of successful missions.
|
-- @field #number Nsuccess Number of successful missions.
|
||||||
-- @field #number Nfailure Number of failed mission.
|
-- @field #number Nfailure Number of failed mission.
|
||||||
|
-- @field #table assetNumbers Asset numbers. Each entry is a table of data type `#CHIEF.AssetNumber`.
|
||||||
-- @extends Ops.Intel#INTEL
|
-- @extends Ops.Intel#INTEL
|
||||||
|
|
||||||
--- *In preparing for battle I have always found that plans are useless, but planning is indispensable* -- Dwight D Eisenhower
|
--- *In preparing for battle I have always found that plans are useless, but planning is indispensable* -- Dwight D Eisenhower
|
||||||
@@ -163,7 +164,7 @@
|
|||||||
--
|
--
|
||||||
-- Will at a strategic zone with importance 2.
|
-- Will at a strategic zone with importance 2.
|
||||||
--
|
--
|
||||||
-- If the zone is currently owned by another coalition and enemy ground troops are present in the zone, a CAS and an ARTY mission are lauchned:
|
-- If the zone is currently owned by another coalition and enemy ground troops are present in the zone, a CAS and an ARTY mission are launched:
|
||||||
--
|
--
|
||||||
-- * A mission of type `AUFTRAG.Type.CASENHANCED` is started if assets are available that can carry out this mission type.
|
-- * A mission of type `AUFTRAG.Type.CASENHANCED` is started if assets are available that can carry out this mission type.
|
||||||
-- * A mission of type `AUFTRAG.Type.ARTY` is started provided assets are available.
|
-- * A mission of type `AUFTRAG.Type.ARTY` is started provided assets are available.
|
||||||
@@ -331,7 +332,7 @@ CHIEF.Strategy = {
|
|||||||
|
|
||||||
--- CHIEF class version.
|
--- CHIEF class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CHIEF.version="0.6.0"
|
CHIEF.version="0.6.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -1284,8 +1285,10 @@ end
|
|||||||
--
|
--
|
||||||
-- Empty:
|
-- Empty:
|
||||||
--
|
--
|
||||||
-- * `AUFTRAG.Type.ONGURAD` with Nmin=1 and Nmax=1 assets, Attribute=`GROUP.Attribute.GROUND_TANK`.
|
-- * `AUFTRAG.Type.ONGURAD` with Nmin=0 and Nmax=1 assets, Attribute=`GROUP.Attribute.GROUND_TANK`.
|
||||||
|
-- * `AUFTRAG.Type.ONGURAD` with Nmin=0 and Nmax=1 assets, Attribute=`GROUP.Attribute.GROUND_IFV`.
|
||||||
-- * `AUFTRAG.Type.ONGUARD` with Nmin=1 and Nmax=3 assets, Attribute=`GROUP.Attribute.GROUND_INFANTRY`.
|
-- * `AUFTRAG.Type.ONGUARD` with Nmin=1 and Nmax=3 assets, Attribute=`GROUP.Attribute.GROUND_INFANTRY`.
|
||||||
|
-- * `AUFTRAG.Type.OPSTRANSPORT` with Nmin=0 and Nmax=1 assets, Attribute=`GROUP.Attribute.AIR_TRANSPORTHELO` or `GROUP.Attribute.GROUND_APC`. This asset is used to transport the infantry groups.
|
||||||
--
|
--
|
||||||
-- Resources can be created with the @{#CHIEF.CreateResource} and @{#CHIEF.AddToResource} functions.
|
-- Resources can be created with the @{#CHIEF.CreateResource} and @{#CHIEF.AddToResource} functions.
|
||||||
--
|
--
|
||||||
@@ -3033,10 +3036,13 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Recruite infantry assets.
|
-- Recruite infantry assets.
|
||||||
|
self:T(self.lid..string.format("Recruiting assets for zone %s", StratZone.opszone:GetName()))
|
||||||
self:T(self.lid.."Missiontype="..MissionType)
|
self:T(self.lid.."Missiontype="..MissionType)
|
||||||
self:T({categories=Categories})
|
self:T({categories=Categories})
|
||||||
self:T({attributes=Attributes})
|
self:T({attributes=Attributes})
|
||||||
self:T({properties=Properties})
|
self:T({properties=Properties})
|
||||||
|
|
||||||
|
|
||||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2, nil, RangeMax, nil, nil, nil, nil, Categories, Attributes, Properties)
|
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2, nil, RangeMax, nil, nil, nil, nil, Categories, Attributes, Properties)
|
||||||
|
|
||||||
if recruited then
|
if recruited then
|
||||||
@@ -3052,9 +3058,12 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
local TargetCoord = TargetZone:GetCoordinate()
|
local TargetCoord = TargetZone:GetCoordinate()
|
||||||
|
|
||||||
-- First check if we need a transportation.
|
-- First check if we need a transportation.
|
||||||
local transport=nil
|
local transport=nil --Ops.OpsTransport#OPSTRANSPORT
|
||||||
|
local Ntransports=0
|
||||||
if Resource.carrierNmin and Resource.carrierNmax and Resource.carrierNmax>0 then
|
if Resource.carrierNmin and Resource.carrierNmax and Resource.carrierNmax>0 then
|
||||||
|
|
||||||
|
self:T(self.lid..string.format("Recruiting carrier assets: Nmin=%s, Nmax=%s", tostring(Resource.carrierNmin), tostring(Resource.carrierNmax)))
|
||||||
|
|
||||||
-- Filter only those assets that shall be transported.
|
-- Filter only those assets that shall be transported.
|
||||||
local cargoassets=CHIEF._FilterAssets(assets, Resource.Categories, Resource.Attributes, Resource.Properties)
|
local cargoassets=CHIEF._FilterAssets(assets, Resource.Categories, Resource.Attributes, Resource.Properties)
|
||||||
|
|
||||||
@@ -3064,6 +3073,10 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
recruited, transport=LEGION.AssignAssetsForTransport(self.commander, self.commander.legions, cargoassets,
|
recruited, transport=LEGION.AssignAssetsForTransport(self.commander, self.commander.legions, cargoassets,
|
||||||
Resource.carrierNmin, Resource.carrierNmax, TargetZone, nil, Resource.carrierCategories, Resource.carrierAttributes, Resource.carrierProperties)
|
Resource.carrierNmin, Resource.carrierNmax, TargetZone, nil, Resource.carrierCategories, Resource.carrierAttributes, Resource.carrierProperties)
|
||||||
|
|
||||||
|
Ntransports=transport~=nil and #transport.assets or 0
|
||||||
|
|
||||||
|
self:T(self.lid..string.format("Recruited %d transport carrier assets success=%s", Ntransports, tostring(recruited)))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -3076,7 +3089,7 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Debug messgage.
|
-- Debug message
|
||||||
self:T2(self.lid..string.format("Recruited %d assets for mission %s", #assets, MissionType))
|
self:T2(self.lid..string.format("Recruited %d assets for mission %s", #assets, MissionType))
|
||||||
|
|
||||||
|
|
||||||
@@ -3224,10 +3237,13 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
-- Attach mission to ops zone.
|
-- Attach mission to ops zone.
|
||||||
StratZone.opszone:_AddMission(self.coalition, MissionType, mission)
|
StratZone.opszone:_AddMission(self.coalition, MissionType, mission)
|
||||||
|
|
||||||
|
mission:SetName(string.format("Stratzone %s-%d", StratZone.opszone:GetName(), mission.auftragsnummer))
|
||||||
|
|
||||||
-- Attach mission to resource.
|
-- Attach mission to resource.
|
||||||
Resource.mission=mission
|
Resource.mission=mission
|
||||||
|
|
||||||
if transport then
|
-- Check if transport assets could be allocated. If carrier Nmin=0 and 0 assets could be allocated, transport would still be created but not usefull obviously
|
||||||
|
if transport and Ntransports>0 then
|
||||||
-- Attach OPS transport to mission.
|
-- Attach OPS transport to mission.
|
||||||
mission.opstransport=transport
|
mission.opstransport=transport
|
||||||
-- Set ops zone to transport.
|
-- Set ops zone to transport.
|
||||||
@@ -3240,7 +3256,7 @@ function CHIEF:RecruitAssetsForZone(StratZone, Resource)
|
|||||||
else
|
else
|
||||||
|
|
||||||
-- Mission not supported.
|
-- Mission not supported.
|
||||||
self:E(self.lid..string.format("ERROR: Mission type not supported for OPSZONE! Unrecruiting assets..."))
|
self:E(self.lid..string.format("ERROR: Mission type %s not supported for OPSZONE! Unrecruiting assets...", tostring(MissionType)))
|
||||||
LEGION.UnRecruitAssets(assets)
|
LEGION.UnRecruitAssets(assets)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -577,7 +577,7 @@ function COHORT:AddAsset(Asset)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Remove asset from chort.
|
--- Remove specific asset from chort.
|
||||||
-- @param #COHORT self
|
-- @param #COHORT self
|
||||||
-- @param Functional.Warehouse#WAREHOUSE.Assetitem Asset The asset.
|
-- @param Functional.Warehouse#WAREHOUSE.Assetitem Asset The asset.
|
||||||
-- @return #COHORT self
|
-- @return #COHORT self
|
||||||
@@ -609,6 +609,40 @@ function COHORT:DelGroup(GroupName)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Remove assets from pool. Not that assets must not be spawned or already reserved or requested.
|
||||||
|
-- @param #COHORT self
|
||||||
|
-- @param #number N Number of assets to be removed. Default 1.
|
||||||
|
-- @return #COHORT self
|
||||||
|
function COHORT:RemoveAssets(N)
|
||||||
|
self:T2(self.lid..string.format("Remove %d assets of Cohort", N))
|
||||||
|
|
||||||
|
N=N or 1
|
||||||
|
|
||||||
|
local n=0
|
||||||
|
for i=#self.assets,1,-1 do
|
||||||
|
local asset=self.assets[i] --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||||
|
|
||||||
|
self:T2(self.lid..string.format("Checking removing asset %s", asset.spawngroupname))
|
||||||
|
if not (asset.requested or asset.spawned or asset.isReserved) then
|
||||||
|
self:T2(self.lid..string.format("Removing asset %s", asset.spawngroupname))
|
||||||
|
table.remove(self.assets, i)
|
||||||
|
n=n+1
|
||||||
|
else
|
||||||
|
self:T2(self.lid..string.format("Could NOT Remove asset %s", asset.spawngroupname))
|
||||||
|
end
|
||||||
|
|
||||||
|
if n>=N then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
self:T(self.lid..string.format("Removed %d/%d assets. New asset count=%d", n, N, #self.assets))
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get name of the cohort.
|
--- Get name of the cohort.
|
||||||
-- @param #COHORT self
|
-- @param #COHORT self
|
||||||
-- @return #string Name of the cohort.
|
-- @return #string Name of the cohort.
|
||||||
@@ -975,6 +1009,7 @@ function COHORT:CanMission(Mission)
|
|||||||
|
|
||||||
if Mission.refuelSystem and Mission.refuelSystem==self.tankerSystem then
|
if Mission.refuelSystem and Mission.refuelSystem==self.tankerSystem then
|
||||||
-- Correct refueling system.
|
-- Correct refueling system.
|
||||||
|
self:T(self.lid..string.format("INFO: Correct refueling system requested=%s != %s=available", tostring(Mission.refuelSystem), tostring(self.tankerSystem)))
|
||||||
else
|
else
|
||||||
self:T(self.lid..string.format("INFO: Wrong refueling system requested=%s != %s=available", tostring(Mission.refuelSystem), tostring(self.tankerSystem)))
|
self:T(self.lid..string.format("INFO: Wrong refueling system requested=%s != %s=available", tostring(Mission.refuelSystem), tostring(self.tankerSystem)))
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
--
|
--
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
-- Date: September 2023
|
-- Date: September 2023
|
||||||
|
-- Last Update: July 2024
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
--- **Ops** - Easy GCI & CAP Manager
|
--- **Ops** - Easy GCI & CAP Manager
|
||||||
@@ -65,6 +66,9 @@
|
|||||||
-- @field #boolean TankerInvisible
|
-- @field #boolean TankerInvisible
|
||||||
-- @field #number CapFormation
|
-- @field #number CapFormation
|
||||||
-- @field #table ReadyFlightGroups
|
-- @field #table ReadyFlightGroups
|
||||||
|
-- @field #boolean DespawnAfterLanding
|
||||||
|
-- @field #boolean DespawnAfterHolding
|
||||||
|
-- @field #list<Ops.Auftrag#AUFTRAG> ListOfAuftrag
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
||||||
@@ -93,7 +97,8 @@
|
|||||||
--
|
--
|
||||||
-- ### Prerequisites
|
-- ### Prerequisites
|
||||||
--
|
--
|
||||||
-- You have to put a STATIC object on the airbase with the UNIT name according to the name of the airbase. E.g. for Kuitaisi this has to have the name Kutaisi. This object symbolizes the AirWing HQ.
|
-- You have to put a **STATIC WAREHOUSE** object on the airbase with the UNIT name according to the name of the airbase. **Do not put any other static type or it creates a conflict with the airbase name!**
|
||||||
|
-- E.g. for Kuitaisi this has to have the unit name Kutaisi. This object symbolizes the AirWing HQ.
|
||||||
-- Next put a late activated template group for your CAP/GCI Squadron on the map. Last, put a zone on the map for the CAP operations, let's name it "Blue Zone 1". Size of the zone plays no role.
|
-- Next put a late activated template group for your CAP/GCI Squadron on the map. Last, put a zone on the map for the CAP operations, let's name it "Blue Zone 1". Size of the zone plays no role.
|
||||||
-- Put an EW radar system on the map and name it aptly, like "Blue EWR".
|
-- Put an EW radar system on the map and name it aptly, like "Blue EWR".
|
||||||
--
|
--
|
||||||
@@ -209,6 +214,9 @@ EASYGCICAP = {
|
|||||||
TankerInvisible = true,
|
TankerInvisible = true,
|
||||||
CapFormation = nil,
|
CapFormation = nil,
|
||||||
ReadyFlightGroups = {},
|
ReadyFlightGroups = {},
|
||||||
|
DespawnAfterLanding = false,
|
||||||
|
DespawnAfterHolding = true,
|
||||||
|
ListOfAuftrag = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Internal Squadron data type
|
--- Internal Squadron data type
|
||||||
@@ -244,7 +252,7 @@ EASYGCICAP = {
|
|||||||
|
|
||||||
--- EASYGCICAP class version.
|
--- EASYGCICAP class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
EASYGCICAP.version="0.1.10"
|
EASYGCICAP.version="0.1.13"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -292,6 +300,9 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
|||||||
self.Monitor = false
|
self.Monitor = false
|
||||||
self.TankerInvisible = true
|
self.TankerInvisible = true
|
||||||
self.CapFormation = ENUMS.Formation.FixedWing.FingerFour.Group
|
self.CapFormation = ENUMS.Formation.FixedWing.FingerFour.Group
|
||||||
|
self.DespawnAfterLanding = false
|
||||||
|
self.DespawnAfterHolding = true
|
||||||
|
self.ListOfAuftrag = {}
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- Set some string id for output to DCS.log file.
|
||||||
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
||||||
@@ -341,7 +352,7 @@ end
|
|||||||
-- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Cap-Missions + Intercept-Missions + Alert5-Missionsm default is 6
|
-- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Cap-Missions + Intercept-Missions + Alert5-Missionsm default is 6
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:SetMaxAliveMissions(Maxiumum)
|
function EASYGCICAP:SetMaxAliveMissions(Maxiumum)
|
||||||
self:T(self.lid.."SetDefaultResurrection")
|
self:T(self.lid.."SetMaxAliveMissions")
|
||||||
self.MaxAliveMissions = Maxiumum or 8
|
self.MaxAliveMissions = Maxiumum or 8
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -458,6 +469,26 @@ function EASYGCICAP:SetDefaultOverhead(Overhead)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set default despawning after landing.
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:SetDefaultDespawnAfterLanding()
|
||||||
|
self:T(self.lid.."SetDefaultDespawnAfterLanding")
|
||||||
|
self.DespawnAfterLanding = true
|
||||||
|
self.DespawnAfterHolding = false
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set default despawning after holding (despawn in air close to AFB).
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:SetDefaultDespawnAfterHolding()
|
||||||
|
self:T(self.lid.."SetDefaultDespawnAfterLanding")
|
||||||
|
self.DespawnAfterLanding = false
|
||||||
|
self.DespawnAfterHolding = true
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set CAP mission start to vary randomly between Start end End seconds.
|
--- Set CAP mission start to vary randomly between Start end End seconds.
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param #number Start
|
-- @param #number Start
|
||||||
@@ -512,6 +543,8 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
self:T(self.lid.."_AddAirwing "..Airbasename)
|
self:T(self.lid.."_AddAirwing "..Airbasename)
|
||||||
|
|
||||||
local CapFormation = self.CapFormation
|
local CapFormation = self.CapFormation
|
||||||
|
local DespawnAfterLanding = self.DespawnAfterLanding
|
||||||
|
local DespawnAfterHolding = self.DespawnAfterHolding
|
||||||
|
|
||||||
-- Create Airwing
|
-- Create Airwing
|
||||||
local CAP_Wing = AIRWING:New(Airbasename,Alias)
|
local CAP_Wing = AIRWING:New(Airbasename,Alias)
|
||||||
@@ -553,8 +586,11 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
|
|
||||||
function CAP_Wing:OnAfterFlightOnMission(From, Event, To, Flightgroup, Mission)
|
function CAP_Wing:OnAfterFlightOnMission(From, Event, To, Flightgroup, Mission)
|
||||||
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
||||||
--flightgroup:SetDespawnAfterLanding()
|
if DespawnAfterLanding then
|
||||||
flightgroup:SetDespawnAfterHolding()
|
flightgroup:SetDespawnAfterLanding()
|
||||||
|
elseif DespawnAfterHolding then
|
||||||
|
flightgroup:SetDespawnAfterHolding()
|
||||||
|
end
|
||||||
flightgroup:SetDestinationbase(AIRBASE:FindByName(Airbasename))
|
flightgroup:SetDestinationbase(AIRBASE:FindByName(Airbasename))
|
||||||
flightgroup:GetGroup():CommandEPLRS(true,5)
|
flightgroup:GetGroup():CommandEPLRS(true,5)
|
||||||
flightgroup:GetGroup():SetOptionRadarUsingForContinousSearch()
|
flightgroup:GetGroup():SetOptionRadarUsingForContinousSearch()
|
||||||
@@ -577,10 +613,11 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
flightgroup:GetGroup():OptionROTEvadeFire()
|
flightgroup:GetGroup():OptionROTEvadeFire()
|
||||||
flightgroup:SetFuelLowRTB(true)
|
flightgroup:SetFuelLowRTB(true)
|
||||||
Intel:AddAgent(flightgroup)
|
Intel:AddAgent(flightgroup)
|
||||||
function flightgroup:OnAfterHolding(From,Event,To)
|
if DespawnAfterHolding then
|
||||||
self:Despawn(1,true)
|
function flightgroup:OnAfterHolding(From,Event,To)
|
||||||
end
|
self:Despawn(1,true)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.noaltert5 > 0 then
|
if self.noaltert5 > 0 then
|
||||||
@@ -588,6 +625,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
alert:SetRequiredAssets(self.noaltert5)
|
alert:SetRequiredAssets(self.noaltert5)
|
||||||
alert:SetRepeat(99)
|
alert:SetRepeat(99)
|
||||||
CAP_Wing:AddMission(alert)
|
CAP_Wing:AddMission(alert)
|
||||||
|
table.insert(self.ListOfAuftrag,alert)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.wings[Airbasename] = { CAP_Wing, AIRBASE:FindByName(Airbasename):GetZone(), Airbasename }
|
self.wings[Airbasename] = { CAP_Wing, AIRBASE:FindByName(Airbasename):GetZone(), Airbasename }
|
||||||
@@ -1124,7 +1162,7 @@ function EASYGCICAP:_TryAssignIntercept(ReadyFlightGroups,InterceptAuftrag,Group
|
|||||||
return assigned, wingsize
|
return assigned, wingsize
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Add a zone to the rejected zones set.
|
--- Here, we'll decide if we need to launch an intercepting flight, and from where
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param Ops.Intel#INTEL.Cluster Cluster
|
-- @param Ops.Intel#INTEL.Cluster Cluster
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
@@ -1168,9 +1206,11 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
|||||||
local zone = _data[2] -- Core.Zone#ZONE
|
local zone = _data[2] -- Core.Zone#ZONE
|
||||||
local zonecoord = zone:GetCoordinate()
|
local zonecoord = zone:GetCoordinate()
|
||||||
local name = _data[3] -- #string
|
local name = _data[3] -- #string
|
||||||
|
local coa = AIRBASE:FindByName(name):GetCoalition()
|
||||||
local distance = position:DistanceFromPointVec2(zonecoord)
|
local distance = position:DistanceFromPointVec2(zonecoord)
|
||||||
local airframes = airwing:CountAssets(true)
|
local airframes = airwing:CountAssets(true)
|
||||||
if distance < bestdistance and airframes >= wingsize then
|
local samecoalitionab = coa == self.coalition and true or false
|
||||||
|
if distance < bestdistance and airframes >= wingsize and samecoalitionab == true then
|
||||||
bestdistance = distance
|
bestdistance = distance
|
||||||
targetairwing = airwing
|
targetairwing = airwing
|
||||||
targetawname = name
|
targetawname = name
|
||||||
@@ -1186,10 +1226,11 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
|||||||
local name = data.AirbaseName
|
local name = data.AirbaseName
|
||||||
local zonecoord = data.Coordinate
|
local zonecoord = data.Coordinate
|
||||||
local airwing = wings[name][1]
|
local airwing = wings[name][1]
|
||||||
|
local coa = AIRBASE:FindByName(name):GetCoalition()
|
||||||
|
local samecoalitionab = coa == self.coalition and true or false
|
||||||
local distance = position:DistanceFromPointVec2(zonecoord)
|
local distance = position:DistanceFromPointVec2(zonecoord)
|
||||||
local airframes = airwing:CountAssets(true)
|
local airframes = airwing:CountAssets(true)
|
||||||
if distance < bestdistance and airframes >= wingsize then
|
if distance < bestdistance and airframes >= wingsize and samecoalitionab == true then
|
||||||
bestdistance = distance
|
bestdistance = distance
|
||||||
targetairwing = airwing -- Ops.Airwing#AIRWING
|
targetairwing = airwing -- Ops.Airwing#AIRWING
|
||||||
targetawname = name
|
targetawname = name
|
||||||
@@ -1228,6 +1269,8 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
|||||||
nogozoneset
|
nogozoneset
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
table.insert(self.ListOfAuftrag,InterceptAuftrag)
|
||||||
local assigned, rest = self:_TryAssignIntercept(ReadyFlightGroups,InterceptAuftrag,contact.group,wingsize)
|
local assigned, rest = self:_TryAssignIntercept(ReadyFlightGroups,InterceptAuftrag,contact.group,wingsize)
|
||||||
if not assigned then
|
if not assigned then
|
||||||
InterceptAuftrag:SetRequiredAssets(rest)
|
InterceptAuftrag:SetRequiredAssets(rest)
|
||||||
@@ -1319,6 +1362,20 @@ end
|
|||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:onafterStatus(From,Event,To)
|
function EASYGCICAP:onafterStatus(From,Event,To)
|
||||||
self:T({From,Event,To})
|
self:T({From,Event,To})
|
||||||
|
-- cleanup
|
||||||
|
local cleaned = false
|
||||||
|
local cleanlist = {}
|
||||||
|
for _,_auftrag in pairs(self.ListOfAuftrag) do
|
||||||
|
local auftrag = _auftrag -- Ops.Auftrag#AUFTRAG
|
||||||
|
if auftrag and (not (auftrag:IsCancelled() or auftrag:IsDone() or auftrag:IsOver())) then
|
||||||
|
table.insert(cleanlist,auftrag)
|
||||||
|
cleaned = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if cleaned == true then
|
||||||
|
self.ListOfAuftrag = nil
|
||||||
|
self.ListOfAuftrag = cleanlist
|
||||||
|
end
|
||||||
-- Gather Some Stats
|
-- Gather Some Stats
|
||||||
local function counttable(tbl)
|
local function counttable(tbl)
|
||||||
local count = 0
|
local count = 0
|
||||||
|
|||||||
@@ -334,6 +334,9 @@ function FLEET:onafterStatus(From, Event, To)
|
|||||||
-- Info ---
|
-- Info ---
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
-- Display tactival overview.
|
||||||
|
self:_TacticalOverview()
|
||||||
|
|
||||||
-- General info:
|
-- General info:
|
||||||
if self.verbose>=1 then
|
if self.verbose>=1 then
|
||||||
|
|
||||||
|
|||||||
@@ -3815,18 +3815,9 @@ function FLIGHTGROUP:_InitGroup(Template)
|
|||||||
-- Group object.
|
-- Group object.
|
||||||
local group=self.group --Wrapper.Group#GROUP
|
local group=self.group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
-- Get template of group.
|
|
||||||
local template=Template or self:_GetTemplate()
|
|
||||||
|
|
||||||
-- Helo group.
|
-- Helo group.
|
||||||
self.isHelo=group:IsHelicopter()
|
self.isHelo=group:IsHelicopter()
|
||||||
|
|
||||||
-- Is (template) group uncontrolled.
|
|
||||||
self.isUncontrolled=template.uncontrolled
|
|
||||||
|
|
||||||
-- Is (template) group late activated.
|
|
||||||
self.isLateActivated=template.lateActivation
|
|
||||||
|
|
||||||
-- Max speed in km/h.
|
-- Max speed in km/h.
|
||||||
self.speedMax=group:GetSpeedMax()
|
self.speedMax=group:GetSpeedMax()
|
||||||
|
|
||||||
@@ -3846,25 +3837,38 @@ function FLIGHTGROUP:_InitGroup(Template)
|
|||||||
|
|
||||||
-- Group ammo.
|
-- Group ammo.
|
||||||
self.ammo=self:GetAmmoTot()
|
self.ammo=self:GetAmmoTot()
|
||||||
|
|
||||||
|
-- Get template of group.
|
||||||
|
local template=Template or self:_GetTemplate()
|
||||||
|
|
||||||
-- Radio parameters from template. Default is set on spawn if not modified by user.
|
-- Is (template) group uncontrolled.
|
||||||
self.radio.Freq=tonumber(template.frequency)
|
self.isUncontrolled=template~=nil and template.uncontrolled or false
|
||||||
self.radio.Modu=tonumber(template.modulation)
|
|
||||||
self.radio.On=template.communication
|
|
||||||
|
|
||||||
-- Set callsign. Default is set on spawn if not modified by user.
|
-- Is (template) group late activated.
|
||||||
local callsign=template.units[1].callsign
|
self.isLateActivated=template~=nil and template.lateActivation or false
|
||||||
--self:I({callsign=callsign})
|
|
||||||
if type(callsign)=="number" then -- Sometimes callsign is just "101".
|
if template then
|
||||||
local cs=tostring(callsign)
|
|
||||||
callsign={}
|
-- Radio parameters from template. Default is set on spawn if not modified by user.
|
||||||
callsign[1]=cs:sub(1,1)
|
self.radio.Freq=tonumber(template.frequency)
|
||||||
callsign[2]=cs:sub(2,2)
|
self.radio.Modu=tonumber(template.modulation)
|
||||||
callsign[3]=cs:sub(3,3)
|
self.radio.On=template.communication
|
||||||
|
|
||||||
|
-- Set callsign. Default is set on spawn if not modified by user.
|
||||||
|
local callsign=template.units[1].callsign
|
||||||
|
--self:I({callsign=callsign})
|
||||||
|
if type(callsign)=="number" then -- Sometimes callsign is just "101".
|
||||||
|
local cs=tostring(callsign)
|
||||||
|
callsign={}
|
||||||
|
callsign[1]=cs:sub(1,1)
|
||||||
|
callsign[2]=cs:sub(2,2)
|
||||||
|
callsign[3]=cs:sub(3,3)
|
||||||
|
end
|
||||||
|
self.callsign.NumberSquad=tonumber(callsign[1])
|
||||||
|
self.callsign.NumberGroup=tonumber(callsign[2])
|
||||||
|
self.callsign.NameSquad=UTILS.GetCallsignName(self.callsign.NumberSquad)
|
||||||
|
|
||||||
end
|
end
|
||||||
self.callsign.NumberSquad=tonumber(callsign[1])
|
|
||||||
self.callsign.NumberGroup=tonumber(callsign[2])
|
|
||||||
self.callsign.NameSquad=UTILS.GetCallsignName(self.callsign.NumberSquad)
|
|
||||||
|
|
||||||
-- Set default formation.
|
-- Set default formation.
|
||||||
if self.isHelo then
|
if self.isHelo then
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
-- @field #table cohorts Cohorts of this legion.
|
-- @field #table cohorts Cohorts of this legion.
|
||||||
-- @field Ops.Commander#COMMANDER commander Commander of this legion.
|
-- @field Ops.Commander#COMMANDER commander Commander of this legion.
|
||||||
-- @field Ops.Chief#CHIEF chief Chief of this legion.
|
-- @field Ops.Chief#CHIEF chief Chief of this legion.
|
||||||
|
-- @field #boolean tacview If `true`, show tactical overview on status update.
|
||||||
-- @extends Functional.Warehouse#WAREHOUSE
|
-- @extends Functional.Warehouse#WAREHOUSE
|
||||||
|
|
||||||
--- *Per aspera ad astra.*
|
--- *Per aspera ad astra.*
|
||||||
@@ -322,6 +323,14 @@ function LEGION:SetVerbosity(VerbosityLevel)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set tactical overview on.
|
||||||
|
-- @param #LEGION self
|
||||||
|
-- @return #LEGION self
|
||||||
|
function LEGION:SetTacticalOverviewOn()
|
||||||
|
self.tacview=true
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Add a mission for the legion. It will pick the best available assets for the mission and lauch it when ready.
|
--- Add a mission for the legion. It will pick the best available assets for the mission and lauch it when ready.
|
||||||
-- @param #LEGION self
|
-- @param #LEGION self
|
||||||
-- @param Ops.Auftrag#AUFTRAG Mission Mission for this legion.
|
-- @param Ops.Auftrag#AUFTRAG Mission Mission for this legion.
|
||||||
@@ -1772,7 +1781,7 @@ end
|
|||||||
-- Mission Functions
|
-- Mission Functions
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
--- Create a new flight group after an asset was spawned.
|
--- Create a new OPS group after an asset was spawned.
|
||||||
-- @param #LEGION self
|
-- @param #LEGION self
|
||||||
-- @param Functional.Warehouse#WAREHOUSE.Assetitem asset The asset.
|
-- @param Functional.Warehouse#WAREHOUSE.Assetitem asset The asset.
|
||||||
-- @return Ops.FlightGroup#FLIGHTGROUP The created flightgroup object.
|
-- @return Ops.FlightGroup#FLIGHTGROUP The created flightgroup object.
|
||||||
@@ -1836,6 +1845,53 @@ function LEGION:_CreateFlightGroup(asset)
|
|||||||
return opsgroup
|
return opsgroup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Display tactical overview.
|
||||||
|
-- @param #LEGION self
|
||||||
|
function LEGION:_TacticalOverview()
|
||||||
|
|
||||||
|
if self.tacview then
|
||||||
|
|
||||||
|
local NassetsTotal=self:CountAssets(nil)
|
||||||
|
local NassetsStock=self:CountAssets(true)
|
||||||
|
local NassetsActiv=self:CountAssets(false)
|
||||||
|
|
||||||
|
local NmissionsTotal=#self.missionqueue
|
||||||
|
local NmissionsRunni=self:CountMissionsInQueue()
|
||||||
|
|
||||||
|
-- Info message
|
||||||
|
local text=string.format("Tactical Overview %s\n", self.alias)
|
||||||
|
text=text..string.format("===================================\n")
|
||||||
|
|
||||||
|
-- Asset info.
|
||||||
|
text=text..string.format("Assets: %d [Active=%d, Stock=%d]\n", NassetsTotal, NassetsActiv, NassetsStock)
|
||||||
|
|
||||||
|
-- Mission info.
|
||||||
|
text=text..string.format("Missions: %d [Running=%d]\n", NmissionsTotal, NmissionsRunni)
|
||||||
|
for _,mtype in pairs(AUFTRAG.Type) do
|
||||||
|
local n=self:CountMissionsInQueue(mtype)
|
||||||
|
if n>0 then
|
||||||
|
local N=self:CountMissionsInQueue(mtype)
|
||||||
|
text=text..string.format(" - %s: %d [Running=%d]\n", mtype, n, N)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local Ntransports=#self.transportqueue
|
||||||
|
if Ntransports>0 then
|
||||||
|
text=text..string.format("Transports: %d\n", Ntransports)
|
||||||
|
for _,_transport in pairs(self.transportqueue) do
|
||||||
|
local transport=_transport --Ops.OpsTransport#OPSTRANSPORT
|
||||||
|
text=text..string.format(" - %s", transport:GetState())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Message to coalition.
|
||||||
|
MESSAGE:New(text, 60, nil, true):ToCoalition(self:GetCoalition())
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if an asset is currently on a mission (STARTED or EXECUTING).
|
--- Check if an asset is currently on a mission (STARTED or EXECUTING).
|
||||||
-- @param #LEGION self
|
-- @param #LEGION self
|
||||||
@@ -2563,6 +2619,8 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
|||||||
local RangeMax = RangeMax or 0
|
local RangeMax = RangeMax or 0
|
||||||
local InRange=(RangeMax and math.max(RangeMax, Rmax) or Rmax) >= TargetDistance
|
local InRange=(RangeMax and math.max(RangeMax, Rmax) or Rmax) >= TargetDistance
|
||||||
|
|
||||||
|
--env.info(string.format("Range TargetDist=%.1f Rmax=%.1f RangeMax=%.1f InRange=%s", TargetDistance, Rmax, RangeMax, tostring(InRange)))
|
||||||
|
|
||||||
return InRange
|
return InRange
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2628,7 +2686,7 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
|||||||
else
|
else
|
||||||
Cohort:T(Cohort.lid..string.format("Cohort %s cannot because of category", Cohort.name))
|
Cohort:T(Cohort.lid..string.format("Cohort %s cannot because of category", Cohort.name))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if can then
|
if can then
|
||||||
can=CheckAttribute(Cohort)
|
can=CheckAttribute(Cohort)
|
||||||
@@ -2684,7 +2742,7 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
|||||||
else
|
else
|
||||||
Cohort:T(Cohort.lid..string.format("Cohort %s cannot because of max weight", Cohort.name))
|
Cohort:T(Cohort.lid..string.format("Cohort %s cannot because of max weight", Cohort.name))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@@ -2728,6 +2786,8 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
|||||||
|
|
||||||
-- Check if cohort can do the mission.
|
-- Check if cohort can do the mission.
|
||||||
local can=LEGION._CohortCan(cohort, MissionTypeRecruit, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight)
|
local can=LEGION._CohortCan(cohort, MissionTypeRecruit, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight)
|
||||||
|
|
||||||
|
--env.info(string.format("RecruitCohortAssets %s Cohort=%s can=%s", MissionTypeRecruit, cohort:GetName(), tostring(can)))
|
||||||
|
|
||||||
-- Check OnDuty, capable, in range and refueling type (if TANKER).
|
-- Check OnDuty, capable, in range and refueling type (if TANKER).
|
||||||
if can then
|
if can then
|
||||||
@@ -2744,6 +2804,12 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Break if no assets could be found
|
||||||
|
if #Assets==0 then
|
||||||
|
--env.info(string.format("LEGION.RecruitCohortAssets: No assets could be recruited for mission type %s [Nmin=%s, Nmax=%s]", MissionTypeRecruit, tostring(NreqMin), tostring(NreqMax)))
|
||||||
|
return false, {}, {}
|
||||||
|
end
|
||||||
|
|
||||||
-- Now we have a long list with assets.
|
-- Now we have a long list with assets.
|
||||||
LEGION._OptimizeAssetSelection(Assets, MissionTypeOpt, TargetVec2, false, TotalWeight)
|
LEGION._OptimizeAssetSelection(Assets, MissionTypeOpt, TargetVec2, false, TotalWeight)
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
-- @field #number pathCorridor Path corrdidor width in meters.
|
-- @field #number pathCorridor Path corrdidor width in meters.
|
||||||
-- @field #boolean ispathfinding If true, group is currently path finding.
|
-- @field #boolean ispathfinding If true, group is currently path finding.
|
||||||
-- @field #NAVYGROUP.Target engage Engage target.
|
-- @field #NAVYGROUP.Target engage Engage target.
|
||||||
|
-- @field #boolean intowindold Use old calculation to determine heading into wind.
|
||||||
-- @extends Ops.OpsGroup#OPSGROUP
|
-- @extends Ops.OpsGroup#OPSGROUP
|
||||||
|
|
||||||
--- *Something must be left to chance; nothing is sure in a sea fight above all.* -- Horatio Nelson
|
--- *Something must be left to chance; nothing is sure in a sea fight above all.* -- Horatio Nelson
|
||||||
@@ -393,7 +394,8 @@ function NAVYGROUP:New(group)
|
|||||||
-- Handle events:
|
-- Handle events:
|
||||||
self:HandleEvent(EVENTS.Birth, self.OnEventBirth)
|
self:HandleEvent(EVENTS.Birth, self.OnEventBirth)
|
||||||
self:HandleEvent(EVENTS.Dead, self.OnEventDead)
|
self:HandleEvent(EVENTS.Dead, self.OnEventDead)
|
||||||
self:HandleEvent(EVENTS.RemoveUnit, self.OnEventRemoveUnit)
|
self:HandleEvent(EVENTS.RemoveUnit, self.OnEventRemoveUnit)
|
||||||
|
self:HandleEvent(EVENTS.UnitLost, self.OnEventRemoveUnit)
|
||||||
|
|
||||||
-- Start the status monitoring.
|
-- Start the status monitoring.
|
||||||
self.timerStatus=TIMER:New(self.Status, self):Start(1, 30)
|
self.timerStatus=TIMER:New(self.Status, self):Start(1, 30)
|
||||||
@@ -455,6 +457,18 @@ function NAVYGROUP:SetPathfindingOff()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set if old into wind calculation is used when carrier turns into the wind for a recovery.
|
||||||
|
-- @param #NAVYGROUP self
|
||||||
|
-- @param #boolean SwitchOn If `true` or `nil`, use old into wind calculation.
|
||||||
|
-- @return #NAVYGROUP self
|
||||||
|
function NAVYGROUP:SetIntoWindLegacy( SwitchOn )
|
||||||
|
if SwitchOn==nil then
|
||||||
|
SwitchOn=true
|
||||||
|
end
|
||||||
|
self.intowindold=SwitchOn
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Add a *scheduled* task.
|
--- Add a *scheduled* task.
|
||||||
-- @param #NAVYGROUP self
|
-- @param #NAVYGROUP self
|
||||||
@@ -600,6 +614,58 @@ function NAVYGROUP:AddTurnIntoWind(starttime, stoptime, speed, uturn, offset)
|
|||||||
return recovery
|
return recovery
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get "Turn Into Wind" data. You can specify a certain ID.
|
||||||
|
-- @param #NAVYGROUP self
|
||||||
|
-- @param #number TID (Optional) Turn Into wind ID. If not given, the currently open "Turn into Wind" data is return (if there is any).
|
||||||
|
-- @return #NAVYGROUP.IntoWind Turn into window data table.
|
||||||
|
function NAVYGROUP:GetTurnIntoWind(TID)
|
||||||
|
|
||||||
|
if TID then
|
||||||
|
|
||||||
|
-- Look for a specific ID.
|
||||||
|
for _,_turn in pairs(self.Qintowind) do
|
||||||
|
local turn=_turn --#NAVYGROUP.IntoWind
|
||||||
|
if turn.Id==TID then
|
||||||
|
return turn
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
-- Return currently open window.
|
||||||
|
return self.intowind
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Extend duration of turn into wind.
|
||||||
|
-- @param #NAVYGROUP self
|
||||||
|
-- @param #number Duration Duration in seconds. Default 300 sec.
|
||||||
|
-- @param #NAVYGROUP.IntoWind TurnIntoWind (Optional) Turn into window data table. If not given, the currently open one is used (if there is any).
|
||||||
|
-- @return #NAVYGROUP self
|
||||||
|
function NAVYGROUP:ExtendTurnIntoWind(Duration, TurnIntoWind)
|
||||||
|
|
||||||
|
Duration=Duration or 300
|
||||||
|
|
||||||
|
-- ID of turn or nil
|
||||||
|
local TID=TurnIntoWind and TurnIntoWind.Id or nil
|
||||||
|
|
||||||
|
-- Get turn data.
|
||||||
|
local turn=self:GetTurnIntoWind(TID)
|
||||||
|
|
||||||
|
if turn then
|
||||||
|
turn.Tstop=turn.Tstop+Duration
|
||||||
|
self:T(self.lid..string.format("Extending turn into wind by %d seconds. New stop time is %s", Duration, UTILS.SecondsToClock(turn.Tstop)))
|
||||||
|
else
|
||||||
|
self:E(self.lid.."Could not get turn into wind to extend!")
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Remove steam into wind window from queue. If the window is currently active, it is stopped first.
|
--- Remove steam into wind window from queue. If the window is currently active, it is stopped first.
|
||||||
-- @param #NAVYGROUP self
|
-- @param #NAVYGROUP self
|
||||||
-- @param #NAVYGROUP.IntoWind IntoWindData Turn into window data table.
|
-- @param #NAVYGROUP.IntoWind IntoWindData Turn into window data table.
|
||||||
@@ -2068,8 +2134,43 @@ end
|
|||||||
--- Get heading of group into the wind.
|
--- Get heading of group into the wind.
|
||||||
-- @param #NAVYGROUP self
|
-- @param #NAVYGROUP self
|
||||||
-- @param #number Offset Offset angle in degrees, e.g. to account for an angled runway.
|
-- @param #number Offset Offset angle in degrees, e.g. to account for an angled runway.
|
||||||
|
-- @param #number vdeck Desired wind speed on deck in Knots.
|
||||||
-- @return #number Carrier heading in degrees.
|
-- @return #number Carrier heading in degrees.
|
||||||
function NAVYGROUP:GetHeadingIntoWind_old(Offset)
|
-- @return #number Carrier speed in knots.
|
||||||
|
function NAVYGROUP:GetHeadingIntoWind_old(Offset, vdeck)
|
||||||
|
|
||||||
|
local function adjustDegreesForWindSpeed(windSpeed)
|
||||||
|
local degreesAdjustment = 0
|
||||||
|
-- the windspeeds are in m/s
|
||||||
|
-- +0 degrees at 15m/s = 37kts
|
||||||
|
-- +0 degrees at 14m/s = 35kts
|
||||||
|
-- +0 degrees at 13m/s = 33kts
|
||||||
|
-- +4 degrees at 12m/s = 31kts
|
||||||
|
-- +4 degrees at 11m/s = 29kts
|
||||||
|
-- +4 degrees at 10m/s = 27kts
|
||||||
|
-- +4 degrees at 9m/s = 27kts
|
||||||
|
-- +4 degrees at 8m/s = 27kts
|
||||||
|
-- +8 degrees at 7m/s = 27kts
|
||||||
|
-- +8 degrees at 6m/s = 27kts
|
||||||
|
-- +8 degrees at 5m/s = 26kts
|
||||||
|
-- +20 degrees at 4m/s = 26kts
|
||||||
|
-- +20 degrees at 3m/s = 26kts
|
||||||
|
-- +30 degrees at 2m/s = 26kts 1s
|
||||||
|
|
||||||
|
if windSpeed > 0 and windSpeed < 3 then
|
||||||
|
degreesAdjustment = 30
|
||||||
|
elseif windSpeed >= 3 and windSpeed < 5 then
|
||||||
|
degreesAdjustment = 20
|
||||||
|
elseif windSpeed >= 5 and windSpeed < 8 then
|
||||||
|
degreesAdjustment = 8
|
||||||
|
elseif windSpeed >= 8 and windSpeed < 13 then
|
||||||
|
degreesAdjustment = 4
|
||||||
|
elseif windSpeed >= 13 then
|
||||||
|
degreesAdjustment = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
return degreesAdjustment
|
||||||
|
end
|
||||||
|
|
||||||
Offset=Offset or 0
|
Offset=Offset or 0
|
||||||
|
|
||||||
@@ -2077,7 +2178,7 @@ function NAVYGROUP:GetHeadingIntoWind_old(Offset)
|
|||||||
local windfrom, vwind=self:GetWind()
|
local windfrom, vwind=self:GetWind()
|
||||||
|
|
||||||
-- Actually, we want the runway in the wind.
|
-- Actually, we want the runway in the wind.
|
||||||
local intowind=windfrom-Offset
|
local intowind = windfrom - Offset + adjustDegreesForWindSpeed(vwind)
|
||||||
|
|
||||||
-- If no wind, take current heading.
|
-- If no wind, take current heading.
|
||||||
if vwind<0.1 then
|
if vwind<0.1 then
|
||||||
@@ -2088,8 +2189,11 @@ function NAVYGROUP:GetHeadingIntoWind_old(Offset)
|
|||||||
if intowind<0 then
|
if intowind<0 then
|
||||||
intowind=intowind+360
|
intowind=intowind+360
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Speed of carrier in m/s but at least 4 knots.
|
||||||
|
local vtot = math.max(vdeck-UTILS.MpsToKnots(vwind), 4)
|
||||||
|
|
||||||
return intowind
|
return intowind, vtot
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -2099,7 +2203,8 @@ end
|
|||||||
-- @param #number Offset Offset angle in degrees, e.g. to account for an angled runway.
|
-- @param #number Offset Offset angle in degrees, e.g. to account for an angled runway.
|
||||||
-- @param #number vdeck Desired wind speed on deck in Knots.
|
-- @param #number vdeck Desired wind speed on deck in Knots.
|
||||||
-- @return #number Carrier heading in degrees.
|
-- @return #number Carrier heading in degrees.
|
||||||
function NAVYGROUP:GetHeadingIntoWind(Offset, vdeck)
|
-- @return #number Carrier speed in knots.
|
||||||
|
function NAVYGROUP:GetHeadingIntoWind_new(Offset, vdeck)
|
||||||
|
|
||||||
-- Default offset angle.
|
-- Default offset angle.
|
||||||
Offset=Offset or 0
|
Offset=Offset or 0
|
||||||
@@ -2180,6 +2285,25 @@ function NAVYGROUP:GetHeadingIntoWind(Offset, vdeck)
|
|||||||
return intowind, v
|
return intowind, v
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get heading of group into the wind. This minimizes the cross wind for an angled runway.
|
||||||
|
-- Implementation based on [Mags & Bami](https://magwo.github.io/carrier-cruise/) work.
|
||||||
|
-- @param #NAVYGROUP self
|
||||||
|
-- @param #number Offset Offset angle in degrees, e.g. to account for an angled runway.
|
||||||
|
-- @param #number vdeck Desired wind speed on deck in Knots.
|
||||||
|
-- @return #number Carrier heading in degrees.
|
||||||
|
-- @return #number Carrier speed in knots.
|
||||||
|
function NAVYGROUP:GetHeadingIntoWind(Offset, vdeck)
|
||||||
|
|
||||||
|
if self.intowindold then
|
||||||
|
--env.info("FF use OLD into wind")
|
||||||
|
return self:GetHeadingIntoWind_old(Offset, vdeck)
|
||||||
|
else
|
||||||
|
--env.info("FF use NEW into wind")
|
||||||
|
return self:GetHeadingIntoWind_new(Offset, vdeck)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Find free path to next waypoint.
|
--- Find free path to next waypoint.
|
||||||
-- @param #NAVYGROUP self
|
-- @param #NAVYGROUP self
|
||||||
|
|||||||
@@ -11372,11 +11372,19 @@ end
|
|||||||
-- @return #OPSGROUP self
|
-- @return #OPSGROUP self
|
||||||
function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
||||||
|
|
||||||
-- Template waypoints.
|
|
||||||
self.waypoints0=UTILS.DeepCopy(_DATABASE:GetGroupTemplate(self.groupname).route.points) --self.group:GetTemplateRoutePoints()
|
|
||||||
|
|
||||||
-- Waypoints empty!
|
-- Waypoints empty!
|
||||||
self.waypoints={}
|
self.waypoints={}
|
||||||
|
self.waypoints0={}
|
||||||
|
|
||||||
|
-- Get group template
|
||||||
|
local template=_DATABASE:GetGroupTemplate(self.groupname)
|
||||||
|
|
||||||
|
if template==nil then
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Template waypoints.
|
||||||
|
self.waypoints0=UTILS.DeepCopy(template.route.points) --self.group:GetTemplateRoutePoints()
|
||||||
|
|
||||||
WpIndexMin=WpIndexMin or 1
|
WpIndexMin=WpIndexMin or 1
|
||||||
WpIndexMax=WpIndexMax or #self.waypoints0
|
WpIndexMax=WpIndexMax or #self.waypoints0
|
||||||
@@ -13631,11 +13639,7 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
local unit=UNIT:FindByName(unitname)
|
local unit=UNIT:FindByName(unitname)
|
||||||
|
|
||||||
if unit then
|
if unit then
|
||||||
|
|
||||||
-- Get unit template.
|
|
||||||
local unittemplate=unit:GetTemplate()
|
|
||||||
--local unittemplate=_DATABASE:GetUnitTemplateFromUnitName(unitname)
|
|
||||||
|
|
||||||
-- Element table.
|
-- Element table.
|
||||||
local element=self:GetElementByName(unitname)
|
local element=self:GetElementByName(unitname)
|
||||||
|
|
||||||
@@ -13662,8 +13666,18 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
element.Nhit=0
|
element.Nhit=0
|
||||||
element.opsgroup=self
|
element.opsgroup=self
|
||||||
|
|
||||||
|
-- Get unit template.
|
||||||
|
local unittemplate=unit:GetTemplate()
|
||||||
|
|
||||||
|
if unittemplate==nil then
|
||||||
|
if element.DCSunit:getPlayerName() then
|
||||||
|
element.skill="Client"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
element.skill=unittemplate~=nil and unittemplate.skill or "Unknown"
|
||||||
|
end
|
||||||
|
|
||||||
-- Skill etc.
|
-- Skill etc.
|
||||||
element.skill=unittemplate.skill or "Unknown"
|
|
||||||
if element.skill=="Client" or element.skill=="Player" then
|
if element.skill=="Client" or element.skill=="Player" then
|
||||||
element.ai=false
|
element.ai=false
|
||||||
element.client=CLIENT:FindByName(unitname)
|
element.client=CLIENT:FindByName(unitname)
|
||||||
@@ -13722,24 +13736,22 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
element.weightCargo=0
|
element.weightCargo=0
|
||||||
end
|
end
|
||||||
element.weight=element.weightEmpty+element.weightCargo
|
element.weight=element.weightEmpty+element.weightCargo
|
||||||
|
|
||||||
-- FLIGHTGROUP specific.
|
-- FLIGHTGROUP specific.
|
||||||
if self.isFlightgroup then
|
element.callsign=element.unit:GetCallsign()
|
||||||
element.callsign=element.unit:GetCallsign()
|
element.fuelmass=element.fuelmass0 or 99999
|
||||||
|
element.fuelrel=element.unit:GetFuel() or 1
|
||||||
|
|
||||||
|
if self.isFlightgroup and unittemplate then
|
||||||
element.modex=unittemplate.onboard_num
|
element.modex=unittemplate.onboard_num
|
||||||
element.payload=unittemplate.payload
|
element.payload=unittemplate.payload
|
||||||
element.pylons=unittemplate.payload and unittemplate.payload.pylons or nil
|
element.pylons=unittemplate.payload and unittemplate.payload.pylons or nil
|
||||||
element.fuelmass0=unittemplate.payload and unittemplate.payload.fuel or 0
|
element.fuelmass0=unittemplate.payload and unittemplate.payload.fuel or 0
|
||||||
element.fuelmass=element.fuelmass0
|
|
||||||
element.fuelrel=element.unit:GetFuel()
|
|
||||||
else
|
else
|
||||||
element.callsign="Peter-1-1"
|
element.callsign="Peter-1-1"
|
||||||
element.modex="000"
|
element.modex="000"
|
||||||
element.payload={}
|
element.payload={}
|
||||||
element.pylons={}
|
element.pylons={}
|
||||||
element.fuelmass0=99999
|
|
||||||
element.fuelmass =99999
|
|
||||||
element.fuelrel=1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Debug text.
|
-- Debug text.
|
||||||
|
|||||||
@@ -604,6 +604,14 @@ function OPSZONE:GetAttackDuration()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Find an OPSZONE using the Zone Name.
|
||||||
|
-- @param #OPSZONE self
|
||||||
|
-- @param #string ZoneName The zone name.
|
||||||
|
-- @return #OPSZONE The OPSZONE or nil if not found.
|
||||||
|
function OPSZONE:FindByName( ZoneName )
|
||||||
|
local Found = _DATABASE:FindOpsZone( ZoneName )
|
||||||
|
return Found
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if the red coalition is currently owning the zone.
|
--- Check if the red coalition is currently owning the zone.
|
||||||
-- @param #OPSZONE self
|
-- @param #OPSZONE self
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType)
|
|||||||
self.TTSType = TTSType or "close air support"
|
self.TTSType = TTSType or "close air support"
|
||||||
self.lastsmoketime = 0
|
self.lastsmoketime = 0
|
||||||
|
|
||||||
if Repeat then
|
if type(Repeat) == "boolean" and Repeat == true and type(Times) == "number" and Times > 1 then
|
||||||
self.Repeat = true
|
self.Repeat = true
|
||||||
self.RepeatNo = Times or 1
|
self.RepeatNo = Times or 1
|
||||||
end
|
end
|
||||||
@@ -1571,7 +1571,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.1.66"
|
PLAYERTASKCONTROLLER.version="0.1.67"
|
||||||
|
|
||||||
--- Create and run a new TASKCONTROLLER instance.
|
--- Create and run a new TASKCONTROLLER instance.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@@ -1973,7 +1973,9 @@ function PLAYERTASKCONTROLLER:_SendMessageToClients(Text,Seconds)
|
|||||||
local seconds = Seconds or 10
|
local seconds = Seconds or 10
|
||||||
self.ClientSet:ForEachClient(
|
self.ClientSet:ForEachClient(
|
||||||
function (Client)
|
function (Client)
|
||||||
local m = MESSAGE:New(Text,seconds,"Tasking"):ToClient(Client)
|
if Client ~= nil and Client:IsActive() then
|
||||||
|
local m = MESSAGE:New(Text,seconds,"Tasking"):ToClient(Client)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
@@ -2206,7 +2208,7 @@ end
|
|||||||
function PLAYERTASKCONTROLLER:_EventHandler(EventData)
|
function PLAYERTASKCONTROLLER:_EventHandler(EventData)
|
||||||
self:T(self.lid.."_EventHandler: "..EventData.id)
|
self:T(self.lid.."_EventHandler: "..EventData.id)
|
||||||
--self:T(self.lid.."_EventHandler: "..EventData.IniPlayerName)
|
--self:T(self.lid.."_EventHandler: "..EventData.IniPlayerName)
|
||||||
if EventData.id == EVENTS.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then
|
if EventData.id == EVENTS.UnitLost or EventData.id == EVENTS.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then
|
||||||
if EventData.IniPlayerName then
|
if EventData.IniPlayerName then
|
||||||
self:T(self.lid.."Event for player: "..EventData.IniPlayerName)
|
self:T(self.lid.."Event for player: "..EventData.IniPlayerName)
|
||||||
--if self.PlayerMenu[EventData.IniPlayerName] then
|
--if self.PlayerMenu[EventData.IniPlayerName] then
|
||||||
@@ -4138,6 +4140,7 @@ function PLAYERTASKCONTROLLER:onafterStart(From, Event, To)
|
|||||||
self:HandleEvent(EVENTS.Crash, self._EventHandler)
|
self:HandleEvent(EVENTS.Crash, self._EventHandler)
|
||||||
self:HandleEvent(EVENTS.PilotDead, self._EventHandler)
|
self:HandleEvent(EVENTS.PilotDead, self._EventHandler)
|
||||||
self:HandleEvent(EVENTS.PlayerEnterAircraft, self._EventHandler)
|
self:HandleEvent(EVENTS.PlayerEnterAircraft, self._EventHandler)
|
||||||
|
self:HandleEvent(EVENTS.UnitLost, self._EventHandler)
|
||||||
self:SetEventPriority(5)
|
self:SetEventPriority(5)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -660,9 +660,9 @@ function RECOVERYTANKER:SetRecoveryAirboss(switch)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set that the group takes the roll of an AWACS instead of a refueling tanker.
|
--- Set that the group takes the role of an AWACS instead of a refueling tanker.
|
||||||
-- @param #RECOVERYTANKER self
|
-- @param #RECOVERYTANKER self
|
||||||
-- @param #boolean switch If true or nil, set roll AWACS.
|
-- @param #boolean switch If true or nil, set role AWACS.
|
||||||
-- @param #boolean eplrs If true or nil, enable EPLRS. If false, EPLRS will be off.
|
-- @param #boolean eplrs If true or nil, enable EPLRS. If false, EPLRS will be off.
|
||||||
-- @return #RECOVERYTANKER self
|
-- @return #RECOVERYTANKER self
|
||||||
function RECOVERYTANKER:SetAWACS(switch, eplrs)
|
function RECOVERYTANKER:SetAWACS(switch, eplrs)
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ RADIO = {
|
|||||||
Power = 100,
|
Power = 100,
|
||||||
Loop = false,
|
Loop = false,
|
||||||
alias = nil,
|
alias = nil,
|
||||||
|
moduhasbeenset = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{#RADIO.Broadcast} to actually broadcast.
|
--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{#RADIO.Broadcast} to actually broadcast.
|
||||||
@@ -167,12 +168,13 @@ function RADIO:SetFrequency(Frequency)
|
|||||||
self:F2(Frequency)
|
self:F2(Frequency)
|
||||||
|
|
||||||
if type(Frequency) == "number" then
|
if type(Frequency) == "number" then
|
||||||
|
|
||||||
-- If frequency is in range
|
-- If frequency is in range
|
||||||
--if (Frequency >= 30 and Frequency <= 87.995) or (Frequency >= 108 and Frequency <= 173.995) or (Frequency >= 225 and Frequency <= 399.975) then
|
--if (Frequency >= 30 and Frequency <= 87.995) or (Frequency >= 108 and Frequency <= 173.995) or (Frequency >= 225 and Frequency <= 399.975) then
|
||||||
|
|
||||||
-- Convert frequency from MHz to Hz
|
-- Convert frequency from MHz to Hz
|
||||||
self.Frequency = Frequency * 1000000
|
self.Frequency = Frequency
|
||||||
|
self.HertzFrequency = Frequency * 1000000
|
||||||
|
|
||||||
-- If the RADIO is attached to a UNIT or a GROUP, we need to send the DCS Command "SetFrequency" to change the UNIT or GROUP frequency
|
-- If the RADIO is attached to a UNIT or a GROUP, we need to send the DCS Command "SetFrequency" to change the UNIT or GROUP frequency
|
||||||
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
|
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
|
||||||
@@ -180,7 +182,7 @@ function RADIO:SetFrequency(Frequency)
|
|||||||
local commandSetFrequency={
|
local commandSetFrequency={
|
||||||
id = "SetFrequency",
|
id = "SetFrequency",
|
||||||
params = {
|
params = {
|
||||||
frequency = self.Frequency,
|
frequency = self.HertzFrequency,
|
||||||
modulation = self.Modulation,
|
modulation = self.Modulation,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +199,7 @@ function RADIO:SetFrequency(Frequency)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set AM or FM modulation of the radio transmitter.
|
--- Set AM or FM modulation of the radio transmitter. Set this before you set a frequency!
|
||||||
-- @param #RADIO self
|
-- @param #RADIO self
|
||||||
-- @param #number Modulation Modulation is either radio.modulation.AM or radio.modulation.FM.
|
-- @param #number Modulation Modulation is either radio.modulation.AM or radio.modulation.FM.
|
||||||
-- @return #RADIO self
|
-- @return #RADIO self
|
||||||
@@ -206,6 +208,10 @@ function RADIO:SetModulation(Modulation)
|
|||||||
if type(Modulation) == "number" then
|
if type(Modulation) == "number" then
|
||||||
if Modulation == radio.modulation.AM or Modulation == radio.modulation.FM then --TODO Maybe make this future proof if ED decides to add an other modulation ?
|
if Modulation == radio.modulation.AM or Modulation == radio.modulation.FM then --TODO Maybe make this future proof if ED decides to add an other modulation ?
|
||||||
self.Modulation = Modulation
|
self.Modulation = Modulation
|
||||||
|
if self.moduhasbeenset == false and Modulation == radio.modulation.FM then -- override default
|
||||||
|
self:SetFrequency(self.Frequency)
|
||||||
|
end
|
||||||
|
self.moduhasbeenset = true
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ function RADIOQUEUE:NewTransmission(filename, duration, path, tstart, interval,
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
if type(duration)~="number" then
|
if type(duration)~="number" then
|
||||||
self:E(self.lid.."ERROR: Duration specified is NOT a number.")
|
self:E(self.lid..string.format("ERROR: Duration specified is NOT a number but type=%s. Filename=%s, duration=%s", type(duration), tostring(filename), tostring(duration)))
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -361,6 +361,7 @@ end
|
|||||||
-- @param #RADIOQUEUE self
|
-- @param #RADIOQUEUE self
|
||||||
-- @param #RADIOQUEUE.Transmission transmission The transmission.
|
-- @param #RADIOQUEUE.Transmission transmission The transmission.
|
||||||
function RADIOQUEUE:Broadcast(transmission)
|
function RADIOQUEUE:Broadcast(transmission)
|
||||||
|
self:T("Broadcast")
|
||||||
|
|
||||||
if ((transmission.soundfile and transmission.soundfile.useSRS) or transmission.soundtext) and self.msrs then
|
if ((transmission.soundfile and transmission.soundfile.useSRS) or transmission.soundtext) and self.msrs then
|
||||||
self:_BroadcastSRS(transmission)
|
self:_BroadcastSRS(transmission)
|
||||||
@@ -425,7 +426,7 @@ function RADIOQUEUE:Broadcast(transmission)
|
|||||||
else
|
else
|
||||||
|
|
||||||
-- Broadcasting from carrier. No subtitle possible. Need to send messages to players.
|
-- Broadcasting from carrier. No subtitle possible. Need to send messages to players.
|
||||||
self:T(self.lid..string.format("Broadcasting via trigger.action.radioTransmission()."))
|
self:T(self.lid..string.format("Broadcasting via trigger.action.radioTransmission()"))
|
||||||
|
|
||||||
-- Position from where to transmit.
|
-- Position from where to transmit.
|
||||||
local vec3=nil
|
local vec3=nil
|
||||||
@@ -453,6 +454,8 @@ function RADIOQUEUE:Broadcast(transmission)
|
|||||||
local text=string.format("file=%s, freq=%.2f MHz, duration=%.2f sec, subtitle=%s", filename, self.frequency/1000000, transmission.duration, transmission.subtitle or "")
|
local text=string.format("file=%s, freq=%.2f MHz, duration=%.2f sec, subtitle=%s", filename, self.frequency/1000000, transmission.duration, transmission.subtitle or "")
|
||||||
MESSAGE:New(string.format(text, filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE "..self.alias):ToAll()
|
MESSAGE:New(string.format(text, filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE "..self.alias):ToAll()
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
self:E("ERROR: Could not get vec3 to determine transmission origin! Did you specify a sender and is it still alive?")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -482,7 +485,6 @@ end
|
|||||||
--- Check radio queue for transmissions to be broadcasted.
|
--- Check radio queue for transmissions to be broadcasted.
|
||||||
-- @param #RADIOQUEUE self
|
-- @param #RADIOQUEUE self
|
||||||
function RADIOQUEUE:_CheckRadioQueue()
|
function RADIOQUEUE:_CheckRadioQueue()
|
||||||
--env.info("FF check radio queue "..self.alias)
|
|
||||||
|
|
||||||
-- Check if queue is empty.
|
-- Check if queue is empty.
|
||||||
if #self.queue==0 then
|
if #self.queue==0 then
|
||||||
|
|||||||
@@ -271,11 +271,11 @@ MSRS.Voices = {
|
|||||||
["David"] = "Microsoft David Desktop", -- en-US
|
["David"] = "Microsoft David Desktop", -- en-US
|
||||||
["Zira"] = "Microsoft Zira Desktop", -- en-US
|
["Zira"] = "Microsoft Zira Desktop", -- en-US
|
||||||
["Hortense"] = "Microsoft Hortense Desktop", --fr-FR
|
["Hortense"] = "Microsoft Hortense Desktop", --fr-FR
|
||||||
["de-DE-Hedda"] = "Microsoft Hedda Desktop", -- de-DE
|
["de_DE_Hedda"] = "Microsoft Hedda Desktop", -- de-DE
|
||||||
["en-GB-Hazel"] = "Microsoft Hazel Desktop", -- en-GB
|
["en_GB_Hazel"] = "Microsoft Hazel Desktop", -- en-GB
|
||||||
["en-US-David"] = "Microsoft David Desktop", -- en-US
|
["en_US_David"] = "Microsoft David Desktop", -- en-US
|
||||||
["en-US-Zira"] = "Microsoft Zira Desktop", -- en-US
|
["en_US_Zira"] = "Microsoft Zira Desktop", -- en-US
|
||||||
["fr-FR-Hortense"] = "Microsoft Hortense Desktop", --fr-FR
|
["fr_FR_Hortense"] = "Microsoft Hortense Desktop", --fr-FR
|
||||||
},
|
},
|
||||||
MicrosoftGRPC = { -- en-US/GB voices only as of Jan 2024, working ones if using gRPC and MS, if voice packs are installed
|
MicrosoftGRPC = { -- en-US/GB voices only as of Jan 2024, working ones if using gRPC and MS, if voice packs are installed
|
||||||
--["Hedda"] = "Hedda", -- de-DE
|
--["Hedda"] = "Hedda", -- de-DE
|
||||||
@@ -304,8 +304,7 @@ MSRS.Voices = {
|
|||||||
["en_CA_Linda"] = "Linda", --en-CA
|
["en_CA_Linda"] = "Linda", --en-CA
|
||||||
["en_IN_Ravi"] = "Ravi", --en-IN
|
["en_IN_Ravi"] = "Ravi", --en-IN
|
||||||
["en_IN_Heera"] = "Heera", --en-IN
|
["en_IN_Heera"] = "Heera", --en-IN
|
||||||
["en_IR_Sean"] = "Sean", --en-IR
|
["en_IR_Sean"] = "Sean", --en-IR
|
||||||
--]]
|
|
||||||
},
|
},
|
||||||
Google = {
|
Google = {
|
||||||
Standard = {
|
Standard = {
|
||||||
@@ -1238,7 +1237,7 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
|
|||||||
self:T({Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate} )
|
self:T({Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate} )
|
||||||
|
|
||||||
if Delay and Delay>0 then
|
if Delay and Delay>0 then
|
||||||
self:ScheduleOnce(Delay, MSRS.PlayTextExt, self, Text, 0, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate)
|
self:ScheduleOnce(Delay, self.PlayTextExt, self, Text, 0, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate)
|
||||||
else
|
else
|
||||||
|
|
||||||
Frequencies = Frequencies or self:GetFrequencies()
|
Frequencies = Frequencies or self:GetFrequencies()
|
||||||
@@ -1560,8 +1559,8 @@ end
|
|||||||
function MSRS:_DCSgRPCtts(Text, Frequencies, Gender, Culture, Voice, Volume, Label, Coordinate)
|
function MSRS:_DCSgRPCtts(Text, Frequencies, Gender, Culture, Voice, Volume, Label, Coordinate)
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:F("MSRS_BACKEND_DCSGRPC:_DCSgRPCtts()")
|
self:T("MSRS_BACKEND_DCSGRPC:_DCSgRPCtts()")
|
||||||
self:F({Text, Frequencies, Gender, Culture, Voice, Volume, Label, Coordinate})
|
self:T({Text, Frequencies, Gender, Culture, Voice, Volume, Label, Coordinate})
|
||||||
|
|
||||||
local options = {} -- #MSRS.GRPCOptions
|
local options = {} -- #MSRS.GRPCOptions
|
||||||
|
|
||||||
@@ -1587,7 +1586,6 @@ function MSRS:_DCSgRPCtts(Text, Frequencies, Gender, Culture, Voice, Volume, Lab
|
|||||||
|
|
||||||
-- Provider (win, gcloud, ...)
|
-- Provider (win, gcloud, ...)
|
||||||
local provider = self.provider or MSRS.Provider.WINDOWS
|
local provider = self.provider or MSRS.Provider.WINDOWS
|
||||||
self:F({provider=provider})
|
|
||||||
|
|
||||||
-- Provider options: voice, credentials
|
-- Provider options: voice, credentials
|
||||||
options.provider = {}
|
options.provider = {}
|
||||||
@@ -1595,7 +1593,7 @@ function MSRS:_DCSgRPCtts(Text, Frequencies, Gender, Culture, Voice, Volume, Lab
|
|||||||
|
|
||||||
-- Voice
|
-- Voice
|
||||||
Voice=Voice or self:GetVoice(self.provider) or self.voice
|
Voice=Voice or self:GetVoice(self.provider) or self.voice
|
||||||
|
|
||||||
if Voice then
|
if Voice then
|
||||||
-- We use a specific voice
|
-- We use a specific voice
|
||||||
options.provider[provider].voice = Voice
|
options.provider[provider].voice = Voice
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
do -- Sound Base
|
do -- Sound Base
|
||||||
|
|
||||||
--- @type SOUNDBASE
|
-- @type SOUNDBASE
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ end
|
|||||||
|
|
||||||
do -- Sound File
|
do -- Sound File
|
||||||
|
|
||||||
--- @type SOUNDFILE
|
-- @type SOUNDFILE
|
||||||
-- @field #string ClassName Name of the class
|
-- @field #string ClassName Name of the class
|
||||||
-- @field #string filename Name of the flag.
|
-- @field #string filename Name of the flag.
|
||||||
-- @field #string path Directory path, where the sound file is located. This includes the final slash "/".
|
-- @field #string path Directory path, where the sound file is located. This includes the final slash "/".
|
||||||
@@ -160,7 +160,7 @@ do -- Sound File
|
|||||||
-- @param #string FileName The name of the sound file, e.g. "Hello World.ogg".
|
-- @param #string FileName The name of the sound file, e.g. "Hello World.ogg".
|
||||||
-- @param #string Path The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.
|
-- @param #string Path The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.
|
||||||
-- @param #number Duration Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.
|
-- @param #number Duration Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.
|
||||||
-- @param #bolean UseSrs Set if SRS should be used to play this file. Default is false.
|
-- @param #boolean UseSrs Set if SRS should be used to play this file. Default is false.
|
||||||
-- @return #SOUNDFILE self
|
-- @return #SOUNDFILE self
|
||||||
function SOUNDFILE:New(FileName, Path, Duration, UseSrs)
|
function SOUNDFILE:New(FileName, Path, Duration, UseSrs)
|
||||||
|
|
||||||
@@ -249,6 +249,9 @@ do -- Sound File
|
|||||||
-- @param #string Duration Duration in seconds. Default 3 seconds.
|
-- @param #string Duration Duration in seconds. Default 3 seconds.
|
||||||
-- @return #SOUNDFILE self
|
-- @return #SOUNDFILE self
|
||||||
function SOUNDFILE:SetDuration(Duration)
|
function SOUNDFILE:SetDuration(Duration)
|
||||||
|
if Duration and type(Duration)=="string" then
|
||||||
|
Duration=tonumber(Duration)
|
||||||
|
end
|
||||||
self.duration=Duration or 3
|
self.duration=Duration or 3
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -289,7 +292,7 @@ end
|
|||||||
|
|
||||||
do -- Text-To-Speech
|
do -- Text-To-Speech
|
||||||
|
|
||||||
--- @type SOUNDTEXT
|
-- @type SOUNDTEXT
|
||||||
-- @field #string ClassName Name of the class
|
-- @field #string ClassName Name of the class
|
||||||
-- @field #string text Text to speak.
|
-- @field #string text Text to speak.
|
||||||
-- @field #number duration Duration in seconds.
|
-- @field #number duration Duration in seconds.
|
||||||
@@ -356,7 +359,7 @@ do -- Text-To-Speech
|
|||||||
local self=BASE:Inherit(self, BASE:New()) -- #SOUNDTEXT
|
local self=BASE:Inherit(self, BASE:New()) -- #SOUNDTEXT
|
||||||
|
|
||||||
self:SetText(Text)
|
self:SetText(Text)
|
||||||
self:SetDuration(Duration or STTS.getSpeechTime(Text))
|
self:SetDuration(Duration or MSRS.getSpeechTime(Text))
|
||||||
--self:SetGender()
|
--self:SetGender()
|
||||||
--self:SetCulture()
|
--self:SetCulture()
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
do -- UserSound
|
do -- UserSound
|
||||||
|
|
||||||
--- @type USERSOUND
|
-- @type USERSOUND
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ COMMANDCENTER = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- @type COMMANDCENTER.AutoAssignMethods
|
---
|
||||||
|
-- @type COMMANDCENTER.AutoAssignMethods
|
||||||
COMMANDCENTER.AutoAssignMethods = {
|
COMMANDCENTER.AutoAssignMethods = {
|
||||||
["Random"] = 1,
|
["Random"] = 1,
|
||||||
["Distance"] = 2,
|
["Distance"] = 2,
|
||||||
@@ -210,7 +211,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
self:SetMessageDuration(10)
|
self:SetMessageDuration(10)
|
||||||
|
|
||||||
self:HandleEvent( EVENTS.Birth,
|
self:HandleEvent( EVENTS.Birth,
|
||||||
--- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function( self, EventData )
|
function( self, EventData )
|
||||||
if EventData.IniObjectCategory == 1 then
|
if EventData.IniObjectCategory == 1 then
|
||||||
@@ -241,7 +242,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
-- -- - Assign the PlayerUnit to the Task if required.
|
-- -- - Assign the PlayerUnit to the Task if required.
|
||||||
-- -- - Send a message to the other players in the group that this player has joined.
|
-- -- - Send a message to the other players in the group that this player has joined.
|
||||||
-- self:HandleEvent( EVENTS.PlayerEnterUnit,
|
-- self:HandleEvent( EVENTS.PlayerEnterUnit,
|
||||||
-- --- @param #COMMANDCENTER self
|
-- -- @param #COMMANDCENTER self
|
||||||
-- -- @param Core.Event#EVENTDATA EventData
|
-- -- @param Core.Event#EVENTDATA EventData
|
||||||
-- function( self, EventData )
|
-- function( self, EventData )
|
||||||
-- local PlayerUnit = EventData.IniUnit
|
-- local PlayerUnit = EventData.IniUnit
|
||||||
@@ -258,7 +259,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
-- The PlayerUnit will be UnAssigned from the Task.
|
-- The PlayerUnit will be UnAssigned from the Task.
|
||||||
-- When there is no Unit left running the Task, the Task goes into Abort...
|
-- When there is no Unit left running the Task, the Task goes into Abort...
|
||||||
self:HandleEvent( EVENTS.MissionEnd,
|
self:HandleEvent( EVENTS.MissionEnd,
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function( self, EventData )
|
function( self, EventData )
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
@@ -273,7 +274,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
-- The PlayerUnit will be UnAssigned from the Task.
|
-- The PlayerUnit will be UnAssigned from the Task.
|
||||||
-- When there is no Unit left running the Task, the Task goes into Abort...
|
-- When there is no Unit left running the Task, the Task goes into Abort...
|
||||||
self:HandleEvent( EVENTS.PlayerLeaveUnit,
|
self:HandleEvent( EVENTS.PlayerLeaveUnit,
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function( self, EventData )
|
function( self, EventData )
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
@@ -290,7 +291,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
-- The PlayerUnit will be UnAssigned from the Task.
|
-- The PlayerUnit will be UnAssigned from the Task.
|
||||||
-- When there is no Unit left running the Task, the Task goes into Abort...
|
-- When there is no Unit left running the Task, the Task goes into Abort...
|
||||||
self:HandleEvent( EVENTS.Crash,
|
self:HandleEvent( EVENTS.Crash,
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function( self, EventData )
|
function( self, EventData )
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
do -- DETECTION MANAGER
|
do -- DETECTION MANAGER
|
||||||
|
|
||||||
--- @type DETECTION_MANAGER
|
-- @type DETECTION_MANAGER
|
||||||
-- @field Core.Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
-- @field Core.Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
||||||
-- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
-- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||||
-- @field Tasking.CommandCenter#COMMANDCENTER CC The command center that is used to communicate with the players.
|
-- @field Tasking.CommandCenter#COMMANDCENTER CC The command center that is used to communicate with the players.
|
||||||
@@ -62,7 +62,7 @@ do -- DETECTION MANAGER
|
|||||||
Detection = nil,
|
Detection = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field Tasking.CommandCenter#COMMANDCENTER
|
-- @field Tasking.CommandCenter#COMMANDCENTER
|
||||||
DETECTION_MANAGER.CC = nil
|
DETECTION_MANAGER.CC = nil
|
||||||
|
|
||||||
--- FAC constructor.
|
--- FAC constructor.
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
-- @module Tasking.Mission
|
-- @module Tasking.Mission
|
||||||
-- @image Task_Mission.JPG
|
-- @image Task_Mission.JPG
|
||||||
|
|
||||||
--- @type MISSION
|
---
|
||||||
|
-- @type MISSION
|
||||||
-- @field #MISSION.Clients _Clients
|
-- @field #MISSION.Clients _Clients
|
||||||
-- @field Core.Menu#MENU_COALITION MissionMenu
|
-- @field Core.Menu#MENU_COALITION MissionMenu
|
||||||
-- @field #string MissionBriefing
|
-- @field #string MissionBriefing
|
||||||
@@ -790,7 +791,7 @@ function MISSION:HasGroup( TaskGroup )
|
|||||||
return Has
|
return Has
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @return #number
|
-- @return #number
|
||||||
function MISSION:GetTasksRemaining()
|
function MISSION:GetTasksRemaining()
|
||||||
-- Determine how many tasks are remaining.
|
-- Determine how many tasks are remaining.
|
||||||
@@ -805,7 +806,7 @@ function MISSION:GetTasksRemaining()
|
|||||||
return TasksRemaining
|
return TasksRemaining
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @return #number
|
-- @return #number
|
||||||
function MISSION:GetTaskTypes()
|
function MISSION:GetTaskTypes()
|
||||||
-- Determine how many tasks are remaining.
|
-- Determine how many tasks are remaining.
|
||||||
@@ -865,7 +866,7 @@ end
|
|||||||
---- - <xx> Aborted Tasks (xp)
|
---- - <xx> Aborted Tasks (xp)
|
||||||
---- - <xx> Failed Tasks (xp)
|
---- - <xx> Failed Tasks (xp)
|
||||||
----
|
----
|
||||||
---- @param #MISSION self
|
-- @param #MISSION self
|
||||||
---- @return #string
|
---- @return #string
|
||||||
--function MISSION:ReportSummary()
|
--function MISSION:ReportSummary()
|
||||||
--
|
--
|
||||||
@@ -1175,7 +1176,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param #string TaskStatus The status
|
-- @param #string TaskStatus The status
|
||||||
-- @param Wrapper.Group#GROUP ReportGroup
|
-- @param Wrapper.Group#GROUP ReportGroup
|
||||||
function MISSION:MenuReportTasksPerStatus( ReportGroup, TaskStatus )
|
function MISSION:MenuReportTasksPerStatus( ReportGroup, TaskStatus )
|
||||||
@@ -1186,7 +1187,7 @@ function MISSION:MenuReportTasksPerStatus( ReportGroup, TaskStatus )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Wrapper.Group#GROUP ReportGroup
|
-- @param Wrapper.Group#GROUP ReportGroup
|
||||||
function MISSION:MenuReportPlayersPerTask( ReportGroup )
|
function MISSION:MenuReportPlayersPerTask( ReportGroup )
|
||||||
|
|
||||||
@@ -1195,7 +1196,7 @@ function MISSION:MenuReportPlayersPerTask( ReportGroup )
|
|||||||
self:GetCommandCenter():MessageTypeToGroup( Report, ReportGroup, MESSAGE.Type.Overview )
|
self:GetCommandCenter():MessageTypeToGroup( Report, ReportGroup, MESSAGE.Type.Overview )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Wrapper.Group#GROUP ReportGroup
|
-- @param Wrapper.Group#GROUP ReportGroup
|
||||||
function MISSION:MenuReportPlayersProgress( ReportGroup )
|
function MISSION:MenuReportPlayersProgress( ReportGroup )
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,8 @@
|
|||||||
-- @module Tasking.Task
|
-- @module Tasking.Task
|
||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
--- @type TASK
|
---
|
||||||
|
-- @type TASK
|
||||||
-- @field Core.Scheduler#SCHEDULER TaskScheduler
|
-- @field Core.Scheduler#SCHEDULER TaskScheduler
|
||||||
-- @field Tasking.Mission#MISSION Mission
|
-- @field Tasking.Mission#MISSION Mission
|
||||||
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
|
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
|
||||||
@@ -726,7 +727,7 @@ function TASK:AddGroups( GroupSet )
|
|||||||
GroupSet = GroupSet or SET_GROUP:New()
|
GroupSet = GroupSet or SET_GROUP:New()
|
||||||
|
|
||||||
self.SetGroup:ForEachGroup(
|
self.SetGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP GroupSet
|
-- @param Wrapper.Group#GROUP GroupSet
|
||||||
function( GroupItem )
|
function( GroupItem )
|
||||||
GroupSet:Add( GroupItem:GetName(), GroupItem)
|
GroupSet:Add( GroupItem:GetName(), GroupItem)
|
||||||
end
|
end
|
||||||
@@ -819,7 +820,7 @@ end
|
|||||||
|
|
||||||
do -- Group Assignment
|
do -- Group Assignment
|
||||||
|
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Actions.Act_Assign#ACT_ASSIGN AcceptClass
|
-- @param Actions.Act_Assign#ACT_ASSIGN AcceptClass
|
||||||
function TASK:SetAssignMethod( AcceptClass )
|
function TASK:SetAssignMethod( AcceptClass )
|
||||||
|
|
||||||
@@ -1199,7 +1200,7 @@ function TASK:RemoveAssignedMenuForGroup( TaskGroup )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
function TASK:MenuAssignToGroup( TaskGroup )
|
function TASK:MenuAssignToGroup( TaskGroup )
|
||||||
|
|
||||||
@@ -1208,7 +1209,7 @@ function TASK:MenuAssignToGroup( TaskGroup )
|
|||||||
self:AssignToGroup( TaskGroup )
|
self:AssignToGroup( TaskGroup )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
function TASK:MenuMarkToGroup( TaskGroup )
|
function TASK:MenuMarkToGroup( TaskGroup )
|
||||||
self:F()
|
self:F()
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
-- @module Tasking.TaskInfo
|
-- @module Tasking.TaskInfo
|
||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
--- @type TASKINFO
|
---
|
||||||
|
-- @type TASKINFO
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -29,7 +30,8 @@ TASKINFO = {
|
|||||||
ClassName = "TASKINFO",
|
ClassName = "TASKINFO",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @type TASKINFO.Detail #string A string that flags to document which level of detail needs to be shown in the report.
|
---
|
||||||
|
-- @type TASKINFO.Detail #string A string that flags to document which level of detail needs to be shown in the report.
|
||||||
--
|
--
|
||||||
-- - "M" for Markings on the Map (F10).
|
-- - "M" for Markings on the Map (F10).
|
||||||
-- - "S" for Summary Reports.
|
-- - "S" for Summary Reports.
|
||||||
@@ -279,7 +281,7 @@ function TASKINFO:AddCargoSet( SetCargo, Order, Detail, Keep )
|
|||||||
local CargoReport = REPORT:New()
|
local CargoReport = REPORT:New()
|
||||||
CargoReport:Add( "" )
|
CargoReport:Add( "" )
|
||||||
SetCargo:ForEachCargo(
|
SetCargo:ForEachCargo(
|
||||||
--- @param Cargo.Cargo#CARGO Cargo
|
-- @param Cargo.Cargo#CARGO Cargo
|
||||||
function( Cargo )
|
function( Cargo )
|
||||||
CargoReport:Add( string.format( ' - %s (%s) %s - status %s ', Cargo:GetName(), Cargo:GetType(), Cargo:GetTransportationMethod(), Cargo:GetCurrentState() ) )
|
CargoReport:Add( string.format( ' - %s (%s) %s - status %s ', Cargo:GetName(), Cargo:GetType(), Cargo:GetTransportationMethod(), Cargo:GetCurrentState() ) )
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -173,19 +173,19 @@ do -- TASK_A2A
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Core.Set#SET_UNIT TargetSetUnit The set of targets.
|
-- @param Core.Set#SET_UNIT TargetSetUnit The set of targets.
|
||||||
function TASK_A2A:SetTargetSetUnit( TargetSetUnit )
|
function TASK_A2A:SetTargetSetUnit( TargetSetUnit )
|
||||||
|
|
||||||
self.TargetSetUnit = TargetSetUnit
|
self.TargetSetUnit = TargetSetUnit
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
function TASK_A2A:GetPlannedMenuText()
|
function TASK_A2A:GetPlannedMenuText()
|
||||||
return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )"
|
return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )"
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Core.Point#COORDINATE RendezVousCoordinate The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
|
-- @param Core.Point#COORDINATE RendezVousCoordinate The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
|
||||||
-- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
|
-- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
@@ -198,7 +198,7 @@ do -- TASK_A2A
|
|||||||
ActRouteRendezVous:SetRange( RendezVousRange )
|
ActRouteRendezVous:SetRange( RendezVousRange )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return Core.Point#COORDINATE The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
|
-- @return Core.Point#COORDINATE The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
|
||||||
-- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
|
-- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
|
||||||
@@ -210,7 +210,7 @@ do -- TASK_A2A
|
|||||||
return ActRouteRendezVous:GetCoordinate(), ActRouteRendezVous:GetRange()
|
return ActRouteRendezVous:GetCoordinate(), ActRouteRendezVous:GetRange()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map.
|
-- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map.
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function TASK_A2A:SetRendezVousZone( RendezVousZone, TaskUnit )
|
function TASK_A2A:SetRendezVousZone( RendezVousZone, TaskUnit )
|
||||||
@@ -221,7 +221,7 @@ do -- TASK_A2A
|
|||||||
ActRouteRendezVous:SetZone( RendezVousZone )
|
ActRouteRendezVous:SetZone( RendezVousZone )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map.
|
-- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map.
|
||||||
function TASK_A2A:GetRendezVousZone( TaskUnit )
|
function TASK_A2A:GetRendezVousZone( TaskUnit )
|
||||||
@@ -232,7 +232,7 @@ do -- TASK_A2A
|
|||||||
return ActRouteRendezVous:GetZone()
|
return ActRouteRendezVous:GetZone()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Core.Point#COORDINATE TargetCoordinate The Coordinate object where the Target is located on the map.
|
-- @param Core.Point#COORDINATE TargetCoordinate The Coordinate object where the Target is located on the map.
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function TASK_A2A:SetTargetCoordinate( TargetCoordinate, TaskUnit )
|
function TASK_A2A:SetTargetCoordinate( TargetCoordinate, TaskUnit )
|
||||||
@@ -243,7 +243,7 @@ do -- TASK_A2A
|
|||||||
ActRouteTarget:SetCoordinate( TargetCoordinate )
|
ActRouteTarget:SetCoordinate( TargetCoordinate )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return Core.Point#COORDINATE The Coordinate object where the Target is located on the map.
|
-- @return Core.Point#COORDINATE The Coordinate object where the Target is located on the map.
|
||||||
function TASK_A2A:GetTargetCoordinate( TaskUnit )
|
function TASK_A2A:GetTargetCoordinate( TaskUnit )
|
||||||
@@ -254,7 +254,7 @@ do -- TASK_A2A
|
|||||||
return ActRouteTarget:GetCoordinate()
|
return ActRouteTarget:GetCoordinate()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map.
|
-- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map.
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function TASK_A2A:SetTargetZone( TargetZone, Altitude, Heading, TaskUnit )
|
function TASK_A2A:SetTargetZone( TargetZone, Altitude, Heading, TaskUnit )
|
||||||
@@ -265,7 +265,7 @@ do -- TASK_A2A
|
|||||||
ActRouteTarget:SetZone( TargetZone, Altitude, Heading )
|
ActRouteTarget:SetZone( TargetZone, Altitude, Heading )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map.
|
-- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map.
|
||||||
function TASK_A2A:GetTargetZone( TaskUnit )
|
function TASK_A2A:GetTargetZone( TaskUnit )
|
||||||
@@ -309,7 +309,7 @@ do -- TASK_A2A
|
|||||||
self:__Goal( -10 )
|
self:__Goal( -10 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
-- @param #TASK_A2A self
|
||||||
function TASK_A2A:UpdateTaskInfo( DetectedItem )
|
function TASK_A2A:UpdateTaskInfo( DetectedItem )
|
||||||
|
|
||||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||||
@@ -501,7 +501,7 @@ do -- TASK_A2A_SWEEP
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2A_SWEEP self
|
-- @param #TASK_A2A_SWEEP self
|
||||||
function TASK_A2A_SWEEP:onafterGoal( TaskUnit, From, Event, To )
|
function TASK_A2A_SWEEP:onafterGoal( TaskUnit, From, Event, To )
|
||||||
local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT
|
local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- TaskDispatcher = TASK_A2A_DISPATCHER:New( ... )
|
-- TaskDispatcher = TASK_A2A_DISPATCHER:New( ... )
|
||||||
--
|
--
|
||||||
-- --- @param #TaskDispatcher self
|
-- -- @param #TaskDispatcher self
|
||||||
-- -- @param #string From Contains the name of the state from where the Event was triggered.
|
-- -- @param #string From Contains the name of the state from where the Event was triggered.
|
||||||
-- -- @param #string Event Contains the name of the event that was triggered. In this case Assign.
|
-- -- @param #string Event Contains the name of the event that was triggered. In this case Assign.
|
||||||
-- -- @param #string To Contains the name of the state that will be transitioned to.
|
-- -- @param #string To Contains the name of the state that will be transitioned to.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user