mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Compare commits
2287 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd0b2ace65 | ||
|
|
dc83af4d02 | ||
|
|
342e901dd1 | ||
|
|
0a38700edb | ||
|
|
659615114a | ||
|
|
bfd26522d6 | ||
|
|
00d14c7c0a | ||
|
|
47c9e1ba1f | ||
|
|
92e680a276 | ||
|
|
4955fe4d92 | ||
|
|
e439bcdd0f | ||
|
|
792aa73832 | ||
|
|
d375e0ce29 | ||
|
|
e3670219ed | ||
|
|
a915452e6e | ||
|
|
6662a1cf97 | ||
|
|
be8405b72b | ||
|
|
9b24695377 | ||
|
|
5ca3e3b2b8 | ||
|
|
8bbef34b74 | ||
|
|
618a8744a2 | ||
|
|
5329da32eb | ||
|
|
df86c3f2a1 | ||
|
|
784fcb7882 | ||
|
|
23aeef7a20 | ||
|
|
0ee24b86dc | ||
|
|
9ac4f136aa | ||
|
|
ca9b2d79cc | ||
|
|
c9a09c2fc9 | ||
|
|
813286f7f3 | ||
|
|
6028c91f81 | ||
|
|
11b6bb2638 | ||
|
|
3c57928f46 | ||
|
|
e091e659a2 | ||
|
|
32f0bb33c3 | ||
|
|
dea64751c3 | ||
|
|
31d0410284 | ||
|
|
9cdf550432 | ||
|
|
09525029ab | ||
|
|
87c436ba34 | ||
|
|
b1002017e5 | ||
|
|
6e9727e265 | ||
|
|
383e953ba1 | ||
|
|
94ee76fe62 | ||
|
|
9b52b640e6 | ||
|
|
ea23162ca9 | ||
|
|
68d0220912 | ||
|
|
683388faee | ||
|
|
56ec3920c5 | ||
|
|
88842d1c67 | ||
|
|
f335ffc4ec | ||
|
|
f76aefa976 | ||
|
|
4976cd86f2 | ||
|
|
2cd66ae1d4 | ||
|
|
c00eff8b23 | ||
|
|
7f0376561b | ||
|
|
3c710613a8 | ||
|
|
3585208547 | ||
|
|
29c0017e80 | ||
|
|
45ebf9a3c7 | ||
|
|
908e505ce3 | ||
|
|
c808e4a4e2 | ||
|
|
e129eb97a7 | ||
|
|
e2612b97d7 | ||
|
|
70e9d91bb5 | ||
|
|
0b8810f8b3 | ||
|
|
3d39ccbdce | ||
|
|
41b867a4ca | ||
|
|
427baa43d7 | ||
|
|
d4e141f3c5 | ||
|
|
1c0a8d9380 | ||
|
|
f05680f23d | ||
|
|
2b0b9d44eb | ||
|
|
2fc7a3b542 | ||
|
|
820ae2759b | ||
|
|
12b596a47f | ||
|
|
a06d099917 | ||
|
|
7552309a28 | ||
|
|
b9ad5b5ba7 | ||
|
|
8ef781a9ac | ||
|
|
5e24e8658b | ||
|
|
43eeaede65 | ||
|
|
749c5f87de | ||
|
|
a520daeb56 | ||
|
|
9bb713db10 | ||
|
|
f9ba96f228 | ||
|
|
a49bd23a2a | ||
|
|
913b2c6d3f | ||
|
|
cea2f18228 | ||
|
|
fd2d8a5119 | ||
|
|
24b3200777 | ||
|
|
fa4e0447dd | ||
|
|
31aa604fc4 | ||
|
|
3518c89791 | ||
|
|
f44db27565 | ||
|
|
acaab0c6a9 | ||
|
|
9b1abab73a | ||
|
|
cad8f15b61 | ||
|
|
aafbd8c297 | ||
|
|
1d08bcf2e0 | ||
|
|
6d38346eb8 | ||
|
|
9487a5ae91 | ||
|
|
d2bb6a4fc0 | ||
|
|
c3ccecdd4a | ||
|
|
5ad54648ab | ||
|
|
96337cc5df | ||
|
|
fa0ce0927b | ||
|
|
693c2a730f | ||
|
|
0d438a9452 | ||
|
|
bc9eee22b7 | ||
|
|
f74d25b31c | ||
|
|
66af360ce6 | ||
|
|
ad9893c3ab | ||
|
|
1156971d94 | ||
|
|
c79b5c37c4 | ||
|
|
b4e6201b68 | ||
|
|
f26d8d6822 | ||
|
|
3d0b7b9267 | ||
|
|
a2b650a9e3 | ||
|
|
905b442e9b | ||
|
|
7cd95377f9 | ||
|
|
18fe3112bd | ||
|
|
84e85dd0b5 | ||
|
|
2744befbab | ||
|
|
e87dc525b9 | ||
|
|
cc057744ba | ||
|
|
db1779e1db | ||
|
|
ed31b87b2f | ||
|
|
d1e31a3652 | ||
|
|
d25a723fc7 | ||
|
|
3fb4cae7b8 | ||
|
|
f0fe1b431d | ||
|
|
8e286edd25 | ||
|
|
74520b1359 | ||
|
|
0ffcdf2f66 | ||
|
|
fe0edeb011 | ||
|
|
d06e44d37b | ||
|
|
35348d9b81 | ||
|
|
d06a618582 | ||
|
|
4b16e94eaf | ||
|
|
d5253f0420 | ||
|
|
d983676330 | ||
|
|
03c30f3cce | ||
|
|
99b93266ad | ||
|
|
4530b74367 | ||
|
|
e307b57e67 | ||
|
|
5ef9bb2acd | ||
|
|
4aacdc1567 | ||
|
|
57552f4300 | ||
|
|
09d53f7d8c | ||
|
|
161bdc0413 | ||
|
|
44ad362dbc | ||
|
|
ea776aeacc | ||
|
|
e30479329a | ||
|
|
d9948d1a19 | ||
|
|
b962096661 | ||
|
|
725b55a505 | ||
|
|
5f7a4f2bbb | ||
|
|
f555399e2f | ||
|
|
1b6945e0b0 | ||
|
|
4fd55b1bd6 | ||
|
|
fb276cf812 | ||
|
|
41dfaab82a | ||
|
|
20b8deb6de | ||
|
|
6af836c118 | ||
|
|
f87b8a2c2a | ||
|
|
daffd7412a | ||
|
|
bfb60b318e | ||
|
|
a55959dfbb | ||
|
|
4d24eb82be | ||
|
|
4656d3e019 | ||
|
|
86b76ba216 | ||
|
|
ff561410ad | ||
|
|
e26caa2f74 | ||
|
|
b32d17c2ab | ||
|
|
29111e1018 | ||
|
|
3433ebd665 | ||
|
|
b75fff60c8 | ||
|
|
a47fa3f9fc | ||
|
|
4ac57fce7a | ||
|
|
6218b94c99 | ||
|
|
74a6c89801 | ||
|
|
25a9a0120a | ||
|
|
deb0747e66 | ||
|
|
00f5fde5a8 | ||
|
|
03cd354f9e | ||
|
|
66a1fa8af5 | ||
|
|
c2096c8dfd | ||
|
|
1b4033cfce | ||
|
|
750edf1144 | ||
|
|
48bc41873a | ||
|
|
2e54f51229 | ||
|
|
e39e414e0d | ||
|
|
068a1ab99c | ||
|
|
e35d9eb07f | ||
|
|
6551383070 | ||
|
|
b03978cc3d | ||
|
|
3a7233b594 | ||
|
|
82f4c5790a | ||
|
|
5957124e9e | ||
|
|
7c91b9847b | ||
|
|
92a05ca74a | ||
|
|
a3c13c8cea | ||
|
|
d02b5db6dd | ||
|
|
bd074728fe | ||
|
|
8d87531464 | ||
|
|
5fbd3d9525 | ||
|
|
61b7b3ead6 | ||
|
|
8f2178a79c | ||
|
|
72bb23ed0d | ||
|
|
7f7999e3e5 | ||
|
|
0a08e3fdac | ||
|
|
b522b38d31 | ||
|
|
646a2aec66 | ||
|
|
7392cb9bf3 | ||
|
|
2e77988473 | ||
|
|
b2dc7bc232 | ||
|
|
1b25220729 | ||
|
|
4953000565 | ||
|
|
01b7575bca | ||
|
|
f6e6dcac9a | ||
|
|
93c307d9dd | ||
|
|
852c18cef8 | ||
|
|
def622a02c | ||
|
|
acfe1a856e | ||
|
|
9f1f6af647 | ||
|
|
30bedb39f1 | ||
|
|
fbcc4ee32b | ||
|
|
27571cc22f | ||
|
|
1182a5eb1e | ||
|
|
5f57c71c62 | ||
|
|
c0d60b1bcf | ||
|
|
63c68d729b | ||
|
|
5fe29e2ba1 | ||
|
|
16ff1ac3e7 | ||
|
|
0e4f805e1c | ||
|
|
5f29bdc7a7 | ||
|
|
04f8f6d512 | ||
|
|
f4768aff07 | ||
|
|
b74d46f762 | ||
|
|
02decc3901 | ||
|
|
dcdea16624 | ||
|
|
2635cf6345 | ||
|
|
578c65196c | ||
|
|
64fb24ce96 | ||
|
|
45dd7117c7 | ||
|
|
e86069d39c | ||
|
|
e9db714937 | ||
|
|
fdcf153b0b | ||
|
|
8523b7e20a | ||
|
|
29b992bf81 | ||
|
|
4c52509d6d | ||
|
|
8d603a0cef | ||
|
|
9bc067f2e8 | ||
|
|
5fbe0d9a70 | ||
|
|
4c1c36ef46 | ||
|
|
067fbcaeaf | ||
|
|
f0aad83d53 | ||
|
|
474f767e56 | ||
|
|
be062061d5 | ||
|
|
ac5dfab82f | ||
|
|
13d5f4ac99 | ||
|
|
f9030be843 | ||
|
|
3cea1cc78c | ||
|
|
37c1423c9f | ||
|
|
538e35d8f0 | ||
|
|
d23f029953 | ||
|
|
aafa37f80d | ||
|
|
203f0c8abc | ||
|
|
1c0e6362a1 | ||
|
|
68165cee75 | ||
|
|
8ef5f0b3f6 | ||
|
|
d0736b0b56 | ||
|
|
2fbcd9d2b9 | ||
|
|
15b1ed028e | ||
|
|
a611a38181 | ||
|
|
008617a35c | ||
|
|
81a403f02d | ||
|
|
6144a61a2e | ||
|
|
df102fba6c | ||
|
|
5d192abd25 | ||
|
|
902f6dae11 | ||
|
|
62337f445a | ||
|
|
b38c1c5827 | ||
|
|
8309768735 | ||
|
|
42e6b57296 | ||
|
|
2835ec812f | ||
|
|
990161729b | ||
|
|
c08cee2317 | ||
|
|
e1ea4322a1 | ||
|
|
0f7759d070 | ||
|
|
6523c4473f | ||
|
|
4a0842bea6 | ||
|
|
3745e6a8d8 | ||
|
|
3b3666c5f7 | ||
|
|
9e1a28f7ca | ||
|
|
82c7e921eb | ||
|
|
67ccf532ea | ||
|
|
45912911ee | ||
|
|
c7fe42d919 | ||
|
|
9916afaa49 | ||
|
|
55c5a23616 | ||
|
|
7b6df08268 | ||
|
|
9300050573 | ||
|
|
6bee1cc88e | ||
|
|
c94767a715 | ||
|
|
7aa3169523 | ||
|
|
cf86eacb16 | ||
|
|
43ab4d5f38 | ||
|
|
aa064a1d0e | ||
|
|
21240a60de | ||
|
|
0427c0d3a7 | ||
|
|
3f632b92e2 | ||
|
|
014750ea7f | ||
|
|
548b80969a | ||
|
|
e4bbfce314 | ||
|
|
278f1db9a9 | ||
|
|
359429b17e | ||
|
|
f151271cb1 | ||
|
|
6001f6abda | ||
|
|
18e5012546 | ||
|
|
fd9b5d8d16 | ||
|
|
da3ee13582 | ||
|
|
b6f184388a | ||
|
|
903c065b74 | ||
|
|
d8471698ab | ||
|
|
6204cecbbd | ||
|
|
ddeca49916 | ||
|
|
d8dcf37886 | ||
|
|
5ae41a208b | ||
|
|
0462d900e6 | ||
|
|
4fb2ad88bc | ||
|
|
ea55e90e62 | ||
|
|
6025c05f33 | ||
|
|
64f854e646 | ||
|
|
0f962461e1 | ||
|
|
62dfb5b5ff | ||
|
|
171af5a3c3 | ||
|
|
874548d1c1 | ||
|
|
aadc03c38d | ||
|
|
fb0aeafaa2 | ||
|
|
683fa13bb2 | ||
|
|
d3bd55a290 | ||
|
|
e4408a964d | ||
|
|
1fbe78b667 | ||
|
|
4902e0f597 | ||
|
|
34e248b1c3 | ||
|
|
5a05917bc2 | ||
|
|
98a613261c | ||
|
|
ee880a893e | ||
|
|
7e8555d6b7 | ||
|
|
0a6bdd6e04 | ||
|
|
f97f33ab59 | ||
|
|
f59102ee09 | ||
|
|
de304d6bb9 | ||
|
|
73181e3f45 | ||
|
|
e42e4e1ddf | ||
|
|
86e899f39b | ||
|
|
a30079c45b | ||
|
|
f644d49e71 | ||
|
|
c0b09b03d9 | ||
|
|
50ffd9aba6 | ||
|
|
4d4138c1e6 | ||
|
|
936fec1f49 | ||
|
|
9625d87dd5 | ||
|
|
c4d0319bb2 | ||
|
|
802139205c | ||
|
|
6022a3905f | ||
|
|
6f724c62fb | ||
|
|
fb918cb2a4 | ||
|
|
1a74f112ef | ||
|
|
abb4de46d7 | ||
|
|
5747c49abf | ||
|
|
b87930738a | ||
|
|
d2c78516f5 | ||
|
|
93cff96794 | ||
|
|
75e80a0091 | ||
|
|
46d2c9c196 | ||
|
|
6f61d160af | ||
|
|
13419171a9 | ||
|
|
147cfea587 | ||
|
|
c27da8e54e | ||
|
|
f3c8b4c1cd | ||
|
|
09e1883488 | ||
|
|
dce9631399 | ||
|
|
fb2ba1dea0 | ||
|
|
19073534dd | ||
|
|
23080e3cc4 | ||
|
|
b50d3fa809 | ||
|
|
1f191cf9bb | ||
|
|
6c773786d2 | ||
|
|
8939963187 | ||
|
|
e3fb693cb7 | ||
|
|
7cc11f55bb | ||
|
|
f9747d1c4c | ||
|
|
60a3d3409e | ||
|
|
cd8cbc54c8 | ||
|
|
b72124c0d9 | ||
|
|
0d6a1644e2 | ||
|
|
d51e761b26 | ||
|
|
1ebe8b82ec | ||
|
|
1445ef61a0 | ||
|
|
f82490f0d5 | ||
|
|
dfe2ed2a98 | ||
|
|
bb5c044a25 | ||
|
|
be87103b53 | ||
|
|
54f7627f9c | ||
|
|
2fb460c4bb | ||
|
|
1b3c94cc57 | ||
|
|
216ea230a8 | ||
|
|
7e727620a4 | ||
|
|
13ec9bcdd4 | ||
|
|
90096163ee | ||
|
|
d2564d4a54 | ||
|
|
cd178d6a8c | ||
|
|
2aa0b5ddfb | ||
|
|
cf6e026392 | ||
|
|
37f819458a | ||
|
|
16fb0c3081 | ||
|
|
168f4301d2 | ||
|
|
9fb03d9d8a | ||
|
|
d89ed535b7 | ||
|
|
08b4b890ce | ||
|
|
d5a406c60f | ||
|
|
cb16210577 | ||
|
|
8c0e0de45f | ||
|
|
3524cba4ef | ||
|
|
df6a37a972 | ||
|
|
13600ff6fd | ||
|
|
a957bb4968 | ||
|
|
5f8d1cf5b0 | ||
|
|
a115267e08 | ||
|
|
37998fbf1d | ||
|
|
846aa823d4 | ||
|
|
0d877853eb | ||
|
|
68298fc585 | ||
|
|
b97a7cf387 | ||
|
|
e9d75f6d94 | ||
|
|
1dce2eb747 | ||
|
|
7c110d90cd | ||
|
|
2ecc02ce4d | ||
|
|
8fa5277417 | ||
|
|
7cce5745af | ||
|
|
231f1f236d | ||
|
|
ece0a46f97 | ||
|
|
2c9b0b8376 | ||
|
|
76577c03e7 | ||
|
|
48d30250a0 | ||
|
|
a798f2d61c | ||
|
|
d0f8b1436b | ||
|
|
ddc5e0f86e | ||
|
|
ae08c87822 | ||
|
|
ae880e9d1c | ||
|
|
101d2e1de5 | ||
|
|
f6b7708567 | ||
|
|
051286acd1 | ||
|
|
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 | ||
|
|
3fac5ac9f0 | ||
|
|
d83cabbab6 | ||
|
|
5f9d4405b1 | ||
|
|
bdd9efa2cc | ||
|
|
a778e910f7 | ||
|
|
24b09e22f7 | ||
|
|
b40331b04e | ||
|
|
2d1fcb9be8 | ||
|
|
5fcd394ddd | ||
|
|
fe6d69fdcc | ||
|
|
7a0f53ebf3 | ||
|
|
af17265efc | ||
|
|
12b8740bad | ||
|
|
a2580122de | ||
|
|
a6de09a0ca | ||
|
|
5e62791837 | ||
|
|
b60435fb2c | ||
|
|
754430ba75 | ||
|
|
85fc601a7a | ||
|
|
1d5f9cc4cc | ||
|
|
5e3b50c158 | ||
|
|
2262f27d18 | ||
|
|
4668132b37 | ||
|
|
1fc526e80f | ||
|
|
ceb77e2837 | ||
|
|
6f7a29d372 | ||
|
|
137f0251fb | ||
|
|
08745c910c | ||
|
|
1d8658122a | ||
|
|
344eff535a | ||
|
|
e375f3a401 | ||
|
|
10986f8a0d | ||
|
|
f4ae0c9547 | ||
|
|
16dc3860f7 | ||
|
|
4bddf16c82 | ||
|
|
cc414862a4 | ||
|
|
1355f2f562 | ||
|
|
e620062a95 | ||
|
|
333ed629bb | ||
|
|
813b9d90aa | ||
|
|
c87e91d845 | ||
|
|
5fc39daa9d | ||
|
|
09372df86d | ||
|
|
26d0f2f4e3 | ||
|
|
e010a13f85 | ||
|
|
cffca96755 | ||
|
|
7c0605e82f | ||
|
|
a847d890ba | ||
|
|
778ae1b8e5 | ||
|
|
97635f4bba | ||
|
|
a6568a955f | ||
|
|
2657c3aa52 | ||
|
|
1f1ab1664c | ||
|
|
6df4fffafd | ||
|
|
7bac0f32fc | ||
|
|
17b1e08532 | ||
|
|
987f613aae | ||
|
|
dead785133 | ||
|
|
dade17a67f | ||
|
|
64be0ffee5 | ||
|
|
59ceb01d19 | ||
|
|
783e29f189 | ||
|
|
c225456cd4 | ||
|
|
3ea3dfb486 | ||
|
|
7dec189358 | ||
|
|
42d8a9f59d | ||
|
|
9e7caba089 | ||
|
|
af39a3ae9c | ||
|
|
9df6467cd1 | ||
|
|
399f9883a9 | ||
|
|
dd7c1a9245 | ||
|
|
593f21bd3b | ||
|
|
9815216bd5 | ||
|
|
da8a02465e | ||
|
|
ce01534535 | ||
|
|
639c5bc71a | ||
|
|
aec65209d0 | ||
|
|
c985d40ca0 | ||
|
|
d0ca76926e | ||
|
|
1fd15bcd4d | ||
|
|
90b588420f | ||
|
|
073e619015 | ||
|
|
3a0d2a5c51 | ||
|
|
d9528292af | ||
|
|
07a76ced88 | ||
|
|
f022c87f25 | ||
|
|
5d8260b28e | ||
|
|
830dd05514 | ||
|
|
d432ec8105 | ||
|
|
7a24b491e9 | ||
|
|
ca7949d8c4 | ||
|
|
a3805118a0 | ||
|
|
efca40d481 | ||
|
|
34fde09c12 | ||
|
|
0e40dc70b2 | ||
|
|
52452b45b1 | ||
|
|
b9bfd781d0 | ||
|
|
983d518a69 | ||
|
|
c14dec7412 | ||
|
|
662885aaa6 | ||
|
|
f1c03e1b86 | ||
|
|
78ab7547f3 | ||
|
|
2e6957984f | ||
|
|
433a66d530 | ||
|
|
5d67009b18 | ||
|
|
4ffe6a04c2 | ||
|
|
7081448c40 | ||
|
|
7d3ad15f39 | ||
|
|
dfca4d8bec | ||
|
|
0bd245aee5 | ||
|
|
fe730da72f | ||
|
|
c7c1bcfff4 | ||
|
|
d0728afee7 | ||
|
|
4f25c9a408 | ||
|
|
01330bf00c | ||
|
|
01de638b8e | ||
|
|
3e8c7ad1df | ||
|
|
22c6a03161 | ||
|
|
4179e63e30 | ||
|
|
7868a2e9de | ||
|
|
b1f3cda7f7 | ||
|
|
522c5e4eaa | ||
|
|
1e9608de3a | ||
|
|
04b4f7cc0f | ||
|
|
b7db198125 | ||
|
|
dd8b2caa24 | ||
|
|
1e4cfd473c | ||
|
|
00b8c39455 | ||
|
|
cd0e4bfb04 | ||
|
|
4364cb8e53 | ||
|
|
044fb66ca0 | ||
|
|
ad882dd72e | ||
|
|
d4d0dcec61 | ||
|
|
84857d2a32 | ||
|
|
cc17027a7a | ||
|
|
2a33aa029d | ||
|
|
c72f96be19 | ||
|
|
02db5ba532 | ||
|
|
fc52e06318 | ||
|
|
e7f270630c | ||
|
|
29a3c0d554 | ||
|
|
0f5f2658a6 | ||
|
|
27d36f3e0d | ||
|
|
6df872eed2 | ||
|
|
9ce1b90eb1 | ||
|
|
38c19b1442 | ||
|
|
bbae343b0e | ||
|
|
5f5b781f04 | ||
|
|
8e99f37306 | ||
|
|
d3419d218a | ||
|
|
2f34526c55 | ||
|
|
f9dcc9d95c | ||
|
|
ebc355ee6a | ||
|
|
a0b49fbd67 | ||
|
|
ae213c4cf1 | ||
|
|
8dea86b921 | ||
|
|
44003a8fda | ||
|
|
b883bb1e62 | ||
|
|
db35a67bd7 | ||
|
|
1bfc98fa99 | ||
|
|
efb687cbb5 | ||
|
|
668f12391e | ||
|
|
dfaccd6aa5 | ||
|
|
2220f1829f | ||
|
|
65aeb56c2f | ||
|
|
47ad79b81d | ||
|
|
956035b856 | ||
|
|
76fde11f47 | ||
|
|
bc5946c76e | ||
|
|
c0ac5d1487 | ||
|
|
f8852ca759 | ||
|
|
1f041a8acf | ||
|
|
2f957899e1 | ||
|
|
892cb90d62 | ||
|
|
3d7172fdf7 | ||
|
|
3fa3644e1e | ||
|
|
28411d2093 | ||
|
|
26deaca166 | ||
|
|
9b26ed7042 | ||
|
|
1346317ad9 | ||
|
|
05b547b640 | ||
|
|
afa8d9c4d1 | ||
|
|
e11bb71c2d | ||
|
|
95baed1aac | ||
|
|
3b364c7650 | ||
|
|
672f1ae2d6 | ||
|
|
0b607eb751 | ||
|
|
89d945037d | ||
|
|
2a4e242eb2 | ||
|
|
39471212d3 | ||
|
|
8b2237d183 | ||
|
|
6c1a4f1e0d | ||
|
|
abc26b1e5c | ||
|
|
235cbbe23a | ||
|
|
f771607f40 | ||
|
|
2cf7047617 | ||
|
|
b338f486e5 | ||
|
|
b761078c18 | ||
|
|
202d649085 | ||
|
|
1beb5934c2 | ||
|
|
616690391c | ||
|
|
e1e0095d9b | ||
|
|
5d00a2d806 | ||
|
|
465c395294 | ||
|
|
5adb943939 | ||
|
|
a8cbf81851 | ||
|
|
0e78e9c92b | ||
|
|
13309663fb | ||
|
|
4baa593fde | ||
|
|
186b64ea81 | ||
|
|
7c4d640690 | ||
|
|
73bddddba4 | ||
|
|
833206a3b5 | ||
|
|
743baac945 | ||
|
|
0764d076db | ||
|
|
c9fd56116e | ||
|
|
e21240e711 | ||
|
|
99d32a7854 | ||
|
|
620df5ad3e | ||
|
|
504aa19c03 | ||
|
|
9a3effd063 | ||
|
|
d4a49ae68b | ||
|
|
b9cb6dbffb | ||
|
|
be85aab755 | ||
|
|
fcb7a2c3e7 | ||
|
|
ca1018f80b | ||
|
|
b9bd8d88a9 | ||
|
|
21412e0061 | ||
|
|
5761e11157 | ||
|
|
7d3f1235e7 | ||
|
|
473001c95b | ||
|
|
532cc0b4df | ||
|
|
08fb4e3736 | ||
|
|
6b7e66efa5 | ||
|
|
18fd587ab0 | ||
|
|
5fd8139f00 | ||
|
|
ac68744deb | ||
|
|
cec02bc44f | ||
|
|
a924a0b641 | ||
|
|
ee15b04142 | ||
|
|
2c67a66d88 | ||
|
|
1fdb3b7daa | ||
|
|
483cf09676 | ||
|
|
181ed6046e | ||
|
|
ba14330281 | ||
|
|
8ca9c4e7b8 | ||
|
|
bd28c10492 | ||
|
|
4c890d18d1 | ||
|
|
2eb4118d56 | ||
|
|
67d53034df | ||
|
|
355230a97f | ||
|
|
bde5859879 | ||
|
|
630e02f1ce | ||
|
|
1ea2f091e0 | ||
|
|
a5632ec3a4 | ||
|
|
0804a3567a | ||
|
|
ef8c71d27c | ||
|
|
879ea847e9 | ||
|
|
be3c418919 | ||
|
|
7aa252e42f | ||
|
|
a52df9ae9a | ||
|
|
2c749bf5c9 | ||
|
|
24eaa7441c | ||
|
|
1b072e11ad | ||
|
|
0dec9418ca | ||
|
|
9a2174ac2b | ||
|
|
371b100672 | ||
|
|
82f4c9d526 | ||
|
|
eac87c97af | ||
|
|
00dc9969b6 | ||
|
|
2205100942 | ||
|
|
801475e146 | ||
|
|
d7ee243a00 | ||
|
|
d5ceabadb0 | ||
|
|
f3ec69ac2a | ||
|
|
8a6cbeda74 | ||
|
|
13cdb77957 | ||
|
|
caedc314b7 | ||
|
|
d7963bb161 | ||
|
|
e86afefe79 | ||
|
|
1253e241ff | ||
|
|
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 | ||
|
|
80b2b26018 | ||
|
|
e3f523d648 | ||
|
|
bf82cd9e2a | ||
|
|
b952161794 | ||
|
|
b2e3e23182 | ||
|
|
13c0a42d5b | ||
|
|
a734cb8a7e | ||
|
|
7d708339a5 | ||
|
|
43e30ce426 | ||
|
|
fdfc21187c | ||
|
|
59c5acc1f2 | ||
|
|
1c293c2f62 | ||
|
|
0ad2226e47 | ||
|
|
5246647d62 | ||
|
|
1f74899f8a | ||
|
|
e97a5493e4 | ||
|
|
fa3e73e577 | ||
|
|
15cee84695 | ||
|
|
7c483b4bb6 | ||
|
|
9f2f1c7de7 | ||
|
|
62b2a9197b | ||
|
|
3b139a92fb | ||
|
|
2fcb31f3ac | ||
|
|
e3e101b8ff | ||
|
|
525a11d21d | ||
|
|
eef41c067d | ||
|
|
48a0400213 | ||
|
|
48b20299b2 | ||
|
|
50094894aa | ||
|
|
e355a2f6d5 | ||
|
|
a1151584e1 | ||
|
|
2fce93d925 | ||
|
|
25a5e821ef | ||
|
|
db6354b60d | ||
|
|
969a658e15 | ||
|
|
a66ad1f086 | ||
|
|
29ff59b128 | ||
|
|
fe2e257dc0 | ||
|
|
11551a9816 | ||
|
|
d5b7fdab24 | ||
|
|
7bd03d55ba | ||
|
|
d23347e14e | ||
|
|
e5112597a2 | ||
|
|
24271e6780 | ||
|
|
fb16a29392 | ||
|
|
f10d676921 | ||
|
|
5dd8bec6b9 | ||
|
|
5ee190602e | ||
|
|
02aee6f936 | ||
|
|
da45ee201e | ||
|
|
c4d8b64713 | ||
|
|
c90c5c3bfc | ||
|
|
5d9fc356e0 | ||
|
|
b03add80c6 | ||
|
|
d5322466e9 | ||
|
|
290609d581 | ||
|
|
c2a0b1c16b | ||
|
|
a5526d0c73 | ||
|
|
c408485c5b | ||
|
|
4762b88980 | ||
|
|
661094d113 | ||
|
|
6e06288228 | ||
|
|
f5f86e9ba6 | ||
|
|
f562130e96 | ||
|
|
35fbacb196 | ||
|
|
90d825c809 | ||
|
|
48f81d90cc | ||
|
|
68756681fa | ||
|
|
0532c54cd5 | ||
|
|
5c90afea76 | ||
|
|
b6b344a69a | ||
|
|
601c8165d8 | ||
|
|
b612c3a846 | ||
|
|
0bf1204499 | ||
|
|
36a6d5fede | ||
|
|
884b3c7b8d | ||
|
|
4dd6b956aa | ||
|
|
aedd2a6391 | ||
|
|
c2d5f9f428 | ||
|
|
54b49ff0d6 | ||
|
|
5680344dfd | ||
|
|
b0e0926b70 | ||
|
|
27158ee7e8 | ||
|
|
b1be1f5f71 | ||
|
|
6b020e011e | ||
|
|
7995940579 | ||
|
|
3ffdb4fe4b | ||
|
|
9211770056 | ||
|
|
becaf47a66 | ||
|
|
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 | ||
|
|
9ea8443286 | ||
|
|
039be9790d | ||
|
|
1599b14beb | ||
|
|
170f97d013 | ||
|
|
8fa89753b6 | ||
|
|
67bd4429f5 | ||
|
|
98d131881f | ||
|
|
57ff653dc3 | ||
|
|
f8a3e7fc2e | ||
|
|
8910311c5c | ||
|
|
e5fbaeafcd | ||
|
|
90e7711788 | ||
|
|
29e255a7bd | ||
|
|
f76fa58a5f | ||
|
|
c8b36b8c99 | ||
|
|
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 | ||
|
|
5b37e7b249 | ||
|
|
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 | ||
|
|
cfca4fdc46 | ||
|
|
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 | ||
|
|
a4704d0e2f | ||
|
|
76493fb6d7 | ||
|
|
1e783fad29 | ||
|
|
f6af379be6 | ||
|
|
7538f63c00 | ||
|
|
54277da8a5 | ||
|
|
12111c27ad | ||
|
|
b0c294b59b | ||
|
|
60dedb4cbe | ||
|
|
57b55246a6 | ||
|
|
ac4702b57c | ||
|
|
14ff3028e3 | ||
|
|
dd9752b6ed | ||
|
|
7978bbc612 | ||
|
|
bfaf88f017 | ||
|
|
9eb05fa447 | ||
|
|
454a6a8350 | ||
|
|
1f9cc15fb1 | ||
|
|
6db8ba9e2f | ||
|
|
a89c96e3c4 | ||
|
|
fc32252db7 | ||
|
|
fb15a10bc4 | ||
|
|
37dd629cea | ||
|
|
ed851ebc86 | ||
|
|
3d972411f1 | ||
|
|
c1cc36f18a | ||
|
|
9014e27edc | ||
|
|
da5a66d200 | ||
|
|
f246631d3f | ||
|
|
f922b94eb1 | ||
|
|
b5965bbf81 | ||
|
|
c7d8916085 | ||
|
|
76a7a7f6da | ||
|
|
264d7bd3a8 | ||
|
|
d3a3a14e96 | ||
|
|
f397b47a8f | ||
|
|
9f942e0fda | ||
|
|
540861dd25 | ||
|
|
2a63a128cd | ||
|
|
c1d42ef10c | ||
|
|
b737ebb962 | ||
|
|
bcbda4eb64 | ||
|
|
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 | ||
|
|
7306cc1102 | ||
|
|
c765070401 | ||
|
|
1e974c7d3a | ||
|
|
20f74c95bf | ||
|
|
b7159f7334 | ||
|
|
7a97fed8a1 | ||
|
|
1064f2123b | ||
|
|
6e72c4c40a | ||
|
|
b1823824c2 | ||
|
|
6406ce696b | ||
|
|
f0de6ca9e1 | ||
|
|
1e015fd988 | ||
|
|
408f9d9c0c | ||
|
|
0d9d0be0c3 | ||
|
|
afe54e1472 | ||
|
|
0f7c3533ba | ||
|
|
059d8ccfc0 | ||
|
|
bd9022c010 | ||
|
|
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 |
1
.github/workflows/build-docs.yml
vendored
1
.github/workflows/build-docs.yml
vendored
@@ -57,6 +57,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Update apt-get (needed for act docker image)
|
- name: Update apt-get (needed for act docker image)
|
||||||
run: |
|
run: |
|
||||||
|
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
|
|
||||||
- name: Install tree
|
- name: Install tree
|
||||||
|
|||||||
3
.github/workflows/build-includes.yml
vendored
3
.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'
|
||||||
@@ -47,6 +49,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Update apt-get (needed for act docker image)
|
- name: Update apt-get (needed for act docker image)
|
||||||
run: |
|
run: |
|
||||||
|
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
|
|
||||||
- name: Install tree
|
- name: Install tree
|
||||||
|
|||||||
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
|
||||||
|
|
||||||
|
|||||||
@@ -1151,14 +1151,14 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
||||||
|
|
||||||
self:I( "Captured " .. AirbaseName )
|
self:T( "Captured " .. AirbaseName )
|
||||||
|
|
||||||
-- Now search for all squadrons located at the airbase, and sanitize them.
|
-- Now search for all squadrons located at the airbase, and sanitize them.
|
||||||
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||||
if Squadron.AirbaseName == AirbaseName then
|
if Squadron.AirbaseName == AirbaseName then
|
||||||
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||||
Squadron.Captured = true
|
Squadron.Captured = true
|
||||||
self:I( "Squadron " .. SquadronName .. " captured." )
|
self:T( "Squadron " .. SquadronName .. " captured." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1828,7 +1828,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
self:SetSquadronCapInterval( SquadronName, self.DefenderDefault.CapLimit, self.DefenderDefault.CapMinSeconds, self.DefenderDefault.CapMaxSeconds, 1 )
|
self:SetSquadronCapInterval( SquadronName, self.DefenderDefault.CapLimit, self.DefenderDefault.CapMinSeconds, self.DefenderDefault.CapMaxSeconds, 1 )
|
||||||
|
|
||||||
self:I( { CAP = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, Zone, PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageAltType } } )
|
self:T( { CAP = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, Zone, PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageAltType } } )
|
||||||
|
|
||||||
-- Add the CAP to the EWR network.
|
-- Add the CAP to the EWR network.
|
||||||
|
|
||||||
@@ -2085,7 +2085,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
Intercept.EngageCeilingAltitude = EngageCeilingAltitude
|
Intercept.EngageCeilingAltitude = EngageCeilingAltitude
|
||||||
Intercept.EngageAltType = EngageAltType
|
Intercept.EngageAltType = EngageAltType
|
||||||
|
|
||||||
self:I( { GCI = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { GCI = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set squadron GCI.
|
--- Set squadron GCI.
|
||||||
@@ -3000,17 +3000,17 @@ do -- AI_A2A_DISPATCHER
|
|||||||
for FriendlyDistance, AIFriendly in UTILS.spairs( DefenderFriendlies or {} ) do
|
for FriendlyDistance, AIFriendly in UTILS.spairs( DefenderFriendlies or {} ) do
|
||||||
-- We only allow to ENGAGE targets as long as the Units on both sides are balanced.
|
-- We only allow to ENGAGE targets as long as the Units on both sides are balanced.
|
||||||
if AttackerCount > DefenderCount then
|
if AttackerCount > DefenderCount then
|
||||||
--self:I("***** AI_A2A_DISPATCHER:CountDefendersToBeEngaged() *****\nThis is supposed to be a UNIT:")
|
--self:T("***** AI_A2A_DISPATCHER:CountDefendersToBeEngaged() *****\nThis is supposed to be a UNIT:")
|
||||||
if AIFriendly then
|
if AIFriendly then
|
||||||
local classname = AIFriendly.ClassName or "No Class Name"
|
local classname = AIFriendly.ClassName or "No Class Name"
|
||||||
local unitname = AIFriendly.IdentifiableName or "No Unit Name"
|
local unitname = AIFriendly.IdentifiableName or "No Unit Name"
|
||||||
--self:I("Class Name: " .. classname)
|
--self:T("Class Name: " .. classname)
|
||||||
--self:I("Unit Name: " .. unitname)
|
--self:T("Unit Name: " .. unitname)
|
||||||
--self:I({AIFriendly})
|
--self:T({AIFriendly})
|
||||||
end
|
end
|
||||||
local Friendly = nil
|
local Friendly = nil
|
||||||
if AIFriendly and AIFriendly:IsAlive() then
|
if AIFriendly and AIFriendly:IsAlive() then
|
||||||
--self:I("AIFriendly alive, getting GROUP")
|
--self:T("AIFriendly alive, getting GROUP")
|
||||||
Friendly = AIFriendly:GetGroup() -- Wrapper.Group#GROUP
|
Friendly = AIFriendly:GetGroup() -- Wrapper.Group#GROUP
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3952,7 +3952,7 @@ end
|
|||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
--- @type AI_A2A_GCICAP
|
-- @type AI_A2A_GCICAP
|
||||||
-- @extends #AI_A2A_DISPATCHER
|
-- @extends #AI_A2A_DISPATCHER
|
||||||
|
|
||||||
--- Create an automatic air defence system for a coalition setting up GCI and CAP air defenses.
|
--- Create an automatic air defence system for a coalition setting up GCI and CAP air defenses.
|
||||||
@@ -4322,23 +4322,23 @@ do
|
|||||||
|
|
||||||
-- Setup squadrons
|
-- Setup squadrons
|
||||||
|
|
||||||
self:I( { Airbases = AirbaseNames } )
|
self:T( { Airbases = AirbaseNames } )
|
||||||
|
|
||||||
self:I( "Defining Templates for Airbases ..." )
|
self:T( "Defining Templates for Airbases ..." )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
local AirbaseCoord = Airbase:GetCoordinate()
|
local AirbaseCoord = Airbase:GetCoordinate()
|
||||||
local AirbaseZone = ZONE_RADIUS:New( "Airbase", AirbaseCoord:GetVec2(), 3000 )
|
local AirbaseZone = ZONE_RADIUS:New( "Airbase", AirbaseCoord:GetVec2(), 3000 )
|
||||||
local Templates = nil
|
local Templates = nil
|
||||||
self:I( { Airbase = AirbaseName } )
|
self:T( { Airbase = AirbaseName } )
|
||||||
for TemplateID, Template in pairs( self.Templates:GetSet() ) do
|
for TemplateID, Template in pairs( self.Templates:GetSet() ) do
|
||||||
local Template = Template -- Wrapper.Group#GROUP
|
local Template = Template -- Wrapper.Group#GROUP
|
||||||
local TemplateCoord = Template:GetCoordinate()
|
local TemplateCoord = Template:GetCoordinate()
|
||||||
if AirbaseZone:IsVec2InZone( TemplateCoord:GetVec2() ) then
|
if AirbaseZone:IsVec2InZone( TemplateCoord:GetVec2() ) then
|
||||||
Templates = Templates or {}
|
Templates = Templates or {}
|
||||||
table.insert( Templates, Template:GetName() )
|
table.insert( Templates, Template:GetName() )
|
||||||
self:I( { Template = Template:GetName() } )
|
self:T( { Template = Template:GetName() } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Templates then
|
if Templates then
|
||||||
@@ -4354,13 +4354,13 @@ do
|
|||||||
self.CAPTemplates:FilterPrefixes( CapPrefixes )
|
self.CAPTemplates:FilterPrefixes( CapPrefixes )
|
||||||
self.CAPTemplates:FilterOnce()
|
self.CAPTemplates:FilterOnce()
|
||||||
|
|
||||||
self:I( "Setting up CAP ..." )
|
self:T( "Setting up CAP ..." )
|
||||||
for CAPID, CAPTemplate in pairs( self.CAPTemplates:GetSet() ) do
|
for CAPID, CAPTemplate in pairs( self.CAPTemplates:GetSet() ) do
|
||||||
local CAPZone = ZONE_POLYGON:New( CAPTemplate:GetName(), CAPTemplate )
|
local CAPZone = ZONE_POLYGON:New( CAPTemplate:GetName(), CAPTemplate )
|
||||||
-- Now find the closest airbase from the ZONE (start or center)
|
-- Now find the closest airbase from the ZONE (start or center)
|
||||||
local AirbaseDistance = 99999999
|
local AirbaseDistance = 99999999
|
||||||
local AirbaseClosest = nil -- Wrapper.Airbase#AIRBASE
|
local AirbaseClosest = nil -- Wrapper.Airbase#AIRBASE
|
||||||
self:I( { CAPZoneGroup = CAPID } )
|
self:T( { CAPZoneGroup = CAPID } )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
@@ -4368,7 +4368,7 @@ do
|
|||||||
local Squadron = self.DefenderSquadrons[AirbaseName]
|
local Squadron = self.DefenderSquadrons[AirbaseName]
|
||||||
if Squadron then
|
if Squadron then
|
||||||
local Distance = AirbaseCoord:Get2DDistance( CAPZone:GetCoordinate() )
|
local Distance = AirbaseCoord:Get2DDistance( CAPZone:GetCoordinate() )
|
||||||
self:I( { AirbaseDistance = Distance } )
|
self:T( { AirbaseDistance = Distance } )
|
||||||
if Distance < AirbaseDistance then
|
if Distance < AirbaseDistance then
|
||||||
AirbaseDistance = Distance
|
AirbaseDistance = Distance
|
||||||
AirbaseClosest = Airbase
|
AirbaseClosest = Airbase
|
||||||
@@ -4376,7 +4376,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if AirbaseClosest then
|
if AirbaseClosest then
|
||||||
self:I( { CAPAirbase = AirbaseClosest:GetName() } )
|
self:T( { CAPAirbase = AirbaseClosest:GetName() } )
|
||||||
self:SetSquadronCap( AirbaseClosest:GetName(), CAPZone, 6000, 10000, 500, 800, 800, 1200, "RADIO" )
|
self:SetSquadronCap( AirbaseClosest:GetName(), CAPZone, 6000, 10000, 500, 800, 800, 1200, "RADIO" )
|
||||||
self:SetSquadronCapInterval( AirbaseClosest:GetName(), CapLimit, 300, 600, 1 )
|
self:SetSquadronCapInterval( AirbaseClosest:GetName(), CapLimit, 300, 600, 1 )
|
||||||
end
|
end
|
||||||
@@ -4384,14 +4384,14 @@ do
|
|||||||
|
|
||||||
-- Setup GCI.
|
-- Setup GCI.
|
||||||
-- GCI is setup for all Squadrons.
|
-- GCI is setup for all Squadrons.
|
||||||
self:I( "Setting up GCI ..." )
|
self:T( "Setting up GCI ..." )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
local Squadron = self.DefenderSquadrons[AirbaseName]
|
local Squadron = self.DefenderSquadrons[AirbaseName]
|
||||||
self:F( { Airbase = AirbaseName } )
|
self:F( { Airbase = AirbaseName } )
|
||||||
if Squadron then
|
if Squadron then
|
||||||
self:I( { GCIAirbase = AirbaseName } )
|
self:T( { GCIAirbase = AirbaseName } )
|
||||||
self:SetSquadronGci( AirbaseName, 800, 1200 )
|
self:SetSquadronGci( AirbaseName, 800, 1200 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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 )
|
||||||
|
|
||||||
|
|||||||
@@ -904,14 +904,14 @@ do -- AI_A2G_DISPATCHER
|
|||||||
-- @type AI_A2G_DISPATCHER.DefenseCoordinates
|
-- @type AI_A2G_DISPATCHER.DefenseCoordinates
|
||||||
-- @map <#string,Core.Point#COORDINATE> A list of all defense coordinates mapped per defense coordinate name.
|
-- @map <#string,Core.Point#COORDINATE> A list of all defense coordinates mapped per defense coordinate name.
|
||||||
|
|
||||||
--- @field #AI_A2G_DISPATCHER.DefenseCoordinates DefenseCoordinates
|
-- @field #AI_A2G_DISPATCHER.DefenseCoordinates DefenseCoordinates
|
||||||
AI_A2G_DISPATCHER.DefenseCoordinates = {}
|
AI_A2G_DISPATCHER.DefenseCoordinates = {}
|
||||||
|
|
||||||
--- Enumerator for spawns at airbases.
|
--- Enumerator for spawns at airbases.
|
||||||
-- @type AI_A2G_DISPATCHER.Takeoff
|
-- @type AI_A2G_DISPATCHER.Takeoff
|
||||||
-- @extends Wrapper.Group#GROUP.Takeoff
|
-- @extends Wrapper.Group#GROUP.Takeoff
|
||||||
|
|
||||||
--- @field #AI_A2G_DISPATCHER.Takeoff Takeoff
|
-- @field #AI_A2G_DISPATCHER.Takeoff Takeoff
|
||||||
AI_A2G_DISPATCHER.Takeoff = GROUP.Takeoff
|
AI_A2G_DISPATCHER.Takeoff = GROUP.Takeoff
|
||||||
|
|
||||||
--- Defines Landing location.
|
--- Defines Landing location.
|
||||||
@@ -942,7 +942,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
-- @type AI_A2G_DISPATCHER.DefenseQueue
|
-- @type AI_A2G_DISPATCHER.DefenseQueue
|
||||||
-- @list<#AI_A2G_DISPATCHER.DefenseQueueItem> DefenseQueueItem A list of all defenses being queued ...
|
-- @list<#AI_A2G_DISPATCHER.DefenseQueueItem> DefenseQueueItem A list of all defenses being queued ...
|
||||||
|
|
||||||
--- @field #AI_A2G_DISPATCHER.DefenseQueue DefenseQueue
|
-- @field #AI_A2G_DISPATCHER.DefenseQueue DefenseQueue
|
||||||
AI_A2G_DISPATCHER.DefenseQueue = {}
|
AI_A2G_DISPATCHER.DefenseQueue = {}
|
||||||
|
|
||||||
--- Defense approach types.
|
--- Defense approach types.
|
||||||
@@ -1136,7 +1136,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:onafterStart( From, Event, To )
|
function AI_A2G_DISPATCHER:onafterStart( From, Event, To )
|
||||||
|
|
||||||
self:GetParent( self ).onafterStart( self, From, Event, To )
|
self:GetParent( self ).onafterStart( self, From, Event, To )
|
||||||
@@ -1147,7 +1147,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
for Resource = 1, DefenderSquadron.ResourceCount or 0 do
|
for Resource = 1, DefenderSquadron.ResourceCount or 0 do
|
||||||
self:ResourcePark( DefenderSquadron )
|
self:ResourcePark( DefenderSquadron )
|
||||||
end
|
end
|
||||||
self:I( "Parked resources for squadron " .. DefenderSquadron.Name )
|
self:T( "Parked resources for squadron " .. DefenderSquadron.Name )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1201,7 +1201,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:ResourcePark( DefenderSquadron )
|
function AI_A2G_DISPATCHER:ResourcePark( DefenderSquadron )
|
||||||
local TemplateID = math.random( 1, #DefenderSquadron.Spawn )
|
local TemplateID = math.random( 1, #DefenderSquadron.Spawn )
|
||||||
local Spawn = DefenderSquadron.Spawn[ TemplateID ] -- Core.Spawn#SPAWN
|
local Spawn = DefenderSquadron.Spawn[ TemplateID ] -- Core.Spawn#SPAWN
|
||||||
@@ -1218,33 +1218,33 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2G_DISPATCHER:OnEventBaseCaptured( EventData )
|
function AI_A2G_DISPATCHER:OnEventBaseCaptured( EventData )
|
||||||
|
|
||||||
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
||||||
|
|
||||||
self:I( "Captured " .. AirbaseName )
|
self:T( "Captured " .. AirbaseName )
|
||||||
|
|
||||||
-- Now search for all squadrons located at the airbase, and sanitize them.
|
-- Now search for all squadrons located at the airbase, and sanitize them.
|
||||||
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||||
if Squadron.AirbaseName == AirbaseName then
|
if Squadron.AirbaseName == AirbaseName then
|
||||||
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||||
Squadron.Captured = true
|
Squadron.Captured = true
|
||||||
self:I( "Squadron " .. SquadronName .. " captured." )
|
self:T( "Squadron " .. SquadronName .. " captured." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2G_DISPATCHER:OnEventCrashOrDead( EventData )
|
function AI_A2G_DISPATCHER:OnEventCrashOrDead( EventData )
|
||||||
self.Detection:ForgetDetectedUnit( EventData.IniUnitName )
|
self.Detection:ForgetDetectedUnit( EventData.IniUnitName )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2G_DISPATCHER:OnEventLand( EventData )
|
function AI_A2G_DISPATCHER:OnEventLand( EventData )
|
||||||
self:F( "Landed" )
|
self:F( "Landed" )
|
||||||
@@ -1261,7 +1261,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
end
|
end
|
||||||
DefenderUnit:Destroy()
|
DefenderUnit:Destroy()
|
||||||
self:ResourcePark( Squadron, Defender )
|
self:ResourcePark( Squadron )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if DefenderUnit:GetLife() ~= DefenderUnit:GetLife0() then
|
if DefenderUnit:GetLife() ~= DefenderUnit:GetLife0() then
|
||||||
@@ -1273,7 +1273,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2G_DISPATCHER:OnEventEngineShutdown( EventData )
|
function AI_A2G_DISPATCHER:OnEventEngineShutdown( EventData )
|
||||||
local DefenderUnit = EventData.IniUnit
|
local DefenderUnit = EventData.IniUnit
|
||||||
@@ -1289,7 +1289,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
end
|
end
|
||||||
DefenderUnit:Destroy()
|
DefenderUnit:Destroy()
|
||||||
self:ResourcePark( Squadron, Defender )
|
self:ResourcePark( Squadron )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1297,7 +1297,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
|
|
||||||
do -- Manage the defensive behaviour
|
do -- Manage the defensive behaviour
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param #string DefenseCoordinateName The name of the coordinate to be defended by A2G defenses.
|
-- @param #string DefenseCoordinateName The name of the coordinate to be defended by A2G defenses.
|
||||||
-- @param Core.Point#COORDINATE DefenseCoordinate The coordinate to be defended by A2G defenses.
|
-- @param Core.Point#COORDINATE DefenseCoordinate The coordinate to be defended by A2G defenses.
|
||||||
function AI_A2G_DISPATCHER:AddDefenseCoordinate( DefenseCoordinateName, DefenseCoordinate )
|
function AI_A2G_DISPATCHER:AddDefenseCoordinate( DefenseCoordinateName, DefenseCoordinate )
|
||||||
@@ -1305,19 +1305,19 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:SetDefenseReactivityLow()
|
function AI_A2G_DISPATCHER:SetDefenseReactivityLow()
|
||||||
self.DefenseReactivity = 0.05
|
self.DefenseReactivity = 0.05
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:SetDefenseReactivityMedium()
|
function AI_A2G_DISPATCHER:SetDefenseReactivityMedium()
|
||||||
self.DefenseReactivity = 0.15
|
self.DefenseReactivity = 0.15
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:SetDefenseReactivityHigh()
|
function AI_A2G_DISPATCHER:SetDefenseReactivityHigh()
|
||||||
self.DefenseReactivity = 0.5
|
self.DefenseReactivity = 0.5
|
||||||
end
|
end
|
||||||
@@ -1351,14 +1351,14 @@ do -- AI_A2G_DISPATCHER
|
|||||||
-- 1. the **distance of the closest airbase to target**, being smaller than the **Defend Radius**.
|
-- 1. the **distance of the closest airbase to target**, being smaller than the **Defend Radius**.
|
||||||
-- 2. the **distance to any defense reference point**.
|
-- 2. the **distance to any defense reference point**.
|
||||||
--
|
--
|
||||||
-- The **default** defense radius is defined as **400000** or **40km**. Override the default defense radius when the era of the warfare is early, or,
|
-- The **default** defense radius is defined as **40000** or **40km**. Override the default defense radius when the era of the warfare is early, or,
|
||||||
-- when you don't want to let the AI_A2G_DISPATCHER react immediately when a certain border or area is not being crossed.
|
-- when you don't want to let the AI_A2G_DISPATCHER react immediately when a certain border or area is not being crossed.
|
||||||
--
|
--
|
||||||
-- Use the method @{#AI_A2G_DISPATCHER.SetDefendRadius}() to set a specific defend radius for all squadrons,
|
-- Use the method @{#AI_A2G_DISPATCHER.SetDefendRadius}() to set a specific defend radius for all squadrons,
|
||||||
-- **the Defense Radius is defined for ALL squadrons which are operational.**
|
-- **the Defense Radius is defined for ALL squadrons which are operational.**
|
||||||
--
|
--
|
||||||
-- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param #number DefenseRadius (Optional, Default = 200000) The defense radius to engage detected targets from the nearest capable and available squadron airbase.
|
-- @param #number DefenseRadius (Optional, Default = 20000) The defense radius to engage detected targets from the nearest capable and available squadron airbase.
|
||||||
-- @return #AI_A2G_DISPATCHER
|
-- @return #AI_A2G_DISPATCHER
|
||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
@@ -1373,7 +1373,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
function AI_A2G_DISPATCHER:SetDefenseRadius( DefenseRadius )
|
function AI_A2G_DISPATCHER:SetDefenseRadius( DefenseRadius )
|
||||||
|
|
||||||
self.DefenseRadius = DefenseRadius or 100000
|
self.DefenseRadius = DefenseRadius or 40000
|
||||||
|
|
||||||
self.Detection:SetAcceptRange( self.DefenseRadius )
|
self.Detection:SetAcceptRange( self.DefenseRadius )
|
||||||
|
|
||||||
@@ -1868,7 +1868,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
-- @param #string SquadronName The squadron name.
|
-- @param #string SquadronName The squadron name.
|
||||||
-- @param #number TakeoffInterval Only Takeoff new units each specified interval in seconds in 10 seconds steps.
|
-- @param #number TakeoffInterval Only Takeoff new units each specified interval in seconds in 10 seconds steps.
|
||||||
-- @usage
|
-- @usage
|
||||||
@@ -2144,7 +2144,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
Sead.EngageAltType = EngageAltType
|
Sead.EngageAltType = EngageAltType
|
||||||
Sead.Defend = true
|
Sead.Defend = true
|
||||||
|
|
||||||
self:I( { SEAD = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { SEAD = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -2234,7 +2234,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
|
|
||||||
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "SEAD" )
|
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "SEAD" )
|
||||||
|
|
||||||
self:I( { SEAD = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { SEAD = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -2295,7 +2295,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
Cas.EngageAltType = EngageAltType
|
Cas.EngageAltType = EngageAltType
|
||||||
Cas.Defend = true
|
Cas.Defend = true
|
||||||
|
|
||||||
self:I( { CAS = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { CAS = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -2385,7 +2385,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
|
|
||||||
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "CAS" )
|
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "CAS" )
|
||||||
|
|
||||||
self:I( { CAS = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { CAS = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -2446,7 +2446,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
Bai.EngageAltType = EngageAltType
|
Bai.EngageAltType = EngageAltType
|
||||||
Bai.Defend = true
|
Bai.Defend = true
|
||||||
|
|
||||||
self:I( { BAI = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { BAI = { SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -2536,7 +2536,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
|
|
||||||
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "BAI" )
|
self:SetSquadronPatrolInterval( SquadronName, self.DefenderDefault.PatrolLimit, self.DefenderDefault.PatrolMinSeconds, self.DefenderDefault.PatrolMaxSeconds, 1, "BAI" )
|
||||||
|
|
||||||
self:I( { BAI = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
self:T( { BAI = { Zone:GetName(), PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType } } )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -3369,7 +3369,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:AddDefenderToSquadron( Squadron, Defender, Size )
|
function AI_A2G_DISPATCHER:AddDefenderToSquadron( Squadron, Defender, Size )
|
||||||
self.Defenders = self.Defenders or {}
|
self.Defenders = self.Defenders or {}
|
||||||
local DefenderName = Defender:GetName()
|
local DefenderName = Defender:GetName()
|
||||||
@@ -3380,7 +3380,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
self:F( { DefenderName = DefenderName, SquadronResourceCount = Squadron.ResourceCount } )
|
self:F( { DefenderName = DefenderName, SquadronResourceCount = Squadron.ResourceCount } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_DISPATCHER:RemoveDefenderFromSquadron( Squadron, Defender )
|
function AI_A2G_DISPATCHER:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
self.Defenders = self.Defenders or {}
|
self.Defenders = self.Defenders or {}
|
||||||
local DefenderName = Defender:GetName()
|
local DefenderName = Defender:GetName()
|
||||||
@@ -3796,7 +3796,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
Dispatcher:ClearDefenderTaskTarget( DefenderGroup )
|
Dispatcher:ClearDefenderTaskTarget( DefenderGroup )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_Fsm:onafterLostControl( DefenderGroup, From, Event, To )
|
function AI_A2G_Fsm:onafterLostControl( DefenderGroup, From, Event, To )
|
||||||
self:F({"LostControl", DefenderGroup:GetName()})
|
self:F({"LostControl", DefenderGroup:GetName()})
|
||||||
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
||||||
@@ -3813,7 +3813,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_Fsm:onafterHome( DefenderGroup, From, Event, To, Action )
|
function AI_A2G_Fsm:onafterHome( DefenderGroup, From, Event, To, Action )
|
||||||
self:F({"Home", DefenderGroup:GetName()})
|
self:F({"Home", DefenderGroup:GetName()})
|
||||||
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
||||||
@@ -3894,11 +3894,15 @@ do -- AI_A2G_DISPATCHER
|
|||||||
local Squadron = Dispatcher:GetSquadronFromDefender( DefenderGroup )
|
local Squadron = Dispatcher:GetSquadronFromDefender( DefenderGroup )
|
||||||
|
|
||||||
if Squadron then
|
if Squadron then
|
||||||
local FirstUnit = AttackSetUnit:GetFirst()
|
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
|
||||||
@@ -3933,7 +3937,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
Dispatcher:ClearDefenderTaskTarget( DefenderGroup )
|
Dispatcher:ClearDefenderTaskTarget( DefenderGroup )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_Fsm:onafterLostControl( DefenderGroup, From, Event, To )
|
function AI_A2G_Fsm:onafterLostControl( DefenderGroup, From, Event, To )
|
||||||
self:F({"Defender LostControl", DefenderGroup:GetName()})
|
self:F({"Defender LostControl", DefenderGroup:GetName()})
|
||||||
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
||||||
@@ -3950,7 +3954,7 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
function AI_A2G_Fsm:onafterHome( DefenderGroup, From, Event, To, Action )
|
function AI_A2G_Fsm:onafterHome( DefenderGroup, From, Event, To, Action )
|
||||||
self:F({"Defender Home", DefenderGroup:GetName()})
|
self:F({"Defender Home", DefenderGroup:GetName()})
|
||||||
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
self:GetParent(self).onafterHome( self, DefenderGroup, From, Event, To )
|
||||||
@@ -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,7 +9,8 @@
|
|||||||
-- @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
|
||||||
|
|
||||||
--- The AI_AIR class implements the core functions to operate an AI @{Wrapper.Group}.
|
--- The AI_AIR class implements the core functions to operate an AI @{Wrapper.Group}.
|
||||||
@@ -264,7 +265,7 @@ function AI_AIR:New( AIGroup )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP self
|
-- @param Wrapper.Group#GROUP self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function GROUP:OnEventTakeoff( EventData, Fsm )
|
function GROUP:OnEventTakeoff( EventData, Fsm )
|
||||||
Fsm:Takeoff()
|
Fsm:Takeoff()
|
||||||
@@ -446,13 +447,13 @@ function AI_AIR:onafterReturn( Controllable, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
function AI_AIR:onbeforeStatus()
|
function AI_AIR:onbeforeStatus()
|
||||||
|
|
||||||
return self.CheckStatus
|
return self.CheckStatus
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
function AI_AIR:onafterStatus()
|
function AI_AIR:onafterStatus()
|
||||||
|
|
||||||
if self.Controllable and self.Controllable:IsAlive() then
|
if self.Controllable and self.Controllable:IsAlive() then
|
||||||
@@ -465,7 +466,7 @@ function AI_AIR:onafterStatus()
|
|||||||
local DistanceFromHomeBase = self.HomeAirbase:GetCoordinate():Get2DDistance( self.Controllable:GetCoordinate() )
|
local DistanceFromHomeBase = self.HomeAirbase:GetCoordinate():Get2DDistance( self.Controllable:GetCoordinate() )
|
||||||
|
|
||||||
if DistanceFromHomeBase > self.DisengageRadius then
|
if DistanceFromHomeBase > self.DisengageRadius then
|
||||||
self:I( self.Controllable:GetName() .. " is too far from home base, RTB!" )
|
self:T( self.Controllable:GetName() .. " is too far from home base, RTB!" )
|
||||||
self:Hold( 300 )
|
self:Hold( 300 )
|
||||||
RTB = false
|
RTB = false
|
||||||
end
|
end
|
||||||
@@ -489,10 +490,10 @@ function AI_AIR:onafterStatus()
|
|||||||
if Fuel < self.FuelThresholdPercentage then
|
if Fuel < self.FuelThresholdPercentage then
|
||||||
|
|
||||||
if self.TankerName then
|
if self.TankerName then
|
||||||
self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... Refuelling at Tanker!" )
|
self:T( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... Refuelling at Tanker!" )
|
||||||
self:Refuel()
|
self:Refuel()
|
||||||
else
|
else
|
||||||
self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" )
|
self:T( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" )
|
||||||
local OldAIControllable = self.Controllable
|
local OldAIControllable = self.Controllable
|
||||||
|
|
||||||
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
||||||
@@ -518,7 +519,7 @@ function AI_AIR:onafterStatus()
|
|||||||
-- Note that a group can consist of more units, so if one unit is damaged of a group, the mission may continue.
|
-- Note that a group can consist of more units, so if one unit is damaged of a group, the mission may continue.
|
||||||
-- The damaged unit will RTB due to DCS logic, and the others will continue to engage.
|
-- The damaged unit will RTB due to DCS logic, and the others will continue to engage.
|
||||||
if ( Damage / InitialLife ) < self.PatrolDamageThreshold then
|
if ( Damage / InitialLife ) < self.PatrolDamageThreshold then
|
||||||
self:I( self.Controllable:GetName() .. " is damaged: " .. Damage .. " ... RTB!" )
|
self:T( self.Controllable:GetName() .. " is damaged: " .. Damage .. " ... RTB!" )
|
||||||
self:Damaged()
|
self:Damaged()
|
||||||
RTB = true
|
RTB = true
|
||||||
self:SetStatusOff()
|
self:SetStatusOff()
|
||||||
@@ -536,7 +537,7 @@ function AI_AIR:onafterStatus()
|
|||||||
if Damage ~= InitialLife then
|
if Damage ~= InitialLife then
|
||||||
self:Damaged()
|
self:Damaged()
|
||||||
else
|
else
|
||||||
self:I( self.Controllable:GetName() .. " control lost! " )
|
self:T( self.Controllable:GetName() .. " control lost! " )
|
||||||
|
|
||||||
self:LostControl()
|
self:LostControl()
|
||||||
end
|
end
|
||||||
@@ -560,7 +561,7 @@ function AI_AIR:onafterStatus()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR.RTBRoute( AIGroup, Fsm )
|
function AI_AIR.RTBRoute( AIGroup, Fsm )
|
||||||
|
|
||||||
AIGroup:F( { "AI_AIR.RTBRoute:", AIGroup:GetName() } )
|
AIGroup:F( { "AI_AIR.RTBRoute:", AIGroup:GetName() } )
|
||||||
@@ -571,7 +572,7 @@ function AI_AIR.RTBRoute( AIGroup, Fsm )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR.RTBHold( AIGroup, Fsm )
|
function AI_AIR.RTBHold( AIGroup, Fsm )
|
||||||
|
|
||||||
AIGroup:F( { "AI_AIR.RTBHold:", AIGroup:GetName() } )
|
AIGroup:F( { "AI_AIR.RTBHold:", AIGroup:GetName() } )
|
||||||
@@ -598,7 +599,7 @@ function AI_AIR:SetRTBSpeedFactors(MinFactor,MaxFactor)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
||||||
self:F( { AIGroup, From, Event, To } )
|
self:F( { AIGroup, From, Event, To } )
|
||||||
@@ -617,7 +618,10 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
|||||||
--- Calculate the target route point.
|
--- Calculate the target route point.
|
||||||
|
|
||||||
local FromCoord = AIGroup:GetCoordinate()
|
local FromCoord = AIGroup:GetCoordinate()
|
||||||
|
if not FromCoord then return end
|
||||||
|
|
||||||
local ToTargetCoord = self.HomeAirbase:GetCoordinate() -- coordinate is on land height(!)
|
local ToTargetCoord = self.HomeAirbase:GetCoordinate() -- coordinate is on land height(!)
|
||||||
|
|
||||||
local ToTargetVec3 = ToTargetCoord:GetVec3()
|
local ToTargetVec3 = ToTargetCoord:GetVec3()
|
||||||
ToTargetVec3.y = ToTargetCoord:GetLandHeight()+3000 -- let's set this 1000m/3000 feet above ground
|
ToTargetVec3.y = ToTargetCoord:GetLandHeight()+3000 -- let's set this 1000m/3000 feet above ground
|
||||||
local ToTargetCoord2 = COORDINATE:NewFromVec3( ToTargetVec3 )
|
local ToTargetCoord2 = COORDINATE:NewFromVec3( ToTargetVec3 )
|
||||||
@@ -638,13 +642,13 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
|||||||
local ToAirbaseCoord = ToTargetCoord2
|
local ToAirbaseCoord = ToTargetCoord2
|
||||||
|
|
||||||
if Distance < 5000 then
|
if Distance < 5000 then
|
||||||
self:I( "RTB and near the airbase!" )
|
self:T( "RTB and near the airbase!" )
|
||||||
self:Home()
|
self:Home()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not AIGroup:InAir() == true then
|
if not AIGroup:InAir() == true then
|
||||||
self:I( "Not anymore in the air, considered Home." )
|
self:T( "Not anymore in the air, considered Home." )
|
||||||
self:Home()
|
self:Home()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -686,12 +690,12 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR:onafterHome( AIGroup, From, Event, To )
|
function AI_AIR:onafterHome( AIGroup, From, Event, To )
|
||||||
self:F( { AIGroup, From, Event, To } )
|
self:F( { AIGroup, From, Event, To } )
|
||||||
|
|
||||||
self:I( "Group " .. self.Controllable:GetName() .. " ... Home! ( " .. self:GetState() .. " )" )
|
self:T( "Group " .. self.Controllable:GetName() .. " ... Home! ( " .. self:GetState() .. " )" )
|
||||||
|
|
||||||
if AIGroup and AIGroup:IsAlive() then
|
if AIGroup and AIGroup:IsAlive() then
|
||||||
end
|
end
|
||||||
@@ -700,15 +704,17 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR:onafterHold( AIGroup, From, Event, To, HoldTime )
|
function AI_AIR:onafterHold( AIGroup, From, Event, To, HoldTime )
|
||||||
self:F( { AIGroup, From, Event, To } )
|
self:F( { AIGroup, From, Event, To } )
|
||||||
|
|
||||||
self:I( "Group " .. self.Controllable:GetName() .. " ... Holding! ( " .. self:GetState() .. " )" )
|
self:T( "Group " .. self.Controllable:GetName() .. " ... Holding! ( " .. self:GetState() .. " )" )
|
||||||
|
|
||||||
if AIGroup and AIGroup:IsAlive() then
|
if AIGroup and AIGroup:IsAlive() then
|
||||||
local OrbitTask = AIGroup:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
local Coordinate = AIGroup:GetCoordinate()
|
||||||
|
if Coordinate == nil then return end
|
||||||
|
local OrbitTask = AIGroup:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed, Coordinate )
|
||||||
local TimedOrbitTask = AIGroup:TaskControlled( OrbitTask, AIGroup:TaskCondition( nil, nil, nil, nil, HoldTime , nil ) )
|
local TimedOrbitTask = AIGroup:TaskControlled( OrbitTask, AIGroup:TaskCondition( nil, nil, nil, nil, HoldTime , nil ) )
|
||||||
|
|
||||||
local RTBTask = AIGroup:TaskFunction( "AI_AIR.RTBHold", self )
|
local RTBTask = AIGroup:TaskFunction( "AI_AIR.RTBHold", self )
|
||||||
@@ -722,17 +728,17 @@ function AI_AIR:onafterHold( AIGroup, From, Event, To, HoldTime )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR.Resume( AIGroup, Fsm )
|
function AI_AIR.Resume( AIGroup, Fsm )
|
||||||
|
|
||||||
AIGroup:I( { "AI_AIR.Resume:", AIGroup:GetName() } )
|
AIGroup:T( { "AI_AIR.Resume:", AIGroup:GetName() } )
|
||||||
if AIGroup:IsAlive() then
|
if AIGroup:IsAlive() then
|
||||||
Fsm:__RTB( Fsm.TaskDelay )
|
Fsm:__RTB( Fsm.TaskDelay )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
|
function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
|
||||||
self:F( { AIGroup, From, Event, To } )
|
self:F( { AIGroup, From, Event, To } )
|
||||||
@@ -744,7 +750,7 @@ function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
|
|||||||
|
|
||||||
if Tanker and Tanker:IsAlive() and Tanker:IsAirPlane() then
|
if Tanker and Tanker:IsAlive() and Tanker:IsAirPlane() then
|
||||||
|
|
||||||
self:I( "Group " .. self.Controllable:GetName() .. " ... Refuelling! State=" .. self:GetState() .. ", Refuelling tanker " .. self.TankerName )
|
self:T( "Group " .. self.Controllable:GetName() .. " ... Refuelling! State=" .. self:GetState() .. ", Refuelling tanker " .. self.TankerName )
|
||||||
|
|
||||||
local RefuelRoute = {}
|
local RefuelRoute = {}
|
||||||
|
|
||||||
@@ -798,13 +804,13 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
function AI_AIR:onafterDead()
|
function AI_AIR:onafterDead()
|
||||||
self:SetStatusOff()
|
self:SetStatusOff()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR:OnCrash( EventData )
|
function AI_AIR:OnCrash( EventData )
|
||||||
|
|
||||||
@@ -815,7 +821,7 @@ function AI_AIR:OnCrash( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR:OnEjection( EventData )
|
function AI_AIR:OnEjection( EventData )
|
||||||
|
|
||||||
@@ -824,7 +830,7 @@ function AI_AIR:OnEjection( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR self
|
-- @param #AI_AIR self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR:OnPilotDead( EventData )
|
function AI_AIR:OnPilotDead( EventData )
|
||||||
|
|
||||||
|
|||||||
@@ -900,14 +900,14 @@ do -- AI_AIR_DISPATCHER
|
|||||||
-- @type AI_AIR_DISPATCHER.DefenseCoordinates
|
-- @type AI_AIR_DISPATCHER.DefenseCoordinates
|
||||||
-- @map <#string,Core.Point#COORDINATE> A list of all defense coordinates mapped per defense coordinate name.
|
-- @map <#string,Core.Point#COORDINATE> A list of all defense coordinates mapped per defense coordinate name.
|
||||||
|
|
||||||
--- @field #AI_AIR_DISPATCHER.DefenseCoordinates DefenseCoordinates
|
-- @field #AI_AIR_DISPATCHER.DefenseCoordinates DefenseCoordinates
|
||||||
AI_AIR_DISPATCHER.DefenseCoordinates = {}
|
AI_AIR_DISPATCHER.DefenseCoordinates = {}
|
||||||
|
|
||||||
--- Enumerator for spawns at airbases
|
--- Enumerator for spawns at airbases
|
||||||
-- @type AI_AIR_DISPATCHER.Takeoff
|
-- @type AI_AIR_DISPATCHER.Takeoff
|
||||||
-- @extends Wrapper.Group#GROUP.Takeoff
|
-- @extends Wrapper.Group#GROUP.Takeoff
|
||||||
|
|
||||||
--- @field #AI_AIR_DISPATCHER.Takeoff Takeoff
|
-- @field #AI_AIR_DISPATCHER.Takeoff Takeoff
|
||||||
AI_AIR_DISPATCHER.Takeoff = GROUP.Takeoff
|
AI_AIR_DISPATCHER.Takeoff = GROUP.Takeoff
|
||||||
|
|
||||||
--- Defnes Landing location.
|
--- Defnes Landing location.
|
||||||
@@ -938,7 +938,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
-- @type AI_AIR_DISPATCHER.DefenseQueue
|
-- @type AI_AIR_DISPATCHER.DefenseQueue
|
||||||
-- @list<#AI_AIR_DISPATCHER.DefenseQueueItem> DefenseQueueItem A list of all defenses being queued ...
|
-- @list<#AI_AIR_DISPATCHER.DefenseQueueItem> DefenseQueueItem A list of all defenses being queued ...
|
||||||
|
|
||||||
--- @field #AI_AIR_DISPATCHER.DefenseQueue DefenseQueue
|
-- @field #AI_AIR_DISPATCHER.DefenseQueue DefenseQueue
|
||||||
AI_AIR_DISPATCHER.DefenseQueue = {}
|
AI_AIR_DISPATCHER.DefenseQueue = {}
|
||||||
|
|
||||||
--- Defense approach types
|
--- Defense approach types
|
||||||
@@ -1130,7 +1130,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
function AI_AIR_DISPATCHER:onafterStart( From, Event, To )
|
function AI_AIR_DISPATCHER:onafterStart( From, Event, To )
|
||||||
|
|
||||||
self:GetParent( self ).onafterStart( self, From, Event, To )
|
self:GetParent( self ).onafterStart( self, From, Event, To )
|
||||||
@@ -1141,7 +1141,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
for Resource = 1, DefenderSquadron.ResourceCount or 0 do
|
for Resource = 1, DefenderSquadron.ResourceCount or 0 do
|
||||||
self:ResourcePark( DefenderSquadron )
|
self:ResourcePark( DefenderSquadron )
|
||||||
end
|
end
|
||||||
self:I( "Parked resources for squadron " .. DefenderSquadron.Name )
|
self:T( "Parked resources for squadron " .. DefenderSquadron.Name )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1194,7 +1194,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
function AI_AIR_DISPATCHER:ResourcePark( DefenderSquadron )
|
function AI_AIR_DISPATCHER:ResourcePark( DefenderSquadron )
|
||||||
local TemplateID = math.random( 1, #DefenderSquadron.Spawn )
|
local TemplateID = math.random( 1, #DefenderSquadron.Spawn )
|
||||||
local Spawn = DefenderSquadron.Spawn[ TemplateID ] -- Core.Spawn#SPAWN
|
local Spawn = DefenderSquadron.Spawn[ TemplateID ] -- Core.Spawn#SPAWN
|
||||||
@@ -1211,31 +1211,31 @@ do -- AI_AIR_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR_DISPATCHER:OnEventBaseCaptured( EventData )
|
function AI_AIR_DISPATCHER:OnEventBaseCaptured( EventData )
|
||||||
|
|
||||||
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
||||||
|
|
||||||
self:I( "Captured " .. AirbaseName )
|
self:T( "Captured " .. AirbaseName )
|
||||||
|
|
||||||
-- Now search for all squadrons located at the airbase, and sanitize them.
|
-- Now search for all squadrons located at the airbase, and sanitize them.
|
||||||
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||||
if Squadron.AirbaseName == AirbaseName then
|
if Squadron.AirbaseName == AirbaseName then
|
||||||
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
Squadron.ResourceCount = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||||
Squadron.Captured = true
|
Squadron.Captured = true
|
||||||
self:I( "Squadron " .. SquadronName .. " captured." )
|
self:T( "Squadron " .. SquadronName .. " captured." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR_DISPATCHER:OnEventCrashOrDead( EventData )
|
function AI_AIR_DISPATCHER:OnEventCrashOrDead( EventData )
|
||||||
self.Detection:ForgetDetectedUnit( EventData.IniUnitName )
|
self.Detection:ForgetDetectedUnit( EventData.IniUnitName )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR_DISPATCHER:OnEventLand( EventData )
|
function AI_AIR_DISPATCHER:OnEventLand( EventData )
|
||||||
self:F( "Landed" )
|
self:F( "Landed" )
|
||||||
@@ -1252,7 +1252,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
end
|
end
|
||||||
DefenderUnit:Destroy()
|
DefenderUnit:Destroy()
|
||||||
self:ResourcePark( Squadron, Defender )
|
self:ResourcePark( Squadron )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if DefenderUnit:GetLife() ~= DefenderUnit:GetLife0() then
|
if DefenderUnit:GetLife() ~= DefenderUnit:GetLife0() then
|
||||||
@@ -1263,7 +1263,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR_DISPATCHER:OnEventEngineShutdown( EventData )
|
function AI_AIR_DISPATCHER:OnEventEngineShutdown( EventData )
|
||||||
local DefenderUnit = EventData.IniUnit
|
local DefenderUnit = EventData.IniUnit
|
||||||
@@ -1279,31 +1279,31 @@ do -- AI_AIR_DISPATCHER
|
|||||||
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
self:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
end
|
end
|
||||||
DefenderUnit:Destroy()
|
DefenderUnit:Destroy()
|
||||||
self:ResourcePark( Squadron, Defender )
|
self:ResourcePark( Squadron )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- Manage the defensive behaviour
|
do -- Manage the defensive behaviour
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param #string DefenseCoordinateName The name of the coordinate to be defended by AIR defenses.
|
-- @param #string DefenseCoordinateName The name of the coordinate to be defended by AIR defenses.
|
||||||
-- @param Core.Point#COORDINATE DefenseCoordinate The coordinate to be defended by AIR defenses.
|
-- @param Core.Point#COORDINATE DefenseCoordinate The coordinate to be defended by AIR defenses.
|
||||||
function AI_AIR_DISPATCHER:AddDefenseCoordinate( DefenseCoordinateName, DefenseCoordinate )
|
function AI_AIR_DISPATCHER:AddDefenseCoordinate( DefenseCoordinateName, DefenseCoordinate )
|
||||||
self.DefenseCoordinates[DefenseCoordinateName] = DefenseCoordinate
|
self.DefenseCoordinates[DefenseCoordinateName] = DefenseCoordinate
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
function AI_AIR_DISPATCHER:SetDefenseReactivityLow()
|
function AI_AIR_DISPATCHER:SetDefenseReactivityLow()
|
||||||
self.DefenseReactivity = 0.05
|
self.DefenseReactivity = 0.05
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
function AI_AIR_DISPATCHER:SetDefenseReactivityMedium()
|
function AI_AIR_DISPATCHER:SetDefenseReactivityMedium()
|
||||||
self.DefenseReactivity = 0.15
|
self.DefenseReactivity = 0.15
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
function AI_AIR_DISPATCHER:SetDefenseReactivityHigh()
|
function AI_AIR_DISPATCHER:SetDefenseReactivityHigh()
|
||||||
self.DefenseReactivity = 0.5
|
self.DefenseReactivity = 0.5
|
||||||
end
|
end
|
||||||
@@ -1867,7 +1867,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param #string SquadronName The squadron name.
|
-- @param #string SquadronName The squadron name.
|
||||||
-- @param #number TakeoffInterval Only Takeoff new units each specified interval in seconds in 10 seconds steps.
|
-- @param #number TakeoffInterval Only Takeoff new units each specified interval in seconds in 10 seconds steps.
|
||||||
-- @usage
|
-- @usage
|
||||||
@@ -2769,7 +2769,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
|
|
||||||
-- TODO: Need to model the resources in a squadron.
|
-- TODO: Need to model the resources in a squadron.
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param AI.AI_Air_Squadron#AI_AIR_SQUADRON Squadron
|
-- @param AI.AI_Air_Squadron#AI_AIR_SQUADRON Squadron
|
||||||
function AI_AIR_DISPATCHER:AddDefenderToSquadron( Squadron, Defender, Size )
|
function AI_AIR_DISPATCHER:AddDefenderToSquadron( Squadron, Defender, Size )
|
||||||
self.Defenders = self.Defenders or {}
|
self.Defenders = self.Defenders or {}
|
||||||
@@ -2782,7 +2782,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
self:F( { DefenderName = DefenderName, SquadronResourceCount = Squadron.ResourceCount } )
|
self:F( { DefenderName = DefenderName, SquadronResourceCount = Squadron.ResourceCount } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param AI.AI_Air_Squadron#AI_AIR_SQUADRON Squadron
|
-- @param AI.AI_Air_Squadron#AI_AIR_SQUADRON Squadron
|
||||||
function AI_AIR_DISPATCHER:RemoveDefenderFromSquadron( Squadron, Defender )
|
function AI_AIR_DISPATCHER:RemoveDefenderFromSquadron( Squadron, Defender )
|
||||||
self.Defenders = self.Defenders or {}
|
self.Defenders = self.Defenders or {}
|
||||||
@@ -2795,7 +2795,7 @@ do -- AI_AIR_DISPATCHER
|
|||||||
self:F( { DefenderName = DefenderName, SquadronResourceCount = SquadronResourceCount } )
|
self:F( { DefenderName = DefenderName, SquadronResourceCount = SquadronResourceCount } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_DISPATCHER self
|
-- @param #AI_AIR_DISPATCHER self
|
||||||
-- @param Wrapper.Group#GROUP Defender
|
-- @param Wrapper.Group#GROUP Defender
|
||||||
-- @return AI.AI_Air_Squadron#AI_AIR_SQUADRON The Squadron.
|
-- @return AI.AI_Air_Squadron#AI_AIR_SQUADRON The Squadron.
|
||||||
function AI_AIR_DISPATCHER:GetSquadronFromDefender( Defender )
|
function AI_AIR_DISPATCHER:GetSquadronFromDefender( Defender )
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_AIR_ENGAGE
|
-- @type AI_AIR_ENGAGE
|
||||||
-- @extends AI.AI_Air#AI_AIR
|
-- @extends AI.AI_AIR#AI_AIR
|
||||||
|
|
||||||
|
|
||||||
--- 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.
|
||||||
@@ -351,7 +351,7 @@ function AI_AIR_ENGAGE:onafterAbort( AIGroup, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_ENGAGE self
|
-- @param #AI_AIR_ENGAGE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup The Group Object managed by the FSM.
|
-- @param Wrapper.Group#GROUP AIGroup The Group 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.
|
||||||
@@ -361,7 +361,7 @@ function AI_AIR_ENGAGE:onafterAccomplish( AIGroup, From, Event, To )
|
|||||||
--self:SetDetectionOff()
|
--self:SetDetectionOff()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_ENGAGE self
|
-- @param #AI_AIR_ENGAGE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup The Group Object managed by the FSM.
|
-- @param Wrapper.Group#GROUP AIGroup The Group 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.
|
||||||
@@ -374,7 +374,7 @@ function AI_AIR_ENGAGE:onafterDestroy( AIGroup, From, Event, To, EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_AIR_ENGAGE self
|
-- @param #AI_AIR_ENGAGE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_AIR_ENGAGE:OnEventDead( EventData )
|
function AI_AIR_ENGAGE:OnEventDead( EventData )
|
||||||
self:F( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
@@ -387,9 +387,9 @@ function AI_AIR_ENGAGE:OnEventDead( EventData )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIControllable
|
-- @param Wrapper.Group#GROUP AIControllable
|
||||||
function AI_AIR_ENGAGE.___EngageRoute( AIGroup, Fsm, AttackSetUnit )
|
function AI_AIR_ENGAGE.___EngageRoute( AIGroup, Fsm, AttackSetUnit )
|
||||||
Fsm:I(string.format("AI_AIR_ENGAGE.___EngageRoute: %s", tostring(AIGroup:GetName())))
|
Fsm:T(string.format("AI_AIR_ENGAGE.___EngageRoute: %s", tostring(AIGroup:GetName())))
|
||||||
|
|
||||||
if AIGroup and AIGroup:IsAlive() then
|
if AIGroup and AIGroup:IsAlive() then
|
||||||
Fsm:__EngageRoute( Fsm.TaskDelay or 0.1, AttackSetUnit )
|
Fsm:__EngageRoute( Fsm.TaskDelay or 0.1, AttackSetUnit )
|
||||||
@@ -397,14 +397,14 @@ function AI_AIR_ENGAGE.___EngageRoute( AIGroup, Fsm, AttackSetUnit )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_ENGAGE self
|
-- @param #AI_AIR_ENGAGE self
|
||||||
-- @param Wrapper.Group#GROUP DefenderGroup The GroupGroup managed by the FSM.
|
-- @param Wrapper.Group#GROUP DefenderGroup The GroupGroup 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.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
-- @param Core.Set#SET_UNIT AttackSetUnit Unit set to be attacked.
|
-- @param Core.Set#SET_UNIT AttackSetUnit Unit set to be attacked.
|
||||||
function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, AttackSetUnit )
|
function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, AttackSetUnit )
|
||||||
self:I( { DefenderGroup, From, Event, To, AttackSetUnit } )
|
self:T( { DefenderGroup, From, Event, To, AttackSetUnit } )
|
||||||
|
|
||||||
local DefenderGroupName = DefenderGroup:GetName()
|
local DefenderGroupName = DefenderGroup:GetName()
|
||||||
|
|
||||||
@@ -426,7 +426,13 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac
|
|||||||
local DefenderCoord = DefenderGroup:GetPointVec3()
|
local DefenderCoord = DefenderGroup:GetPointVec3()
|
||||||
DefenderCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
DefenderCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
||||||
|
|
||||||
local TargetCoord = AttackSetUnit:GetFirst():GetPointVec3()
|
local TargetCoord = AttackSetUnit:GetRandomSurely():GetPointVec3()
|
||||||
|
|
||||||
|
if TargetCoord == nil then
|
||||||
|
self:Return()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
TargetCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
TargetCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
||||||
|
|
||||||
local TargetDistance = DefenderCoord:Get2DDistance( TargetCoord )
|
local TargetDistance = DefenderCoord:Get2DDistance( TargetCoord )
|
||||||
@@ -435,12 +441,12 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac
|
|||||||
-- TODO: A factor of * 3 is way too close. This causes the AI not to engange until merged sometimes!
|
-- TODO: A factor of * 3 is way too close. This causes the AI not to engange until merged sometimes!
|
||||||
if TargetDistance <= EngageDistance * 9 then
|
if TargetDistance <= EngageDistance * 9 then
|
||||||
|
|
||||||
--self:I(string.format("AI_AIR_ENGAGE onafterEngageRoute ==> __Engage - target distance = %.1f km", TargetDistance/1000))
|
--self:T(string.format("AI_AIR_ENGAGE onafterEngageRoute ==> __Engage - target distance = %.1f km", TargetDistance/1000))
|
||||||
self:__Engage( 0.1, AttackSetUnit )
|
self:__Engage( 0.1, AttackSetUnit )
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
--self:I(string.format("FF AI_AIR_ENGAGE onafterEngageRoute ==> Routing - target distance = %.1f km", TargetDistance/1000))
|
--self:T(string.format("FF AI_AIR_ENGAGE onafterEngageRoute ==> Routing - target distance = %.1f km", TargetDistance/1000))
|
||||||
|
|
||||||
local EngageRoute = {}
|
local EngageRoute = {}
|
||||||
local AttackTasks = {}
|
local AttackTasks = {}
|
||||||
@@ -472,16 +478,16 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- TODO: This will make an A2A Dispatcher CAP flight to return rather than going back to patrolling!
|
-- TODO: This will make an A2A Dispatcher CAP flight to return rather than going back to patrolling!
|
||||||
self:I( DefenderGroupName .. ": No targets found -> Going RTB")
|
self:T( DefenderGroupName .. ": No targets found -> Going RTB")
|
||||||
self:Return()
|
self:Return()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIControllable
|
-- @param Wrapper.Group#GROUP AIControllable
|
||||||
function AI_AIR_ENGAGE.___Engage( AIGroup, Fsm, AttackSetUnit )
|
function AI_AIR_ENGAGE.___Engage( AIGroup, Fsm, AttackSetUnit )
|
||||||
|
|
||||||
Fsm:I(string.format("AI_AIR_ENGAGE.___Engage: %s", tostring(AIGroup:GetName())))
|
Fsm:T(string.format("AI_AIR_ENGAGE.___Engage: %s", tostring(AIGroup:GetName())))
|
||||||
|
|
||||||
if AIGroup and AIGroup:IsAlive() then
|
if AIGroup and AIGroup:IsAlive() then
|
||||||
local delay=Fsm.TaskDelay or 0.1
|
local delay=Fsm.TaskDelay or 0.1
|
||||||
@@ -490,7 +496,7 @@ function AI_AIR_ENGAGE.___Engage( AIGroup, Fsm, AttackSetUnit )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_AIR_ENGAGE self
|
-- @param #AI_AIR_ENGAGE self
|
||||||
-- @param Wrapper.Group#GROUP DefenderGroup The GroupGroup managed by the FSM.
|
-- @param Wrapper.Group#GROUP DefenderGroup The GroupGroup 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.
|
||||||
@@ -516,7 +522,7 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU
|
|||||||
local DefenderCoord = DefenderGroup:GetPointVec3()
|
local DefenderCoord = DefenderGroup:GetPointVec3()
|
||||||
DefenderCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
DefenderCoord:SetY( EngageAltitude ) -- Ground targets don't have an altitude.
|
||||||
|
|
||||||
local TargetCoord = AttackSetUnit:GetFirst():GetPointVec3()
|
local TargetCoord = AttackSetUnit:GetRandomSurely():GetPointVec3()
|
||||||
if not TargetCoord then
|
if not TargetCoord then
|
||||||
self:Return()
|
self:Return()
|
||||||
return
|
return
|
||||||
@@ -547,12 +553,12 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU
|
|||||||
local AttackUnitTasks = self:CreateAttackUnitTasks( AttackSetUnit, DefenderGroup, EngageAltitude ) -- Polymorphic
|
local AttackUnitTasks = self:CreateAttackUnitTasks( AttackSetUnit, DefenderGroup, EngageAltitude ) -- Polymorphic
|
||||||
|
|
||||||
if #AttackUnitTasks == 0 then
|
if #AttackUnitTasks == 0 then
|
||||||
self:I( DefenderGroupName .. ": No valid targets found -> Going RTB")
|
self:T( DefenderGroupName .. ": No valid targets found -> Going RTB")
|
||||||
self:Return()
|
self:Return()
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
local text=string.format("%s: Engaging targets at distance %.2f NM", DefenderGroupName, UTILS.MetersToNM(TargetDistance))
|
local text=string.format("%s: Engaging targets at distance %.2f NM", DefenderGroupName, UTILS.MetersToNM(TargetDistance))
|
||||||
self:I(text)
|
self:T(text)
|
||||||
DefenderGroup:OptionROEOpenFire()
|
DefenderGroup:OptionROEOpenFire()
|
||||||
DefenderGroup:OptionROTEvadeFire()
|
DefenderGroup:OptionROTEvadeFire()
|
||||||
DefenderGroup:OptionKeepWeaponsOnThreat()
|
DefenderGroup:OptionKeepWeaponsOnThreat()
|
||||||
@@ -569,13 +575,13 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- TODO: This will make an A2A Dispatcher CAP flight to return rather than going back to patrolling!
|
-- TODO: This will make an A2A Dispatcher CAP flight to return rather than going back to patrolling!
|
||||||
self:I( DefenderGroupName .. ": No targets found -> returning.")
|
self:T( DefenderGroupName .. ": No targets found -> returning.")
|
||||||
self:Return()
|
self:Return()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AIEngage
|
-- @param Wrapper.Group#GROUP AIEngage
|
||||||
function AI_AIR_ENGAGE.Resume( AIEngage, Fsm )
|
function AI_AIR_ENGAGE.Resume( AIEngage, Fsm )
|
||||||
|
|
||||||
AIEngage:F( { "Resume:", AIEngage:GetName() } )
|
AIEngage:F( { "Resume:", AIEngage:GetName() } )
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_AIR_SQUADRON
|
-- @type AI_AIR_SQUADRON
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ AI_AIR_SQUADRON = {
|
|||||||
-- @return #AI_AIR_SQUADRON
|
-- @return #AI_AIR_SQUADRON
|
||||||
function AI_AIR_SQUADRON:New( SquadronName, AirbaseName, TemplatePrefixes, ResourceCount )
|
function AI_AIR_SQUADRON:New( SquadronName, AirbaseName, TemplatePrefixes, ResourceCount )
|
||||||
|
|
||||||
self:I( { Air_Squadron = { SquadronName, AirbaseName, TemplatePrefixes, ResourceCount } } )
|
self:T( { Air_Squadron = { SquadronName, AirbaseName, TemplatePrefixes, ResourceCount } } )
|
||||||
|
|
||||||
local AI_Air_Squadron = BASE:New() -- #AI_AIR_SQUADRON
|
local AI_Air_Squadron = BASE:New() -- #AI_AIR_SQUADRON
|
||||||
|
|
||||||
|
|||||||
@@ -174,8 +174,7 @@ function AI_BAI_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
|
|||||||
-- @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.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
|
|
||||||
-- @return #boolean Return false to cancel Transition.
|
-- @return #boolean Return false to cancel Transition.
|
||||||
|
|
||||||
--- OnAfter Transition Handler for Event Engage.
|
--- OnAfter Transition Handler for Event Engage.
|
||||||
@@ -408,7 +407,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 +416,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 +428,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 +477,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 +487,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 +611,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 +622,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 +636,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 } )
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ function AI_CAS_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
|
|||||||
-- @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.
|
||||||
|
|
||||||
-- @return #boolean Return false to cancel Transition.
|
-- @return #boolean Return false to cancel Transition.
|
||||||
|
|
||||||
--- OnAfter Transition Handler for Event Engage.
|
--- OnAfter Transition Handler for Event Engage.
|
||||||
@@ -363,7 +362,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 +374,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 +386,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 +419,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 +429,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 +529,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 +540,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 +554,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
|
-- @module AI.AI_Cargo
|
||||||
-- @image Cargo.JPG
|
-- @image Cargo.JPG
|
||||||
|
|
||||||
--- @type AI_CARGO
|
-- @type AI_CARGO
|
||||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ function AI_CARGO:onafterUnloaded( Carrier, From, Event, To, Cargo, CarrierUnit,
|
|||||||
for _, CarrierUnit in pairs( Carrier:GetUnits() ) do
|
for _, CarrierUnit in pairs( Carrier:GetUnits() ) do
|
||||||
local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT
|
local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT
|
||||||
local IsEmpty = CarrierUnit:IsCargoEmpty()
|
local IsEmpty = CarrierUnit:IsCargoEmpty()
|
||||||
self:I({ IsEmpty = IsEmpty })
|
self:T({ IsEmpty = IsEmpty })
|
||||||
if not IsEmpty then
|
if not IsEmpty then
|
||||||
AllUnloaded = false
|
AllUnloaded = false
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
-- @image AI_Cargo_Dispatcher.JPG
|
-- @image AI_Cargo_Dispatcher.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_CARGO_DISPATCHER
|
-- @type AI_CARGO_DISPATCHER
|
||||||
-- @field Core.Set#SET_GROUP CarrierSet The set of @{Wrapper.Group#GROUP} objects of carriers that will transport the cargo.
|
-- @field Core.Set#SET_GROUP CarrierSet The set of @{Wrapper.Group#GROUP} objects of carriers that will transport the cargo.
|
||||||
-- @field Core.Set#SET_CARGO CargoSet The set of @{Cargo.Cargo#CARGO} objects, which can be CARGO_GROUP, CARGO_CRATE, CARGO_SLINGLOAD objects.
|
-- @field Core.Set#SET_CARGO CargoSet The set of @{Cargo.Cargo#CARGO} objects, which can be CARGO_GROUP, CARGO_CRATE, CARGO_SLINGLOAD objects.
|
||||||
-- @field Core.Zone#SET_ZONE PickupZoneSet The set of pickup zones, which are used to where the cargo can be picked up by the carriers. If nil, then cargo can be picked up everywhere.
|
-- @field Core.Zone#SET_ZONE PickupZoneSet The set of pickup zones, which are used to where the cargo can be picked up by the carriers. If nil, then cargo can be picked up everywhere.
|
||||||
@@ -1161,7 +1161,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
else
|
else
|
||||||
local text=string.format("WARNING: Cargo %s is too heavy to be loaded into transport. Cargo weight %.1f > %.1f load capacity of carrier %s.",
|
local text=string.format("WARNING: Cargo %s is too heavy to be loaded into transport. Cargo weight %.1f > %.1f load capacity of carrier %s.",
|
||||||
tostring(Cargo:GetName()), Cargo:GetWeight(), LargestLoadCapacity, tostring(Carrier:GetName()))
|
tostring(Cargo:GetName()), Cargo:GetWeight(), LargestLoadCapacity, tostring(Carrier:GetName()))
|
||||||
self:I(text)
|
self:T(text)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ function AI_ESCORT:SetFlightMenuFormation( Formation )
|
|||||||
|
|
||||||
if MenuFormation then
|
if MenuFormation then
|
||||||
local Arguments = MenuFormation.Arguments
|
local Arguments = MenuFormation.Arguments
|
||||||
--self:I({Arguments=unpack(Arguments)})
|
--self:T({Arguments=unpack(Arguments)})
|
||||||
local FlightMenuFormation = MENU_GROUP:New( self.PlayerGroup, "Formation", self.MainMenu )
|
local FlightMenuFormation = MENU_GROUP:New( self.PlayerGroup, "Formation", self.MainMenu )
|
||||||
local MenuFlightFormationID = MENU_GROUP_COMMAND:New( self.PlayerGroup, Formation, FlightMenuFormation,
|
local MenuFlightFormationID = MENU_GROUP_COMMAND:New( self.PlayerGroup, Formation, FlightMenuFormation,
|
||||||
function ( self, Formation, ... )
|
function ( self, Formation, ... )
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
|
|
||||||
--- @type AI_ESCORT_DISPATCHER
|
-- @type AI_ESCORT_DISPATCHER
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ AI_ESCORT_DISPATCHER = {
|
|||||||
ClassName = "AI_ESCORT_DISPATCHER",
|
ClassName = "AI_ESCORT_DISPATCHER",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @field #list
|
-- @field #list
|
||||||
AI_ESCORT_DISPATCHER.AI_Escorts = {}
|
AI_ESCORT_DISPATCHER.AI_Escorts = {}
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ function AI_ESCORT_DISPATCHER:onafterStart( From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_DISPATCHER self
|
-- @param #AI_ESCORT_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_ESCORT_DISPATCHER:OnEventExit( EventData )
|
function AI_ESCORT_DISPATCHER:OnEventExit( EventData )
|
||||||
|
|
||||||
@@ -110,11 +110,11 @@ function AI_ESCORT_DISPATCHER:OnEventExit( EventData )
|
|||||||
local PlayerGroup = EventData.IniGroup
|
local PlayerGroup = EventData.IniGroup
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
|
|
||||||
self:I({EscortAirbase= self.EscortAirbase } )
|
self:T({EscortAirbase= self.EscortAirbase } )
|
||||||
self:I({PlayerGroupName = PlayerGroupName } )
|
self:T({PlayerGroupName = PlayerGroupName } )
|
||||||
self:I({PlayerGroup = PlayerGroup})
|
self:T({PlayerGroup = PlayerGroup})
|
||||||
self:I({FirstGroup = self.CarrierSet:GetFirst()})
|
self:T({FirstGroup = self.CarrierSet:GetFirst()})
|
||||||
self:I({FindGroup = self.CarrierSet:FindGroup( PlayerGroupName )})
|
self:T({FindGroup = self.CarrierSet:FindGroup( PlayerGroupName )})
|
||||||
|
|
||||||
if self.CarrierSet:FindGroup( PlayerGroupName ) then
|
if self.CarrierSet:FindGroup( PlayerGroupName ) then
|
||||||
if self.AI_Escorts[PlayerGroupName] then
|
if self.AI_Escorts[PlayerGroupName] then
|
||||||
@@ -125,7 +125,7 @@ function AI_ESCORT_DISPATCHER:OnEventExit( EventData )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_DISPATCHER self
|
-- @param #AI_ESCORT_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_ESCORT_DISPATCHER:OnEventBirth( EventData )
|
function AI_ESCORT_DISPATCHER:OnEventBirth( EventData )
|
||||||
|
|
||||||
@@ -133,17 +133,17 @@ function AI_ESCORT_DISPATCHER:OnEventBirth( EventData )
|
|||||||
local PlayerGroup = EventData.IniGroup
|
local PlayerGroup = EventData.IniGroup
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
|
|
||||||
self:I({EscortAirbase= self.EscortAirbase } )
|
self:T({EscortAirbase= self.EscortAirbase } )
|
||||||
self:I({PlayerGroupName = PlayerGroupName } )
|
self:T({PlayerGroupName = PlayerGroupName } )
|
||||||
self:I({PlayerGroup = PlayerGroup})
|
self:T({PlayerGroup = PlayerGroup})
|
||||||
self:I({FirstGroup = self.CarrierSet:GetFirst()})
|
self:T({FirstGroup = self.CarrierSet:GetFirst()})
|
||||||
self:I({FindGroup = self.CarrierSet:FindGroup( PlayerGroupName )})
|
self:T({FindGroup = self.CarrierSet:FindGroup( PlayerGroupName )})
|
||||||
|
|
||||||
if self.CarrierSet:FindGroup( PlayerGroupName ) then
|
if self.CarrierSet:FindGroup( PlayerGroupName ) then
|
||||||
if not self.AI_Escorts[PlayerGroupName] then
|
if not self.AI_Escorts[PlayerGroupName] then
|
||||||
local LeaderUnit = PlayerUnit
|
local LeaderUnit = PlayerUnit
|
||||||
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Hot )
|
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Hot )
|
||||||
self:I({EscortGroup = EscortGroup})
|
self:T({EscortGroup = EscortGroup})
|
||||||
|
|
||||||
self:ScheduleOnce( 1,
|
self:ScheduleOnce( 1,
|
||||||
function( EscortGroup )
|
function( EscortGroup )
|
||||||
|
|||||||
@@ -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),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -652,15 +652,15 @@ function AI_PATROL_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable+
|
||||||
function AI_PATROL_ZONE:onbeforeDetect( Controllable, From, Event, To )
|
function AI_PATROL_ZONE:onbeforeDetect( Controllable, From, Event, To )
|
||||||
|
|
||||||
return self.DetectOn and self.DetectActivated
|
return self.DetectOn and self.DetectActivated
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
|
function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
|
||||||
|
|
||||||
local Detected = false
|
local Detected = false
|
||||||
@@ -705,7 +705,7 @@ function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
-- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
-- This static method is called from the route path within the last task at the last waypoint of the Controllable.
|
-- This static method is called from the route path within the last task at the last waypoint of the Controllable.
|
||||||
-- Note that this method is required, as triggers the next route when patrolling for the Controllable.
|
-- Note that this method is required, as triggers the next route when patrolling for the Controllable.
|
||||||
function AI_PATROL_ZONE:_NewPatrolRoute( AIControllable )
|
function AI_PATROL_ZONE:_NewPatrolRoute( AIControllable )
|
||||||
@@ -822,13 +822,13 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
function AI_PATROL_ZONE:onbeforeStatus()
|
function AI_PATROL_ZONE:onbeforeStatus()
|
||||||
|
|
||||||
return self.CheckStatus
|
return self.CheckStatus
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
function AI_PATROL_ZONE:onafterStatus()
|
function AI_PATROL_ZONE:onafterStatus()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@@ -838,7 +838,7 @@ function AI_PATROL_ZONE:onafterStatus()
|
|||||||
|
|
||||||
local Fuel = self.Controllable:GetFuelMin()
|
local Fuel = self.Controllable:GetFuelMin()
|
||||||
if Fuel < self.PatrolFuelThresholdPercentage then
|
if Fuel < self.PatrolFuelThresholdPercentage then
|
||||||
self:I( self.Controllable:GetName() .. " is out of fuel:" .. Fuel .. ", RTB!" )
|
self:T( self.Controllable:GetName() .. " is out of fuel:" .. Fuel .. ", RTB!" )
|
||||||
local OldAIControllable = self.Controllable
|
local OldAIControllable = self.Controllable
|
||||||
|
|
||||||
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
||||||
@@ -846,16 +846,25 @@ function AI_PATROL_ZONE:onafterStatus()
|
|||||||
OldAIControllable:SetTask( TimedOrbitTask, 10 )
|
OldAIControllable:SetTask( TimedOrbitTask, 10 )
|
||||||
|
|
||||||
RTB = true
|
RTB = true
|
||||||
else
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: Check GROUP damage function.
|
-- TODO: Check GROUP damage function.
|
||||||
local Damage = self.Controllable:GetLife()
|
local Damage = self.Controllable:GetLife()
|
||||||
if Damage <= self.PatrolDamageThreshold then
|
if Damage <= self.PatrolDamageThreshold then
|
||||||
self:I( self.Controllable:GetName() .. " is damaged:" .. Damage .. ", RTB!" )
|
self:T( self.Controllable:GetName() .. " is damaged:" .. Damage .. ", RTB!" )
|
||||||
RTB = true
|
RTB = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self:IsInstanceOf("AI_CAS") or self:IsInstanceOf("AI_BAI") then
|
||||||
|
local atotal,shells,rockets,bombs,missiles = self.Controllable:GetAmmunition()
|
||||||
|
local arelevant = rockets+bombs
|
||||||
|
if arelevant == 0 or missiles == 0 then
|
||||||
|
RTB = true
|
||||||
|
self:T({total=atotal,shells=shells,rockets=rockets,bombs=bombs,missiles=missiles})
|
||||||
|
self:T( self.Controllable:GetName() .. " is out of ammo, RTB!" )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if RTB == true then
|
if RTB == true then
|
||||||
self:RTB()
|
self:RTB()
|
||||||
else
|
else
|
||||||
@@ -864,7 +873,7 @@ function AI_PATROL_ZONE:onafterStatus()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
function AI_PATROL_ZONE:onafterRTB()
|
function AI_PATROL_ZONE:onafterRTB()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@@ -903,13 +912,13 @@ function AI_PATROL_ZONE:onafterRTB()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
function AI_PATROL_ZONE:onafterDead()
|
function AI_PATROL_ZONE:onafterDead()
|
||||||
self:SetDetectionOff()
|
self:SetDetectionOff()
|
||||||
self:SetStatusOff()
|
self:SetStatusOff()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_PATROL_ZONE:OnCrash( EventData )
|
function AI_PATROL_ZONE:OnCrash( EventData )
|
||||||
|
|
||||||
@@ -920,7 +929,7 @@ function AI_PATROL_ZONE:OnCrash( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_PATROL_ZONE:OnEjection( EventData )
|
function AI_PATROL_ZONE:OnEjection( EventData )
|
||||||
|
|
||||||
@@ -929,7 +938,7 @@ function AI_PATROL_ZONE:OnEjection( EventData )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_PATROL_ZONE:OnPilotDead( EventData )
|
function AI_PATROL_ZONE:OnPilotDead( EventData )
|
||||||
|
|
||||||
|
|||||||
@@ -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 = {}
|
||||||
@@ -34,11 +34,12 @@ local _TraceClassMethod = {}
|
|||||||
|
|
||||||
local _ClassID = 0
|
local _ClassID = 0
|
||||||
|
|
||||||
---
|
--- Base class of everything
|
||||||
-- @type BASE
|
-- @type BASE
|
||||||
-- @field ClassName The name of the class.
|
-- @field #string ClassName The name of the class.
|
||||||
-- @field ClassID The ID number of the class.
|
-- @field #number ClassID The ID number of the class.
|
||||||
-- @field ClassNameAndID The name of the class concatenated with the ID number of the class.
|
-- @field #string ClassNameAndID The name of the class concatenated with the ID number of the class.
|
||||||
|
-- @field Core.Scheduler#SCHEDULER Scheduler The scheduler object.
|
||||||
|
|
||||||
--- BASE class
|
--- BASE class
|
||||||
--
|
--
|
||||||
@@ -200,6 +201,7 @@ BASE = {
|
|||||||
States = {},
|
States = {},
|
||||||
Debug = debug,
|
Debug = debug,
|
||||||
Scheduler = nil,
|
Scheduler = nil,
|
||||||
|
Properties = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- @field #BASE.__
|
-- @field #BASE.__
|
||||||
@@ -210,14 +212,6 @@ BASE._ = {
|
|||||||
Schedules = {}, --- Contains the Schedulers Active
|
Schedules = {}, --- Contains the Schedulers Active
|
||||||
}
|
}
|
||||||
|
|
||||||
--- The Formation Class
|
|
||||||
-- @type FORMATION
|
|
||||||
-- @field Cone A cone formation.
|
|
||||||
FORMATION = {
|
|
||||||
Cone = "Cone",
|
|
||||||
Vee = "Vee",
|
|
||||||
}
|
|
||||||
|
|
||||||
--- BASE constructor.
|
--- BASE constructor.
|
||||||
--
|
--
|
||||||
-- This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
|
-- This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
|
||||||
@@ -741,7 +735,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 +880,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
|
||||||
@@ -1036,6 +1110,31 @@ function BASE:ClearState( Object, StateName )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set one property of an object.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Key The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!
|
||||||
|
-- @param Value The value that is stored. Note that the value can be a #string, but it can also be any other type!
|
||||||
|
function BASE:SetProperty(Key,Value)
|
||||||
|
self.Properties = self.Properties or {}
|
||||||
|
self.Properties[Key] = Value
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get one property of an object by the key.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @param Key The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!
|
||||||
|
-- @return Value The value that is stored. Note that the value can be a #string, but it can also be any other type! Nil if not found.
|
||||||
|
function BASE:GetProperty(Key)
|
||||||
|
self.Properties = self.Properties or {}
|
||||||
|
return self.Properties[Key]
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get all of the properties of an object in a table.
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @return #table of values, indexed by keys.
|
||||||
|
function BASE:GetProperties()
|
||||||
|
return self.Properties
|
||||||
|
end
|
||||||
|
|
||||||
-- Trace section
|
-- Trace section
|
||||||
|
|
||||||
-- Log a trace (only shown when trace is on)
|
-- Log a trace (only shown when trace is on)
|
||||||
@@ -1150,13 +1249,22 @@ end
|
|||||||
-- @return #string Text
|
-- @return #string Text
|
||||||
function BASE:_Serialize(Arguments)
|
function BASE:_Serialize(Arguments)
|
||||||
local text = UTILS.PrintTableToLog({Arguments}, 0, true)
|
local text = UTILS.PrintTableToLog({Arguments}, 0, true)
|
||||||
text = string.gsub(text,"\n","")
|
text = string.gsub(text,"(\n+)","")
|
||||||
text = string.gsub(text,"%(%(","%(")
|
text = string.gsub(text,"%(%(","%(")
|
||||||
text = string.gsub(text,"%)%)","%)")
|
text = string.gsub(text,"%)%)","%)")
|
||||||
text = string.gsub(text,"(%s+)","")
|
text = string.gsub(text,"(%s+)"," ")
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
----- (Internal) Serialize arguments
|
||||||
|
---- @param #BASE self
|
||||||
|
---- @param #table Arguments
|
||||||
|
---- @return #string Text
|
||||||
|
--function BASE:_Serialize(Arguments)
|
||||||
|
-- local text=UTILS.BasicSerialize(Arguments)
|
||||||
|
-- return text
|
||||||
|
--end
|
||||||
|
|
||||||
--- Trace a function call. This function is private.
|
--- Trace a function call. This function is private.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param Arguments A #table or any field.
|
-- @param Arguments A #table or any field.
|
||||||
@@ -1191,7 +1299,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" )
|
||||||
|
|
||||||
@@ -1206,7 +1314,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" )
|
||||||
|
|
||||||
@@ -1221,7 +1329,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" )
|
||||||
|
|
||||||
@@ -1265,7 +1373,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" )
|
||||||
|
|
||||||
@@ -1280,7 +1388,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" )
|
||||||
|
|
||||||
@@ -1295,7 +1403,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" )
|
||||||
|
|
||||||
@@ -1327,7 +1435,7 @@ function BASE:E( Arguments )
|
|||||||
|
|
||||||
env.info( string.format( "%6d(%6d)/%1s:%30s%05d.%s(%s)", LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, UTILS.BasicSerialize( Arguments ) ) )
|
env.info( string.format( "%6d(%6d)/%1s:%30s%05d.%s(%s)", LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, UTILS.BasicSerialize( Arguments ) ) )
|
||||||
else
|
else
|
||||||
env.info( string.format( "%1s:%30s%05d(%s)", "E", self.ClassName, self.ClassID, BASE:_Serialize(Arguments) ) )
|
env.info( string.format( "%1s:%30s%05d(%s)", "E", self.ClassName, self.ClassID, UTILS.BasicSerialize(Arguments) ) )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1354,8 +1462,7 @@ function BASE:I( Arguments )
|
|||||||
|
|
||||||
env.info( string.format( "%6d(%6d)/%1s:%30s%05d.%s(%s)", LineCurrent, LineFrom, "I", self.ClassName, self.ClassID, Function, UTILS.BasicSerialize( Arguments ) ) )
|
env.info( string.format( "%6d(%6d)/%1s:%30s%05d.%s(%s)", LineCurrent, LineFrom, "I", self.ClassName, self.ClassID, Function, UTILS.BasicSerialize( Arguments ) ) )
|
||||||
else
|
else
|
||||||
env.info( string.format( "%1s:%30s%05d(%s)", "I", self.ClassName, self.ClassID, BASE:_Serialize(Arguments)) )
|
env.info( string.format( "%1s:%30s%05d(%s)", "I", self.ClassName, self.ClassID, UTILS.BasicSerialize(Arguments)) )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -38,11 +38,13 @@
|
|||||||
-- @type BEACON
|
-- @type BEACON
|
||||||
-- @field #string ClassName Name of the class "BEACON".
|
-- @field #string ClassName Name of the class "BEACON".
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE Positionable The @{Wrapper.Controllable#CONTROLLABLE} that will receive radio capabilities.
|
-- @field Wrapper.Controllable#CONTROLLABLE Positionable The @{Wrapper.Controllable#CONTROLLABLE} that will receive radio capabilities.
|
||||||
|
-- @field #number UniqueName Counter to make the unique naming work.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
BEACON = {
|
BEACON = {
|
||||||
ClassName = "BEACON",
|
ClassName = "BEACON",
|
||||||
Positionable = nil,
|
Positionable = nil,
|
||||||
name = nil,
|
name = nil,
|
||||||
|
UniqueName = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Beacon types supported by DCS.
|
--- Beacon types supported by DCS.
|
||||||
@@ -384,7 +386,9 @@ end
|
|||||||
function BEACON:RadioBeacon(FileName, Frequency, Modulation, Power, BeaconDuration)
|
function BEACON:RadioBeacon(FileName, Frequency, Modulation, Power, BeaconDuration)
|
||||||
self:F({FileName, Frequency, Modulation, Power, BeaconDuration})
|
self:F({FileName, Frequency, Modulation, Power, BeaconDuration})
|
||||||
local IsValid = false
|
local IsValid = false
|
||||||
|
|
||||||
|
Modulation = Modulation or radio.modulation.AM
|
||||||
|
|
||||||
-- Check the filename
|
-- Check the filename
|
||||||
if type(FileName) == "string" then
|
if type(FileName) == "string" then
|
||||||
if FileName:find(".ogg") or FileName:find(".wav") then
|
if FileName:find(".ogg") or FileName:find(".wav") then
|
||||||
@@ -395,7 +399,7 @@ function BEACON:RadioBeacon(FileName, Frequency, Modulation, Power, BeaconDurati
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not IsValid then
|
if not IsValid then
|
||||||
self:E({"File name invalid. Maybe something wrong with the extension ? ", FileName})
|
self:E({"File name invalid. Maybe something wrong with the extension? ", FileName})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check the Frequency
|
-- Check the Frequency
|
||||||
@@ -421,7 +425,9 @@ function BEACON:RadioBeacon(FileName, Frequency, Modulation, Power, BeaconDurati
|
|||||||
if IsValid then
|
if IsValid then
|
||||||
self:T2({"Activating Beacon on ", Frequency, Modulation})
|
self:T2({"Activating Beacon on ", Frequency, Modulation})
|
||||||
-- Note that this is looped. I have to give this transmission a unique name, I use the class ID
|
-- Note that this is looped. I have to give this transmission a unique name, I use the class ID
|
||||||
trigger.action.radioTransmission(FileName, self.Positionable:GetPositionVec3(), Modulation, true, Frequency, Power, tostring(self.ID))
|
BEACON.UniqueName = BEACON.UniqueName + 1
|
||||||
|
self.BeaconName = "MooseBeacon"..tostring(BEACON.UniqueName)
|
||||||
|
trigger.action.radioTransmission(FileName, self.Positionable:GetPositionVec3(), Modulation, true, Frequency, Power, self.BeaconName)
|
||||||
|
|
||||||
if BeaconDuration then -- Schedule the stop of the BEACON if asked by the MD
|
if BeaconDuration then -- Schedule the stop of the BEACON if asked by the MD
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
@@ -429,7 +435,8 @@ function BEACON:RadioBeacon(FileName, Frequency, Modulation, Power, BeaconDurati
|
|||||||
self:StopRadioBeacon()
|
self:StopRadioBeacon()
|
||||||
end, {}, BeaconDuration)
|
end, {}, BeaconDuration)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Stops the Radio Beacon
|
--- Stops the Radio Beacon
|
||||||
@@ -438,7 +445,7 @@ end
|
|||||||
function BEACON:StopRadioBeacon()
|
function BEACON:StopRadioBeacon()
|
||||||
self:F()
|
self:F()
|
||||||
-- The unique name of the transmission is the class ID
|
-- The unique name of the transmission is the class ID
|
||||||
trigger.action.stopRadioTransmission(tostring(self.ID))
|
trigger.action.stopRadioTransmission(self.BeaconName)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
--
|
--
|
||||||
-- @module Core.ClientMenu
|
-- @module Core.ClientMenu
|
||||||
-- @image Core_Menu.JPG
|
-- @image Core_Menu.JPG
|
||||||
-- last change: Oct 2023
|
-- last change: Jan 2025
|
||||||
|
|
||||||
-- TODO
|
-- TODO
|
||||||
----------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------
|
||||||
@@ -51,14 +51,15 @@
|
|||||||
-- @field #boolean Generic
|
-- @field #boolean Generic
|
||||||
-- @field #boolean debug
|
-- @field #boolean debug
|
||||||
-- @field #CLIENTMENUMANAGER Controller
|
-- @field #CLIENTMENUMANAGER Controller
|
||||||
|
-- @field #active boolean
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @field #CLIENTMENU
|
-- @field #CLIENTMENU
|
||||||
CLIENTMENU = {
|
CLIENTMENU = {
|
||||||
ClassName = "CLIENTMENUE",
|
ClassName = "CLIENTMENU",
|
||||||
lid = "",
|
lid = "",
|
||||||
version = "0.1.1",
|
version = "0.1.3",
|
||||||
name = nil,
|
name = nil,
|
||||||
path = nil,
|
path = nil,
|
||||||
group = nil,
|
group = nil,
|
||||||
@@ -70,6 +71,7 @@ CLIENTMENU = {
|
|||||||
debug = false,
|
debug = false,
|
||||||
Controller = nil,
|
Controller = nil,
|
||||||
groupname = nil,
|
groupname = nil,
|
||||||
|
active = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -114,7 +116,7 @@ function CLIENTMENU:NewEntry(Client,Text,Parent,Function,...)
|
|||||||
if self.Functionargs and self.debug then
|
if self.Functionargs and self.debug then
|
||||||
self:T({"Functionargs",self.Functionargs})
|
self:T({"Functionargs",self.Functionargs})
|
||||||
end
|
end
|
||||||
if not self.Generic then
|
if not self.Generic and self.active == false then
|
||||||
if Function ~= nil then
|
if Function ~= nil then
|
||||||
local ErrorHandler = function( errmsg )
|
local ErrorHandler = function( errmsg )
|
||||||
env.info( "MOOSE Error in CLIENTMENU COMMAND function: " .. errmsg )
|
env.info( "MOOSE Error in CLIENTMENU COMMAND function: " .. errmsg )
|
||||||
@@ -133,8 +135,10 @@ function CLIENTMENU:NewEntry(Client,Text,Parent,Function,...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.path = missionCommands.addCommandForGroup(self.GroupID,Text,self.parentpath, self.CallHandler)
|
self.path = missionCommands.addCommandForGroup(self.GroupID,Text,self.parentpath, self.CallHandler)
|
||||||
|
self.active = true
|
||||||
else
|
else
|
||||||
self.path = missionCommands.addSubMenuForGroup(self.GroupID,Text,self.parentpath)
|
self.path = missionCommands.addSubMenuForGroup(self.GroupID,Text,self.parentpath)
|
||||||
|
self.active = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if self.parentpath then
|
if self.parentpath then
|
||||||
@@ -200,6 +204,7 @@ function CLIENTMENU:RemoveF10()
|
|||||||
if not status then
|
if not status then
|
||||||
self:I(string.format("**** Error Removing Menu Entry %s for %s!",tostring(self.name),self.groupname))
|
self:I(string.format("**** Error Removing Menu Entry %s for %s!",tostring(self.name),self.groupname))
|
||||||
end
|
end
|
||||||
|
self.active = false
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -412,7 +417,7 @@ end
|
|||||||
CLIENTMENUMANAGER = {
|
CLIENTMENUMANAGER = {
|
||||||
ClassName = "CLIENTMENUMANAGER",
|
ClassName = "CLIENTMENUMANAGER",
|
||||||
lid = "",
|
lid = "",
|
||||||
version = "0.1.4",
|
version = "0.1.6",
|
||||||
name = nil,
|
name = nil,
|
||||||
clientset = nil,
|
clientset = nil,
|
||||||
menutree = {},
|
menutree = {},
|
||||||
@@ -450,7 +455,7 @@ end
|
|||||||
-- @param #CLIENTMENUMANAGER self
|
-- @param #CLIENTMENUMANAGER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
-- @return #CLIENTMENUMANAGER self
|
-- @return #CLIENTMENUMANAGER self
|
||||||
function CLIENTMENUMANAGER:_EventHandler(EventData)
|
function CLIENTMENUMANAGER:_EventHandler(EventData,Retry)
|
||||||
self:T(self.lid.."_EventHandler: "..EventData.id)
|
self:T(self.lid.."_EventHandler: "..EventData.id)
|
||||||
--self:I(self.lid.."_EventHandler: "..tostring(EventData.IniPlayerName))
|
--self:I(self.lid.."_EventHandler: "..tostring(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.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then
|
||||||
@@ -463,6 +468,10 @@ function CLIENTMENUMANAGER:_EventHandler(EventData)
|
|||||||
if EventData.IniPlayerName and EventData.IniGroup then
|
if EventData.IniPlayerName and EventData.IniGroup then
|
||||||
if (not self.clientset:IsIncludeObject(_DATABASE:FindClient( EventData.IniUnitName ))) then
|
if (not self.clientset:IsIncludeObject(_DATABASE:FindClient( EventData.IniUnitName ))) then
|
||||||
self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName)
|
self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName)
|
||||||
|
if not Retry then
|
||||||
|
-- try again in 2 secs
|
||||||
|
self:ScheduleOnce(2,CLIENTMENUMANAGER._EventHandler,self,EventData,true)
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
--self:I(self.lid.."Join event for player: "..EventData.IniPlayerName)
|
--self:I(self.lid.."Join event for player: "..EventData.IniPlayerName)
|
||||||
@@ -519,7 +528,7 @@ function CLIENTMENUMANAGER:InitAutoPropagation()
|
|||||||
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.PlayerEnterUnit, self._EventHandler)
|
self:HandleEvent(EVENTS.PlayerEnterUnit, self._EventHandler)
|
||||||
self:SetEventPriority(5)
|
self:SetEventPriority(6)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -676,6 +685,7 @@ end
|
|||||||
function CLIENTMENUMANAGER:Propagate(Client)
|
function CLIENTMENUMANAGER:Propagate(Client)
|
||||||
self:T(self.lid.."Propagate")
|
self:T(self.lid.."Propagate")
|
||||||
--self:I(UTILS.PrintTableToLog(Client,1))
|
--self:I(UTILS.PrintTableToLog(Client,1))
|
||||||
|
local knownunits = {} -- track so we can ID multi seated
|
||||||
local Set = self.clientset.Set
|
local Set = self.clientset.Set
|
||||||
if Client then
|
if Client then
|
||||||
Set = {Client}
|
Set = {Client}
|
||||||
@@ -684,28 +694,36 @@ function CLIENTMENUMANAGER:Propagate(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 playerunit = client:GetName()
|
||||||
|
--local playergroup = client:GetGroup()
|
||||||
local playername = client:GetPlayerName() or "none"
|
local playername = client:GetPlayerName() or "none"
|
||||||
if not self.playertree[playername] then
|
if not knownunits[playerunit] then
|
||||||
self.playertree[playername] = {}
|
knownunits[playerunit] = true
|
||||||
end
|
else
|
||||||
for level,branch in pairs (self.menutree) do
|
self:I("Player in multi seat unit: "..playername)
|
||||||
self:T("Building branch:" .. level)
|
break -- multi seat already build
|
||||||
for _,leaf in pairs(branch) do
|
end
|
||||||
self:T("Building leaf:" .. leaf)
|
if not self.playertree[playername] then
|
||||||
local entry = self:FindEntryByUUID(leaf)
|
self.playertree[playername] = {}
|
||||||
if entry then
|
end
|
||||||
self:T("Found generic entry:" .. entry.UUID)
|
for level,branch in pairs (self.menutree) do
|
||||||
local parent = nil
|
self:T("Building branch:" .. level)
|
||||||
if entry.Parent and entry.Parent.UUID then
|
for _,leaf in pairs(branch) do
|
||||||
parent = self.playertree[playername][entry.Parent.UUID] or self:FindEntryByUUID(entry.Parent.UUID)
|
self:T("Building leaf:" .. leaf)
|
||||||
end
|
local entry = self:FindEntryByUUID(leaf)
|
||||||
self.playertree[playername][entry.UUID] = CLIENTMENU:NewEntry(client,entry.name,parent,entry.Function,unpack(entry.Functionargs))
|
if entry then
|
||||||
self.playertree[playername][entry.UUID].Once = entry.Once
|
self:T("Found generic entry:" .. entry.UUID)
|
||||||
else
|
local parent = nil
|
||||||
self:T("NO generic entry for:" .. leaf)
|
if entry.Parent and entry.Parent.UUID then
|
||||||
end
|
parent = self.playertree[playername][entry.Parent.UUID] or self:FindEntryByUUID(entry.Parent.UUID)
|
||||||
end
|
end
|
||||||
|
self.playertree[playername][entry.UUID] = CLIENTMENU:NewEntry(client,entry.name,parent,entry.Function,unpack(entry.Functionargs))
|
||||||
|
self.playertree[playername][entry.UUID].Once = entry.Once
|
||||||
|
else
|
||||||
|
self:T("NO generic entry for:" .. leaf)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
@@ -719,13 +737,21 @@ end
|
|||||||
function CLIENTMENUMANAGER:AddEntry(Entry,Client)
|
function CLIENTMENUMANAGER:AddEntry(Entry,Client)
|
||||||
self:T(self.lid.."AddEntry")
|
self:T(self.lid.."AddEntry")
|
||||||
local Set = self.clientset.Set
|
local Set = self.clientset.Set
|
||||||
|
local knownunits = {}
|
||||||
if Client then
|
if Client then
|
||||||
Set = {Client}
|
Set = {Client}
|
||||||
end
|
end
|
||||||
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()
|
||||||
|
if not knownunits[unitname] then
|
||||||
|
knownunits[unitname] = true
|
||||||
|
else
|
||||||
|
self:I("Player in multi seat unit: "..playername)
|
||||||
|
break
|
||||||
|
end
|
||||||
if Entry then
|
if Entry then
|
||||||
self:T("Adding generic entry:" .. Entry.UUID)
|
self:T("Adding generic entry:" .. Entry.UUID)
|
||||||
local parent = nil
|
local parent = nil
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -199,10 +211,9 @@ function DATABASE:AddStatic( DCSStaticName )
|
|||||||
|
|
||||||
if not self.STATICS[DCSStaticName] then
|
if not self.STATICS[DCSStaticName] then
|
||||||
self.STATICS[DCSStaticName] = STATIC:Register( DCSStaticName )
|
self.STATICS[DCSStaticName] = STATIC:Register( DCSStaticName )
|
||||||
return self.STATICS[DCSStaticName]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return self.STATICS[DCSStaticName]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -212,16 +223,42 @@ function DATABASE:DeleteStatic( DCSStaticName )
|
|||||||
self.STATICS[DCSStaticName] = nil
|
self.STATICS[DCSStaticName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Finds a STATIC based on the StaticName.
|
--- Finds a STATIC based on the Static Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string StaticName
|
-- @param #string StaticName Name of the static object.
|
||||||
-- @return Wrapper.Static#STATIC The found STATIC.
|
-- @return Wrapper.Static#STATIC The found STATIC.
|
||||||
function DATABASE:FindStatic( StaticName )
|
function DATABASE:FindStatic( StaticName )
|
||||||
|
|
||||||
local StaticFound = self.STATICS[StaticName]
|
local StaticFound = self.STATICS[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)
|
||||||
|
end
|
||||||
|
return self.DYNAMICCARGO[Name]
|
||||||
|
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 +850,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 +873,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 +902,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 +914,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 )
|
||||||
@@ -1009,7 +1078,7 @@ function DATABASE:_RegisterGroupTemplate( GroupTemplate, CoalitionSide, Category
|
|||||||
self.Templates.Groups[GroupTemplateName].CategoryID = CategoryID
|
self.Templates.Groups[GroupTemplateName].CategoryID = CategoryID
|
||||||
self.Templates.Groups[GroupTemplateName].CoalitionID = CoalitionSide
|
self.Templates.Groups[GroupTemplateName].CoalitionID = CoalitionSide
|
||||||
self.Templates.Groups[GroupTemplateName].CountryID = CountryID
|
self.Templates.Groups[GroupTemplateName].CountryID = CountryID
|
||||||
|
|
||||||
local UnitNames = {}
|
local UnitNames = {}
|
||||||
|
|
||||||
for unit_num, UnitTemplate in pairs( GroupTemplate.units ) do
|
for unit_num, UnitTemplate in pairs( GroupTemplate.units ) do
|
||||||
@@ -1074,7 +1143,7 @@ end
|
|||||||
-- @param #string unitname Name of the associated unit.
|
-- @param #string unitname Name of the associated unit.
|
||||||
-- @return #number Octal
|
-- @return #number Octal
|
||||||
function DATABASE:GetNextSTN(octal,unitname)
|
function DATABASE:GetNextSTN(octal,unitname)
|
||||||
local first = UTILS.OctalToDecimal(octal)
|
local first = UTILS.OctalToDecimal(octal) or 0
|
||||||
if self.STNS[first] == unitname then return octal end
|
if self.STNS[first] == unitname then return octal end
|
||||||
local nextoctal = 77777
|
local nextoctal = 77777
|
||||||
local found = false
|
local found = false
|
||||||
@@ -1111,7 +1180,7 @@ end
|
|||||||
-- @param #string unitname Name of the associated unit.
|
-- @param #string unitname Name of the associated unit.
|
||||||
-- @return #number Octal
|
-- @return #number Octal
|
||||||
function DATABASE:GetNextSADL(octal,unitname)
|
function DATABASE:GetNextSADL(octal,unitname)
|
||||||
local first = UTILS.OctalToDecimal(octal)
|
local first = UTILS.OctalToDecimal(octal) or 0
|
||||||
if self.SADL[first] == unitname then return octal end
|
if self.SADL[first] == unitname then return octal end
|
||||||
local nextoctal = 7777
|
local nextoctal = 7777
|
||||||
local found = false
|
local found = false
|
||||||
@@ -1147,10 +1216,13 @@ end
|
|||||||
-- @param #string GroupName Group name.
|
-- @param #string GroupName Group name.
|
||||||
-- @return #table Group template table.
|
-- @return #table Group template table.
|
||||||
function DATABASE:GetGroupTemplate( GroupName )
|
function DATABASE:GetGroupTemplate( GroupName )
|
||||||
local GroupTemplate = self.Templates.Groups[GroupName].Template
|
local GroupTemplate=nil
|
||||||
GroupTemplate.SpawnCoalitionID = self.Templates.Groups[GroupName].CoalitionID
|
if self.Templates.Groups[GroupName] then
|
||||||
GroupTemplate.SpawnCategoryID = self.Templates.Groups[GroupName].CategoryID
|
GroupTemplate = self.Templates.Groups[GroupName].Template
|
||||||
GroupTemplate.SpawnCountryID = self.Templates.Groups[GroupName].CountryID
|
GroupTemplate.SpawnCoalitionID = self.Templates.Groups[GroupName].CoalitionID
|
||||||
|
GroupTemplate.SpawnCategoryID = self.Templates.Groups[GroupName].CategoryID
|
||||||
|
GroupTemplate.SpawnCountryID = self.Templates.Groups[GroupName].CountryID
|
||||||
|
end
|
||||||
return GroupTemplate
|
return GroupTemplate
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1195,6 +1267,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.
|
||||||
@@ -1268,7 +1377,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.
|
||||||
@@ -1276,7 +1389,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.
|
||||||
@@ -1284,7 +1401,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
|
||||||
@@ -1330,6 +1451,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
|
||||||
@@ -1428,12 +1579,29 @@ end
|
|||||||
-- @param DCS#Airbase airbase Airbase.
|
-- @param DCS#Airbase airbase Airbase.
|
||||||
-- @return #DATABASE self
|
-- @return #DATABASE self
|
||||||
function DATABASE:_RegisterAirbase(airbase)
|
function DATABASE:_RegisterAirbase(airbase)
|
||||||
|
|
||||||
|
local IsSyria = UTILS.GetDCSMap() == "Syria" and true or false
|
||||||
|
local countHSyria = 0
|
||||||
|
|
||||||
if airbase then
|
if airbase then
|
||||||
|
|
||||||
-- Get the airbase name.
|
-- Get the airbase name.
|
||||||
local DCSAirbaseName = airbase:getName()
|
local DCSAirbaseName = airbase:getName()
|
||||||
|
|
||||||
|
-- DCS 2.9.8.1107 added 143 helipads all named H with the same object ID ..
|
||||||
|
if IsSyria and DCSAirbaseName == "H" and countHSyria > 0 then
|
||||||
|
--[[
|
||||||
|
local p = airbase:getPosition().p
|
||||||
|
local mgrs = COORDINATE:New(p.x,p.z,p.y):ToStringMGRS()
|
||||||
|
self:I("Airbase on Syria map named H @ "..mgrs)
|
||||||
|
countHSyria = countHSyria + 1
|
||||||
|
if countHSyria > 1 then return self end
|
||||||
|
--]]
|
||||||
|
return self
|
||||||
|
elseif IsSyria and DCSAirbaseName == "H" and countHSyria == 0 then
|
||||||
|
countHSyria = countHSyria + 1
|
||||||
|
end
|
||||||
|
|
||||||
-- This gave the incorrect value to be inserted into the airdromeID for DCS 2.5.6. Is fixed now.
|
-- This gave the incorrect value to be inserted into the airdromeID for DCS 2.5.6. Is fixed now.
|
||||||
local airbaseID=airbase:getID()
|
local airbaseID=airbase:getID()
|
||||||
|
|
||||||
@@ -1473,7 +1641,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
|
||||||
|
|
||||||
@@ -1481,7 +1649,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
|
||||||
@@ -1502,9 +1680,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
|
||||||
@@ -1520,10 +1698,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.
|
||||||
@@ -1533,14 +1711,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
|
||||||
@@ -1554,7 +1737,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
|
||||||
@@ -1562,7 +1744,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
|
||||||
@@ -1572,7 +1754,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))
|
||||||
@@ -1595,7 +1777,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.
|
||||||
@@ -1662,6 +1845,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
|
||||||
@@ -1685,7 +1877,7 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
|||||||
if Event.IniObjectCategory == 1 then
|
if Event.IniObjectCategory == 1 then
|
||||||
|
|
||||||
-- Try to get the player name. This can be buggy for multicrew aircraft!
|
-- Try to get the player name. This can be buggy for multicrew aircraft!
|
||||||
local PlayerName = Event.IniUnit:GetPlayerName() or FindPlayerName(Event.IniUnitName)
|
local PlayerName = Event.IniPlayerName or Event.IniUnit:GetPlayerName() or FindPlayerName(Event.IniUnitName)
|
||||||
|
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
|
|
||||||
@@ -1703,6 +1895,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
|
||||||
@@ -2081,7 +2274,7 @@ function DATABASE:_RegisterTemplates()
|
|||||||
for group_num, Template in pairs(obj_type_data.group) do
|
for group_num, Template in pairs(obj_type_data.group) do
|
||||||
|
|
||||||
if obj_type_name ~= "static" and Template and Template.units and type(Template.units) == 'table' then --making sure again- this is a valid group
|
if obj_type_name ~= "static" and Template and Template.units and type(Template.units) == 'table' then --making sure again- this is a valid group
|
||||||
|
|
||||||
self:_RegisterGroupTemplate(Template, CoalitionSide, _DATABASECategory[string.lower(CategoryName)], CountryID)
|
self:_RegisterGroupTemplate(Template, CoalitionSide, _DATABASECategory[string.lower(CategoryName)], CountryID)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -1197,6 +1329,7 @@ function EVENT:onEvent( Event )
|
|||||||
end
|
end
|
||||||
|
|
||||||
Event.IniDCSGroupName = Event.IniUnit and Event.IniUnit.GroupName or ""
|
Event.IniDCSGroupName = Event.IniUnit and Event.IniUnit.GroupName or ""
|
||||||
|
Event.IniGroupName=Event.IniDCSGroupName --At least set the group name because group might not exist any more
|
||||||
if Event.IniDCSGroup and Event.IniDCSGroup:isExist() then
|
if Event.IniDCSGroup and Event.IniDCSGroup:isExist() then
|
||||||
Event.IniDCSGroupName = Event.IniDCSGroup:getName()
|
Event.IniDCSGroupName = Event.IniDCSGroup:getName()
|
||||||
Event.IniGroup = GROUP:FindByName( Event.IniDCSGroupName )
|
Event.IniGroup = GROUP:FindByName( Event.IniDCSGroupName )
|
||||||
@@ -1223,7 +1356,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()
|
||||||
@@ -1233,10 +1372,10 @@ function EVENT:onEvent( Event )
|
|||||||
-- Scenery
|
-- Scenery
|
||||||
---
|
---
|
||||||
Event.IniDCSUnit = Event.initiator
|
Event.IniDCSUnit = Event.initiator
|
||||||
Event.IniDCSUnitName = Event.IniDCSUnit:getName()
|
Event.IniDCSUnitName = Event.IniDCSUnit.getName and Event.IniDCSUnit:getName() or "Scenery no name "..math.random(1,20000)
|
||||||
Event.IniUnitName = Event.IniDCSUnitName
|
Event.IniUnitName = Event.IniDCSUnitName
|
||||||
Event.IniUnit = SCENERY:Register( Event.IniDCSUnitName, Event.initiator )
|
Event.IniUnit = SCENERY:Register( Event.IniDCSUnitName, Event.initiator )
|
||||||
Event.IniCategory = Event.IniDCSUnit:getDesc().category
|
Event.IniCategory = Event.IniDCSUnit.getDesc and Event.IniDCSUnit:getDesc().category
|
||||||
Event.IniTypeName = Event.initiator:isExist() and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
Event.IniTypeName = Event.initiator:isExist() and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
||||||
|
|
||||||
elseif Event.IniObjectCategory == Object.Category.BASE then
|
elseif Event.IniObjectCategory == Object.Category.BASE then
|
||||||
@@ -1301,7 +1440,7 @@ function EVENT:onEvent( Event )
|
|||||||
-- STATIC
|
-- STATIC
|
||||||
---
|
---
|
||||||
Event.TgtDCSUnit = Event.target
|
Event.TgtDCSUnit = Event.target
|
||||||
if Event.target:isExist() and Event.id ~= 33 then -- leave out ejected seat object
|
if Event.target.isExist and Event.target:isExist() and Event.id ~= 33 then -- leave out ejected seat object, check that isExist exists (Kiowa Hellfire issue, Special K)
|
||||||
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
|
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
|
||||||
-- Workaround for borked target info on cruise missiles
|
-- Workaround for borked target info on cruise missiles
|
||||||
if Event.TgtDCSUnitName and Event.TgtDCSUnitName ~= "" then
|
if Event.TgtDCSUnitName and Event.TgtDCSUnitName ~= "" then
|
||||||
@@ -1335,24 +1474,26 @@ function EVENT:onEvent( Event )
|
|||||||
-- SCENERY
|
-- SCENERY
|
||||||
---
|
---
|
||||||
Event.TgtDCSUnit = Event.target
|
Event.TgtDCSUnit = Event.target
|
||||||
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
|
Event.TgtDCSUnitName = Event.TgtDCSUnit.getName and Event.TgtDCSUnit.getName() or nil
|
||||||
Event.TgtUnitName = Event.TgtDCSUnitName
|
if Event.TgtDCSUnitName~=nil then
|
||||||
Event.TgtUnit = SCENERY:Register( Event.TgtDCSUnitName, Event.target )
|
Event.TgtUnitName = Event.TgtDCSUnitName
|
||||||
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
|
Event.TgtUnit = SCENERY:Register( Event.TgtDCSUnitName, Event.target )
|
||||||
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
|
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
|
||||||
|
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
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 +1528,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.
|
||||||
@@ -948,8 +948,9 @@ do -- FSM
|
|||||||
end
|
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
|
||||||
|
|
||||||
@@ -1081,8 +1082,9 @@ do -- FSM_CONTROLLABLE
|
|||||||
end
|
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
|
||||||
|
|||||||
@@ -108,26 +108,30 @@ function MARKEROPS_BASE:New(Tagname,Keywords,Casesensitive)
|
|||||||
--- On after "MarkAdded" event. Triggered when a Marker is added to the F10 map.
|
--- On after "MarkAdded" event. Triggered when a Marker is added to the F10 map.
|
||||||
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkAdded
|
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkAdded
|
||||||
-- @param #MARKEROPS_BASE self
|
-- @param #MARKEROPS_BASE self
|
||||||
-- @param #string From The From state
|
-- @param #string From The From state.
|
||||||
-- @param #string Event The Event called
|
-- @param #string Event The Event called.
|
||||||
-- @param #string To The To state
|
-- @param #string To The To state.
|
||||||
-- @param #string Text The text on the marker
|
-- @param #string Text The text on the marker.
|
||||||
-- @param #table Keywords Table of matching keywords found in the Event text
|
-- @param #table Keywords Table of matching keywords found in the Event text.
|
||||||
-- @param Core.Point#COORDINATE Coord Coordinate of the marker.
|
-- @param Core.Point#COORDINATE Coord Coordinate of the marker.
|
||||||
-- @param #number MarkerID Id of this marker
|
-- @param #number MarkerID Id of this marker.
|
||||||
-- @param #number CoalitionNumber Coalition of the marker creator
|
-- @param #number CoalitionNumber Coalition of the marker creator.
|
||||||
|
-- @param #string PlayerName Name of the player creating/changing the mark. nil if it cannot be obtained.
|
||||||
|
-- @param Core.Event#EVENTDATA EventData the event data table.
|
||||||
|
|
||||||
--- On after "MarkChanged" event. Triggered when a Marker is changed on the F10 map.
|
--- On after "MarkChanged" event. Triggered when a Marker is changed on the F10 map.
|
||||||
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkChanged
|
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkChanged
|
||||||
-- @param #MARKEROPS_BASE self
|
-- @param #MARKEROPS_BASE self
|
||||||
-- @param #string From The From state
|
-- @param #string From The From state.
|
||||||
-- @param #string Event The Event called
|
-- @param #string Event The Event called.
|
||||||
-- @param #string To The To state
|
-- @param #string To The To state.
|
||||||
-- @param #string Text The text on the marker
|
-- @param #string Text The text on the marker.
|
||||||
-- @param #table Keywords Table of matching keywords found in the Event text
|
-- @param #table Keywords Table of matching keywords found in the Event text.
|
||||||
-- @param Core.Point#COORDINATE Coord Coordinate of the marker.
|
-- @param Core.Point#COORDINATE Coord Coordinate of the marker.
|
||||||
-- @param #number MarkerID Id of this marker
|
-- @param #number MarkerID Id of this marker.
|
||||||
-- @param #number CoalitionNumber Coalition of the marker creator
|
-- @param #number CoalitionNumber Coalition of the marker creator.
|
||||||
|
-- @param #string PlayerName Name of the player creating/changing the mark. nil if it cannot be obtained.
|
||||||
|
-- @param Core.Event#EVENTDATA EventData the event data table
|
||||||
|
|
||||||
--- On after "MarkDeleted" event. Triggered when a Marker is deleted from the F10 map.
|
--- On after "MarkDeleted" event. Triggered when a Marker is deleted from the F10 map.
|
||||||
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkDeleted
|
-- @function [parent=#MARKEROPS_BASE] OnAfterMarkDeleted
|
||||||
@@ -167,7 +171,7 @@ function MARKEROPS_BASE:OnEventMark(Event)
|
|||||||
if Eventtext~=nil then
|
if Eventtext~=nil then
|
||||||
if self:_MatchTag(Eventtext) then
|
if self:_MatchTag(Eventtext) then
|
||||||
local matchtable = self:_MatchKeywords(Eventtext)
|
local matchtable = self:_MatchKeywords(Eventtext)
|
||||||
self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition)
|
self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif Event.id==world.event.S_EVENT_MARK_CHANGE then
|
elseif Event.id==world.event.S_EVENT_MARK_CHANGE then
|
||||||
@@ -177,7 +181,7 @@ function MARKEROPS_BASE:OnEventMark(Event)
|
|||||||
if Eventtext~=nil then
|
if Eventtext~=nil then
|
||||||
if self:_MatchTag(Eventtext) then
|
if self:_MatchTag(Eventtext) then
|
||||||
local matchtable = self:_MatchKeywords(Eventtext)
|
local matchtable = self:_MatchKeywords(Eventtext)
|
||||||
self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition)
|
self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif Event.id==world.event.S_EVENT_MARK_REMOVED then
|
elseif Event.id==world.event.S_EVENT_MARK_REMOVED then
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -75,35 +75,37 @@ MESSAGE.Type = {
|
|||||||
|
|
||||||
--- Creates a new MESSAGE object. Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions @{#MESSAGE.ToClient} or @{#MESSAGE.ToCoalition} or @{#MESSAGE.ToAll} to send these Messages to the respective recipients.
|
--- Creates a new MESSAGE object. Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions @{#MESSAGE.ToClient} or @{#MESSAGE.ToCoalition} or @{#MESSAGE.ToAll} to send these Messages to the respective recipients.
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string MessageText is the text of the Message.
|
-- @param #string Text is the text of the Message.
|
||||||
-- @param #number MessageDuration is a number in seconds of how long the MESSAGE should be shown on the display panel.
|
-- @param #number Duration Duration in seconds how long the message text is shown.
|
||||||
-- @param #string MessageCategory (optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ".
|
-- @param #string Category (Optional) String expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ".
|
||||||
-- @param #boolean ClearScreen (optional) Clear all previous messages if true.
|
-- @param #boolean ClearScreen (optional) Clear all previous messages if true.
|
||||||
-- @return #MESSAGE
|
-- @return #MESSAGE self
|
||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Create a series of new Messages.
|
-- -- Create a series of new Messages.
|
||||||
-- -- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
|
-- -- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
|
||||||
-- -- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
|
-- -- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
|
||||||
-- -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
|
-- -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
|
||||||
-- -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
|
-- -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
|
||||||
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" )
|
-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" )
|
||||||
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" )
|
-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" )
|
||||||
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" )
|
-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" )
|
||||||
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")
|
-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")
|
||||||
--
|
--
|
||||||
function MESSAGE:New( MessageText, MessageDuration, MessageCategory, ClearScreen )
|
function MESSAGE:New( Text, Duration, Category, ClearScreen )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:F( { MessageText, MessageDuration, MessageCategory } )
|
|
||||||
|
self:F( { Text, Duration, Category } )
|
||||||
|
|
||||||
self.MessageType = nil
|
self.MessageType = nil
|
||||||
|
|
||||||
-- When no MessageCategory is given, we don't show it as a title...
|
-- When no MessageCategory is given, we don't show it as a title...
|
||||||
if MessageCategory and MessageCategory ~= "" then
|
if Category and Category ~= "" then
|
||||||
if MessageCategory:sub( -1 ) ~= "\n" then
|
if Category:sub( -1 ) ~= "\n" then
|
||||||
self.MessageCategory = MessageCategory .. ": "
|
self.MessageCategory = Category .. ": "
|
||||||
else
|
else
|
||||||
self.MessageCategory = MessageCategory:sub( 1, -2 ) .. ":\n"
|
self.MessageCategory = Category:sub( 1, -2 ) .. ":\n"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.MessageCategory = ""
|
self.MessageCategory = ""
|
||||||
@@ -114,9 +116,9 @@ function MESSAGE:New( MessageText, MessageDuration, MessageCategory, ClearScreen
|
|||||||
self.ClearScreen = ClearScreen
|
self.ClearScreen = ClearScreen
|
||||||
end
|
end
|
||||||
|
|
||||||
self.MessageDuration = MessageDuration or 5
|
self.MessageDuration = Duration or 5
|
||||||
self.MessageTime = timer.getTime()
|
self.MessageTime = timer.getTime()
|
||||||
self.MessageText = MessageText:gsub( "^\n", "", 1 ):gsub( "\n$", "", 1 )
|
self.MessageText = Text:gsub( "^\n", "", 1 ):gsub( "\n$", "", 1 )
|
||||||
|
|
||||||
self.MessageSent = false
|
self.MessageSent = false
|
||||||
self.MessageGroup = false
|
self.MessageGroup = false
|
||||||
@@ -177,40 +179,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 +241,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 +290,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 +311,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 +334,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 )
|
||||||
@@ -395,29 +380,36 @@ end
|
|||||||
--- Sends a MESSAGE to all players.
|
--- Sends a MESSAGE to all players.
|
||||||
-- @param #MESSAGE self
|
-- @param #MESSAGE self
|
||||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||||
-- @return #MESSAGE
|
-- @param #number Delay (Optional) Delay in seconds before the message is send. Default instantly (`nil`).
|
||||||
|
-- @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 )
|
function MESSAGE:ToAll( Settings, Delay )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
if self.MessageType then
|
if Delay and Delay>0 then
|
||||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
self:ScheduleOnce(Delay, MESSAGE.ToAll, self, Settings, 0)
|
||||||
self.MessageDuration = Settings:GetMessageTime( self.MessageType )
|
else
|
||||||
self.MessageCategory = "" -- self.MessageType .. ": "
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.MessageDuration ~= 0 then
|
if self.MessageType then
|
||||||
self:T( self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" ) .. " / " .. self.MessageDuration )
|
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||||
trigger.action.outText( self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" ), self.MessageDuration, self.ClearScreen )
|
self.MessageDuration = Settings:GetMessageTime( self.MessageType )
|
||||||
|
self.MessageCategory = "" -- self.MessageType .. ": "
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.MessageDuration ~= 0 then
|
||||||
|
self:T( self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" ) .. " / " .. self.MessageDuration )
|
||||||
|
trigger.action.outText( self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" ), self.MessageDuration, self.ClearScreen )
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@@ -472,6 +464,7 @@ _MESSAGESRS = {}
|
|||||||
-- @param #number Volume (optional) Volume, can be between 0.0 and 1.0 (loudest).
|
-- @param #number Volume (optional) Volume, can be between 0.0 and 1.0 (loudest).
|
||||||
-- @param #string Label (optional) Label, defaults to "MESSAGE" or the Message Category set.
|
-- @param #string Label (optional) Label, defaults to "MESSAGE" or the Message Category set.
|
||||||
-- @param Core.Point#COORDINATE Coordinate (optional) Coordinate this messages originates from.
|
-- @param Core.Point#COORDINATE Coordinate (optional) Coordinate this messages originates from.
|
||||||
|
-- @param #string Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Mind the dot here, not using the colon this time around!
|
-- -- Mind the dot here, not using the colon this time around!
|
||||||
-- -- Needed once only
|
-- -- Needed once only
|
||||||
@@ -479,7 +472,7 @@ _MESSAGESRS = {}
|
|||||||
-- -- later on in your code
|
-- -- later on in your code
|
||||||
-- MESSAGE:New("Test message!",15,"SPAWN"):ToSRS()
|
-- MESSAGE:New("Test message!",15,"SPAWN"):ToSRS()
|
||||||
--
|
--
|
||||||
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate)
|
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate,Backend)
|
||||||
|
|
||||||
_MESSAGESRS.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone"
|
_MESSAGESRS.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone"
|
||||||
|
|
||||||
@@ -497,6 +490,10 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
|
|||||||
_MESSAGESRS.MSRS:SetCoordinate(Coordinate)
|
_MESSAGESRS.MSRS:SetCoordinate(Coordinate)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Backend then
|
||||||
|
_MESSAGESRS.MSRS:SetBackend(Backend)
|
||||||
|
end
|
||||||
|
|
||||||
_MESSAGESRS.Culture = Culture or MSRS.culture or "en-GB"
|
_MESSAGESRS.Culture = Culture or MSRS.culture or "en-GB"
|
||||||
_MESSAGESRS.MSRS:SetCulture(Culture)
|
_MESSAGESRS.MSRS:SetCulture(Culture)
|
||||||
|
|
||||||
@@ -509,10 +506,10 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
|
|||||||
end
|
end
|
||||||
|
|
||||||
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
||||||
_MESSAGESRS.MSRS:SetLabel(Label or "MESSAGE")
|
_MESSAGESRS.MSRS:SetLabel(_MESSAGESRS.label)
|
||||||
|
|
||||||
_MESSAGESRS.port = Port or MSRS.port or 5002
|
_MESSAGESRS.port = Port or MSRS.port or 5002
|
||||||
_MESSAGESRS.MSRS:SetPort(Port or 5002)
|
_MESSAGESRS.MSRS:SetPort(_MESSAGESRS.port)
|
||||||
|
|
||||||
_MESSAGESRS.volume = Volume or MSRS.volume or 1
|
_MESSAGESRS.volume = Volume or MSRS.volume or 1
|
||||||
_MESSAGESRS.MSRS:SetVolume(_MESSAGESRS.volume)
|
_MESSAGESRS.MSRS:SetVolume(_MESSAGESRS.volume)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ do -- COORDINATE
|
|||||||
--
|
--
|
||||||
-- ## 4.4) Get the North correction of the current location.
|
-- ## 4.4) Get the North correction of the current location.
|
||||||
--
|
--
|
||||||
-- * @{#COORDINATE.GetNorthCorrection}(): Obtains the north correction at the current 3D point.
|
-- * @{#COORDINATE.GetNorthCorrectionRadians}(): Obtains the north correction at the current 3D point.
|
||||||
--
|
--
|
||||||
-- ## 4.5) Point Randomization
|
-- ## 4.5) Point Randomization
|
||||||
--
|
--
|
||||||
@@ -968,8 +968,13 @@ do -- COORDINATE
|
|||||||
-- @return DCS#Distance Distance The distance in meters.
|
-- @return DCS#Distance Distance The distance in meters.
|
||||||
function COORDINATE:Get2DDistance(TargetCoordinate)
|
function COORDINATE:Get2DDistance(TargetCoordinate)
|
||||||
if not TargetCoordinate then return 1000000 end
|
if not TargetCoordinate then return 1000000 end
|
||||||
local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z}
|
--local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z}
|
||||||
local norm=UTILS.VecNorm(a)
|
local a = self:GetVec2()
|
||||||
|
if not TargetCoordinate.ClassName then
|
||||||
|
TargetCoordinate=COORDINATE:NewFromVec3(TargetCoordinate)
|
||||||
|
end
|
||||||
|
local b = TargetCoordinate:GetVec2()
|
||||||
|
local norm=UTILS.VecDist2D(a,b)
|
||||||
return norm
|
return norm
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1216,7 +1221,7 @@ do -- COORDINATE
|
|||||||
local s = string.format( '%03d°', AngleDegrees )
|
local s = string.format( '%03d°', AngleDegrees )
|
||||||
|
|
||||||
if MagVar then
|
if MagVar then
|
||||||
local variation = UTILS.GetMagneticDeclination() or 0
|
local variation = self:GetMagneticDeclination() or 0
|
||||||
local AngleMagnetic = AngleDegrees - variation
|
local AngleMagnetic = AngleDegrees - variation
|
||||||
|
|
||||||
if AngleMagnetic < 0 then AngleMagnetic = 360-AngleMagnetic end
|
if AngleMagnetic < 0 then AngleMagnetic = 360-AngleMagnetic end
|
||||||
@@ -1329,13 +1334,16 @@ do -- COORDINATE
|
|||||||
-- @param Core.Settings#SETTINGS Settings
|
-- @param Core.Settings#SETTINGS Settings
|
||||||
-- @param #string Language (Optional) Language "en" or "ru"
|
-- @param #string Language (Optional) Language "en" or "ru"
|
||||||
-- @param #boolean MagVar If true, also state angle in magnetic
|
-- @param #boolean MagVar If true, also state angle in magnetic
|
||||||
|
-- @param #number Precision Rounding precision, defaults to 0
|
||||||
-- @return #string The BR Text
|
-- @return #string The BR Text
|
||||||
function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar )
|
function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar, Precision )
|
||||||
|
|
||||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||||
|
|
||||||
|
Precision = Precision or 0
|
||||||
|
|
||||||
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, MagVar )
|
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, MagVar )
|
||||||
local DistanceText = self:GetDistanceText( Distance, Settings, Language, 0 )
|
local DistanceText = self:GetDistanceText( Distance, Settings, Language, Precision )
|
||||||
|
|
||||||
local BRText = BearingText .. DistanceText
|
local BRText = BearingText .. DistanceText
|
||||||
|
|
||||||
@@ -1957,9 +1965,18 @@ do -- COORDINATE
|
|||||||
--- Smokes the point in a color.
|
--- Smokes the point in a color.
|
||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param Utilities.Utils#SMOKECOLOR SmokeColor
|
-- @param Utilities.Utils#SMOKECOLOR SmokeColor
|
||||||
function COORDINATE:Smoke( SmokeColor )
|
-- @param #string name (Optional) Name if you want to stop the smoke early (normal duration: 5mins)
|
||||||
|
function COORDINATE:Smoke( SmokeColor, name )
|
||||||
self:F2( { SmokeColor } )
|
self:F2( { SmokeColor } )
|
||||||
trigger.action.smoke( self:GetVec3(), SmokeColor )
|
self.firename = name or "Smoke-"..math.random(1,100000)
|
||||||
|
trigger.action.smoke( self:GetVec3(), SmokeColor, self.firename )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Stops smoking the point in a color.
|
||||||
|
-- @param #COORDINATE self
|
||||||
|
-- @param #string name (Optional) Name if you want to stop the smoke early (normal duration: 5mins)
|
||||||
|
function COORDINATE:StopSmoke( name )
|
||||||
|
self:StopBigSmokeAndFire( name )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Smoke the COORDINATE Green.
|
--- Smoke the COORDINATE Green.
|
||||||
@@ -2233,7 +2250,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
|
||||||
@@ -2410,7 +2427,7 @@ do -- COORDINATE
|
|||||||
for i,coord in ipairs(Coordinates) do
|
for i,coord in ipairs(Coordinates) do
|
||||||
vecs[i+1]=coord:GetVec3()
|
vecs[i+1]=coord:GetVec3()
|
||||||
end
|
end
|
||||||
|
|
||||||
if #vecs<3 then
|
if #vecs<3 then
|
||||||
self:E("ERROR: A free form polygon needs at least three points!")
|
self:E("ERROR: A free form polygon needs at least three points!")
|
||||||
elseif #vecs==3 then
|
elseif #vecs==3 then
|
||||||
@@ -2669,9 +2686,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 +2764,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 +2854,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)
|
||||||
@@ -2897,12 +2917,13 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from.
|
-- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from.
|
||||||
-- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.
|
-- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.
|
||||||
-- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA
|
-- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA
|
||||||
|
-- @param #number Precision Rounding precision, currently full km as default (=0)
|
||||||
-- @return #string The BR text.
|
-- @return #string The BR text.
|
||||||
function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar )
|
function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar, Precision )
|
||||||
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||||
local Distance = self:Get2DDistance( FromCoordinate )
|
local Distance = self:Get2DDistance( FromCoordinate )
|
||||||
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar )
|
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return a BRA string from a COORDINATE to the COORDINATE.
|
--- Return a BRA string from a COORDINATE to the COORDINATE.
|
||||||
@@ -2938,6 +2959,8 @@ do -- COORDINATE
|
|||||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||||
|
|
||||||
local bearing = UTILS.Round( UTILS.ToDegree( AngleRadians ),0 )
|
local bearing = UTILS.Round( UTILS.ToDegree( AngleRadians ),0 )
|
||||||
|
local magnetic = self:GetMagneticDeclination() or 0
|
||||||
|
bearing = bearing - magnetic
|
||||||
|
|
||||||
local rangeMetres = self:Get2DDistance(currentCoord)
|
local rangeMetres = self:Get2DDistance(currentCoord)
|
||||||
local rangeNM = UTILS.Round( UTILS.MetersToNM(rangeMetres), 0)
|
local rangeNM = UTILS.Round( UTILS.MetersToNM(rangeMetres), 0)
|
||||||
@@ -3310,16 +3333,16 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable to retrieve the settings from, otherwise the default settings will be chosen.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable to retrieve the settings from, otherwise the default settings will be chosen.
|
||||||
-- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.
|
-- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.
|
||||||
-- @param Tasking.Task#TASK Task The task for which coordinates need to be calculated.
|
|
||||||
-- @return #string The coordinate Text in the configured coordinate system.
|
-- @return #string The coordinate Text in the configured coordinate system.
|
||||||
function COORDINATE:ToString( Controllable, Settings, Task )
|
function COORDINATE:ToString( Controllable, Settings )
|
||||||
|
|
||||||
-- self:E( { Controllable = Controllable and Controllable:GetName() } )
|
-- self:E( { Controllable = Controllable and Controllable:GetName() } )
|
||||||
|
|
||||||
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
||||||
|
|
||||||
local ModeA2A = nil
|
local ModeA2A = nil
|
||||||
|
|
||||||
|
--[[
|
||||||
if Task then
|
if Task then
|
||||||
if Task:IsInstanceOf( TASK_A2A ) then
|
if Task:IsInstanceOf( TASK_A2A ) then
|
||||||
ModeA2A = true
|
ModeA2A = true
|
||||||
@@ -3336,7 +3359,7 @@ do -- COORDINATE
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
if ModeA2A == nil then
|
if ModeA2A == nil then
|
||||||
local IsAir = Controllable and ( Controllable:IsAirPlane() or Controllable:IsHelicopter() ) or false
|
local IsAir = Controllable and ( Controllable:IsAirPlane() or Controllable:IsHelicopter() ) or false
|
||||||
@@ -3411,7 +3434,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 +3466,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
|
||||||
@@ -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 .. '"' )
|
||||||
|
|
||||||
|
|||||||
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.
|
||||||
@@ -460,12 +535,6 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
-- Name of the spawned static.
|
-- Name of the spawned static.
|
||||||
Template.name = self.InitStaticName or string.format("%s#%05d", self.SpawnTemplatePrefix, self.SpawnIndex)
|
Template.name = self.InitStaticName or string.format("%s#%05d", self.SpawnTemplatePrefix, self.SpawnIndex)
|
||||||
|
|
||||||
-- Add and register the new static.
|
|
||||||
local mystatic=_DATABASE:AddStatic(Template.name)
|
|
||||||
|
|
||||||
-- Debug output.
|
|
||||||
self:T(Template)
|
|
||||||
|
|
||||||
-- Add static to the game.
|
-- Add static to the game.
|
||||||
local Static=nil --DCS#StaticObject
|
local Static=nil --DCS#StaticObject
|
||||||
|
|
||||||
@@ -488,7 +557,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,
|
||||||
@@ -502,6 +571,28 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
self:T("Spawning Static")
|
self:T("Spawning Static")
|
||||||
self:T2({Template=Template})
|
self:T2({Template=Template})
|
||||||
Static=coalition.addStaticObject(CountryID, Template)
|
Static=coalition.addStaticObject(CountryID, Template)
|
||||||
|
|
||||||
|
if Static then
|
||||||
|
self:T(string.format("Succesfully spawned static object \"%s\" ID=%d", Static:getName(), Static:getID()))
|
||||||
|
--[[
|
||||||
|
local static=StaticObject.getByName(Static:getName())
|
||||||
|
if static then
|
||||||
|
env.info(string.format("FF got static from StaticObject.getByName"))
|
||||||
|
else
|
||||||
|
env.error(string.format("FF error did NOT get static from StaticObject.getByName"))
|
||||||
|
end ]]
|
||||||
|
else
|
||||||
|
self:E(string.format("ERROR: DCS static object \"%s\" is nil!", tostring(Template.name)))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add and register the new static.
|
||||||
|
local mystatic=_DATABASE:AddStatic(Template.name)
|
||||||
|
|
||||||
|
-- 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
|
end
|
||||||
|
|
||||||
return mystatic
|
return mystatic
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -605,10 +605,13 @@ function ZONE_BASE:Trigger(Objects)
|
|||||||
self:AddTransition("TriggerStopped","TriggerStart","TriggerRunning")
|
self:AddTransition("TriggerStopped","TriggerStart","TriggerRunning")
|
||||||
self:AddTransition("*","EnteredZone","*")
|
self:AddTransition("*","EnteredZone","*")
|
||||||
self:AddTransition("*","LeftZone","*")
|
self:AddTransition("*","LeftZone","*")
|
||||||
|
self:AddTransition("*","ZoneEmpty","*")
|
||||||
|
self:AddTransition("*","ObjectDead","*")
|
||||||
self:AddTransition("*","TriggerRunCheck","*")
|
self:AddTransition("*","TriggerRunCheck","*")
|
||||||
self:AddTransition("*","TriggerStop","TriggerStopped")
|
self:AddTransition("*","TriggerStop","TriggerStopped")
|
||||||
self:TriggerStart()
|
self:TriggerStart()
|
||||||
self.checkobjects = Objects
|
self.checkobjects = Objects
|
||||||
|
self.ObjectsInZone = false
|
||||||
if UTILS.IsInstanceOf(Objects,"SET_BASE") then
|
if UTILS.IsInstanceOf(Objects,"SET_BASE") then
|
||||||
self.objectset = Objects.Set
|
self.objectset = Objects.Set
|
||||||
else
|
else
|
||||||
@@ -646,6 +649,22 @@ function ZONE_BASE:Trigger(Objects)
|
|||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable leaving the zone.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable leaving the zone.
|
||||||
|
|
||||||
|
--- On After "ObjectDead" event. An observed object has left the zone.
|
||||||
|
-- @function [parent=#ZONE_BASE] OnAfterObjectDead
|
||||||
|
-- @param #ZONE_BASE self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable which died. Might be nil.
|
||||||
|
|
||||||
|
--- On After "ZoneEmpty" event. All observed objects have left the zone or are dead.
|
||||||
|
-- @function [parent=#ZONE_BASE] OnAfterZoneEmpty
|
||||||
|
-- @param #ZONE_BASE self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (Internal) Check the assigned objects for being in/out of the zone
|
--- (Internal) Check the assigned objects for being in/out of the zone
|
||||||
@@ -659,9 +678,13 @@ function ZONE_BASE:_TriggerCheck(fromstart)
|
|||||||
-- just earmark everyone in/out
|
-- just earmark everyone in/out
|
||||||
for _,_object in pairs(objectset) do
|
for _,_object in pairs(objectset) do
|
||||||
local obj = _object -- Wrapper.Controllable#CONTROLLABLE
|
local obj = _object -- Wrapper.Controllable#CONTROLLABLE
|
||||||
if not obj.TriggerInZone then obj.TriggerInZone = {} end
|
if not obj.TriggerInZone then
|
||||||
|
obj.TriggerInZone = {}
|
||||||
|
obj.TriggerZoneDeadNotification = false
|
||||||
|
end
|
||||||
if obj and obj:IsAlive() and self:IsCoordinateInZone(obj:GetCoordinate()) then
|
if obj and obj:IsAlive() and self:IsCoordinateInZone(obj:GetCoordinate()) then
|
||||||
obj.TriggerInZone[self.ZoneName] = true
|
obj.TriggerInZone[self.ZoneName] = true
|
||||||
|
self.ObjectsInZone = true
|
||||||
else
|
else
|
||||||
obj.TriggerInZone[self.ZoneName] = false
|
obj.TriggerInZone[self.ZoneName] = false
|
||||||
end
|
end
|
||||||
@@ -669,6 +692,7 @@ function ZONE_BASE:_TriggerCheck(fromstart)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Check for changes
|
-- Check for changes
|
||||||
|
local objcount = 0
|
||||||
for _,_object in pairs(objectset) do
|
for _,_object in pairs(objectset) do
|
||||||
local obj = _object -- Wrapper.Controllable#CONTROLLABLE
|
local obj = _object -- Wrapper.Controllable#CONTROLLABLE
|
||||||
if obj and obj:IsAlive() then
|
if obj and obj:IsAlive() then
|
||||||
@@ -683,11 +707,20 @@ function ZONE_BASE:_TriggerCheck(fromstart)
|
|||||||
-- is obj in zone?
|
-- is obj in zone?
|
||||||
local inzone = self:IsCoordinateInZone(obj:GetCoordinate())
|
local inzone = self:IsCoordinateInZone(obj:GetCoordinate())
|
||||||
--self:I("Object "..obj:GetName().." is in zone: "..tostring(inzone))
|
--self:I("Object "..obj:GetName().." is in zone: "..tostring(inzone))
|
||||||
|
if inzone and obj.TriggerInZone[self.ZoneName] then
|
||||||
|
-- just count
|
||||||
|
objcount = objcount + 1
|
||||||
|
self.ObjectsInZone = true
|
||||||
|
obj.TriggerZoneDeadNotification = false
|
||||||
|
end
|
||||||
if inzone and not obj.TriggerInZone[self.ZoneName] then
|
if inzone and not obj.TriggerInZone[self.ZoneName] then
|
||||||
-- wasn't in zone before
|
-- wasn't in zone before
|
||||||
--self:I("Newly entered")
|
--self:I("Newly entered")
|
||||||
self:__EnteredZone(0.5,obj)
|
self:__EnteredZone(0.5,obj)
|
||||||
obj.TriggerInZone[self.ZoneName] = true
|
obj.TriggerInZone[self.ZoneName] = true
|
||||||
|
objcount = objcount + 1
|
||||||
|
self.ObjectsInZone = true
|
||||||
|
obj.TriggerZoneDeadNotification = false
|
||||||
elseif (not inzone) and obj.TriggerInZone[self.ZoneName] then
|
elseif (not inzone) and obj.TriggerInZone[self.ZoneName] then
|
||||||
-- has left the zone
|
-- has left the zone
|
||||||
--self:I("Newly left")
|
--self:I("Newly left")
|
||||||
@@ -696,8 +729,21 @@ function ZONE_BASE:_TriggerCheck(fromstart)
|
|||||||
else
|
else
|
||||||
--self:I("Not left or not entered, or something went wrong!")
|
--self:I("Not left or not entered, or something went wrong!")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- object dead
|
||||||
|
if not obj.TriggerZoneDeadNotification == true then
|
||||||
|
obj.TriggerInZone = nil
|
||||||
|
self:__ObjectDead(0.5,obj)
|
||||||
|
obj.TriggerZoneDeadNotification = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- zone empty?
|
||||||
|
if objcount == 0 and self.ObjectsInZone == true then
|
||||||
|
-- zone was not but is now empty
|
||||||
|
self.ObjectsInZone = false
|
||||||
|
self:__ZoneEmpty(0.5)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -791,7 +837,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 +993,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 +1024,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 +1050,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 +1062,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 +1074,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 +1086,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 +1100,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 +1184,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 +1195,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 +1249,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,13 +1455,13 @@ 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,
|
||||||
params = {
|
params = {
|
||||||
point = ZoneCoord:GetVec3(),
|
point = ZoneCoord:GetVec3(),
|
||||||
radius = ZoneRadius / 2,
|
radius = ZoneRadius,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1436,7 +1482,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 +1502,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 +1567,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 +1582,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 +1598,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 +1731,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 +1800,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 +1870,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 +1886,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 +1919,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 +1928,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 +1942,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 +1952,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 +1960,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 +1986,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 +2002,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 +2013,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 +2022,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 +2031,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 +2042,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
|
||||||
@@ -2046,7 +2092,7 @@ function _ZONE_TRIANGLE:New(p1, p2, p3)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.SurfaceArea = math.abs((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y)) * 0.5
|
self.SurfaceArea = math.abs((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y)) * 0.5
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2054,7 +2100,7 @@ end
|
|||||||
-- @param #_ZONE_TRIANGLE self
|
-- @param #_ZONE_TRIANGLE self
|
||||||
-- @param #table pt The point to check
|
-- @param #table pt The point to check
|
||||||
-- @param #table points (optional) The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it
|
-- @param #table points (optional) The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it
|
||||||
-- @return #bool True if the point is contained, false otherwise
|
-- @return #boolean True if the point is contained, false otherwise
|
||||||
function _ZONE_TRIANGLE:ContainsPoint(pt, points)
|
function _ZONE_TRIANGLE:ContainsPoint(pt, points)
|
||||||
points = points or self.Points
|
points = points or self.Points
|
||||||
|
|
||||||
@@ -2183,7 +2229,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 +2397,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 +2480,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 +2501,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
|
||||||
@@ -2563,7 +2609,7 @@ function ZONE_POLYGON_BASE:ReFill(Color,Alpha)
|
|||||||
self.FillTriangles = {}
|
self.FillTriangles = {}
|
||||||
end
|
end
|
||||||
-- refill
|
-- refill
|
||||||
for _, triangle in pairs(self._Triangles) do
|
for _,triangle in pairs(self._Triangles) do
|
||||||
local draw_ids = triangle:Fill(coalition,color,alpha,nil)
|
local draw_ids = triangle:Fill(coalition,color,alpha,nil)
|
||||||
self.FillTriangles = draw_ids
|
self.FillTriangles = draw_ids
|
||||||
table.combine(self.DrawID, draw_ids)
|
table.combine(self.DrawID, draw_ids)
|
||||||
@@ -2707,7 +2753,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 +2761,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 +2786,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 +2796,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 +2819,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 +2829,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 +2849,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 +2884,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 +2897,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 +2911,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 +2932,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 +2955,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 +2994,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 +3065,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 +3081,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 +3101,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 )
|
||||||
@@ -3076,9 +3122,25 @@ function ZONE_POLYGON:NewFromDrawing(DrawingName)
|
|||||||
-- points for the drawings are saved in local space, so add the object's map x and y coordinates to get
|
-- points for the drawings are saved in local space, so add the object's map x and y coordinates to get
|
||||||
-- world space points we can use
|
-- world space points we can use
|
||||||
for _, point in UTILS.spairs(object["points"]) do
|
for _, point in UTILS.spairs(object["points"]) do
|
||||||
|
-- check if we want to skip adding a point
|
||||||
|
local skip = false
|
||||||
local p = {x = object["mapX"] + point["x"],
|
local p = {x = object["mapX"] + point["x"],
|
||||||
y = object["mapY"] + point["y"] }
|
y = object["mapY"] + point["y"] }
|
||||||
table.add(points, p)
|
|
||||||
|
-- Check if the same coordinates already exist in the list, skip if they do
|
||||||
|
-- This can happen when drawing a Polygon in Free mode, DCS adds points on
|
||||||
|
-- top of each other that are in the `mission` file, but not visible in the
|
||||||
|
-- Mission Editor
|
||||||
|
for _, pt in pairs(points) do
|
||||||
|
if pt.x == p.x and pt.y == p.y then
|
||||||
|
skip = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- if it's a unique point, add it
|
||||||
|
if not skip then
|
||||||
|
table.add(points, p)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
elseif object["polygonMode"] == "rect" then
|
elseif object["polygonMode"] == "rect" then
|
||||||
-- the points for a rect are saved as local coordinates with an angle. To get the world space points from this
|
-- the points for a rect are saved as local coordinates with an angle. To get the world space points from this
|
||||||
@@ -3096,6 +3158,7 @@ function ZONE_POLYGON:NewFromDrawing(DrawingName)
|
|||||||
|
|
||||||
points = {p1, p2, p3, p4}
|
points = {p1, p2, p3, p4}
|
||||||
else
|
else
|
||||||
|
-- bring the Arrow code over from Shape/Polygon
|
||||||
-- something else that might be added in the future
|
-- something else that might be added in the future
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3204,7 +3267,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
|
||||||
|
|
||||||
@@ -3215,7 +3278,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
|
||||||
@@ -3519,7 +3582,37 @@ do -- ZONE_ELASTIC
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Remove a vertex (point) from the polygon.
|
||||||
|
-- @param #ZONE_ELASTIC self
|
||||||
|
-- @param DCS#Vec2 Vec2 Point in 2D (with x and y coordinates).
|
||||||
|
-- @return #ZONE_ELASTIC self
|
||||||
|
function ZONE_ELASTIC:RemoveVertex2D(Vec2)
|
||||||
|
|
||||||
|
local found = false
|
||||||
|
local findex = 0
|
||||||
|
for _id,_vec2 in pairs(self.points) do
|
||||||
|
if _vec2.x == Vec2.x and _vec2.y == Vec2.y then
|
||||||
|
found = true
|
||||||
|
findex = _id
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if found == true and findex > 0 then
|
||||||
|
table.remove(self.points,findex)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Remove a vertex (point) from the polygon.
|
||||||
|
-- @param #ZONE_ELASTIC self
|
||||||
|
-- @param DCS#Vec3 Vec3 Point in 3D (with x, y and z coordinates). Only the x and z coordinates are used.
|
||||||
|
-- @return #ZONE_ELASTIC self
|
||||||
|
function ZONE_ELASTIC:RemoveVertex3D(Vec3)
|
||||||
|
return self:RemoveVertex2D({x=Vec3.x, y=Vec3.z})
|
||||||
|
end
|
||||||
|
|
||||||
--- Add a vertex (point) to the polygon.
|
--- Add a vertex (point) to the polygon.
|
||||||
-- @param #ZONE_ELASTIC self
|
-- @param #ZONE_ELASTIC self
|
||||||
@@ -3556,8 +3649,8 @@ 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 {})
|
||||||
|
|
||||||
@@ -3575,6 +3668,9 @@ do -- ZONE_ELASTIC
|
|||||||
|
|
||||||
-- Update polygon verticies from points.
|
-- Update polygon verticies from points.
|
||||||
self._.Polygon=self:_ConvexHull(points)
|
self._.Polygon=self:_ConvexHull(points)
|
||||||
|
|
||||||
|
self._Triangles = self:_Triangulate()
|
||||||
|
self.SurfaceArea = self:_CalculateSurfaceArea()
|
||||||
|
|
||||||
if Draw~=false then
|
if Draw~=false then
|
||||||
if self.DrawID or Draw==true then
|
if self.DrawID or Draw==true then
|
||||||
@@ -3624,7 +3720,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
|
||||||
@@ -3773,7 +3869,7 @@ end
|
|||||||
--- Checks if a point is contained within the oval.
|
--- Checks if a point is contained within the oval.
|
||||||
-- @param #ZONE_OVAL self
|
-- @param #ZONE_OVAL self
|
||||||
-- @param #table point The point to check
|
-- @param #table point The point to check
|
||||||
-- @return #bool True if the point is contained, false otherwise
|
-- @return #boolean True if the point is contained, false otherwise
|
||||||
function ZONE_OVAL:IsVec2InZone(vec2)
|
function ZONE_OVAL:IsVec2InZone(vec2)
|
||||||
local cos, sin = math.cos, math.sin
|
local cos, sin = math.cos, math.sin
|
||||||
local dx = vec2.x - self.CenterVec2.x
|
local dx = vec2.x - self.CenterVec2.x
|
||||||
@@ -3970,7 +4066,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
|
||||||
|
|
||||||
@@ -3981,7 +4077,7 @@ do -- ZONE_AIRBASE
|
|||||||
ZoneVec2 = self._.ZoneVec2Cache
|
ZoneVec2 = self._.ZoneVec2Cache
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { ZoneVec2 } )
|
--self:T( { ZoneVec2 } )
|
||||||
|
|
||||||
return ZoneVec2
|
return ZoneVec2
|
||||||
end
|
end
|
||||||
@@ -3992,11 +4088,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
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ do -- world
|
|||||||
-- @field #world.event event [https://wiki.hoggitworld.com/view/DCS_enum_world](https://wiki.hoggitworld.com/view/DCS_enum_world)
|
-- @field #world.event event [https://wiki.hoggitworld.com/view/DCS_enum_world](https://wiki.hoggitworld.com/view/DCS_enum_world)
|
||||||
-- @field #world.BirthPlace BirthPlace The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
|
-- @field #world.BirthPlace BirthPlace The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
|
||||||
-- @field #world.VolumeType VolumeType The volumeType enumerator defines the types of 3d geometery used within the [world.searchObjects](https://wiki.hoggitworld.com/view/DCS_func_searchObjects) function.
|
-- @field #world.VolumeType VolumeType The volumeType enumerator defines the types of 3d geometery used within the [world.searchObjects](https://wiki.hoggitworld.com/view/DCS_func_searchObjects) function.
|
||||||
|
-- @field #world.weather weather Weather functions for fog etc.
|
||||||
|
|
||||||
--- The world singleton contains functions centered around two different but extremely useful functions.
|
--- The world singleton contains functions centered around two different but extremely useful functions.
|
||||||
-- * Events and event handlers are all governed within world.
|
-- * Events and event handlers are all governed within world.
|
||||||
@@ -25,38 +26,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
|
||||||
@@ -102,6 +133,36 @@ do -- world
|
|||||||
-- @function [parent=#world] getAirbases
|
-- @function [parent=#world] getAirbases
|
||||||
-- @param #number coalitionId The coalition side number ID. Default is all airbases are returned.
|
-- @param #number coalitionId The coalition side number ID. Default is all airbases are returned.
|
||||||
-- @return #table Table of DCS airbase objects.
|
-- @return #table Table of DCS airbase objects.
|
||||||
|
|
||||||
|
|
||||||
|
--- Weather functions.
|
||||||
|
-- @type world.weather
|
||||||
|
|
||||||
|
--- Fog animation data structure.
|
||||||
|
-- @type world.FogAnimation
|
||||||
|
-- @field #number time
|
||||||
|
-- @field #number visibility
|
||||||
|
-- @field #number thickness
|
||||||
|
|
||||||
|
--- Returns the current fog thickness.
|
||||||
|
-- @function [parent=#world.weather] getFogThickness Returns the fog thickness.
|
||||||
|
-- @return #number Fog thickness in meters. If there is no fog, zero is returned.
|
||||||
|
|
||||||
|
--- Sets the fog thickness instantly. Any current fog animation is discarded.
|
||||||
|
-- @function [parent=#world.weather] setFogThickness
|
||||||
|
-- @param #number thickness Fog thickness in meters. Set to zero to disable fog.
|
||||||
|
|
||||||
|
--- Returns the current fog visibility distance.
|
||||||
|
-- @function [parent=#world.weather] getFogVisibilityDistance Returns the current maximum visibility distance in meters. Returns zero if fog is not present.
|
||||||
|
|
||||||
|
--- Instantly sets the maximum visibility distance of fog at sea level when looking at the horizon. Any current fog animation is discarded. Set zero to disable the fog.
|
||||||
|
-- @function [parent=#world.weather] setFogVisibilityDistance
|
||||||
|
-- @param #number visibility Max fog visibility in meters. Set to zero to disable fog.
|
||||||
|
|
||||||
|
--- Sets fog animation keys. Time is set in seconds and relative to the current simulation time, where time=0 is the current moment.
|
||||||
|
-- Time must be increasing. Previous animation is always discarded despite the data being correct.
|
||||||
|
-- @function [parent=#world.weather] setFogAnimation
|
||||||
|
-- @param #world.FogAnimation animation List of fog animations
|
||||||
|
|
||||||
end -- world
|
end -- world
|
||||||
|
|
||||||
@@ -377,7 +438,7 @@ do -- coalition
|
|||||||
-- @param #table groupData Group data table.
|
-- @param #table groupData Group data table.
|
||||||
-- @return DCS#Group The spawned Group object.
|
-- @return DCS#Group The spawned Group object.
|
||||||
|
|
||||||
--- Dynamically spawns a static object. See [hoggit](https://wiki.hoggitworld.com/view/DCS_func_addGroup)
|
--- Dynamically spawns a static object. See [hoggit](https://wiki.hoggitworld.com/view/DCS_func_addStaticObject)
|
||||||
-- @function [parent=#coalition] addStaticObject
|
-- @function [parent=#coalition] addStaticObject
|
||||||
-- @param #number countryId Id of the country.
|
-- @param #number countryId Id of the country.
|
||||||
-- @param #table groupData Group data table.
|
-- @param #table groupData Group data table.
|
||||||
@@ -390,6 +451,7 @@ end -- coalition
|
|||||||
|
|
||||||
do -- Types
|
do -- Types
|
||||||
|
|
||||||
|
--- Descriptors.
|
||||||
-- @type Desc
|
-- @type Desc
|
||||||
-- @field #number speedMax0 Max speed in meters/second at zero altitude.
|
-- @field #number speedMax0 Max speed in meters/second at zero altitude.
|
||||||
-- @field #number massEmpty Empty mass in kg.
|
-- @field #number massEmpty Empty mass in kg.
|
||||||
@@ -568,9 +630,13 @@ do -- Object
|
|||||||
--- @function [parent=#Object] destroy
|
--- @function [parent=#Object] destroy
|
||||||
-- @param #Object self
|
-- @param #Object self
|
||||||
|
|
||||||
--- @function [parent=#Object] getCategory
|
--- Returns an enumerator of the category for the specific object.
|
||||||
|
-- The enumerator returned is dependent on the category of the object and how the function is called.
|
||||||
|
-- As of DCS 2.9.2 when this function is called on an Object, Unit, Weapon, or Airbase a 2nd value will be returned which details the object sub-category value.
|
||||||
|
-- @function [parent=#Object] getCategory
|
||||||
-- @param #Object self
|
-- @param #Object self
|
||||||
-- @return #Object.Category
|
-- @return #Object.Category The object category (1=UNIT, 2=WEAPON, 3=STATIC, 4=BASE, 5=SCENERY, 6=Cargo)
|
||||||
|
-- @return #number The subcategory of the passed object, e.g. Unit.Category if a unit object was passed.
|
||||||
|
|
||||||
--- Returns type name of the Object.
|
--- Returns type name of the Object.
|
||||||
-- @function [parent=#Object] getTypeName
|
-- @function [parent=#Object] getTypeName
|
||||||
@@ -983,14 +1049,16 @@ do -- Spot
|
|||||||
end -- Spot
|
end -- Spot
|
||||||
|
|
||||||
do -- Controller
|
do -- Controller
|
||||||
|
|
||||||
--- Controller is an object that performs A.I.-tasks. Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands. Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.
|
--- Controller is an object that performs A.I.-tasks. Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands. Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.
|
||||||
--
|
--
|
||||||
-- This class has 2 types of functions:
|
-- This class has 2 types of functions:
|
||||||
--
|
--
|
||||||
-- * Tasks
|
-- * Tasks
|
||||||
-- * Commands: Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.
|
-- * Commands: Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.
|
||||||
|
--
|
||||||
-- @type Controller
|
-- @type Controller
|
||||||
-- @field #Controller.Detection Detection Enum contains identifiers of surface types.
|
-- @field #Controller.Detection Detection Enum contains identifiers of surface types.
|
||||||
|
|
||||||
--- Enables and disables the controller.
|
--- Enables and disables the controller.
|
||||||
-- Note: Now it works only for ground / naval groups!
|
-- Note: Now it works only for ground / naval groups!
|
||||||
@@ -1049,18 +1117,18 @@ do -- Controller
|
|||||||
|
|
||||||
-- Detection
|
-- Detection
|
||||||
|
|
||||||
--- Enum contains identifiers of surface types.
|
--- Enum containing detection types.
|
||||||
-- @type Controller.Detection
|
-- @type Controller.Detection
|
||||||
-- @field VISUAL
|
-- @field #number VISUAL Visual detection. Numeric value 1.
|
||||||
-- @field OPTIC
|
-- @field #number OPTIC Optical detection. Numeric value 2.
|
||||||
-- @field RADAR
|
-- @field #number RADAR Radar detection. Numeric value 4.
|
||||||
-- @field IRST
|
-- @field #number IRST Infra-red search and track detection. Numeric value 8.
|
||||||
-- @field RWR
|
-- @field #number RWR Radar Warning Receiver detection. Numeric value 16.
|
||||||
-- @field DLINK
|
-- @field #number DLINK Data link detection. Numeric value 32.
|
||||||
|
|
||||||
--- Detected target.
|
--- Detected target.
|
||||||
-- @type DetectedTarget
|
-- @type Controller.DetectedTarget
|
||||||
-- @field Wrapper.Object#Object object The target
|
-- @field DCS#Object object The target
|
||||||
-- @field #boolean visible The target is visible
|
-- @field #boolean visible The target is visible
|
||||||
-- @field #boolean type The target type is known
|
-- @field #boolean type The target type is known
|
||||||
-- @field #boolean distance Distance to the target is known
|
-- @field #boolean distance Distance to the target is known
|
||||||
@@ -1073,9 +1141,9 @@ do -- Controller
|
|||||||
-- @param #Controller.Detection detection Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
|
-- @param #Controller.Detection detection Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
|
||||||
-- @return #boolean detected True if the target is detected.
|
-- @return #boolean detected True if the target is detected.
|
||||||
-- @return #boolean visible Has effect only if detected is true. True if the target is visible now.
|
-- @return #boolean visible Has effect only if detected is true. True if the target is visible now.
|
||||||
|
-- @return #boolean type Has effect only if detected is true. True if the target type is known.
|
||||||
|
-- @return #boolean distance Has effect only if detected is true. True if the distance to the target is known.
|
||||||
-- @return #ModelTime lastTime Has effect only if visible is false. Last time when target was seen.
|
-- @return #ModelTime lastTime Has effect only if visible is false. Last time when target was seen.
|
||||||
-- @return #boolean type Has effect only if detected is true. True if the target type is known.
|
|
||||||
-- @return #boolean distance Has effect only if detected is true. True if the distance to the target is known.
|
|
||||||
-- @return #Vec3 lastPos Has effect only if visible is false. Last position of the target when it was seen.
|
-- @return #Vec3 lastPos Has effect only if visible is false. Last position of the target when it was seen.
|
||||||
-- @return #Vec3 lastVel Has effect only if visible is false. Last velocity of the target when it was seen.
|
-- @return #Vec3 lastVel Has effect only if visible is false. Last velocity of the target when it was seen.
|
||||||
|
|
||||||
@@ -1101,6 +1169,7 @@ end -- Controller
|
|||||||
|
|
||||||
do -- Unit
|
do -- Unit
|
||||||
|
|
||||||
|
--- Unit.
|
||||||
-- @type Unit
|
-- @type Unit
|
||||||
-- @extends #CoalitionObject
|
-- @extends #CoalitionObject
|
||||||
-- @field ID Identifier of an unit. It assigned to an unit by the Mission Editor automatically.
|
-- @field ID Identifier of an unit. It assigned to an unit by the Mission Editor automatically.
|
||||||
@@ -1665,6 +1734,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
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
-- ### Author: FlightControl - Framework Design & Programming
|
-- ### Author: FlightControl - Framework Design & Programming
|
||||||
-- ### Refactoring to use the Runway auto-detection: Applevangelist
|
-- ### Refactoring to use the Runway auto-detection: Applevangelist
|
||||||
-- @date August 2022
|
-- @date August 2022
|
||||||
-- Last Update Nov 2023
|
-- Last Update Feb 2025
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@@ -416,7 +416,7 @@ end
|
|||||||
-- @field #ATC_GROUND_UNIVERSAL
|
-- @field #ATC_GROUND_UNIVERSAL
|
||||||
ATC_GROUND_UNIVERSAL = {
|
ATC_GROUND_UNIVERSAL = {
|
||||||
ClassName = "ATC_GROUND_UNIVERSAL",
|
ClassName = "ATC_GROUND_UNIVERSAL",
|
||||||
Version = "0.0.1",
|
Version = "0.0.2",
|
||||||
SetClient = nil,
|
SetClient = nil,
|
||||||
Airbases = nil,
|
Airbases = nil,
|
||||||
AirbaseList = nil,
|
AirbaseList = nil,
|
||||||
@@ -441,17 +441,25 @@ function ATC_GROUND_UNIVERSAL:New(AirbaseList)
|
|||||||
self:T( { self.ClassName } )
|
self:T( { self.ClassName } )
|
||||||
|
|
||||||
self.Airbases = {}
|
self.Airbases = {}
|
||||||
|
|
||||||
for _name,_ in pairs(_DATABASE.AIRBASES) do
|
|
||||||
self.Airbases[_name]={}
|
|
||||||
end
|
|
||||||
|
|
||||||
self.AirbaseList = AirbaseList
|
self.AirbaseList = AirbaseList
|
||||||
|
|
||||||
if not self.AirbaseList then
|
if not self.AirbaseList then
|
||||||
self.AirbaseList = {}
|
self.AirbaseList = {}
|
||||||
for _name,_ in pairs(_DATABASE.AIRBASES) do
|
for _name,_base in pairs(_DATABASE.AIRBASES) do
|
||||||
self.AirbaseList[_name]=_name
|
-- DONE exclude FARPS and Ships
|
||||||
|
if _base and _base.isAirdrome == true then
|
||||||
|
self.AirbaseList[_name]=_name
|
||||||
|
self.Airbases[_name]={}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for _,_name in pairs(AirbaseList) do
|
||||||
|
-- DONE exclude FARPS and Ships
|
||||||
|
local airbase = _DATABASE:FindAirbase(_name)
|
||||||
|
if airbase and (airbase.isAirdrome == true) then
|
||||||
|
self.Airbases[_name]={}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -721,14 +729,18 @@ function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
|||||||
|
|
||||||
if NotInRunwayZone then
|
if NotInRunwayZone then
|
||||||
|
|
||||||
|
local Taxi = Client:GetState( self, "Taxi" )
|
||||||
|
|
||||||
if IsOnGround then
|
if IsOnGround then
|
||||||
local Taxi = Client:GetState( self, "Taxi" )
|
|
||||||
self:T( Taxi )
|
self:T( Taxi )
|
||||||
if Taxi == false then
|
if Taxi == false then
|
||||||
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
||||||
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
||||||
Velocity:ToString() , 20, "ATC" )
|
Velocity:ToString() , 20, "ATC" )
|
||||||
Client:SetState( self, "Taxi", true )
|
Client:SetState( self, "Taxi", true )
|
||||||
|
Client:SetState( self, "Speeding", false )
|
||||||
|
Client:SetState( self, "Warnings", 0 )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: GetVelocityKMH function usage
|
-- TODO: GetVelocityKMH function usage
|
||||||
@@ -737,7 +749,7 @@ function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
|||||||
local IsAboveRunway = Client:IsAboveRunway()
|
local IsAboveRunway = Client:IsAboveRunway()
|
||||||
self:T( {IsAboveRunway, IsOnGround, Velocity:Get() })
|
self:T( {IsAboveRunway, IsOnGround, Velocity:Get() })
|
||||||
|
|
||||||
if IsOnGround then
|
if IsOnGround and not Taxi then
|
||||||
local Speeding = false
|
local Speeding = false
|
||||||
if AirbaseMeta.MaximumKickSpeed then
|
if AirbaseMeta.MaximumKickSpeed then
|
||||||
if Velocity:Get() > AirbaseMeta.MaximumKickSpeed then
|
if Velocity:Get() > AirbaseMeta.MaximumKickSpeed then
|
||||||
@@ -749,15 +761,17 @@ function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Speeding == true then
|
if Speeding == true then
|
||||||
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() ..
|
--MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() ..
|
||||||
" has been kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
|
-- " has been kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
|
||||||
Client:Destroy()
|
--Client:Destroy()
|
||||||
Client:SetState( self, "Speeding", false )
|
Client:SetState( self, "Speeding", true )
|
||||||
Client:SetState( self, "Warnings", 0 )
|
local SpeedingWarnings = Client:GetState( self, "Warnings" )
|
||||||
|
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
|
||||||
|
Client:Message( "Warning " .. SpeedingWarnings .. "/3! Airbase traffic rule violation! Slow down now! Your speed is " ..
|
||||||
|
Velocity:ToString(), 5, "ATC" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if IsOnGround then
|
if IsOnGround then
|
||||||
|
|
||||||
local Speeding = false
|
local Speeding = false
|
||||||
@@ -1035,23 +1049,23 @@ end
|
|||||||
-- The following airbases are monitored at the Nevada region.
|
-- The following airbases are monitored at the Nevada region.
|
||||||
-- Use the @{Wrapper.Airbase#AIRBASE.Nevada} enumeration to select the airbases to be monitored.
|
-- Use the @{Wrapper.Airbase#AIRBASE.Nevada} enumeration to select the airbases to be monitored.
|
||||||
--
|
--
|
||||||
-- * `AIRBASE.Nevada.Beatty_Airport`
|
-- * `AIRBASE.Nevada.Beatty`
|
||||||
-- * `AIRBASE.Nevada.Boulder_City_Airport`
|
-- * `AIRBASE.Nevada.Boulder_City`
|
||||||
-- * `AIRBASE.Nevada.Creech_AFB`
|
-- * `AIRBASE.Nevada.Creech`
|
||||||
-- * `AIRBASE.Nevada.Echo_Bay`
|
-- * `AIRBASE.Nevada.Echo_Bay`
|
||||||
-- * `AIRBASE.Nevada.Groom_Lake_AFB`
|
-- * `AIRBASE.Nevada.Groom_Lake`
|
||||||
-- * `AIRBASE.Nevada.Henderson_Executive_Airport`
|
-- * `AIRBASE.Nevada.Henderson_Executive`
|
||||||
-- * `AIRBASE.Nevada.Jean_Airport`
|
-- * `AIRBASE.Nevada.Jean`
|
||||||
-- * `AIRBASE.Nevada.Laughlin_Airport`
|
-- * `AIRBASE.Nevada.Laughlin`
|
||||||
-- * `AIRBASE.Nevada.Lincoln_County`
|
-- * `AIRBASE.Nevada.Lincoln_County`
|
||||||
-- * `AIRBASE.Nevada.McCarran_International_Airport`
|
-- * `AIRBASE.Nevada.McCarran_International`
|
||||||
-- * `AIRBASE.Nevada.Mesquite`
|
-- * `AIRBASE.Nevada.Mesquite`
|
||||||
-- * `AIRBASE.Nevada.Mina_Airport`
|
-- * `AIRBASE.Nevada.Mina`
|
||||||
-- * `AIRBASE.Nevada.Nellis_AFB`
|
-- * `AIRBASE.Nevada.Nellis`
|
||||||
-- * `AIRBASE.Nevada.North_Las_Vegas`
|
-- * `AIRBASE.Nevada.North_Las_Vegas`
|
||||||
-- * `AIRBASE.Nevada.Pahute_Mesa_Airstrip`
|
-- * `AIRBASE.Nevada.Pahute_Mesa`
|
||||||
-- * `AIRBASE.Nevada.Tonopah_Airport`
|
-- * `AIRBASE.Nevada.Tonopah`
|
||||||
-- * `AIRBASE.Nevada.Tonopah_Test_Range_Airfield`
|
-- * `AIRBASE.Nevada.Tonopah_Test_Range`
|
||||||
--
|
--
|
||||||
-- # Installation
|
-- # Installation
|
||||||
--
|
--
|
||||||
@@ -1088,10 +1102,10 @@ end
|
|||||||
--
|
--
|
||||||
-- -- Monitor specific airbases.
|
-- -- Monitor specific airbases.
|
||||||
-- ATC_Ground = ATC_GROUND_NEVADA:New(
|
-- ATC_Ground = ATC_GROUND_NEVADA:New(
|
||||||
-- { AIRBASE.Nevada.Laughlin_Airport,
|
-- { AIRBASE.Nevada.Laughlin,
|
||||||
-- AIRBASE.Nevada.Lincoln_County,
|
-- AIRBASE.Nevada.Lincoln_County,
|
||||||
-- AIRBASE.Nevada.North_Las_Vegas,
|
-- AIRBASE.Nevada.North_Las_Vegas,
|
||||||
-- AIRBASE.Nevada.McCarran_International_Airport
|
-- AIRBASE.Nevada.McCarran_International
|
||||||
-- }
|
-- }
|
||||||
-- )
|
-- )
|
||||||
--
|
--
|
||||||
@@ -1330,33 +1344,33 @@ end
|
|||||||
-- The following airbases are monitored at the PersianGulf region.
|
-- The following airbases are monitored at the PersianGulf region.
|
||||||
-- Use the @{Wrapper.Airbase#AIRBASE.PersianGulf} enumeration to select the airbases to be monitored.
|
-- Use the @{Wrapper.Airbase#AIRBASE.PersianGulf} enumeration to select the airbases to be monitored.
|
||||||
--
|
--
|
||||||
-- * `AIRBASE.PersianGulf.Abu_Musa_Island_Airport`
|
-- * `AIRBASE.PersianGulf.Abu_Musa_Island`
|
||||||
-- * `AIRBASE.PersianGulf.Al_Dhafra_AB`
|
-- * `AIRBASE.PersianGulf.Al_Dhafra_AFB`
|
||||||
-- * `AIRBASE.PersianGulf.Al_Maktoum_Intl`
|
-- * `AIRBASE.PersianGulf.Al_Maktoum_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Al_Minhad_AB`
|
-- * `AIRBASE.PersianGulf.Al_Minhad_AFB`
|
||||||
-- * `AIRBASE.PersianGulf.Bandar_Abbas_Intl`
|
-- * `AIRBASE.PersianGulf.Bandar_Abbas_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Bandar_Lengeh`
|
-- * `AIRBASE.PersianGulf.Bandar_Lengeh`
|
||||||
-- * `AIRBASE.PersianGulf.Dubai_Intl`
|
-- * `AIRBASE.PersianGulf.Dubai_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Fujairah_Intl`
|
-- * `AIRBASE.PersianGulf.Fujairah_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Havadarya`
|
-- * `AIRBASE.PersianGulf.Havadarya`
|
||||||
-- * `AIRBASE.PersianGulf.Kerman_Airport`
|
-- * `AIRBASE.PersianGulf.Kerman`
|
||||||
-- * `AIRBASE.PersianGulf.Khasab`
|
-- * `AIRBASE.PersianGulf.Khasab`
|
||||||
-- * `AIRBASE.PersianGulf.Lar_Airbase`
|
-- * `AIRBASE.PersianGulf.Lar`
|
||||||
-- * `AIRBASE.PersianGulf.Qeshm_Island`
|
-- * `AIRBASE.PersianGulf.Qeshm_Island`
|
||||||
-- * `AIRBASE.PersianGulf.Sharjah_Intl`
|
-- * `AIRBASE.PersianGulf.Sharjah_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Shiraz_International_Airport`
|
-- * `AIRBASE.PersianGulf.Shiraz_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Sir_Abu_Nuayr`
|
-- * `AIRBASE.PersianGulf.Sir_Abu_Nuayr`
|
||||||
-- * `AIRBASE.PersianGulf.Sirri_Island`
|
-- * `AIRBASE.PersianGulf.Sirri_Island`
|
||||||
-- * `AIRBASE.PersianGulf.Tunb_Island_AFB`
|
-- * `AIRBASE.PersianGulf.Tunb_Island_AFB`
|
||||||
-- * `AIRBASE.PersianGulf.Tunb_Kochak`
|
-- * `AIRBASE.PersianGulf.Tunb_Kochak`
|
||||||
-- * `AIRBASE.PersianGulf.Sas_Al_Nakheel_Airport`
|
-- * `AIRBASE.PersianGulf.Sas_Al_Nakheel`
|
||||||
-- * `AIRBASE.PersianGulf.Bandar_e_Jask_airfield`
|
-- * `AIRBASE.PersianGulf.Bandar_e_Jask`
|
||||||
-- * `AIRBASE.PersianGulf.Abu_Dhabi_International_Airport`
|
-- * `AIRBASE.PersianGulf.Abu_Dhabi_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Al_Bateen_Airport`
|
-- * `AIRBASE.PersianGulf.Al_Bateen`
|
||||||
-- * `AIRBASE.PersianGulf.Kish_International_Airport`
|
-- * `AIRBASE.PersianGulf.Kish_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Al_Ain_International_Airport`
|
-- * `AIRBASE.PersianGulf.Al_Ain_Intl`
|
||||||
-- * `AIRBASE.PersianGulf.Lavan_Island_Airport`
|
-- * `AIRBASE.PersianGulf.Lavan_Island`
|
||||||
-- * `AIRBASE.PersianGulf.Jiroft_Airport`
|
-- * `AIRBASE.PersianGulf.Jiroft`
|
||||||
--
|
--
|
||||||
-- # Installation
|
-- # Installation
|
||||||
--
|
--
|
||||||
@@ -1391,8 +1405,8 @@ end
|
|||||||
-- AirbasePoliceCaucasus = ATC_GROUND_PERSIANGULF:New()
|
-- AirbasePoliceCaucasus = ATC_GROUND_PERSIANGULF:New()
|
||||||
--
|
--
|
||||||
-- ATC_Ground = ATC_GROUND_PERSIANGULF:New(
|
-- ATC_Ground = ATC_GROUND_PERSIANGULF:New(
|
||||||
-- { AIRBASE.PersianGulf.Kerman_Airport,
|
-- { AIRBASE.PersianGulf.Kerman,
|
||||||
-- AIRBASE.PersianGulf.Al_Minhad_AB
|
-- AIRBASE.PersianGulf.Al_Minhad_AFB
|
||||||
-- }
|
-- }
|
||||||
-- )
|
-- )
|
||||||
--
|
--
|
||||||
@@ -1441,11 +1455,10 @@ function ATC_GROUND_PERSIANGULF:Start( RepeatScanSeconds )
|
|||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
-- @type ATC_GROUND_MARIANAISLANDS
|
-- @type ATC_GROUND_MARIANAISLANDS
|
||||||
-- @extends #ATC_GROUND
|
-- @extends #ATC_GROUND
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- # ATC\_GROUND\_MARIANA, extends @{#ATC_GROUND}
|
--- # ATC\_GROUND\_MARIANA, extends @{#ATC_GROUND}
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -618,63 +619,148 @@ ARTY.WeaponType={
|
|||||||
}
|
}
|
||||||
|
|
||||||
--- Database of common artillery unit properties.
|
--- Database of common artillery unit properties.
|
||||||
|
-- @type ARTY.dbitem
|
||||||
|
-- @field #string displayname Name displayed in ME.
|
||||||
|
-- @field #number minrange Minimum firing range in meters.
|
||||||
|
-- @field #number maxrange Maximum firing range in meters.
|
||||||
|
-- @field #number reloadtime Reload time in seconds.
|
||||||
|
|
||||||
|
--- Database of common artillery unit properties.
|
||||||
|
-- Table key is the "type name" and table value is and `ARTY.dbitem`.
|
||||||
-- @type ARTY.db
|
-- @type ARTY.db
|
||||||
ARTY.db={
|
ARTY.db={
|
||||||
["2B11 mortar"] = { -- type "2B11 mortar"
|
["LeFH_18-40-105"] = {
|
||||||
minrange = 500, -- correct?
|
displayname = "FH LeFH-18 105mm", -- name displayed in the ME
|
||||||
maxrange = 7000, -- 7 km
|
minrange = 500, -- min range (green circle) in meters
|
||||||
reloadtime = 30, -- 30 sec
|
maxrange = 10500, -- max range (red circle) in meters
|
||||||
|
reloadtime = nil, -- reload time in seconds
|
||||||
},
|
},
|
||||||
["SPH 2S1 Gvozdika"] = { -- type "SAU Gvozdika"
|
["M2A1-105"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "FH M2A1 105mm",
|
||||||
maxrange = 15000, -- 15 km
|
minrange = 500,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 11500,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["SPH 2S19 Msta"] = { --type "SAU Msta", alias "2S19 Msta"
|
["Pak40"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "FH Pak 40 75mm",
|
||||||
maxrange = 23500, -- 23.5 km
|
minrange = 500,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 3000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["L118_Unit"] = {
|
||||||
|
displayname = "L118 Light Artillery Gun",
|
||||||
|
minrange = 500,
|
||||||
|
maxrange = 17500,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["SPH 2S3 Akatsia"] = { -- type "SAU Akatsia", alias "2S3 Akatsia"
|
["Smerch"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "MLRS 9A52 Smerch CM 300mm",
|
||||||
maxrange = 17000, -- 17 km
|
minrange = 20000,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 70000,
|
||||||
|
reloadtime = 2160,
|
||||||
},
|
},
|
||||||
["SPH 2S9 Nona"] = { --type "SAU 2-C9"
|
["Smerch_HE"] = {
|
||||||
minrange = 500, -- correct?
|
displayname = "MLRS 9A52 Smerch HE 300mm",
|
||||||
maxrange = 7000, -- 7 km
|
minrange = 20000,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 70000,
|
||||||
|
reloadtime = 2160,
|
||||||
},
|
},
|
||||||
["SPH M109 Paladin"] = { -- type "M-109", alias "M109"
|
["Uragan_BM-27"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "MLRS 9K57 Uragan BM-27 220mm",
|
||||||
maxrange = 22000, -- 22 km
|
minrange = 11500,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 35800,
|
||||||
|
reloadtime = 840,
|
||||||
},
|
},
|
||||||
["SpGH Dana"] = { -- type "SpGH_Dana"
|
["Grad-URAL"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "MLRS BM-21 Grad 122mm",
|
||||||
maxrange = 18700, -- 18.7 km
|
minrange = 5000,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 19000,
|
||||||
|
reloadtime = 420,
|
||||||
},
|
},
|
||||||
["MLRS BM-21 Grad"] = { --type "Grad-URAL", alias "MLRS BM-21 Grad"
|
["HL_B8M1"] = {
|
||||||
minrange = 5000, -- 5 km
|
displayname = "MLRS HL with B8M1 80mm",
|
||||||
maxrange = 19000, -- 19 km
|
minrange = 500,
|
||||||
reloadtime = 420, -- 7 min
|
maxrange = 5000,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["MLRS 9K57 Uragan BM-27"] = { -- type "Uragan_BM-27"
|
["tt_B8M1"] = {
|
||||||
minrange = 11500, -- 11.5 km
|
displayname = "MLRS LC with B8M1 80mm",
|
||||||
maxrange = 35800, -- 35.8 km
|
minrange = 500,
|
||||||
reloadtime = 840, -- 14 min
|
maxrange = 5000,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["MLRS 9A52 Smerch"] = { -- type "Smerch"
|
["MLRS"] = {
|
||||||
minrange = 20000, -- 20 km
|
displayname = "MLRS M270 227mm",
|
||||||
maxrange = 70000, -- 70 km
|
minrange = 10000,
|
||||||
reloadtime = 2160, -- 36 min
|
maxrange = 32000,
|
||||||
|
reloadtime = 540,
|
||||||
},
|
},
|
||||||
["MLRS M270"] = { --type "MRLS", alias "M270 MRLS"
|
["2B11 mortar"] = {
|
||||||
minrange = 10000, -- 10 km
|
displayname = "Mortar 2B11 120mm",
|
||||||
maxrange = 32000, -- 32 km
|
minrange = 500,
|
||||||
reloadtime = 540, -- 9 min
|
maxrange = 7000,
|
||||||
|
reloadtime = 30,
|
||||||
},
|
},
|
||||||
|
["PLZ05"] = {
|
||||||
|
displayname = "PLZ-05",
|
||||||
|
minrange = 500,
|
||||||
|
maxrange = 23500,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["SAU Gvozdika"] = {
|
||||||
|
displayname = "SPH 2S1 Gvozdika 122mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 15000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["SAU Msta"] = {
|
||||||
|
displayname = "SPH 2S19 Msta 152mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 23500,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["SAU Akatsia"] = {
|
||||||
|
displayname = "SPH 2S3 Akatsia 152mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 17000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["SpGH_Dana"] = {
|
||||||
|
displayname = "SPH Dana vz77 152mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 18700,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["M-109"] = {
|
||||||
|
displayname = "SPH M109 Paladin 155mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 22000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["M12_GMC"] = {
|
||||||
|
displayname = "SPH M12 GMC 155mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 18200,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["Wespe124"] = {
|
||||||
|
displayname = "SPH Sd.Kfz.124 Wespe 105mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 7000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["T155_Firtina"] = {
|
||||||
|
displayname = "SPH T155 Firtina 155mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 41000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["SAU 2-C9"] = {
|
||||||
|
displayname = "SPM 2S9 Nona 120mm M",
|
||||||
|
minrange = 500,
|
||||||
|
maxrange = 7000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Target.
|
--- Target.
|
||||||
@@ -694,7 +780,7 @@ ARTY.db={
|
|||||||
|
|
||||||
--- Arty script version.
|
--- Arty script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ARTY.version="1.3.0"
|
ARTY.version="1.3.3"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -707,7 +793,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.
|
||||||
@@ -796,8 +882,8 @@ function ARTY:New(group, alias)
|
|||||||
-- Maximum speed in km/h.
|
-- Maximum speed in km/h.
|
||||||
self.SpeedMax=group:GetSpeedMax()
|
self.SpeedMax=group:GetSpeedMax()
|
||||||
|
|
||||||
-- Group is mobile or not (e.g. mortars).
|
-- Group is mobile or not (e.g. mortars). Some immobile units have a speed of 1 m/s = 3.6 km/h. So we check this number.
|
||||||
if self.SpeedMax>1 then
|
if self.SpeedMax>3.6 then
|
||||||
self.ismobile=true
|
self.ismobile=true
|
||||||
else
|
else
|
||||||
self.ismobile=false
|
self.ismobile=false
|
||||||
@@ -1532,7 +1618,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 +1973,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
|
||||||
@@ -1922,7 +2008,7 @@ function ARTY:onafterStart(Controllable, From, Event, To)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check if we have and arty type that is in the DB.
|
-- Check if we have and arty type that is in the DB.
|
||||||
local _dbproperties=self:_CheckDB(self.DisplayName)
|
local _dbproperties=self:_CheckDB(self.Type)
|
||||||
self:T({dbproperties=_dbproperties})
|
self:T({dbproperties=_dbproperties})
|
||||||
if _dbproperties~=nil then
|
if _dbproperties~=nil then
|
||||||
for property,value in pairs(_dbproperties) do
|
for property,value in pairs(_dbproperties) do
|
||||||
@@ -1968,8 +2054,8 @@ function ARTY:onafterStart(Controllable, From, Event, To)
|
|||||||
text=text..string.format("Type = %s\n", self.Type)
|
text=text..string.format("Type = %s\n", self.Type)
|
||||||
text=text..string.format("Display Name = %s\n", self.DisplayName)
|
text=text..string.format("Display Name = %s\n", self.DisplayName)
|
||||||
text=text..string.format("Number of units = %d\n", self.IniGroupStrength)
|
text=text..string.format("Number of units = %d\n", self.IniGroupStrength)
|
||||||
text=text..string.format("Speed max = %d km/h\n", self.SpeedMax)
|
text=text..string.format("Speed max = %.1f km/h\n", self.SpeedMax)
|
||||||
text=text..string.format("Speed default = %d km/h\n", self.Speed)
|
text=text..string.format("Speed default = %.1f km/h\n", self.Speed)
|
||||||
text=text..string.format("Is mobile = %s\n", tostring(self.ismobile))
|
text=text..string.format("Is mobile = %s\n", tostring(self.ismobile))
|
||||||
text=text..string.format("Is cargo = %s\n", tostring(self.iscargo))
|
text=text..string.format("Is cargo = %s\n", tostring(self.iscargo))
|
||||||
text=text..string.format("Min range = %.1f km\n", self.minrange/1000)
|
text=text..string.format("Min range = %.1f km\n", self.minrange/1000)
|
||||||
@@ -2093,7 +2179,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 +2192,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 +2379,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 +2409,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 +2857,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 +2874,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 +2957,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 +3130,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=Nammo -- We take everything that is available
|
||||||
_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
|
||||||
@@ -3070,6 +3155,8 @@ function ARTY:onafterOpenFire(Controllable, From, Event, To, target)
|
|||||||
nfire=Nmissiles
|
nfire=Nmissiles
|
||||||
_type="cruise missiles"
|
_type="cruise missiles"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--env.info(string.format("FF type=%s, Nrockets=%d, Nfire=%d target.nshells=%d", _type, Nrockets, nfire, target.nshells))
|
||||||
|
|
||||||
-- Adjust if less than requested ammo is left.
|
-- Adjust if less than requested ammo is left.
|
||||||
target.nshells=math.min(target.nshells, nfire)
|
target.nshells=math.min(target.nshells, nfire)
|
||||||
@@ -3337,7 +3424,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 +3690,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 +3705,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 +3722,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 +3737,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 +3804,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 +3965,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 +3979,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 +4082,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 +4129,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 +4880,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 +4945,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 +4957,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 +5001,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
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
-- @image Designation.JPG
|
-- @image Designation.JPG
|
||||||
--
|
--
|
||||||
-- Date: 24 Oct 2021
|
-- Date: 24 Oct 2021
|
||||||
-- Last Update: Jan 2024
|
-- Last Update: Mar 2025
|
||||||
--
|
--
|
||||||
--- Class AUTOLASE
|
--- Class AUTOLASE
|
||||||
-- @type AUTOLASE
|
-- @type AUTOLASE
|
||||||
@@ -88,6 +88,11 @@
|
|||||||
-- @field #table LaserCodes
|
-- @field #table LaserCodes
|
||||||
-- @field #table playermenus
|
-- @field #table playermenus
|
||||||
-- @field #boolean smokemenu
|
-- @field #boolean smokemenu
|
||||||
|
-- @field #boolean threatmenu
|
||||||
|
-- @field #number RoundingPrecision
|
||||||
|
-- @field #table smokeoffset
|
||||||
|
-- @field #boolean increasegroundawareness
|
||||||
|
-- @field #number MonitorFrequency
|
||||||
-- @extends Ops.Intel#INTEL
|
-- @extends Ops.Intel#INTEL
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -99,6 +104,9 @@ AUTOLASE = {
|
|||||||
alias = "",
|
alias = "",
|
||||||
debug = false,
|
debug = false,
|
||||||
smokemenu = true,
|
smokemenu = true,
|
||||||
|
RoundingPrecision = 0,
|
||||||
|
increasegroundawareness = true,
|
||||||
|
MonitorFrequency = 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Laser spot info
|
--- Laser spot info
|
||||||
@@ -117,7 +125,7 @@ AUTOLASE = {
|
|||||||
|
|
||||||
--- AUTOLASE class version.
|
--- AUTOLASE class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AUTOLASE.version = "0.1.23"
|
AUTOLASE.version = "0.1.31"
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
-- Begin Functional.Autolase.lua
|
-- Begin Functional.Autolase.lua
|
||||||
@@ -190,6 +198,7 @@ function AUTOLASE:New(RecceSet, Coalition, Alias, PilotSet)
|
|||||||
self.reporttimelong = 30
|
self.reporttimelong = 30
|
||||||
self.smoketargets = false
|
self.smoketargets = false
|
||||||
self.smokecolor = SMOKECOLOR.Red
|
self.smokecolor = SMOKECOLOR.Red
|
||||||
|
self.smokeoffset = nil
|
||||||
self.notifypilots = true
|
self.notifypilots = true
|
||||||
self.targetsperrecce = {}
|
self.targetsperrecce = {}
|
||||||
self.RecceUnits = {}
|
self.RecceUnits = {}
|
||||||
@@ -205,6 +214,12 @@ function AUTOLASE:New(RecceSet, Coalition, Alias, PilotSet)
|
|||||||
self:SetLaserCodes( { 1688, 1130, 4785, 6547, 1465, 4578 } ) -- set self.LaserCodes
|
self:SetLaserCodes( { 1688, 1130, 4785, 6547, 1465, 4578 } ) -- set self.LaserCodes
|
||||||
self.playermenus = {}
|
self.playermenus = {}
|
||||||
self.smokemenu = true
|
self.smokemenu = true
|
||||||
|
self.threatmenu = true
|
||||||
|
self.RoundingPrecision = 0
|
||||||
|
self.increasegroundawareness = true
|
||||||
|
self.MonitorFrequency = 30
|
||||||
|
|
||||||
|
self:EnableSmokeMenu({Angle=math.random(0,359),Distance=math.random(10,20)})
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- Set some string id for output to DCS.log file.
|
||||||
self.lid=string.format("AUTOLASE %s (%s) | ", self.alias, self.coalition and UTILS.GetCoalitionName(self.coalition) or "unknown")
|
self.lid=string.format("AUTOLASE %s (%s) | ", self.alias, self.coalition and UTILS.GetCoalitionName(self.coalition) or "unknown")
|
||||||
@@ -307,55 +322,92 @@ end
|
|||||||
-- Helper Functions
|
-- Helper Functions
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
--- [User] When using Monitor, set the frequency here in which the report will appear
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @param #number Seconds Run the report loop every number of seconds defined here.
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:SetMonitorFrequency(Seconds)
|
||||||
|
self.MonitorFrequency = Seconds or 30
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [User] Set a table of possible laser codes.
|
--- [User] Set a table of possible laser codes.
|
||||||
-- Each new RECCE can select a code from this table, default is { 1688, 1130, 4785, 6547, 1465, 4578 } .
|
-- Each new RECCE can select a code from this table, default is { 1688, 1130, 4785, 6547, 1465, 4578 }.
|
||||||
-- @param #AUTOLASE self
|
-- @param #AUTOLASE self
|
||||||
-- @param #list<#number> LaserCodes
|
-- @param #list<#number> LaserCodes
|
||||||
-- @return #AUTOLASE
|
-- @return #AUTOLASE self
|
||||||
function AUTOLASE:SetLaserCodes( LaserCodes )
|
function AUTOLASE:SetLaserCodes( LaserCodes )
|
||||||
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
|
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Improve ground unit detection by using a zone scan and LOS check.
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:EnableImproveGroundUnitsDetection()
|
||||||
|
self.increasegroundawareness = true
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [User] Do not improve ground unit detection by using a zone scan and LOS check.
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:DisableImproveGroundUnitsDetection()
|
||||||
|
self.increasegroundawareness = false
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (Internal) Function to set pilot menu.
|
--- (Internal) Function to set pilot menu.
|
||||||
-- @param #AUTOLASE self
|
-- @param #AUTOLASE self
|
||||||
-- @return #AUTOLASE self
|
-- @return #AUTOLASE self
|
||||||
function AUTOLASE:SetPilotMenu()
|
function AUTOLASE:SetPilotMenu()
|
||||||
if self.usepilotset then
|
if self.usepilotset then
|
||||||
local pilottable = self.pilotset:GetSetObjects() or {}
|
local pilottable = self.pilotset:GetSetObjects() or {}
|
||||||
|
local grouptable = {}
|
||||||
for _,_unit in pairs (pilottable) do
|
for _,_unit in pairs (pilottable) do
|
||||||
local Unit = _unit -- Wrapper.Unit#UNIT
|
local Unit = _unit -- Wrapper.Unit#UNIT
|
||||||
if Unit and Unit:IsAlive() then
|
if Unit and Unit:IsAlive() then
|
||||||
local Group = Unit:GetGroup()
|
local Group = Unit:GetGroup()
|
||||||
|
local GroupName = Group:GetName() or "none"
|
||||||
local unitname = Unit:GetName()
|
local unitname = Unit:GetName()
|
||||||
if self.playermenus[unitname] then self.playermenus[unitname]:Remove() end
|
if not grouptable[GroupName] == true then
|
||||||
local lasetopm = MENU_GROUP:New(Group,"Autolase",nil)
|
if self.playermenus[unitname] then self.playermenus[unitname]:Remove() end -- menus
|
||||||
self.playermenus[unitname] = lasetopm
|
local lasetopm = MENU_GROUP:New(Group,"Autolase",nil)
|
||||||
local lasemenu = MENU_GROUP_COMMAND:New(Group,"Status",lasetopm,self.ShowStatus,self,Group,Unit)
|
self.playermenus[unitname] = lasetopm
|
||||||
if self.smokemenu then
|
local lasemenu = MENU_GROUP_COMMAND:New(Group,"Status",lasetopm,self.ShowStatus,self,Group,Unit)
|
||||||
local smoke = (self.smoketargets == true) and "off" or "on"
|
if self.smokemenu then
|
||||||
local smoketext = string.format("Switch smoke targets to %s",smoke)
|
local smoke = (self.smoketargets == true) and "off" or "on"
|
||||||
local smokemenu = MENU_GROUP_COMMAND:New(Group,smoketext,lasetopm,self.SetSmokeTargets,self,(not self.smoketargets))
|
local smoketext = string.format("Switch smoke targets to %s",smoke)
|
||||||
end
|
local smokemenu = MENU_GROUP_COMMAND:New(Group,smoketext,lasetopm,self.SetSmokeTargets,self,(not self.smoketargets))
|
||||||
for _,_grp in pairs(self.RecceSet.Set) do
|
end -- smokement
|
||||||
local grp = _grp -- Wrapper.Group#GROUP
|
if self.threatmenu then
|
||||||
local unit = grp:GetUnit(1)
|
local threatmenutop = MENU_GROUP:New(Group,"Set min lasing threat",lasetopm)
|
||||||
--local name = grp:GetName()
|
for i=0,10,2 do
|
||||||
if unit and unit:IsAlive() then
|
local text = "Threatlevel "..tostring(i)
|
||||||
local name = unit:GetName()
|
local threatmenu = MENU_GROUP_COMMAND:New(Group,text,threatmenutop,self.SetMinThreatLevel,self,i)
|
||||||
local mname = string.gsub(name,".%d+.%d+$","")
|
end -- threatlevel
|
||||||
local code = self:GetLaserCode(name)
|
end -- threatmenu
|
||||||
local unittop = MENU_GROUP:New(Group,"Change laser code for "..mname,lasetopm)
|
for _,_grp in pairs(self.RecceSet.Set) do
|
||||||
for _,_code in pairs(self.LaserCodes) do
|
local grp = _grp -- Wrapper.Group#GROUP
|
||||||
local text = tostring(_code)
|
local unit = grp:GetUnit(1)
|
||||||
if _code == code then text = text.."(*)" end
|
--local name = grp:GetName()
|
||||||
local changemenu = MENU_GROUP_COMMAND:New(Group,text,unittop,self.SetRecceLaserCode,self,name,_code,true)
|
if unit and unit:IsAlive() then
|
||||||
end
|
local name = unit:GetName()
|
||||||
end
|
local mname = string.gsub(name,".%d+.%d+$","")
|
||||||
end
|
local code = self:GetLaserCode(name)
|
||||||
|
local unittop = MENU_GROUP:New(Group,"Change laser code for "..mname,lasetopm)
|
||||||
|
for _,_code in pairs(self.LaserCodes) do
|
||||||
|
local text = tostring(_code)
|
||||||
|
if _code == code then text = text.."(*)" end
|
||||||
|
local changemenu = MENU_GROUP_COMMAND:New(Group,text,unittop,self.SetRecceLaserCode,self,name,_code,true)
|
||||||
|
end -- Codes
|
||||||
|
end -- unit alive
|
||||||
|
end -- Recceset
|
||||||
|
grouptable[GroupName] = true
|
||||||
|
end -- grouptable[GroupName]
|
||||||
--lasemenu:Refresh()
|
--lasemenu:Refresh()
|
||||||
end
|
end -- unit alive
|
||||||
end
|
end -- pilot loop
|
||||||
else
|
else
|
||||||
if not self.NoMenus then
|
if not self.NoMenus then
|
||||||
self.Menu = MENU_COALITION_COMMAND:New(self.coalition,"Autolase",nil,self.ShowStatus,self)
|
self.Menu = MENU_COALITION_COMMAND:New(self.coalition,"Autolase",nil,self.ShowStatus,self)
|
||||||
@@ -586,11 +638,26 @@ function AUTOLASE:SetSmokeTargets(OnOff,Color)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (User) Function to set rounding precision for BR distance output.
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @param #number IDP Rounding precision before/after the decimal sign. Defaults to zero. Positive values round right of the decimal sign, negative ones left of the decimal sign.
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:SetRoundingPrecsion(IDP)
|
||||||
|
self.RoundingPrecision = IDP or 0
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (User) Show the "Switch smoke target..." menu entry for pilots. On by default.
|
--- (User) Show the "Switch smoke target..." menu entry for pilots. On by default.
|
||||||
-- @param #AUTOLASE self
|
-- @param #AUTOLASE self
|
||||||
|
-- @param #table Offset (Optional) Define an offset for the smoke, i.e. not directly on the unit itself, angle is degrees and distance is meters. E.g. `autolase:EnableSmokeMenu({Angle=30,Distance=20})`
|
||||||
-- @return #AUTOLASE self
|
-- @return #AUTOLASE self
|
||||||
function AUTOLASE:EnableSmokeMenu()
|
function AUTOLASE:EnableSmokeMenu(Offset)
|
||||||
self.smokemenu = true
|
self.smokemenu = true
|
||||||
|
if Offset then
|
||||||
|
self.smokeoffset = {}
|
||||||
|
self.smokeoffset.Distance = Offset.Distance or math.random(10,20)
|
||||||
|
self.smokeoffset.Angle = Offset.Angle or math.random(0,359)
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -599,9 +666,25 @@ end
|
|||||||
-- @return #AUTOLASE self
|
-- @return #AUTOLASE self
|
||||||
function AUTOLASE:DisableSmokeMenu()
|
function AUTOLASE:DisableSmokeMenu()
|
||||||
self.smokemenu = false
|
self.smokemenu = false
|
||||||
|
self.smokeoffset = nil
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (User) Show the "Switch min threat lasing..." menu entry for pilots. On by default.
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:EnableThreatLevelMenu()
|
||||||
|
self.threatmenu = true
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- (User) Do not show the "Switch min threat lasing..." menu entry for pilots.
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:DisableThreatLevelMenu()
|
||||||
|
self.threatmenu = false
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (Internal) Function to calculate line of sight.
|
--- (Internal) Function to calculate line of sight.
|
||||||
-- @param #AUTOLASE self
|
-- @param #AUTOLASE self
|
||||||
@@ -642,7 +725,8 @@ function AUTOLASE:CleanCurrentLasing()
|
|||||||
local unit = recce:GetUnit(1)
|
local unit = recce:GetUnit(1)
|
||||||
local name = unit:GetName()
|
local name = unit:GetName()
|
||||||
if not self.RecceUnits[name] then
|
if not self.RecceUnits[name] then
|
||||||
self.RecceUnits[name] = { name=name, unit=unit, cooldown = false, timestamp = timer.getAbsTime() }
|
local isground = (unit and unit.IsGround) and unit:IsGround() or false
|
||||||
|
self.RecceUnits[name] = { name=name, unit=unit, cooldown = false, timestamp = timer.getAbsTime(), isground=isground }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -728,8 +812,11 @@ function AUTOLASE:ShowStatus(Group,Unit)
|
|||||||
end
|
end
|
||||||
local code = self:GetLaserCode(unit:GetName())
|
local code = self:GetLaserCode(unit:GetName())
|
||||||
report:Add(string.format("Recce %s has code %d",name,code))
|
report:Add(string.format("Recce %s has code %d",name,code))
|
||||||
|
report:Add("---------------")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
report:Add(string.format("Lasing min threat level %d",self.minthreatlevel))
|
||||||
|
report:Add("---------------")
|
||||||
local lines = 0
|
local lines = 0
|
||||||
for _ind,_entry in pairs(self.CurrentLasing) do
|
for _ind,_entry in pairs(self.CurrentLasing) do
|
||||||
local entry = _entry -- #AUTOLASE.LaserSpot
|
local entry = _entry -- #AUTOLASE.LaserSpot
|
||||||
@@ -749,22 +836,28 @@ function AUTOLASE:ShowStatus(Group,Unit)
|
|||||||
if playername then
|
if playername then
|
||||||
local settings = _DATABASE:GetPlayerSettings(playername)
|
local settings = _DATABASE:GetPlayerSettings(playername)
|
||||||
if settings then
|
if settings then
|
||||||
self:I("Get Settings ok!")
|
self:T("Get Settings ok!")
|
||||||
if settings:IsA2G_MGRS() then
|
if settings:IsA2G_MGRS() then
|
||||||
locationstring = entry.coordinate:ToStringMGRS(settings)
|
locationstring = entry.coordinate:ToStringMGRS(settings)
|
||||||
elseif settings:IsA2G_LL_DMS() then
|
elseif settings:IsA2G_LL_DMS() then
|
||||||
locationstring = entry.coordinate:ToStringLLDMS(settings)
|
locationstring = entry.coordinate:ToStringLLDMS(settings)
|
||||||
|
elseif settings:IsA2G_LL_DDM() then
|
||||||
|
locationstring = entry.coordinate:ToStringLLDDM(settings)
|
||||||
elseif settings:IsA2G_BR() then
|
elseif settings:IsA2G_BR() then
|
||||||
locationstring = entry.coordinate:ToStringBR(Group:GetCoordinate() or Unit:GetCoordinate(),settings)
|
-- attention this is the distance from the ASKING unit to target, not from RECCE to target!
|
||||||
|
local startcoordinate = Unit:GetCoordinate() or Group:GetCoordinate()
|
||||||
|
locationstring = entry.coordinate:ToStringBR(startcoordinate,settings,false,self.RoundingPrecision)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local text = string.format("%s lasing %s code %d\nat %s",reccename,typename,code,locationstring)
|
local text = string.format("+ %s lasing %s code %d\nat %s",reccename,typename,code,locationstring)
|
||||||
report:Add(text)
|
report:Add(text)
|
||||||
|
report:Add("---------------")
|
||||||
lines = lines + 1
|
lines = lines + 1
|
||||||
end
|
end
|
||||||
if lines == 0 then
|
if lines == 0 then
|
||||||
report:Add("No targets!")
|
report:Add("No targets!")
|
||||||
|
report:Add("---------------")
|
||||||
end
|
end
|
||||||
local reporttime = self.reporttimelong
|
local reporttime = self.reporttimelong
|
||||||
if lines == 0 then reporttime = self.reporttimeshort end
|
if lines == 0 then reporttime = self.reporttimeshort end
|
||||||
@@ -883,6 +976,65 @@ function AUTOLASE:CanLase(Recce,Unit)
|
|||||||
return canlase
|
return canlase
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (Internal) Function to do a zone check per ground Recce and make found units and statics "known".
|
||||||
|
-- @param #AUTOLASE self
|
||||||
|
-- @return #AUTOLASE self
|
||||||
|
function AUTOLASE:_Prescient()
|
||||||
|
-- self.RecceUnits[name] = { name=name, unit=unit, cooldown = false, timestamp = timer.getAbsTime(), isground=isground }
|
||||||
|
for _,_data in pairs(self.RecceUnits) do
|
||||||
|
-- ground units only
|
||||||
|
if _data.isground and _data.unit and _data.unit:IsAlive() then
|
||||||
|
local unit = _data.unit -- Wrapper.Unit#UNIT
|
||||||
|
local position = unit:GetCoordinate() -- Core.Point#COORDINATE
|
||||||
|
local needsinit = false
|
||||||
|
if position then
|
||||||
|
local lastposition = unit:GetProperty("lastposition")
|
||||||
|
-- property initiated?
|
||||||
|
if not lastposition then
|
||||||
|
unit:SetProperty("lastposition",position)
|
||||||
|
lastposition = position
|
||||||
|
needsinit = true
|
||||||
|
end
|
||||||
|
-- has moved?
|
||||||
|
local dist = position:Get2DDistance(lastposition)
|
||||||
|
-- refresh?
|
||||||
|
local TNow = timer.getAbsTime()
|
||||||
|
-- check
|
||||||
|
if dist > 10 or needsinit==true or TNow - _data.timestamp > 29 then
|
||||||
|
-- init scan objects
|
||||||
|
local hasunits,hasstatics,_,Units,Statics = position:ScanObjects(self.LaseDistance,true,true,false)
|
||||||
|
-- loop found units
|
||||||
|
if hasunits then
|
||||||
|
self:T(self.lid.."Checking possibly visible UNITs for Recce "..unit:GetName())
|
||||||
|
for _,_target in pairs(Units) do -- Wrapper.Unit#UNIT object here
|
||||||
|
local target = _target -- Wrapper.Unit#UNIT
|
||||||
|
if target and target:GetCoalition() ~= self.coalition then
|
||||||
|
if unit:IsLOS(target) and (not target:IsUnitDetected(unit))then
|
||||||
|
unit:KnowUnit(target,true,true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- loop found statics
|
||||||
|
if hasstatics then
|
||||||
|
self:T(self.lid.."Checking possibly visible STATICs for Recce "..unit:GetName())
|
||||||
|
for _,_static in pairs(Statics) do -- DCS static object here
|
||||||
|
local static = STATIC:Find(_static)
|
||||||
|
if static and static:GetCoalition() ~= self.coalition then
|
||||||
|
local IsLOS = position:IsLOS(static:GetCoordinate())
|
||||||
|
if IsLOS then
|
||||||
|
unit:KnowUnit(static,true,true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
-- FSM Functions
|
-- FSM Functions
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
@@ -895,6 +1047,9 @@ end
|
|||||||
-- @return #AUTOLASE self
|
-- @return #AUTOLASE self
|
||||||
function AUTOLASE:onbeforeMonitor(From, Event, To)
|
function AUTOLASE:onbeforeMonitor(From, Event, To)
|
||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
|
if self.increasegroundawareness then
|
||||||
|
self:_Prescient()
|
||||||
|
end
|
||||||
-- Check if group has detected any units.
|
-- Check if group has detected any units.
|
||||||
self:UpdateIntel()
|
self:UpdateIntel()
|
||||||
return self
|
return self
|
||||||
@@ -923,7 +1078,7 @@ function AUTOLASE:onafterMonitor(From, Event, To)
|
|||||||
local grp = contact.group
|
local grp = contact.group
|
||||||
local coord = contact.position
|
local coord = contact.position
|
||||||
local reccename = contact.recce or "none"
|
local reccename = contact.recce or "none"
|
||||||
local threat = contact.threatlevel or 0
|
local threat = contact.threatlevel or 0
|
||||||
local reccegrp = UNIT:FindByName(reccename)
|
local reccegrp = UNIT:FindByName(reccename)
|
||||||
if reccegrp then
|
if reccegrp then
|
||||||
local reccecoord = reccegrp:GetCoordinate()
|
local reccecoord = reccegrp:GetCoordinate()
|
||||||
@@ -1047,6 +1202,9 @@ function AUTOLASE:onafterMonitor(From, Event, To)
|
|||||||
}
|
}
|
||||||
if self.smoketargets then
|
if self.smoketargets then
|
||||||
local coord = unit:GetCoordinate()
|
local coord = unit:GetCoordinate()
|
||||||
|
if self.smokeoffset then
|
||||||
|
coord:Translate(self.smokeoffset.Distance,self.smokeoffset.Angle,true,true)
|
||||||
|
end
|
||||||
local color = self:GetSmokeColor(reccename)
|
local color = self:GetSmokeColor(reccename)
|
||||||
coord:Smoke(color)
|
coord:Smoke(color)
|
||||||
end
|
end
|
||||||
@@ -1057,7 +1215,8 @@ function AUTOLASE:onafterMonitor(From, Event, To)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self:__Monitor(-30)
|
local nextloop = -self.MonitorFrequency or -30
|
||||||
|
self:__Monitor(nextloop)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -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 } )
|
||||||
@@ -354,7 +357,7 @@ function CLEANUP_AIRBASE.__:EventAddForCleanUp( Event )
|
|||||||
self:F({Event})
|
self:F({Event})
|
||||||
|
|
||||||
|
|
||||||
if Event.IniDCSUnit and Event.IniCategory == Object.Category.UNIT then
|
if Event.IniDCSUnit and Event.IniUnit and Event.IniCategory == Object.Category.UNIT then
|
||||||
if self.CleanUpList[Event.IniDCSUnitName] == nil then
|
if self.CleanUpList[Event.IniDCSUnitName] == nil then
|
||||||
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.IniUnit:GetVec2() ) then
|
||||||
self:AddForCleanUp( Event.IniUnit, Event.IniDCSUnitName )
|
self:AddForCleanUp( Event.IniUnit, Event.IniDCSUnitName )
|
||||||
@@ -362,7 +365,7 @@ function CLEANUP_AIRBASE.__:EventAddForCleanUp( Event )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Event.TgtDCSUnit and Event.TgtCategory == Object.Category.UNIT then
|
if Event.TgtDCSUnit and Event.TgtUnit and Event.TgtCategory == Object.Category.UNIT then
|
||||||
if self.CleanUpList[Event.TgtDCSUnitName] == nil then
|
if self.CleanUpList[Event.TgtDCSUnitName] == nil then
|
||||||
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
if self:IsInAirbase( Event.TgtUnit:GetVec2() ) then
|
||||||
self:AddForCleanUp( Event.TgtUnit, Event.TgtDCSUnitName )
|
self:AddForCleanUp( Event.TgtUnit, Event.TgtDCSUnitName )
|
||||||
@@ -384,7 +387,7 @@ function CLEANUP_AIRBASE.__:CleanUpSchedule()
|
|||||||
local CleanUpUnit = CleanUpListData.CleanUpUnit -- Wrapper.Unit#UNIT
|
local CleanUpUnit = CleanUpListData.CleanUpUnit -- Wrapper.Unit#UNIT
|
||||||
local CleanUpGroupName = CleanUpListData.CleanUpGroupName
|
local CleanUpGroupName = CleanUpListData.CleanUpGroupName
|
||||||
|
|
||||||
if CleanUpUnit:IsAlive() ~= nil then
|
if CleanUpUnit and CleanUpUnit:IsAlive() ~= nil then
|
||||||
|
|
||||||
if self:IsInAirbase( CleanUpUnit:GetVec2() ) then
|
if self:IsInAirbase( CleanUpUnit:GetVec2() ) then
|
||||||
|
|
||||||
@@ -411,7 +414,7 @@ function CLEANUP_AIRBASE.__:CleanUpSchedule()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Clean Units which are waiting for a very long time in the CleanUpZone.
|
-- Clean Units which are waiting for a very long time in the CleanUpZone.
|
||||||
if CleanUpUnit and not CleanUpUnit:GetPlayerName() then
|
if CleanUpUnit and (CleanUpUnit.GetPlayerName == nil or not CleanUpUnit:GetPlayerName()) then
|
||||||
local CleanUpUnitVelocity = CleanUpUnit:GetVelocityKMH()
|
local CleanUpUnitVelocity = CleanUpUnit:GetVelocityKMH()
|
||||||
if CleanUpUnitVelocity < 1 then
|
if CleanUpUnitVelocity < 1 then
|
||||||
if CleanUpListData.CleanUpMoved then
|
if CleanUpListData.CleanUpMoved then
|
||||||
|
|||||||
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
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
|
|
||||||
do -- DESIGNATE
|
do -- DESIGNATE
|
||||||
|
|
||||||
--- @type DESIGNATE
|
-- @type DESIGNATE
|
||||||
-- @extends Core.Fsm#FSM_PROCESS
|
-- @extends Core.Fsm#FSM_PROCESS
|
||||||
|
|
||||||
--- Manage the designation of detected targets.
|
--- Manage the designation of detected targets.
|
||||||
@@ -525,7 +525,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
self.AttackSet:ForEachGroupAlive(
|
self.AttackSet:ForEachGroupAlive(
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AttackGroup
|
-- @param Wrapper.Group#GROUP AttackGroup
|
||||||
function( AttackGroup )
|
function( AttackGroup )
|
||||||
self.FlashStatusMenu[AttackGroup] = FlashMenu
|
self.FlashStatusMenu[AttackGroup] = FlashMenu
|
||||||
end
|
end
|
||||||
@@ -554,7 +554,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
self.AttackSet:ForEachGroupAlive(
|
self.AttackSet:ForEachGroupAlive(
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP AttackGroup
|
-- @param Wrapper.Group#GROUP AttackGroup
|
||||||
function( AttackGroup )
|
function( AttackGroup )
|
||||||
self.FlashDetectionMessage[AttackGroup] = FlashDetectionMessage
|
self.FlashDetectionMessage[AttackGroup] = FlashDetectionMessage
|
||||||
end
|
end
|
||||||
@@ -826,7 +826,7 @@ do -- DESIGNATE
|
|||||||
-- This Detection is obsolete, remove from the designate scope
|
-- This Detection is obsolete, remove from the designate scope
|
||||||
self.Designating[DesignateIndex] = nil
|
self.Designating[DesignateIndex] = nil
|
||||||
self.AttackSet:ForEachGroupAlive(
|
self.AttackSet:ForEachGroupAlive(
|
||||||
--- @param Wrapper.Group#GROUP AttackGroup
|
-- @param Wrapper.Group#GROUP AttackGroup
|
||||||
function( AttackGroup )
|
function( AttackGroup )
|
||||||
if AttackGroup:IsAlive() == true then
|
if AttackGroup:IsAlive() == true then
|
||||||
local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
|
local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
|
||||||
@@ -903,7 +903,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
self.AttackSet:ForEachGroupAlive(
|
self.AttackSet:ForEachGroupAlive(
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP GroupReport
|
-- @param Wrapper.Group#GROUP GroupReport
|
||||||
function( AttackGroup )
|
function( AttackGroup )
|
||||||
|
|
||||||
if self.FlashStatusMenu[AttackGroup] or ( MenuAttackGroup and ( AttackGroup:GetName() == MenuAttackGroup:GetName() ) ) then
|
if self.FlashStatusMenu[AttackGroup] or ( MenuAttackGroup and ( AttackGroup:GetName() == MenuAttackGroup:GetName() ) ) then
|
||||||
@@ -1060,7 +1060,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
self.AttackSet:ForEachGroupAlive(
|
self.AttackSet:ForEachGroupAlive(
|
||||||
|
|
||||||
--- @param Wrapper.Group#GROUP GroupReport
|
-- @param Wrapper.Group#GROUP GroupReport
|
||||||
function( AttackGroup )
|
function( AttackGroup )
|
||||||
|
|
||||||
self:ScheduleOnce( Delay, self.SetMenu, self, AttackGroup )
|
self:ScheduleOnce( Delay, self.SetMenu, self, AttackGroup )
|
||||||
@@ -1198,7 +1198,7 @@ do -- DESIGNATE
|
|||||||
--local ReportTypes = REPORT:New()
|
--local ReportTypes = REPORT:New()
|
||||||
--local ReportLaserCodes = REPORT:New()
|
--local ReportLaserCodes = REPORT:New()
|
||||||
|
|
||||||
TargetSetUnit:Flush( self )
|
--TargetSetUnit:Flush( self )
|
||||||
|
|
||||||
--self:F( { Recces = self.Recces } )
|
--self:F( { Recces = self.Recces } )
|
||||||
for TargetUnit, RecceData in pairs( self.Recces ) do
|
for TargetUnit, RecceData in pairs( self.Recces ) do
|
||||||
@@ -1229,10 +1229,12 @@ do -- DESIGNATE
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if TargetSetUnit == nil then return end
|
||||||
|
|
||||||
if self.AutoLase or ( not self.AutoLase and ( self.LaseStart + Duration >= timer.getTime() ) ) then
|
if self.AutoLase or ( not self.AutoLase and ( self.LaseStart + Duration >= timer.getTime() ) ) then
|
||||||
|
|
||||||
TargetSetUnit:ForEachUnitPerThreatLevel( 10, 0,
|
TargetSetUnit:ForEachUnitPerThreatLevel( 10, 0,
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
-- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( TargetUnit )
|
function( TargetUnit )
|
||||||
|
|
||||||
self:F( { TargetUnit = TargetUnit:GetName() } )
|
self:F( { TargetUnit = TargetUnit:GetName() } )
|
||||||
@@ -1253,7 +1255,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
|
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local RecceUnitDesc = RecceUnit:GetDesc()
|
local RecceUnitDesc = RecceUnit:GetDesc()
|
||||||
--self:F( { RecceUnit = RecceUnit:GetName(), RecceDescription = RecceUnitDesc } )
|
--self:F( { RecceUnit = RecceUnit:GetName(), RecceDescription = RecceUnitDesc } )x
|
||||||
|
|
||||||
if RecceUnit:IsLasing() == false then
|
if RecceUnit:IsLasing() == false then
|
||||||
--self:F( { IsDetected = RecceUnit:IsDetected( TargetUnit ), IsLOS = RecceUnit:IsLOS( TargetUnit ) } )
|
--self:F( { IsDetected = RecceUnit:IsDetected( TargetUnit ), IsLOS = RecceUnit:IsLOS( TargetUnit ) } )
|
||||||
@@ -1275,9 +1277,10 @@ do -- DESIGNATE
|
|||||||
local Spot = RecceUnit:LaseUnit( TargetUnit, LaserCode, Duration )
|
local Spot = RecceUnit:LaseUnit( TargetUnit, LaserCode, Duration )
|
||||||
local AttackSet = self.AttackSet
|
local AttackSet = self.AttackSet
|
||||||
local DesignateName = self.DesignateName
|
local DesignateName = self.DesignateName
|
||||||
|
local typename = TargetUnit:GetTypeName()
|
||||||
|
|
||||||
function Spot:OnAfterDestroyed( From, Event, To )
|
function Spot:OnAfterDestroyed( From, Event, To )
|
||||||
self.Recce:MessageToSetGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed. " .. TargetSetUnit:Count() .. " targets left.",
|
self.Recce:MessageToSetGroup( "Target " ..typename .. " destroyed. " .. TargetSetUnit:CountAlive() .. " targets left.",
|
||||||
5, AttackSet, self.DesignateName )
|
5, AttackSet, self.DesignateName )
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1285,7 +1288,7 @@ do -- DESIGNATE
|
|||||||
-- OK. We have assigned for the Recce a TargetUnit. We can exit the function.
|
-- OK. We have assigned for the Recce a TargetUnit. We can exit the function.
|
||||||
MarkingCount = MarkingCount + 1
|
MarkingCount = MarkingCount + 1
|
||||||
local TargetUnitType = TargetUnit:GetTypeName()
|
local TargetUnitType = TargetUnit:GetTypeName()
|
||||||
RecceUnit:MessageToSetGroup( "Marking " .. TargetUnit:GetTypeName() .. " with laser " .. RecceUnit:GetSpot().LaserCode .. " for " .. Duration .. "s.",
|
RecceUnit:MessageToSetGroup( "Marking " .. TargetUnitType .. " with laser " .. RecceUnit:GetSpot().LaserCode .. " for " .. Duration .. "s.",
|
||||||
10, self.AttackSet, DesignateName )
|
10, self.AttackSet, DesignateName )
|
||||||
if not MarkedTypes[TargetUnitType] then
|
if not MarkedTypes[TargetUnitType] then
|
||||||
MarkedTypes[TargetUnitType] = true
|
MarkedTypes[TargetUnitType] = true
|
||||||
@@ -1392,7 +1395,7 @@ do -- DESIGNATE
|
|||||||
local MarkedCount = 0
|
local MarkedCount = 0
|
||||||
|
|
||||||
TargetSetUnit:ForEachUnitPerThreatLevel( 10, 0,
|
TargetSetUnit:ForEachUnitPerThreatLevel( 10, 0,
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
-- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( SmokeUnit )
|
function( SmokeUnit )
|
||||||
|
|
||||||
if MarkedCount < self.MaximumMarkings then
|
if MarkedCount < self.MaximumMarkings then
|
||||||
@@ -1457,9 +1460,10 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
-- @return #DESIGNATE
|
-- @return #DESIGNATE
|
||||||
function DESIGNATE:onafterDoneSmoking( From, Event, To, Index )
|
function DESIGNATE:onafterDoneSmoking( From, Event, To, Index )
|
||||||
|
if self.Designating[Index] ~= nil then
|
||||||
self.Designating[Index] = string.gsub( self.Designating[Index], "S", "" )
|
self.Designating[Index] = string.gsub( self.Designating[Index], "S", "" )
|
||||||
self:SetDesignateMenu()
|
self:SetDesignateMenu()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- DoneIlluminating
|
--- DoneIlluminating
|
||||||
@@ -1472,5 +1476,3 @@ do -- DESIGNATE
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ do -- DETECTION_BASE
|
|||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function DETECTION_BASE:onafterDetect( From, Event, To )
|
function DETECTION_BASE:onafterDetect( From, Event, To )
|
||||||
|
|
||||||
local DetectDelay = 0.1
|
local DetectDelay = 0.15
|
||||||
self.DetectionCount = 0
|
self.DetectionCount = 0
|
||||||
self.DetectionRun = 0
|
self.DetectionRun = 0
|
||||||
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
|
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
|
||||||
@@ -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:F( { DetectedObjects = self.DetectedObjects } )
|
self:T( { DetectedObjects = self.DetectedObjects } )
|
||||||
|
|
||||||
self.DetectionRun = self.DetectionRun + 1
|
self.DetectionRun = self.DetectionRun + 1
|
||||||
|
|
||||||
@@ -612,14 +613,14 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
if Detection and Detection:IsAlive() then
|
if Detection and Detection:IsAlive() then
|
||||||
|
|
||||||
-- self:T( { "DetectionGroup is Alive", DetectionGroup: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 = {}
|
||||||
|
|
||||||
local DetectedTargets = Detection:GetDetectedTargets(
|
local DetectedTargets = DetectionUnit:GetDetectedTargets(
|
||||||
self.DetectVisual,
|
self.DetectVisual,
|
||||||
self.DetectOptical,
|
self.DetectOptical,
|
||||||
self.DetectRadar,
|
self.DetectRadar,
|
||||||
@@ -628,28 +629,30 @@ do -- DETECTION_BASE
|
|||||||
self.DetectDLINK
|
self.DetectDLINK
|
||||||
)
|
)
|
||||||
|
|
||||||
self:F( { DetectedTargets = DetectedTargets } )
|
--self:T( { DetectedTargets = 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
|
||||||
|
|
||||||
if DetectedObject:isExist() then
|
if DetectedObject:isExist() then
|
||||||
|
|
||||||
local TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity = DetectionUnit:IsTargetDetected(
|
local TargetIsDetected, TargetIsVisible, TargetKnowType, TargetKnowDistance, TargetLastTime, TargetLastPos, TargetLastVelocity = DetectionUnit:IsTargetDetected(
|
||||||
DetectedObject,
|
DetectedObject,
|
||||||
self.DetectVisual,
|
self.DetectVisual,
|
||||||
self.DetectOptical,
|
self.DetectOptical,
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -1154,8 +1154,6 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
|
|
||||||
if self.EscortGroup:IsAlive() and self.EscortClient:IsAlive() then
|
if self.EscortGroup:IsAlive() and self.EscortClient:IsAlive() then
|
||||||
|
|
||||||
if true then
|
|
||||||
|
|
||||||
local EscortGroupName = self.EscortGroup:GetName()
|
local EscortGroupName = self.EscortGroup:GetName()
|
||||||
|
|
||||||
self.EscortMenuAttackNearbyTargets:RemoveSubMenus()
|
self.EscortMenuAttackNearbyTargets:RemoveSubMenus()
|
||||||
@@ -1226,177 +1224,6 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
else
|
|
||||||
-- local EscortGroupName = self.EscortGroup:GetName()
|
|
||||||
-- local EscortTargets = self.EscortGroup:GetDetectedTargets()
|
|
||||||
--
|
|
||||||
-- local ClientEscortTargets = self.EscortClient._EscortGroups[EscortGroupName].Targets
|
|
||||||
--
|
|
||||||
-- local EscortTargetMessages = ""
|
|
||||||
-- for EscortTargetID, EscortTarget in pairs( EscortTargets ) do
|
|
||||||
-- local EscortObject = EscortTarget.object
|
|
||||||
-- self:T( EscortObject )
|
|
||||||
-- if EscortObject and EscortObject:isExist() and EscortObject.id_ < 50000000 then
|
|
||||||
--
|
|
||||||
-- local EscortTargetUnit = UNIT:Find( EscortObject )
|
|
||||||
-- local EscortTargetUnitName = EscortTargetUnit:GetName()
|
|
||||||
--
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- -- local EscortTargetIsDetected,
|
|
||||||
-- -- EscortTargetIsVisible,
|
|
||||||
-- -- EscortTargetLastTime,
|
|
||||||
-- -- EscortTargetKnowType,
|
|
||||||
-- -- EscortTargetKnowDistance,
|
|
||||||
-- -- EscortTargetLastPos,
|
|
||||||
-- -- EscortTargetLastVelocity
|
|
||||||
-- -- = self.EscortGroup:IsTargetDetected( EscortObject )
|
|
||||||
-- --
|
|
||||||
-- -- self:T( { EscortTargetIsDetected,
|
|
||||||
-- -- EscortTargetIsVisible,
|
|
||||||
-- -- EscortTargetLastTime,
|
|
||||||
-- -- EscortTargetKnowType,
|
|
||||||
-- -- EscortTargetKnowDistance,
|
|
||||||
-- -- EscortTargetLastPos,
|
|
||||||
-- -- EscortTargetLastVelocity } )
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- local EscortTargetUnitVec3 = EscortTargetUnit:GetVec3()
|
|
||||||
-- local EscortVec3 = self.EscortGroup:GetVec3()
|
|
||||||
-- local Distance = ( ( EscortTargetUnitVec3.x - EscortVec3.x )^2 +
|
|
||||||
-- ( EscortTargetUnitVec3.y - EscortVec3.y )^2 +
|
|
||||||
-- ( EscortTargetUnitVec3.z - EscortVec3.z )^2
|
|
||||||
-- ) ^ 0.5 / 1000
|
|
||||||
--
|
|
||||||
-- self:T( { self.EscortGroup:GetName(), EscortTargetUnit:GetName(), Distance, EscortTarget } )
|
|
||||||
--
|
|
||||||
-- if Distance <= 15 then
|
|
||||||
--
|
|
||||||
-- if not ClientEscortTargets[EscortTargetUnitName] then
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName] = {}
|
|
||||||
-- end
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName].AttackUnit = EscortTargetUnit
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName].visible = EscortTarget.visible
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName].type = EscortTarget.type
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName].distance = EscortTarget.distance
|
|
||||||
-- else
|
|
||||||
-- if ClientEscortTargets[EscortTargetUnitName] then
|
|
||||||
-- ClientEscortTargets[EscortTargetUnitName] = nil
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- self:T( { "Sorting Targets Table:", ClientEscortTargets } )
|
|
||||||
-- table.sort( ClientEscortTargets, function( a, b ) return a.Distance < b.Distance end )
|
|
||||||
-- self:T( { "Sorted Targets Table:", ClientEscortTargets } )
|
|
||||||
--
|
|
||||||
-- -- Remove the sub menus of the Attack menu of the Escort for the EscortGroup.
|
|
||||||
-- self.EscortMenuAttackNearbyTargets:RemoveSubMenus()
|
|
||||||
--
|
|
||||||
-- if self.EscortMenuTargetAssistance then
|
|
||||||
-- self.EscortMenuTargetAssistance:RemoveSubMenus()
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- --for MenuIndex = 1, #self.EscortMenuAttackTargets do
|
|
||||||
-- -- self:T( { "Remove Menu:", self.EscortMenuAttackTargets[MenuIndex] } )
|
|
||||||
-- -- self.EscortMenuAttackTargets[MenuIndex] = self.EscortMenuAttackTargets[MenuIndex]:Remove()
|
|
||||||
-- --end
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- if ClientEscortTargets then
|
|
||||||
-- for ClientEscortTargetUnitName, ClientEscortTargetData in pairs( ClientEscortTargets ) do
|
|
||||||
--
|
|
||||||
-- for ClientEscortGroupName, EscortGroupData in pairs( self.EscortClient._EscortGroups ) do
|
|
||||||
--
|
|
||||||
-- if ClientEscortTargetData and ClientEscortTargetData.AttackUnit:IsAlive() then
|
|
||||||
--
|
|
||||||
-- local EscortTargetMessage = ""
|
|
||||||
-- local EscortTargetCategoryName = ClientEscortTargetData.AttackUnit:GetCategoryName()
|
|
||||||
-- local EscortTargetCategoryType = ClientEscortTargetData.AttackUnit:GetTypeName()
|
|
||||||
-- if ClientEscortTargetData.type then
|
|
||||||
-- EscortTargetMessage = EscortTargetMessage .. EscortTargetCategoryName .. " (" .. EscortTargetCategoryType .. ") at "
|
|
||||||
-- else
|
|
||||||
-- EscortTargetMessage = EscortTargetMessage .. "Unknown target at "
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local EscortTargetUnitVec3 = ClientEscortTargetData.AttackUnit:GetVec3()
|
|
||||||
-- local EscortVec3 = self.EscortGroup:GetVec3()
|
|
||||||
-- local Distance = ( ( EscortTargetUnitVec3.x - EscortVec3.x )^2 +
|
|
||||||
-- ( EscortTargetUnitVec3.y - EscortVec3.y )^2 +
|
|
||||||
-- ( EscortTargetUnitVec3.z - EscortVec3.z )^2
|
|
||||||
-- ) ^ 0.5 / 1000
|
|
||||||
--
|
|
||||||
-- self:T( { self.EscortGroup:GetName(), ClientEscortTargetData.AttackUnit:GetName(), Distance, ClientEscortTargetData.AttackUnit } )
|
|
||||||
-- if ClientEscortTargetData.visible == false then
|
|
||||||
-- EscortTargetMessage = EscortTargetMessage .. string.format( "%.2f", Distance ) .. " estimated km"
|
|
||||||
-- else
|
|
||||||
-- EscortTargetMessage = EscortTargetMessage .. string.format( "%.2f", Distance ) .. " km"
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if ClientEscortTargetData.visible then
|
|
||||||
-- EscortTargetMessage = EscortTargetMessage .. ", visual"
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if ClientEscortGroupName == EscortGroupName then
|
|
||||||
--
|
|
||||||
-- MENU_GROUP_COMMAND:New( self.EscortClient,
|
|
||||||
-- EscortTargetMessage,
|
|
||||||
-- self.EscortMenuAttackNearbyTargets,
|
|
||||||
-- ESCORT._AttackTarget,
|
|
||||||
-- { ParamSelf = self,
|
|
||||||
-- ParamUnit = ClientEscortTargetData.AttackUnit
|
|
||||||
-- }
|
|
||||||
-- )
|
|
||||||
-- EscortTargetMessages = EscortTargetMessages .. "\n - " .. EscortTargetMessage
|
|
||||||
-- else
|
|
||||||
-- if self.EscortMenuTargetAssistance then
|
|
||||||
-- local MenuTargetAssistance = MENU_GROUP:New( self.EscortClient, EscortGroupData.EscortName, self.EscortMenuTargetAssistance )
|
|
||||||
-- MENU_GROUP_COMMAND:New( self.EscortClient,
|
|
||||||
-- EscortTargetMessage,
|
|
||||||
-- MenuTargetAssistance,
|
|
||||||
-- ESCORT._AssistTarget,
|
|
||||||
-- self,
|
|
||||||
-- EscortGroupData.EscortGroup,
|
|
||||||
-- ClientEscortTargetData.AttackUnit
|
|
||||||
-- )
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- else
|
|
||||||
-- ClientEscortTargetData = nil
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if EscortTargetMessages ~= "" and self.ReportTargets == true then
|
|
||||||
-- self.EscortGroup:MessageToClient( "Detected targets within 15 km range:" .. EscortTargetMessages:gsub("\n$",""), 20, self.EscortClient )
|
|
||||||
-- else
|
|
||||||
-- self.EscortGroup:MessageToClient( "No targets detected!", 20, self.EscortClient )
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if self.EscortMenuResumeMission then
|
|
||||||
-- self.EscortMenuResumeMission:RemoveSubMenus()
|
|
||||||
--
|
|
||||||
-- -- if self.EscortMenuResumeWayPoints then
|
|
||||||
-- -- for MenuIndex = 1, #self.EscortMenuResumeWayPoints do
|
|
||||||
-- -- self:T( { "Remove Menu:", self.EscortMenuResumeWayPoints[MenuIndex] } )
|
|
||||||
-- -- self.EscortMenuResumeWayPoints[MenuIndex] = self.EscortMenuResumeWayPoints[MenuIndex]:Remove()
|
|
||||||
-- -- end
|
|
||||||
-- -- end
|
|
||||||
--
|
|
||||||
-- local TaskPoints = self:RegisterRoute()
|
|
||||||
-- for WayPointID, WayPoint in pairs( TaskPoints ) do
|
|
||||||
-- local EscortVec3 = self.EscortGroup:GetVec3()
|
|
||||||
-- local Distance = ( ( WayPoint.x - EscortVec3.x )^2 +
|
|
||||||
-- ( WayPoint.y - EscortVec3.z )^2
|
|
||||||
-- ) ^ 0.5 / 1000
|
|
||||||
-- MENU_GROUP_COMMAND:New( self.EscortClient, "Waypoint " .. WayPointID .. " at " .. string.format( "%.2f", Distance ).. "km", self.EscortMenuResumeMission, ESCORT._ResumeMission, { ParamSelf = self, ParamWayPoint = WayPointID } )
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -1060,7 +1060,7 @@ function FOX:onafterMissileLaunch(From, Event, To, missile)
|
|||||||
|
|
||||||
-- Tracking info and init of last bomb position.
|
-- Tracking info and init of last bomb position.
|
||||||
local text=string.format("FOX: Tracking missile %s(%s) - target %s - shooter %s", missile.missileType, missile.missileName, tostring(missile.targetName), missile.shooterName)
|
local text=string.format("FOX: Tracking missile %s(%s) - target %s - shooter %s", missile.missileType, missile.missileName, tostring(missile.targetName), missile.shooterName)
|
||||||
self:I(FOX.lid..text)
|
self:T(FOX.lid..text)
|
||||||
MESSAGE:New(text, 10):ToAllIf(self.Debug)
|
MESSAGE:New(text, 10):ToAllIf(self.Debug)
|
||||||
|
|
||||||
-- Loop over players.
|
-- Loop over players.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
-- @module Functional.Mantis
|
-- @module Functional.Mantis
|
||||||
-- @image Functional.Mantis.jpg
|
-- @image Functional.Mantis.jpg
|
||||||
--
|
--
|
||||||
-- Last Update: Feb 2024
|
-- Last Update: Mar 2025
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **MANTIS** class, extends Core.Base#BASE
|
--- **MANTIS** class, extends Core.Base#BASE
|
||||||
@@ -58,6 +58,11 @@
|
|||||||
-- @field #boolean ShoradLink If true, #MANTIS has #SHORAD enabled
|
-- @field #boolean ShoradLink If true, #MANTIS has #SHORAD enabled
|
||||||
-- @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 #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.
|
||||||
|
-- @field #boolean SmokeDecoy If true, smoke short range SAM units as decoy if a plane is in firing range.
|
||||||
|
-- @field #number SmokeDecoyColor Color to use, defaults to SMOKECOLOR.White
|
||||||
|
-- @field #number checkcounter Counter for SAM Table refreshes
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +74,7 @@
|
|||||||
--
|
--
|
||||||
-- * Moose derived Modular, Automatic and Network capable Targeting and Interception System.
|
-- * Moose derived Modular, Automatic and Network capable Targeting and Interception System.
|
||||||
-- * Controls a network of SAM sites. Uses detection to switch on the SAM site closest to the enemy.
|
-- * Controls a network of SAM sites. Uses detection to switch on the SAM site closest to the enemy.
|
||||||
-- * **Automatic mode** (default since 0.8) can set-up your SAM site network automatically for you
|
-- * **Automatic mode** (default since 0.8) will set-up your SAM site network automatically for you
|
||||||
-- * **Classic mode** behaves like before
|
-- * **Classic mode** behaves like before
|
||||||
-- * Leverage evasiveness from SEAD, leverage attack range setting
|
-- * Leverage evasiveness from SEAD, leverage attack range setting
|
||||||
-- * Automatic setup of SHORAD based on groups of the class "short-range"
|
-- * Automatic setup of SHORAD based on groups of the class "short-range"
|
||||||
@@ -84,6 +89,7 @@
|
|||||||
-- * SAM sites, e.g. each **group name** begins with "Red SAM"
|
-- * SAM sites, e.g. each **group name** begins with "Red SAM"
|
||||||
-- * EWR network and AWACS, e.g. each **group name** begins with "Red EWR" and *not* e.g. "Red SAM EWR" (overlap with "Red SAM"), "Red EWR Awacs" will be found by "Red EWR"
|
-- * EWR network and AWACS, e.g. each **group name** begins with "Red EWR" and *not* e.g. "Red SAM EWR" (overlap with "Red SAM"), "Red EWR Awacs" will be found by "Red EWR"
|
||||||
-- * SHORAD, e.g. each **group name** begins with "Red SHORAD" and *not" e.g. just "SHORAD" because you might also have "Blue SHORAD"
|
-- * SHORAD, e.g. each **group name** begins with "Red SHORAD" and *not" e.g. just "SHORAD" because you might also have "Blue SHORAD"
|
||||||
|
-- * Point Defense, e.g. each **group name** begins with "Red AAA" and *not" e.g. just "AAA" because you might also have "Blue AAA"
|
||||||
--
|
--
|
||||||
-- It's important to get this right because of the nature of the filter-system in @{Core.Set#SET_GROUP}. Filters are "greedy", that is they
|
-- It's important to get this right because of the nature of the filter-system in @{Core.Set#SET_GROUP}. Filters are "greedy", that is they
|
||||||
-- will match *any* string that contains the search string - hence we need to avoid that SAMs, EWR and SHORAD step on each other\'s toes.
|
-- will match *any* string that contains the search string - hence we need to avoid that SAMs, EWR and SHORAD step on each other\'s toes.
|
||||||
@@ -142,6 +148,7 @@
|
|||||||
-- **Location** is of highest importance here. Whilst AWACS in DCS has almost the "all seeing eye", EWR don't have that. Choose your location wisely, against a mountain backdrop or inside a valley even the best EWR system
|
-- **Location** is of highest importance here. Whilst AWACS in DCS has almost the "all seeing eye", EWR don't have that. Choose your location wisely, against a mountain backdrop or inside a valley even the best EWR system
|
||||||
-- doesn't work well. Prefer higher-up locations with a good view; use F7 in-game to check where you actually placed your EWR and have a look around. Apart from the obvious choice, do also consider other radar units
|
-- doesn't work well. Prefer higher-up locations with a good view; use F7 in-game to check where you actually placed your EWR and have a look around. Apart from the obvious choice, do also consider other radar units
|
||||||
-- for this role, most have "SR" (search radar) or "STR" (search and track radar) in their names, use the encyclopedia to see what they actually do.
|
-- for this role, most have "SR" (search radar) or "STR" (search and track radar) in their names, use the encyclopedia to see what they actually do.
|
||||||
|
-- **HINT** Set at least one EWR on invisible and immortal so MANTIS doesn't stop working.
|
||||||
--
|
--
|
||||||
-- ## 1.2 SAM sites
|
-- ## 1.2 SAM sites
|
||||||
--
|
--
|
||||||
@@ -187,29 +194,32 @@
|
|||||||
-- -- This is effectively a 3-stage filter allowing for zone overlap. A coordinate is accepted first when
|
-- -- This is effectively a 3-stage filter allowing for zone overlap. A coordinate is accepted first when
|
||||||
-- -- it is inside any AcceptZone. Then RejectZones are checked, which enforces both borders, but also overlaps of
|
-- -- it is inside any AcceptZone. Then RejectZones are checked, which enforces both borders, but also overlaps of
|
||||||
-- -- Accept- and RejectZones. Last, if it is inside a conflict zone, it is accepted.
|
-- -- Accept- and RejectZones. Last, if it is inside a conflict zone, it is accepted.
|
||||||
-- `mybluemantis:AddZones(AcceptZones,RejectZones,ConflictZones)`
|
-- mybluemantis:AddZones(AcceptZones,RejectZones,ConflictZones)
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- ### 2.1.2 Change the number of long-, mid- and short-range systems going live on a detected target:
|
-- ### 2.1.2 Change the number of long-, mid- and short-range, point defense systems going live on a detected target:
|
||||||
--
|
--
|
||||||
-- -- parameters are numbers. Defaults are 1,2,2,6 respectively
|
-- -- parameters are numbers. Defaults are 1,2,2,6,6 respectively
|
||||||
-- `mybluemantis:SetMaxActiveSAMs(Short,Mid,Long,Classic)`
|
-- mybluemantis:SetMaxActiveSAMs(Short,Mid,Long,Classic,Point)
|
||||||
--
|
--
|
||||||
-- ### 2.1.3 SHORAD will automatically be added from SAM sites of type "short-range"
|
-- ### 2.1.3 SHORAD/Point defense will automatically be added from SAM sites of type "point" or if the range is less than 5km or if the type is AAA.
|
||||||
--
|
--
|
||||||
-- ### 2.1.4 Advanced features
|
-- ### 2.1.4 Advanced features
|
||||||
--
|
--
|
||||||
-- -- switch off auto mode **before** you start MANTIS.
|
-- -- Option to switch off auto mode **before** you start MANTIS (not recommended)
|
||||||
-- `mybluemantis.automode = false`
|
-- mybluemantis.automode = false
|
||||||
--
|
--
|
||||||
-- -- switch off auto shorad **before** you start MANTIS.
|
-- -- Option to set the scale of the activation range, i.e. don't activate at the fringes of max range, defaults below.
|
||||||
-- `mybluemantis.autoshorad = false`
|
|
||||||
--
|
|
||||||
-- -- scale of the activation range, i.e. don't activate at the fringes of max range, defaults below.
|
|
||||||
-- -- also see engagerange below.
|
-- -- also see engagerange below.
|
||||||
-- ` self.radiusscale[MANTIS.SamType.LONG] = 1.1`
|
-- self.radiusscale[MANTIS.SamType.LONG] = 1.1
|
||||||
-- ` self.radiusscale[MANTIS.SamType.MEDIUM] = 1.2`
|
-- self.radiusscale[MANTIS.SamType.MEDIUM] = 1.2
|
||||||
-- ` self.radiusscale[MANTIS.SamType.SHORT] = 1.3`
|
-- self.radiusscale[MANTIS.SamType.SHORT] = 1.3
|
||||||
|
-- self.radiusscale[MANTIS.SamType.POINT] = 1.4
|
||||||
|
--
|
||||||
|
-- ### 2.1.5 Friendlies check in firing range
|
||||||
|
--
|
||||||
|
-- -- For some scenarios, like Cold War, it might be useful not to activate SAMs if friendly aircraft are around to avoid death by friendly fire.
|
||||||
|
-- mybluemantis.checkforfriendlies = true
|
||||||
--
|
--
|
||||||
-- # 3. Default settings [both modes unless stated otherwise]
|
-- # 3. Default settings [both modes unless stated otherwise]
|
||||||
--
|
--
|
||||||
@@ -233,9 +243,9 @@
|
|||||||
--
|
--
|
||||||
-- 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, not recommended for manual setup]
|
||||||
--
|
--
|
||||||
-- 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 manually. 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:
|
||||||
--
|
--
|
||||||
-- local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()
|
-- local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()
|
||||||
@@ -289,6 +299,7 @@ MANTIS = {
|
|||||||
SAM_Table_Long = {},
|
SAM_Table_Long = {},
|
||||||
SAM_Table_Medium = {},
|
SAM_Table_Medium = {},
|
||||||
SAM_Table_Short = {},
|
SAM_Table_Short = {},
|
||||||
|
SAM_Table_PointDef = {},
|
||||||
lid = "",
|
lid = "",
|
||||||
Detection = nil,
|
Detection = nil,
|
||||||
AWACS_Detection = nil,
|
AWACS_Detection = nil,
|
||||||
@@ -321,6 +332,10 @@ MANTIS = {
|
|||||||
automode = true,
|
automode = true,
|
||||||
autoshorad = true,
|
autoshorad = true,
|
||||||
ShoradGroupSet = nil,
|
ShoradGroupSet = nil,
|
||||||
|
checkforfriendlies = false,
|
||||||
|
SmokeDecoy = false,
|
||||||
|
SmokeDecoyColor = SMOKECOLOR.White,
|
||||||
|
checkcounter = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Advanced state enumerator
|
--- Advanced state enumerator
|
||||||
@@ -337,8 +352,17 @@ MANTIS.SamType = {
|
|||||||
SHORT = "Short",
|
SHORT = "Short",
|
||||||
MEDIUM = "Medium",
|
MEDIUM = "Medium",
|
||||||
LONG = "Long",
|
LONG = "Long",
|
||||||
|
POINT = "Point",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- SAM Radiusscale
|
||||||
|
-- @type MANTIS.radiusscale
|
||||||
|
MANTIS.radiusscale = {}
|
||||||
|
MANTIS.radiusscale[MANTIS.SamType.LONG] = 1.1
|
||||||
|
MANTIS.radiusscale[MANTIS.SamType.MEDIUM] = 1.2
|
||||||
|
MANTIS.radiusscale[MANTIS.SamType.SHORT] = 1.75
|
||||||
|
MANTIS.radiusscale[MANTIS.SamType.POINT] = 3
|
||||||
|
|
||||||
--- SAM data
|
--- SAM data
|
||||||
-- @type MANTIS.SamData
|
-- @type MANTIS.SamData
|
||||||
-- @field #number Range Max firing range in km
|
-- @field #number Range Max firing range in km
|
||||||
@@ -346,6 +370,7 @@ MANTIS.SamType = {
|
|||||||
-- @field #number Height Max firing height in km
|
-- @field #number Height Max firing height in km
|
||||||
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
||||||
-- @field #string Radar Radar typename on unit level (used as key)
|
-- @field #string Radar Radar typename on unit level (used as key)
|
||||||
|
-- @field #string Point Point defense capable
|
||||||
MANTIS.SamData = {
|
MANTIS.SamData = {
|
||||||
["Hawk"] = { Range=35, Blindspot=0, Height=12, Type="Medium", Radar="Hawk" }, -- measures in km
|
["Hawk"] = { Range=35, Blindspot=0, Height=12, Type="Medium", Radar="Hawk" }, -- measures in km
|
||||||
["NASAMS"] = { Range=14, Blindspot=0, Height=7, Type="Short", Radar="NSAMS" }, -- AIM 120B
|
["NASAMS"] = { Range=14, Blindspot=0, Height=7, Type="Short", Radar="NSAMS" }, -- AIM 120B
|
||||||
@@ -357,16 +382,16 @@ MANTIS.SamData = {
|
|||||||
["SA-6"] = { Range=25, Blindspot=0, Height=8, Type="Medium", Radar="1S91" },
|
["SA-6"] = { Range=25, Blindspot=0, Height=8, Type="Medium", Radar="1S91" },
|
||||||
["SA-10"] = { Range=119, Blindspot=0, Height=18, Type="Long" , Radar="S-300PS 4"},
|
["SA-10"] = { Range=119, Blindspot=0, Height=18, Type="Long" , Radar="S-300PS 4"},
|
||||||
["SA-11"] = { Range=35, Blindspot=0, Height=20, Type="Medium", Radar="SA-11" },
|
["SA-11"] = { Range=35, Blindspot=0, Height=20, Type="Medium", Radar="SA-11" },
|
||||||
["Roland"] = { Range=5, Blindspot=0, Height=5, Type="Short", Radar="Roland" },
|
["Roland"] = { Range=5, Blindspot=0, Height=5, Type="Point", Radar="Roland" },
|
||||||
["HQ-7"] = { Range=12, Blindspot=0, Height=3, Type="Short", Radar="HQ-7" },
|
["HQ-7"] = { Range=12, Blindspot=0, Height=3, Type="Short", Radar="HQ-7" },
|
||||||
["SA-9"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Strela" },
|
["SA-9"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="Strela", Point="true" },
|
||||||
["SA-8"] = { Range=10, Blindspot=0, Height=5, Type="Short", Radar="Osa 9A33" },
|
["SA-8"] = { Range=10, Blindspot=0, Height=5, Type="Short", Radar="Osa 9A33" },
|
||||||
["SA-19"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Tunguska" },
|
["SA-19"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Tunguska" },
|
||||||
["SA-15"] = { Range=11, Blindspot=0, Height=6, Type="Short", Radar="Tor 9A331" },
|
["SA-15"] = { Range=11, Blindspot=0, Height=6, Type="Point", Radar="Tor 9A331", Point="true" },
|
||||||
["SA-13"] = { Range=5, Blindspot=0, Height=3, Type="Short", Radar="Strela" },
|
["SA-13"] = { Range=5, Blindspot=0, Height=3, Type="Point", Radar="Strela", Point="true" },
|
||||||
["Avenger"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Avenger" },
|
["Avenger"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Avenger" },
|
||||||
["Chaparral"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Chaparral" },
|
["Chaparral"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Chaparral" },
|
||||||
["Linebacker"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Linebacker" },
|
["Linebacker"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="Linebacker", Point="true" },
|
||||||
["Silkworm"] = { Range=90, Blindspot=1, Height=0.2, Type="Long", Radar="Silkworm" },
|
["Silkworm"] = { Range=90, Blindspot=1, Height=0.2, Type="Long", Radar="Silkworm" },
|
||||||
-- units from HDS Mod, multi launcher options is tricky
|
-- units from HDS Mod, multi launcher options is tricky
|
||||||
["SA-10B"] = { Range=75, Blindspot=0, Height=18, Type="Medium" , Radar="SA-10B"},
|
["SA-10B"] = { Range=75, Blindspot=0, Height=18, Type="Medium" , Radar="SA-10B"},
|
||||||
@@ -374,7 +399,6 @@ MANTIS.SamData = {
|
|||||||
["SA-20A"] = { Range=150, Blindspot=5, Height=27, Type="Long" , Radar="S-300PMU1"},
|
["SA-20A"] = { Range=150, Blindspot=5, Height=27, Type="Long" , Radar="S-300PMU1"},
|
||||||
["SA-20B"] = { Range=200, Blindspot=4, Height=27, Type="Long" , Radar="S-300PMU2"},
|
["SA-20B"] = { Range=200, Blindspot=4, Height=27, Type="Long" , Radar="S-300PMU2"},
|
||||||
["HQ-2"] = { Range=50, Blindspot=6, Height=35, Type="Medium", Radar="HQ_2_Guideline_LN" },
|
["HQ-2"] = { Range=50, Blindspot=6, Height=35, Type="Medium", Radar="HQ_2_Guideline_LN" },
|
||||||
["SHORAD"] = { Range=3, Blindspot=0, Height=3, Type="Short", Radar="Igla" },
|
|
||||||
["TAMIR IDFA"] = { Range=20, Blindspot=0.6, Height=12.3, Type="Short", Radar="IRON_DOME_LN" },
|
["TAMIR IDFA"] = { Range=20, Blindspot=0.6, Height=12.3, Type="Short", Radar="IRON_DOME_LN" },
|
||||||
["STUNNER IDFA"] = { Range=250, Blindspot=1, Height=45, Type="Long", Radar="DAVID_SLING_LN" },
|
["STUNNER IDFA"] = { Range=250, Blindspot=1, Height=45, Type="Long", Radar="DAVID_SLING_LN" },
|
||||||
}
|
}
|
||||||
@@ -386,6 +410,7 @@ MANTIS.SamData = {
|
|||||||
-- @field #number Height Max firing height in km
|
-- @field #number Height Max firing height in km
|
||||||
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
||||||
-- @field #string Radar Radar typename on unit level (used as key)
|
-- @field #string Radar Radar typename on unit level (used as key)
|
||||||
|
-- @field #string Point Point defense capable
|
||||||
MANTIS.SamDataHDS = {
|
MANTIS.SamDataHDS = {
|
||||||
-- units from HDS Mod, multi launcher options is tricky
|
-- units from HDS Mod, multi launcher options is tricky
|
||||||
-- group name MUST contain HDS to ID launcher type correctly!
|
-- group name MUST contain HDS to ID launcher type correctly!
|
||||||
@@ -407,6 +432,7 @@ MANTIS.SamDataHDS = {
|
|||||||
-- @field #number Height Max firing height in km
|
-- @field #number Height Max firing height in km
|
||||||
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
||||||
-- @field #string Radar Radar typename on unit level (used as key)
|
-- @field #string Radar Radar typename on unit level (used as key)
|
||||||
|
-- @field #string Point Point defense capable
|
||||||
MANTIS.SamDataSMA = {
|
MANTIS.SamDataSMA = {
|
||||||
-- units from SMA Mod (Sweedish Military Assets)
|
-- units from SMA Mod (Sweedish Military Assets)
|
||||||
-- https://forum.dcs.world/topic/295202-swedish-military-assets-for-dcs-by-currenthill/
|
-- https://forum.dcs.world/topic/295202-swedish-military-assets-for-dcs-by-currenthill/
|
||||||
@@ -420,7 +446,7 @@ MANTIS.SamDataSMA = {
|
|||||||
["RBS103B SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_Rb103B" },
|
["RBS103B SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_Rb103B" },
|
||||||
["RBS103AM SMA"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
["RBS103AM SMA"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||||
["RBS103BM SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
["RBS103BM SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||||
["Lvkv9040M SMA"] = { Range=4, Blindspot=0, Height=2.5, Type="Short", Radar="LvKv9040" },
|
["Lvkv9040M SMA"] = { Range=4, Blindspot=0, Height=2.5, Type="Point", Radar="LvKv9040",Point="true" },
|
||||||
}
|
}
|
||||||
|
|
||||||
--- SAM data CH
|
--- SAM data CH
|
||||||
@@ -430,28 +456,52 @@ MANTIS.SamDataSMA = {
|
|||||||
-- @field #number Height Max firing height in km
|
-- @field #number Height Max firing height in km
|
||||||
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
-- @field #string Type #MANTIS.SamType of SAM, i.e. SHORT, MEDIUM or LONG (range)
|
||||||
-- @field #string Radar Radar typename on unit level (used as key)
|
-- @field #string Radar Radar typename on unit level (used as key)
|
||||||
|
-- @field #string Point Point defense capable
|
||||||
MANTIS.SamDataCH = {
|
MANTIS.SamDataCH = {
|
||||||
-- units from CH (Military Assets by Currenthill)
|
-- units from CH (Military Assets by Currenthill)
|
||||||
-- https://www.currenthill.com/
|
-- https://www.currenthill.com/
|
||||||
-- group name MUST contain CHM to ID launcher type correctly!
|
-- group name MUST contain CHM to ID launcher type correctly!
|
||||||
["2S38 CH"] = { Range=8, Blindspot=0.5, Height=6, Type="Short", Radar="2S38" },
|
["2S38 CHM"] = { Range=8, Blindspot=0.5, Height=6, Type="Short", Radar="2S38" },
|
||||||
["PantsirS1 CH"] = { Range=20, Blindspot=1.2, Height=15, Type="Short", Radar="PantsirS1" },
|
["PantsirS1 CHM"] = { Range=20, Blindspot=1.2, Height=15, Type="Short", Radar="PantsirS1" },
|
||||||
["PantsirS2 CH"] = { Range=30, Blindspot=1.2, Height=18, Type="Medium", Radar="PantsirS2" },
|
["PantsirS2 CHM"] = { Range=30, Blindspot=1.2, Height=18, Type="Medium", Radar="PantsirS2" },
|
||||||
["PGL-625 CH"] = { Range=10, Blindspot=0.5, Height=5, Type="Short", Radar="PGL_625" },
|
["PGL-625 CHM"] = { Range=10, Blindspot=0.5, Height=5, Type="Short", Radar="PGL_625" },
|
||||||
["HQ-17A CH"] = { Range=20, Blindspot=1.5, Height=10, Type="Short", Radar="HQ17A" },
|
["HQ-17A CHM"] = { Range=20, Blindspot=1.5, Height=10, Type="Short", Radar="HQ17A" },
|
||||||
["M903PAC2 CH"] = { Range=160, Blindspot=3, Height=24.5, Type="Long", Radar="MIM104_M903_PAC2" },
|
["M903PAC2 CHM"] = { Range=160, Blindspot=3, Height=24.5, Type="Long", Radar="MIM104_M903_PAC2" },
|
||||||
["M903PAC3 CH"] = { Range=120, Blindspot=1, Height=40, Type="Long", Radar="MIM104_M903_PAC3" },
|
["M903PAC3 CHM"] = { Range=120, Blindspot=1, Height=40, Type="Long", Radar="MIM104_M903_PAC3" },
|
||||||
["TorM2 CH"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2" },
|
["TorM2 CHM"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2" },
|
||||||
["TorM2K CH"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2K" },
|
["TorM2K CHM"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2K" },
|
||||||
["TorM2M CH"] = { Range=16, Blindspot=1, Height=10, Type="Short", Radar="TorM2M" },
|
["TorM2M CHM"] = { Range=16, Blindspot=1, Height=10, Type="Short", Radar="TorM2M" },
|
||||||
["NASAMS3-AMRAAMER CH"] = { Range=50, Blindspot=2, Height=35.7, Type="Medium", Radar="CH_NASAMS3_LN_AMRAAM_ER" },
|
["NASAMS3-AMRAAMER CHM"] = { Range=50, Blindspot=2, Height=35.7, Type="Medium", Radar="CH_NASAMS3_LN_AMRAAM_ER" },
|
||||||
["NASAMS3-AIM9X2 CH"] = { Range=20, Blindspot=0.2, Height=18, Type="Short", Radar="CH_NASAMS3_LN_AIM9X2" },
|
["NASAMS3-AIM9X2 CHM"] = { Range=20, Blindspot=0.2, Height=18, Type="Short", Radar="CH_NASAMS3_LN_AIM9X2" },
|
||||||
["C-RAM CH"] = { Range=2, Blindspot=0, Height=2, Type="Short", Radar="CH_Centurion_C_RAM" },
|
["C-RAM CHM"] = { Range=2, Blindspot=0, Height=2, Type="Point", Radar="CH_Centurion_C_RAM", Point="true" },
|
||||||
["PGZ-09 CH"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="CH_PGZ09" },
|
["PGZ-09 CHM"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="CH_PGZ09", Point="true" },
|
||||||
["S350-9M100 CH"] = { Range=15, Blindspot=1.5, Height=8, Type="Short", Radar="CH_S350_50P6_9M100" },
|
["S350-9M100 CHM"] = { Range=15, Blindspot=1.5, Height=8, Type="Short", Radar="CH_S350_50P6_9M100" },
|
||||||
["S350-9M96D CH"] = { Range=150, Blindspot=2.5, Height=30, Type="Long", Radar="CH_S350_50P6_9M96D" },
|
["S350-9M96D CHM"] = { Range=150, Blindspot=2.5, Height=30, Type="Long", Radar="CH_S350_50P6_9M96D" },
|
||||||
["LAV-AD CH"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_LAVAD" },
|
["LAV-AD CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_LAVAD" },
|
||||||
["HQ-22 CH"] = { Range=170, Blindspot=5, Height=27, Type="Long", Radar="CH_HQ22_LN" },
|
["HQ-22 CHM"] = { Range=170, Blindspot=5, Height=27, Type="Long", Radar="CH_HQ22_LN" },
|
||||||
|
["PGZ-95 CHM"] = { Range=2, Blindspot=0, Height=2, Type="Point", Radar="CH_PGZ95",Point="true" },
|
||||||
|
["LD-3000 CHM"] = { Range=3, Blindspot=0, Height=3, Type="Point", Radar="CH_LD3000_stationary", Point="true" },
|
||||||
|
["LD-3000M CHM"] = { Range=3, Blindspot=0, Height=3, Type="Point", Radar="CH_LD3000", Point="true" },
|
||||||
|
["FlaRakRad CHM"] = { Range=8, Blindspot=1.5, Height=6, Type="Short", Radar="HQ17A" },
|
||||||
|
["IRIS-T SLM CHM"] = { Range=40, Blindspot=0.5, Height=20, Type="Medium", Radar="CH_IRIST_SLM" },
|
||||||
|
["M903PAC2KAT1 CHM"] = { Range=160, Blindspot=3, Height=24.5, Type="Long", Radar="CH_MIM104_M903_PAC2_KAT1" },
|
||||||
|
["Skynex CHM"] = { Range=3.5, Blindspot=0, Height=3.5, Type="Point", Radar="CH_SkynexHX", Point="true" },
|
||||||
|
["Skyshield CHM"] = { Range=3.5, Blindspot=0, Height=3.5, Type="Point", Radar="CH_Skyshield_Gun", Point="true" },
|
||||||
|
["WieselOzelot CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_Wiesel2Ozelot" },
|
||||||
|
["BukM3-9M317M CHM"] = { Range=70, Blindspot=0.25, Height=35, Type="Medium", Radar="CH_BukM3_9A317M" },
|
||||||
|
["BukM3-9M317MA CHM"] = { Range=70, Blindspot=0.25, Height=35, Type="Medium", Radar="CH_BukM3_9A317MA" },
|
||||||
|
["SkySabre CHM"] = { Range=30, Blindspot=0.5, Height=10, Type="Medium", Radar="CH_SkySabreLN" },
|
||||||
|
["Stormer CHM"] = { Range=7.5, Blindspot=0.3, Height=7, Type="Short", Radar="CH_StormerHVM" },
|
||||||
|
["THAAD CHM"] = { Range=200, Blindspot=40, Height=150, Type="Long", Radar="CH_THAAD_M1120" },
|
||||||
|
["USInfantryFIM92K CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_USInfantry_FIM92" },
|
||||||
|
["RBS98M CHM"] = { Range=20, Blindspot=0, Height=8, Type="Short", Radar="RBS-98" },
|
||||||
|
["RBS70 CHM"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-70" },
|
||||||
|
["RBS90 CHM"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-90" },
|
||||||
|
["RBS103A CHM"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_Rb103A" },
|
||||||
|
["RBS103B CHM"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_Rb103B" },
|
||||||
|
["RBS103AM CHM"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||||
|
["RBS103BM CHM"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||||
|
["Lvkv9040M CHM"] = { Range=4, Blindspot=0, Height=2.5, Type="Point", Radar="LvKv9040", Point="true" },
|
||||||
}
|
}
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
@@ -502,7 +552,8 @@ do
|
|||||||
-- DONE: Treat Awacs separately, since they might be >80km off site
|
-- DONE: Treat Awacs separately, since they might be >80km off site
|
||||||
-- DONE: Allow tables of prefixes for the setup
|
-- DONE: Allow tables of prefixes for the setup
|
||||||
-- DONE: Auto-Mode with range setups for various known SAM types.
|
-- DONE: Auto-Mode with range setups for various known SAM types.
|
||||||
|
|
||||||
|
self.name = name or "mymantis"
|
||||||
self.SAM_Templates_Prefix = samprefix or "Red SAM"
|
self.SAM_Templates_Prefix = samprefix or "Red SAM"
|
||||||
self.EWR_Templates_Prefix = ewrprefix or "Red EWR"
|
self.EWR_Templates_Prefix = ewrprefix or "Red EWR"
|
||||||
self.HQ_Template_CC = hq or nil
|
self.HQ_Template_CC = hq or nil
|
||||||
@@ -511,6 +562,7 @@ do
|
|||||||
self.SAM_Table_Long = {}
|
self.SAM_Table_Long = {}
|
||||||
self.SAM_Table_Medium = {}
|
self.SAM_Table_Medium = {}
|
||||||
self.SAM_Table_Short = {}
|
self.SAM_Table_Short = {}
|
||||||
|
self.SAM_Table_PointDef = {}
|
||||||
self.dynamic = dynamic or false
|
self.dynamic = dynamic or false
|
||||||
self.checkradius = 25000
|
self.checkradius = 25000
|
||||||
self.grouping = 5000
|
self.grouping = 5000
|
||||||
@@ -539,10 +591,6 @@ do
|
|||||||
self.SuppressedGroups = {}
|
self.SuppressedGroups = {}
|
||||||
-- 0.8 additions
|
-- 0.8 additions
|
||||||
self.automode = true
|
self.automode = true
|
||||||
self.radiusscale = {}
|
|
||||||
self.radiusscale[MANTIS.SamType.LONG] = 1.1
|
|
||||||
self.radiusscale[MANTIS.SamType.MEDIUM] = 1.2
|
|
||||||
self.radiusscale[MANTIS.SamType.SHORT] = 1.3
|
|
||||||
--self.SAMCheckRanges = {}
|
--self.SAMCheckRanges = {}
|
||||||
self.usezones = false
|
self.usezones = false
|
||||||
self.AcceptZones = {}
|
self.AcceptZones = {}
|
||||||
@@ -551,6 +599,7 @@ do
|
|||||||
self.maxlongrange = 1
|
self.maxlongrange = 1
|
||||||
self.maxmidrange = 2
|
self.maxmidrange = 2
|
||||||
self.maxshortrange = 2
|
self.maxshortrange = 2
|
||||||
|
self.maxpointdefrange = 6
|
||||||
self.maxclassic = 6
|
self.maxclassic = 6
|
||||||
self.autoshorad = true
|
self.autoshorad = true
|
||||||
self.ShoradGroupSet = SET_GROUP:New() -- Core.Set#SET_GROUP
|
self.ShoradGroupSet = SET_GROUP:New() -- Core.Set#SET_GROUP
|
||||||
@@ -558,7 +607,10 @@ do
|
|||||||
|
|
||||||
self.SkateZones = nil
|
self.SkateZones = nil
|
||||||
self.SkateNumber = 3
|
self.SkateNumber = 3
|
||||||
self.shootandscoot = false
|
self.shootandscoot = false
|
||||||
|
|
||||||
|
self.SmokeDecoy = false
|
||||||
|
self.SmokeDecoyColor = SMOKECOLOR.White
|
||||||
|
|
||||||
self.UseEmOnOff = true
|
self.UseEmOnOff = true
|
||||||
if EmOnOff == false then
|
if EmOnOff == false then
|
||||||
@@ -570,6 +622,7 @@ do
|
|||||||
else
|
else
|
||||||
self.advAwacs = false
|
self.advAwacs = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Set the string id for output to DCS.log file.
|
-- Set the string id for output to DCS.log file.
|
||||||
self.lid=string.format("MANTIS %s | ", self.name)
|
self.lid=string.format("MANTIS %s | ", self.name)
|
||||||
@@ -629,9 +682,12 @@ do
|
|||||||
self.HQ_CC = GROUP:FindByName(self.HQ_Template_CC)
|
self.HQ_CC = GROUP:FindByName(self.HQ_Template_CC)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- counter for SAM table updates
|
||||||
|
self.checkcounter = 1
|
||||||
|
|
||||||
-- TODO Version
|
-- TODO Version
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
self.version="0.8.16"
|
self.version="0.9.27"
|
||||||
self:I(string.format("***** Starting MANTIS Version %s *****", self.version))
|
self:I(string.format("***** Starting MANTIS Version %s *****", self.version))
|
||||||
|
|
||||||
--- FSM Functions ---
|
--- FSM Functions ---
|
||||||
@@ -828,7 +884,7 @@ do
|
|||||||
self.AcceptZones = AcceptZones or {}
|
self.AcceptZones = AcceptZones or {}
|
||||||
self.RejectZones = RejectZones or {}
|
self.RejectZones = RejectZones or {}
|
||||||
self.ConflictZones = ConflictZones or {}
|
self.ConflictZones = ConflictZones or {}
|
||||||
if #AcceptZones > 0 or #RejectZones > 0 or #ConflictZones > 0 then
|
if #self.AcceptZones > 0 or #self.RejectZones > 0 or #self.ConflictZones > 0 then
|
||||||
self.usezones = true
|
self.usezones = true
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
@@ -867,19 +923,31 @@ do
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Function to set Short Range SAMs to spit out smoke as decoy, if an enemy plane is in range.
|
||||||
|
-- @param #MANTIS self
|
||||||
|
-- @param #boolean Onoff Set to true for on and nil/false for off.
|
||||||
|
-- @param #number Color (Optional) Color to use, defaults to `SMOKECOLOR.White`
|
||||||
|
function MANTIS:SetSmokeDecoy(Onoff,Color)
|
||||||
|
self.SmokeDecoy = Onoff
|
||||||
|
self.SmokeDecoyColor = Color or SMOKECOLOR.White
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Function to set number of SAMs going active on a valid, detected thread
|
--- Function to set number of SAMs going active on a valid, detected thread
|
||||||
-- @param #MANTIS self
|
-- @param #MANTIS self
|
||||||
-- @param #number Short Number of short-range systems activated, defaults to 1.
|
-- @param #number Short Number of short-range systems activated, defaults to 1.
|
||||||
-- @param #number Mid Number of mid-range systems activated, defaults to 2.
|
-- @param #number Mid Number of mid-range systems activated, defaults to 2.
|
||||||
-- @param #number Long Number of long-range systems activated, defaults to 2.
|
-- @param #number Long Number of long-range systems activated, defaults to 2.
|
||||||
-- @param #number Classic (non-automode) Number of overall systems activated, defaults to 6.
|
-- @param #number Classic (non-automode) Number of overall systems activated, defaults to 6.
|
||||||
|
-- @param #number Point Number of point defense and AAA systems activated, defaults to 6.
|
||||||
-- @return #MANTIS self
|
-- @return #MANTIS self
|
||||||
function MANTIS:SetMaxActiveSAMs(Short,Mid,Long,Classic)
|
function MANTIS:SetMaxActiveSAMs(Short,Mid,Long,Classic,Point)
|
||||||
self:T(self.lid .. "SetMaxActiveSAMs")
|
self:T(self.lid .. "SetMaxActiveSAMs")
|
||||||
self.maxclassic = Classic or 6
|
self.maxclassic = Classic or 6
|
||||||
self.maxlongrange = Long or 1
|
self.maxlongrange = Long or 1
|
||||||
self.maxmidrange = Mid or 2
|
self.maxmidrange = Mid or 2
|
||||||
self.maxshortrange = Short or 2
|
self.maxshortrange = Short or 2
|
||||||
|
self.maxpointdefrange= Point or 6
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1081,6 +1149,24 @@ do
|
|||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [Internal] Check if any EWR or AWACS is still alive
|
||||||
|
-- @param #MANTIS self
|
||||||
|
-- @return #boolean outcome
|
||||||
|
function MANTIS:_CheckAnyEWRAlive()
|
||||||
|
self:T(self.lid .. "_CheckAnyEWRAlive")
|
||||||
|
local alive = false
|
||||||
|
if self.EWR_Group:CountAlive() > 0 then
|
||||||
|
alive = true
|
||||||
|
end
|
||||||
|
if not alive and self.AWACS_Prefix then
|
||||||
|
local awacs = GROUP:FindByName(self.AWACS_Prefix)
|
||||||
|
if awacs and awacs:IsAlive() then
|
||||||
|
alive = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return alive
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Function to determine state of the advanced mode
|
--- [Internal] Function to determine state of the advanced mode
|
||||||
-- @param #MANTIS self
|
-- @param #MANTIS self
|
||||||
@@ -1255,6 +1341,10 @@ do
|
|||||||
-- DEBUG
|
-- DEBUG
|
||||||
set = self:_PreFilterHeight(height)
|
set = self:_PreFilterHeight(height)
|
||||||
end
|
end
|
||||||
|
--self.friendlyset -- Core.Set#SET_GROUP
|
||||||
|
if self.checkforfriendlies == true and self.friendlyset == nil then
|
||||||
|
self.friendlyset = SET_GROUP:New():FilterCoalitions(self.Coalition):FilterCategories({"plane","helicopter"}):FilterFunction(function(grp) if grp and grp:InAir() then return true else return false end end):FilterStart()
|
||||||
|
end
|
||||||
for _,_coord in pairs (set) do
|
for _,_coord in pairs (set) do
|
||||||
local coord = _coord -- get current coord to check
|
local coord = _coord -- get current coord to check
|
||||||
-- output for cross-check
|
-- output for cross-check
|
||||||
@@ -1269,18 +1359,27 @@ do
|
|||||||
zonecheck = self:_CheckCoordinateInZones(coord)
|
zonecheck = self:_CheckCoordinateInZones(coord)
|
||||||
end
|
end
|
||||||
if self.verbose and self.debug then
|
if self.verbose and self.debug then
|
||||||
local dectstring = coord:ToStringLLDMS()
|
--local dectstring = coord:ToStringLLDMS()
|
||||||
local samstring = samcoordinate:ToStringLLDMS()
|
local samstring = samcoordinate:ToStringMGRS({MGRS_Accuracy=0})
|
||||||
|
samstring = string.gsub(samstring,"%s","")
|
||||||
local inrange = "false"
|
local inrange = "false"
|
||||||
if targetdistance <= rad then
|
if targetdistance <= rad then
|
||||||
inrange = "true"
|
inrange = "true"
|
||||||
end
|
end
|
||||||
local text = string.format("Checking SAM at %s | Targetdist %d | Rad %d | Inrange %s", samstring, targetdistance, rad, inrange)
|
local text = string.format("Checking SAM at %s | Tgtdist %.1fkm | Rad %.1fkm | Inrange %s", samstring, targetdistance/1000, rad/1000, inrange)
|
||||||
local m = MESSAGE:New(text,10,"Check"):ToAllIf(self.debug)
|
local m = MESSAGE:New(text,10,"Check"):ToAllIf(self.debug)
|
||||||
self:T(self.lid..text)
|
self:T(self.lid..text)
|
||||||
end
|
end
|
||||||
|
-- friendlies around?
|
||||||
|
local nofriendlies = true
|
||||||
|
if self.checkforfriendlies == true then
|
||||||
|
local closestfriend, distance = self.friendlyset:GetClosestGroup(samcoordinate)
|
||||||
|
if closestfriend and distance and distance < rad then
|
||||||
|
nofriendlies = false
|
||||||
|
end
|
||||||
|
end
|
||||||
-- end output to cross-check
|
-- end output to cross-check
|
||||||
if targetdistance <= rad and zonecheck then
|
if targetdistance <= rad and zonecheck == true and nofriendlies == true then
|
||||||
return true, targetdistance
|
return true, targetdistance
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1375,7 +1474,7 @@ do
|
|||||||
-- @return #string type Long, medium or short range
|
-- @return #string type Long, medium or short range
|
||||||
-- @return #number blind "blind" spot
|
-- @return #number blind "blind" spot
|
||||||
function MANTIS:_GetSAMDataFromUnits(grpname,mod,sma,chm)
|
function MANTIS:_GetSAMDataFromUnits(grpname,mod,sma,chm)
|
||||||
self:T(self.lid.."_GetSAMRangeFromUnits")
|
self:T(self.lid.."_GetSAMDataFromUnits")
|
||||||
local found = false
|
local found = false
|
||||||
local range = self.checkradius
|
local range = self.checkradius
|
||||||
local height = 3000
|
local height = 3000
|
||||||
@@ -1414,6 +1513,17 @@ do
|
|||||||
end
|
end
|
||||||
if found then break end
|
if found then break end
|
||||||
end
|
end
|
||||||
|
--- AAA or Point Defense
|
||||||
|
if not found then
|
||||||
|
local grp = GROUP:FindByName(grpname)
|
||||||
|
if (grp and grp:IsAlive() and grp:IsAAA()) or string.find(grpname,"AAA",1,true) then
|
||||||
|
range = 2000
|
||||||
|
height = 2000
|
||||||
|
blind = 50
|
||||||
|
type = MANTIS.SamType.POINT
|
||||||
|
found = true
|
||||||
|
end
|
||||||
|
end
|
||||||
if not found then
|
if not found then
|
||||||
self:E(self.lid .. string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname))
|
self:E(self.lid .. string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname))
|
||||||
end
|
end
|
||||||
@@ -1428,7 +1538,7 @@ do
|
|||||||
-- @return #string type Long, medium or short range
|
-- @return #string type Long, medium or short range
|
||||||
-- @return #number blind "blind" spot
|
-- @return #number blind "blind" spot
|
||||||
function MANTIS:_GetSAMRange(grpname)
|
function MANTIS:_GetSAMRange(grpname)
|
||||||
self:T(self.lid.."_GetSAMRange")
|
self:T(self.lid.."_GetSAMRange for "..tostring(grpname))
|
||||||
local range = self.checkradius
|
local range = self.checkradius
|
||||||
local height = 3000
|
local height = 3000
|
||||||
local type = MANTIS.SamType.MEDIUM
|
local type = MANTIS.SamType.MEDIUM
|
||||||
@@ -1445,9 +1555,9 @@ do
|
|||||||
elseif string.find(grpname,"CHM",1,true) then
|
elseif string.find(grpname,"CHM",1,true) then
|
||||||
CHMod = true
|
CHMod = true
|
||||||
end
|
end
|
||||||
if self.automode then
|
--if self.automode then
|
||||||
for idx,entry in pairs(self.SamData) do
|
for idx,entry in pairs(self.SamData) do
|
||||||
--self:I("ID = " .. idx)
|
self:T2("ID = " .. idx)
|
||||||
if string.find(grpname,idx,1,true) then
|
if string.find(grpname,idx,1,true) then
|
||||||
local _entry = entry -- #MANTIS.SamData
|
local _entry = entry -- #MANTIS.SamData
|
||||||
type = _entry.Type
|
type = _entry.Type
|
||||||
@@ -1455,18 +1565,32 @@ do
|
|||||||
range = _entry.Range * 1000 * radiusscale -- max firing range
|
range = _entry.Range * 1000 * radiusscale -- max firing range
|
||||||
height = _entry.Height * 1000 -- max firing height
|
height = _entry.Height * 1000 -- max firing height
|
||||||
blind = _entry.Blindspot
|
blind = _entry.Blindspot
|
||||||
--self:I("Matching Groupname = " .. grpname .. " Range= " .. range)
|
self:T("Matching Groupname = " .. grpname .. " Range= " .. range)
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--end
|
||||||
|
--- Secondary - AAA or Point Defense
|
||||||
|
if not found then
|
||||||
|
local grp = GROUP:FindByName(grpname)
|
||||||
|
if (grp and grp:IsAlive() and grp:IsAAA()) or string.find(grpname,"AAA",1,true) then
|
||||||
|
range = 2000
|
||||||
|
height = 2000
|
||||||
|
blind = 50
|
||||||
|
type = MANTIS.SamType.POINT
|
||||||
|
found = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- secondary filter if not found
|
--- Tertiary filter if not found
|
||||||
if (not found and self.automode) or HDSmod or SMAMod or CHMod then
|
if (not found) or HDSmod or SMAMod or CHMod then
|
||||||
range, height, type = self:_GetSAMDataFromUnits(grpname,HDSmod,SMAMod,CHMod)
|
range, height, type = self:_GetSAMDataFromUnits(grpname,HDSmod,SMAMod,CHMod)
|
||||||
elseif not found then
|
elseif not found then
|
||||||
self:E(self.lid .. string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname))
|
self:E(self.lid .. string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname))
|
||||||
end
|
end
|
||||||
|
if found and string.find(grpname,"SHORAD",1,true) then
|
||||||
|
type = MANTIS.SamType.POINT -- force short on match
|
||||||
|
end
|
||||||
return range, height, type, blind
|
return range, height, type, blind
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1484,6 +1608,7 @@ do
|
|||||||
local SAM_Tbl_lg = {} -- table of long range SAM defense zones
|
local SAM_Tbl_lg = {} -- table of long range SAM defense zones
|
||||||
local SAM_Tbl_md = {} -- table of mid range SAM defense zones
|
local SAM_Tbl_md = {} -- table of mid range SAM defense zones
|
||||||
local SAM_Tbl_sh = {} -- table of short range SAM defense zones
|
local SAM_Tbl_sh = {} -- table of short range SAM defense zones
|
||||||
|
local SAM_Tbl_pt = {} -- table of point defense/AAA
|
||||||
local SEAD_Grps = {} -- table of SAM names to make evasive
|
local SEAD_Grps = {} -- table of SAM names to make evasive
|
||||||
local engagerange = self.engagerange -- firing range in % of max
|
local engagerange = self.engagerange -- firing range in % of max
|
||||||
--cycle through groups and set alarm state etc
|
--cycle through groups and set alarm state etc
|
||||||
@@ -1502,23 +1627,27 @@ do
|
|||||||
local grpname = group:GetName()
|
local grpname = group:GetName()
|
||||||
local grpcoord = group:GetCoordinate()
|
local grpcoord = group:GetCoordinate()
|
||||||
local grprange,grpheight,type,blind = self:_GetSAMRange(grpname)
|
local grprange,grpheight,type,blind = self:_GetSAMRange(grpname)
|
||||||
table.insert( SAM_Tbl, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
--table.insert( SEAD_Grps, grpname )
|
--table.insert( SEAD_Grps, grpname )
|
||||||
if type == MANTIS.SamType.LONG then
|
if type == MANTIS.SamType.LONG then
|
||||||
table.insert( SAM_Tbl_lg, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_lg, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
table.insert( SEAD_Grps, grpname )
|
table.insert( SEAD_Grps, grpname )
|
||||||
--self:T("SAM "..grpname.." is type LONG")
|
self:T("SAM "..grpname.." is type LONG")
|
||||||
elseif type == MANTIS.SamType.MEDIUM then
|
elseif type == MANTIS.SamType.MEDIUM then
|
||||||
table.insert( SAM_Tbl_md, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_md, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
table.insert( SEAD_Grps, grpname )
|
table.insert( SEAD_Grps, grpname )
|
||||||
--self:T("SAM "..grpname.." is type MEDIUM")
|
self:T("SAM "..grpname.." is type MEDIUM")
|
||||||
elseif type == MANTIS.SamType.SHORT then
|
elseif type == MANTIS.SamType.SHORT then
|
||||||
table.insert( SAM_Tbl_sh, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_sh, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
--self:T("SAM "..grpname.." is type SHORT")
|
table.insert( SEAD_Grps, grpname )
|
||||||
|
self:T("SAM "..grpname.." is type SHORT")
|
||||||
|
elseif type == MANTIS.SamType.POINT then
|
||||||
|
table.insert( SAM_Tbl_pt, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
|
self:T("SAM "..grpname.." is type POINT")
|
||||||
self.ShoradGroupSet:Add(grpname,group)
|
self.ShoradGroupSet:Add(grpname,group)
|
||||||
if not self.autoshorad then
|
if not self.autoshorad then
|
||||||
table.insert( SEAD_Grps, grpname )
|
table.insert( SEAD_Grps, grpname )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.SamStateTracker[grpname] = "GREEN"
|
self.SamStateTracker[grpname] = "GREEN"
|
||||||
end
|
end
|
||||||
@@ -1527,6 +1656,7 @@ do
|
|||||||
self.SAM_Table_Long = SAM_Tbl_lg
|
self.SAM_Table_Long = SAM_Tbl_lg
|
||||||
self.SAM_Table_Medium = SAM_Tbl_md
|
self.SAM_Table_Medium = SAM_Tbl_md
|
||||||
self.SAM_Table_Short = SAM_Tbl_sh
|
self.SAM_Table_Short = SAM_Tbl_sh
|
||||||
|
self.SAM_Table_PointDef = SAM_Tbl_pt
|
||||||
-- make SAMs evasive
|
-- make SAMs evasive
|
||||||
local mysead = SEAD:New( SEAD_Grps, self.Padding ) -- Functional.Sead#SEAD
|
local mysead = SEAD:New( SEAD_Grps, self.Padding ) -- Functional.Sead#SEAD
|
||||||
mysead:SetEngagementRange(engagerange)
|
mysead:SetEngagementRange(engagerange)
|
||||||
@@ -1550,7 +1680,8 @@ do
|
|||||||
local SAM_Tbl = {} -- table of SAM defense zones
|
local SAM_Tbl = {} -- table of SAM defense zones
|
||||||
local SAM_Tbl_lg = {} -- table of long range SAM defense zones
|
local SAM_Tbl_lg = {} -- table of long range SAM defense zones
|
||||||
local SAM_Tbl_md = {} -- table of mid range SAM defense zones
|
local SAM_Tbl_md = {} -- table of mid range SAM defense zones
|
||||||
local SAM_Tbl_sh = {} -- table of short range SAM defense zon
|
local SAM_Tbl_sh = {} -- table of short range SAM defense zones
|
||||||
|
local SAM_Tbl_pt = {} -- table of point defense/AAA
|
||||||
local SEAD_Grps = {} -- table of SAM names to make evasive
|
local SEAD_Grps = {} -- table of SAM names to make evasive
|
||||||
local engagerange = self.engagerange -- firing range in % of max
|
local engagerange = self.engagerange -- firing range in % of max
|
||||||
--cycle through groups and set alarm state etc
|
--cycle through groups and set alarm state etc
|
||||||
@@ -1561,17 +1692,21 @@ do
|
|||||||
local grpname = group:GetName()
|
local grpname = group:GetName()
|
||||||
local grpcoord = group:GetCoordinate()
|
local grpcoord = group:GetCoordinate()
|
||||||
local grprange, grpheight,type,blind = self:_GetSAMRange(grpname)
|
local grprange, grpheight,type,blind = self:_GetSAMRange(grpname)
|
||||||
table.insert( SAM_Tbl, {grpname, grpcoord, grprange, grpheight, blind}) -- make the table lighter, as I don't really use the zone here
|
local radaralive = group:IsSAM()
|
||||||
|
table.insert( SAM_Tbl, {grpname, grpcoord, grprange, grpheight, blind, type}) -- make the table lighter, as I don't really use the zone here
|
||||||
table.insert( SEAD_Grps, grpname )
|
table.insert( SEAD_Grps, grpname )
|
||||||
if type == MANTIS.SamType.LONG then
|
if type == MANTIS.SamType.LONG and radaralive then
|
||||||
table.insert( SAM_Tbl_lg, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_lg, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
--self:I({grpname,grprange, grpheight})
|
self:T({grpname,grprange, grpheight})
|
||||||
elseif type == MANTIS.SamType.MEDIUM then
|
elseif type == MANTIS.SamType.MEDIUM and radaralive then
|
||||||
table.insert( SAM_Tbl_md, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_md, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
--self:I({grpname,grprange, grpheight})
|
self:T({grpname,grprange, grpheight})
|
||||||
elseif type == MANTIS.SamType.SHORT then
|
elseif type == MANTIS.SamType.SHORT and radaralive then
|
||||||
table.insert( SAM_Tbl_sh, {grpname, grpcoord, grprange, grpheight, blind})
|
table.insert( SAM_Tbl_sh, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
-- self:I({grpname,grprange, grpheight})
|
self:T({grpname,grprange, grpheight})
|
||||||
|
elseif type == MANTIS.SamType.POINT or (not radaralive) then
|
||||||
|
table.insert( SAM_Tbl_pt, {grpname, grpcoord, grprange, grpheight, blind, type})
|
||||||
|
self:T({grpname,grprange, grpheight})
|
||||||
self.ShoradGroupSet:Add(grpname,group)
|
self.ShoradGroupSet:Add(grpname,group)
|
||||||
if self.autoshorad then
|
if self.autoshorad then
|
||||||
self.Shorad.Groupset = self.ShoradGroupSet
|
self.Shorad.Groupset = self.ShoradGroupSet
|
||||||
@@ -1583,6 +1718,7 @@ do
|
|||||||
self.SAM_Table_Long = SAM_Tbl_lg
|
self.SAM_Table_Long = SAM_Tbl_lg
|
||||||
self.SAM_Table_Medium = SAM_Tbl_md
|
self.SAM_Table_Medium = SAM_Tbl_md
|
||||||
self.SAM_Table_Short = SAM_Tbl_sh
|
self.SAM_Table_Short = SAM_Tbl_sh
|
||||||
|
self.SAM_Table_PointDef = SAM_Tbl_pt
|
||||||
-- make SAMs evasive
|
-- make SAMs evasive
|
||||||
if self.mysead ~= nil then
|
if self.mysead ~= nil then
|
||||||
local mysead = self.mysead
|
local mysead = self.mysead
|
||||||
@@ -1626,20 +1762,33 @@ do
|
|||||||
-- @param #table detset Table of COORDINATES
|
-- @param #table detset Table of COORDINATES
|
||||||
-- @param #boolean dlink Using DLINK
|
-- @param #boolean dlink Using DLINK
|
||||||
-- @param #number limit of SAM sites to go active on a contact
|
-- @param #number limit of SAM sites to go active on a contact
|
||||||
-- @return #MANTIS self
|
-- @return #number instatusred
|
||||||
|
-- @return #number instatusgreen
|
||||||
|
-- @return #number activeshorads
|
||||||
function MANTIS:_CheckLoop(samset,detset,dlink,limit)
|
function MANTIS:_CheckLoop(samset,detset,dlink,limit)
|
||||||
self:T(self.lid .. "CheckLoop " .. #detset .. " Coordinates")
|
self:T(self.lid .. "CheckLoop " .. #detset .. " Coordinates")
|
||||||
local switchedon = 0
|
local switchedon = 0
|
||||||
|
local instatusred = 0
|
||||||
|
local instatusgreen = 0
|
||||||
|
local activeshorads = 0
|
||||||
|
local SEADactive = 0
|
||||||
for _,_data in pairs (samset) do
|
for _,_data in pairs (samset) do
|
||||||
local samcoordinate = _data[2]
|
local samcoordinate = _data[2]
|
||||||
local name = _data[1]
|
local name = _data[1]
|
||||||
local radius = _data[3]
|
local radius = _data[3]
|
||||||
local height = _data[4]
|
local height = _data[4]
|
||||||
local blind = _data[5] * 1.25 + 1
|
local blind = _data[5] * 1.25 + 1
|
||||||
|
local shortsam = (_data[6] == MANTIS.SamType.SHORT) and true or false
|
||||||
|
if not shortsam then
|
||||||
|
shortsam = (_data[6] == MANTIS.SamType.POINT) and true or false
|
||||||
|
end
|
||||||
local samgroup = GROUP:FindByName(name)
|
local samgroup = GROUP:FindByName(name)
|
||||||
local IsInZone, Distance = self:_CheckObjectInZone(detset, samcoordinate, radius, height, dlink)
|
local IsInZone, Distance = self:_CheckObjectInZone(detset, samcoordinate, radius, height, dlink)
|
||||||
local suppressed = self.SuppressedGroups[name] or false
|
local suppressed = self.SuppressedGroups[name] or false
|
||||||
local activeshorad = self.Shorad.ActiveGroups[name] or false
|
local activeshorad = false
|
||||||
|
if self.Shorad and self.Shorad.ActiveGroups and self.Shorad.ActiveGroups[name] then
|
||||||
|
activeshorad = true
|
||||||
|
end
|
||||||
if IsInZone and not suppressed and not activeshorad then --check any target in zone and not currently managed by SEAD
|
if IsInZone and not suppressed and not activeshorad then --check any target in zone and not currently managed by SEAD
|
||||||
if samgroup:IsAlive() then
|
if samgroup:IsAlive() then
|
||||||
-- switch on SAM
|
-- switch on SAM
|
||||||
@@ -1652,12 +1801,23 @@ do
|
|||||||
elseif (not self.UseEmOnOff) and switchedon < limit then
|
elseif (not self.UseEmOnOff) and switchedon < limit then
|
||||||
samgroup:OptionAlarmStateRed()
|
samgroup:OptionAlarmStateRed()
|
||||||
switchedon = switchedon + 1
|
switchedon = switchedon + 1
|
||||||
switch = true
|
switch = true
|
||||||
end
|
end
|
||||||
if self.SamStateTracker[name] ~= "RED" and switch then
|
if self.SamStateTracker[name] ~= "RED" and switch then
|
||||||
self:__RedState(1,samgroup)
|
self:__RedState(1,samgroup)
|
||||||
self.SamStateTracker[name] = "RED"
|
self.SamStateTracker[name] = "RED"
|
||||||
end
|
end
|
||||||
|
-- TODO doesn't work
|
||||||
|
if shortsam == true and self.SmokeDecoy == true then
|
||||||
|
self:T("Smoking")
|
||||||
|
local units = samgroup:GetUnits() or {}
|
||||||
|
local smoke = self.SmokeDecoyColor or SMOKECOLOR.White
|
||||||
|
for _,unit in pairs(units) do
|
||||||
|
if unit and unit:IsAlive() then
|
||||||
|
unit:GetCoordinate():Smoke(smoke)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-- link in to SHORAD if available
|
-- link in to SHORAD if available
|
||||||
-- DONE: Test integration fully
|
-- DONE: Test integration fully
|
||||||
if self.ShoradLink and (Distance < self.ShoradActDistance or Distance < blind ) then -- don't give SHORAD position away too early
|
if self.ShoradLink and (Distance < self.ShoradActDistance or Distance < blind ) then -- don't give SHORAD position away too early
|
||||||
@@ -1670,7 +1830,7 @@ do
|
|||||||
-- debug output
|
-- debug output
|
||||||
if (self.debug or self.verbose) and switch then
|
if (self.debug or self.verbose) and switch then
|
||||||
local text = string.format("SAM %s in alarm state RED!", name)
|
local text = string.format("SAM %s in alarm state RED!", name)
|
||||||
local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug)
|
--local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug
|
||||||
if self.verbose then self:I(self.lid..text) end
|
if self.verbose then self:I(self.lid..text) end
|
||||||
end
|
end
|
||||||
end --end alive
|
end --end alive
|
||||||
@@ -1688,13 +1848,27 @@ do
|
|||||||
end
|
end
|
||||||
if self.debug or self.verbose then
|
if self.debug or self.verbose then
|
||||||
local text = string.format("SAM %s in alarm state GREEN!", name)
|
local text = string.format("SAM %s in alarm state GREEN!", name)
|
||||||
local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug)
|
--local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug)
|
||||||
if self.verbose then self:I(self.lid..text) end
|
if self.verbose then self:I(self.lid..text) end
|
||||||
end
|
end
|
||||||
end --end alive
|
end --end alive
|
||||||
end --end check
|
end --end check
|
||||||
end --for for loop
|
end --for loop
|
||||||
return self
|
if self.debug or self.verbose then
|
||||||
|
for _,_status in pairs(self.SamStateTracker) do
|
||||||
|
if _status == "GREEN" then
|
||||||
|
instatusgreen=instatusgreen+1
|
||||||
|
elseif _status == "RED" then
|
||||||
|
instatusred=instatusred+1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if self.Shorad then
|
||||||
|
for _,_name in pairs(self.Shorad.ActiveGroups or {}) do
|
||||||
|
activeshorads=activeshorads+1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return instatusred, instatusgreen, activeshorads
|
||||||
end
|
end
|
||||||
|
|
||||||
--- [Internal] Check detection function
|
--- [Internal] Check detection function
|
||||||
@@ -1707,22 +1881,38 @@ do
|
|||||||
--get detected set
|
--get detected set
|
||||||
local detset = detection:GetDetectedItemCoordinates()
|
local detset = detection:GetDetectedItemCoordinates()
|
||||||
--self:T("Check:", {detset})
|
--self:T("Check:", {detset})
|
||||||
-- randomly update SAM Table
|
-- update SAM Table evey 3 runs
|
||||||
local rand = math.random(1,100)
|
if self.checkcounter%3 == 0 then
|
||||||
if rand > 65 then -- 1/3 of cases
|
|
||||||
self:_RefreshSAMTable()
|
self:_RefreshSAMTable()
|
||||||
end
|
end
|
||||||
|
self.checkcounter = self.checkcounter + 1
|
||||||
|
local instatusred = 0
|
||||||
|
local instatusgreen = 0
|
||||||
|
local activeshorads = 0
|
||||||
-- switch SAMs on/off if (n)one of the detected groups is inside their reach
|
-- switch SAMs on/off if (n)one of the detected groups is inside their reach
|
||||||
if self.automode then
|
if self.automode then
|
||||||
local samset = self.SAM_Table_Long -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Long -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
self:_CheckLoop(samset,detset,dlink,self.maxlongrange)
|
local instatusredl, instatusgreenl, activeshoradsl = self:_CheckLoop(samset,detset,dlink,self.maxlongrange)
|
||||||
local samset = self.SAM_Table_Medium -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Medium -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
self:_CheckLoop(samset,detset,dlink,self.maxmidrange)
|
local instatusredm, instatusgreenm, activeshoradsm = self:_CheckLoop(samset,detset,dlink,self.maxmidrange)
|
||||||
local samset = self.SAM_Table_Short -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Short -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
self:_CheckLoop(samset,detset,dlink,self.maxshortrange)
|
local instatusreds, instatusgreens, activeshoradss = self:_CheckLoop(samset,detset,dlink,self.maxshortrange)
|
||||||
|
local samset = self.SAM_Table_PointDef -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
|
instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxpointdefrange)
|
||||||
else
|
else
|
||||||
local samset = self:_GetSAMTable() -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self:_GetSAMTable() -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
self:_CheckLoop(samset,detset,dlink,self.maxclassic)
|
instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxclassic)
|
||||||
|
end
|
||||||
|
if self.debug or self.verbose then
|
||||||
|
local statusreport = REPORT:New("\nMANTIS Status "..self.name)
|
||||||
|
statusreport:Add("+-----------------------------+")
|
||||||
|
statusreport:Add(string.format("+ SAM in RED State: %2d",instatusred))
|
||||||
|
statusreport:Add(string.format("+ SAM in GREEN State: %2d",instatusgreen))
|
||||||
|
if self.Shorad then
|
||||||
|
statusreport:Add(string.format("+ SHORAD active: %2d",activeshorads))
|
||||||
|
end
|
||||||
|
statusreport:Add("+-----------------------------+")
|
||||||
|
MESSAGE:New(statusreport:Text(),10):ToAll():ToLog()
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -1807,7 +1997,7 @@ do
|
|||||||
end
|
end
|
||||||
--]]
|
--]]
|
||||||
if self.autoshorad then
|
if self.autoshorad then
|
||||||
self.Shorad = SHORAD:New(self.name.."-SHORAD",self.name.."-SHORAD",self.SAM_Group,self.ShoradActDistance,self.ShoradTime,self.coalition,self.UseEmOnOff)
|
self.Shorad = SHORAD:New(self.name.."-SHORAD","SHORAD",self.SAM_Group,self.ShoradActDistance,self.ShoradTime,self.coalition,self.UseEmOnOff)
|
||||||
self.Shorad:SetDefenseLimits(80,95)
|
self.Shorad:SetDefenseLimits(80,95)
|
||||||
self.ShoradLink = true
|
self.ShoradLink = true
|
||||||
self.Shorad.Groupset=self.ShoradGroupSet
|
self.Shorad.Groupset=self.ShoradGroupSet
|
||||||
@@ -1832,12 +2022,34 @@ do
|
|||||||
if not self.state2flag then
|
if not self.state2flag then
|
||||||
self:_Check(self.Detection,self.DLink)
|
self:_Check(self.Detection,self.DLink)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ check Awacs
|
local EWRAlive = self:_CheckAnyEWRAlive()
|
||||||
if self.advAwacs and not self.state2flag then
|
|
||||||
self:_Check(self.AWACS_Detection,false)
|
local function FindSAMSRTR()
|
||||||
|
for i=1,1000 do
|
||||||
|
local randomsam = self.SAM_Group:GetRandom()
|
||||||
|
if randomsam and randomsam:IsAlive() then
|
||||||
|
if randomsam:IsSAM() then return randomsam end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Switch on a random SR/TR if no EWR left over
|
||||||
|
if not EWRAlive then
|
||||||
|
local randomsam = FindSAMSRTR() -- Wrapper.Group#GROUP
|
||||||
|
if randomsam and randomsam:IsAlive() then
|
||||||
|
if self.UseEmOnOff then
|
||||||
|
randomsam:EnableEmission(true)
|
||||||
|
else
|
||||||
|
randomsam:OptionAlarmStateRed()
|
||||||
|
end
|
||||||
|
local name = randomsam:GetName()
|
||||||
|
if self.SamStateTracker[name] ~= "RED" then
|
||||||
|
self:__RedState(1,randomsam)
|
||||||
|
self.SamStateTracker[name] = "RED"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--]]
|
|
||||||
|
|
||||||
-- relocate HQ and EWR
|
-- relocate HQ and EWR
|
||||||
if self.autorelocate then
|
if self.autorelocate then
|
||||||
@@ -1847,8 +2059,6 @@ do
|
|||||||
|
|
||||||
local halfintv = math.floor(timepassed / relointerval)
|
local halfintv = math.floor(timepassed / relointerval)
|
||||||
|
|
||||||
--self:T({timepassed=timepassed, halfintv=halfintv})
|
|
||||||
|
|
||||||
if halfintv >= 1 then
|
if halfintv >= 1 then
|
||||||
self.TimeStamp = timer.getAbsTime()
|
self.TimeStamp = timer.getAbsTime()
|
||||||
self:_Relocate()
|
self:_Relocate()
|
||||||
@@ -1977,7 +2187,7 @@ do
|
|||||||
local Shorad = self.Shorad
|
local Shorad = self.Shorad
|
||||||
local radius = self.checkradius
|
local radius = self.checkradius
|
||||||
local ontime = self.ShoradTime
|
local ontime = self.ShoradTime
|
||||||
Shorad:WakeUpShorad(Name, radius, ontime)
|
Shorad:WakeUpShorad(Name, radius, ontime, nil, true)
|
||||||
self:__ShoradActivated(1,Name, radius, ontime)
|
self:__ShoradActivated(1,Name, radius, ontime)
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
|||||||
--
|
--
|
||||||
-- ### Authors: **applevangelist**, **FlightControl**
|
-- ### Authors: **applevangelist**, **FlightControl**
|
||||||
--
|
--
|
||||||
-- Last Update: Dec 2023
|
-- Last Update: Dec 2024
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@@ -28,6 +28,16 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
-- @type SEAD
|
-- @type SEAD
|
||||||
|
-- @field #string ClassName The Class Name.
|
||||||
|
-- @field #table TargetSkill Table of target skills.
|
||||||
|
-- @field #table SEADGroupPrefixes Table of SEAD prefixes.
|
||||||
|
-- @field #table SuppressedGroups Table of currently suppressed groups.
|
||||||
|
-- @field #number EngagementRange Engagement Range.
|
||||||
|
-- @field #number Padding Padding in seconds.
|
||||||
|
-- @field #function CallBack Callback function for suppression plans.
|
||||||
|
-- @field #boolean UseCallBack Switch for callback function to be used.
|
||||||
|
-- @field #boolean debug Debug switch.
|
||||||
|
-- @field #boolen WeaponTrack Track switch, if true track weapon speed for 30 secs.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Make SAM sites execute evasive and defensive behaviour when being fired upon.
|
--- Make SAM sites execute evasive and defensive behaviour when being fired upon.
|
||||||
@@ -56,10 +66,11 @@ SEAD = {
|
|||||||
SEADGroupPrefixes = {},
|
SEADGroupPrefixes = {},
|
||||||
SuppressedGroups = {},
|
SuppressedGroups = {},
|
||||||
EngagementRange = 75, -- default 75% engagement range Feature Request #1355
|
EngagementRange = 75, -- default 75% engagement range Feature Request #1355
|
||||||
Padding = 10,
|
Padding = 15,
|
||||||
CallBack = nil,
|
CallBack = nil,
|
||||||
UseCallBack = false,
|
UseCallBack = false,
|
||||||
debug = false,
|
debug = false,
|
||||||
|
WeaponTrack = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Missile enumerators
|
--- Missile enumerators
|
||||||
@@ -69,6 +80,7 @@ SEAD = {
|
|||||||
["AGM_122"] = "AGM_122",
|
["AGM_122"] = "AGM_122",
|
||||||
["AGM_84"] = "AGM_84",
|
["AGM_84"] = "AGM_84",
|
||||||
["AGM_45"] = "AGM_45",
|
["AGM_45"] = "AGM_45",
|
||||||
|
["AGM_65"] = "AGM_65",
|
||||||
["ALARM"] = "ALARM",
|
["ALARM"] = "ALARM",
|
||||||
["LD-10"] = "LD-10",
|
["LD-10"] = "LD-10",
|
||||||
["X_58"] = "X_58",
|
["X_58"] = "X_58",
|
||||||
@@ -88,6 +100,7 @@ SEAD = {
|
|||||||
-- km and mach
|
-- km and mach
|
||||||
["AGM_88"] = { 150, 3},
|
["AGM_88"] = { 150, 3},
|
||||||
["AGM_45"] = { 12, 2},
|
["AGM_45"] = { 12, 2},
|
||||||
|
["AGM_65"] = { 16, 0.9},
|
||||||
["AGM_122"] = { 16.5, 2.3},
|
["AGM_122"] = { 16.5, 2.3},
|
||||||
["AGM_84"] = { 280, 0.8},
|
["AGM_84"] = { 280, 0.8},
|
||||||
["ALARM"] = { 45, 2},
|
["ALARM"] = { 45, 2},
|
||||||
@@ -144,7 +157,7 @@ function SEAD:New( SEADGroupPrefixes, Padding )
|
|||||||
self:AddTransition("*", "ManageEvasion", "*")
|
self:AddTransition("*", "ManageEvasion", "*")
|
||||||
self:AddTransition("*", "CalculateHitZone", "*")
|
self:AddTransition("*", "CalculateHitZone", "*")
|
||||||
|
|
||||||
self:I("*** SEAD - Started Version 0.4.6")
|
self:I("*** SEAD - Started Version 0.4.9")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -371,7 +384,7 @@ function SEAD:onafterManageEvasion(From,Event,To,_targetskill,_targetgroup,SEADP
|
|||||||
reach = wpndata[1] * 1.1
|
reach = wpndata[1] * 1.1
|
||||||
local mach = wpndata[2]
|
local mach = wpndata[2]
|
||||||
wpnspeed = math.floor(mach * 340.29)
|
wpnspeed = math.floor(mach * 340.29)
|
||||||
if Weapon then
|
if Weapon and Weapon:GetSpeed() > 0 then
|
||||||
wpnspeed = Weapon:GetSpeed()
|
wpnspeed = Weapon:GetSpeed()
|
||||||
self:T(string.format("*** SEAD - Weapon Speed from WEAPON: %f m/s",wpnspeed))
|
self:T(string.format("*** SEAD - Weapon Speed from WEAPON: %f m/s",wpnspeed))
|
||||||
end
|
end
|
||||||
@@ -452,29 +465,38 @@ end
|
|||||||
-- @return #SEAD self
|
-- @return #SEAD self
|
||||||
function SEAD:HandleEventShot( EventData )
|
function SEAD:HandleEventShot( EventData )
|
||||||
self:T( { EventData.id } )
|
self:T( { EventData.id } )
|
||||||
local SEADPlane = EventData.IniUnit -- Wrapper.Unit#UNIT
|
|
||||||
local SEADGroup = EventData.IniGroup -- Wrapper.Group#GROUP
|
|
||||||
local SEADPlanePos = SEADPlane:GetCoordinate() -- Core.Point#COORDINATE
|
|
||||||
local SEADUnit = EventData.IniDCSUnit
|
|
||||||
local SEADUnitName = EventData.IniDCSUnitName
|
|
||||||
local SEADWeapon = EventData.Weapon -- Identify the weapon fired
|
|
||||||
local SEADWeaponName = EventData.WeaponName -- return weapon type
|
|
||||||
|
|
||||||
local WeaponWrapper = WEAPON:New(EventData.Weapon)
|
|
||||||
--local SEADWeaponSpeed = WeaponWrapper:GetSpeed() -- mps
|
|
||||||
|
|
||||||
self:T( "*** SEAD - Missile Launched = " .. SEADWeaponName)
|
local SEADWeapon = EventData.Weapon -- Identify the weapon fired
|
||||||
--self:T({ SEADWeapon })
|
local SEADWeaponName = EventData.WeaponName or "None" -- return weapon type
|
||||||
|
|
||||||
if self:_CheckHarms(SEADWeaponName) then
|
if self:_CheckHarms(SEADWeaponName) then
|
||||||
|
--UTILS.PrintTableToLog(EventData)
|
||||||
|
local SEADPlane = EventData.IniUnit -- Wrapper.Unit#UNIT
|
||||||
|
|
||||||
|
if not SEADPlane then return self end -- case IniUnit is empty
|
||||||
|
|
||||||
|
local SEADGroup = EventData.IniGroup -- Wrapper.Group#GROUP
|
||||||
|
local SEADPlanePos = SEADPlane:GetCoordinate() -- Core.Point#COORDINATE
|
||||||
|
local SEADUnit = EventData.IniDCSUnit
|
||||||
|
local SEADUnitName = EventData.IniDCSUnitName
|
||||||
|
|
||||||
|
local WeaponWrapper = WEAPON:New(EventData.Weapon) -- Wrapper.Weapon#WEAPON
|
||||||
|
|
||||||
|
self:T( "*** SEAD - Missile Launched = " .. SEADWeaponName)
|
||||||
|
|
||||||
self:T( '*** SEAD - Weapon Match' )
|
self:T( '*** SEAD - Weapon Match' )
|
||||||
|
if self.WeaponTrack == true then
|
||||||
|
WeaponWrapper:SetFuncTrack(function(weapon) env.info(string.format("*** Weapon Speed: %d m/s",weapon:GetSpeed() or -1)) end)
|
||||||
|
WeaponWrapper:StartTrack(0.1)
|
||||||
|
WeaponWrapper:StopTrack(30)
|
||||||
|
end
|
||||||
local _targetskill = "Random"
|
local _targetskill = "Random"
|
||||||
local _targetgroupname = "none"
|
local _targetgroupname = "none"
|
||||||
local _target = EventData.Weapon:getTarget() -- Identify target
|
local _target = EventData.Weapon:getTarget() -- Identify target
|
||||||
if not _target or self.debug then -- AGM-88 or 154 w/o target data
|
if not _target or self.debug then -- AGM-88 or 154 w/o target data
|
||||||
self:E("***** SEAD - No target data for " .. (SEADWeaponName or "None"))
|
self:E("***** SEAD - No target data for " .. (SEADWeaponName or "None"))
|
||||||
if string.find(SEADWeaponName,"AGM_88",1,true) or string.find(SEADWeaponName,"AGM_154",1,true) then
|
if string.find(SEADWeaponName,"AGM_88",1,true) or string.find(SEADWeaponName,"AGM_154",1,true) then
|
||||||
self:I("**** Tracking AGM-88/154 with no target data.")
|
self:T("**** Tracking AGM-88/154 with no target data.")
|
||||||
local pos0 = SEADPlane:GetCoordinate()
|
local pos0 = SEADPlane:GetCoordinate()
|
||||||
local fheight = SEADPlane:GetHeight()
|
local fheight = SEADPlane:GetHeight()
|
||||||
self:__CalculateHitZone(20,SEADWeapon,pos0,fheight,SEADGroup,SEADWeaponName)
|
self:__CalculateHitZone(20,SEADWeapon,pos0,fheight,SEADGroup,SEADWeaponName)
|
||||||
@@ -520,7 +542,7 @@ function SEAD:HandleEventShot( EventData )
|
|||||||
end
|
end
|
||||||
if SEADGroupFound == true then -- yes we are being attacked
|
if SEADGroupFound == true then -- yes we are being attacked
|
||||||
if string.find(SEADWeaponName,"ADM_141",1,true) then
|
if string.find(SEADWeaponName,"ADM_141",1,true) then
|
||||||
self:__ManageEvasion(2,_targetskill,_targetgroup,SEADPlanePos,SEADWeaponName,SEADGroup,0,WeaponWrapper)
|
self:__ManageEvasion(2,_targetskill,_targetgroup,SEADPlanePos,SEADWeaponName,SEADGroup,2,WeaponWrapper)
|
||||||
else
|
else
|
||||||
self:ManageEvasion(_targetskill,_targetgroup,SEADPlanePos,SEADWeaponName,SEADGroup,0,WeaponWrapper)
|
self:ManageEvasion(_targetskill,_targetgroup,SEADPlanePos,SEADWeaponName,SEADGroup,0,WeaponWrapper)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
-- @image Functional.Shorad.jpg
|
-- @image Functional.Shorad.jpg
|
||||||
--
|
--
|
||||||
-- Date: Nov 2021
|
-- Date: Nov 2021
|
||||||
-- Last Update: Nov 2023
|
-- Last Update: Jan 2025
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **SHORAD** class, extends Core.Base#BASE
|
--- **SHORAD** class, extends Core.Base#BASE
|
||||||
@@ -113,7 +113,7 @@ SHORAD = {
|
|||||||
SkateNumber = 3,
|
SkateNumber = 3,
|
||||||
SkateZones = nil,
|
SkateZones = nil,
|
||||||
minscootdist = 100,
|
minscootdist = 100,
|
||||||
minscootdist = 3000,
|
maxscootdist = 3000,
|
||||||
scootrandomcoord = false,
|
scootrandomcoord = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +443,9 @@ do
|
|||||||
for _,_groups in pairs (shoradset) do
|
for _,_groups in pairs (shoradset) do
|
||||||
local groupname = _groups:GetName()
|
local groupname = _groups:GetName()
|
||||||
if string.find(groupname, tgtgrp, 1, true) then
|
if string.find(groupname, tgtgrp, 1, true) then
|
||||||
returnname = true
|
if _groups:IsSAM() then
|
||||||
|
returnname = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return returnname
|
return returnname
|
||||||
@@ -470,6 +472,7 @@ do
|
|||||||
-- @param #number Radius Radius of the #ZONE
|
-- @param #number Radius Radius of the #ZONE
|
||||||
-- @param #number ActiveTimer Number of seconds to stay active
|
-- @param #number ActiveTimer Number of seconds to stay active
|
||||||
-- @param #number TargetCat (optional) Category, i.e. Object.Category.UNIT or Object.Category.STATIC
|
-- @param #number TargetCat (optional) Category, i.e. Object.Category.UNIT or Object.Category.STATIC
|
||||||
|
-- @param #boolean ShotAt If true, function is called after a shot
|
||||||
-- @return #SHORAD self
|
-- @return #SHORAD self
|
||||||
-- @usage Use this function to integrate with other systems, example
|
-- @usage Use this function to integrate with other systems, example
|
||||||
--
|
--
|
||||||
@@ -479,7 +482,7 @@ do
|
|||||||
-- mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")
|
-- mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")
|
||||||
-- mymantis:AddShorad(myshorad,720)
|
-- mymantis:AddShorad(myshorad,720)
|
||||||
-- mymantis:Start()
|
-- mymantis:Start()
|
||||||
function SHORAD:onafterWakeUpShorad(From, Event, To, TargetGroup, Radius, ActiveTimer, TargetCat)
|
function SHORAD:onafterWakeUpShorad(From, Event, To, TargetGroup, Radius, ActiveTimer, TargetCat, ShotAt)
|
||||||
self:T(self.lid .. " WakeUpShorad")
|
self:T(self.lid .. " WakeUpShorad")
|
||||||
self:T({TargetGroup, Radius, ActiveTimer, TargetCat})
|
self:T({TargetGroup, Radius, ActiveTimer, TargetCat})
|
||||||
local targetcat = TargetCat or Object.Category.UNIT
|
local targetcat = TargetCat or Object.Category.UNIT
|
||||||
@@ -521,7 +524,27 @@ do
|
|||||||
-- go through set and find the one(s) to activate
|
-- go through set and find the one(s) to activate
|
||||||
local TDiff = 4
|
local TDiff = 4
|
||||||
for _,_group in pairs (shoradset) do
|
for _,_group in pairs (shoradset) do
|
||||||
if _group:IsAnyInZone(targetzone) then
|
|
||||||
|
local groupname = _group:GetName()
|
||||||
|
|
||||||
|
if groupname == TargetGroup and ShotAt==true then
|
||||||
|
-- Shot at a SHORAD group
|
||||||
|
if self.UseEmOnOff then
|
||||||
|
_group:EnableEmission(false)
|
||||||
|
end
|
||||||
|
_group:OptionAlarmStateGreen()
|
||||||
|
self.ActiveGroups[groupname] = nil
|
||||||
|
local text = string.format("Shot at SHORAD %s! Evading!", _group:GetName())
|
||||||
|
self:T(text)
|
||||||
|
local m = MESSAGE:New(text,10,"SHORAD"):ToAllIf(self.debug)
|
||||||
|
|
||||||
|
--Shoot and Scoot
|
||||||
|
if self.shootandscoot then
|
||||||
|
self:__ShootAndScoot(1,_group)
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif _group:IsAnyInZone(targetzone) or groupname == TargetGroup then
|
||||||
|
-- shot at a group we protect
|
||||||
local text = string.format("Waking up SHORAD %s", _group:GetName())
|
local text = string.format("Waking up SHORAD %s", _group:GetName())
|
||||||
self:T(text)
|
self:T(text)
|
||||||
local m = MESSAGE:New(text,10,"SHORAD"):ToAllIf(self.debug)
|
local m = MESSAGE:New(text,10,"SHORAD"):ToAllIf(self.debug)
|
||||||
@@ -529,7 +552,6 @@ do
|
|||||||
_group:EnableEmission(true)
|
_group:EnableEmission(true)
|
||||||
end
|
end
|
||||||
_group:OptionAlarmStateRed()
|
_group:OptionAlarmStateRed()
|
||||||
local groupname = _group:GetName()
|
|
||||||
if self.ActiveGroups[groupname] == nil then -- no timer yet for this group
|
if self.ActiveGroups[groupname] == nil then -- no timer yet for this group
|
||||||
self.ActiveGroups[groupname] = { Timing = ActiveTimer }
|
self.ActiveGroups[groupname] = { Timing = ActiveTimer }
|
||||||
local endtime = timer.getTime() + (ActiveTimer * math.random(75,100) / 100 ) -- randomize wakeup a bit
|
local endtime = timer.getTime() + (ActiveTimer * math.random(75,100) / 100 ) -- randomize wakeup a bit
|
||||||
@@ -607,7 +629,7 @@ do
|
|||||||
_targetgroupname = tgtgrp:GetName() -- group name
|
_targetgroupname = tgtgrp:GetName() -- group name
|
||||||
_targetskill = tgtgrp:GetUnit(1):GetSkill()
|
_targetskill = tgtgrp:GetUnit(1):GetSkill()
|
||||||
self:T("*** Found Target = ".. _targetgroupname)
|
self:T("*** Found Target = ".. _targetgroupname)
|
||||||
self:WakeUpShorad(_targetgroupname, self.Radius, self.ActiveTimer, Object.Category.UNIT)
|
self:WakeUpShorad(_targetgroupname, self.Radius, self.ActiveTimer, Object.Category.UNIT,true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -736,7 +758,7 @@ do
|
|||||||
-- if being shot at, find closest SHORADs to activate
|
-- if being shot at, find closest SHORADs to activate
|
||||||
if shotatsams or shotatus then
|
if shotatsams or shotatus then
|
||||||
self:T({shotatsams=shotatsams,shotatus=shotatus})
|
self:T({shotatsams=shotatsams,shotatus=shotatus})
|
||||||
self:WakeUpShorad(targetgroupname, self.Radius, self.ActiveTimer, targetcat)
|
self:WakeUpShorad(targetgroupname, self.Radius, self.ActiveTimer, targetcat, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
--
|
--
|
||||||
-- @module Functional.Stratego
|
-- @module Functional.Stratego
|
||||||
-- @image Functional.Stratego.png
|
-- @image Functional.Stratego.png
|
||||||
|
-- Last Update May 2024
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -41,7 +42,9 @@
|
|||||||
-- @field #boolean usebudget
|
-- @field #boolean usebudget
|
||||||
-- @field #number CaptureUnits
|
-- @field #number CaptureUnits
|
||||||
-- @field #number CaptureThreatlevel
|
-- @field #number CaptureThreatlevel
|
||||||
|
-- @field #table CaptureObjectCategories
|
||||||
-- @field #boolean ExcludeShips
|
-- @field #boolean ExcludeShips
|
||||||
|
-- @field Core.Zone#ZONE StrategoZone
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
@@ -154,6 +157,7 @@
|
|||||||
-- @{#STRATEGO.FindRoute}(): Find a route between two nodes.
|
-- @{#STRATEGO.FindRoute}(): Find a route between two nodes.
|
||||||
-- @{#STRATEGO.SetCaptureOptions}(): Set how many units of which minimum threat level are needed to capture one node (i.e. the underlying OpsZone).
|
-- @{#STRATEGO.SetCaptureOptions}(): Set how many units of which minimum threat level are needed to capture one node (i.e. the underlying OpsZone).
|
||||||
-- @{#STRATEGO.SetDebug}(): Set debug and draw options.
|
-- @{#STRATEGO.SetDebug}(): Set debug and draw options.
|
||||||
|
-- @{#STRATEGO.SetStrategoZone}(): Set a zone to restrict STRATEGO analytics to, can be any kind of ZONE Object.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- ## Visualisation example code for the Syria map:
|
-- ## Visualisation example code for the Syria map:
|
||||||
@@ -177,7 +181,7 @@ STRATEGO = {
|
|||||||
debug = false,
|
debug = false,
|
||||||
drawzone = false,
|
drawzone = false,
|
||||||
markzone = false,
|
markzone = false,
|
||||||
version = "0.2.5",
|
version = "0.3.1",
|
||||||
portweight = 3,
|
portweight = 3,
|
||||||
POIweight = 1,
|
POIweight = 1,
|
||||||
maxrunways = 3,
|
maxrunways = 3,
|
||||||
@@ -196,6 +200,7 @@ STRATEGO = {
|
|||||||
usebudget = false,
|
usebudget = false,
|
||||||
CaptureUnits = 3,
|
CaptureUnits = 3,
|
||||||
CaptureThreatlevel = 1,
|
CaptureThreatlevel = 1,
|
||||||
|
CaptureObjectCategories = {Object.Category.UNIT},
|
||||||
ExcludeShips = true,
|
ExcludeShips = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +212,10 @@ STRATEGO = {
|
|||||||
-- @field #number coalition
|
-- @field #number coalition
|
||||||
-- @field #boolean port
|
-- @field #boolean port
|
||||||
-- @field Core.Zone#ZONE_RADIUS zone,
|
-- @field Core.Zone#ZONE_RADIUS zone,
|
||||||
-- @field Core.Point#COORDINATRE coord
|
-- @field Core.Point#COORDINATE coord
|
||||||
-- @field #string type
|
-- @field #string type
|
||||||
-- @field Ops.OpsZone#OPSZONE opszone
|
-- @field Ops.OpsZone#OPSZONE opszone
|
||||||
|
-- @field #number connections
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @type STRATEGO.DistData
|
-- @type STRATEGO.DistData
|
||||||
@@ -377,6 +383,15 @@ function STRATEGO:SetDebug(Debug,DrawZones,MarkZones)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [USER] Restrict Stratego to analyse this zone only.
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param Core.Zone#ZONE Zone The Zone to restrict Stratego to, can be any kind of ZONE Object.
|
||||||
|
-- @return #STRATEGO self
|
||||||
|
function STRATEGO:SetStrategoZone(Zone)
|
||||||
|
self.StrategoZone = Zone
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [USER] Set weights for nodes and routes to determine their importance.
|
--- [USER] Set weights for nodes and routes to determine their importance.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #number MaxRunways Set the maximum number of runways the big (equals strategic) airbases on the map have. Defaults to 3. The weight of an airbase node hence equals the number of runways.
|
-- @param #number MaxRunways Set the maximum number of runways the big (equals strategic) airbases on the map have. Defaults to 3. The weight of an airbase node hence equals the number of runways.
|
||||||
@@ -407,11 +422,13 @@ end
|
|||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #number CaptureUnits Number of units needed, defaults to three.
|
-- @param #number CaptureUnits Number of units needed, defaults to three.
|
||||||
-- @param #number CaptureThreatlevel Threat level needed, can be 0..10, defaults to one.
|
-- @param #number CaptureThreatlevel Threat level needed, can be 0..10, defaults to one.
|
||||||
|
-- @param #table CaptureCategories Table of object categories which can capture a node, defaults to `{Object.Category.UNIT}`.
|
||||||
-- @return #STRATEGO self
|
-- @return #STRATEGO self
|
||||||
function STRATEGO:SetCaptureOptions(CaptureUnits,CaptureThreatlevel)
|
function STRATEGO:SetCaptureOptions(CaptureUnits,CaptureThreatlevel,CaptureCategories)
|
||||||
self:T(self.lid.."SetCaptureOptions")
|
self:T(self.lid.."SetCaptureOptions")
|
||||||
self.CaptureUnits = CaptureUnits or 3
|
self.CaptureUnits = CaptureUnits or 3
|
||||||
self.CaptureThreatlevel = CaptureThreatlevel or 1
|
self.CaptureThreatlevel = CaptureThreatlevel or 1
|
||||||
|
self.CaptureObjectCategories = CaptureCategories or {Object.Category.UNIT}
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -425,12 +442,19 @@ function STRATEGO:AnalyseBases()
|
|||||||
local airbasetable = self.airbasetable
|
local airbasetable = self.airbasetable
|
||||||
local nonconnectedab = self.nonconnectedab
|
local nonconnectedab = self.nonconnectedab
|
||||||
local easynames = self.easynames
|
local easynames = self.easynames
|
||||||
|
local zone = self.StrategoZone -- Core.Zone#ZONE_POLYGON
|
||||||
|
|
||||||
-- find bases with >= 1 runways
|
-- find bases with >= 1 runways
|
||||||
self.bases:ForEach(
|
self.bases:ForEach(
|
||||||
function(afb)
|
function(afb)
|
||||||
local ab = afb -- Wrapper.Airbase#AIRBASE
|
local ab = afb -- Wrapper.Airbase#AIRBASE
|
||||||
|
local abvec2 = ab:GetVec2()
|
||||||
if self.ExcludeShips and ab:IsShip() then return end
|
if self.ExcludeShips and ab:IsShip() then return end
|
||||||
|
if zone ~= nil then
|
||||||
|
if not zone:IsVec2InZone(abvec2) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
local abname = ab:GetName()
|
local abname = ab:GetName()
|
||||||
local runways = ab:GetRunways()
|
local runways = ab:GetRunways()
|
||||||
local numrwys = #runways
|
local numrwys = #runways
|
||||||
@@ -467,6 +491,7 @@ function STRATEGO:AnalyseBases()
|
|||||||
coord = coord,
|
coord = coord,
|
||||||
type = abtype,
|
type = abtype,
|
||||||
opszone = opszone,
|
opszone = opszone,
|
||||||
|
connections = 0,
|
||||||
}
|
}
|
||||||
airbasetable[abname] = tbl
|
airbasetable[abname] = tbl
|
||||||
nonconnectedab[abname] = true
|
nonconnectedab[abname] = true
|
||||||
@@ -507,6 +532,7 @@ function STRATEGO:GetNewOpsZone(Zone,Coalition)
|
|||||||
local opszone = OPSZONE:New(Zone,Coalition or 0)
|
local opszone = OPSZONE:New(Zone,Coalition or 0)
|
||||||
opszone:SetCaptureNunits(self.CaptureUnits)
|
opszone:SetCaptureNunits(self.CaptureUnits)
|
||||||
opszone:SetCaptureThreatlevel(self.CaptureThreatlevel)
|
opszone:SetCaptureThreatlevel(self.CaptureThreatlevel)
|
||||||
|
opszone:SetObjectCategories(self.CaptureObjectCategories)
|
||||||
opszone:SetDrawZone(self.drawzone)
|
opszone:SetDrawZone(self.drawzone)
|
||||||
opszone:SetMarkZone(self.markzone)
|
opszone:SetMarkZone(self.markzone)
|
||||||
opszone:Start()
|
opszone:Start()
|
||||||
@@ -552,10 +578,12 @@ function STRATEGO:AnalysePOIs(Set,Weight,Key)
|
|||||||
coord = coord,
|
coord = coord,
|
||||||
type = Key,
|
type = Key,
|
||||||
opszone = opszone,
|
opszone = opszone,
|
||||||
|
connections = 0,
|
||||||
}
|
}
|
||||||
airbasetable[zone:GetName()] = tbl
|
airbasetable[zname] = tbl
|
||||||
nonconnectedab[zone:GetName()] = true
|
nonconnectedab[zname] = true
|
||||||
local name = string.gsub(zname,"[%p%s]",".")
|
local name = string.gsub(zname,"[%p%s]",".")
|
||||||
|
--self:I({name=name,zone=zname})
|
||||||
easynames[name]=zname
|
easynames[name]=zname
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@@ -566,7 +594,7 @@ end
|
|||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @return #STRATEGO self
|
-- @return #STRATEGO self
|
||||||
function STRATEGO:GetToFrom(StartPoint,EndPoint)
|
function STRATEGO:GetToFrom(StartPoint,EndPoint)
|
||||||
self:T(self.lid.."GetToFrom")
|
self:T(self.lid.."GetToFrom "..tostring(StartPoint).." "..tostring(EndPoint))
|
||||||
local pstart = string.gsub(StartPoint,"[%p%s]",".")
|
local pstart = string.gsub(StartPoint,"[%p%s]",".")
|
||||||
local pend = string.gsub(EndPoint,"[%p%s]",".")
|
local pend = string.gsub(EndPoint,"[%p%s]",".")
|
||||||
local fromto = pstart..";"..pend
|
local fromto = pstart..";"..pend
|
||||||
@@ -574,11 +602,35 @@ function STRATEGO:GetToFrom(StartPoint,EndPoint)
|
|||||||
return fromto, tofrom
|
return fromto, tofrom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [USER] Get available connecting nodes from one start node
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string StartPoint The starting name
|
||||||
|
-- @return #boolean found
|
||||||
|
-- @return #table Nodes
|
||||||
|
function STRATEGO:GetRoutesFromNode(StartPoint)
|
||||||
|
self:T(self.lid.."GetRoutesFromNode")
|
||||||
|
local pstart = string.gsub(StartPoint,"[%p%s]",".")
|
||||||
|
local found = false
|
||||||
|
pstart=pstart..";"
|
||||||
|
local routes = {}
|
||||||
|
local listed = {}
|
||||||
|
for _,_data in pairs(self.routexists) do
|
||||||
|
if string.find(_data,pstart,1,true) and not listed[_data] then
|
||||||
|
local target = string.gsub(_data,pstart,"")
|
||||||
|
local fname = self.easynames[target]
|
||||||
|
table.insert(routes,fname)
|
||||||
|
found = true
|
||||||
|
listed[_data] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return found,routes
|
||||||
|
end
|
||||||
|
|
||||||
--- [USER] Manually add a route, for e.g. Island hopping or to connect isolated networks. Use **after** STRATEGO has been started!
|
--- [USER] Manually add a route, for e.g. Island hopping or to connect isolated networks. Use **after** STRATEGO has been started!
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Startpoint Starting Point, e.g. AIRBASE.Syria.Hatay
|
-- @param #string Startpoint Starting Point, e.g. AIRBASE.Syria.Hatay
|
||||||
-- @param #string Endpoint End Point, e.g. AIRBASE.Syria.H4
|
-- @param #string Endpoint End Point, e.g. AIRBASE.Syria.H4
|
||||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Defaults to lila.
|
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Defaults to violet.
|
||||||
-- @param #number Linetype (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 5.
|
-- @param #number Linetype (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 5.
|
||||||
-- @param #boolean Draw (Optional) If true, draw route on the F10 map. Defaukt false.
|
-- @param #boolean Draw (Optional) If true, draw route on the F10 map. Defaukt false.
|
||||||
-- @return #STRATEGO self
|
-- @return #STRATEGO self
|
||||||
@@ -606,6 +658,8 @@ function STRATEGO:AddRoutesManually(Startpoint,Endpoint,Color,Linetype,Draw)
|
|||||||
local factor = self.airbasetable[Startpoint].baseweight*self.routefactor
|
local factor = self.airbasetable[Startpoint].baseweight*self.routefactor
|
||||||
self.airbasetable[Startpoint].weight = self.airbasetable[Startpoint].weight+factor
|
self.airbasetable[Startpoint].weight = self.airbasetable[Startpoint].weight+factor
|
||||||
self.airbasetable[Endpoint].weight = self.airbasetable[Endpoint].weight+factor
|
self.airbasetable[Endpoint].weight = self.airbasetable[Endpoint].weight+factor
|
||||||
|
self.airbasetable[Endpoint].connections = self.airbasetable[Endpoint].connections + 2
|
||||||
|
self.airbasetable[Startpoint].connections = self.airbasetable[Startpoint].connections+2
|
||||||
if self.debug or Draw then
|
if self.debug or Draw then
|
||||||
startcoordinate:LineToAll(targetcoordinate,-1,color,1,linetype,nil,string.format("%dkm",dist))
|
startcoordinate:LineToAll(targetcoordinate,-1,color,1,linetype,nil,string.format("%dkm",dist))
|
||||||
end
|
end
|
||||||
@@ -624,7 +678,7 @@ function STRATEGO:AnalyseRoutes(tgtrwys,factor,color,linetype)
|
|||||||
for _,_data in pairs(self.airbasetable) do
|
for _,_data in pairs(self.airbasetable) do
|
||||||
local fromto,tofrom = self:GetToFrom(startpoint,_data.name)
|
local fromto,tofrom = self:GetToFrom(startpoint,_data.name)
|
||||||
if _data.name == startpoint then
|
if _data.name == startpoint then
|
||||||
-- sam as we
|
-- same as we
|
||||||
elseif _data.baseweight == tgtrwys and not (self.routexists[fromto] or self.routexists[tofrom]) then
|
elseif _data.baseweight == tgtrwys and not (self.routexists[fromto] or self.routexists[tofrom]) then
|
||||||
local tgtc = _data.coord
|
local tgtc = _data.coord
|
||||||
local dist = UTILS.Round(tgtc:Get2DDistance(startcoord),-2)/1000
|
local dist = UTILS.Round(tgtc:Get2DDistance(startcoord),-2)/1000
|
||||||
@@ -646,6 +700,8 @@ function STRATEGO:AnalyseRoutes(tgtrwys,factor,color,linetype)
|
|||||||
self.nonconnectedab[startpoint] = false
|
self.nonconnectedab[startpoint] = false
|
||||||
self.airbasetable[startpoint].weight = self.airbasetable[startpoint].weight+factor
|
self.airbasetable[startpoint].weight = self.airbasetable[startpoint].weight+factor
|
||||||
self.airbasetable[_data.name].weight = self.airbasetable[_data.name].weight+factor
|
self.airbasetable[_data.name].weight = self.airbasetable[_data.name].weight+factor
|
||||||
|
self.airbasetable[startpoint].connections = self.airbasetable[startpoint].connections + 1
|
||||||
|
self.airbasetable[_data.name].connections = self.airbasetable[_data.name].connections + 1
|
||||||
if self.debug then
|
if self.debug then
|
||||||
startcoord:LineToAll(tgtc,-1,color,1,linetype,nil,string.format("%dkm",dist))
|
startcoord:LineToAll(tgtc,-1,color,1,linetype,nil,string.format("%dkm",dist))
|
||||||
end
|
end
|
||||||
@@ -692,6 +748,8 @@ function STRATEGO:AnalyseUnconnected(Color)
|
|||||||
end
|
end
|
||||||
self.airbasetable[startpoint].weight = self.airbasetable[startpoint].weight+1
|
self.airbasetable[startpoint].weight = self.airbasetable[startpoint].weight+1
|
||||||
self.airbasetable[closest].weight = self.airbasetable[closest].weight+1
|
self.airbasetable[closest].weight = self.airbasetable[closest].weight+1
|
||||||
|
self.airbasetable[startpoint].connections = self.airbasetable[startpoint].connections+2
|
||||||
|
self.airbasetable[closest].connections = self.airbasetable[closest].connections+2
|
||||||
local data = {
|
local data = {
|
||||||
start = startpoint,
|
start = startpoint,
|
||||||
target = closest,
|
target = closest,
|
||||||
@@ -708,14 +766,50 @@ function STRATEGO:AnalyseUnconnected(Color)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
|
function STRATEGO:PruneDeadEnds(abtable)
|
||||||
|
local found = false
|
||||||
|
local newtable = {}
|
||||||
|
for name, _data in pairs(abtable) do
|
||||||
|
local data = _data -- #STRATEGO.Data
|
||||||
|
if data.connections > 2 then
|
||||||
|
newtable[name] = data
|
||||||
|
else
|
||||||
|
-- dead end
|
||||||
|
found = true
|
||||||
|
local neighbors, nearest, distance = self:FindNeighborNodes(name)
|
||||||
|
--self:I("Pruning "..name)
|
||||||
|
if nearest then
|
||||||
|
for _name,_ in pairs(neighbors) do
|
||||||
|
local abname = self.easynames[_name] or _name
|
||||||
|
--self:I({easyname=_name,airbasename=abname})
|
||||||
|
if abtable[abname] then
|
||||||
|
abtable[abname].connections = abtable[abname].connections -1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if self.debug then
|
||||||
|
data.coord:CircleToAll(5000,-1,{1,1,1},1,{1,1,1},1,3,true,"Dead End")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
abtable = nil
|
||||||
|
return found,newtable
|
||||||
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
--- [USER] Get a list of the nodes with the highest weight.
|
--- [USER] Get a list of the nodes with the highest weight.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #number Coalition (Optional) Find for this coalition only. E.g. coalition.side.BLUE.
|
-- @param #number Coalition (Optional) Find for this coalition only. E.g. coalition.side.BLUE.
|
||||||
-- @return #table Table of nodes.
|
-- @return #table Table of nodes.
|
||||||
-- @return #number Weight The consolidated weight associated with the nodes.
|
-- @return #number Weight The consolidated weight associated with the nodes.
|
||||||
|
-- @return #number Highest Highest weight found.
|
||||||
|
-- @return #string Name of the node with the highest weight.
|
||||||
function STRATEGO:GetHighestWeightNodes(Coalition)
|
function STRATEGO:GetHighestWeightNodes(Coalition)
|
||||||
self:T(self.lid.."GetHighestWeightNodes")
|
self:T(self.lid.."GetHighestWeightNodes")
|
||||||
local weight = 0
|
local weight = 0
|
||||||
|
local highest = 0
|
||||||
|
local highname = nil
|
||||||
local airbases = {}
|
local airbases = {}
|
||||||
for _name,_data in pairs(self.airbasetable) do
|
for _name,_data in pairs(self.airbasetable) do
|
||||||
local okay = true
|
local okay = true
|
||||||
@@ -729,8 +823,12 @@ function STRATEGO:GetHighestWeightNodes(Coalition)
|
|||||||
if not airbases[weight] then airbases[weight]={} end
|
if not airbases[weight] then airbases[weight]={} end
|
||||||
table.insert(airbases[weight],_name)
|
table.insert(airbases[weight],_name)
|
||||||
end
|
end
|
||||||
|
if _data.weight > highest and okay then
|
||||||
|
highest = _data.weight
|
||||||
|
highname = _name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return airbases[weight],weight
|
return airbases[weight],weight,highest,highname
|
||||||
end
|
end
|
||||||
|
|
||||||
--- [USER] Get a list of the nodes a weight less than the given parameter.
|
--- [USER] Get a list of the nodes a weight less than the given parameter.
|
||||||
@@ -759,9 +857,39 @@ function STRATEGO:GetNextHighestWeightNodes(Weight, Coalition)
|
|||||||
return airbases[weight],weight
|
return airbases[weight],weight
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [USER] Set the aggregated weight of a single node found by its name manually.
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string Name The name to look for.
|
||||||
|
-- @param #number Weight The weight to be set.
|
||||||
|
-- @return #boolean success
|
||||||
|
function STRATEGO:SetNodeWeight(Name,Weight)
|
||||||
|
self:T(self.lid.."SetNodeWeight")
|
||||||
|
if Name and Weight and self.airbasetable[Name] then
|
||||||
|
self.airbasetable[Name].weight = Weight or 0
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [USER] Set the base weight of a single node found by its name manually.
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string Name The name to look for.
|
||||||
|
-- @param #number Weight The weight to be set.
|
||||||
|
-- @return #boolean success
|
||||||
|
function STRATEGO:SetNodeBaseWeight(Name,Weight)
|
||||||
|
self:T(self.lid.."SetNodeBaseWeight")
|
||||||
|
if Name and Weight and self.airbasetable[Name] then
|
||||||
|
self.airbasetable[Name].baseweight = Weight or 0
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- [USER] Get the aggregated weight of a node by its name.
|
--- [USER] Get the aggregated weight of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string Name The name to look for.
|
||||||
-- @return #number Weight The weight or 0 if not found.
|
-- @return #number Weight The weight or 0 if not found.
|
||||||
function STRATEGO:GetNodeWeight(Name)
|
function STRATEGO:GetNodeWeight(Name)
|
||||||
self:T(self.lid.."GetNodeWeight")
|
self:T(self.lid.."GetNodeWeight")
|
||||||
@@ -774,7 +902,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the base weight of a node by its name.
|
--- [USER] Get the base weight of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string Name The name to look for.
|
||||||
-- @return #number Weight The base weight or 0 if not found.
|
-- @return #number Weight The base weight or 0 if not found.
|
||||||
function STRATEGO:GetNodeBaseWeight(Name)
|
function STRATEGO:GetNodeBaseWeight(Name)
|
||||||
self:T(self.lid.."GetNodeBaseWeight")
|
self:T(self.lid.."GetNodeBaseWeight")
|
||||||
@@ -787,7 +915,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the COALITION of a node by its name.
|
--- [USER] Get the COALITION of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #number Coalition The coalition.
|
-- @return #number Coalition The coalition.
|
||||||
function STRATEGO:GetNodeCoalition(Name)
|
function STRATEGO:GetNodeCoalition(Name)
|
||||||
self:T(self.lid.."GetNodeCoalition")
|
self:T(self.lid.."GetNodeCoalition")
|
||||||
@@ -800,7 +928,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the TYPE of a node by its name.
|
--- [USER] Get the TYPE of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #string Type Type of the node, e.g. STRATEGO.Type.AIRBASE or nil if not found.
|
-- @return #string Type Type of the node, e.g. STRATEGO.Type.AIRBASE or nil if not found.
|
||||||
function STRATEGO:GetNodeType(Name)
|
function STRATEGO:GetNodeType(Name)
|
||||||
self:T(self.lid.."GetNodeType")
|
self:T(self.lid.."GetNodeType")
|
||||||
@@ -813,7 +941,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the ZONE of a node by its name.
|
--- [USER] Get the ZONE of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return Core.Zone#ZONE Zone The Zone of the node or nil if not found.
|
-- @return Core.Zone#ZONE Zone The Zone of the node or nil if not found.
|
||||||
function STRATEGO:GetNodeZone(Name)
|
function STRATEGO:GetNodeZone(Name)
|
||||||
self:T(self.lid.."GetNodeZone")
|
self:T(self.lid.."GetNodeZone")
|
||||||
@@ -826,7 +954,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the OPSZONE of a node by its name.
|
--- [USER] Get the OPSZONE of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return Ops.OpsZone#OPSZONE OpsZone The OpsZone of the node or nil if not found.
|
-- @return Ops.OpsZone#OPSZONE OpsZone The OpsZone of the node or nil if not found.
|
||||||
function STRATEGO:GetNodeOpsZone(Name)
|
function STRATEGO:GetNodeOpsZone(Name)
|
||||||
self:T(self.lid.."GetNodeOpsZone")
|
self:T(self.lid.."GetNodeOpsZone")
|
||||||
@@ -839,7 +967,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Get the COORDINATE of a node by its name.
|
--- [USER] Get the COORDINATE of a node by its name.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return Core.Point#COORDINATE Coordinate The Coordinate of the node or nil if not found.
|
-- @return Core.Point#COORDINATE Coordinate The Coordinate of the node or nil if not found.
|
||||||
function STRATEGO:GetNodeCoordinate(Name)
|
function STRATEGO:GetNodeCoordinate(Name)
|
||||||
self:T(self.lid.."GetNodeCoordinate")
|
self:T(self.lid.."GetNodeCoordinate")
|
||||||
@@ -852,7 +980,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Check if the TYPE of a node is AIRBASE.
|
--- [USER] Check if the TYPE of a node is AIRBASE.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #boolean Outcome
|
-- @return #boolean Outcome
|
||||||
function STRATEGO:IsAirbase(Name)
|
function STRATEGO:IsAirbase(Name)
|
||||||
self:T(self.lid.."IsAirbase")
|
self:T(self.lid.."IsAirbase")
|
||||||
@@ -865,7 +993,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Check if the TYPE of a node is PORT.
|
--- [USER] Check if the TYPE of a node is PORT.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #boolean Outcome
|
-- @return #boolean Outcome
|
||||||
function STRATEGO:IsPort(Name)
|
function STRATEGO:IsPort(Name)
|
||||||
self:T(self.lid.."IsPort")
|
self:T(self.lid.."IsPort")
|
||||||
@@ -878,7 +1006,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Check if the TYPE of a node is POI.
|
--- [USER] Check if the TYPE of a node is POI.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #boolean Outcome
|
-- @return #boolean Outcome
|
||||||
function STRATEGO:IsPOI(Name)
|
function STRATEGO:IsPOI(Name)
|
||||||
self:T(self.lid.."IsPOI")
|
self:T(self.lid.."IsPOI")
|
||||||
@@ -891,7 +1019,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Check if the TYPE of a node is FARP.
|
--- [USER] Check if the TYPE of a node is FARP.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #boolean Outcome
|
-- @return #boolean Outcome
|
||||||
function STRATEGO:IsFARP(Name)
|
function STRATEGO:IsFARP(Name)
|
||||||
self:T(self.lid.."IsFARP")
|
self:T(self.lid.."IsFARP")
|
||||||
@@ -904,7 +1032,7 @@ end
|
|||||||
|
|
||||||
--- [USER] Check if the TYPE of a node is SHIP.
|
--- [USER] Check if the TYPE of a node is SHIP.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Name.
|
-- @param #string The name to look for.
|
||||||
-- @return #boolean Outcome
|
-- @return #boolean Outcome
|
||||||
function STRATEGO:IsShip(Name)
|
function STRATEGO:IsShip(Name)
|
||||||
self:T(self.lid.."IsShip")
|
self:T(self.lid.."IsShip")
|
||||||
@@ -1087,35 +1215,67 @@ function STRATEGO:FindNeighborNodes(Name,Enemies,Friends)
|
|||||||
self:T(self.lid.."FindNeighborNodes")
|
self:T(self.lid.."FindNeighborNodes")
|
||||||
local neighbors = {}
|
local neighbors = {}
|
||||||
local name = string.gsub(Name,"[%p%s]",".")
|
local name = string.gsub(Name,"[%p%s]",".")
|
||||||
|
--self:I({Name=Name,name=name})
|
||||||
local shortestdist = 1000*1000
|
local shortestdist = 1000*1000
|
||||||
local nearest = nil
|
local nearest = nil
|
||||||
for _route,_data in pairs(self.disttable) do
|
for _route,_data in pairs(self.disttable) do
|
||||||
if string.find(_route,name,1,true) then
|
if string.find(_route,name,1,true) then
|
||||||
local dist = self.disttable[_route] -- #STRATEGO.DistData
|
local dist = self.disttable[_route] -- #STRATEGO.DistData
|
||||||
|
--self:I({route=_route,name=name})
|
||||||
local tname = string.gsub(_route,name,"")
|
local tname = string.gsub(_route,name,"")
|
||||||
local tname = string.gsub(tname,";","")
|
local tname = string.gsub(tname,";","")
|
||||||
|
--self:I({tname=tname,cname=self.easynames[tname]})
|
||||||
local cname = self.easynames[tname] -- name of target
|
local cname = self.easynames[tname] -- name of target
|
||||||
local encoa = self.coalition == coalition.side.BLUE and coalition.side.RED or coalition.side.BLUE
|
if cname then
|
||||||
if Enemies == true then
|
local encoa = self.coalition == coalition.side.BLUE and coalition.side.RED or coalition.side.BLUE
|
||||||
if self.airbasetable[cname].coalition == encoa then
|
if Enemies == true then
|
||||||
neighbors[cname] = dist
|
if self.airbasetable[cname].coalition == encoa then
|
||||||
|
neighbors[cname] = dist
|
||||||
|
end
|
||||||
|
elseif Friends == true then
|
||||||
|
if self.airbasetable[cname].coalition ~= encoa then
|
||||||
|
neighbors[cname] = dist
|
||||||
|
end
|
||||||
|
else
|
||||||
|
neighbors[cname] = dist
|
||||||
end
|
end
|
||||||
elseif Friends == true then
|
if neighbors[cname] and dist.dist < shortestdist then
|
||||||
if self.airbasetable[cname].coalition ~= encoa then
|
shortestdist = dist.dist
|
||||||
neighbors[cname] = dist
|
nearest = cname
|
||||||
end
|
end
|
||||||
else
|
|
||||||
neighbors[cname] = dist
|
|
||||||
end
|
|
||||||
if neighbors[cname] and dist.dist < shortestdist then
|
|
||||||
shortestdist = dist.dist
|
|
||||||
nearest = cname
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return neighbors, nearest, shortestdist
|
return neighbors, nearest, shortestdist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [INTERNAL] Route Finding - Find the next hop towards an end node from a start node
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string Start The name of the start node.
|
||||||
|
-- @param #string End The name of the end node.
|
||||||
|
-- @param #table InRoute Table of node names making up the route so far.
|
||||||
|
-- @return #string Name of the next closest node
|
||||||
|
function STRATEGO:_GetNextClosest(Start,End,InRoute)
|
||||||
|
local ecoord = self.airbasetable[End].coord
|
||||||
|
local nodes,nearest = self:FindNeighborNodes(Start)
|
||||||
|
--self:I(tostring(nearest))
|
||||||
|
local closest = nil
|
||||||
|
local closedist = 1000*1000
|
||||||
|
for _name,_dist in pairs(nodes) do
|
||||||
|
local kcoord = self.airbasetable[_name].coord
|
||||||
|
local nnodes = self.airbasetable[_name].connections > 2 and true or false
|
||||||
|
if _name == End then nnodes = true end
|
||||||
|
if kcoord ~= nil and ecoord ~= nil and nnodes == true and InRoute[_name] ~= true then
|
||||||
|
local dist = math.floor((kcoord:Get2DDistance(ecoord)/1000)+0.5)
|
||||||
|
if (dist < closedist ) then
|
||||||
|
closedist = dist
|
||||||
|
closest = _name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return closest
|
||||||
|
end
|
||||||
|
|
||||||
--- [USER] Find a route between two nodes.
|
--- [USER] Find a route between two nodes.
|
||||||
-- @param #STRATEGO self
|
-- @param #STRATEGO self
|
||||||
-- @param #string Start The name of the start node.
|
-- @param #string Start The name of the start node.
|
||||||
@@ -1124,15 +1284,19 @@ end
|
|||||||
-- @param #boolean Draw If true, draw the route on the map.
|
-- @param #boolean Draw If true, draw the route on the map.
|
||||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Defaults to black.
|
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Defaults to black.
|
||||||
-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 6.
|
-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 6.
|
||||||
|
-- @param #boolean NoOptimize If set to true, do not optimize (shorten) the resulting route if possible.
|
||||||
-- @return #table Route Table of #string name entries of the route
|
-- @return #table Route Table of #string name entries of the route
|
||||||
-- @return #boolean Complete If true, the route was found end-to-end.
|
-- @return #boolean Complete If true, the route was found end-to-end.
|
||||||
function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType)
|
-- @return #boolean Reverse If true, the route was found with a reverse search, the route table will be from sorted from end point to start point.
|
||||||
|
function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType,NoOptimize)
|
||||||
self:T(self.lid.."FindRoute")
|
self:T(self.lid.."FindRoute")
|
||||||
--self:I({Start,End,Hops})
|
--self:I({Start,End,Hops})
|
||||||
--local bases = UTILS.DeepCopy(self.airbasetable)
|
--local bases = UTILS.DeepCopy(self.airbasetable)
|
||||||
local Route = {}
|
local Route = {}
|
||||||
|
local InRoute = {}
|
||||||
local hops = Hops or 4
|
local hops = Hops or 4
|
||||||
local routecomplete = false
|
local routecomplete = false
|
||||||
|
local reverse = false
|
||||||
|
|
||||||
local function Checker(neighbors)
|
local function Checker(neighbors)
|
||||||
for _name,_data in pairs(neighbors) do
|
for _name,_data in pairs(neighbors) do
|
||||||
@@ -1143,26 +1307,7 @@ function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType)
|
|||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function NextClosest(Start,End)
|
|
||||||
local ecoord = self.airbasetable[End].coord
|
|
||||||
local nodes = self:FindNeighborNodes(Start)
|
|
||||||
local closest = nil
|
|
||||||
local closedist = 1000*1000
|
|
||||||
for _name,_dist in pairs(nodes) do
|
|
||||||
local kcoord = self.airbasetable[_name].coord
|
|
||||||
local dist = math.floor((kcoord:Get2DDistance(ecoord)/1000)+0.5)
|
|
||||||
if dist < closedist then
|
|
||||||
closedist = dist
|
|
||||||
closest = _name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if closest then
|
|
||||||
--MESSAGE:New(string.format("Start %s | End %s | Nextclosest %s",Start,End,closest),10,"STRATEGO"):ToLog():ToAll()
|
|
||||||
return closest
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function DrawRoute(Route)
|
local function DrawRoute(Route)
|
||||||
for i=1,#Route-1 do
|
for i=1,#Route-1 do
|
||||||
local p1=Route[i]
|
local p1=Route[i]
|
||||||
@@ -1177,6 +1322,7 @@ function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType)
|
|||||||
|
|
||||||
-- One hop
|
-- One hop
|
||||||
Route[#Route+1] = Start
|
Route[#Route+1] = Start
|
||||||
|
InRoute[Start] = true
|
||||||
local nodes = self:FindNeighborNodes(Start)
|
local nodes = self:FindNeighborNodes(Start)
|
||||||
local endpoint = Checker(nodes)
|
local endpoint = Checker(nodes)
|
||||||
|
|
||||||
@@ -1186,9 +1332,11 @@ function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType)
|
|||||||
else
|
else
|
||||||
local spoint = Start
|
local spoint = Start
|
||||||
for i=1,hops do
|
for i=1,hops do
|
||||||
local Next = NextClosest(spoint,End)
|
--self:I("Start="..tostring(spoint))
|
||||||
if Next then
|
local Next = self:_GetNextClosest(spoint,End,InRoute)
|
||||||
|
if Next ~= nil then
|
||||||
Route[#Route+1] = Next
|
Route[#Route+1] = Next
|
||||||
|
InRoute[Next] = true
|
||||||
local nodes = self:FindNeighborNodes(Next)
|
local nodes = self:FindNeighborNodes(Next)
|
||||||
local endpoint = Checker(nodes)
|
local endpoint = Checker(nodes)
|
||||||
if endpoint then
|
if endpoint then
|
||||||
@@ -1198,11 +1346,59 @@ function STRATEGO:FindRoute(Start,End,Hops,Draw,Color,LineType)
|
|||||||
else
|
else
|
||||||
spoint = Next
|
spoint = Next
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (self.debug or Draw) then DrawRoute(Route) end
|
|
||||||
return Route, routecomplete
|
-- optimize route
|
||||||
|
local function OptimizeRoute(Route)
|
||||||
|
local foundcut = false
|
||||||
|
local largestcut = 0
|
||||||
|
local cut = {}
|
||||||
|
for i=1,#Route do
|
||||||
|
--self:I({Start=Route[i]})
|
||||||
|
local found,nodes = self:GetRoutesFromNode(Route[i])
|
||||||
|
for _,_name in pairs(nodes or {}) do
|
||||||
|
for j=i+2,#Route do
|
||||||
|
if _name == Route[j] then
|
||||||
|
--self:I({"Shortcut",Route[i],Route[j]})
|
||||||
|
if j-i > largestcut then
|
||||||
|
largestcut = j-i
|
||||||
|
cut = {i=i,j=j}
|
||||||
|
foundcut = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if foundcut then
|
||||||
|
local newroute = {}
|
||||||
|
for i=1,#Route do
|
||||||
|
if i<= cut.i or i>=cut.j then
|
||||||
|
table.insert(newroute,Route[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return newroute
|
||||||
|
end
|
||||||
|
return Route, foundcut
|
||||||
|
end
|
||||||
|
|
||||||
|
if routecomplete == true and NoOptimize ~= true then
|
||||||
|
local foundcut = true
|
||||||
|
while foundcut ~= false do
|
||||||
|
Route, foundcut = OptimizeRoute(Route)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- reverse search
|
||||||
|
Route, routecomplete = self:FindRoute(End,Start,Hops,Draw,Color,LineType)
|
||||||
|
reverse = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if (self.debug or Draw) then DrawRoute(Route) end
|
||||||
|
|
||||||
|
return Route, routecomplete, reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
--- [USER] Add budget points.
|
--- [USER] Add budget points.
|
||||||
@@ -1309,6 +1505,139 @@ function STRATEGO:FindAffordableConsolidationTarget()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [INTERNAL] Internal helper function to check for islands, aka Floodtest
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string next Name of the start node
|
||||||
|
-- @param #table filled #table of visited nodes
|
||||||
|
-- @param #table unfilled #table if unvisited nodes
|
||||||
|
-- @return #STRATEGO self
|
||||||
|
function STRATEGO:_FloodNext(next,filled,unfilled)
|
||||||
|
local start = self:FindNeighborNodes(next)
|
||||||
|
for _name,_ in pairs (start) do
|
||||||
|
if filled[_name] ~= true then
|
||||||
|
self:T("Flooding ".._name)
|
||||||
|
filled[_name] = true
|
||||||
|
unfilled[_name] = nil
|
||||||
|
self:_FloodNext(_name,filled,unfilled)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [INTERNAL] Internal helper function to check for islands, aka Floodtest
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #string Start Name of the start node
|
||||||
|
-- @param #table ABTable (Optional) #table of node names to check.
|
||||||
|
-- @return #STRATEGO self
|
||||||
|
function STRATEGO:_FloodFill(Start,ABTable)
|
||||||
|
self:T("Start = "..tostring(Start))
|
||||||
|
if Start == nil then return end
|
||||||
|
local filled = {}
|
||||||
|
local unfilled = {}
|
||||||
|
if ABTable then
|
||||||
|
unfilled = ABTable
|
||||||
|
else
|
||||||
|
for _name,_ in pairs(self.airbasetable) do
|
||||||
|
unfilled[_name] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
filled[Start] = true
|
||||||
|
unfilled[Start] = nil
|
||||||
|
local start = self:FindNeighborNodes(Start)
|
||||||
|
for _name,_ in pairs (start) do
|
||||||
|
if filled[_name] ~= true then
|
||||||
|
self:T("Flooding ".._name)
|
||||||
|
filled[_name] = true
|
||||||
|
unfilled[_name] = nil
|
||||||
|
self:_FloodNext(_name,filled,unfilled)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return filled, unfilled
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [INTERNAL] Internal helper function to check for islands, aka Floodtest
|
||||||
|
-- @param #STRATEGO self
|
||||||
|
-- @param #boolen connect If true, connect the two resulting islands at the shortest distance if necessary
|
||||||
|
-- @param #boolen draw If true, draw outer vertices of found node networks
|
||||||
|
-- @return #boolean Connected If true, all nodes are in one network
|
||||||
|
-- @return #table Network #table of node names in the network
|
||||||
|
-- @return #table Unconnected #table of node names **not** in the network
|
||||||
|
function STRATEGO:_FloodTest(connect,draw)
|
||||||
|
|
||||||
|
local function GetElastic(bases)
|
||||||
|
local vec2table = {}
|
||||||
|
for _name,_ in pairs(bases) do
|
||||||
|
local coord = self.airbasetable[_name].coord
|
||||||
|
local vec2 = coord:GetVec2()
|
||||||
|
table.insert(vec2table,vec2)
|
||||||
|
end
|
||||||
|
local zone = ZONE_ELASTIC:New("STRATEGO-Floodtest-"..math.random(1,10000),vec2table)
|
||||||
|
return zone
|
||||||
|
end
|
||||||
|
|
||||||
|
local function DrawElastic(filled,drawit)
|
||||||
|
local zone = GetElastic(filled)
|
||||||
|
if drawit then
|
||||||
|
zone:SetColor({1,1,1},1)
|
||||||
|
zone:SetDrawCoalition(-1)
|
||||||
|
zone:Update(1,true) -- draw zone
|
||||||
|
end
|
||||||
|
return zone
|
||||||
|
end
|
||||||
|
|
||||||
|
local _,_,weight,name = self:GetHighestWeightNodes()
|
||||||
|
local filled, unfilled = self:_FloodFill(name)
|
||||||
|
local allin = true
|
||||||
|
if table.length(unfilled) > 0 then
|
||||||
|
MESSAGE:New("There is at least one node island!",15,"STRATEGO"):ToAllIf(self.debug):ToLog()
|
||||||
|
allin = false
|
||||||
|
if self.debug == true then
|
||||||
|
local zone1 = DrawElastic(filled,draw)
|
||||||
|
local zone2 = DrawElastic(unfilled,draw)
|
||||||
|
local vertices1 = zone1:GetVerticiesVec2()
|
||||||
|
local vertices2 = zone2:GetVerticiesVec2()
|
||||||
|
-- get closest vertices
|
||||||
|
local corner1 = nil
|
||||||
|
local corner2 = nil
|
||||||
|
local mindist = math.huge
|
||||||
|
local found = false
|
||||||
|
for _,_edge in pairs(vertices1) do
|
||||||
|
for _,_edge2 in pairs(vertices2) do
|
||||||
|
local dist=UTILS.VecDist2D(_edge,_edge2)
|
||||||
|
if dist < mindist then
|
||||||
|
mindist = dist
|
||||||
|
corner1 = _edge
|
||||||
|
corner2 = _edge2
|
||||||
|
found = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if found then
|
||||||
|
local Corner = COORDINATE:NewFromVec2(corner1)
|
||||||
|
local Corner2 = COORDINATE:NewFromVec2(corner2)
|
||||||
|
Corner:LineToAll(Corner2,-1,{1,1,1},1,1,true,"Island2Island")
|
||||||
|
local cornername
|
||||||
|
local cornername2
|
||||||
|
for _name,_data in pairs(self.airbasetable) do
|
||||||
|
local zone = _data.zone
|
||||||
|
if zone:IsVec2InZone(corner1) then
|
||||||
|
cornername = _name
|
||||||
|
self:T("Corner1 = ".._name)
|
||||||
|
end
|
||||||
|
if zone:IsVec2InZone(corner2) then
|
||||||
|
cornername2 = _name
|
||||||
|
self:T("Corner2 = ".._name)
|
||||||
|
end
|
||||||
|
if cornername and cornername2 and connect == true then
|
||||||
|
self:AddRoutesManually(cornername,cornername2,Color,Linetype,self.debug)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return allin, filled, unfilled
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- End
|
-- End
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -288,7 +288,7 @@ function TIRESIAS:_InitGroups()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
||||||
if grp.Tiresias.invisible and grp.Tiresias.invisible == false then
|
if grp.Tiresias.invisible == false then
|
||||||
grp:SetCommandInvisible(true)
|
grp:SetCommandInvisible(true)
|
||||||
grp.Tiresias.invisible = true
|
grp.Tiresias.invisible = true
|
||||||
if SwitchAAA then
|
if SwitchAAA then
|
||||||
@@ -315,10 +315,11 @@ function TIRESIAS:_InitGroups()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
||||||
if grp.Tiresias and grp.Tiresias.invisible and grp.Tiresias.invisible == false then
|
if grp.Tiresias and grp.Tiresias.invisible == false then
|
||||||
grp:SetCommandInvisible(true)
|
grp:SetCommandInvisible(true)
|
||||||
grp:SetAIOff()
|
grp:SetAIOff()
|
||||||
grp.Tiresias.invisible = true
|
grp.Tiresias.invisible = true
|
||||||
|
grp.Tiresias.AIOff = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--BASE:I(string.format("Init/Switch off Vehicle %s (Exception %s)",grp:GetName(),tostring(grp.Tiresias.exception)))
|
--BASE:I(string.format("Init/Switch off Vehicle %s (Exception %s)",grp:GetName(),tostring(grp.Tiresias.exception)))
|
||||||
@@ -336,7 +337,7 @@ function TIRESIAS:_InitGroups()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
if grp.Tiresias and (not grp.Tiresias.exception == true) then
|
||||||
if grp.Tiresias and grp.Tiresias.invisible and grp.Tiresias.invisible == false then
|
if grp.Tiresias and grp.Tiresias.invisible == false then
|
||||||
grp:SetCommandInvisible(true)
|
grp:SetCommandInvisible(true)
|
||||||
grp.Tiresias.invisible = true
|
grp.Tiresias.invisible = true
|
||||||
end
|
end
|
||||||
@@ -391,7 +392,9 @@ function TIRESIAS:_SwitchOnGroups(group,radius)
|
|||||||
if ground:CountAlive() > 0 then
|
if ground:CountAlive() > 0 then
|
||||||
ground:ForEachGroupAlive(
|
ground:ForEachGroupAlive(
|
||||||
function(grp)
|
function(grp)
|
||||||
if grp.Tiresias and grp.Tiresias.type and (not grp.Tiresias.exception == true ) then
|
local name = grp:GetName()
|
||||||
|
if grp:GetCoalition() ~= group:GetCoalition()
|
||||||
|
and 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)
|
||||||
grp.Tiresias.invisible = false
|
grp.Tiresias.invisible = false
|
||||||
@@ -407,7 +410,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
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6047,7 +6047,7 @@ function WAREHOUSE:_SpawnAssetAircraft(alias, asset, request, parking, uncontrol
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if #parking<#template.units and not airstart then
|
if parking and #parking<#template.units and not airstart then
|
||||||
local text=string.format("ERROR: Not enough parking! Free parking = %d < %d aircraft to be spawned.", #parking, #template.units)
|
local text=string.format("ERROR: Not enough parking! Free parking = %d < %d aircraft to be spawned.", #parking, #template.units)
|
||||||
self:_DebugMessage(text)
|
self:_DebugMessage(text)
|
||||||
return nil
|
return nil
|
||||||
@@ -6089,7 +6089,7 @@ function WAREHOUSE:_SpawnAssetAircraft(alias, asset, request, parking, uncontrol
|
|||||||
terminal=parking[i].TerminalID
|
terminal=parking[i].TerminalID
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.Debug then
|
if self.Debug and terminal then
|
||||||
local text=string.format("Spawnplace unit %s terminal %d.", unit.name, terminal)
|
local text=string.format("Spawnplace unit %s terminal %d.", unit.name, terminal)
|
||||||
coord:MarkToAll(text)
|
coord:MarkToAll(text)
|
||||||
env.info(text)
|
env.info(text)
|
||||||
@@ -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
|
||||||
@@ -8120,9 +8122,11 @@ function WAREHOUSE:_FindParkingForAssets(airbase, assets)
|
|||||||
-- Debug output for occupied spots.
|
-- Debug output for occupied spots.
|
||||||
if self.Debug then
|
if self.Debug then
|
||||||
local coord=problem.coord --Core.Point#COORDINATE
|
local coord=problem.coord --Core.Point#COORDINATE
|
||||||
local text=string.format("Obstacle %s [type=%s] blocking spot=%d! Size=%.1f m and distance=%.1f m.", problem.name, problem.type, _termid, problem.size, problem.dist)
|
if coord then
|
||||||
self:I(self.lid..text)
|
local text=string.format("Obstacle %s [type=%s] blocking spot=%d! Size=%.1f m and distance=%.1f m.", problem.name, problem.type, _termid, problem.size, problem.dist)
|
||||||
coord:MarkToAll(string.format(text))
|
self:I(self.lid..text)
|
||||||
|
coord:MarkToAll(text)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self:T(self.lid..string.format("Parking spot %d is occupied or not big enough!", _termid))
|
self:T(self.lid..string.format("Parking spot %d is occupied or not big enough!", _termid))
|
||||||
end
|
end
|
||||||
@@ -8431,12 +8435,14 @@ function WAREHOUSE:_GetAttribute(group)
|
|||||||
local attribute=WAREHOUSE.Attribute.OTHER_UNKNOWN --#WAREHOUSE.Attribute
|
local attribute=WAREHOUSE.Attribute.OTHER_UNKNOWN --#WAREHOUSE.Attribute
|
||||||
|
|
||||||
if group then
|
if group then
|
||||||
|
|
||||||
|
local groupCat=group:GetCategory()
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
--- Air ---
|
--- Air ---
|
||||||
-----------
|
-----------
|
||||||
-- Planes
|
-- Planes
|
||||||
local transportplane=group:HasAttribute("Transports") and group:HasAttribute("Planes")
|
local transportplane=group:HasAttribute("Transports") and group:HasAttribute("Planes") and groupCat==Group.Category.AIRPLANE
|
||||||
local awacs=group:HasAttribute("AWACS")
|
local awacs=group:HasAttribute("AWACS")
|
||||||
local fighter=group:HasAttribute("Fighters") or group:HasAttribute("Interceptors") or group:HasAttribute("Multirole fighters") or (group:HasAttribute("Bombers") and not group:HasAttribute("Strategic bombers"))
|
local fighter=group:HasAttribute("Fighters") or group:HasAttribute("Interceptors") or group:HasAttribute("Multirole fighters") or (group:HasAttribute("Bombers") and not group:HasAttribute("Strategic bombers"))
|
||||||
local bomber=group:HasAttribute("Strategic bombers")
|
local bomber=group:HasAttribute("Strategic bombers")
|
||||||
@@ -8591,7 +8597,6 @@ end
|
|||||||
-- @param #WAREHOUSE.Queueitem qitem Item of queue to be removed.
|
-- @param #WAREHOUSE.Queueitem qitem Item of queue to be removed.
|
||||||
-- @param #table queue The queue from which the item should be deleted.
|
-- @param #table queue The queue from which the item should be deleted.
|
||||||
function WAREHOUSE:_DeleteQueueItem(qitem, queue)
|
function WAREHOUSE:_DeleteQueueItem(qitem, queue)
|
||||||
self:F({qitem=qitem, queue=queue})
|
|
||||||
|
|
||||||
for i=1,#queue do
|
for i=1,#queue do
|
||||||
local _item=queue[i] --#WAREHOUSE.Queueitem
|
local _item=queue[i] --#WAREHOUSE.Queueitem
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ _SCHEDULEDISPATCHER = SCHEDULEDISPATCHER:New() -- Core.ScheduleDispatcher#SCHEDU
|
|||||||
_DATABASE = DATABASE:New() -- Core.Database#DATABASE
|
_DATABASE = DATABASE:New() -- Core.Database#DATABASE
|
||||||
|
|
||||||
--- Settings
|
--- Settings
|
||||||
_SETTINGS = SETTINGS:Set()
|
_SETTINGS = SETTINGS:Set() -- Core.Settings#SETTINGS
|
||||||
_SETTINGS:SetPlayerMenuOn()
|
_SETTINGS:SetPlayerMenuOn()
|
||||||
|
|
||||||
--- Register cargos.
|
--- Register cargos.
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Utilities/Enums.lua' )
|
__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/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 +47,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 +83,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' )
|
||||||
@@ -154,6 +154,14 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Actions/Act_Route.lua' )
|
|||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Actions/Act_Account.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Actions/Act_Account.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Actions/Act_Assist.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Actions/Act_Assist.lua' )
|
||||||
|
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/ShapeBase.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Circle.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Cube.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Line.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Oval.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Polygon.lua' )
|
||||||
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Triangle.lua' )
|
||||||
|
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/UserSound.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/UserSound.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/SoundOutput.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/SoundOutput.lua' )
|
||||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/Radio.lua' )
|
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Sound/Radio.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' )
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -187,7 +187,7 @@ AIRWING = {
|
|||||||
|
|
||||||
--- AIRWING class version.
|
--- AIRWING class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AIRWING.version="0.9.5"
|
AIRWING.version="0.9.6"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@@ -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 ---
|
||||||
@@ -1362,16 +1365,20 @@ function AIRWING:CheckRescuhelo()
|
|||||||
|
|
||||||
local N=self:CountMissionsInQueue({AUFTRAG.Type.RESCUEHELO})
|
local N=self:CountMissionsInQueue({AUFTRAG.Type.RESCUEHELO})
|
||||||
|
|
||||||
local name=self.airbase:GetName()
|
if self.airbase then
|
||||||
|
|
||||||
local carrier=UNIT:FindByName(name)
|
local name=self.airbase:GetName()
|
||||||
|
|
||||||
for i=1,self.nflightsRescueHelo-N do
|
local carrier=UNIT:FindByName(name)
|
||||||
|
|
||||||
local mission=AUFTRAG:NewRESCUEHELO(carrier)
|
for i=1,self.nflightsRescueHelo-N do
|
||||||
|
|
||||||
self:AddMission(mission)
|
local mission=AUFTRAG:NewRESCUEHELO(carrier)
|
||||||
|
|
||||||
|
self:AddMission(mission)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -255,6 +255,7 @@
|
|||||||
-- @field #boolean skipperUturn U-turn on/off via menu.
|
-- @field #boolean skipperUturn U-turn on/off via menu.
|
||||||
-- @field #number skipperOffset Holding offset angle in degrees for Case II/III manual recoveries.
|
-- @field #number skipperOffset Holding offset angle in degrees for Case II/III manual recoveries.
|
||||||
-- @field #number skipperTime Recovery time in min for manual recovery.
|
-- @field #number skipperTime Recovery time in min for manual recovery.
|
||||||
|
-- @field #boolean intowindold If true, use old into wind calculation.
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- Be the boss!
|
--- Be the boss!
|
||||||
@@ -2724,6 +2725,18 @@ function AIRBOSS:SetLSOCallInterval( TimeInterval )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set if old into wind calculation is used when carrier turns into the wind for a recovery.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #boolean SwitchOn If `true` or `nil`, use old into wind calculation.
|
||||||
|
-- @return #AIRBOSS self
|
||||||
|
function AIRBOSS:SetIntoWindLegacy( SwitchOn )
|
||||||
|
if SwitchOn==nil then
|
||||||
|
SwitchOn=true
|
||||||
|
end
|
||||||
|
self.intowindold=SwitchOn
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Airboss is a rather nice guy and not strictly following the rules. Fore example, he does allow you into the landing pattern if you are not coming from the Marshal stack.
|
--- Airboss is a rather nice guy and not strictly following the rules. Fore example, he does allow you into the landing pattern if you are not coming from the Marshal stack.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param #boolean Switch If true or nil, Airboss bends the rules a bit.
|
-- @param #boolean Switch If true or nil, Airboss bends the rules a bit.
|
||||||
@@ -3602,7 +3615,7 @@ function AIRBOSS:onafterStart( From, Event, To )
|
|||||||
|
|
||||||
-- Handle events.
|
-- Handle events.
|
||||||
self:HandleEvent( EVENTS.Birth )
|
self:HandleEvent( EVENTS.Birth )
|
||||||
self:HandleEvent( EVENTS.Land )
|
self:HandleEvent( EVENTS.RunwayTouch )
|
||||||
self:HandleEvent( EVENTS.EngineShutdown )
|
self:HandleEvent( EVENTS.EngineShutdown )
|
||||||
self:HandleEvent( EVENTS.Takeoff )
|
self:HandleEvent( EVENTS.Takeoff )
|
||||||
self:HandleEvent( EVENTS.Crash )
|
self:HandleEvent( EVENTS.Crash )
|
||||||
@@ -3610,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)
|
||||||
@@ -3642,6 +3656,12 @@ function AIRBOSS:onafterStatus( From, Event, To )
|
|||||||
local pos = self:GetCoordinate()
|
local pos = self:GetCoordinate()
|
||||||
local speed = self.carrier:GetVelocityKNOTS()
|
local speed = self.carrier:GetVelocityKNOTS()
|
||||||
|
|
||||||
|
-- Update magnetic variation if we can get it from DCS.
|
||||||
|
if require then
|
||||||
|
self.magvar=pos:GetMagneticDeclination()
|
||||||
|
--env.info(string.format("FF magvar=%.1f", self.magvar))
|
||||||
|
end
|
||||||
|
|
||||||
-- Check water is ahead.
|
-- Check water is ahead.
|
||||||
local collision = false -- self:_CheckCollisionCoord(pos:Translate(self.collisiondist, hdg))
|
local collision = false -- self:_CheckCollisionCoord(pos:Translate(self.collisiondist, hdg))
|
||||||
|
|
||||||
@@ -4361,7 +4381,7 @@ function AIRBOSS:onafterStop( From, Event, To )
|
|||||||
|
|
||||||
-- Unhandle events.
|
-- Unhandle events.
|
||||||
self:UnHandleEvent( EVENTS.Birth )
|
self:UnHandleEvent( EVENTS.Birth )
|
||||||
self:UnHandleEvent( EVENTS.Land )
|
self:UnHandleEvent( EVENTS.RunwayTouch )
|
||||||
self:UnHandleEvent( EVENTS.EngineShutdown )
|
self:UnHandleEvent( EVENTS.EngineShutdown )
|
||||||
self:UnHandleEvent( EVENTS.Takeoff )
|
self:UnHandleEvent( EVENTS.Takeoff )
|
||||||
self:UnHandleEvent( EVENTS.Crash )
|
self:UnHandleEvent( EVENTS.Crash )
|
||||||
@@ -5201,6 +5221,7 @@ function AIRBOSS:_InitVoiceOvers()
|
|||||||
TOMCAT = { file = "PILOT-Tomcat", suffix = "ogg", loud = false, subtitle = "", duration = 0.66, subduration = 5 },
|
TOMCAT = { file = "PILOT-Tomcat", suffix = "ogg", loud = false, subtitle = "", duration = 0.66, subduration = 5 },
|
||||||
HORNET = { file = "PILOT-Hornet", suffix = "ogg", loud = false, subtitle = "", duration = 0.56, subduration = 5 },
|
HORNET = { file = "PILOT-Hornet", suffix = "ogg", loud = false, subtitle = "", duration = 0.56, subduration = 5 },
|
||||||
VIKING = { file = "PILOT-Viking", suffix = "ogg", loud = false, subtitle = "", duration = 0.61, subduration = 5 },
|
VIKING = { file = "PILOT-Viking", suffix = "ogg", loud = false, subtitle = "", duration = 0.61, subduration = 5 },
|
||||||
|
GREYHOUND = { file = "PILOT-Greyhound", suffix = "ogg", loud = false, subtitle = "", duration = 0.61, subduration = 5 },
|
||||||
BALL = { file = "PILOT-Ball", suffix = "ogg", loud = false, subtitle = "", duration = 0.50, subduration = 5 },
|
BALL = { file = "PILOT-Ball", suffix = "ogg", loud = false, subtitle = "", duration = 0.50, subduration = 5 },
|
||||||
BINGOFUEL = { file = "PILOT-BingoFuel", suffix = "ogg", loud = false, subtitle = "", duration = 0.80 },
|
BINGOFUEL = { file = "PILOT-BingoFuel", suffix = "ogg", loud = false, subtitle = "", duration = 0.80 },
|
||||||
GASATDIVERT = { file = "PILOT-GasAtDivert", suffix = "ogg", loud = false, subtitle = "", duration = 1.80 },
|
GASATDIVERT = { file = "PILOT-GasAtDivert", suffix = "ogg", loud = false, subtitle = "", duration = 1.80 },
|
||||||
@@ -6475,7 +6496,7 @@ function AIRBOSS:_LandAI( flight )
|
|||||||
or flight.actype == AIRBOSS.AircraftCarrier.RHINOF
|
or flight.actype == AIRBOSS.AircraftCarrier.RHINOF
|
||||||
or flight.actype == AIRBOSS.AircraftCarrier.GROWLER then
|
or flight.actype == AIRBOSS.AircraftCarrier.GROWLER then
|
||||||
Speed = UTILS.KnotsToKmph( 200 )
|
Speed = UTILS.KnotsToKmph( 200 )
|
||||||
elseif flight.actype == AIRBOSS.AircraftCarrier.E2D then
|
elseif flight.actype == AIRBOSS.AircraftCarrier.E2D or flight.actype == AIRBOSS.AircraftCarrier.C2A then
|
||||||
Speed = UTILS.KnotsToKmph( 150 )
|
Speed = UTILS.KnotsToKmph( 150 )
|
||||||
elseif flight.actype == AIRBOSS.AircraftCarrier.F14A_AI or flight.actype == AIRBOSS.AircraftCarrier.F14A or flight.actype == AIRBOSS.AircraftCarrier.F14B then
|
elseif flight.actype == AIRBOSS.AircraftCarrier.F14A_AI or flight.actype == AIRBOSS.AircraftCarrier.F14A or flight.actype == AIRBOSS.AircraftCarrier.F14B then
|
||||||
Speed = UTILS.KnotsToKmph( 175 )
|
Speed = UTILS.KnotsToKmph( 175 )
|
||||||
@@ -8270,7 +8291,7 @@ end
|
|||||||
--- Airboss event handler for event land.
|
--- Airboss event handler for event land.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AIRBOSS:OnEventLand( EventData )
|
function AIRBOSS:OnEventRunwayTouch( EventData )
|
||||||
self:F3( { eventland = EventData } )
|
self:F3( { eventland = EventData } )
|
||||||
|
|
||||||
-- Nil checks.
|
-- Nil checks.
|
||||||
@@ -11476,7 +11497,7 @@ end
|
|||||||
|
|
||||||
--- Get wind direction and speed at carrier position.
|
--- Get wind direction and speed at carrier position.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param #number alt Altitude ASL in meters. Default 15 m.
|
-- @param #number alt Altitude ASL in meters. Default 18 m.
|
||||||
-- @param #boolean magnetic Direction including magnetic declination.
|
-- @param #boolean magnetic Direction including magnetic declination.
|
||||||
-- @param Core.Point#COORDINATE coord (Optional) Coordinate at which to get the wind. Default is current carrier position.
|
-- @param Core.Point#COORDINATE coord (Optional) Coordinate at which to get the wind. Default is current carrier position.
|
||||||
-- @return #number Direction the wind is blowing **from** in degrees.
|
-- @return #number Direction the wind is blowing **from** in degrees.
|
||||||
@@ -11548,10 +11569,31 @@ end
|
|||||||
|
|
||||||
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
|
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #number vdeck Desired wind velocity over deck in knots.
|
||||||
-- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned.
|
-- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned.
|
||||||
-- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
|
-- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
|
||||||
-- @return #number Carrier heading in degrees.
|
-- @return #number Carrier heading in degrees.
|
||||||
function AIRBOSS:GetHeadingIntoWind_old( magnetic, coord )
|
-- @return #number Carrier speed in knots to reach desired wind speed on deck.
|
||||||
|
function AIRBOSS:GetHeadingIntoWind(vdeck, magnetic, coord )
|
||||||
|
|
||||||
|
if self.intowindold then
|
||||||
|
--env.info("FF use OLD into wind")
|
||||||
|
return self:GetHeadingIntoWind_old(vdeck, magnetic, coord)
|
||||||
|
else
|
||||||
|
--env.info("FF use NEW into wind")
|
||||||
|
return self:GetHeadingIntoWind_new(vdeck, magnetic, coord)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #number vdeck Desired wind velocity over deck in knots.
|
||||||
|
-- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned.
|
||||||
|
-- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
|
||||||
|
-- @return #number Carrier heading in degrees.
|
||||||
|
function AIRBOSS:GetHeadingIntoWind_old( vdeck, magnetic, coord )
|
||||||
|
|
||||||
local function adjustDegreesForWindSpeed(windSpeed)
|
local function adjustDegreesForWindSpeed(windSpeed)
|
||||||
local degreesAdjustment = 0
|
local degreesAdjustment = 0
|
||||||
@@ -11608,7 +11650,13 @@ function AIRBOSS:GetHeadingIntoWind_old( magnetic, coord )
|
|||||||
intowind = intowind + 360
|
intowind = intowind + 360
|
||||||
end
|
end
|
||||||
|
|
||||||
return intowind
|
-- Wind speed.
|
||||||
|
--local _, vwind = self:GetWind()
|
||||||
|
|
||||||
|
-- Speed of carrier in m/s but at least 4 knots.
|
||||||
|
local vtot = math.max(vdeck-UTILS.MpsToKnots(vwind), 4)
|
||||||
|
|
||||||
|
return intowind, vtot
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
|
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
|
||||||
@@ -11619,7 +11667,7 @@ end
|
|||||||
-- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
|
-- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
|
||||||
-- @return #number Carrier heading in degrees.
|
-- @return #number Carrier heading in degrees.
|
||||||
-- @return #number Carrier speed in knots to reach desired wind speed on deck.
|
-- @return #number Carrier speed in knots to reach desired wind speed on deck.
|
||||||
function AIRBOSS:GetHeadingIntoWind( vdeck, magnetic, coord )
|
function AIRBOSS:GetHeadingIntoWind_new( vdeck, magnetic, coord )
|
||||||
|
|
||||||
-- Default offset angle.
|
-- Default offset angle.
|
||||||
local Offset=self.carrierparam.rwyangle or 0
|
local Offset=self.carrierparam.rwyangle or 0
|
||||||
@@ -14280,6 +14328,8 @@ function AIRBOSS:_GetACNickname( actype )
|
|||||||
nickname = "Harrier"
|
nickname = "Harrier"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.E2D then
|
elseif actype == AIRBOSS.AircraftCarrier.E2D then
|
||||||
nickname = "Hawkeye"
|
nickname = "Hawkeye"
|
||||||
|
elseif actype == AIRBOSS.AircraftCarrier.C2A then
|
||||||
|
nickname = "Greyhound"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.F14A_AI or actype == AIRBOSS.AircraftCarrier.F14A or actype == AIRBOSS.AircraftCarrier.F14B then
|
elseif actype == AIRBOSS.AircraftCarrier.F14A_AI or actype == AIRBOSS.AircraftCarrier.F14A or actype == AIRBOSS.AircraftCarrier.F14B then
|
||||||
nickname = "Tomcat"
|
nickname = "Tomcat"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.FA18C or actype == AIRBOSS.AircraftCarrier.HORNET then
|
elseif actype == AIRBOSS.AircraftCarrier.FA18C or actype == AIRBOSS.AircraftCarrier.HORNET then
|
||||||
@@ -14317,32 +14367,55 @@ function AIRBOSS:_GetOnboardNumbers( group, playeronly )
|
|||||||
-- Debug text.
|
-- Debug text.
|
||||||
local text = string.format( "Onboard numbers of group %s:", groupname )
|
local text = string.format( "Onboard numbers of group %s:", groupname )
|
||||||
|
|
||||||
-- Units of template group.
|
local template=group:GetTemplate()
|
||||||
local units = group:GetTemplate().units
|
|
||||||
|
|
||||||
-- Get numbers.
|
|
||||||
local numbers = {}
|
local numbers = {}
|
||||||
for _, unit in pairs( units ) do
|
if template then
|
||||||
|
|
||||||
-- Onboard number and unit name.
|
-- Units of template group.
|
||||||
local n = tostring( unit.onboard_num )
|
local units = template.units
|
||||||
local name = unit.name
|
|
||||||
local skill = unit.skill or "Unknown"
|
|
||||||
|
|
||||||
-- Debug text.
|
-- Get numbers.
|
||||||
text = text .. string.format( "\n- unit %s: onboard #=%s skill=%s", name, n, tostring( skill ) )
|
for _, unit in pairs( units ) do
|
||||||
|
|
||||||
if playeronly and skill == "Client" or skill == "Player" then
|
-- Onboard number and unit name.
|
||||||
-- There can be only one player in the group, so we skip everything else.
|
local n = tostring( unit.onboard_num )
|
||||||
return n
|
local name = unit.name
|
||||||
|
local skill = unit.skill or "Unknown"
|
||||||
|
|
||||||
|
-- Debug text.
|
||||||
|
text = text .. string.format( "\n- unit %s: onboard #=%s skill=%s", name, n, tostring( skill ) )
|
||||||
|
|
||||||
|
if playeronly and skill == "Client" or skill == "Player" then
|
||||||
|
-- There can be only one player in the group, so we skip everything else.
|
||||||
|
return n
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Table entry.
|
||||||
|
numbers[name] = n
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Table entry.
|
-- Debug info.
|
||||||
numbers[name] = n
|
self:T2( self.lid .. text )
|
||||||
end
|
|
||||||
|
|
||||||
-- Debug info.
|
else
|
||||||
self:T2( self.lid .. text )
|
|
||||||
|
if playeronly then
|
||||||
|
return 101
|
||||||
|
else
|
||||||
|
|
||||||
|
local units=group:GetUnits()
|
||||||
|
|
||||||
|
for i,_unit in pairs(units) do
|
||||||
|
local name=_unit:GetName()
|
||||||
|
|
||||||
|
numbers[name]=100+i
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
return numbers
|
return numbers
|
||||||
end
|
end
|
||||||
@@ -14607,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()
|
||||||
@@ -15578,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
|
||||||
@@ -15646,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
|
||||||
@@ -18014,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
|
||||||
|
|
||||||
@@ -18066,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
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||||
--
|
--
|
||||||
@@ -161,6 +162,7 @@
|
|||||||
-- @field #number missionRange Mission range in meters. Used by LEGION classes (AIRWING, BRIGADE, ...).
|
-- @field #number missionRange Mission range in meters. Used by LEGION classes (AIRWING, BRIGADE, ...).
|
||||||
-- @field Core.Point#COORDINATE missionWaypointCoord Mission waypoint coordinate.
|
-- @field Core.Point#COORDINATE missionWaypointCoord Mission waypoint coordinate.
|
||||||
-- @field Core.Point#COORDINATE missionEgressCoord Mission egress waypoint coordinate.
|
-- @field Core.Point#COORDINATE missionEgressCoord Mission egress waypoint coordinate.
|
||||||
|
-- @field Core.Point#COORDINATE missionIngressCoord Mission Ingress waypoint coordinate.
|
||||||
-- @field #number missionWaypointRadius Random radius in meters.
|
-- @field #number missionWaypointRadius Random radius in meters.
|
||||||
-- @field #boolean legionReturn If `true`, assets return to their legion (default). If `false`, they will stay alive.
|
-- @field #boolean legionReturn If `true`, assets return to their legion (default). If `false`, they will stay alive.
|
||||||
--
|
--
|
||||||
@@ -239,6 +241,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 +451,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 +498,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 +1070,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 +1081,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)
|
||||||
|
|
||||||
@@ -1707,15 +1719,16 @@ end
|
|||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC or TARGET object.
|
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC or TARGET object.
|
||||||
-- @param #number Altitude Engage altitude in feet. Default 2000 ft.
|
-- @param #number Altitude Engage altitude in feet. Default 2000 ft.
|
||||||
|
-- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:NewSTRIKE(Target, Altitude)
|
function AUFTRAG:NewSTRIKE(Target, Altitude, EngageWeaponType)
|
||||||
|
|
||||||
local mission=AUFTRAG:New(AUFTRAG.Type.STRIKE)
|
local mission=AUFTRAG:New(AUFTRAG.Type.STRIKE)
|
||||||
|
|
||||||
mission:_TargetFromObject(Target)
|
mission:_TargetFromObject(Target)
|
||||||
|
|
||||||
-- DCS Task options:
|
-- DCS Task options:
|
||||||
mission.engageWeaponType=ENUMS.WeaponFlag.Auto
|
mission.engageWeaponType=EngageWeaponType or ENUMS.WeaponFlag.Auto
|
||||||
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 2000)
|
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 2000)
|
||||||
|
|
||||||
@@ -1734,18 +1747,20 @@ 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.
|
||||||
|
-- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:NewBOMBING(Target, Altitude)
|
function AUFTRAG:NewBOMBING(Target, Altitude, EngageWeaponType)
|
||||||
|
|
||||||
local mission=AUFTRAG:New(AUFTRAG.Type.BOMBING)
|
local mission=AUFTRAG:New(AUFTRAG.Type.BOMBING)
|
||||||
|
|
||||||
mission:_TargetFromObject(Target)
|
mission:_TargetFromObject(Target)
|
||||||
|
|
||||||
-- DCS task options:
|
-- DCS task options:
|
||||||
mission.engageWeaponType=ENUMS.WeaponFlag.Auto
|
mission.engageWeaponType=EngageWeaponType or 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)
|
||||||
|
|
||||||
@@ -1767,9 +1782,47 @@ 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 do not have a runway.
|
||||||
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:NewBOMBRUNWAY(Airdrome, Altitude)
|
function AUFTRAG:NewBOMBRUNWAY(Airdrome, Altitude)
|
||||||
@@ -1821,7 +1874,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.
|
||||||
|
|
||||||
@@ -2105,7 +2158,11 @@ end
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--- **[GROUND, NAVAL]** Create an ARTY mission.
|
--- **[GROUND, NAVAL]** Create an ARTY mission ("Fire at point" task).
|
||||||
|
--
|
||||||
|
-- If the group has more than one weapon type supporting the "Fire at point" task, the employed weapon type can be set via the `AUFTRAG:SetWeaponType()` function.
|
||||||
|
--
|
||||||
|
-- **Note** that it is recommended to set the weapon range via the `OPSGROUP:AddWeaponRange()` function as this cannot be retrieved from the DCS API.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Target Center of the firing solution.
|
-- @param Core.Point#COORDINATE Target Center of the firing solution.
|
||||||
-- @param #number Nshots Number of shots to be fired. Default `#nil`.
|
-- @param #number Nshots Number of shots to be fired. Default `#nil`.
|
||||||
@@ -2128,6 +2185,7 @@ function AUFTRAG:NewARTY(Target, Nshots, Radius, Altitude)
|
|||||||
mission.optionAlarm=0
|
mission.optionAlarm=0
|
||||||
|
|
||||||
mission.missionFraction=0.0
|
mission.missionFraction=0.0
|
||||||
|
mission.missionWaypointRadius=0.0
|
||||||
|
|
||||||
-- Evaluate after 8 min.
|
-- Evaluate after 8 min.
|
||||||
mission.dTevaluate=8*60
|
mission.dTevaluate=8*60
|
||||||
@@ -2252,7 +2310,7 @@ function AUFTRAG:NewCAPTUREZONE(OpsZone, Coalition, Speed, Altitude, Formation)
|
|||||||
params.formation=Formation or "Off Road"
|
params.formation=Formation or "Off Road"
|
||||||
params.zone=mission:GetObjective()
|
params.zone=mission:GetObjective()
|
||||||
params.altitude=mission.missionAltitude
|
params.altitude=mission.missionAltitude
|
||||||
params.speed=mission.missionSpeed
|
params.speed=mission.missionSpeed and UTILS.KmphToMps(mission.missionSpeed) or nil
|
||||||
|
|
||||||
mission.DCStask.params=params
|
mission.DCStask.params=params
|
||||||
|
|
||||||
@@ -2302,7 +2360,7 @@ function AUFTRAG:NewGROUNDATTACK(Target, Speed, Formation)
|
|||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
mission.DCStask.params.speed=Speed
|
mission.DCStask.params.speed=mission.missionSpeed and UTILS.KmphToMps(mission.missionSpeed) or nil
|
||||||
mission.DCStask.params.formation=Formation or ENUMS.Formation.Vehicle.Vee
|
mission.DCStask.params.formation=Formation or ENUMS.Formation.Vehicle.Vee
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
@@ -2611,6 +2669,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
|
||||||
@@ -3429,7 +3489,7 @@ end
|
|||||||
|
|
||||||
--- Set Rules of Engagement (ROE) for this mission.
|
--- Set Rules of Engagement (ROE) for this mission.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param #string roe Mission ROE.
|
-- @param #number roe Mission ROE, e.g. `ENUMS.ROE.ReturnFire` (whiche equals 3)
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:SetROE(roe)
|
function AUFTRAG:SetROE(roe)
|
||||||
|
|
||||||
@@ -3441,7 +3501,7 @@ end
|
|||||||
|
|
||||||
--- Set Reaction on Threat (ROT) for this mission.
|
--- Set Reaction on Threat (ROT) for this mission.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param #string rot Mission ROT.
|
-- @param #number rot Mission ROT, e.g. `ENUMS.ROT.NoReaction` (whiche equals 0)
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:SetROT(rot)
|
function AUFTRAG:SetROT(rot)
|
||||||
|
|
||||||
@@ -4605,6 +4665,16 @@ function AUFTRAG:SetGroupWaypointCoordinate(opsgroup, coordinate)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [Air] Set mission (ingress) waypoint coordinate for FLIGHT group.
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @param Core.Point#COORDINATE coordinate Waypoint Coordinate.
|
||||||
|
-- @return #AUFTRAG self
|
||||||
|
function AUFTRAG:SetIngressCoordinate(coordinate)
|
||||||
|
self.missionIngressCoord = coordinate
|
||||||
|
self.missionIngressCoordAlt = UTILS.MetersToFeet(coordinate.y) or 10000
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Get mission (ingress) waypoint coordinate of OPS group
|
--- Get mission (ingress) waypoint coordinate of OPS group
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Ops.OpsGroup#OPSGROUP opsgroup The OPS group.
|
-- @param Ops.OpsGroup#OPSGROUP opsgroup The OPS group.
|
||||||
@@ -5660,7 +5730,7 @@ function AUFTRAG:GetMissionTypesText(MissionTypes)
|
|||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set the mission waypoint coordinate where the mission is executed. Note that altitude is set via `:SetMissionAltitude`.
|
--- [NON-AIR] Set the mission waypoint coordinate from where the mission is executed. Note that altitude is set via `:SetMissionAltitude`.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Coordinate Coordinate where the mission is executed.
|
-- @param Core.Point#COORDINATE Coordinate Coordinate where the mission is executed.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
@@ -5688,8 +5758,9 @@ end
|
|||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Coordinate Egrees coordinate.
|
-- @param Core.Point#COORDINATE Coordinate Egrees coordinate.
|
||||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||||
|
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude)
|
function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude, Speed)
|
||||||
|
|
||||||
-- Obviously a zone was passed. We get the coordinate.
|
-- Obviously a zone was passed. We get the coordinate.
|
||||||
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||||
@@ -5700,7 +5771,64 @@ function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude)
|
|||||||
|
|
||||||
if Altitude then
|
if Altitude then
|
||||||
self.missionEgressCoord.y=UTILS.FeetToMeters(Altitude)
|
self.missionEgressCoord.y=UTILS.FeetToMeters(Altitude)
|
||||||
|
self.missionEgressCoordAlt = UTILS.FeetToMeters(Altitude)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.missionEgressCoordSpeed=Speed and Speed or nil
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [Air] Set the mission ingress coordinate. This is the coordinate where the assigned group will fly before the actual mission coordinate.
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate Ingrees coordinate.
|
||||||
|
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||||
|
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
|
||||||
|
-- @return #AUFTRAG self
|
||||||
|
function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude, Speed)
|
||||||
|
|
||||||
|
-- Obviously a zone was passed. We get the coordinate.
|
||||||
|
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||||
|
Coordinate=Coordinate:GetCoordinate()
|
||||||
|
end
|
||||||
|
|
||||||
|
self.missionIngressCoord=Coordinate
|
||||||
|
|
||||||
|
if Altitude then
|
||||||
|
self.missionIngressCoord.y=UTILS.FeetToMeters(Altitude)
|
||||||
|
self.missionIngressCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.missionIngressCoordSpeed=Speed and Speed or nil
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- [Air] Set the mission holding coordinate. This is the coordinate where the assigned group will fly before the actual mission execution starts. Do not forget to add a push condition, too!
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate Holding coordinate.
|
||||||
|
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||||
|
-- @param #number Speed (Optional) Speed in knots to reach this waypoint and hold there. Defaults to mission speed.
|
||||||
|
-- @param #number Duration (Optional) Duration in seconds on how long to hold, defaults to 15 minutes. Mission continues if either a push condition is met or the time is up.
|
||||||
|
-- @return #AUFTRAG self
|
||||||
|
function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Speed, Duration)
|
||||||
|
|
||||||
|
-- Obviously a zone was passed. We get the coordinate.
|
||||||
|
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||||
|
Coordinate=Coordinate:GetCoordinate()
|
||||||
|
end
|
||||||
|
|
||||||
|
self.missionHoldingCoord=Coordinate
|
||||||
|
self.missionHoldingDuration=Duration or 900
|
||||||
|
|
||||||
|
if Altitude then
|
||||||
|
self.missionHoldingCoord.y=UTILS.FeetToMeters(Altitude)
|
||||||
|
self.missionHoldingCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.missionHoldingCoordSpeed=Speed and Speed or nil
|
||||||
|
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the mission egress coordinate if this was defined.
|
--- Get the mission egress coordinate if this was defined.
|
||||||
@@ -5710,6 +5838,20 @@ function AUFTRAG:GetMissionEgressCoord()
|
|||||||
return self.missionEgressCoord
|
return self.missionEgressCoord
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get the mission ingress coordinate if this was defined.
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @return Core.Point#COORDINATE Coordinate Coordinate or nil.
|
||||||
|
function AUFTRAG:GetMissionIngressCoord()
|
||||||
|
return self.missionIngressCoord
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get the mission holding coordinate if this was defined.
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @return Core.Point#COORDINATE Coordinate Coordinate or nil.
|
||||||
|
function AUFTRAG:GetMissionHoldingCoord()
|
||||||
|
return self.missionHoldingCoord
|
||||||
|
end
|
||||||
|
|
||||||
--- Get coordinate which was set as mission waypoint coordinate.
|
--- Get coordinate which was set as mission waypoint coordinate.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @return Core.Point#COORDINATE Coordinate where the mission is executed or `#nil`.
|
-- @return Core.Point#COORDINATE Coordinate where the mission is executed or `#nil`.
|
||||||
@@ -5744,10 +5886,27 @@ function AUFTRAG:GetMissionWaypointCoord(group, randomradius, surfacetypes)
|
|||||||
end
|
end
|
||||||
return coord
|
return coord
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local coord=group:GetCoordinate()
|
||||||
|
|
||||||
|
-- Check if an ingress or holding coord has been explicitly set.
|
||||||
|
if self.missionHoldingCoord then
|
||||||
|
coord=self.missionHoldingCoord
|
||||||
|
if self.missionHoldingCoorddAlt then
|
||||||
|
coord:SetAltitude(self.missionHoldingCoordAlt, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.missionIngressCoord then
|
||||||
|
coord=self.missionIngressCoord
|
||||||
|
if self.missionIngressCoordAlt then
|
||||||
|
coord:SetAltitude(self.missionIngressCoordAlt, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Create waypoint coordinate half way between us and the target.
|
-- Create waypoint coordinate half way between us and the target.
|
||||||
local waypointcoord=COORDINATE:New(0,0,0)
|
local waypointcoord=COORDINATE:New(0,0,0)
|
||||||
local coord=group:GetCoordinate()
|
|
||||||
if coord then
|
if coord then
|
||||||
waypointcoord=coord:GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction)
|
waypointcoord=coord:GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction)
|
||||||
else
|
else
|
||||||
@@ -5952,6 +6111,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 +6138,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)
|
||||||
|
|
||||||
@@ -6037,7 +6206,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local param={}
|
local param={}
|
||||||
param.zone=self:GetObjective()
|
param.zone=self:GetObjective()
|
||||||
param.altitude=self.missionAltitude
|
param.altitude=self.missionAltitude
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
|
||||||
|
|
||||||
DCStask.params=param
|
DCStask.params=param
|
||||||
|
|
||||||
@@ -6117,7 +6286,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local param={}
|
local param={}
|
||||||
param.target=self.engageTarget
|
param.target=self.engageTarget
|
||||||
param.altitude=self.missionAltitude
|
param.altitude=self.missionAltitude
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
|
||||||
param.lastindex=nil
|
param.lastindex=nil
|
||||||
|
|
||||||
DCStask.params=param
|
DCStask.params=param
|
||||||
@@ -6290,7 +6459,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local param={}
|
local param={}
|
||||||
param.zone=self:GetObjective()
|
param.zone=self:GetObjective()
|
||||||
param.altitude=self.missionAltitude
|
param.altitude=self.missionAltitude
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
|
||||||
|
|
||||||
DCStask.params=param
|
DCStask.params=param
|
||||||
|
|
||||||
@@ -6326,7 +6495,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local param={}
|
local param={}
|
||||||
param.zone=self:GetObjective()
|
param.zone=self:GetObjective()
|
||||||
param.altitude=self.missionAltitude
|
param.altitude=self.missionAltitude
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
|
||||||
|
|
||||||
DCStask.params=param
|
DCStask.params=param
|
||||||
|
|
||||||
@@ -6346,7 +6515,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local param={}
|
local param={}
|
||||||
param.target=self:GetTargetData()
|
param.target=self:GetTargetData()
|
||||||
param.action="Wedge"
|
param.action="Wedge"
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
|
||||||
|
|
||||||
DCStask.params=param
|
DCStask.params=param
|
||||||
|
|
||||||
@@ -6492,8 +6661,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 Jan 2025
|
||||||
-- @module Ops.AWACS
|
-- @module Ops.AWACS
|
||||||
-- @image OPS_AWACS.jpg
|
-- @image OPS_AWACS.jpg
|
||||||
|
|
||||||
@@ -122,6 +122,7 @@ do
|
|||||||
-- @field #number TacticalModulation
|
-- @field #number TacticalModulation
|
||||||
-- @field #number TacticalInterval
|
-- @field #number TacticalInterval
|
||||||
-- @field Core.Set#SET_GROUP DetectionSet
|
-- @field Core.Set#SET_GROUP DetectionSet
|
||||||
|
-- @field #number MaxMissionRange
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
|
|
||||||
@@ -183,7 +184,7 @@ do
|
|||||||
--
|
--
|
||||||
-- Add Escorts Squad (recommended, optional)
|
-- Add Escorts Squad (recommended, optional)
|
||||||
--
|
--
|
||||||
-- local Squad_Two = SQUADRON:New("Escorts",4,"Escorts North")
|
-- local Squad_Two = SQUADRON:New("Escorts",4,"Escorts North") -- taking a template with 2 planes here, will result in a group of 2 escorts which can fly in formation escorting the AWACS.
|
||||||
-- Squad_Two:AddMissionCapability({AUFTRAG.Type.ESCORT})
|
-- Squad_Two:AddMissionCapability({AUFTRAG.Type.ESCORT})
|
||||||
-- Squad_Two:SetFuelLowRefuel(true)
|
-- Squad_Two:SetFuelLowRefuel(true)
|
||||||
-- Squad_Two:SetFuelLowThreshold(0.3)
|
-- Squad_Two:SetFuelLowThreshold(0.3)
|
||||||
@@ -231,8 +232,8 @@ do
|
|||||||
-- -- set up in the mission editor with a late activated helo named "Rock#ZONE_POLYGON". Note this also sets the BullsEye to be referenced as "Rock".
|
-- -- set up in the mission editor with a late activated helo named "Rock#ZONE_POLYGON". Note this also sets the BullsEye to be referenced as "Rock".
|
||||||
-- -- The CAP station zone is called "Fremont". We will be on 255 AM.
|
-- -- The CAP station zone is called "Fremont". We will be on 255 AM.
|
||||||
-- local testawacs = AWACS:New("AWACS North",AwacsAW,"blue",AIRBASE.Caucasus.Kutaisi,"Awacs Orbit",ZONE:FindByName("Rock"),"Fremont",255,radio.modulation.AM )
|
-- local testawacs = AWACS:New("AWACS North",AwacsAW,"blue",AIRBASE.Caucasus.Kutaisi,"Awacs Orbit",ZONE:FindByName("Rock"),"Fremont",255,radio.modulation.AM )
|
||||||
-- -- set two escorts
|
-- -- set one escort group; this example has two units in the template group, so they can fly a nice formation.
|
||||||
-- testawacs:SetEscort(2)
|
-- testawacs:SetEscort(1,ENUMS.Formation.FixedWing.FingerFour.Group,{x=-500,y=50,z=500},45)
|
||||||
-- -- Callsign will be "Focus". We'll be a Angels 30, doing 300 knots, orbit leg to 88deg with a length of 25nm.
|
-- -- Callsign will be "Focus". We'll be a Angels 30, doing 300 knots, orbit leg to 88deg with a length of 25nm.
|
||||||
-- testawacs:SetAwacsDetails(CALLSIGN.AWACS.Focus,1,30,300,88,25)
|
-- testawacs:SetAwacsDetails(CALLSIGN.AWACS.Focus,1,30,300,88,25)
|
||||||
-- -- Set up SRS on port 5010 - change the below to your path and port
|
-- -- Set up SRS on port 5010 - change the below to your path and port
|
||||||
@@ -508,7 +509,7 @@ do
|
|||||||
-- @field #AWACS
|
-- @field #AWACS
|
||||||
AWACS = {
|
AWACS = {
|
||||||
ClassName = "AWACS", -- #string
|
ClassName = "AWACS", -- #string
|
||||||
version = "0.2.64", -- #string
|
version = "0.2.71", -- #string
|
||||||
lid = "", -- #string
|
lid = "", -- #string
|
||||||
coalition = coalition.side.BLUE, -- #number
|
coalition = coalition.side.BLUE, -- #number
|
||||||
coalitiontxt = "blue", -- #string
|
coalitiontxt = "blue", -- #string
|
||||||
@@ -605,6 +606,7 @@ AWACS = {
|
|||||||
TacticalModulation = radio.modulation.AM,
|
TacticalModulation = radio.modulation.AM,
|
||||||
TacticalInterval = 120,
|
TacticalInterval = 120,
|
||||||
DetectionSet = nil,
|
DetectionSet = nil,
|
||||||
|
MaxMissionRange = 125,
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -935,7 +937,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
|
||||||
@@ -1572,6 +1574,15 @@ function AWACS:SetLocale(Locale)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Set the max mission range flights can be away from their home base.
|
||||||
|
-- @param #AWACS self
|
||||||
|
-- @param #number NM Distance in nautical miles
|
||||||
|
-- @return #AWACS self
|
||||||
|
function AWACS:SetMaxMissionRange(NM)
|
||||||
|
self.MaxMissionRange = NM or 125
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [User] Add additional frequency and modulation for AWACS SRS output.
|
--- [User] Add additional frequency and modulation for AWACS SRS output.
|
||||||
-- @param #AWACS self
|
-- @param #AWACS self
|
||||||
-- @param #number Frequency The frequency to add, e.g. 132.5
|
-- @param #number Frequency The frequency to add, e.g. 132.5
|
||||||
@@ -1626,7 +1637,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
|
||||||
@@ -1762,7 +1773,7 @@ function AWACS:_EventHandler(EventData)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Event.id == EVENTS.PlayerLeaveUnit then --player left unit
|
if Event.id == EVENTS.PlayerLeaveUnit and Event.IniGroupName then --player left unit
|
||||||
-- check known player?
|
-- check known player?
|
||||||
self:T("Player group left unit: " .. Event.IniGroupName)
|
self:T("Player group left unit: " .. Event.IniGroupName)
|
||||||
self:T("Player name left: " .. Event.IniPlayerName)
|
self:T("Player name left: " .. Event.IniPlayerName)
|
||||||
@@ -2158,9 +2169,12 @@ end
|
|||||||
|
|
||||||
--- [User] Set AWACS Escorts Template
|
--- [User] Set AWACS Escorts Template
|
||||||
-- @param #AWACS self
|
-- @param #AWACS self
|
||||||
-- @param #number EscortNumber Number of fighther planes to accompany this AWACS. 0 or nil means no escorts.
|
-- @param #number EscortNumber Number of fighther plane GROUPs to accompany this AWACS. 0 or nil means no escorts. If you want >1 plane in an escort group, you can either set the respective squadron grouping to the desired number, or use a template for escorts with >1 unit.
|
||||||
|
-- @param #number Formation Formation the escort should take (if more than one plane), e.g. `ENUMS.Formation.FixedWing.FingerFour.Group`. Formation is used on GROUP level, multiple groups of one unit will NOT conform to this formation.
|
||||||
|
-- @param #table OffsetVector Offset the escorts should fly behind the AWACS, given as table, distance in meters, e.g. `{x=-500,y=0,z=500}` - 500m behind (negative value) and to the right (negative for left), no vertical separation (positive over, negative under the AWACS flight). For multiple groups, the vectors will be slightly changed to avoid collisions.
|
||||||
|
-- @param #number EscortEngageMaxDistance Escorts engage air targets max this NM away, defaults to 45NM.
|
||||||
-- @return #AWACS self
|
-- @return #AWACS self
|
||||||
function AWACS:SetEscort(EscortNumber)
|
function AWACS:SetEscort(EscortNumber,Formation,OffsetVector,EscortEngageMaxDistance)
|
||||||
self:T(self.lid.."SetEscort")
|
self:T(self.lid.."SetEscort")
|
||||||
if EscortNumber and EscortNumber > 0 then
|
if EscortNumber and EscortNumber > 0 then
|
||||||
self.HasEscorts = true
|
self.HasEscorts = true
|
||||||
@@ -2169,6 +2183,9 @@ function AWACS:SetEscort(EscortNumber)
|
|||||||
self.HasEscorts = false
|
self.HasEscorts = false
|
||||||
self.EscortNumber = 0
|
self.EscortNumber = 0
|
||||||
end
|
end
|
||||||
|
self.EscortFormation = Formation
|
||||||
|
self.OffsetVec = OffsetVector or {x=500,y=100,z=500}
|
||||||
|
self.EscortEngageMaxDistance = EscortEngageMaxDistance or 45
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2223,11 +2240,26 @@ function AWACS:_StartEscorts(Shiftchange)
|
|||||||
local group = AwacsFG:GetGroup()
|
local group = AwacsFG:GetGroup()
|
||||||
|
|
||||||
local timeonstation = (self.EscortsTimeOnStation + self.ShiftChangeTime) * 3600 -- hours to seconds
|
local timeonstation = (self.EscortsTimeOnStation + self.ShiftChangeTime) * 3600 -- hours to seconds
|
||||||
|
local OffsetX = 500
|
||||||
|
local OffsetY = 500
|
||||||
|
local OffsetZ = 500
|
||||||
|
if self.OffsetVec then
|
||||||
|
OffsetX = self.OffsetVec.x or 500
|
||||||
|
OffsetY = self.OffsetVec.y or 500
|
||||||
|
OffsetZ = self.OffsetVec.z or 500
|
||||||
|
end
|
||||||
|
|
||||||
for i=1,self.EscortNumber do
|
for i=1,self.EscortNumber do
|
||||||
-- every
|
-- every
|
||||||
local escort = AUFTRAG:NewESCORT(group, {x= -100*((i + (i%2))/2), y=0, z=(100 + 100*((i + (i%2))/2))*(-1)^i},45,{"Air"})
|
local escort = AUFTRAG:NewESCORT(group, {x= OffsetX*((i + (i%2))/2), y=OffsetY*((i + (i%2))/2), z=(OffsetZ + OffsetZ*((i + (i%2))/2))*(-1)^i},self.EscortEngageMaxDistance,{"Air"})
|
||||||
escort:SetRequiredAssets(1)
|
--local escort = AUFTRAG:NewESCORT(group,self.OffsetVec,self.EscortEngageMaxDistance,{"Air"})
|
||||||
|
--escort:SetRequiredAssets(self.EscortNumber)
|
||||||
escort:SetTime(nil,timeonstation)
|
escort:SetTime(nil,timeonstation)
|
||||||
|
if self.Escortformation then
|
||||||
|
escort:SetFormation(self.Escortformation)
|
||||||
|
end
|
||||||
|
escort:SetMissionRange(self.MaxMissionRange)
|
||||||
|
|
||||||
self.AirWing:AddMission(escort)
|
self.AirWing:AddMission(escort)
|
||||||
self.CatchAllMissions[#self.CatchAllMissions+1] = escort
|
self.CatchAllMissions[#self.CatchAllMissions+1] = escort
|
||||||
|
|
||||||
@@ -2434,7 +2466,7 @@ function AWACS:_GetCallSign(Group,GID, IsPlayer)
|
|||||||
|
|
||||||
local callsign = "Ghost 1"
|
local callsign = "Ghost 1"
|
||||||
if Group and Group:IsAlive() then
|
if Group and Group:IsAlive() then
|
||||||
callsign = Group:GetCustomCallSign(self.callsignshort,self.keepnumber,self.callsignTranslations)
|
callsign = Group:GetCustomCallSign(self.callsignshort,self.keepnumber,self.callsignTranslations,self.callsignCustomFunc,self.callsignCustomArgs)
|
||||||
end
|
end
|
||||||
return callsign
|
return callsign
|
||||||
end
|
end
|
||||||
@@ -2443,10 +2475,12 @@ end
|
|||||||
-- @param #AWACS self
|
-- @param #AWACS self
|
||||||
-- @param #boolean ShortCallsign If true, only call out the major flight number
|
-- @param #boolean ShortCallsign If true, only call out the major flight number
|
||||||
-- @param #boolean Keepnumber If true, keep the **customized callsign** in the #GROUP name as-is, no amendments or numbers.
|
-- @param #boolean Keepnumber If true, keep the **customized callsign** in the #GROUP name as-is, no amendments or numbers.
|
||||||
-- @param #table CallsignTranslations (optional) Table to translate between DCS standard callsigns and bespoke ones. Does not apply if using customized
|
-- @param #table CallsignTranslations (Optional) Table to translate between DCS standard callsigns and bespoke ones. Does not apply if using customized.
|
||||||
-- callsigns from playername or group name.
|
-- callsigns from playername or group name.
|
||||||
|
-- @param #func CallsignCustomFunc (Optional) For player names only(!). If given, this function will return the callsign. Needs to take the groupname and the playername as first two arguments.
|
||||||
|
-- @param #arg ... (Optional) Comma separated arguments to add to the custom function call after groupname and playername.
|
||||||
-- @return #AWACS self
|
-- @return #AWACS self
|
||||||
function AWACS:SetCallSignOptions(ShortCallsign,Keepnumber,CallsignTranslations)
|
function AWACS:SetCallSignOptions(ShortCallsign,Keepnumber,CallsignTranslations,CallsignCustomFunc,...)
|
||||||
if not ShortCallsign or ShortCallsign == false then
|
if not ShortCallsign or ShortCallsign == false then
|
||||||
self.callsignshort = false
|
self.callsignshort = false
|
||||||
else
|
else
|
||||||
@@ -2454,6 +2488,8 @@ function AWACS:SetCallSignOptions(ShortCallsign,Keepnumber,CallsignTranslations)
|
|||||||
end
|
end
|
||||||
self.keepnumber = Keepnumber or false
|
self.keepnumber = Keepnumber or false
|
||||||
self.callsignTranslations = CallsignTranslations
|
self.callsignTranslations = CallsignTranslations
|
||||||
|
self.callsignCustomFunc = CallsignCustomFunc
|
||||||
|
self.callsignCustomArgs = arg or {}
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3626,7 +3662,7 @@ function AWACS:_CheckIn(Group)
|
|||||||
managedgroup.LastTasking = timer.getTime()
|
managedgroup.LastTasking = timer.getTime()
|
||||||
|
|
||||||
GID = managedgroup.GID
|
GID = managedgroup.GID
|
||||||
self.ManagedGrps[self.ManagedGrpID]=managedgroup
|
self.ManagedGrps[self.ManagedGrpID]=managedgroup
|
||||||
|
|
||||||
local alphacheckbulls = self:_ToStringBULLS(Group:GetCoordinate())
|
local alphacheckbulls = self:_ToStringBULLS(Group:GetCoordinate())
|
||||||
local alphacheckbullstts = self:_ToStringBULLS(Group:GetCoordinate(),false,true)
|
local alphacheckbullstts = self:_ToStringBULLS(Group:GetCoordinate(),false,true)
|
||||||
@@ -3893,6 +3929,12 @@ function AWACS:_SetClientMenus()
|
|||||||
checkin = checkin,
|
checkin = checkin,
|
||||||
}
|
}
|
||||||
self.clientmenus:Push(menus,cgrpname)
|
self.clientmenus:Push(menus,cgrpname)
|
||||||
|
-- catch errors - when this entry is built we should NOT have a managed entry
|
||||||
|
local GID,hasentry = self:_GetManagedGrpID(cgrp)
|
||||||
|
if hasentry then
|
||||||
|
-- this user is checked in but has the check in entry ... not good.
|
||||||
|
self:_CheckOut(cgrp,GID,true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -5585,6 +5627,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
|
||||||
@@ -5733,7 +5781,7 @@ function AWACS:_AssignPilotToTarget(Pilots,Targets)
|
|||||||
local intercept = AUFTRAG:NewINTERCEPT(Target.Target)
|
local intercept = AUFTRAG:NewINTERCEPT(Target.Target)
|
||||||
intercept:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
|
intercept:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
|
||||||
intercept:SetWeaponType(ENUMS.WeaponFlag.Auto)
|
intercept:SetWeaponType(ENUMS.WeaponFlag.Auto)
|
||||||
|
intercept:SetMissionRange(self.MaxMissionRange)
|
||||||
-- TODO
|
-- TODO
|
||||||
-- now this is going to be interesting...
|
-- now this is going to be interesting...
|
||||||
-- Check if the target left the "hot" area or is dead already
|
-- Check if the target left the "hot" area or is dead already
|
||||||
@@ -5781,6 +5829,7 @@ function AWACS:_AssignPilotToTarget(Pilots,Targets)
|
|||||||
AnchorSpeed = UTILS.KnotsToAltKIAS(AnchorSpeed,Angels)
|
AnchorSpeed = UTILS.KnotsToAltKIAS(AnchorSpeed,Angels)
|
||||||
local Anchor = self.AnchorStacks:ReadByPointer(Pilot.AnchorStackNo) -- #AWACS.AnchorData
|
local Anchor = self.AnchorStacks:ReadByPointer(Pilot.AnchorStackNo) -- #AWACS.AnchorData
|
||||||
local capauftrag = AUFTRAG:NewCAP(Anchor.StationZone,Angels,AnchorSpeed,Anchor.StationZoneCoordinate,0,15,{})
|
local capauftrag = AUFTRAG:NewCAP(Anchor.StationZone,Angels,AnchorSpeed,Anchor.StationZoneCoordinate,0,15,{})
|
||||||
|
capauftrag:SetMissionRange(self.MaxMissionRange)
|
||||||
capauftrag:SetTime(nil,((self.CAPTimeOnStation*3600)+(15*60)))
|
capauftrag:SetTime(nil,((self.CAPTimeOnStation*3600)+(15*60)))
|
||||||
Pilot.FlightGroup:AddMission(capauftrag)
|
Pilot.FlightGroup:AddMission(capauftrag)
|
||||||
|
|
||||||
@@ -5898,6 +5947,8 @@ function AWACS:onafterStart(From, Event, To)
|
|||||||
-- set up the AWACS and let it orbit
|
-- set up the AWACS and let it orbit
|
||||||
local AwacsAW = self.AirWing -- Ops.Airwing#AIRWING
|
local AwacsAW = self.AirWing -- Ops.Airwing#AIRWING
|
||||||
local mission = AUFTRAG:NewORBIT_RACETRACK(self.OrbitZone:GetCoordinate(),self.AwacsAngels*1000,self.Speed,self.Heading,self.Leg)
|
local mission = AUFTRAG:NewORBIT_RACETRACK(self.OrbitZone:GetCoordinate(),self.AwacsAngels*1000,self.Speed,self.Heading,self.Leg)
|
||||||
|
mission:SetMissionRange(self.MaxMissionRange)
|
||||||
|
mission:SetRequiredAttribute({ GROUP.Attribute.AIR_AWACS }) -- prefered plane type, thanks to Heart8reaker
|
||||||
local timeonstation = (self.AwacsTimeOnStation + self.ShiftChangeTime) * 3600
|
local timeonstation = (self.AwacsTimeOnStation + self.ShiftChangeTime) * 3600
|
||||||
mission:SetTime(nil,timeonstation)
|
mission:SetTime(nil,timeonstation)
|
||||||
self.CatchAllMissions[#self.CatchAllMissions+1] = mission
|
self.CatchAllMissions[#self.CatchAllMissions+1] = mission
|
||||||
@@ -6040,6 +6091,7 @@ function AWACS:_CheckAwacsStatus()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- AWACS
|
-- AWACS
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@@ -6188,12 +6240,13 @@ function AWACS:_CheckAwacsStatus()
|
|||||||
|
|
||||||
report:Add("====================")
|
report:Add("====================")
|
||||||
|
|
||||||
|
local RESMission
|
||||||
-- Check for replacement mission - if any
|
-- Check for replacement mission - if any
|
||||||
if self.ShiftChangeEscortsFlag and self.ShiftChangeEscortsRequested then -- Ops.Auftrag#AUFTRAG
|
if self.ShiftChangeEscortsFlag and self.ShiftChangeEscortsRequested then -- Ops.Auftrag#AUFTRAG
|
||||||
ESmission = self.EscortMissionReplacement[i]
|
RESMission = self.EscortMissionReplacement[i]
|
||||||
local esstatus = ESmission:GetState()
|
local esstatus = RESMission:GetState()
|
||||||
local ESmissiontime = (timer.getTime() - self.EscortsTimeStamp)
|
local RESMissiontime = (timer.getTime() - self.EscortsTimeStamp)
|
||||||
local ESTOSLeft = UTILS.Round((((self.EscortsTimeOnStation+self.ShiftChangeTime)*3600) - ESmissiontime),0) -- seconds
|
local ESTOSLeft = UTILS.Round((((self.EscortsTimeOnStation+self.ShiftChangeTime)*3600) - RESMissiontime),0) -- seconds
|
||||||
ESTOSLeft = UTILS.Round(ESTOSLeft/60,0) -- minutes
|
ESTOSLeft = UTILS.Round(ESTOSLeft/60,0) -- minutes
|
||||||
local ChangeTime = UTILS.Round(((self.ShiftChangeTime * 3600)/60),0)
|
local ChangeTime = UTILS.Round(((self.ShiftChangeTime * 3600)/60),0)
|
||||||
|
|
||||||
@@ -6201,7 +6254,7 @@ function AWACS:_CheckAwacsStatus()
|
|||||||
report:Add(string.format("Auftrag Status: %s",esstatus))
|
report:Add(string.format("Auftrag Status: %s",esstatus))
|
||||||
report:Add(string.format("TOS Left: %d min",ESTOSLeft))
|
report:Add(string.format("TOS Left: %d min",ESTOSLeft))
|
||||||
|
|
||||||
local OpsGroups = ESmission:GetOpsGroups()
|
local OpsGroups = RESMission:GetOpsGroups()
|
||||||
local OpsGroup = self:_GetAliveOpsGroupFromTable(OpsGroups) -- Ops.OpsGroup#OPSGROUP
|
local OpsGroup = self:_GetAliveOpsGroupFromTable(OpsGroups) -- Ops.OpsGroup#OPSGROUP
|
||||||
if OpsGroup then
|
if OpsGroup then
|
||||||
local OpsName = OpsGroup:GetName() or "Unknown"
|
local OpsName = OpsGroup:GetName() or "Unknown"
|
||||||
@@ -6213,13 +6266,13 @@ function AWACS:_CheckAwacsStatus()
|
|||||||
report:Add("***** Cannot obtain (yet) this missions OpsGroup!")
|
report:Add("***** Cannot obtain (yet) this missions OpsGroup!")
|
||||||
end
|
end
|
||||||
|
|
||||||
if ESmission:IsExecuting() then
|
if RESMission and RESMission:IsExecuting() then
|
||||||
-- make the actual change in the queue
|
-- make the actual change in the queue
|
||||||
self.ShiftChangeEscortsFlag = false
|
self.ShiftChangeEscortsFlag = false
|
||||||
self.ShiftChangeEscortsRequested = false
|
self.ShiftChangeEscortsRequested = false
|
||||||
-- cancel old mission
|
-- cancel old mission
|
||||||
if ESmission and ESmission:IsNotOver() then
|
if ESmission and ESmission:IsNotOver() then
|
||||||
ESmission:Cancel()
|
ESmission:__Cancel(1)
|
||||||
end
|
end
|
||||||
self.EscortMission[i] = self.EscortMissionReplacement[i]
|
self.EscortMission[i] = self.EscortMissionReplacement[i]
|
||||||
self.EscortMissionReplacement[i] = nil
|
self.EscortMissionReplacement[i] = nil
|
||||||
@@ -6471,6 +6524,7 @@ function AWACS:onafterAssignedAnchor(From, Event, To, GID, Anchor, AnchorStackNo
|
|||||||
if auftragtype == AUFTRAG.Type.ALERT5 then
|
if auftragtype == AUFTRAG.Type.ALERT5 then
|
||||||
-- all correct
|
-- all correct
|
||||||
local capauftrag = AUFTRAG:NewCAP(Anchor.StationZone,Angels*1000,AnchorSpeed,Anchor.StationZone:GetCoordinate(),0,15,{})
|
local capauftrag = AUFTRAG:NewCAP(Anchor.StationZone,Angels*1000,AnchorSpeed,Anchor.StationZone:GetCoordinate(),0,15,{})
|
||||||
|
capauftrag:SetMissionRange(self.MaxMissionRange)
|
||||||
capauftrag:SetTime(nil,((self.CAPTimeOnStation*3600)+(15*60)))
|
capauftrag:SetTime(nil,((self.CAPTimeOnStation*3600)+(15*60)))
|
||||||
capauftrag:AddAsset(managedgroup.FlightGroup)
|
capauftrag:AddAsset(managedgroup.FlightGroup)
|
||||||
self.CatchAllMissions[#self.CatchAllMissions+1] = capauftrag
|
self.CatchAllMissions[#self.CatchAllMissions+1] = capauftrag
|
||||||
@@ -6834,7 +6888,8 @@ function AWACS:onafterAwacsShiftChange(From,Event,To)
|
|||||||
self.CatchAllMissions[#self.CatchAllMissions+1] = mission
|
self.CatchAllMissions[#self.CatchAllMissions+1] = mission
|
||||||
local timeonstation = (self.AwacsTimeOnStation + self.ShiftChangeTime) * 3600
|
local timeonstation = (self.AwacsTimeOnStation + self.ShiftChangeTime) * 3600
|
||||||
mission:SetTime(nil,timeonstation)
|
mission:SetTime(nil,timeonstation)
|
||||||
|
mission:SetMissionRange(self.MaxMissionRange)
|
||||||
|
|
||||||
AwacsAW:AddMission(mission)
|
AwacsAW:AddMission(mission)
|
||||||
|
|
||||||
self.AwacsMissionReplacement = mission
|
self.AwacsMissionReplacement = mission
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
-- @module Ops.CSAR
|
-- @module Ops.CSAR
|
||||||
-- @image OPS_CSAR.jpg
|
-- @image OPS_CSAR.jpg
|
||||||
|
|
||||||
-- Date: May 2023
|
---
|
||||||
-- Last: Update Dec 2024
|
-- Last Update Jan 2025
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **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)
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
-- mycsar.immortalcrew = true -- Set to true to make wounded crew immortal.
|
-- mycsar.immortalcrew = true -- Set to true to make wounded crew immortal.
|
||||||
-- mycsar.invisiblecrew = false -- Set to true to make wounded crew insvisible.
|
-- mycsar.invisiblecrew = false -- Set to true to make wounded crew insvisible.
|
||||||
-- mycsar.loadDistance = 75 -- configure distance for pilots to get into helicopter in meters.
|
-- mycsar.loadDistance = 75 -- configure distance for pilots to get into helicopter in meters.
|
||||||
-- mycsar.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes.
|
-- mycsar.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes. Will also try to add ZONE and STATIC objects with this prefix once at startup.
|
||||||
-- mycsar.max_units = 6 -- max number of pilots that can be carried if #CSAR.AircraftType is undefined.
|
-- mycsar.max_units = 6 -- max number of pilots that can be carried if #CSAR.AircraftType is undefined.
|
||||||
-- mycsar.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages.
|
-- mycsar.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages.
|
||||||
-- mycsar.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots\' radio beacons.
|
-- mycsar.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots\' radio beacons.
|
||||||
@@ -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
|
||||||
@@ -291,10 +307,13 @@ CSAR.AircraftType["UH-60L"] = 10
|
|||||||
CSAR.AircraftType["AH-64D_BLK_II"] = 2
|
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["OH58D"] = 2
|
||||||
|
CSAR.AircraftType["CH-47Fbl1"] = 31
|
||||||
|
|
||||||
--- CSAR class version.
|
--- CSAR class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CSAR.version="1.0.20"
|
CSAR.version="1.0.30"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@@ -453,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
|
||||||
@@ -463,7 +485,7 @@ function CSAR:New(Coalition, Template, Alias)
|
|||||||
self.SRSModulation = radio.modulation.AM -- modulation
|
self.SRSModulation = radio.modulation.AM -- modulation
|
||||||
self.SRSport = 5002 -- port
|
self.SRSport = 5002 -- port
|
||||||
self.SRSCulture = "en-GB"
|
self.SRSCulture = "en-GB"
|
||||||
self.SRSVoice = nil
|
self.SRSVoice = MSRS.Voices.Google.Standard.en_GB_Standard_B
|
||||||
self.SRSGPathToCredentials = nil
|
self.SRSGPathToCredentials = nil
|
||||||
self.SRSVolume = 1.0 -- volume 0.0 to 1.0
|
self.SRSVolume = 1.0 -- volume 0.0 to 1.0
|
||||||
self.SRSGender = "male" -- male or female
|
self.SRSGender = "male" -- male or female
|
||||||
@@ -631,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
|
||||||
@@ -639,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
|
||||||
@@ -648,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
|
||||||
@@ -734,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)
|
||||||
|
|
||||||
@@ -787,6 +809,8 @@ end
|
|||||||
-- @param #boolean noMessage
|
-- @param #boolean noMessage
|
||||||
-- @param #string _description Description
|
-- @param #string _description Description
|
||||||
-- @param #boolean forcedesc Use the description only for the pilot track entry
|
-- @param #boolean forcedesc Use the description only for the pilot track entry
|
||||||
|
-- @return Wrapper.Group#GROUP PilotInField Pilot GROUP object
|
||||||
|
-- @return #string AliasName Alias display name
|
||||||
function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _playerName, _freq, noMessage, _description, forcedesc )
|
function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _playerName, _freq, noMessage, _description, forcedesc )
|
||||||
self:T(self.lid .. " _AddCsar")
|
self:T(self.lid .. " _AddCsar")
|
||||||
self:T({_coalition , _country, _point, _typeName, _unitName, _playerName, _freq, noMessage, _description})
|
self:T({_coalition , _country, _point, _typeName, _unitName, _playerName, _freq, noMessage, _description})
|
||||||
@@ -816,8 +840,18 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local BeaconName
|
||||||
|
|
||||||
|
if _playerName then
|
||||||
|
BeaconName = _playerName..math.random(1,10000)
|
||||||
|
elseif _unitName then
|
||||||
|
BeaconName = _unitName..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)
|
||||||
@@ -842,11 +876,11 @@ 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.
|
||||||
|
|
||||||
return self
|
return _spawnedGroup, _alias
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (Internal) Function to add a CSAR object into the scene at a zone coordinate. For mission designers wanting to add e.g. PoWs to the scene.
|
--- (Internal) Function to add a CSAR object into the scene at a zone coordinate. For mission designers wanting to add e.g. PoWs to the scene.
|
||||||
@@ -960,7 +994,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.
|
||||||
@@ -1190,7 +1223,7 @@ function CSAR:_EventHandler(EventData)
|
|||||||
|
|
||||||
if _place:GetCoalition() == self.coalition or _place:GetCoalition() == coalition.side.NEUTRAL then
|
if _place:GetCoalition() == self.coalition or _place:GetCoalition() == coalition.side.NEUTRAL then
|
||||||
self:__Landed(2,_event.IniUnitName, _place)
|
self:__Landed(2,_event.IniUnitName, _place)
|
||||||
self:_ScheduledSARFlight(_event.IniUnitName,_event.IniGroupName,true)
|
self:_ScheduledSARFlight(_event.IniUnitName,_event.IniGroupName,true,true)
|
||||||
else
|
else
|
||||||
self:T(string.format("Airfield %d, Unit %d", _place:GetCoalition(), _unit:GetCoalition()))
|
self:T(string.format("Airfield %d, Unit %d", _place:GetCoalition(), _unit:GetCoalition()))
|
||||||
end
|
end
|
||||||
@@ -1238,10 +1271,24 @@ function CSAR:_InitSARForPilot(_downedGroup, _GroupName, _freq, _nomessage, _pla
|
|||||||
if not _nomessage then
|
if not _nomessage then
|
||||||
if _freq ~= 0 then --shagrat
|
if _freq ~= 0 then --shagrat
|
||||||
local _text = string.format("%s requests SAR at %s, beacon at %.2f KHz", _groupName, _coordinatesText, _freqk)--shagrat _groupName to prevent 'f15_Pilot_Parachute'
|
local _text = string.format("%s requests SAR at %s, beacon at %.2f KHz", _groupName, _coordinatesText, _freqk)--shagrat _groupName to prevent 'f15_Pilot_Parachute'
|
||||||
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime)
|
if self.coordtype ~= 2 then --not MGRS
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime)
|
||||||
|
else
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,false,true)
|
||||||
|
local coordtext = UTILS.MGRSStringToSRSFriendly(_coordinatesText,true)
|
||||||
|
local _text = string.format("%s requests SAR at %s, beacon at %.2f kilo hertz", _groupName, coordtext, _freqk)
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,true,false)
|
||||||
|
end
|
||||||
else --shagrat CASEVAC msg
|
else --shagrat CASEVAC msg
|
||||||
local _text = string.format("Pickup Zone at %s.", _coordinatesText )
|
local _text = string.format("Pickup Zone at %s.", _coordinatesText )
|
||||||
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime)
|
if self.coordtype ~= 2 then --not MGRS
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime)
|
||||||
|
else
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,false,true)
|
||||||
|
local coordtext = UTILS.MGRSStringToSRSFriendly(_coordinatesText,true)
|
||||||
|
local _text = string.format("Pickup Zone at %s.", coordtext )
|
||||||
|
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,true,false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1529,7 +1576,7 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
local _reset = true
|
local _reset = true
|
||||||
|
|
||||||
if (_distance < 500) then
|
if (_distance < 500) then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo closer than 500m: ".._lookupKeyHeli)
|
||||||
if self.heliCloseMessage[_lookupKeyHeli] == nil then
|
if self.heliCloseMessage[_lookupKeyHeli] == nil then
|
||||||
if self.autosmoke == true then
|
if self.autosmoke == true then
|
||||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. You\'re close now! Land or hover at the smoke.", self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. You\'re close now! Land or hover at the smoke.", self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||||
@@ -1538,14 +1585,16 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
end
|
end
|
||||||
self.heliCloseMessage[_lookupKeyHeli] = true
|
self.heliCloseMessage[_lookupKeyHeli] = true
|
||||||
end
|
end
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Checking landed vs Hover for ".._lookupKeyHeli)
|
||||||
-- have we landed close enough?
|
-- have we landed close enough?
|
||||||
if not _heliUnit:InAir() then
|
if not _heliUnit:InAir() then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo landed: ".._lookupKeyHeli)
|
||||||
if self.pilotRuntoExtractPoint == true then
|
if self.pilotRuntoExtractPoint == true then
|
||||||
if (_distance < self.extractDistance) then
|
if (_distance < self.extractDistance) then
|
||||||
local _time = self.landedStatus[_lookupKeyHeli]
|
local _time = self.landedStatus[_lookupKeyHeli]
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Check pilot running or arrived ".._lookupKeyHeli)
|
||||||
if _time == nil then
|
if _time == nil then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pilot running not arrived yet ".._lookupKeyHeli)
|
||||||
self.landedStatus[_lookupKeyHeli] = math.floor( (_distance - self.loadDistance) / 3.6 )
|
self.landedStatus[_lookupKeyHeli] = math.floor( (_distance - self.loadDistance) / 3.6 )
|
||||||
_time = self.landedStatus[_lookupKeyHeli]
|
_time = self.landedStatus[_lookupKeyHeli]
|
||||||
_woundedGroup:OptionAlarmStateGreen()
|
_woundedGroup:OptionAlarmStateGreen()
|
||||||
@@ -1556,11 +1605,15 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
self.landedStatus[_lookupKeyHeli] = _time
|
self.landedStatus[_lookupKeyHeli] = _time
|
||||||
end
|
end
|
||||||
--if _time <= 0 or _distance < self.loadDistance then
|
--if _time <= 0 or _distance < self.loadDistance then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pilot close enough? ".._lookupKeyHeli)
|
||||||
if _distance < self.loadDistance + 5 or _distance <= 13 then
|
if _distance < self.loadDistance + 5 or _distance <= 13 then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pilot close enough - YES ".._lookupKeyHeli)
|
||||||
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Door closed, try again next loop ".._lookupKeyHeli)
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pick up Pilot ".._lookupKeyHeli)
|
||||||
self.landedStatus[_lookupKeyHeli] = nil
|
self.landedStatus[_lookupKeyHeli] = nil
|
||||||
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
||||||
return true
|
return true
|
||||||
@@ -1568,28 +1621,32 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo landed, pilot NOT set to run to helo ".._lookupKeyHeli)
|
||||||
if (_distance < self.loadDistance) then
|
if (_distance < self.loadDistance) then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo close enough, door check ".._lookupKeyHeli)
|
||||||
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Door closed, try again next loop ".._lookupKeyHeli)
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pick up Pilot ".._lookupKeyHeli)
|
||||||
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering".._lookupKeyHeli)
|
||||||
local _unitsInHelicopter = self:_PilotsOnboard(_heliName)
|
local _unitsInHelicopter = self:_PilotsOnboard(_heliName)
|
||||||
local _maxUnits = self.AircraftType[_heliUnit:GetTypeName()]
|
local _maxUnits = self.AircraftType[_heliUnit:GetTypeName()]
|
||||||
if _maxUnits == nil then
|
if _maxUnits == nil then
|
||||||
_maxUnits = self.max_units
|
_maxUnits = self.max_units
|
||||||
end
|
end
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Check capacity and close enough for winching ".._lookupKeyHeli)
|
||||||
if _heliUnit:InAir() and _unitsInHelicopter + 1 <= _maxUnits then
|
if _heliUnit:InAir() and _unitsInHelicopter + 1 <= _maxUnits then
|
||||||
-- DONE - make variable
|
-- DONE - make variable
|
||||||
if _distance < self.rescuehoverdistance then
|
if _distance < self.rescuehoverdistance then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering close enough ".._lookupKeyHeli)
|
||||||
--check height!
|
--check height!
|
||||||
local leaderheight = _woundedLeader:GetHeight()
|
local leaderheight = _woundedLeader:GetHeight()
|
||||||
if leaderheight < 0 then leaderheight = 0 end
|
if leaderheight < 0 then leaderheight = 0 end
|
||||||
@@ -1597,7 +1654,7 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
|
|
||||||
-- DONE - make variable
|
-- DONE - make variable
|
||||||
if _height <= self.rescuehoverheight then
|
if _height <= self.rescuehoverheight then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering low enough ".._lookupKeyHeli)
|
||||||
local _time = self.hoverStatus[_lookupKeyHeli]
|
local _time = self.hoverStatus[_lookupKeyHeli]
|
||||||
|
|
||||||
if _time == nil then
|
if _time == nil then
|
||||||
@@ -1607,22 +1664,28 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
_time = self.hoverStatus[_lookupKeyHeli] - 10
|
_time = self.hoverStatus[_lookupKeyHeli] - 10
|
||||||
self.hoverStatus[_lookupKeyHeli] = _time
|
self.hoverStatus[_lookupKeyHeli] = _time
|
||||||
end
|
end
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Check hover timer ".._lookupKeyHeli)
|
||||||
if _time > 0 then
|
if _time > 0 then
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering not long enough ".._lookupKeyHeli)
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Hovering above " .. _pilotName .. ". \n\nHold hover for " .. _time .. " seconds to winch them up. \n\nIf the countdown stops you\'re too far away!", self.messageTime, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Hovering above " .. _pilotName .. ". \n\nHold hover for " .. _time .. " seconds to winch them up. \n\nIf the countdown stops you\'re too far away!", self.messageTime, true)
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering long enough - door check ".._lookupKeyHeli)
|
||||||
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Door closed, try again next loop ".._lookupKeyHeli)
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
self.hoverStatus[_lookupKeyHeli] = nil
|
self.hoverStatus[_lookupKeyHeli] = nil
|
||||||
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
self:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Pilot picked up ".._lookupKeyHeli)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
_reset = false
|
_reset = false
|
||||||
else
|
else
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Helo hovering too high ".._lookupKeyHeli)
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Too high to winch " .. _pilotName .. " \nReduce height and hover for 10 seconds!", self.messageTime, true,true)
|
self:_DisplayMessageToSAR(_heliUnit, "Too high to winch " .. _pilotName .. " \nReduce height and hover for 10 seconds!", self.messageTime, true,true)
|
||||||
|
self:T(self.lid .. "[Pickup Debug] Hovering too high, try again next loop ".._lookupKeyHeli)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1647,7 +1710,8 @@ end
|
|||||||
-- @param #string heliname Heli name
|
-- @param #string heliname Heli name
|
||||||
-- @param #string groupname Group name
|
-- @param #string groupname Group name
|
||||||
-- @param #boolean isairport If true, EVENT.Landing took place at an airport or FARP
|
-- @param #boolean isairport If true, EVENT.Landing took place at an airport or FARP
|
||||||
function CSAR:_ScheduledSARFlight(heliname,groupname, isairport)
|
-- @param #boolean noreschedule If true, do not try to reschedule this is distances are not ok (coming from landing event)
|
||||||
|
function CSAR:_ScheduledSARFlight(heliname,groupname, isairport, noreschedule)
|
||||||
self:T(self.lid .. " _ScheduledSARFlight")
|
self:T(self.lid .. " _ScheduledSARFlight")
|
||||||
self:T({heliname,groupname})
|
self:T({heliname,groupname})
|
||||||
local _heliUnit = self:_GetSARHeli(heliname)
|
local _heliUnit = self:_GetSARHeli(heliname)
|
||||||
@@ -1667,20 +1731,29 @@ function CSAR:_ScheduledSARFlight(heliname,groupname, isairport)
|
|||||||
local _dist = self:_GetClosestMASH(_heliUnit)
|
local _dist = self:_GetClosestMASH(_heliUnit)
|
||||||
|
|
||||||
if _dist == -1 then
|
if _dist == -1 then
|
||||||
return
|
self:T(self.lid.."[Drop off debug] Check distance to MASH for "..heliname.." Distance can not be determined!")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:T(self.lid.."[Drop off debug] Check distance to MASH for "..heliname.." Distance km: "..math.floor(_dist/1000))
|
||||||
|
|
||||||
if ( _dist < self.FARPRescueDistance or isairport ) and _heliUnit:InAir() == false then
|
if ( _dist < self.FARPRescueDistance or isairport ) and _heliUnit:InAir() == false then
|
||||||
|
self:T(self.lid.."[Drop off debug] Distance ok, door check")
|
||||||
if self.pilotmustopendoors and self:_IsLoadingDoorOpen(heliname) == false then
|
if self.pilotmustopendoors and self:_IsLoadingDoorOpen(heliname) == false then
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me out!", self.messageTime, true, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me out!", self.messageTime, true, true)
|
||||||
|
self:T(self.lid.."[Drop off debug] Door closed, try again next loop")
|
||||||
else
|
else
|
||||||
|
self:T(self.lid.."[Drop off debug] Rescued!")
|
||||||
self:_RescuePilots(_heliUnit)
|
self:_RescuePilots(_heliUnit)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--queue up
|
--queue up
|
||||||
self:__Returning(-5,heliname,_woundedGroupName, isairport)
|
if not noreschedule then
|
||||||
|
self:__Returning(5,heliname,_woundedGroupName, isairport)
|
||||||
|
self:ScheduleOnce(5,self._ScheduledSARFlight,self,heliname,groupname, isairport, noreschedule)
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1750,9 +1823,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
|
||||||
@@ -1761,8 +1831,9 @@ end
|
|||||||
--- (Internal) Function to get string of a group\'s position.
|
--- (Internal) Function to get string of a group\'s position.
|
||||||
-- @param #CSAR self
|
-- @param #CSAR self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE _woundedGroup Group or Unit object.
|
-- @param Wrapper.Controllable#CONTROLLABLE _woundedGroup Group or Unit object.
|
||||||
|
-- @param Wrapper.Unit#UNIT _Unit Requesting helo pilot unit
|
||||||
-- @return #string Coordinates as Text
|
-- @return #string Coordinates as Text
|
||||||
function CSAR:_GetPositionOfWounded(_woundedGroup)
|
function CSAR:_GetPositionOfWounded(_woundedGroup,_Unit)
|
||||||
self:T(self.lid .. " _GetPositionOfWounded")
|
self:T(self.lid .. " _GetPositionOfWounded")
|
||||||
local _coordinate = _woundedGroup:GetCoordinate()
|
local _coordinate = _woundedGroup:GetCoordinate()
|
||||||
local _coordinatesText = "None"
|
local _coordinatesText = "None"
|
||||||
@@ -1777,6 +1848,26 @@ function CSAR:_GetPositionOfWounded(_woundedGroup)
|
|||||||
_coordinatesText = _coordinate:ToStringBULLS(self.coalition)
|
_coordinatesText = _coordinate:ToStringBULLS(self.coalition)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if _Unit and _Unit:GetPlayerName() then
|
||||||
|
local playername = _Unit:GetPlayerName()
|
||||||
|
if playername then
|
||||||
|
local settings = _DATABASE:GetPlayerSettings(playername) or _SETTINGS
|
||||||
|
if settings then
|
||||||
|
self:T("Get Settings ok!")
|
||||||
|
if settings:IsA2G_MGRS() then
|
||||||
|
_coordinatesText = _coordinate:ToStringMGRS(settings)
|
||||||
|
elseif settings:IsA2G_LL_DMS() then
|
||||||
|
_coordinatesText = _coordinate:ToStringLLDMS(settings)
|
||||||
|
elseif settings:IsA2G_LL_DDM() then
|
||||||
|
_coordinatesText = _coordinate:ToStringLLDDM(settings)
|
||||||
|
elseif settings:IsA2G_BR() then
|
||||||
|
-- attention this is the distance from the ASKING unit to target, not from RECCE to target!
|
||||||
|
local startcoordinate = _Unit:GetCoordinate()
|
||||||
|
_coordinatesText = _coordinate:ToStringBR(startcoordinate,settings)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return _coordinatesText
|
return _coordinatesText
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1802,22 +1893,26 @@ function CSAR:_DisplayActiveSAR(_unitName)
|
|||||||
self:T({Table=_value})
|
self:T({Table=_value})
|
||||||
local _woundedGroup = _value.group
|
local _woundedGroup = _value.group
|
||||||
if _woundedGroup and _value.alive then
|
if _woundedGroup and _value.alive then
|
||||||
local _coordinatesText = self:_GetPositionOfWounded(_woundedGroup)
|
local _coordinatesText = self:_GetPositionOfWounded(_woundedGroup,_heli)
|
||||||
local _helicoord = _heli:GetCoordinate()
|
local _helicoord = _heli:GetCoordinate()
|
||||||
local _woundcoord = _woundedGroup:GetCoordinate()
|
local _woundcoord = _woundedGroup:GetCoordinate()
|
||||||
local _distance = self:_GetDistance(_helicoord, _woundcoord)
|
local _distance = self:_GetDistance(_helicoord, _woundcoord)
|
||||||
self:T({_distance = _distance})
|
self:T({_distance = _distance})
|
||||||
local distancetext = ""
|
local distancetext = ""
|
||||||
if _SETTINGS:IsImperial() then
|
local settings = _SETTINGS
|
||||||
|
if _heli:GetPlayerName() then
|
||||||
|
settings = _DATABASE:GetPlayerSettings(_heli:GetPlayerName()) or _SETTINGS
|
||||||
|
end
|
||||||
|
if settings:IsImperial() then
|
||||||
distancetext = string.format("%.1fnm",UTILS.MetersToNM(_distance))
|
distancetext = string.format("%.1fnm",UTILS.MetersToNM(_distance))
|
||||||
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
|
||||||
|
|
||||||
@@ -1898,7 +1993,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()
|
||||||
@@ -1919,28 +2014,68 @@ end
|
|||||||
--- (Internal) Display info to all SAR groups.
|
--- (Internal) Display info to all SAR groups.
|
||||||
-- @param #CSAR self
|
-- @param #CSAR self
|
||||||
-- @param #string _message Message to display.
|
-- @param #string _message Message to display.
|
||||||
-- @param #number _side Coalition of message.
|
-- @param #number _side Coalition of message.
|
||||||
-- @param #number _messagetime How long to show.
|
-- @param #number _messagetime How long to show.
|
||||||
function CSAR:_DisplayToAllSAR(_message, _side, _messagetime)
|
-- @param #boolean ToSRS If true or nil, send to SRS TTS
|
||||||
|
-- @param #boolean ToScreen If true or nil, send to Screen
|
||||||
|
function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
|
||||||
self:T(self.lid .. " _DisplayToAllSAR")
|
self:T(self.lid .. " _DisplayToAllSAR")
|
||||||
local messagetime = _messagetime or self.messageTime
|
local messagetime = _messagetime or self.messageTime
|
||||||
if self.msrs then
|
self:T({_message,ToSRS=ToSRS,ToScreen=ToScreen})
|
||||||
|
if self.msrs and (ToSRS == true or ToSRS == nil) then
|
||||||
local voice = self.CSARVoice or MSRS.Voices.Google.Standard.en_GB_Standard_F
|
local voice = self.CSARVoice or MSRS.Voices.Google.Standard.en_GB_Standard_F
|
||||||
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:I("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
|
||||||
for _, _unitName in pairs(self.csarUnits) do
|
if ToScreen == true or ToScreen == nil then
|
||||||
local _unit = self:_GetSARHeli(_unitName)
|
for _, _unitName in pairs(self.csarUnits) do
|
||||||
if _unit and not self.suppressmessages then
|
local _unit = self:_GetSARHeli(_unitName)
|
||||||
self:_DisplayMessageToSAR(_unit, _message, _messagetime)
|
if _unit and not self.suppressmessages then
|
||||||
|
self:_DisplayMessageToSAR(_unit, _message, _messagetime)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
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
|
||||||
@@ -1981,7 +2116,7 @@ end
|
|||||||
--- (Internal) Determine distance to closest MASH.
|
--- (Internal) Determine distance to closest MASH.
|
||||||
-- @param #CSAR self
|
-- @param #CSAR self
|
||||||
-- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT
|
-- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT
|
||||||
-- @retunr
|
-- @return #CSAR self
|
||||||
function CSAR:_GetClosestMASH(_heli)
|
function CSAR:_GetClosestMASH(_heli)
|
||||||
self:T(self.lid .. " _GetClosestMASH")
|
self:T(self.lid .. " _GetClosestMASH")
|
||||||
local _mashset = self.mash -- Core.Set#SET_GROUP
|
local _mashset = self.mash -- Core.Set#SET_GROUP
|
||||||
@@ -2064,12 +2199,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
|
||||||
@@ -2092,7 +2227,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
|
||||||
@@ -2183,9 +2323,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
|
||||||
@@ -2200,31 +2344,35 @@ 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
|
||||||
self:T({_pilot})
|
self:T({_pilot.name})
|
||||||
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
|
||||||
@@ -2261,6 +2409,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 ---
|
||||||
------------------------------
|
------------------------------
|
||||||
@@ -2282,7 +2440,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
|
||||||
@@ -2291,7 +2451,24 @@ 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()
|
||||||
|
|
||||||
|
local staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterOnce()
|
||||||
|
local zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterOnce()
|
||||||
|
|
||||||
|
if staticmashes:Count() > 0 then
|
||||||
|
for _,_mash in pairs(staticmashes.Set) do
|
||||||
|
self.mash:AddObject(_mash)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if zonemashes:Count() > 0 then
|
||||||
|
for _,_mash in pairs(zonemashes.Set) do
|
||||||
|
self.mash:AddObject(_mash)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
@@ -2501,7 +2678,7 @@ end
|
|||||||
-- @param #boolean IsAirport True if heli has landed on an AFB (from event land).
|
-- @param #boolean IsAirport True if heli has landed on an AFB (from event land).
|
||||||
function CSAR:onbeforeReturning(From, Event, To, Heliname, Woundedgroupname, IsAirPort)
|
function CSAR:onbeforeReturning(From, Event, To, Heliname, Woundedgroupname, IsAirPort)
|
||||||
self:T({From, Event, To, Heliname, Woundedgroupname})
|
self:T({From, Event, To, Heliname, Woundedgroupname})
|
||||||
self:_ScheduledSARFlight(Heliname,Woundedgroupname, IsAirPort)
|
--self:_ScheduledSARFlight(Heliname,Woundedgroupname, IsAirPort)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
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
|
||||||
@@ -1078,6 +1079,13 @@ function CHIEF:SetStrategy(Strategy)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get current strategy.
|
||||||
|
-- @param #CHIEF self
|
||||||
|
-- @return #string Strategy.
|
||||||
|
function CHIEF:GetStrategy()
|
||||||
|
return self.strategy
|
||||||
|
end
|
||||||
|
|
||||||
--- Get defence condition.
|
--- Get defence condition.
|
||||||
-- @param #CHIEF self
|
-- @param #CHIEF self
|
||||||
-- @param #string Current Defence condition. See @{#CHIEF.DEFCON}, e.g. `CHIEF.DEFCON.RED`.
|
-- @param #string Current Defence condition. See @{#CHIEF.DEFCON}, e.g. `CHIEF.DEFCON.RED`.
|
||||||
@@ -1277,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.
|
||||||
--
|
--
|
||||||
@@ -1456,7 +1466,7 @@ end
|
|||||||
--- Add a CAP zone. Flights will engage detected targets inside this zone.
|
--- Add a CAP zone. Flights will engage detected targets inside this zone.
|
||||||
-- @param #CHIEF self
|
-- @param #CHIEF self
|
||||||
-- @param Core.Zone#ZONE Zone CAP Zone. Has to be a circular zone.
|
-- @param Core.Zone#ZONE Zone CAP Zone. Has to be a circular zone.
|
||||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet.
|
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||||
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
||||||
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||||
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
||||||
@@ -1472,7 +1482,7 @@ end
|
|||||||
--- Add a GCI CAP.
|
--- Add a GCI CAP.
|
||||||
-- @param #CHIEF self
|
-- @param #CHIEF self
|
||||||
-- @param Core.Zone#ZONE Zone Zone, where the flight orbits.
|
-- @param Core.Zone#ZONE Zone Zone, where the flight orbits.
|
||||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet.
|
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||||
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
||||||
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||||
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
||||||
@@ -1499,7 +1509,7 @@ end
|
|||||||
--- Add an AWACS zone.
|
--- Add an AWACS zone.
|
||||||
-- @param #CHIEF self
|
-- @param #CHIEF self
|
||||||
-- @param Core.Zone#ZONE Zone Zone.
|
-- @param Core.Zone#ZONE Zone Zone.
|
||||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet.
|
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||||
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
||||||
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||||
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
||||||
@@ -1526,7 +1536,7 @@ end
|
|||||||
--- Add a refuelling tanker zone.
|
--- Add a refuelling tanker zone.
|
||||||
-- @param #CHIEF self
|
-- @param #CHIEF self
|
||||||
-- @param Core.Zone#ZONE Zone Zone.
|
-- @param Core.Zone#ZONE Zone Zone.
|
||||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet.
|
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||||
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
-- @param #number Speed Orbit speed in KIAS. Default 350 kts.
|
||||||
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
-- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||||
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
-- @param #number Leg Length of race-track in NM. Default 30 NM.
|
||||||
@@ -3026,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
|
||||||
@@ -3045,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)
|
||||||
|
|
||||||
@@ -3057,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
|
||||||
@@ -3069,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))
|
||||||
|
|
||||||
|
|
||||||
@@ -3217,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.
|
||||||
@@ -3233,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
|
||||||
|
|||||||
@@ -88,7 +88,10 @@ COHORT = {
|
|||||||
|
|
||||||
--- COHORT class version.
|
--- COHORT class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
COHORT.version="0.3.5"
|
COHORT.version="0.3.6"
|
||||||
|
|
||||||
|
--- Global variable to store the unique(!) cohort names
|
||||||
|
_COHORTNAMES={}
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -110,6 +113,17 @@ COHORT.version="0.3.5"
|
|||||||
-- @return #COHORT self
|
-- @return #COHORT self
|
||||||
function COHORT:New(TemplateGroupName, Ngroups, CohortName)
|
function COHORT:New(TemplateGroupName, Ngroups, CohortName)
|
||||||
|
|
||||||
|
-- Name of the cohort.
|
||||||
|
local name=tostring(CohortName or TemplateGroupName)
|
||||||
|
|
||||||
|
-- Cohort name has to be unique or we will get serious problems!
|
||||||
|
if UTILS.IsAnyInTable(_COHORTNAMES, name) then
|
||||||
|
env.error(string.format('ERROR: cannot create cohort "%s" because another cohort with that name already exists. Names must be unique!', name))
|
||||||
|
return nil
|
||||||
|
else
|
||||||
|
table.insert(_COHORTNAMES, name)
|
||||||
|
end
|
||||||
|
|
||||||
-- Inherit everything from FSM class.
|
-- Inherit everything from FSM class.
|
||||||
local self=BASE:Inherit(self, FSM:New()) -- #COHORT
|
local self=BASE:Inherit(self, FSM:New()) -- #COHORT
|
||||||
|
|
||||||
@@ -117,7 +131,7 @@ function COHORT:New(TemplateGroupName, Ngroups, CohortName)
|
|||||||
self.templatename=TemplateGroupName
|
self.templatename=TemplateGroupName
|
||||||
|
|
||||||
-- Cohort name.
|
-- Cohort name.
|
||||||
self.name=tostring(CohortName or TemplateGroupName)
|
self.name=name
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- Set some string id for output to DCS.log file.
|
||||||
self.lid=string.format("COHORT %s | ", self.name)
|
self.lid=string.format("COHORT %s | ", self.name)
|
||||||
@@ -505,6 +519,9 @@ end
|
|||||||
function COHORT:SetCallsign(Callsign, Index)
|
function COHORT:SetCallsign(Callsign, Index)
|
||||||
self.callsignName=Callsign
|
self.callsignName=Callsign
|
||||||
self.callsignIndex=Index
|
self.callsignIndex=Index
|
||||||
|
self.callsign={}
|
||||||
|
self.callsign.NumberSquad=Callsign
|
||||||
|
self.callsign.NumberGroup=Index
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -574,7 +591,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
|
||||||
@@ -606,6 +623,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.
|
||||||
@@ -972,6 +1023,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
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user