mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-17 07:33:56 +00:00
Compare commits
1112 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1be2c92a5c | |||
| 4c8a17fe57 | |||
| 64dea17982 | |||
| b1f86c702d | |||
| 1a9540d0d4 | |||
| cdfaac527c | |||
| 4e3bf9969b | |||
| 74c16bd4f0 | |||
| 55e048b322 | |||
| b31fb7ece3 | |||
| 149e3421d9 | |||
| 338ec34604 | |||
| 3d79a16d3a | |||
| efa08c1280 | |||
| 589e65963f | |||
| af4f20af67 | |||
| b1b8630d21 | |||
| 98ed7d50c1 | |||
| 4ba81cb8bc | |||
| 626b12f486 | |||
| 36c0297344 | |||
| 8c60a8c678 | |||
| 6829d75464 | |||
| 867f919d5f | |||
| f769a0deb5 | |||
| 4efd71e36a | |||
| 7e9dd9deff | |||
| fed9174bcb | |||
| b6ea6606fc | |||
| 9963c737a3 | |||
| 5005203206 | |||
| a3455855b8 | |||
| 73d3ed119c | |||
| d1e4dd3fe9 | |||
| 23112c9954 | |||
| 9326cfad1c | |||
| 23c59d906f | |||
| cc62655ffe | |||
| b8e114101b | |||
| 401e9d9e8e | |||
| f083b77390 | |||
| db3bc3742e | |||
| 9b1a3e4894 | |||
| bf10196662 | |||
| 6c32aa6044 | |||
| edf70e971c | |||
| 7c5af54473 | |||
| a0420e1cb6 | |||
| 2aa9b91ce5 | |||
| 27bd27a2e5 | |||
| 8e219c5877 | |||
| fdc19a6898 | |||
| d3ebf023fb | |||
| 3d1dcd78a3 | |||
| d40c559d2d | |||
| 9cda1b88ea | |||
| 09f99b9a74 | |||
| ff5205e686 | |||
| ebd105f80d | |||
| cc8a4e0bad | |||
| 5f70e2d6b1 | |||
| 95f38fbf55 | |||
| aec3466f13 | |||
| 696630fe4d | |||
| 47aa524677 | |||
| 79f03c164c | |||
| ca7d3a48a7 | |||
| 2556dbe145 | |||
| af1e9546e5 | |||
| 3203a22668 | |||
| b69ac2f86f | |||
| 0d410f3e55 | |||
| cbe6756330 | |||
| 07045be32b | |||
| 52a2132463 | |||
| 9272b1f18c | |||
| b84880c0dd | |||
| a9be18b284 | |||
| 93178df67f | |||
| f34bf1e052 | |||
| e159eb83b7 | |||
| 2581836058 | |||
| d9651e1dea | |||
| 0347f185a5 | |||
| 5e2218de38 | |||
| 6db5441bb1 | |||
| 13b7e43729 | |||
| a72f7298d0 | |||
| 801cc105da | |||
| f186b4bd58 | |||
| 79f13fa6ae | |||
| d38fc4ec8f | |||
| ba1575d674 | |||
| 391182e23f | |||
| 6d5fb64fde | |||
| 5df1fb88f1 | |||
| 2e4d4f056a | |||
| a9ceda4edd | |||
| e76fd23396 | |||
| 7df1eb963f | |||
| aff1d3c7db | |||
| d15f6cdb44 | |||
| c59b668eec | |||
| 4620a83317 | |||
| 87d0c4e9d4 | |||
| 74361f6a3a | |||
| b82b882e02 | |||
| 347783d4b7 | |||
| 0b2f07ca6c | |||
| 7c5d5543e0 | |||
| 3d10716b1f | |||
| c48a7d4400 | |||
| 79130d4fe2 | |||
| aebb6ac0db | |||
| 3eb910b47e | |||
| 6223b8e1a7 | |||
| 533a4dfa6c | |||
| dbc752253b | |||
| 7f074781f4 | |||
| ab77fcbc1f | |||
| 56520092c3 | |||
| 252a1b0761 | |||
| 51e5f53965 | |||
| b0976d1613 | |||
| a737ca71e6 | |||
| 1071300a7f | |||
| 2490958090 | |||
| b78b76e579 | |||
| efff22fc18 | |||
| d52ce9af72 | |||
| cace516e91 | |||
| 4b27e92210 | |||
| 3d0061fd83 | |||
| 1f0a154e4d | |||
| 02bfe9a253 | |||
| f2063f41f6 | |||
| c7c07c7075 | |||
| 28e60745b9 | |||
| 830a3b9b1a | |||
| 12241e931a | |||
| 3f902d8886 | |||
| fdffef3baf | |||
| 4cb6debef8 | |||
| 435ea42761 | |||
| 36957dce85 | |||
| fe44e966e0 | |||
| 3b4be5396e | |||
| 685c7ac777 | |||
| efe4bf3912 | |||
| f1c70f5713 | |||
| 3608386bd0 | |||
| 548a959e72 | |||
| ff957b72c4 | |||
| 80c55a451d | |||
| bd5816e451 | |||
| d28477a655 | |||
| 9e329abcfa | |||
| 781a2043b7 | |||
| 44136b23b1 | |||
| a5f4272ab7 | |||
| f32b5878ed | |||
| 1a2892d5d0 | |||
| 1811e28fbb | |||
| c6ee556c2b | |||
| 054e362e8c | |||
| c4cb9fb82c | |||
| b48035fb37 | |||
| 5819c31b5e | |||
| d77886d586 | |||
| a9c616120f | |||
| 09849c7a44 | |||
| 75d4b70623 | |||
| 60959e211a | |||
| 6bccd64ade | |||
| 1fcc1598b1 | |||
| 69784226ea | |||
| ff17d17e3e | |||
| 40d9cd2c2b | |||
| a7127f07cb | |||
| b47528028c | |||
| 105c30868b | |||
| 786ddda4ad | |||
| 9d08d667a3 | |||
| a570136a9f | |||
| 16583ee35f | |||
| ed17a42737 | |||
| 2f6525c7c4 | |||
| 5e2e8d1fae | |||
| a05f52e3d0 | |||
| 117a1e8811 | |||
| 0daf486868 | |||
| ab6d4cb9b9 | |||
| 6efbc95043 | |||
| e5fc4bc1dc | |||
| 65eaecd005 | |||
| 7d52fb686a | |||
| 92b4f18cd6 | |||
| 8ede104a3d | |||
| 42b4bd62d9 | |||
| a8bc62608c | |||
| 266aba5d72 | |||
| 1ddcd28371 | |||
| f8c0886fe5 | |||
| ac258fa356 | |||
| 7b21c0cc6b | |||
| 67297aa574 | |||
| 28b7c431e0 | |||
| b5ba31a94d | |||
| 4ca843a14e | |||
| 24043d31ab | |||
| a008e6cc26 | |||
| 1e0afb96af | |||
| 786afd561a | |||
| 5a21e1717c | |||
| d3b550f6a2 | |||
| f5bda1e8d1 | |||
| a5bad3735f | |||
| 2e00c3ad56 | |||
| 3324656516 | |||
| a8b6607c89 | |||
| f93bf6f0e7 | |||
| ccd4d3c9a8 | |||
| 4dee60b0fd | |||
| 85a4e4bd35 | |||
| 227b6337bc | |||
| b6c82316c7 | |||
| 9850b50f1e | |||
| 970f567edf | |||
| a4b47001c4 | |||
| bea05a5b54 | |||
| 7ae60e3cd1 | |||
| 4367a91d4b | |||
| 04accc28c8 | |||
| 210fd237e8 | |||
| 34074a9451 | |||
| 94179bbb33 | |||
| c9549ecd7c | |||
| dc8ebf7faa | |||
| 33bd6cc5a4 | |||
| 5f7975b910 | |||
| 835b7d66a1 | |||
| b99894768b | |||
| 06acd02dbb | |||
| 2cedcff73c | |||
| 360567ccd7 | |||
| 82ec9befd0 | |||
| 514ac30ad1 | |||
| 782cd87d60 | |||
| 3514073433 | |||
| f4345e1005 | |||
| b88a421d2c | |||
| 25d3fb389c | |||
| 9afd516182 | |||
| bfeaa0530f | |||
| bb4692bbf6 | |||
| 73fc73ae52 | |||
| f9d667863e | |||
| f3bc71a4ee | |||
| d30377a7b1 | |||
| 750ad6b5b9 | |||
| e8176eee4f | |||
| 52b1526163 | |||
| 74254e407b | |||
| ca3ccce3f2 | |||
| 4ce820279e | |||
| 3c11045050 | |||
| 64199acefe | |||
| 2d4d4e3865 | |||
| f01a1fb6b9 | |||
| 0a05bb3892 | |||
| 506073022b | |||
| 85b582d6dd | |||
| 8968add126 | |||
| 6967b5f20b | |||
| 4e910fcd7a | |||
| c65d93dd73 | |||
| ea3689791b | |||
| 38bdcfd297 | |||
| b74ec54bea | |||
| 6698bf0c67 | |||
| c346eb7acc | |||
| 414a1d2ca5 | |||
| 6f16d34681 | |||
| 88e6d1c3ff | |||
| 877ca7176a | |||
| 9c3a2470c2 | |||
| ee002fa470 | |||
| 33773950b0 | |||
| 753691f5db | |||
| 216d023c45 | |||
| d5911afde1 | |||
| a57532d7bf | |||
| e02a1f705b | |||
| 2e4d401f61 | |||
| 9c16734141 | |||
| ea1fa521c4 | |||
| 384e0b1212 | |||
| 3d6bd4ea54 | |||
| 085330c930 | |||
| 44cfbb2c30 | |||
| fe0f0a0190 | |||
| f1386dd229 | |||
| 68ac892015 | |||
| 782bd0f164 | |||
| d85b109091 | |||
| 429307ecc3 | |||
| 180d861426 | |||
| 7c15e1119b | |||
| 11d7a31584 | |||
| 26f55b0bb5 | |||
| 2828693112 | |||
| ebd61a70b0 | |||
| e96c265135 | |||
| a96e093204 | |||
| bed8196f10 | |||
| d51ab4483e | |||
| e28d24bfe3 | |||
| 7a9f2f3944 | |||
| 0ce082ed80 | |||
| 1319df63f5 | |||
| 486dc6d218 | |||
| 234345f2ea | |||
| 08bfc1450c | |||
| 8788dc264d | |||
| 5ff5da9d9a | |||
| bfc9d357d6 | |||
| fc79fd18b8 | |||
| a949b7ae8c | |||
| 6899f4b5ac | |||
| e6fb8fa1d4 | |||
| 12e71f4454 | |||
| 6362e37804 | |||
| 8471132fe7 | |||
| 2449ed4c96 | |||
| 3979e6b2af | |||
| 052f055bbf | |||
| a88bc4554f | |||
| ddfdc3e1d1 | |||
| e0487280e5 | |||
| 8bb080dba7 | |||
| c31e8e8130 | |||
| 09fd4d25b7 | |||
| e3c753ba71 | |||
| 1ac0249fe5 | |||
| eb1db21920 | |||
| 60e46bed7e | |||
| a127c8b7c7 | |||
| 982b5392ab | |||
| 843ef4d9d2 | |||
| 52986ce8de | |||
| 5c570b3d8c | |||
| d85e5e7b3e | |||
| 2ebce9fd03 | |||
| 758f2a7103 | |||
| fa163d2a42 | |||
| 8f910f83af | |||
| 5e6204854f | |||
| da65b3ec64 | |||
| c781c2fefb | |||
| d691b8201b | |||
| 2109222d12 | |||
| 1abebc54b2 | |||
| 248af4f9a1 | |||
| 1a70358e21 | |||
| 1729c14acc | |||
| 1b440aa3ad | |||
| 9e2a57a935 | |||
| e52c1199f9 | |||
| 176d614d86 | |||
| 3003d069fe | |||
| dfcbe6fd9b | |||
| 5a9277de90 | |||
| 3b4b385418 | |||
| db49403117 | |||
| 63b916eeca | |||
| 0beb6b2022 | |||
| 62dcfdb7a2 | |||
| 17d33b460f | |||
| 9dc282b1d9 | |||
| 7ec43c9913 | |||
| 9df39f9646 | |||
| d3ad70b019 | |||
| 8bab24adbd | |||
| 3261a59cee | |||
| 42731b5778 | |||
| 80d2c9871d | |||
| d5b7a2e168 | |||
| ee610f5cc7 | |||
| 1830b4c752 | |||
| 486891d861 | |||
| cec6663ea3 | |||
| 9e2ad78330 | |||
| d8dc953252 | |||
| 08bab8501b | |||
| 3e2fe8a744 | |||
| 802c2065ee | |||
| 34d2336030 | |||
| 9322b4df99 | |||
| af0e411487 | |||
| bff150a931 | |||
| 829860e4f0 | |||
| af67829a41 | |||
| e633c0247d | |||
| 38b385f15f | |||
| 33483ae37b | |||
| a9a827dc40 | |||
| d82f49f727 | |||
| ce711a3d0c | |||
| 6b3148ec31 | |||
| e5fc887d4a | |||
| 59b15930a3 | |||
| f06daedb0c | |||
| c2b8a71000 | |||
| b29f485e15 | |||
| e821fa1100 | |||
| e5c919700a | |||
| b9b947fa3d | |||
| 07714d160c | |||
| e413ca5b62 | |||
| a96c617b01 | |||
| da0ba49a14 | |||
| c4ad52a456 | |||
| de2c6bec85 | |||
| 3eef63b75c | |||
| 9df694e12e | |||
| a3754b7031 | |||
| ca19352ace | |||
| e3b405ad2d | |||
| fb8cc4bfeb | |||
| c119e35901 | |||
| b3005010e7 | |||
| 2cb58da7b7 | |||
| ab14deb2cf | |||
| 5b88ad2967 | |||
| 79a2e905a8 | |||
| 0e3500f587 | |||
| 12fa333907 | |||
| 17a3f59bdc | |||
| fc9e31199e | |||
| fefcbbabbb | |||
| 38fcb274a0 | |||
| 3aa3942998 | |||
| 8a958df5f5 | |||
| 41a9c22959 | |||
| 49097649de | |||
| 19e94a7fb9 | |||
| 7605c2f4f5 | |||
| ec41d7310b | |||
| feb4f77ef4 | |||
| 79654a99d9 | |||
| 1d0a273ffb | |||
| 7fec25ddcd | |||
| 81b227fa9e | |||
| 2eb5374b28 | |||
| 12bde81e67 | |||
| 0503596414 | |||
| 65ab481432 | |||
| d76e8ddc3f | |||
| 7189154d47 | |||
| e72bd1738c | |||
| 280d2f6517 | |||
| 16e069b9a5 | |||
| 230e270f13 | |||
| a87860a110 | |||
| 7456489fb0 | |||
| 9992361980 | |||
| 40fee25da5 | |||
| d6a9e4726e | |||
| 9e81e5606a | |||
| 01425dac70 | |||
| 8406fd86d5 | |||
| 88a8a3318f | |||
| c4f0440b0a | |||
| cbb6d2c712 | |||
| bc24d75ad7 | |||
| c869d23778 | |||
| 5edffbbca4 | |||
| 01f2b6b783 | |||
| ed091c4f3e | |||
| f4a2ae8ccc | |||
| 4bc25c6043 | |||
| d25acf1065 | |||
| 742103ff02 | |||
| f93a1959b4 | |||
| d37cd1613d | |||
| 96a923b5a8 | |||
| aebb6a359b | |||
| 500f113f95 | |||
| b983e9f8b4 | |||
| 856197a5c8 | |||
| 6f05249214 | |||
| c9c6d5dbc2 | |||
| a8de630ecf | |||
| 7c37160fb7 | |||
| 2e263561d3 | |||
| 255a652d4d | |||
| aa2cff69e9 | |||
| 0789fb7f08 | |||
| 4fba2e4abd | |||
| 9670f26619 | |||
| e197f88510 | |||
| b07accdb3d | |||
| 31808b7981 | |||
| 50827b3b60 | |||
| 8901820026 | |||
| 288b933884 | |||
| f4c7912415 | |||
| 1ecc3c8ff2 | |||
| 6e38e214b6 | |||
| 8251879162 | |||
| ec9297a5c0 | |||
| a93ade9813 | |||
| df454cb59e | |||
| 13217f764e | |||
| 71400ff24b | |||
| 10371c06d0 | |||
| 33dd158df4 | |||
| d74d337d2f | |||
| 4b1d81d582 | |||
| e223084014 | |||
| 02022685f4 | |||
| c415f9082f | |||
| aab65765a7 | |||
| c0335a1f86 | |||
| c2e81415a1 | |||
| 1d8a03f9d4 | |||
| befb957b3f | |||
| d0d22142b9 | |||
| ecc94b6b5e | |||
| 977df39ac9 | |||
| e0eee614c7 | |||
| ed52325fe2 | |||
| 68e0537846 | |||
| 53b1415e87 | |||
| 75c350cffc | |||
| 484a51a377 | |||
| 488996fadb | |||
| 729f987cf1 | |||
| 7113706a16 | |||
| 45e62a5b2f | |||
| b803371d0b | |||
| dd459b05b5 | |||
| 41855fc63b | |||
| 71d93f2b67 | |||
| c814ed5a04 | |||
| fa10c7d0d4 | |||
| 0ea6f5f71b | |||
| 43c5fee5b3 | |||
| 905b2a7a98 | |||
| 9faa12a681 | |||
| 0532ceb1cf | |||
| 0cc3150558 | |||
| 0fc2ce2484 | |||
| 6abd76a40b | |||
| 4a1acf5d6a | |||
| 7ae926bf5c | |||
| c197c842e8 | |||
| 8ad03f11ca | |||
| bfb89e80e0 | |||
| 4d48b42aea | |||
| 6e01df753f | |||
| c75022038c | |||
| d71cd370c0 | |||
| f400d0212a | |||
| 3ce0a8a45e | |||
| cc295b4633 | |||
| cad66e8241 | |||
| da7bc301ea | |||
| f6b77f51ce | |||
| 4067259e9a | |||
| fe9512eb82 | |||
| d213c3defb | |||
| d13781ec32 | |||
| 8c5efdbe55 | |||
| e49003940f | |||
| 3c85b920cd | |||
| 83cf6026cb | |||
| ece9e008c2 | |||
| 95e7daa27c | |||
| 5411c4f38d | |||
| 56022f5e1e | |||
| bc464008c9 | |||
| 25143386d5 | |||
| af7c9a3caa | |||
| 4a3e60bde9 | |||
| 4c8a93f63f | |||
| c6b78b9e42 | |||
| ea90f56f4d | |||
| 8684fc13ac | |||
| 7ccdec671a | |||
| 052e1c3867 | |||
| ac410e9a56 | |||
| 1e1ed92d52 | |||
| fc37149e9d | |||
| 413fa31534 | |||
| 5af7bcc677 | |||
| 3768d57639 | |||
| e947367fca | |||
| 23105e3cb5 | |||
| 09898d9b4d | |||
| a49d20dd8f | |||
| 0069d20434 | |||
| 56c8e22392 | |||
| 54ad4495c4 | |||
| 16dff6c24d | |||
| e543ee576f | |||
| 8db60412ba | |||
| 2da2dec1da | |||
| 892fcfc2ca | |||
| 8ff79e4131 | |||
| 2b29ae4f9c | |||
| 04f275e273 | |||
| 19ab249d77 | |||
| f15b1a503a | |||
| a64cc0ba4b | |||
| 0457fc85c7 | |||
| 2cd071acb2 | |||
| 92f6687429 | |||
| c0b1062ac7 | |||
| 54f6eddfa2 | |||
| 777886a8e7 | |||
| 6cb262e04d | |||
| 504c531266 | |||
| 77863e64bb | |||
| 61509f35df | |||
| 1c48a71cec | |||
| 940abee55c | |||
| b66a29e209 | |||
| 2d9a99738e | |||
| 22b8cab5e1 | |||
| d40b744728 | |||
| ccb1055c6f | |||
| c78471cc8f | |||
| aa4b4a5e2f | |||
| 33154ebcdc | |||
| 78bfbb11f9 | |||
| a491c34824 | |||
| 43c7a65942 | |||
| d18cd0e643 | |||
| 26a03d2c45 | |||
| b035e0835c | |||
| dbe96fa931 | |||
| dc04d347bb | |||
| a33d71d6ef | |||
| e842e11b88 | |||
| 3cf168c7aa | |||
| ff02063d54 | |||
| 2e5ffa269f | |||
| 744782fd0b | |||
| 9a4025a566 | |||
| 7a8486d7cd | |||
| 25f79e495b | |||
| 8525bf0188 | |||
| cb08e4a577 | |||
| a28ad6a7c2 | |||
| 7e3c33e242 | |||
| e8f30fc98b | |||
| 77b9ded23e | |||
| 5d976266c3 | |||
| e03a397d46 | |||
| f08783f800 | |||
| eea75c669f | |||
| 2e31c62efb | |||
| e7f953df6d | |||
| b62b39e9e8 | |||
| 8717faf7a1 | |||
| 14300229fb | |||
| 2c15d7ed00 | |||
| 6ac17fa999 | |||
| 768a380b32 | |||
| 0233fef475 | |||
| a4aa78ac35 | |||
| ca3fb4e479 | |||
| 40d4dc14ab | |||
| 618a5ca9be | |||
| f7a86deba5 | |||
| 740f90a513 | |||
| efceb095d2 | |||
| ac7cdb7d16 | |||
| ffc5cff275 | |||
| e456573eec | |||
| daa2b7da4d | |||
| 5351c4f093 | |||
| 5ff314d8e0 | |||
| 45bb0fff8a | |||
| 9a10b34933 | |||
| 1231541053 | |||
| 5e45e4a8ec | |||
| 5a96a6078a | |||
| 8fdeca99be | |||
| 6ff2725a1d | |||
| 2b83d516d5 | |||
| c5ec17a473 | |||
| a81de5e23f | |||
| c1855cefd3 | |||
| e9d812f315 | |||
| f95d27bf80 | |||
| be98ee52b7 | |||
| 4c9210586c | |||
| dc51f83249 | |||
| 23ed39a708 | |||
| 44c59b97e8 | |||
| 9721f743a0 | |||
| 63899923fb | |||
| 4fbbf70b8e | |||
| e38dc77c4b | |||
| f283e68a63 | |||
| 96d52ea393 | |||
| 52c45364fc | |||
| fcfc41252e | |||
| 46f9cf46e4 | |||
| 1c24786723 | |||
| 7ded993c49 | |||
| 2636ca166f | |||
| 5d6e0c333b | |||
| ec2a89fa48 | |||
| c9414d98da | |||
| 7df7a34c32 | |||
| 5d303752fe | |||
| 66cb7dd9b7 | |||
| e483d1bfca | |||
| 1456ff37d0 | |||
| abc86a7e9c | |||
| 00c5d82590 | |||
| c902a1f601 | |||
| d92a170304 | |||
| 41a9a1f74b | |||
| 9d7986e8d1 | |||
| ff5adc29d9 | |||
| b77ff793a3 | |||
| 08b95ec8c6 | |||
| 2c255d48c5 | |||
| 367ee31135 | |||
| 4ca43b4779 | |||
| d30b16a2fe | |||
| 6cb306a7e1 | |||
| b63185f1b3 | |||
| 4dc9e78812 | |||
| 22b81318b9 | |||
| 9862811c16 | |||
| af12296e51 | |||
| 0361a95f5d | |||
| d6a16ee8b1 | |||
| e3aade05d4 | |||
| c21c3ecb42 | |||
| 1bfeb0b41b | |||
| 4ec2923f46 | |||
| d2ec9642ca | |||
| e8e4f6bcb9 | |||
| f723f81c6d | |||
| 5aeb3ba42d | |||
| 104d0f3d2d | |||
| 0ec47795bf | |||
| c634023717 | |||
| df9f204b7a | |||
| 1b29a30760 | |||
| 5d07cebdc4 | |||
| b59bd0d4f2 | |||
| a2ccfcf361 | |||
| dccd46367f | |||
| 2a6df8434a | |||
| 1661872bf8 | |||
| 8878d1a8d3 | |||
| 8e017f2ce0 | |||
| d16124213f | |||
| bdff8541b4 | |||
| 0d0cc20ebc | |||
| 6fcb4a3184 | |||
| 2fced89dfc | |||
| 96ad3ff98b | |||
| 6c8fa5585b | |||
| dc8992134e | |||
| 885b329dcb | |||
| 702c5464aa | |||
| ac750aff10 | |||
| c679a77f9f | |||
| 176e4f6217 | |||
| 9e69c1c17e | |||
| 187a620f37 | |||
| 91b2fc7d9c | |||
| 0baa912465 | |||
| 79e7f9940e | |||
| 25845c4d22 | |||
| b66a342642 | |||
| e2054371ed | |||
| e9c1ccedcd | |||
| 367d1c6715 | |||
| 093c3fe7c9 | |||
| 428712147d | |||
| 20fa78bc85 | |||
| d081e115c7 | |||
| 3df9b54c01 | |||
| 72ac957806 | |||
| 8ea746ee19 | |||
| b2bc553e48 | |||
| a91c76a0be | |||
| 5a94be98fe | |||
| 999d67b7af | |||
| 91e7c86ba0 | |||
| f75c464bcd | |||
| a4ae0d88e1 | |||
| 5c5b1383be | |||
| a5e75bf485 | |||
| c6d79db266 | |||
| b394622b92 | |||
| 03c623a0c2 | |||
| a5a0d8ab8a | |||
| 3bb5d3709b | |||
| 32e538a27d | |||
| 02b75bf529 | |||
| f3477a03c6 | |||
| 8f5e519d0a | |||
| 1c4c5b5476 | |||
| 85e4a6cbd6 | |||
| 0f9742aeb4 | |||
| 2d49745215 | |||
| 2b6a039368 | |||
| 83e146f207 | |||
| b115a0a672 | |||
| 0c384a75cc | |||
| c19d20c3f7 | |||
| c7bc55d851 | |||
| 245dd6bb27 | |||
| ff4f162ca2 | |||
| baf3f9a9a4 | |||
| ae65fce9cd | |||
| 5e856b67a1 | |||
| f365c5153b | |||
| a11cda4ed1 | |||
| 9faa1b806d | |||
| f533d4ec8f | |||
| afc0671aa9 | |||
| f77771ae25 | |||
| c62dc17cd8 | |||
| 3ed61e8a2a | |||
| 2a1234f7ff | |||
| 77c6365e37 | |||
| 5c1d367926 | |||
| 869339150a | |||
| 9b5a653940 | |||
| 083bf13fe4 | |||
| 50436b8ced | |||
| b82e15b2ce | |||
| 8ffa1bd692 | |||
| c855198634 | |||
| 8aa8acdad0 | |||
| 382ad6ecd8 | |||
| f009370e07 | |||
| 0e91a658b3 | |||
| 774317f2c5 | |||
| a33e542df5 | |||
| 6adb9f0839 | |||
| 44a433eadf | |||
| 40cd58aa1c | |||
| a2c241da43 | |||
| 34a11e79b3 | |||
| 1e4d2f4427 | |||
| a3d7c9e537 | |||
| 9966c5eadf | |||
| 66bd771662 | |||
| deb0431f93 | |||
| 5cc3fd7238 | |||
| c1c5467b9d | |||
| f67706044a | |||
| 2cb58bd351 | |||
| fc8c1c156f | |||
| 55052f4451 | |||
| 12dd4a918f | |||
| 21a6bcfcfb | |||
| dc9b70db7e | |||
| 3b03b03f3c | |||
| 3923d81c87 | |||
| 3090100265 | |||
| 87356291f7 | |||
| 633186ca8a | |||
| 411d20ba26 | |||
| 6eac89c038 | |||
| 08b6fa520d | |||
| b69cea999e | |||
| 91db9127da | |||
| c4512651cf | |||
| 26530f25fb | |||
| d51961ac8c | |||
| 80e20e59ec | |||
| 80906ded28 | |||
| 7cb04e65ca | |||
| 8cd625b6f9 | |||
| 152a8cf9da | |||
| bb648b4396 | |||
| ecdca9919e | |||
| 9bf2a013d5 | |||
| 4b2bc909e6 | |||
| b3ed0681a8 | |||
| 0e75f64217 | |||
| 678dc92a66 | |||
| 7f323dd3a5 | |||
| 6ebd36e0b5 | |||
| f7583dbd56 | |||
| d0aa039626 | |||
| 844ad4619e | |||
| a73a12f73b | |||
| 925754f290 | |||
| 3efe02fe37 | |||
| 84b1acc9d5 | |||
| ee144620ef | |||
| f8808e0231 | |||
| 3b02e153ba | |||
| 87a94a72a6 | |||
| de8d356e6a | |||
| 58f5152fe5 | |||
| 5b5bd83d5a | |||
| 90c78f304c | |||
| 6e2a058e6e | |||
| 3c878be568 | |||
| 465f8a5cc9 | |||
| 7dd67bdf0e | |||
| e9e0f82932 | |||
| bb43a0e03c | |||
| 3805ab226b | |||
| f1445cdbdd | |||
| c80f128b0f | |||
| ef78549af0 | |||
| 5b437d6fb1 | |||
| 3a3a3baf93 | |||
| 29efd4c4fb | |||
| 1a9827ec31 | |||
| 4ae5e4ddd0 | |||
| 270eeac084 | |||
| eca130b3af | |||
| 426297812e | |||
| 855ea764b1 | |||
| e53f1aa68d | |||
| 7c06c615d0 | |||
| bc60648458 | |||
| 116527abfe | |||
| a0f58a95db | |||
| c55732a02f | |||
| 25740f7e61 | |||
| 66b6e4475e | |||
| 76a8bc7a33 | |||
| 633f990b36 | |||
| 4511f79609 | |||
| 7ba360a005 | |||
| c4faf39270 | |||
| 1b7dece0a5 | |||
| ddcc20cc47 | |||
| cea3ab291e | |||
| 112a0b2a8e | |||
| 1f4ca22018 | |||
| 954190f6df | |||
| 1307e53833 | |||
| e45d22ad35 | |||
| 48dcca4b7b | |||
| 4e708563eb | |||
| 20b0902768 | |||
| 6a219ab547 | |||
| fd06ce8967 | |||
| 9d46968103 | |||
| a012184dfe | |||
| 972e3550f6 | |||
| 8a83f69e9c | |||
| 98a82c5959 | |||
| ebc7902775 | |||
| 0473276c88 | |||
| 0b30ec7436 | |||
| 84e7efc939 | |||
| 8bdf57d7cb | |||
| d613f59ca8 | |||
| 508decd91b | |||
| ff366fde74 | |||
| 2dce709db1 | |||
| cc99a5ba2a | |||
| e0bf137d70 | |||
| ef4f1a87da | |||
| 8ede1fb351 | |||
| 60ce3685c9 | |||
| a1d06a6fc8 | |||
| 3d5dfc422d | |||
| 52983bc5f1 | |||
| a8a1a0e37c | |||
| e5965f8aec | |||
| 0c8a4c4cf8 | |||
| f1b4bb734d | |||
| 5c3a5ddee3 | |||
| e0e4ba7db3 | |||
| 1f3df107bf | |||
| 6887289466 | |||
| 9ef7a8aa3c | |||
| 900b0049bc | |||
| cadf46ded2 | |||
| b1fd5970d0 | |||
| a4a4b2e6b1 | |||
| d58edf7c38 | |||
| 1f0781f19a | |||
| f53488e8b0 | |||
| 232547a0fb | |||
| f3be326b5e | |||
| 9703d10f03 | |||
| d6ecde96f8 | |||
| 8153052eed | |||
| 7d3a0568a9 | |||
| 4bafdf9408 | |||
| efe3571120 | |||
| bd1fd6f469 | |||
| 69b962b934 | |||
| 1a7117c20d | |||
| c8b0e9e5d2 | |||
| 4b3e361a28 | |||
| 1965e45737 | |||
| a9ecef4f01 | |||
| f11755aad3 | |||
| e42e712e77 | |||
| 84fbd7c4b0 | |||
| 6fb5222358 | |||
| 120a66819c | |||
| d110ef1340 | |||
| 6706fc0af9 | |||
| dc358f9cde | |||
| e285b26b11 | |||
| a62184319f | |||
| add0a0231a | |||
| d00913cb68 | |||
| eef24def61 | |||
| 3813a30def | |||
| 13bde6f2ab | |||
| c38e357652 | |||
| 06d9564b8a | |||
| 0372735a02 | |||
| deb913a95b | |||
| f59dd3e8c7 | |||
| b2ed5c56fc | |||
| 9e29384262 | |||
| 540412d115 | |||
| 694b7afc71 | |||
| cb4a12c5ba | |||
| 733251bf06 | |||
| 42069c5bbb | |||
| 82b4276b33 | |||
| 8f3fc9cb2b | |||
| 89c6358085 | |||
| abb295ecc2 | |||
| 5607aa1cf2 | |||
| 43f1c6fcb1 | |||
| cebf21ec19 | |||
| f4951d09a7 | |||
| 21ec234dd3 | |||
| 43ffad02be | |||
| 4859ea2fb1 | |||
| 86ed8fe9e5 | |||
| d0d709a410 | |||
| 8ecb4372b5 | |||
| cf322c121e | |||
| 1aca716431 | |||
| 83209341ee | |||
| a481e46017 | |||
| 031a0035bd | |||
| 4ca4d2e211 | |||
| 866d4f93cc | |||
| 98eb362628 | |||
| b95f12449e | |||
| e7ab07cec3 | |||
| c61dd606a1 | |||
| 3d029d8f6f | |||
| 9bb18a9df2 | |||
| 823930de40 | |||
| c7201580d6 | |||
| e61856197a | |||
| 37d321bb5c | |||
| 38e16dd07e | |||
| 64bae07877 | |||
| 616a80cf5c | |||
| 18fd22be53 | |||
| c82359f87b | |||
| d354f02507 | |||
| f612ca2fc4 | |||
| 9d0156908c | |||
| 0ee0eb3162 | |||
| 81653cf289 | |||
| 60d68161c4 | |||
| ba5743c057 | |||
| 0ee30532ee | |||
| 093a60050b | |||
| a1605f9a2d | |||
| 6bd5148de8 | |||
| 402e72f728 | |||
| 459ee72426 | |||
| 174054f538 | |||
| 5aba0f025a | |||
| 5b32d39309 | |||
| 8d1adca034 | |||
| 9d55cb6f94 | |||
| 501fafcea6 | |||
| 7b4f7e9295 | |||
| 90fa2abbe8 | |||
| 0532a182bb | |||
| 29bb204e6d | |||
| bf7c49708f | |||
| 9227252976 | |||
| c138f76c8a | |||
| 5f4be987c6 | |||
| 63dc9b2e8e | |||
| f53bd8f11a | |||
| 554809764f | |||
| 084c172e93 | |||
| d86f471361 | |||
| 7fa01b9e3c | |||
| 5ffeecc333 | |||
| 0d88fec4bf | |||
| 06d4e4ac1c | |||
| b3758ae0e7 | |||
| 6a0b7896a4 | |||
| cc0bbf3a17 |
@@ -40,7 +40,7 @@ jobs:
|
||||
# Prepare build environment
|
||||
#########################################################################
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Prepare build output folders
|
||||
run: |
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
mkdir -p build/doc
|
||||
|
||||
- name: Checkout FlightControls modified luadocumentor
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: Applevangelist/luadocumentor
|
||||
path: './build/tools/luadocumentor'
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Checkout ${{ steps.set_doc_repo.outputs.docrepo }} to folder MOOSE_DOCS
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/${{ steps.set_doc_repo.outputs.docrepo }}
|
||||
path: './build/MOOSE_DOCS'
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
# Prepare build environment
|
||||
#########################################################################
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Prepare build output folders
|
||||
run: |
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
# Push to MOOSE_INCLUDE
|
||||
#########################################################################
|
||||
- name: Checkout MOOSE_INCLUDE
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/MOOSE_INCLUDE
|
||||
path: './build/MOOSE_INCLUDE'
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
working-directory: docs/
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v4
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Build with Jekyll
|
||||
# Outputs to the './_site' directory by default
|
||||
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
working-directory: docs/
|
||||
- name: Upload artifact
|
||||
# Automatically uploads an artifact from the './_site' directory by default
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: docs/_site/
|
||||
|
||||
@@ -73,6 +73,6 @@ jobs:
|
||||
needs: deploy
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
- run: npm install linkinator
|
||||
- run: npx linkinator https://flightcontrol-master.github.io/MOOSE/ --verbosity error --timeout 5000 --recurse --skip "(java.com)" --retry-errors --retry-errors-count 3 --retry-errors-jitter
|
||||
- run: npx linkinator https://flightcontrol-master.github.io/MOOSE/ --verbosity error --timeout 5000 --recurse --skip "(java.com)" --skip 'https:\/\/flightcontrol-master\.github\.io\/MOOSE_DOCS_DEVELOP\/Documentation\/(?:AI|Tasking|Cargo|MissileTrainer)\.[^\/\s]+\.html$' --status-code "404:skip" --retry-errors --retry-errors-count 3 --retry-errors-jitter
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,340 +0,0 @@
|
||||
--- **Cargo** - Management of single cargo crates, which are based on a STATIC object.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### [Demo Missions]()
|
||||
--
|
||||
-- ### [YouTube Playlist]()
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Cargo.CargoCrate
|
||||
-- @image Cargo_Crates.JPG
|
||||
|
||||
do -- CARGO_CRATE
|
||||
|
||||
--- Models the behaviour of cargo crates, which can be slingloaded and boarded on helicopters.
|
||||
-- @type CARGO_CRATE
|
||||
-- @extends Cargo.Cargo#CARGO_REPRESENTABLE
|
||||
|
||||
---
|
||||
-- 
|
||||
--
|
||||
--- Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
|
||||
-- Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO\_CRATE objects to and from carriers.
|
||||
--
|
||||
-- The above cargo classes are used by the following AI_CARGO_ classes to allow AI groups to transport cargo:
|
||||
--
|
||||
-- * AI Armoured Personnel Carriers to transport cargo and engage in battles, using the @{AI.AI_Cargo_APC} module.
|
||||
-- * AI Helicopters to transport cargo, using the @{AI.AI_Cargo_Helicopter} module.
|
||||
-- * AI Planes to transport cargo, using the @{AI.AI_Cargo_Airplane} module.
|
||||
-- * AI Ships is planned.
|
||||
--
|
||||
-- The above cargo classes are also used by the TASK_CARGO_ classes to allow human players to transport cargo as part of a tasking:
|
||||
--
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_TRANSPORT} to transport cargo by human players.
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_CSAR} to transport downed pilots by human players.
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @field #CARGO_CRATE
|
||||
CARGO_CRATE = {
|
||||
ClassName = "CARGO_CRATE"
|
||||
}
|
||||
|
||||
--- CARGO_CRATE Constructor.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Wrapper.Static#STATIC CargoStatic
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number LoadRadius (optional)
|
||||
-- @param #number NearRadius (optional)
|
||||
-- @return #CARGO_CRATE
|
||||
function CARGO_CRATE:New( CargoStatic, Type, Name, LoadRadius, NearRadius )
|
||||
local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoStatic, Type, Name, nil, LoadRadius, NearRadius ) ) -- #CARGO_CRATE
|
||||
self:T( { Type, Name, NearRadius } )
|
||||
|
||||
self.CargoObject = CargoStatic -- Wrapper.Static#STATIC
|
||||
|
||||
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
|
||||
_EVENTDISPATCHER:CreateEventNewCargo( self )
|
||||
|
||||
self:HandleEvent( EVENTS.Dead, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.Crash, self.OnEventCargoDead )
|
||||
--self:HandleEvent( EVENTS.RemoveUnit, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self.OnEventCargoDead )
|
||||
|
||||
self:SetEventPriority( 4 )
|
||||
|
||||
self.NearRadius = NearRadius or 25
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function CARGO_CRATE:OnEventCargoDead( EventData )
|
||||
|
||||
local Destroyed = false
|
||||
|
||||
if self:IsDestroyed() or self:IsUnLoaded() or self:IsBoarding() then
|
||||
if self.CargoObject:GetName() == EventData.IniUnitName then
|
||||
if not self.NoDestroy then
|
||||
Destroyed = true
|
||||
end
|
||||
end
|
||||
else
|
||||
if self:IsLoaded() then
|
||||
local CarrierName = self.CargoCarrier:GetName()
|
||||
if CarrierName == EventData.IniDCSUnitName then
|
||||
MESSAGE:New( "Cargo is lost from carrier " .. CarrierName, 15 ):ToAll()
|
||||
Destroyed = true
|
||||
self.CargoCarrier:ClearCargo()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Destroyed then
|
||||
self:I( { "Cargo crate destroyed: " .. self.CargoObject:GetName() } )
|
||||
self:Destroyed()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Enter UnLoaded State.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE
|
||||
function CARGO_CRATE:onenterUnLoaded( From, Event, To, ToPointVec2 )
|
||||
--self:T( { ToPointVec2, From, Event, To } )
|
||||
|
||||
local Angle = 180
|
||||
local Speed = 10
|
||||
local Distance = 10
|
||||
|
||||
if From == "Loaded" then
|
||||
local StartCoordinate = self.CargoCarrier:GetCoordinate()
|
||||
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
|
||||
local CargoDeployCoord = StartCoordinate:Translate( Distance, CargoDeployHeading )
|
||||
|
||||
ToPointVec2 = ToPointVec2 or COORDINATE:NewFromVec2( { x= CargoDeployCoord.x, y = CargoDeployCoord.z } )
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self.CargoObject:ReSpawnAt( ToPointVec2, 0 )
|
||||
self.CargoCarrier = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if self.OnUnLoadedCallBack then
|
||||
self.OnUnLoadedCallBack( self, unpack( self.OnUnLoadedParameters ) )
|
||||
self.OnUnLoadedCallBack = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Loaded State.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
function CARGO_CRATE:onenterLoaded( From, Event, To, CargoCarrier )
|
||||
--self:T( { From, Event, To, CargoCarrier } )
|
||||
|
||||
self.CargoCarrier = CargoCarrier
|
||||
|
||||
-- Only destroy the CargoObject is if there is a CargoObject (packages don't have CargoObjects).
|
||||
if self.CargoObject then
|
||||
self:T("Destroying")
|
||||
self.NoDestroy = true
|
||||
self.CargoObject:Destroy( false ) -- Do not generate a remove unit event, because we want to keep the template for later respawn in the database.
|
||||
--local Coordinate = self.CargoObject:GetCoordinate():GetRandomCoordinateInRadius( 50, 20 )
|
||||
--self.CargoObject:ReSpawnAt( Coordinate, 0 )
|
||||
end
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Boarded.
|
||||
-- @param #CARGO_CRATE self
|
||||
function CARGO_CRATE:CanBoard()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Unboarded.
|
||||
-- @param #CARGO_CRATE self
|
||||
function CARGO_CRATE:CanUnboard()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if the cargo can be sling loaded.
|
||||
-- @param #CARGO_CRATE self
|
||||
function CARGO_CRATE:CanSlingload()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if Cargo Crate is in the radius for the Cargo to be reported.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
-- @return #boolean true if the Cargo Crate is within the report radius.
|
||||
function CARGO_CRATE:IsInReportRadius( Coordinate )
|
||||
--self:T( { Coordinate, LoadRadius = self.LoadRadius } )
|
||||
|
||||
local Distance = 0
|
||||
if self:IsUnLoaded() then
|
||||
Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
|
||||
--self:T( Distance )
|
||||
if Distance <= self.LoadRadius then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo Crate is in the radius for the Cargo to be Boarded or Loaded.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Core.Point#Coordinate Coordinate
|
||||
-- @return #boolean true if the Cargo Crate is within the loading radius.
|
||||
function CARGO_CRATE:IsInLoadRadius( Coordinate )
|
||||
--self:T( { Coordinate, LoadRadius = self.NearRadius } )
|
||||
|
||||
local Distance = 0
|
||||
if self:IsUnLoaded() then
|
||||
Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
|
||||
--self:T( Distance )
|
||||
if Distance <= self.NearRadius then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Get the current Coordinate of the CargoGroup.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @return Core.Point#COORDINATE The current Coordinate of the first Cargo of the CargoGroup.
|
||||
-- @return #nil There is no valid Cargo in the CargoGroup.
|
||||
function CARGO_CRATE:GetCoordinate()
|
||||
--self:T()
|
||||
|
||||
return self.CargoObject:GetCoordinate()
|
||||
end
|
||||
|
||||
--- Check if the CargoGroup is alive.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @return #boolean true if the CargoGroup is alive.
|
||||
-- @return #boolean false if the CargoGroup is dead.
|
||||
function CARGO_CRATE:IsAlive()
|
||||
|
||||
local Alive = true
|
||||
|
||||
-- When the Cargo is Loaded, the Cargo is in the CargoCarrier, so we check if the CargoCarrier is alive.
|
||||
-- When the Cargo is not Loaded, the Cargo is the CargoObject, so we check if the CargoObject is alive.
|
||||
if self:IsLoaded() then
|
||||
Alive = Alive == true and self.CargoCarrier:IsAlive()
|
||||
else
|
||||
Alive = Alive == true and self.CargoObject:IsAlive()
|
||||
end
|
||||
|
||||
return Alive
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Route Cargo to Coordinate and randomize locations.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
function CARGO_CRATE:RouteTo( Coordinate )
|
||||
self:T( {Coordinate = Coordinate } )
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo is near to the Carrier.
|
||||
-- The Cargo is near to the Carrier within NearRadius.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @param Wrapper.Group#GROUP CargoCarrier
|
||||
-- @param #number NearRadius
|
||||
-- @return #boolean The Cargo is near to the Carrier.
|
||||
-- @return #nil The Cargo is not near to the Carrier.
|
||||
function CARGO_CRATE:IsNear( CargoCarrier, NearRadius )
|
||||
self:T( {NearRadius = NearRadius } )
|
||||
|
||||
return self:IsNear( CargoCarrier:GetCoordinate(), NearRadius )
|
||||
end
|
||||
|
||||
--- Respawn the CargoGroup.
|
||||
-- @param #CARGO_CRATE self
|
||||
function CARGO_CRATE:Respawn()
|
||||
|
||||
self:T( { "Respawning crate " .. self:GetName() } )
|
||||
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self.CargoObject:ReSpawn() -- A cargo destroy crates a DEAD event.
|
||||
self:__Reset( -0.1 )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Respawn the CargoGroup.
|
||||
-- @param #CARGO_CRATE self
|
||||
function CARGO_CRATE:onafterReset()
|
||||
|
||||
self:T( { "Reset crate " .. self:GetName() } )
|
||||
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self:SetDeployed( false )
|
||||
self:SetStartState( "UnLoaded" )
|
||||
self.CargoCarrier = nil
|
||||
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
|
||||
_EVENTDISPATCHER:CreateEventNewCargo( self )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--- Get the transportation method of the Cargo.
|
||||
-- @param #CARGO_CRATE self
|
||||
-- @return #string The transportation method of the Cargo.
|
||||
function CARGO_CRATE:GetTransportationMethod()
|
||||
if self:IsLoaded() then
|
||||
return "for unloading"
|
||||
else
|
||||
if self:IsUnLoaded() then
|
||||
return "for loading"
|
||||
else
|
||||
if self:IsDeployed() then
|
||||
return "delivered"
|
||||
end
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,777 +0,0 @@
|
||||
--- **Cargo** - Management of grouped cargo logistics, which are based on a GROUP object.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### [Demo Missions]()
|
||||
--
|
||||
-- ### [YouTube Playlist]()
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Cargo.CargoGroup
|
||||
-- @image Cargo_Groups.JPG
|
||||
|
||||
|
||||
do -- CARGO_GROUP
|
||||
|
||||
--- @type CARGO_GROUP
|
||||
-- @field Core.Set#SET_CARGO CargoSet The collection of derived CARGO objects.
|
||||
-- @field #string GroupName The name of the CargoGroup.
|
||||
-- @field Wrapper.Group#GROUÜ CargoCarrier The carrier group.
|
||||
-- @extends Cargo.Cargo#CARGO_REPORTABLE
|
||||
|
||||
--- Defines a cargo that is represented by a @{Wrapper.Group} object within the simulator.
|
||||
--
|
||||
-- 
|
||||
-- The cargo can be Loaded, UnLoaded, Boarded, UnBoarded to and from Carriers.
|
||||
--
|
||||
-- The above cargo classes are used by the following AI_CARGO_ classes to allow AI groups to transport cargo:
|
||||
--
|
||||
-- * AI Armoured Personnel Carriers to transport cargo and engage in battles, using the @{AI.AI_Cargo_APC} module.
|
||||
-- * AI Helicopters to transport cargo, using the @{AI.AI_Cargo_Helicopter} module.
|
||||
-- * AI Planes to transport cargo, using the @{AI.AI_Cargo_Airplane} module.
|
||||
-- * AI Ships is planned.
|
||||
--
|
||||
-- The above cargo classes are also used by the TASK_CARGO_ classes to allow human players to transport cargo as part of a tasking:
|
||||
--
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_TRANSPORT} to transport cargo by human players.
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_CSAR} to transport downed pilots by human players.
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
-- @field #CARGO_GROUP CARGO_GROUP
|
||||
--
|
||||
CARGO_GROUP = {
|
||||
ClassName = "CARGO_GROUP",
|
||||
}
|
||||
|
||||
--- CARGO_GROUP constructor.
|
||||
-- This make a new CARGO_GROUP from a @{Wrapper.Group} object.
|
||||
-- It will "ungroup" the group object within the sim, and will create a @{Core.Set} of individual Unit objects.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Wrapper.Group#GROUP CargoGroup Group to be transported as cargo.
|
||||
-- @param #string Type Cargo type, e.g. "Infantry". This is the type used in SET_CARGO:New():FilterTypes("Infantry") to define the valid cargo groups of the set.
|
||||
-- @param #string Name A user defined name of the cargo group. This name CAN be the same as the group object but can also have a different name. This name MUST be unique!
|
||||
-- @param #number LoadRadius (optional) Distance in meters until which a cargo is loaded into the carrier. Cargo outside this radius has to be routed by other means to within the radius to be loaded.
|
||||
-- @param #number NearRadius (optional) Once the units are within this radius of the carrier, they are actually loaded, i.e. disappear from the scene.
|
||||
-- @return #CARGO_GROUP Cargo group object.
|
||||
function CARGO_GROUP:New( CargoGroup, Type, Name, LoadRadius, NearRadius )
|
||||
|
||||
-- Inherit CAROG_REPORTABLE
|
||||
local self = BASE:Inherit( self, CARGO_REPORTABLE:New( Type, Name, 0, LoadRadius, NearRadius ) ) -- #CARGO_GROUP
|
||||
self:T( { Type, Name, LoadRadius } )
|
||||
|
||||
self.CargoSet = SET_CARGO:New()
|
||||
self.CargoGroup = CargoGroup
|
||||
self.Grouped = true
|
||||
self.CargoUnitTemplate = {}
|
||||
|
||||
self.NearRadius = NearRadius
|
||||
|
||||
self:SetDeployed( false )
|
||||
|
||||
local WeightGroup = 0
|
||||
local VolumeGroup = 0
|
||||
|
||||
self.CargoGroup:Destroy() -- destroy and generate a unit removal event, so that the database gets cleaned, and the linked sets get properly cleaned.
|
||||
|
||||
local GroupName = CargoGroup:GetName()
|
||||
self.CargoName = Name
|
||||
self.CargoTemplate = UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ) )
|
||||
|
||||
-- Deactivate late activation.
|
||||
self.CargoTemplate.lateActivation=false
|
||||
|
||||
self.GroupTemplate = UTILS.DeepCopy( self.CargoTemplate )
|
||||
self.GroupTemplate.name = self.CargoName .. "#CARGO"
|
||||
self.GroupTemplate.groupId = nil
|
||||
|
||||
self.GroupTemplate.units = {}
|
||||
|
||||
for UnitID, UnitTemplate in pairs( self.CargoTemplate.units ) do
|
||||
UnitTemplate.name = UnitTemplate.name .. "#CARGO"
|
||||
local CargoUnitName = UnitTemplate.name
|
||||
self.CargoUnitTemplate[CargoUnitName] = UnitTemplate
|
||||
|
||||
self.GroupTemplate.units[#self.GroupTemplate.units+1] = self.CargoUnitTemplate[CargoUnitName]
|
||||
self.GroupTemplate.units[#self.GroupTemplate.units].unitId = nil
|
||||
|
||||
-- And we register the spawned unit as part of the CargoSet.
|
||||
local Unit = UNIT:Register( CargoUnitName )
|
||||
|
||||
end
|
||||
|
||||
-- Then we register the new group in the database
|
||||
self.CargoGroup = GROUP:NewTemplate( self.GroupTemplate, self.GroupTemplate.CoalitionID, self.GroupTemplate.CategoryID, self.GroupTemplate.CountryID )
|
||||
|
||||
-- Now we spawn the new group based on the template created.
|
||||
self.CargoObject = _DATABASE:Spawn( self.GroupTemplate )
|
||||
|
||||
for CargoUnitID, CargoUnit in pairs( self.CargoObject:GetUnits() ) do
|
||||
|
||||
|
||||
local CargoUnitName = CargoUnit:GetName()
|
||||
|
||||
local Cargo = CARGO_UNIT:New( CargoUnit, Type, CargoUnitName, LoadRadius, NearRadius )
|
||||
self.CargoSet:Add( CargoUnitName, Cargo )
|
||||
|
||||
WeightGroup = WeightGroup + Cargo:GetWeight()
|
||||
|
||||
end
|
||||
|
||||
self:SetWeight( WeightGroup )
|
||||
|
||||
self:T( { "Weight Cargo", WeightGroup } )
|
||||
|
||||
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
|
||||
_EVENTDISPATCHER:CreateEventNewCargo( self )
|
||||
|
||||
self:HandleEvent( EVENTS.Dead, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.Crash, self.OnEventCargoDead )
|
||||
--self:HandleEvent( EVENTS.RemoveUnit, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self.OnEventCargoDead )
|
||||
|
||||
self:SetEventPriority( 4 )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Respawn the CargoGroup.
|
||||
-- @param #CARGO_GROUP self
|
||||
function CARGO_GROUP:Respawn()
|
||||
|
||||
self:T( { "Respawning" } )
|
||||
|
||||
for CargoID, CargoData in pairs( self.CargoSet:GetSet() ) do
|
||||
local Cargo = CargoData -- Cargo.Cargo#CARGO
|
||||
Cargo:Destroy() -- Destroy the cargo and generate a remove unit event to update the sets.
|
||||
Cargo:SetStartState( "UnLoaded" )
|
||||
end
|
||||
|
||||
-- Now we spawn the new group based on the template created.
|
||||
_DATABASE:Spawn( self.GroupTemplate )
|
||||
|
||||
for CargoUnitID, CargoUnit in pairs( self.CargoObject:GetUnits() ) do
|
||||
|
||||
local CargoUnitName = CargoUnit:GetName()
|
||||
|
||||
local Cargo = CARGO_UNIT:New( CargoUnit, self.Type, CargoUnitName, self.LoadRadius )
|
||||
self.CargoSet:Add( CargoUnitName, Cargo )
|
||||
|
||||
end
|
||||
|
||||
self:SetDeployed( false )
|
||||
self:SetStartState( "UnLoaded" )
|
||||
|
||||
end
|
||||
|
||||
--- Ungroup the cargo group into individual groups with one unit.
|
||||
-- This is required because by default a group will move in formation and this is really an issue for group control.
|
||||
-- Therefore this method is made to be able to ungroup a group.
|
||||
-- This works for ground only groups.
|
||||
-- @param #CARGO_GROUP self
|
||||
function CARGO_GROUP:Ungroup()
|
||||
|
||||
if self.Grouped == true then
|
||||
|
||||
self.Grouped = false
|
||||
|
||||
self.CargoGroup:Destroy()
|
||||
|
||||
for CargoUnitName, CargoUnit in pairs( self.CargoSet:GetSet() ) do
|
||||
local CargoUnit = CargoUnit -- Cargo.CargoUnit#CARGO_UNIT
|
||||
|
||||
if CargoUnit:IsUnLoaded() then
|
||||
local GroupTemplate = UTILS.DeepCopy( self.CargoTemplate )
|
||||
--local GroupName = env.getValueDictByKey( GroupTemplate.name )
|
||||
|
||||
-- We create a new group object with one unit...
|
||||
-- First we prepare the template...
|
||||
GroupTemplate.name = self.CargoName .. "#CARGO#" .. CargoUnitName
|
||||
GroupTemplate.groupId = nil
|
||||
|
||||
if CargoUnit:IsUnLoaded() then
|
||||
GroupTemplate.units = {}
|
||||
GroupTemplate.units[1] = self.CargoUnitTemplate[CargoUnitName]
|
||||
GroupTemplate.units[#GroupTemplate.units].unitId = nil
|
||||
GroupTemplate.units[#GroupTemplate.units].x = CargoUnit:GetX()
|
||||
GroupTemplate.units[#GroupTemplate.units].y = CargoUnit:GetY()
|
||||
GroupTemplate.units[#GroupTemplate.units].heading = CargoUnit:GetHeading()
|
||||
end
|
||||
|
||||
|
||||
-- Then we register the new group in the database
|
||||
local CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
|
||||
|
||||
-- Now we spawn the new group based on the template created.
|
||||
_DATABASE:Spawn( GroupTemplate )
|
||||
end
|
||||
end
|
||||
|
||||
self.CargoObject = nil
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--- Regroup the cargo group into one group with multiple unit.
|
||||
-- This is required because by default a group will move in formation and this is really an issue for group control.
|
||||
-- Therefore this method is made to be able to regroup a group.
|
||||
-- This works for ground only groups.
|
||||
-- @param #CARGO_GROUP self
|
||||
function CARGO_GROUP:Regroup()
|
||||
|
||||
self:T("Regroup")
|
||||
|
||||
if self.Grouped == false then
|
||||
|
||||
self.Grouped = true
|
||||
|
||||
local GroupTemplate = UTILS.DeepCopy( self.CargoTemplate )
|
||||
GroupTemplate.name = self.CargoName .. "#CARGO"
|
||||
GroupTemplate.groupId = nil
|
||||
GroupTemplate.units = {}
|
||||
|
||||
for CargoUnitName, CargoUnit in pairs( self.CargoSet:GetSet() ) do
|
||||
local CargoUnit = CargoUnit -- Cargo.CargoUnit#CARGO_UNIT
|
||||
|
||||
self:T( { CargoUnit:GetName(), UnLoaded = CargoUnit:IsUnLoaded() } )
|
||||
|
||||
if CargoUnit:IsUnLoaded() then
|
||||
|
||||
CargoUnit.CargoObject:Destroy()
|
||||
|
||||
GroupTemplate.units[#GroupTemplate.units+1] = self.CargoUnitTemplate[CargoUnitName]
|
||||
GroupTemplate.units[#GroupTemplate.units].unitId = nil
|
||||
GroupTemplate.units[#GroupTemplate.units].x = CargoUnit:GetX()
|
||||
GroupTemplate.units[#GroupTemplate.units].y = CargoUnit:GetY()
|
||||
GroupTemplate.units[#GroupTemplate.units].heading = CargoUnit:GetHeading()
|
||||
end
|
||||
end
|
||||
|
||||
-- Then we register the new group in the database
|
||||
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID )
|
||||
|
||||
self:T( { "Regroup", GroupTemplate } )
|
||||
|
||||
-- Now we spawn the new group based on the template created.
|
||||
self.CargoObject = _DATABASE:Spawn( GroupTemplate )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- @param #CARGO_GROUP self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function CARGO_GROUP:OnEventCargoDead( EventData )
|
||||
|
||||
self:T(EventData)
|
||||
|
||||
local Destroyed = false
|
||||
|
||||
if self:IsDestroyed() or self:IsUnLoaded() or self:IsBoarding() or self:IsUnboarding() then
|
||||
Destroyed = true
|
||||
for CargoID, CargoData in pairs( self.CargoSet:GetSet() ) do
|
||||
local Cargo = CargoData -- Cargo.Cargo#CARGO
|
||||
if Cargo:IsAlive() then
|
||||
Destroyed = false
|
||||
else
|
||||
Cargo:Destroyed()
|
||||
end
|
||||
end
|
||||
else
|
||||
local CarrierName = self.CargoCarrier:GetName()
|
||||
if CarrierName == EventData.IniDCSUnitName then
|
||||
MESSAGE:New( "Cargo is lost from carrier " .. CarrierName, 15 ):ToAll()
|
||||
Destroyed = true
|
||||
self.CargoCarrier:ClearCargo()
|
||||
end
|
||||
end
|
||||
|
||||
if Destroyed then
|
||||
self:Destroyed()
|
||||
self:T( { "Cargo group destroyed" } )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- After Board Event.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterBoard( From, Event, To, CargoCarrier, NearRadius, ... )
|
||||
self:T( { CargoCarrier.UnitName, From, Event, To, NearRadius = NearRadius } )
|
||||
|
||||
NearRadius = NearRadius or self.NearRadius
|
||||
|
||||
-- For each Cargo object within the CARGO_GROUPED, route each object to the CargoLoadPointVec2
|
||||
self.CargoSet:ForEach(
|
||||
function( Cargo, ... )
|
||||
self:T( { "Board Unit", Cargo:GetName( ), Cargo:IsDestroyed(), Cargo.CargoObject:IsAlive() } )
|
||||
local CargoGroup = Cargo.CargoObject --Wrapper.Group#GROUP
|
||||
CargoGroup:OptionAlarmStateGreen()
|
||||
Cargo:__Board( 1, CargoCarrier, NearRadius, ... )
|
||||
end, ...
|
||||
)
|
||||
|
||||
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
|
||||
|
||||
end
|
||||
|
||||
--- Enter Loaded State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
function CARGO_GROUP:onafterLoad( From, Event, To, CargoCarrier, ... )
|
||||
--self:T( { From, Event, To, CargoCarrier, ...} )
|
||||
|
||||
if From == "UnLoaded" then
|
||||
-- For each Cargo object within the CARGO_GROUP, load each cargo to the CargoCarrier.
|
||||
for CargoID, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||
if not Cargo:IsDestroyed() then
|
||||
Cargo:Load( CargoCarrier )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--self.CargoObject:Destroy()
|
||||
self.CargoCarrier = CargoCarrier
|
||||
self.CargoCarrier:AddCargo( self )
|
||||
|
||||
end
|
||||
|
||||
--- Leave Boarding State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
|
||||
--self:T( { CargoCarrier.UnitName, From, Event, To } )
|
||||
|
||||
local Boarded = true
|
||||
local Cancelled = false
|
||||
local Dead = true
|
||||
|
||||
self.CargoSet:Flush()
|
||||
|
||||
-- For each Cargo object within the CARGO_GROUP, route each object to the CargoLoadPointVec2
|
||||
for CargoID, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||
--self:T( { Cargo:GetName(), Cargo.current } )
|
||||
|
||||
|
||||
if not Cargo:is( "Loaded" )
|
||||
and (not Cargo:is( "Destroyed" )) then -- If one or more units of a group defined as CARGO_GROUP died, the CARGO_GROUP:Board() command does not trigger the CARGO_GRUOP:OnEnterLoaded() function.
|
||||
Boarded = false
|
||||
end
|
||||
|
||||
if Cargo:is( "UnLoaded" ) then
|
||||
Cancelled = true
|
||||
end
|
||||
|
||||
if not Cargo:is( "Destroyed" ) then
|
||||
Dead = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if not Dead then
|
||||
|
||||
if not Cancelled then
|
||||
if not Boarded then
|
||||
self:__Boarding( -5, CargoCarrier, NearRadius, ... )
|
||||
else
|
||||
self:T("Group Cargo is loaded")
|
||||
self:__Load( 1, CargoCarrier, ... )
|
||||
end
|
||||
else
|
||||
self:__CancelBoarding( 1, CargoCarrier, NearRadius, ... )
|
||||
end
|
||||
else
|
||||
self:__Destroyed( 1, CargoCarrier, NearRadius, ... )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Enter UnBoarding State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterUnBoard( From, Event, To, ToPointVec2, NearRadius, ... )
|
||||
self:T( {From, Event, To, ToPointVec2, NearRadius } )
|
||||
|
||||
NearRadius = NearRadius or 25
|
||||
|
||||
local Timer = 1
|
||||
|
||||
if From == "Loaded" then
|
||||
|
||||
if self.CargoObject then
|
||||
self.CargoObject:Destroy()
|
||||
end
|
||||
|
||||
-- For each Cargo object within the CARGO_GROUP, route each object to the CargoLoadPointVec2
|
||||
self.CargoSet:ForEach(
|
||||
--- @param Cargo.Cargo#CARGO Cargo
|
||||
function( Cargo, NearRadius )
|
||||
if not Cargo:IsDestroyed() then
|
||||
local ToVec=nil
|
||||
if ToPointVec2==nil then
|
||||
ToVec=self.CargoCarrier:GetPointVec2():GetRandomPointVec2InRadius(2*NearRadius, NearRadius)
|
||||
else
|
||||
ToVec=ToPointVec2
|
||||
end
|
||||
Cargo:__UnBoard( Timer, ToVec, NearRadius )
|
||||
Timer = Timer + 1
|
||||
end
|
||||
end, { NearRadius }
|
||||
)
|
||||
|
||||
|
||||
self:__UnBoarding( 1, ToPointVec2, NearRadius, ... )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Leave UnBoarding State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius, ... )
|
||||
--self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
|
||||
--local NearRadius = NearRadius or 25
|
||||
|
||||
local Angle = 180
|
||||
local Speed = 10
|
||||
local Distance = 5
|
||||
|
||||
if From == "UnBoarding" then
|
||||
local UnBoarded = true
|
||||
|
||||
-- For each Cargo object within the CARGO_GROUP, route each object to the CargoLoadPointVec2
|
||||
for CargoID, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||
self:T( { Cargo:GetName(), Cargo.current } )
|
||||
if not Cargo:is( "UnLoaded" ) and not Cargo:IsDestroyed() then
|
||||
UnBoarded = false
|
||||
end
|
||||
end
|
||||
|
||||
if UnBoarded then
|
||||
self:__UnLoad( 1, ToPointVec2, ... )
|
||||
else
|
||||
self:__UnBoarding( 1, ToPointVec2, NearRadius, ... )
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Enter UnLoaded State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
function CARGO_GROUP:onafterUnLoad( From, Event, To, ToPointVec2, ... )
|
||||
--self:T( { From, Event, To, ToPointVec2 } )
|
||||
|
||||
if From == "Loaded" then
|
||||
|
||||
-- For each Cargo object within the CARGO_GROUP, route each object to the CargoLoadPointVec2
|
||||
self.CargoSet:ForEach(
|
||||
function( Cargo )
|
||||
--Cargo:UnLoad( ToPointVec2 )
|
||||
local RandomVec2=nil
|
||||
if ToPointVec2 then
|
||||
RandomVec2=ToPointVec2:GetRandomPointVec2InRadius(20, 10)
|
||||
end
|
||||
Cargo:UnBoard( RandomVec2 )
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
self.CargoCarrier:RemoveCargo( self )
|
||||
self.CargoCarrier = nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Get the current Coordinate of the CargoGroup.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return Core.Point#COORDINATE The current Coordinate of the first Cargo of the CargoGroup.
|
||||
-- @return #nil There is no valid Cargo in the CargoGroup.
|
||||
function CARGO_GROUP:GetCoordinate()
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
return Cargo.CargoObject:GetCoordinate()
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the x position of the cargo.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #number
|
||||
function CARGO:GetX()
|
||||
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
return Cargo:GetCoordinate().x
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the y position of the cargo.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #number
|
||||
function CARGO:GetY()
|
||||
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
return Cargo:GetCoordinate().z
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Check if the CargoGroup is alive.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #boolean true if the CargoGroup is alive.
|
||||
-- @return #boolean false if the CargoGroup is dead.
|
||||
function CARGO_GROUP:IsAlive()
|
||||
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
return Cargo ~= nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Get the first alive Cargo Unit of the Cargo Group.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #CARGO_GROUP
|
||||
function CARGO_GROUP:GetFirstAlive()
|
||||
|
||||
local CargoFirstAlive = nil
|
||||
|
||||
for _, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||
if not Cargo:IsDestroyed() then
|
||||
CargoFirstAlive = Cargo
|
||||
break
|
||||
end
|
||||
end
|
||||
return CargoFirstAlive
|
||||
end
|
||||
|
||||
|
||||
--- Get the amount of cargo units in the group.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #CARGO_GROUP
|
||||
function CARGO_GROUP:GetCount()
|
||||
return self.CargoSet:Count()
|
||||
end
|
||||
|
||||
|
||||
--- Get the underlying GROUP object from the CARGO_GROUP.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #CARGO_GROUP
|
||||
function CARGO_GROUP:GetGroup( Cargo )
|
||||
local Cargo = Cargo or self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
return Cargo.CargoObject:GetGroup()
|
||||
end
|
||||
|
||||
|
||||
--- Route Cargo to Coordinate and randomize locations.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
function CARGO_GROUP:RouteTo( Coordinate )
|
||||
--self:T( {Coordinate = Coordinate } )
|
||||
|
||||
-- For each Cargo within the CargoSet, route each object to the Coordinate
|
||||
self.CargoSet:ForEach(
|
||||
function( Cargo )
|
||||
Cargo.CargoObject:RouteGroundTo( Coordinate, 10, "vee", 0 )
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
--- Check if Cargo is near to the Carrier.
|
||||
-- The Cargo is near to the Carrier if the first unit of the Cargo Group is within NearRadius.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Wrapper.Group#GROUP CargoCarrier
|
||||
-- @param #number NearRadius
|
||||
-- @return #boolean The Cargo is near to the Carrier or #nil if the Cargo is not near to the Carrier.
|
||||
function CARGO_GROUP:IsNear( CargoCarrier, NearRadius )
|
||||
self:T( {NearRadius = NearRadius } )
|
||||
|
||||
for _, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||
local Cargo = Cargo -- Cargo.Cargo#CARGO
|
||||
if Cargo:IsAlive() then
|
||||
if Cargo:IsNear( CargoCarrier:GetCoordinate(), NearRadius ) then
|
||||
self:T( "Near" )
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Check if Cargo Group is in the radius for the Cargo to be Boarded.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
-- @return #boolean true if the Cargo Group is within the load radius.
|
||||
function CARGO_GROUP:IsInLoadRadius( Coordinate )
|
||||
--self:T( { Coordinate } )
|
||||
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
local Distance = 0
|
||||
local CargoCoordinate
|
||||
if Cargo:IsLoaded() then
|
||||
CargoCoordinate = Cargo.CargoCarrier:GetCoordinate()
|
||||
else
|
||||
CargoCoordinate = Cargo.CargoObject:GetCoordinate()
|
||||
end
|
||||
|
||||
-- FF check if coordinate could be obtained. This was commented out for some (unknown) reason. But the check seems valid!
|
||||
if CargoCoordinate then
|
||||
Distance = Coordinate:Get2DDistance( CargoCoordinate )
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
self:T( { Distance = Distance, LoadRadius = self.LoadRadius } )
|
||||
if Distance <= self.LoadRadius then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo Group is in the report radius.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Core.Point#Coordinate Coordinate
|
||||
-- @return #boolean true if the Cargo Group is within the report radius.
|
||||
function CARGO_GROUP:IsInReportRadius( Coordinate )
|
||||
--self:T( { Coordinate } )
|
||||
|
||||
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
self:T( { Cargo } )
|
||||
local Distance = 0
|
||||
if Cargo:IsUnLoaded() then
|
||||
Distance = Coordinate:Get2DDistance( Cargo.CargoObject:GetCoordinate() )
|
||||
--self:T( Distance )
|
||||
if Distance <= self.LoadRadius then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Signal a flare at the position of the CargoGroup.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Utilities.Utils#FLARECOLOR FlareColor
|
||||
function CARGO_GROUP:Flare( FlareColor )
|
||||
|
||||
local Cargo = self.CargoSet:GetFirst() -- Cargo.Cargo#CARGO
|
||||
if Cargo then
|
||||
Cargo:Flare( FlareColor )
|
||||
end
|
||||
end
|
||||
|
||||
--- Smoke the CargoGroup.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The color of the smoke.
|
||||
-- @param #number Radius The radius of randomization around the center of the first element of the CargoGroup.
|
||||
function CARGO_GROUP:Smoke( SmokeColor, Radius )
|
||||
|
||||
local Cargo = self.CargoSet:GetFirst() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
Cargo:Smoke( SmokeColor, Radius )
|
||||
end
|
||||
end
|
||||
|
||||
--- Check if the first element of the CargoGroup is the given @{Core.Zone}.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Core.Zone#ZONE_BASE Zone
|
||||
-- @return #boolean **true** if the first element of the CargoGroup is in the Zone
|
||||
-- @return #boolean **false** if there is no element of the CargoGroup in the Zone.
|
||||
function CARGO_GROUP:IsInZone( Zone )
|
||||
--self:T( { Zone } )
|
||||
|
||||
local Cargo = self.CargoSet:GetFirst() -- Cargo.Cargo#CARGO
|
||||
|
||||
if Cargo then
|
||||
return Cargo:IsInZone( Zone )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
--- Get the transportation method of the Cargo.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #string The transportation method of the Cargo.
|
||||
function CARGO_GROUP:GetTransportationMethod()
|
||||
if self:IsLoaded() then
|
||||
return "for unboarding"
|
||||
else
|
||||
if self:IsUnLoaded() then
|
||||
return "for boarding"
|
||||
else
|
||||
if self:IsDeployed() then
|
||||
return "delivered"
|
||||
end
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
|
||||
|
||||
end -- CARGO_GROUP
|
||||
|
||||
@@ -1,277 +0,0 @@
|
||||
--- **Cargo** - Management of single cargo crates, which are based on a STATIC object. The cargo can only be slingloaded.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### [Demo Missions]()
|
||||
--
|
||||
-- ### [YouTube Playlist]()
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Cargo.CargoSlingload
|
||||
-- @image Cargo_Slingload.JPG
|
||||
|
||||
|
||||
do -- CARGO_SLINGLOAD
|
||||
|
||||
--- Models the behaviour of cargo crates, which can only be slingloaded.
|
||||
-- @type CARGO_SLINGLOAD
|
||||
-- @extends Cargo.Cargo#CARGO_REPRESENTABLE
|
||||
|
||||
--- Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
|
||||
--
|
||||
-- The above cargo classes are also used by the TASK_CARGO_ classes to allow human players to transport cargo as part of a tasking:
|
||||
--
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_TRANSPORT} to transport cargo by human players.
|
||||
-- * @{Tasking.Task_Cargo_Transport#TASK_CARGO_CSAR} to transport downed pilots by human players.
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @field #CARGO_SLINGLOAD
|
||||
CARGO_SLINGLOAD = {
|
||||
ClassName = "CARGO_SLINGLOAD"
|
||||
}
|
||||
|
||||
--- CARGO_SLINGLOAD Constructor.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Wrapper.Static#STATIC CargoStatic
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number LoadRadius (optional)
|
||||
-- @param #number NearRadius (optional)
|
||||
-- @return #CARGO_SLINGLOAD
|
||||
function CARGO_SLINGLOAD:New( CargoStatic, Type, Name, LoadRadius, NearRadius )
|
||||
local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoStatic, Type, Name, nil, LoadRadius, NearRadius ) ) -- #CARGO_SLINGLOAD
|
||||
self:T( { Type, Name, NearRadius } )
|
||||
|
||||
self.CargoObject = CargoStatic
|
||||
|
||||
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
|
||||
_EVENTDISPATCHER:CreateEventNewCargo( self )
|
||||
|
||||
self:HandleEvent( EVENTS.Dead, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.Crash, self.OnEventCargoDead )
|
||||
--self:HandleEvent( EVENTS.RemoveUnit, self.OnEventCargoDead )
|
||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self.OnEventCargoDead )
|
||||
|
||||
self:SetEventPriority( 4 )
|
||||
|
||||
self.NearRadius = NearRadius or 25
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function CARGO_SLINGLOAD:OnEventCargoDead( EventData )
|
||||
|
||||
local Destroyed = false
|
||||
|
||||
if self:IsDestroyed() or self:IsUnLoaded() then
|
||||
if self.CargoObject:GetName() == EventData.IniUnitName then
|
||||
if not self.NoDestroy then
|
||||
Destroyed = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Destroyed then
|
||||
self:I( { "Cargo crate destroyed: " .. self.CargoObject:GetName() } )
|
||||
self:Destroyed()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Check if the cargo can be Slingloaded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:CanSlingload()
|
||||
return true
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Boarded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:CanBoard()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Unboarded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:CanUnboard()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Loaded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:CanLoad()
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if the cargo can be Unloaded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:CanUnload()
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo Crate is in the radius for the Cargo to be reported.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
-- @return #boolean true if the Cargo Crate is within the report radius.
|
||||
function CARGO_SLINGLOAD:IsInReportRadius( Coordinate )
|
||||
--self:T( { Coordinate, LoadRadius = self.LoadRadius } )
|
||||
|
||||
local Distance = 0
|
||||
if self:IsUnLoaded() then
|
||||
Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
|
||||
if Distance <= self.LoadRadius then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo Slingload is in the radius for the Cargo to be Boarded or Loaded.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
-- @return #boolean true if the Cargo Slingload is within the loading radius.
|
||||
function CARGO_SLINGLOAD:IsInLoadRadius( Coordinate )
|
||||
--self:T( { Coordinate } )
|
||||
|
||||
local Distance = 0
|
||||
if self:IsUnLoaded() then
|
||||
Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
|
||||
if Distance <= self.NearRadius then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Get the current Coordinate of the CargoGroup.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @return Core.Point#COORDINATE The current Coordinate of the first Cargo of the CargoGroup.
|
||||
-- @return #nil There is no valid Cargo in the CargoGroup.
|
||||
function CARGO_SLINGLOAD:GetCoordinate()
|
||||
--self:T()
|
||||
|
||||
return self.CargoObject:GetCoordinate()
|
||||
end
|
||||
|
||||
--- Check if the CargoGroup is alive.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @return #boolean true if the CargoGroup is alive.
|
||||
-- @return #boolean false if the CargoGroup is dead.
|
||||
function CARGO_SLINGLOAD:IsAlive()
|
||||
|
||||
local Alive = true
|
||||
|
||||
-- When the Cargo is Loaded, the Cargo is in the CargoCarrier, so we check if the CargoCarrier is alive.
|
||||
-- When the Cargo is not Loaded, the Cargo is the CargoObject, so we check if the CargoObject is alive.
|
||||
if self:IsLoaded() then
|
||||
Alive = Alive == true and self.CargoCarrier:IsAlive()
|
||||
else
|
||||
Alive = Alive == true and self.CargoObject:IsAlive()
|
||||
end
|
||||
|
||||
return Alive
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Route Cargo to Coordinate and randomize locations.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
function CARGO_SLINGLOAD:RouteTo( Coordinate )
|
||||
--self:T( {Coordinate = Coordinate } )
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Check if Cargo is near to the Carrier.
|
||||
-- The Cargo is near to the Carrier within NearRadius.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @param Wrapper.Group#GROUP CargoCarrier
|
||||
-- @param #number NearRadius
|
||||
-- @return #boolean The Cargo is near to the Carrier.
|
||||
-- @return #nil The Cargo is not near to the Carrier.
|
||||
function CARGO_SLINGLOAD:IsNear( CargoCarrier, NearRadius )
|
||||
--self:T( {NearRadius = NearRadius } )
|
||||
|
||||
return self:IsNear( CargoCarrier:GetCoordinate(), NearRadius )
|
||||
end
|
||||
|
||||
|
||||
--- Respawn the CargoGroup.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:Respawn()
|
||||
|
||||
--self:T( { "Respawning slingload " .. self:GetName() } )
|
||||
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self.CargoObject:ReSpawn() -- A cargo destroy crates a DEAD event.
|
||||
self:__Reset( -0.1 )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Respawn the CargoGroup.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
function CARGO_SLINGLOAD:onafterReset()
|
||||
|
||||
--self:T( { "Reset slingload " .. self:GetName() } )
|
||||
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self:SetDeployed( false )
|
||||
self:SetStartState( "UnLoaded" )
|
||||
self.CargoCarrier = nil
|
||||
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
|
||||
_EVENTDISPATCHER:CreateEventNewCargo( self )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--- Get the transportation method of the Cargo.
|
||||
-- @param #CARGO_SLINGLOAD self
|
||||
-- @return #string The transportation method of the Cargo.
|
||||
function CARGO_SLINGLOAD:GetTransportationMethod()
|
||||
if self:IsLoaded() then
|
||||
return "for sling loading"
|
||||
else
|
||||
if self:IsUnLoaded() then
|
||||
return "for sling loading"
|
||||
else
|
||||
if self:IsDeployed() then
|
||||
return "delivered"
|
||||
end
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,397 +0,0 @@
|
||||
--- **Cargo** - Management of single cargo logistics, which are based on a UNIT object.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### [Demo Missions]()
|
||||
--
|
||||
-- ### [YouTube Playlist]()
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Cargo.CargoUnit
|
||||
-- @image Cargo_Units.JPG
|
||||
|
||||
do -- CARGO_UNIT
|
||||
|
||||
--- Models CARGO in the form of units, which can be boarded, unboarded, loaded, unloaded.
|
||||
-- @type CARGO_UNIT
|
||||
-- @extends Cargo.Cargo#CARGO_REPRESENTABLE
|
||||
|
||||
--- Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
|
||||
-- Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO_UNIT objects to and from carriers.
|
||||
-- Note that ground forces behave in a group, and thus, act in formation, regardless if one unit is commanded to move.
|
||||
--
|
||||
-- This class is used in CARGO_GROUP, and is not meant to be used by mission designers individually.
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @field #CARGO_UNIT CARGO_UNIT
|
||||
--
|
||||
CARGO_UNIT = {
|
||||
ClassName = "CARGO_UNIT"
|
||||
}
|
||||
|
||||
--- CARGO_UNIT Constructor.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Wrapper.Unit#UNIT CargoUnit
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
-- @param #number LoadRadius (optional)
|
||||
-- @param #number NearRadius (optional)
|
||||
-- @return #CARGO_UNIT
|
||||
function CARGO_UNIT:New( CargoUnit, Type, Name, LoadRadius, NearRadius )
|
||||
|
||||
-- Inherit CARGO_REPRESENTABLE.
|
||||
local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoUnit, Type, Name, LoadRadius, NearRadius ) ) -- #CARGO_UNIT
|
||||
|
||||
-- Debug info.
|
||||
self:T({Type=Type, Name=Name, LoadRadius=LoadRadius, NearRadius=NearRadius})
|
||||
|
||||
-- Set cargo object.
|
||||
self.CargoObject = CargoUnit
|
||||
|
||||
-- Set event prio.
|
||||
self:SetEventPriority( 5 )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Enter UnBoarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 25 m.
|
||||
function CARGO_UNIT:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
|
||||
local Angle = 180
|
||||
local Speed = 60
|
||||
local DeployDistance = 9
|
||||
local RouteDistance = 60
|
||||
|
||||
if From == "Loaded" then
|
||||
|
||||
if not self:IsDestroyed() then
|
||||
|
||||
local CargoCarrier = self.CargoCarrier -- Wrapper.Controllable#CONTROLLABLE
|
||||
|
||||
if CargoCarrier:IsAlive() then
|
||||
|
||||
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
|
||||
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
|
||||
|
||||
|
||||
local CargoRoutePointVec2 = CargoCarrierPointVec2:Translate( RouteDistance, CargoDeployHeading )
|
||||
|
||||
|
||||
-- if there is no ToPointVec2 given, then use the CargoRoutePointVec2
|
||||
local FromDirectionVec3 = CargoCarrierPointVec2:GetDirectionVec3( ToPointVec2 or CargoRoutePointVec2 )
|
||||
local FromAngle = CargoCarrierPointVec2:GetAngleDegrees(FromDirectionVec3)
|
||||
local FromPointVec2 = CargoCarrierPointVec2:Translate( DeployDistance, FromAngle )
|
||||
--local CargoDeployPointVec2 = CargoCarrierPointVec2:GetRandomCoordinateInRadius( 10, 5 )
|
||||
|
||||
ToPointVec2 = ToPointVec2 or CargoCarrierPointVec2:GetRandomCoordinateInRadius( NearRadius, DeployDistance )
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
if CargoCarrier:IsShip() then
|
||||
-- If CargoCarrier is a ship, we don't want to spawn the units in the water next to the boat. Use destination coord instead.
|
||||
self.CargoObject:ReSpawnAt( ToPointVec2, CargoDeployHeading )
|
||||
else
|
||||
self.CargoObject:ReSpawnAt( FromPointVec2, CargoDeployHeading )
|
||||
end
|
||||
self:T( { "CargoUnits:", self.CargoObject:GetGroup():GetName() } )
|
||||
self.CargoCarrier = nil
|
||||
|
||||
local Points = {}
|
||||
|
||||
-- From
|
||||
Points[#Points+1] = FromPointVec2:WaypointGround( Speed, "Vee" )
|
||||
|
||||
-- To
|
||||
Points[#Points+1] = ToPointVec2:WaypointGround( Speed, "Vee" )
|
||||
|
||||
local TaskRoute = self.CargoObject:TaskRoute( Points )
|
||||
self.CargoObject:SetTask( TaskRoute, 1 )
|
||||
|
||||
|
||||
self:__UnBoarding( 1, ToPointVec2, NearRadius )
|
||||
end
|
||||
else
|
||||
-- the Carrier is dead. This cargo is dead too!
|
||||
self:Destroyed()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Leave UnBoarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 100 m.
|
||||
function CARGO_UNIT:onleaveUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
|
||||
local Angle = 180
|
||||
local Speed = 10
|
||||
local Distance = 5
|
||||
|
||||
if From == "UnBoarding" then
|
||||
--if self:IsNear( ToPointVec2, NearRadius ) then
|
||||
return true
|
||||
--else
|
||||
|
||||
--self:__UnBoarding( 1, ToPointVec2, NearRadius )
|
||||
--end
|
||||
--return false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- UnBoard Event.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 100 m.
|
||||
function CARGO_UNIT:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
|
||||
self.CargoInAir = self.CargoObject:InAir()
|
||||
|
||||
self:T( self.CargoInAir )
|
||||
|
||||
-- Only unboard the cargo when the carrier is not in the air.
|
||||
-- (eg. cargo can be on a oil derrick, moving the cargo on the oil derrick will drop the cargo on the sea).
|
||||
if not self.CargoInAir then
|
||||
|
||||
end
|
||||
|
||||
self:__UnLoad( 1, ToPointVec2, NearRadius )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Enter UnLoaded State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#COORDINATE
|
||||
function CARGO_UNIT:onenterUnLoaded( From, Event, To, ToPointVec2 )
|
||||
self:T( { ToPointVec2, From, Event, To } )
|
||||
|
||||
local Angle = 180
|
||||
local Speed = 10
|
||||
local Distance = 5
|
||||
|
||||
if From == "Loaded" then
|
||||
local StartPointVec2 = self.CargoCarrier:GetPointVec2()
|
||||
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
|
||||
local CargoDeployCoord = StartPointVec2:Translate( Distance, CargoDeployHeading )
|
||||
|
||||
ToPointVec2 = ToPointVec2 or COORDINATE:New( CargoDeployCoord.x, CargoDeployCoord.z )
|
||||
|
||||
-- Respawn the group...
|
||||
if self.CargoObject then
|
||||
self.CargoObject:ReSpawnAt( ToPointVec2, 0 )
|
||||
self.CargoCarrier = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if self.OnUnLoadedCallBack then
|
||||
self.OnUnLoadedCallBack( self, unpack( self.OnUnLoadedParameters ) )
|
||||
self.OnUnLoadedCallBack = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Board Event.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Group#GROUP CargoCarrier
|
||||
-- @param #number NearRadius
|
||||
function CARGO_UNIT:onafterBoard( From, Event, To, CargoCarrier, NearRadius, ... )
|
||||
self:T( { From, Event, To, CargoCarrier, NearRadius = NearRadius } )
|
||||
|
||||
self.CargoInAir = self.CargoObject:InAir()
|
||||
|
||||
local Desc = self.CargoObject:GetDesc()
|
||||
local MaxSpeed = Desc.speedMaxOffRoad
|
||||
local TypeName = Desc.typeName
|
||||
|
||||
--self:T({Unit=self.CargoObject:GetName()})
|
||||
|
||||
-- A cargo unit can only be boarded if it is not dead
|
||||
|
||||
-- Only move the group to the carrier when the cargo is not in the air
|
||||
-- (eg. cargo can be on a oil derrick, moving the cargo on the oil derrick will drop the cargo on the sea).
|
||||
if not self.CargoInAir then
|
||||
-- If NearRadius is given, then use the given NearRadius, otherwise calculate the NearRadius
|
||||
-- based upon the Carrier bounding radius, which is calculated from the bounding rectangle on the Y axis.
|
||||
local NearRadius = NearRadius or CargoCarrier:GetBoundingRadius() + 5
|
||||
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
||||
self:Load( CargoCarrier, NearRadius, ... )
|
||||
else
|
||||
if MaxSpeed and MaxSpeed == 0 or TypeName and TypeName == "Stinger comm" then
|
||||
self:Load( CargoCarrier, NearRadius, ... )
|
||||
else
|
||||
|
||||
local Speed = 90
|
||||
local Angle = 180
|
||||
local Distance = 0
|
||||
|
||||
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
|
||||
local CargoCarrierHeading = CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
|
||||
local CargoDeployPointVec2 = CargoCarrierPointVec2:Translate( Distance, CargoDeployHeading )
|
||||
|
||||
-- Set the CargoObject to state Green to ensure it is boarding!
|
||||
self.CargoObject:OptionAlarmStateGreen()
|
||||
|
||||
local Points = {}
|
||||
|
||||
local PointStartVec2 = self.CargoObject:GetPointVec2()
|
||||
|
||||
Points[#Points+1] = PointStartVec2:WaypointGround( Speed )
|
||||
Points[#Points+1] = CargoDeployPointVec2:WaypointGround( Speed )
|
||||
|
||||
local TaskRoute = self.CargoObject:TaskRoute( Points )
|
||||
self.CargoObject:SetTask( TaskRoute, 2 )
|
||||
self:__Boarding( -5, CargoCarrier, NearRadius, ... )
|
||||
self.RunCount = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Boarding Event.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Client#CLIENT CargoCarrier
|
||||
-- @param #number NearRadius Default 25 m.
|
||||
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
|
||||
self:T( { From, Event, To, CargoCarrier:GetName(), NearRadius = NearRadius } )
|
||||
|
||||
self:T( { IsAlive=self.CargoObject:IsAlive() } )
|
||||
|
||||
if CargoCarrier and CargoCarrier:IsAlive() then -- and self.CargoObject and self.CargoObject:IsAlive() then
|
||||
if (CargoCarrier:IsAir() and not CargoCarrier:InAir()) or true then
|
||||
local NearRadius = NearRadius or CargoCarrier:GetBoundingRadius( NearRadius ) + 5
|
||||
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
||||
self:__Load( -1, CargoCarrier, ... )
|
||||
else
|
||||
if self:IsNear( CargoCarrier:GetPointVec2(), 20 ) then
|
||||
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
|
||||
self.RunCount = self.RunCount + 1
|
||||
else
|
||||
self:__Boarding( -2, CargoCarrier, NearRadius, ... )
|
||||
self.RunCount = self.RunCount + 2
|
||||
end
|
||||
if self.RunCount >= 40 then
|
||||
self.RunCount = 0
|
||||
local Speed = 90
|
||||
local Angle = 180
|
||||
local Distance = 0
|
||||
|
||||
--self:T({Unit=self.CargoObject:GetName()})
|
||||
|
||||
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
|
||||
local CargoCarrierHeading = CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
|
||||
local CargoDeployPointVec2 = CargoCarrierPointVec2:Translate( Distance, CargoDeployHeading )
|
||||
|
||||
-- Set the CargoObject to state Green to ensure it is boarding!
|
||||
self.CargoObject:OptionAlarmStateGreen()
|
||||
|
||||
local Points = {}
|
||||
|
||||
local PointStartVec2 = self.CargoObject:GetPointVec2()
|
||||
|
||||
Points[#Points+1] = PointStartVec2:WaypointGround( Speed, "Off road" )
|
||||
Points[#Points+1] = CargoDeployPointVec2:WaypointGround( Speed, "Off road" )
|
||||
|
||||
local TaskRoute = self.CargoObject:TaskRoute( Points )
|
||||
self.CargoObject:SetTask( TaskRoute, 0.2 )
|
||||
end
|
||||
end
|
||||
else
|
||||
self.CargoObject:MessageToGroup( "Cancelling Boarding... Get back on the ground!", 5, CargoCarrier:GetGroup(), self:GetName() )
|
||||
self:CancelBoarding( CargoCarrier, NearRadius, ... )
|
||||
self.CargoObject:SetCommand( self.CargoObject:CommandStopRoute( true ) )
|
||||
end
|
||||
else
|
||||
self:T("Something is wrong")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Loaded State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
function CARGO_UNIT:onenterLoaded( From, Event, To, CargoCarrier )
|
||||
self:T( { From, Event, To, CargoCarrier } )
|
||||
|
||||
self.CargoCarrier = CargoCarrier
|
||||
|
||||
--self:T({Unit=self.CargoObject:GetName()})
|
||||
|
||||
-- Only destroy the CargoObject if there is a CargoObject (packages don't have CargoObjects).
|
||||
if self.CargoObject then
|
||||
self.CargoObject:Destroy( false )
|
||||
--self.CargoObject:ReSpawnAt( COORDINATE:NewFromVec2( {x=0,y=0} ), 0 )
|
||||
end
|
||||
end
|
||||
|
||||
--- Get the transportation method of the Cargo.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @return #string The transportation method of the Cargo.
|
||||
function CARGO_UNIT:GetTransportationMethod()
|
||||
if self:IsLoaded() then
|
||||
return "for unboarding"
|
||||
else
|
||||
if self:IsUnLoaded() then
|
||||
return "for boarding"
|
||||
else
|
||||
if self:IsDeployed() then
|
||||
return "delivered"
|
||||
end
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
end -- CARGO_UNIT
|
||||
@@ -320,10 +320,12 @@ end
|
||||
|
||||
--- Set valid neighbours to be in a certain distance.
|
||||
-- @param #ASTAR self
|
||||
-- @param #number MaxDistance Max distance between nodes in meters. Default is 2000 m.
|
||||
-- @param #number MaxDistance (Optional) Max distance between nodes in meters. Default is 2000 m.
|
||||
-- @return #ASTAR self
|
||||
function ASTAR:SetValidNeighbourDistance(MaxDistance)
|
||||
|
||||
MaxDistance = MaxDistance or 2000
|
||||
|
||||
self:SetValidNeighbourFunction(ASTAR.DistMax, MaxDistance)
|
||||
|
||||
return self
|
||||
@@ -331,10 +333,12 @@ end
|
||||
|
||||
--- Set valid neighbours to be in a certain distance.
|
||||
-- @param #ASTAR self
|
||||
-- @param #number MaxDistance Max distance between nodes in meters. Default is 2000 m.
|
||||
-- @param #number MaxDistance (Optional) Max distance between nodes in meters. Default is 2000 m.
|
||||
-- @return #ASTAR self
|
||||
function ASTAR:SetValidNeighbourRoad(MaxDistance)
|
||||
|
||||
MaxDistance = MaxDistance or 2000
|
||||
|
||||
self:SetValidNeighbourFunction(ASTAR.Road, MaxDistance)
|
||||
|
||||
return self
|
||||
@@ -397,10 +401,10 @@ end
|
||||
-- The coordinate system is oriented along the line between start and end point.
|
||||
-- @param #ASTAR self
|
||||
-- @param #table ValidSurfaceTypes Valid surface types. By default is all surfaces are allowed.
|
||||
-- @param #number BoxHY Box "height" in meters along the y-coordinate. Default 40000 meters (40 km).
|
||||
-- @param #number SpaceX Additional space in meters before start and after end coordinate. Default 10000 meters (10 km).
|
||||
-- @param #number deltaX Increment in the direction of start to end coordinate in meters. Default 2000 meters.
|
||||
-- @param #number deltaY Increment perpendicular to the direction of start to end coordinate in meters. Default is same as deltaX.
|
||||
-- @param #number BoxHY (Optional) Box "height" in meters along the y-coordinate. Default 40000 meters (40 km).
|
||||
-- @param #number SpaceX (Optional) Additional space in meters before start and after end coordinate. Default 10000 meters (10 km).
|
||||
-- @param #number deltaX (Optional) Increment in the direction of start to end coordinate in meters. Default 2000 meters.
|
||||
-- @param #number deltaY (Optional) Increment perpendicular to the direction of start to end coordinate in meters. Default is same as deltaX.
|
||||
-- @param #boolean MarkGrid If true, create F10 map markers at grid nodes.
|
||||
-- @return #ASTAR self
|
||||
function ASTAR:CreateGrid(ValidSurfaceTypes, BoxHY, SpaceX, deltaX, deltaY, MarkGrid)
|
||||
@@ -547,7 +551,7 @@ end
|
||||
--- Function to check if distance between two nodes is less than a threshold distance.
|
||||
-- @param #ASTAR.Node nodeA First node.
|
||||
-- @param #ASTAR.Node nodeB Other node.
|
||||
-- @param #number distmax Max distance in meters. Default is 2000 m.
|
||||
-- @param #number distmax (Optional) Max distance in meters. Default is 2000 m.
|
||||
-- @return #boolean If true, distance between the two nodes is below threshold.
|
||||
function ASTAR.DistMax(nodeA, nodeB, distmax)
|
||||
|
||||
|
||||
@@ -735,6 +735,12 @@ do -- Event Handling
|
||||
-- @function [parent=#BASE] OnEventPlayerEnterAircraft
|
||||
-- @param #BASE self
|
||||
-- @param Core.Event#EVENTDATA EventData The EventData structure.
|
||||
|
||||
--- Occurs when an option is changed for an AI group.
|
||||
-- The event identifies the initiating group, but does not provide the option ID or value.
|
||||
-- @function [parent=#BASE] OnEventGroupChangeOption
|
||||
-- @param #BASE self
|
||||
-- @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.
|
||||
@@ -855,7 +861,7 @@ end
|
||||
-- @param DCS#Time EventTime The time stamp of the event.
|
||||
-- @param DCS#Object Initiator The initiating object of the event.
|
||||
function BASE:CreateEventTakeoff( EventTime, Initiator )
|
||||
self:F( { EventTime, Initiator } )
|
||||
--self:F( { EventTime, Initiator } )
|
||||
|
||||
local Event = {
|
||||
id = world.event.S_EVENT_TAKEOFF,
|
||||
@@ -880,6 +886,22 @@ end
|
||||
|
||||
world.onEvent(Event)
|
||||
end
|
||||
|
||||
--- Creation of a `S_EVENT_GROUP_CHANGE_OPTION` event.
|
||||
-- @param #BASE self
|
||||
-- @param DCS#Time EventTime The time stamp of the event.
|
||||
-- @param DCS#Group Initiator The initiating group of the event.
|
||||
function BASE:CreateEventGroupChangeOption( EventTime, Initiator )
|
||||
self:F( { EventTime, Initiator } )
|
||||
|
||||
local Event = {
|
||||
id = EVENTS.GroupChangeOption,
|
||||
time = EventTime,
|
||||
initiator = Initiator,
|
||||
}
|
||||
|
||||
world.onEvent( Event )
|
||||
end
|
||||
|
||||
--- Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
|
||||
-- @param #BASE self
|
||||
|
||||
@@ -257,7 +257,7 @@ end
|
||||
|
||||
--- Evaluate conditon functions.
|
||||
-- @param #CONDITION self
|
||||
-- @param #boolean AnyTrue If `true`, evaluation return `true` if *any* condition function returns `true`. By default, *all* condition functions must return true.
|
||||
-- @param #boolean AnyTrue (Optional) If `true`, evaluation return `true` if *any* condition function returns `true`. By default, *all* condition functions must return true.
|
||||
-- @return #boolean Result of condition functions.
|
||||
function CONDITION:Evaluate(AnyTrue)
|
||||
|
||||
@@ -401,7 +401,7 @@ end
|
||||
|
||||
--- Condition to check if time is greater than a given threshold time.
|
||||
-- @param #number Time Time in seconds.
|
||||
-- @param #boolean Absolute If `true`, abs. mission time from `timer.getAbsTime()` is checked. Default is relative mission time from `timer.getTime()`.
|
||||
-- @param #boolean Absolute (Optional) If `true`, abs. mission time from `timer.getAbsTime()` is checked. Default is relative mission time from `timer.getTime()`.
|
||||
-- @return #boolean Returns `true` if time is greater than give the time.
|
||||
function CONDITION.IsTimeGreater(Time, Absolute)
|
||||
|
||||
@@ -424,7 +424,7 @@ end
|
||||
|
||||
--- Function that returns `true` (success) with a certain probability. For example, if you specify `Probability=80` there is an 80% chance that `true` is returned.
|
||||
-- Technically, a random number between 0 and 100 is created. If the given success probability is less then this number, `true` is returned.
|
||||
-- @param #number Probability Success probability in percent. Default 50 %.
|
||||
-- @param #number Probability (Optional) Success probability in percent. Default 50 %.
|
||||
-- @return #boolean Returns `true` for success and `false` otherwise.
|
||||
function CONDITION.IsRandomSuccess(Probability)
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
-- * AIRBASES
|
||||
-- * PLAYERSJOINED
|
||||
-- * PLAYERS
|
||||
-- * CARGOS
|
||||
-- * STORAGES (DCS warehouses)
|
||||
-- * DYNAMICCARGO
|
||||
--
|
||||
@@ -81,7 +80,6 @@ DATABASE = {
|
||||
PLAYERSJOINED = {},
|
||||
PLAYERUNITS = {},
|
||||
CLIENTS = {},
|
||||
CARGOS = {},
|
||||
AIRBASES = {},
|
||||
COUNTRY_ID = {},
|
||||
COUNTRY_NAME = {},
|
||||
@@ -141,8 +139,6 @@ function DATABASE:New()
|
||||
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.Hit, self.AccountHits )
|
||||
self:HandleEvent( EVENTS.NewCargo )
|
||||
self:HandleEvent( EVENTS.DeleteCargo )
|
||||
self:HandleEvent( EVENTS.NewZone )
|
||||
self:HandleEvent( EVENTS.DeleteZone )
|
||||
--self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit ) -- This is not working anymore!, handling this through the birth event.
|
||||
@@ -746,102 +742,6 @@ do -- OpsZone
|
||||
|
||||
end -- OpsZone
|
||||
|
||||
do -- cargo
|
||||
|
||||
--- Adds a Cargo based on the Cargo Name in the DATABASE.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string CargoName The name of the airbase
|
||||
function DATABASE:AddCargo( Cargo )
|
||||
|
||||
if not self.CARGOS[Cargo.Name] then
|
||||
self.CARGOS[Cargo.Name] = Cargo
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Deletes a Cargo from the DATABASE based on the Cargo Name.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string CargoName The name of the airbase
|
||||
function DATABASE:DeleteCargo( CargoName )
|
||||
|
||||
self.CARGOS[CargoName] = nil
|
||||
end
|
||||
|
||||
--- Finds an CARGO based on the CargoName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string CargoName
|
||||
-- @return Cargo.Cargo#CARGO The found CARGO.
|
||||
function DATABASE:FindCargo( CargoName )
|
||||
|
||||
local CargoFound = self.CARGOS[CargoName]
|
||||
return CargoFound
|
||||
end
|
||||
|
||||
--- Checks if the Template name has a #CARGO tag.
|
||||
-- If yes, the group is a cargo.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string TemplateName
|
||||
-- @return #boolean
|
||||
function DATABASE:IsCargo( TemplateName )
|
||||
|
||||
TemplateName = env.getValueDictByKey( TemplateName )
|
||||
|
||||
local Cargo = TemplateName:match( "#(CARGO)" )
|
||||
|
||||
return Cargo and Cargo == "CARGO"
|
||||
end
|
||||
|
||||
--- Private method that registers new Static Templates within the DATABASE Object.
|
||||
-- @param #DATABASE self
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:_RegisterCargos()
|
||||
|
||||
local Groups = UTILS.DeepCopy( self.GROUPS ) -- This is a very important statement. CARGO_GROUP:New creates a new _DATABASE.GROUP entry, which will confuse the loop. I searched 4 hours on this to find the bug!
|
||||
|
||||
for CargoGroupName, CargoGroup in pairs( Groups ) do
|
||||
if self:IsCargo( CargoGroupName ) then
|
||||
local CargoInfo = CargoGroupName:match("#CARGO(.*)")
|
||||
local CargoParam = CargoInfo and CargoInfo:match( "%((.*)%)")
|
||||
local CargoName1 = CargoGroupName:match("(.*)#CARGO%(.*%)")
|
||||
local CargoName2 = CargoGroupName:match(".*#CARGO%(.*%)(.*)")
|
||||
local CargoName = CargoName1 .. ( CargoName2 or "" )
|
||||
local Type = CargoParam and CargoParam:match( "T=([%a%d ]+),?")
|
||||
local Name = CargoParam and CargoParam:match( "N=([%a%d]+),?") or CargoName
|
||||
local LoadRadius = CargoParam and tonumber( CargoParam:match( "RR=([%a%d]+),?") )
|
||||
local NearRadius = CargoParam and tonumber( CargoParam:match( "NR=([%a%d]+),?") )
|
||||
|
||||
self:I({"Register CargoGroup:",Type=Type,Name=Name,LoadRadius=LoadRadius,NearRadius=NearRadius})
|
||||
CARGO_GROUP:New( CargoGroup, Type, Name, LoadRadius, NearRadius )
|
||||
end
|
||||
end
|
||||
|
||||
for CargoStaticName, CargoStatic in pairs( self.STATICS ) do
|
||||
if self:IsCargo( CargoStaticName ) then
|
||||
local CargoInfo = CargoStaticName:match("#CARGO(.*)")
|
||||
local CargoParam = CargoInfo and CargoInfo:match( "%((.*)%)")
|
||||
local CargoName = CargoStaticName:match("(.*)#CARGO")
|
||||
local Type = CargoParam and CargoParam:match( "T=([%a%d ]+),?")
|
||||
local Category = CargoParam and CargoParam:match( "C=([%a%d ]+),?")
|
||||
local Name = CargoParam and CargoParam:match( "N=([%a%d]+),?") or CargoName
|
||||
local LoadRadius = CargoParam and tonumber( CargoParam:match( "RR=([%a%d]+),?") )
|
||||
local NearRadius = CargoParam and tonumber( CargoParam:match( "NR=([%a%d]+),?") )
|
||||
|
||||
if Category == "SLING" then
|
||||
self:I({"Register CargoSlingload:",Type=Type,Name=Name,LoadRadius=LoadRadius,NearRadius=NearRadius})
|
||||
CARGO_SLINGLOAD:New( CargoStatic, Type, Name, LoadRadius, NearRadius )
|
||||
else
|
||||
if Category == "CRATE" then
|
||||
self:I({"Register CargoCrate:",Type=Type,Name=Name,LoadRadius=LoadRadius,NearRadius=NearRadius})
|
||||
CARGO_CRATE:New( CargoStatic, Type, Name, LoadRadius, NearRadius )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end -- cargo
|
||||
|
||||
--- Finds a CLIENT based on the ClientName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string ClientName - Note this is the UNIT name of the client!
|
||||
@@ -1278,10 +1178,10 @@ 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.
|
||||
-- @param #string Typename (Optional) Typename of the static. Defaults to "container_cargo".
|
||||
-- @param #number Mass (Optional) Mass of the static. Defaults to 0.
|
||||
-- @param #number Coalition (Optional) Coalition of the static. Defaults to coalition.side.BLUE.
|
||||
-- @param #number Country (Optional) Country of the static. Defaults to country.id.GERMANY.
|
||||
-- @return #table Static template table.
|
||||
function DATABASE:_GetGenericStaticCargoGroupTemplate(Name,Typename,Mass,Coalition,Country)
|
||||
local StaticTemplate = {}
|
||||
@@ -1480,12 +1380,12 @@ function DATABASE:_RegisterDynamicGroup(Groupname)
|
||||
local DCSUnitName = DCSUnit:getName()
|
||||
|
||||
-- Add unit.
|
||||
self:I(string.format("Register Unit: %s", tostring(DCSUnitName)))
|
||||
self:T(string.format("Register Unit: %s", tostring(DCSUnitName)))
|
||||
self:AddUnit( tostring(DCSUnitName), true )
|
||||
|
||||
end
|
||||
else
|
||||
self:E({"Group does not exist: ", DCSGroup})
|
||||
self:T({"Group does not exist: ", DCSGroup})
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -1588,27 +1488,28 @@ end
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:_RegisterAirbase(airbase)
|
||||
|
||||
local IsSyria = UTILS.GetDCSMap() == "Syria" and true or false
|
||||
local countHSyria = 0
|
||||
--local IsSyria = UTILS.GetDCSMap() == "Syria" and true or false
|
||||
--local countHSyria = 0
|
||||
|
||||
if airbase then
|
||||
|
||||
-- Get the airbase name.
|
||||
local DCSAirbaseName = airbase:getName()
|
||||
|
||||
-- DCS 2.9.8.1107 added 143 helipads all named H with the same object ID ..
|
||||
--[[ 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.
|
||||
local airbaseID=airbase:getID()
|
||||
@@ -2050,19 +1951,6 @@ function DATABASE:ForEachClient( IteratorFunction, FinalizeFunction, ... )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the DATABASE and call an iterator function for each CARGO, providing the CARGO object to the function and optional parameters.
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called for each object in the database. The function needs to accept a CLIENT parameter.
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:ForEachCargo( IteratorFunction, FinalizeFunction, ... )
|
||||
self:F2( arg )
|
||||
|
||||
self:ForEach( IteratorFunction, FinalizeFunction, arg, self.CARGOS )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Handles the OnEventNewCargo event.
|
||||
-- @param #DATABASE self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
|
||||
@@ -187,19 +187,17 @@ EVENT = {
|
||||
CreateMarkCoordinateOnEvent = false,
|
||||
}
|
||||
|
||||
world.event.S_EVENT_NEW_CARGO = world.event.S_EVENT_MAX + 1000
|
||||
world.event.S_EVENT_DELETE_CARGO = world.event.S_EVENT_MAX + 1001
|
||||
world.event.S_EVENT_NEW_ZONE = world.event.S_EVENT_MAX + 1002
|
||||
world.event.S_EVENT_DELETE_ZONE = world.event.S_EVENT_MAX + 1003
|
||||
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_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_NEW_ZONE = world.event.S_EVENT_MAX + 1000
|
||||
world.event.S_EVENT_DELETE_ZONE = world.event.S_EVENT_MAX + 1001
|
||||
world.event.S_EVENT_NEW_ZONE_GOAL = world.event.S_EVENT_MAX + 1002
|
||||
world.event.S_EVENT_DELETE_ZONE_GOAL = world.event.S_EVENT_MAX + 1003
|
||||
world.event.S_EVENT_REMOVE_UNIT = world.event.S_EVENT_MAX + 1004
|
||||
world.event.S_EVENT_PLAYER_ENTER_AIRCRAFT = world.event.S_EVENT_MAX + 1005
|
||||
-- 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
|
||||
world.event.S_EVENT_NEW_DYNAMIC_CARGO = world.event.S_EVENT_MAX + 1006
|
||||
world.event.S_EVENT_DYNAMIC_CARGO_LOADED = world.event.S_EVENT_MAX + 1007
|
||||
world.event.S_EVENT_DYNAMIC_CARGO_UNLOADED = world.event.S_EVENT_MAX + 1008
|
||||
world.event.S_EVENT_DYNAMIC_CARGO_REMOVED = world.event.S_EVENT_MAX + 1009
|
||||
|
||||
|
||||
--- The different types of events supported by MOOSE.
|
||||
@@ -234,8 +232,6 @@ EVENTS = {
|
||||
MarkChange = world.event.S_EVENT_MARK_CHANGE,
|
||||
MarkRemoved = world.event.S_EVENT_MARK_REMOVED,
|
||||
-- Moose Events
|
||||
NewCargo = world.event.S_EVENT_NEW_CARGO,
|
||||
DeleteCargo = world.event.S_EVENT_DELETE_CARGO,
|
||||
NewZone = world.event.S_EVENT_NEW_ZONE,
|
||||
DeleteZone = world.event.S_EVENT_DELETE_ZONE,
|
||||
NewZoneGoal = world.event.S_EVENT_NEW_ZONE_GOAL,
|
||||
@@ -282,6 +278,7 @@ EVENTS = {
|
||||
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,
|
||||
GroupChangeOption = world.event.S_EVENT_GROUP_CHANGE_OPTION or -1,
|
||||
-- dynamic cargo
|
||||
NewDynamicCargo = world.event.S_EVENT_NEW_DYNAMIC_CARGO or -1,
|
||||
DynamicCargoLoaded = world.event.S_EVENT_DYNAMIC_CARGO_LOADED or -1,
|
||||
@@ -295,23 +292,25 @@ EVENTS = {
|
||||
--
|
||||
-- * A (Object.Category.)UNIT : A UNIT object type is involved in the Event.
|
||||
-- * A (Object.Category.)STATIC : A STATIC object type is involved in the Event.
|
||||
-- * A GROUP : A DCS Group object is involved in the Event.
|
||||
--
|
||||
-- @type EVENTDATA
|
||||
-- @field #number id The identifier of the event.
|
||||
--
|
||||
-- @field DCS#Unit initiator (UNIT/STATIC/SCENERY) The initiating @{DCS#Unit} or @{DCS#StaticObject}.
|
||||
-- @field DCS#Unit initiator (UNIT/STATIC/SCENERY/GROUP) The initiating @{DCS#Unit} or @{DCS#StaticObject}. For `S_EVENT_GROUP_CHANGE_OPTION`, this is a DCS Group.
|
||||
-- @field DCS#Object.Category IniObjectCategory (UNIT/STATIC/SCENERY) The initiator object category ( Object.Category.UNIT or Object.Category.STATIC ).
|
||||
-- @field DCS#Unit IniDCSUnit (UNIT/STATIC) The initiating @{DCS#Unit} or @{DCS#StaticObject}.
|
||||
-- @field #string IniDCSUnitName (UNIT/STATIC) The initiating Unit name.
|
||||
-- @field Wrapper.Unit#UNIT IniUnit (UNIT/STATIC) The initiating MOOSE wrapper @{Wrapper.Unit#UNIT} of the initiator Unit object.
|
||||
-- @field #string IniUnitName (UNIT/STATIC) The initiating UNIT name (same as IniDCSUnitName).
|
||||
-- @field DCS#Group IniDCSGroup (UNIT) The initiating {DCSGroup#Group}.
|
||||
-- @field #string IniDCSGroupName (UNIT) The initiating Group name.
|
||||
-- @field Wrapper.Group#GROUP IniGroup (UNIT) The initiating MOOSE wrapper @{Wrapper.Group#GROUP} of the initiator Group object.
|
||||
-- @field #string IniGroupName UNIT) The initiating GROUP name (same as IniDCSGroupName).
|
||||
-- @field DCS#Group IniDCSGroup (UNIT/GROUP) The initiating @{DCS#Group}.
|
||||
-- @field #string IniDCSGroupName (UNIT/GROUP) The initiating Group name.
|
||||
-- @field Wrapper.Group#GROUP IniGroup (UNIT/GROUP) The initiating MOOSE wrapper @{Wrapper.Group#GROUP} of the initiator Group object.
|
||||
-- @field #string IniGroupName (UNIT/GROUP) The initiating GROUP name (same as IniDCSGroupName).
|
||||
-- @field DCS#Group.Category IniGroupCategory (GROUP) The category of the initiating group.
|
||||
-- @field #string IniPlayerName (UNIT) The name of the initiating player in case the Unit is a client or player slot.
|
||||
-- @field #string IniPlayerUCID (UNIT) The UCID of the initiating player in case the Unit is a client or player slot and on a multi-player server.
|
||||
-- @field DCS#coalition.side IniCoalition (UNIT) The coalition of the initiator.
|
||||
-- @field DCS#coalition.side IniCoalition (UNIT/GROUP) The coalition of the initiator.
|
||||
-- @field DCS#Unit.Category IniCategory (UNIT) The category of the initiator.
|
||||
-- @field #string IniTypeName (UNIT) The type name of the initiator.
|
||||
--
|
||||
@@ -512,16 +511,6 @@ local _EVENTMETA = {
|
||||
Event = "OnEventMarkRemoved",
|
||||
Text = "S_EVENT_MARK_REMOVED"
|
||||
},
|
||||
[EVENTS.NewCargo] = {
|
||||
Order = 1,
|
||||
Event = "OnEventNewCargo",
|
||||
Text = "S_EVENT_NEW_CARGO"
|
||||
},
|
||||
[EVENTS.DeleteCargo] = {
|
||||
Order = 1,
|
||||
Event = "OnEventDeleteCargo",
|
||||
Text = "S_EVENT_DELETE_CARGO"
|
||||
},
|
||||
[EVENTS.NewZone] = {
|
||||
Order = 1,
|
||||
Event = "OnEventNewZone",
|
||||
@@ -748,6 +737,12 @@ local _EVENTMETA = {
|
||||
Side = "I",
|
||||
Event = "OnEventHumanAircraftRepairFinish",
|
||||
Text = "S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH"
|
||||
},
|
||||
[EVENTS.GroupChangeOption] = {
|
||||
Order = 1,
|
||||
Side = "I",
|
||||
Event = "OnEventGroupChangeOption",
|
||||
Text = "S_EVENT_GROUP_CHANGE_OPTION"
|
||||
},
|
||||
-- dynamic cargo
|
||||
[EVENTS.NewDynamicCargo] = {
|
||||
@@ -1248,7 +1243,16 @@ function EVENT:onEvent( Event )
|
||||
|
||||
if Event.initiator then
|
||||
|
||||
Event.IniObjectCategory = Object.getCategory(Event.initiator)
|
||||
if Event.id == EVENTS.GroupChangeOption then
|
||||
Event.IniDCSGroup = Event.initiator
|
||||
Event.IniDCSGroupName = Group.getName(Event.initiator)
|
||||
Event.IniGroupName = Event.IniDCSGroupName
|
||||
Event.IniGroup = GROUP:FindByName(Event.IniDCSGroupName)
|
||||
Event.IniCoalition = Group.getCoalition(Event.initiator)
|
||||
Event.IniGroupCategory = Group.getCategory(Event.initiator)
|
||||
else
|
||||
Event.IniObjectCategory = Object.getCategory(Event.initiator)
|
||||
end
|
||||
|
||||
if Event.IniObjectCategory == Object.Category.STATIC then
|
||||
---
|
||||
@@ -1336,7 +1340,6 @@ function EVENT:onEvent( Event )
|
||||
Event.IniDynamicCargoName = Event.IniUnitName
|
||||
Event.IniPlayerName = string.match(Event.IniUnitName,"^(.+)|%d%d:%d%d|PKG%d+")
|
||||
else
|
||||
--Event.IniUnit = CARGO:FindByName( Event.IniDCSUnitName )
|
||||
Event.IniUnit = STATIC:FindByName( Event.IniDCSUnitName, false )
|
||||
end
|
||||
Event.IniCoalition = Event.IniDCSUnit:getCoalition()
|
||||
@@ -1468,7 +1471,12 @@ function EVENT:onEvent( Event )
|
||||
-- Weapon.
|
||||
if Event.weapon and type(Event.weapon) == "table" and Event.weapon.isExist and Event.weapon:isExist() then
|
||||
Event.Weapon = Event.weapon
|
||||
Event.WeaponName = Event.weapon:isExist() and Event.weapon:getTypeName() or "Unknown Weapon"
|
||||
if Event.weapon_name == "ZELL Booster" then
|
||||
Event.WeaponName = "ZELL Booster"
|
||||
else
|
||||
Event.WeaponName = Event.weapon:isExist() and Event.weapon.getTypeName and Event.weapon:getTypeName() or "Unknown Weapon"
|
||||
end
|
||||
if Event.weapon_name == "ZELL Booster" then Event.WeaponName = "ZELL Booster" end
|
||||
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()
|
||||
@@ -1508,12 +1516,6 @@ function EVENT:onEvent( Event )
|
||||
Event.MarkGroupID = Event.groupID
|
||||
end
|
||||
|
||||
-- Cargo object.
|
||||
if Event.cargo then
|
||||
Event.Cargo = Event.cargo
|
||||
Event.CargoName = Event.cargo.Name
|
||||
end
|
||||
|
||||
-- Dynamic cargo Object
|
||||
if Event.dynamiccargo then
|
||||
Event.IniDynamicCargo = Event.dynamiccargo
|
||||
@@ -1675,15 +1677,6 @@ function EVENT:onEvent( Event )
|
||||
end
|
||||
end
|
||||
|
||||
-- When cargo was deleted, it may probably be because of an S_EVENT_DEAD.
|
||||
-- However, in the loading logic, an S_EVENT_DEAD is also generated after a Destroy() call.
|
||||
-- And this is a problem because it will remove all entries from the SET_CARGOs.
|
||||
-- To prevent this from happening, the Cargo object has a flag NoDestroy.
|
||||
-- When true, the SET_CARGO won't Remove the Cargo object from the set.
|
||||
-- But we need to switch that flag off after the event handlers have been called.
|
||||
if Event.id == EVENTS.DeleteCargo then
|
||||
Event.Cargo.NoDestroy = nil
|
||||
end
|
||||
else
|
||||
self:T( { EventMeta.Text, Event } )
|
||||
end
|
||||
|
||||
@@ -45,12 +45,6 @@
|
||||
-- By efficiently utilizing the FSM class and derived classes, MOOSE allows mission designers to quickly build processes.
|
||||
-- **Ready made FSM-based implementations classes** exist within the MOOSE framework that **can easily be re-used,
|
||||
-- and tailored** by mission designers through **the implementation of Transition Handlers**.
|
||||
-- Each of these FSM implementation classes start either with:
|
||||
--
|
||||
-- * an acronym **AI\_**, which indicates a FSM implementation directing **AI controlled** @{Wrapper.Group#GROUP} and/or @{Wrapper.Unit#UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class.
|
||||
-- * an acronym **TASK\_**, which indicates a FSM implementation executing a @{Tasking.Task#TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class.
|
||||
-- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{Tasking.Task#TASK}, seated in a @{Wrapper.Client#CLIENT} (slot) or a @{Wrapper.Unit#UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class.
|
||||
--
|
||||
-- Detailed explanations and API specifics are further below clarified and FSM derived class specifics are described in those class documentation sections.
|
||||
--
|
||||
-- ##__Disclaimer:__
|
||||
@@ -61,7 +55,6 @@
|
||||
--
|
||||
-- The following derived classes are available in the MOOSE framework, that implement a specialized form of a FSM:
|
||||
--
|
||||
-- * @{#FSM_TASK}: Models Finite State Machines for @{Tasking.Task}s.
|
||||
-- * @{#FSM_PROCESS}: Models Finite State Machines for @{Tasking.Task} actions, which control @{Wrapper.Client}s.
|
||||
-- * @{#FSM_CONTROLLABLE}: Models Finite State Machines for @{Wrapper.Controllable}s, which are @{Wrapper.Group}s, @{Wrapper.Unit}s, @{Wrapper.Client}s.
|
||||
-- * @{#FSM_SET}: Models Finite State Machines for @{Core.Set}s. Note that these FSMs control multiple objects!!! So State concerns here
|
||||
@@ -118,11 +111,6 @@ do -- FSM
|
||||
-- By efficiently utilizing the FSM class and derived classes, MOOSE allows mission designers to quickly build processes.
|
||||
-- **Ready made FSM-based implementations classes** exist within the MOOSE framework that **can easily be re-used,
|
||||
-- and tailored** by mission designers through **the implementation of Transition Handlers**.
|
||||
-- Each of these FSM implementation classes start either with:
|
||||
--
|
||||
-- * an acronym **AI\_**, which indicates an FSM implementation directing **AI controlled** @{Wrapper.Group#GROUP} and/or @{Wrapper.Unit#UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class.
|
||||
-- * an acronym **TASK\_**, which indicates an FSM implementation executing a @{Tasking.Task#TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class.
|
||||
-- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{Tasking.Task#TASK}, seated in a @{Wrapper.Client#CLIENT} (slot) or a @{Wrapper.Unit#UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@@ -833,6 +821,16 @@ do -- FSM
|
||||
return self._handler( self, EventName, ... )
|
||||
end
|
||||
end
|
||||
|
||||
--- Clear scheduled FSM event.
|
||||
-- @param #FSM self
|
||||
-- @param #string EventName Event name.
|
||||
function FSM:_ClearFSMEvent( EventName )
|
||||
if self._EventSchedules[EventName] then
|
||||
self.CallScheduler:Remove( self._EventSchedules[EventName] )
|
||||
self._EventSchedules[EventName]=nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Go sub.
|
||||
-- @param #FSM self
|
||||
|
||||
@@ -869,10 +869,21 @@ do
|
||||
local MenuTable = {}
|
||||
for MenuText, Menu in pairs( self.Menus or {} ) do
|
||||
local tag = Menu.MenuTag or math.random(1,10000)
|
||||
MenuTable[#MenuTable+1] = {Tag=tag, Enty=Menu}
|
||||
MenuTable[#MenuTable+1] = {Tag=tag, Entry=Menu}
|
||||
end
|
||||
table.sort(MenuTable, function (k1, k2) return k1.tag < k2.tag end )
|
||||
for _, Menu in pairs( MenuTable ) do
|
||||
local function SortTable(k1,k2)
|
||||
if not k1 then
|
||||
if not k2 then return true else return false end
|
||||
elseif not k2 then
|
||||
if not k1 then return true else return false end
|
||||
else
|
||||
return (k1.Tag or 15) <= (k2.Tag or 15)
|
||||
end
|
||||
return false
|
||||
end
|
||||
table.sort(MenuTable, SortTable)
|
||||
--table.sort(MenuTable, function (k1, k2) return (k1.tag or 15) <= (k2.tag or 15) end )
|
||||
for _, Menu in ipairs( MenuTable ) do
|
||||
Menu.Entry:Refresh()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -198,10 +198,41 @@ function MESSAGE:ToClient( Client, Settings )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sends a MESSAGE to a SET_GROUP, SET_UNIT, or SET_CLIENT.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Core.Set#SET_GROUP Set The set to send to.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return self
|
||||
function MESSAGE:ToSet(Set, Settings)
|
||||
for _,_obj in pairs (Set:GetSetObjects() or {}) do
|
||||
if _obj and _obj:IsAlive() then
|
||||
if _obj:IsInstanceOf("SET_GROUP") then
|
||||
self:ToGroup(_obj, Settings)
|
||||
elseif _obj:IsInstanceOf("SET_CLIENT") or _obj:IsInstanceOf("SET_UNIT") then
|
||||
self:ToUnit(_obj, Settings)
|
||||
end
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sends a MESSAGE to a SET_GROUP, SET_UNIT, or SET_CLIENT if a condition is true.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Core.Set#SET_GROUP Set The set to send to.
|
||||
-- @param #boolean Condition The condition which needs to be true.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return self
|
||||
function MESSAGE:ToSetIf(Set, Condition, Settings)
|
||||
if Set and Condition == true then
|
||||
self:ToSet(Set, Settings)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sends a MESSAGE to a Group.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Wrapper.Group#GROUP Group to which the message is displayed.
|
||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return #MESSAGE Message object.
|
||||
function MESSAGE:ToGroup( Group, Settings )
|
||||
self:F( Group.GroupName )
|
||||
@@ -226,7 +257,7 @@ end
|
||||
--- Sends a MESSAGE to a Unit.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Wrapper.Unit#UNIT Unit to which the message is displayed.
|
||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return #MESSAGE Message object.
|
||||
function MESSAGE:ToUnit( Unit, Settings )
|
||||
self:F( Unit.IdentifiableName )
|
||||
@@ -252,7 +283,7 @@ end
|
||||
--- Sends a MESSAGE to a Country.
|
||||
-- @param #MESSAGE self
|
||||
-- @param #number Country to which the message is displayed, e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country)
|
||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return #MESSAGE Message object.
|
||||
function MESSAGE:ToCountry( Country, Settings )
|
||||
self:F(Country )
|
||||
@@ -274,7 +305,7 @@ end
|
||||
-- @param #MESSAGE self
|
||||
-- @param #number Country to which the message is displayed, , e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country)
|
||||
-- @param #boolean Condition Sends the message only if the condition is true.
|
||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @return #MESSAGE Message object.
|
||||
function MESSAGE:ToCountryIf( Country, Condition, Settings )
|
||||
self:F(Country )
|
||||
@@ -379,7 +410,7 @@ end
|
||||
|
||||
--- Sends a MESSAGE to all players.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Core.Settings#Settings Settings (Optional) Settings for message display.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the message is send. Default instantly (`nil`).
|
||||
-- @return #MESSAGE self
|
||||
-- @usage
|
||||
@@ -464,7 +495,9 @@ _MESSAGESRS = {}
|
||||
-- @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 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
|
||||
-- @param #string Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC or MSRS.Backend.HOUND etc
|
||||
-- @param #string Provider (optional) Provider to be used, can be MSRS.Provider.WINDOWS or MSRS.Provider.GOOGLE or MSRS.Provider.PIPER etc
|
||||
-- @param #string Speaker (optional) Speaker to be used. Only for select provider PIPER TTS Voices, requires HOUND backend.
|
||||
-- @usage
|
||||
-- -- Mind the dot here, not using the colon this time around!
|
||||
-- -- Needed once only
|
||||
@@ -472,7 +505,7 @@ _MESSAGESRS = {}
|
||||
-- -- later on in your code
|
||||
-- MESSAGE:New("Test message!",15,"SPAWN"):ToSRS()
|
||||
--
|
||||
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate,Backend)
|
||||
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate,Backend,Provider,Speaker)
|
||||
|
||||
_MESSAGESRS.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
|
||||
@@ -505,6 +538,10 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
|
||||
_MESSAGESRS.MSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
|
||||
if Provider then
|
||||
_MESSAGESRS.MSRS:SetProvider(Provider)
|
||||
end
|
||||
|
||||
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
||||
_MESSAGESRS.MSRS:SetLabel(_MESSAGESRS.label)
|
||||
|
||||
@@ -515,6 +552,7 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
|
||||
_MESSAGESRS.MSRS:SetVolume(_MESSAGESRS.volume)
|
||||
|
||||
if Voice then _MESSAGESRS.MSRS:SetVoice(Voice) end
|
||||
if Speaker then _MESSAGESRS.MSRS:SetSpeakerPiper(Speaker) end
|
||||
|
||||
_MESSAGESRS.voice = Voice or MSRS.voice --or MSRS.Voices.Microsoft.Hedda
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ end
|
||||
|
||||
--- Get the n-th point of the pathline.
|
||||
-- @param #PATHLINE self
|
||||
-- @param #number n The index of the point. Default is the first point.
|
||||
-- @param #number n (optional) The index of the point. Default is the first point.
|
||||
-- @return #PATHLINE.Point Point.
|
||||
function PATHLINE:GetPointFromIndex(n)
|
||||
|
||||
@@ -275,7 +275,7 @@ end
|
||||
--- Get the 3D position of the n-th point.
|
||||
-- @param #PATHLINE self
|
||||
-- @param #number n The n-th point.
|
||||
-- @return DCS#VEC3 Position in 3D.
|
||||
-- @return DCS#Vec3 Position in 3D.
|
||||
function PATHLINE:GetPoint3DFromIndex(n)
|
||||
|
||||
local point=self:GetPointFromIndex(n)
|
||||
@@ -290,7 +290,7 @@ end
|
||||
--- Get the 2D position of the n-th point.
|
||||
-- @param #PATHLINE self
|
||||
-- @param #number n The n-th point.
|
||||
-- @return DCS#VEC2 Position in 3D.
|
||||
-- @return DCS#Vec2 Position in 3D.
|
||||
function PATHLINE:GetPoint2DFromIndex(n)
|
||||
|
||||
local point=self:GetPointFromIndex(n)
|
||||
@@ -360,8 +360,8 @@ end
|
||||
--- Draw line on F10 map.
|
||||
-- @param #PATHLINE self
|
||||
-- @param #number Recipient Recipent of the line: -1=All.
|
||||
-- @param #table Color Color as RGB table plus alpha value. Default {1, 0, 0, 1.0}.
|
||||
-- @param #number LineType Line type: 1=Solid (default).
|
||||
-- @param #table Color (optional) Color as RGB table plus alpha value. Default {1, 0, 0, 1.0}.
|
||||
-- @param #number LineType (optional) Line type: 1=Solid (default).
|
||||
-- @return #PATHLINE self
|
||||
function PATHLINE:DrawLine(Recipient, Color, LineType)
|
||||
|
||||
|
||||
@@ -471,6 +471,121 @@ do -- COORDINATE
|
||||
return x - Precision <= self.x and x + Precision >= self.x and z - Precision <= self.z and z + Precision >= self.z
|
||||
end
|
||||
|
||||
---
|
||||
--Box volume scanning function matching MOOSE COORDINATE:ScanObjects() structure
|
||||
--For use as COORDINATE:ScanObjectsSquare(sideLength, scanunits, scanstatics, scanscenery)
|
||||
--Creates a cubic search volume with the COORDINATE as the lower-left (southwest) corner.
|
||||
--Perfect for grid-based map scanning: increment X and Z by sideLength for next grid cell.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number radius (Optional) Scan radius in meters. Default 100 m.
|
||||
-- @param #boolean scanunits (Optional) If true scan for units. Default true.
|
||||
-- @param #boolean scanstatics (Optional) If true scan for static objects. Default true.
|
||||
-- @param #boolean scanscenery (Optional) If true scan for scenery objects. Default false.
|
||||
-- @return #boolean True if units were found.
|
||||
-- @return #boolean True if statics were found.
|
||||
-- @return #boolean True if scenery objects were found.
|
||||
-- @return #table Table of MOOSE @{Wrapper.Unit#UNIT} objects found.
|
||||
-- @return #table Table of DCS static objects found.
|
||||
-- @return #table Table of DCS scenery objects found.
|
||||
function COORDINATE:ScanObjectsSquare(sideLength, scanunits, scanstatics, scanscenery)
|
||||
self:F(string.format("Scanning cube volume (lower-left corner) with side length %.1f m.", sideLength))
|
||||
|
||||
local CornerVec3 = self:GetVec3()
|
||||
local CenterY = CornerVec3.y
|
||||
|
||||
local MinVec3 = {
|
||||
x = CornerVec3.x,
|
||||
y = CenterY - (sideLength / 2),
|
||||
z = CornerVec3.z
|
||||
}
|
||||
local MaxVec3 = {
|
||||
x = CornerVec3.x + sideLength,
|
||||
y = CenterY + (sideLength / 2),
|
||||
z = CornerVec3.z + sideLength
|
||||
}
|
||||
|
||||
local BoxSearch = {
|
||||
id = world.VolumeType.BOX,
|
||||
params = {
|
||||
min = MinVec3,
|
||||
max = MaxVec3,
|
||||
}
|
||||
}
|
||||
|
||||
-- Defaults
|
||||
if scanunits==nil then
|
||||
scanunits=true
|
||||
end
|
||||
if scanstatics==nil then
|
||||
scanstatics=true
|
||||
end
|
||||
if scanscenery==nil then
|
||||
scanscenery=false
|
||||
end
|
||||
|
||||
-- {Object.Category.UNIT, Object.Category.STATIC, Object.Category.SCENERY}
|
||||
local scanobjects={}
|
||||
if scanunits then
|
||||
table.insert(scanobjects, Object.Category.UNIT)
|
||||
end
|
||||
if scanstatics then
|
||||
table.insert(scanobjects, Object.Category.STATIC)
|
||||
end
|
||||
if scanscenery then
|
||||
table.insert(scanobjects, Object.Category.SCENERY)
|
||||
end
|
||||
|
||||
-- Found stuff.
|
||||
local Units = {}
|
||||
local Statics = {}
|
||||
local Scenery = {}
|
||||
local gotstatics=false
|
||||
local gotunits=false
|
||||
local gotscenery=false
|
||||
|
||||
local function EvaluateZone( ZoneObject )
|
||||
|
||||
if ZoneObject then
|
||||
|
||||
-- Get category of scanned object.
|
||||
local ObjectCategory = ZoneObject:getCategory()
|
||||
|
||||
-- Check for unit or static objects
|
||||
if (ObjectCategory == Object.Category.UNIT and ZoneObject:isExist()) then
|
||||
|
||||
table.insert(Units, ZoneObject)
|
||||
gotunits=true
|
||||
|
||||
elseif (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
|
||||
|
||||
table.insert(Statics, ZoneObject)
|
||||
gotstatics=true
|
||||
|
||||
elseif ObjectCategory == Object.Category.SCENERY then
|
||||
|
||||
table.insert(Scenery, ZoneObject)
|
||||
gotscenery=true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Search the world.
|
||||
world.searchObjects(scanobjects, BoxSearch, EvaluateZone)
|
||||
|
||||
for _,unit in pairs(Units) do
|
||||
if not unit:isExist() then
|
||||
gotunits=false
|
||||
end
|
||||
end
|
||||
|
||||
return gotunits, gotstatics, gotscenery, Units, Statics, Scenery
|
||||
end
|
||||
|
||||
|
||||
--- Scan/find objects (units, statics, scenery) within a certain radius around the coordinate using the world.searchObjects() DCS API function.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number radius (Optional) Scan radius in meters. Default 100 m.
|
||||
@@ -610,7 +725,7 @@ do -- COORDINATE
|
||||
|
||||
--- Find the closest static to the COORDINATE within a certain radius.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number radius Scan radius in meters. Default 100 m.
|
||||
-- @param #number radius (Optional) Scan radius in meters. Default 100 m.
|
||||
-- @return Wrapper.Static#STATIC The closest static or #nil if no unit is inside the given radius.
|
||||
function COORDINATE:FindClosestStatic(radius)
|
||||
|
||||
@@ -633,7 +748,7 @@ do -- COORDINATE
|
||||
|
||||
--- Find the closest unit to the COORDINATE within a certain radius.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number radius Scan radius in meters. Default 100 m.
|
||||
-- @param #number radius (Optional) Scan radius in meters. Default 100 m.
|
||||
-- @return Wrapper.Unit#UNIT The closest unit or #nil if no unit is inside the given radius.
|
||||
function COORDINATE:FindClosestUnit(radius)
|
||||
|
||||
@@ -678,7 +793,7 @@ do -- COORDINATE
|
||||
|
||||
--- Find the closest scenery to the COORDINATE within a certain radius.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number radius Scan radius in meters. Default 100 m.
|
||||
-- @param #number radius (Optional) Scan radius in meters. Default 100 m.
|
||||
-- @return Wrapper.Scenery#SCENERY The closest scenery or #nil if no object is inside the given radius.
|
||||
function COORDINATE:FindClosestScenery(radius)
|
||||
|
||||
@@ -716,8 +831,8 @@ do -- COORDINATE
|
||||
--- Add a Distance in meters from the COORDINATE orthonormal plane, with the given angle, and calculate the new COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param DCS#Distance Distance The Distance to be added in meters.
|
||||
-- @param DCS#Angle Angle The Angle in degrees. Defaults to 0 if not specified (nil).
|
||||
-- @param #boolean Keepalt If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height.
|
||||
-- @param DCS#Angle Angle (Optional) The Angle in degrees. Defaults to 0 if not specified (nil).
|
||||
-- @param #boolean Keepalt (Optional) If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height.
|
||||
-- @param #boolean Overwrite If true, overwrite the original COORDINATE with the translated one. Otherwise, create a new COORDINATE.
|
||||
-- @return #COORDINATE The new calculated COORDINATE.
|
||||
function COORDINATE:Translate( Distance, Angle, Keepalt, Overwrite )
|
||||
@@ -958,7 +1073,7 @@ do -- COORDINATE
|
||||
--- Return an intermediate COORDINATE between this an another coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE ToCoordinate The other coordinate.
|
||||
-- @param #number Fraction The fraction (0,1) where the new coordinate is created. Default 0.5, i.e. in the middle.
|
||||
-- @param #number Fraction (Optional) The fraction (0,1) where the new coordinate is created. Default 0.5, i.e. in the middle.
|
||||
-- @return #COORDINATE Coordinate between this and the other coordinate.
|
||||
function COORDINATE:GetIntermediateCoordinate( ToCoordinate, Fraction )
|
||||
|
||||
@@ -1514,7 +1629,7 @@ do -- COORDINATE
|
||||
-- @param Core.Settings#SETTINGS Settings
|
||||
-- @param #string Language (Optional) Language "en" or "ru"
|
||||
-- @param #boolean MagVar If true, also state angle in magnetic
|
||||
-- @param #number Precision Rounding precision, defaults to 0
|
||||
-- @param #number Precision (Optional) Rounding precision, defaults to 0
|
||||
-- @return #string The BR Text
|
||||
function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar, Precision )
|
||||
|
||||
@@ -1555,7 +1670,7 @@ do -- COORDINATE
|
||||
--- Set altitude.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number altitude New altitude in meters.
|
||||
-- @param #boolean asl Altitude above sea level. Default is above ground level.
|
||||
-- @param #boolean asl (Optional) Altitude above sea level. Default is above ground level.
|
||||
-- @return #COORDINATE The COORDINATE with adjusted altitude.
|
||||
function COORDINATE:SetAltitude(altitude, asl)
|
||||
local alt=altitude
|
||||
@@ -1581,7 +1696,7 @@ do -- COORDINATE
|
||||
-- @param #COORDINATE.WaypointAltType AltType The altitude type.
|
||||
-- @param #COORDINATE.WaypointType Type The route point type.
|
||||
-- @param #COORDINATE.WaypointAction Action The route point action.
|
||||
-- @param DCS#Speed Speed Airspeed in km/h. Default is 500 km/h.
|
||||
-- @param DCS#Speed Speed (Optional) Airspeed in km/h. Default is 500 km/h.
|
||||
-- @param #boolean SpeedLocked true means the speed is locked.
|
||||
-- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points.
|
||||
-- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint.
|
||||
@@ -1741,7 +1856,7 @@ do -- COORDINATE
|
||||
-- @param #COORDINATE self
|
||||
-- @param DCS#Speed Speed Airspeed in km/h.
|
||||
-- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points.
|
||||
-- @param #number timeReFuAr Time in minutes, the aircraft stays at the airbase. Default 10 min.
|
||||
-- @param #number timeReFuAr (Optional) Time in minutes, the aircraft stays at the airbase. Default 10 min.
|
||||
-- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint.
|
||||
-- @param #string description A text description of the waypoint, which will be shown on the F10 map.
|
||||
-- @return #table The route point.
|
||||
@@ -2148,7 +2263,7 @@ do -- COORDINATE
|
||||
|
||||
--- Creates an explosion at the point of a certain intensity.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number ExplosionIntensity Intensity of the explosion in kg TNT. Default 100 kg.
|
||||
-- @param #number ExplosionIntensity (Optional) Intensity of the explosion in kg TNT. Default 100 kg.
|
||||
-- @param #number Delay (Optional) Delay before explosion is triggered in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:Explosion( ExplosionIntensity, Delay )
|
||||
@@ -2163,7 +2278,7 @@ do -- COORDINATE
|
||||
|
||||
--- Creates an illumination bomb at the point.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number Power Power of illumination bomb in Candela. Default 1000 cd.
|
||||
-- @param #number Power (Optional) Power of illumination bomb in Candela. Default 1000 cd.
|
||||
-- @param #number Delay (Optional) Delay before bomb is ignited in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:IlluminationBomb(Power, Delay)
|
||||
@@ -2622,10 +2737,10 @@ do -- COORDINATE
|
||||
-- Creates a line on the F10 map from one point to another.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE Endpoint COORDINATE to where the line is drawn.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2646,13 +2761,13 @@ do -- COORDINATE
|
||||
--- Circle to all.
|
||||
-- Creates a circle on the map with a given radius, color, fill color, and outline.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number Radius Radius in meters. Default 1000 m.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 1000 m.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2686,12 +2801,12 @@ do -- COORDINATE
|
||||
-- Creates a line on the F10 map from one point to another.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE Endpoint COORDINATE in the opposite corner.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2722,12 +2837,12 @@ do -- COORDINATE
|
||||
-- @param #COORDINATE Coord2 Second COORDINATE of the quad shape.
|
||||
-- @param #COORDINATE Coord3 Third COORDINATE of the quad shape.
|
||||
-- @param #COORDINATE Coord4 Fourth COORDINATE of the quad shape.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2759,12 +2874,12 @@ do -- COORDINATE
|
||||
--- Creates a free form shape on the F10 map. The first point is the current COORDINATE. The remaining points need to be specified.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #table Coordinates Table of coordinates of the remaining points of the shape.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2865,12 +2980,12 @@ do -- COORDINATE
|
||||
--- Text to all. Creates a text imposed on the map at the COORDINATE. Text scales with the map.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #string Text Text displayed on the F10 map.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.3.
|
||||
-- @param #number FontSize Font size. Default 14.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.3.
|
||||
-- @param #number FontSize (Optional) Font size. Default 14.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
function COORDINATE:TextToAll(Text, Coalition, Color, Alpha, FillColor, FillAlpha, FontSize, ReadOnly)
|
||||
@@ -2895,12 +3010,12 @@ do -- COORDINATE
|
||||
--- Arrow to all. Creates an arrow from the COORDINATE to the endpoint COORDINATE on the F10 map. There is no control over other dimensions of the arrow.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE Endpoint COORDINATE where the tip of the arrow is pointing at.
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @param #string Text (Optional) Text displayed when mark is added. Default none.
|
||||
-- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again.
|
||||
@@ -2930,7 +3045,7 @@ do -- COORDINATE
|
||||
--- Returns if a Coordinate has Line of Sight (LOS) with the ToCoordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE ToCoordinate
|
||||
-- @param #number Offset Height offset in meters. Default 2 m.
|
||||
-- @param #number Offset (Optional) Height offset in meters. Default 2 m.
|
||||
-- @return #boolean true If the ToCoordinate has LOS with the Coordinate, otherwise false.
|
||||
function COORDINATE:IsLOS( ToCoordinate, Offset )
|
||||
|
||||
@@ -3286,13 +3401,13 @@ do -- COORDINATE
|
||||
-- @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 #boolean MagVar If true, also get angle in MagVar for BR/BRA
|
||||
-- @param #number Precision Rounding precision, currently full km as default (=0)
|
||||
-- @param #number Precision (Optional) Rounding precision, currently full km as default (=0)
|
||||
-- @return #string The BR text.
|
||||
function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar, Precision )
|
||||
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||
local Distance = self:Get2DDistance( FromCoordinate )
|
||||
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision )
|
||||
return "BR " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision )
|
||||
end
|
||||
|
||||
--- Return a Bearing string from a COORDINATE to the (self) COORDINATE.
|
||||
@@ -3300,7 +3415,7 @@ do -- COORDINATE
|
||||
-- @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 #boolean MagVar If true, also get angle in MagVar for BR/BRA
|
||||
-- @param #number Precision Rounding precision, currently full km as default (=0)
|
||||
-- @param #number Precision (Optional) Rounding precision, currently full km as default (=0)
|
||||
-- @return #string The BR text.
|
||||
function COORDINATE:ToStringBearing( FromCoordinate, Settings, MagVar, Precision )
|
||||
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||
@@ -3714,8 +3829,8 @@ do -- COORDINATE
|
||||
-- * Uses default settings in COORDINATE.
|
||||
-- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default.
|
||||
-- @param #COORDINATE self
|
||||
-- @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 Wrapper.Controllable#CONTROLLABLE Controllable (Optional) 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.
|
||||
-- @return #string The coordinate Text in the configured coordinate system.
|
||||
function COORDINATE:ToString( Controllable, Settings )
|
||||
|
||||
@@ -3725,25 +3840,6 @@ do -- COORDINATE
|
||||
|
||||
local ModeA2A = nil
|
||||
|
||||
--[[
|
||||
if Task then
|
||||
if Task:IsInstanceOf( TASK_A2A ) then
|
||||
ModeA2A = true
|
||||
else
|
||||
if Task:IsInstanceOf( TASK_A2G ) then
|
||||
ModeA2A = false
|
||||
else
|
||||
if Task:IsInstanceOf( TASK_CARGO ) then
|
||||
ModeA2A = false
|
||||
end
|
||||
if Task:IsInstanceOf( TASK_CAPTURE_ZONE ) then
|
||||
ModeA2A = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--]]
|
||||
|
||||
if ModeA2A == nil then
|
||||
local IsAir = Controllable and ( Controllable:IsAirPlane() or Controllable:IsHelicopter() ) or false
|
||||
if IsAir then
|
||||
@@ -3769,7 +3865,7 @@ do -- COORDINATE
|
||||
-- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default.
|
||||
-- @param #COORDINATE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @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.
|
||||
-- @return #string The pressure text in the configured measurement system.
|
||||
function COORDINATE:ToStringPressure( Controllable, Settings )
|
||||
|
||||
|
||||
@@ -375,3 +375,13 @@ function SCHEDULEDISPATCHER:NoTrace( Scheduler )
|
||||
Scheduler.ShowTrace = false
|
||||
end
|
||||
|
||||
--- Helper for memory cleanup for self stopping schedulers
|
||||
-- @param #SCHEDULEDISPATCHER self
|
||||
-- @param Core.Scheduler#SCHEDULER Scheduler Scheduler object.
|
||||
-- @param #string CallID (Optional) Scheduler Call ID.
|
||||
function SCHEDULEDISPATCHER:_Reclaim( Scheduler, CallID )
|
||||
self:Stop( Scheduler, CallID ) -- remove DCS timer, nil ScheduleID
|
||||
if self.Schedule[Scheduler] then self.Schedule[Scheduler][CallID] = nil end
|
||||
self.ObjectSchedulers[CallID] = nil
|
||||
self.PersistentSchedulers[CallID] = nil
|
||||
end
|
||||
|
||||
@@ -231,7 +231,7 @@ end
|
||||
-- @param #number Repeat Specifies the time interval in seconds when the scheduler will call the event function.
|
||||
-- @param #number RandomizeFactor Specifies a randomization factor between 0 and 1 to randomize the Repeat.
|
||||
-- @param #number Stop Time interval in seconds after which the scheduler will be stopped.
|
||||
-- @param #number TraceLevel Trace level [0,3]. Default 3.
|
||||
-- @param #number TraceLevel (Optional) Trace level [0,3]. Default 3.
|
||||
-- @param Core.Fsm#FSM Fsm Finite state model.
|
||||
-- @return #string The Schedule ID of the planned schedule.
|
||||
function SCHEDULER:Schedule( MasterObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop, TraceLevel, Fsm )
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -802,7 +802,7 @@ end
|
||||
|
||||
--- [Airplane - F15/16/18/AWACS/B1B/Tanker only] Set the STN Link16 starting number of the Group; each unit of the spawned group will have a consecutive STN set.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number Octal The octal number (digits 1..7, max 5 digits, i.e. 1..77777) to set the STN to. Every STN needs to be unique!
|
||||
-- @param #number Octal The octal number (digits 0..7, max 5 digits, i.e. 1..77777, cannot be zero) to set the STN to. Every STN needs to be unique!
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitSTN(Octal)
|
||||
--self:F( { Octal = Octal } )
|
||||
@@ -820,7 +820,7 @@ end
|
||||
|
||||
--- [Airplane - A10-C II only] Set the SADL TN starting number of the Group; each unit of the spawned group will have a consecutive SADL set.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number Octal The octal number (digits 1..7, max 4 digits, i.e. 1..7777) to set the SADL to. Every SADL needs to be unique!
|
||||
-- @param #number Octal The octal number (digits 0..7, max 4 digits, i.e. 1..7777, cannot be zero) to set the SADL to. Every SADL needs to be unique!
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitSADL(Octal)
|
||||
--self:F( { Octal = Octal } )
|
||||
@@ -1184,6 +1184,7 @@ end
|
||||
|
||||
--- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
|
||||
-- @param #SPAWN self
|
||||
-- @param #table SpawnZoneTable A table with @{Core.Zone} objects. If nil or empty, the method returns self without effect.
|
||||
-- @param #table SpawnZoneTable A table with @{Core.Zone} objects. If this table is given, then each spawn will be executed within the given list of @{Core.Zone}s objects.
|
||||
-- @param #boolean RandomizePositionInZone If nil or true, also the position inside the selected random zone will be randomized. Set to false to use the center of the zone.
|
||||
-- @return #SPAWN self
|
||||
@@ -1201,6 +1202,9 @@ end
|
||||
function SPAWN:InitRandomizeZones( SpawnZoneTable, RandomizePositionInZone )
|
||||
--self:F( { self.SpawnTemplatePrefix, SpawnZoneTable } )
|
||||
|
||||
if not SpawnZoneTable then
|
||||
return self
|
||||
end
|
||||
local temptable = {}
|
||||
for _,_temp in pairs(SpawnZoneTable) do
|
||||
temptable[#temptable+1] = _temp
|
||||
@@ -1241,6 +1245,16 @@ function SPAWN:InitCallSign(ID,Name,Minor,Major)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [RED AIR only!] This method sets a specific callsign for a spawned group.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number ID The number with which to start for the first unit, e.g. 100, further units would then be 101, 102 .. etc.
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitCallSignRed(ID)
|
||||
self.SpawnInitCallSign = true
|
||||
self.SpawnInitCallSignID = ID or 100
|
||||
self.SpawnInitCallSignRED = true
|
||||
end
|
||||
|
||||
--- This method sets a spawn position for the group that is different from the location of the template.
|
||||
-- @param #SPAWN self
|
||||
-- @param Core.Point#COORDINATE Coordinate The position to spawn from
|
||||
@@ -1295,7 +1309,7 @@ end
|
||||
|
||||
--- Respawn group after landing.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number WaitingTime Wait this many seconds before despawning the alive group after landing. Defaults to 3 .
|
||||
-- @param #number WaitingTime (Optional) Wait this many seconds before despawning the alive group after landing. Defaults to 3 .
|
||||
-- @return #SPAWN self
|
||||
-- @usage
|
||||
--
|
||||
@@ -1601,7 +1615,7 @@ end
|
||||
-- This method can be used to "reset" the spawn counter to a specific index number.
|
||||
-- This will actually enable a respawn of groups from the specific index.
|
||||
-- @param #SPAWN self
|
||||
-- @param #string SpawnIndex The index of the group from where the spawning will start again. The default value would be 0, which means a complete reset of the spawnindex.
|
||||
-- @param #string SpawnIndex (Optional) The index of the group from where the spawning will start again. The default value would be 0, which means a complete reset of the spawnindex.
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:SetSpawnIndex( SpawnIndex )
|
||||
self.SpawnIndex = SpawnIndex or 0
|
||||
@@ -2139,6 +2153,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
local parkingspots = {}
|
||||
local parkingindex = {}
|
||||
local spots
|
||||
local useexplicitspots = false
|
||||
|
||||
-- Spawn happens on ground, i.e. at an airbase, a FARP or a ship.
|
||||
if spawnonground and not SpawnTemplate.parked then
|
||||
@@ -2168,15 +2183,41 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
local scanscenery = false
|
||||
local verysafe = false
|
||||
|
||||
-- Use exact parking data when provided, otherwise let helicopters on ships/FARPs
|
||||
-- use the smarter parking search before falling back to the procedural queue path.
|
||||
-- Number of free parking spots at the airbase.
|
||||
if autoparking then
|
||||
if Parkingdata~=nil then
|
||||
-- Parking data explicitly set by user as input parameter.
|
||||
nfree = #Parkingdata
|
||||
spots = Parkingdata
|
||||
useexplicitspots = true
|
||||
elseif autoparking and AirbaseCategory == Airbase.Category.HELIPAD and ishelo then
|
||||
if termtype == nil then
|
||||
-- Helo is spawned. Try exclusive helo spots first.
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( group, AIRBASE.TerminalType.HelicopterOnly, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
if nfree < nunits then
|
||||
-- Not enough helo ports. Let's try also other terminal types.
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( group, AIRBASE.TerminalType.HelicopterUsable, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
end
|
||||
else
|
||||
-- Terminal type explicitly given.
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( group, termtype, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
end
|
||||
|
||||
if nfree >= nunits then
|
||||
useexplicitspots = true
|
||||
else
|
||||
-- These places work procedural and have some kind of build in queue ==> Less effort.
|
||||
nfree = SpawnAirbase:GetFreeParkingSpotsNumber( termtype, true )
|
||||
spots = SpawnAirbase:GetFreeParkingSpotsTable( termtype, true )
|
||||
end
|
||||
elseif autoparking then
|
||||
-- These places work procedural and have some kind of build in queue ==> Less effort.
|
||||
nfree = SpawnAirbase:GetFreeParkingSpotsNumber( termtype, true )
|
||||
spots = SpawnAirbase:GetFreeParkingSpotsTable( termtype, true )
|
||||
elseif Parkingdata~=nil then
|
||||
-- Parking data explicitly set by user as input parameter. (This was commented out for some unknown reason. But I need it this way.)
|
||||
nfree=#Parkingdata
|
||||
spots=Parkingdata
|
||||
else
|
||||
if ishelo then
|
||||
if termtype == nil then
|
||||
@@ -2228,7 +2269,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
local _notenough = false
|
||||
|
||||
-- Need to differentiate some cases again.
|
||||
if autoparking then
|
||||
if autoparking and not useexplicitspots then
|
||||
|
||||
-- On free spot required in these cases.
|
||||
if nfree >= 1 then
|
||||
@@ -2261,6 +2302,10 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
end
|
||||
end
|
||||
|
||||
if useexplicitspots and parkingspots[1] then
|
||||
PointVec3 = parkingspots[1]
|
||||
end
|
||||
|
||||
-- Not enough spots ==> Prepare airstart.
|
||||
if _notenough then
|
||||
|
||||
@@ -2285,9 +2330,16 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
end
|
||||
|
||||
Takeoff = GROUP.Takeoff.Air
|
||||
else
|
||||
spawnonground = false
|
||||
else
|
||||
if not Takeoff == GROUP.Takeoff.Runway then
|
||||
self:E( string.format( "WARNING: Group %s has no parking spots at %s ==> No emergency air start or uncontrolled spawning ==> No spawn!", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||
return nil
|
||||
else
|
||||
Takeoff = GROUP.Takeoff.Runway
|
||||
spawnonground = false
|
||||
self:E( string.format( "WARNING: Group %s set to runway spawning at %s, this only works in Single Player!", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2328,7 +2380,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
if spawnonground then
|
||||
|
||||
-- Ships and FARPS seem to have a build in queue.
|
||||
if autoparking then
|
||||
if autoparking and not useexplicitspots then
|
||||
|
||||
-- Spawn on ship. We take only the position of the ship.
|
||||
SpawnTemplate.units[UnitID].x = PointVec3.x -- TX
|
||||
@@ -2346,7 +2398,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
|
||||
else
|
||||
|
||||
-- Spawn in air as requested initially. Original template orientation is perserved, altitude is already correctly set.
|
||||
-- Spawn in air as requested initially. Original template orientation is preserved, altitude is already correctly set.
|
||||
SpawnTemplate.units[UnitID].x = TX
|
||||
SpawnTemplate.units[UnitID].y = TY
|
||||
SpawnTemplate.units[UnitID].alt = PointVec3.y
|
||||
@@ -2379,7 +2431,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
if Takeoff == GROUP.Takeoff.Air then
|
||||
for UnitID, UnitSpawned in pairs( GroupSpawned:GetUnits() ) do
|
||||
--SCHEDULER:New( nil, BASE.CreateEventTakeoff, { GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject() }, 5 ) --No need to create a new SCHEDULER instance every time!
|
||||
self:ScheduleOnce(5, BASE.CreateEventTakeoff, {GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject()})
|
||||
self:ScheduleOnce(5, BASE.CreateEventTakeoff, GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject())
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2571,21 +2623,51 @@ function SPAWN:ParkAircraft( SpawnAirbase, TerminalType, Parkingdata, SpawnIndex
|
||||
local scanscenery = false
|
||||
local verysafe = false
|
||||
|
||||
-- Number of free parking spots at the airbase.
|
||||
if spawnonship or spawnonfarp or spawnonrunway then
|
||||
-- These places work procedural and have some kind of build in queue ==> Less effort.
|
||||
--self:T2( string.format( "Group %s is spawned on farp/ship/runway %s.", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||
nfree = SpawnAirbase:GetFreeParkingSpotsNumber( termtype, true )
|
||||
spots = SpawnAirbase:GetFreeParkingSpotsTable( termtype, true )
|
||||
--[[
|
||||
elseif Parkingdata~=nil then
|
||||
-- Parking data explicitly set by user as input parameter.
|
||||
nfree=#Parkingdata
|
||||
spots=Parkingdata
|
||||
]]
|
||||
else
|
||||
if ishelo then
|
||||
-- Use exact parking data when provided, otherwise let helicopters on FARPs
|
||||
-- use the smarter parking search before falling back to the procedural queue path.
|
||||
local useexplicitspots = false
|
||||
|
||||
-- Number of free parking spots at the airbase.
|
||||
if Parkingdata~=nil then
|
||||
-- Parking data explicitly set by user as input parameter.
|
||||
nfree = #Parkingdata
|
||||
spots = Parkingdata
|
||||
useexplicitspots = true
|
||||
elseif spawnonfarp and ishelo then
|
||||
if termtype == nil then
|
||||
-- Helo is spawned. Try exclusive helo spots first.
|
||||
--self:T2( string.format( "Helo group %s is at %s using terminal type %d.", self.SpawnTemplatePrefix, SpawnAirbase:GetName(), AIRBASE.TerminalType.HelicopterOnly ) )
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( TemplateGroup, AIRBASE.TerminalType.HelicopterOnly, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
if nfree < nunits then
|
||||
-- Not enough helo ports. Let's try also other terminal types.
|
||||
--self:T2( string.format( "Helo group %s is at %s using terminal type %d.", self.SpawnTemplatePrefix, SpawnAirbase:GetName(), AIRBASE.TerminalType.HelicopterUsable ) )
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( TemplateGroup, AIRBASE.TerminalType.HelicopterUsable, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
end
|
||||
else
|
||||
-- Terminal type explicitly given.
|
||||
--self:T2( string.format( "Helo group %s is at %s using terminal type %d.", self.SpawnTemplatePrefix, SpawnAirbase:GetName(), termtype ) )
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( TemplateGroup, termtype, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, nil )
|
||||
nfree = #spots
|
||||
end
|
||||
|
||||
if nfree >= nunits then
|
||||
useexplicitspots = true
|
||||
else
|
||||
-- These places work procedural and have some kind of build in queue ==> Less effort.
|
||||
--self:T2( string.format( "Group %s is spawned on farp %s using procedural spots.", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||
nfree = SpawnAirbase:GetFreeParkingSpotsNumber( termtype, true )
|
||||
spots = SpawnAirbase:GetFreeParkingSpotsTable( termtype, true )
|
||||
end
|
||||
elseif spawnonship or spawnonfarp or spawnonrunway then
|
||||
-- These places work procedural and have some kind of build in queue ==> Less effort.
|
||||
--self:T2( string.format( "Group %s is spawned on farp/ship/runway %s.", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||
nfree = SpawnAirbase:GetFreeParkingSpotsNumber( termtype, true )
|
||||
spots = SpawnAirbase:GetFreeParkingSpotsTable( termtype, true )
|
||||
else
|
||||
if ishelo then
|
||||
if termtype == nil then
|
||||
-- Helo is spawned. Try exclusive helo spots first.
|
||||
--self:T2( string.format( "Helo group %s is at %s using terminal type %d.", self.SpawnTemplatePrefix, SpawnAirbase:GetName(), AIRBASE.TerminalType.HelicopterOnly ) )
|
||||
spots = SpawnAirbase:FindFreeParkingSpotForAircraft( TemplateGroup, AIRBASE.TerminalType.HelicopterOnly, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits, Parkingdata )
|
||||
@@ -2648,7 +2730,7 @@ function SPAWN:ParkAircraft( SpawnAirbase, TerminalType, Parkingdata, SpawnIndex
|
||||
local _notenough = false
|
||||
|
||||
-- Need to differentiate some cases again.
|
||||
if spawnonship or spawnonfarp or spawnonrunway then
|
||||
if (spawnonship or spawnonfarp or spawnonrunway) and not useexplicitspots then
|
||||
|
||||
-- On free spot required in these cases.
|
||||
if nfree >= 1 then
|
||||
@@ -3549,14 +3631,21 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
||||
end
|
||||
|
||||
if self.SpawnInitCallSign then
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
local Callsign = SpawnTemplate.units[UnitID].callsign
|
||||
if Callsign and type( Callsign ) ~= "number" then
|
||||
SpawnTemplate.units[UnitID].callsign[1] = self.SpawnInitCallSignID
|
||||
SpawnTemplate.units[UnitID].callsign[2] = self.SpawnInitCallSignMinor
|
||||
SpawnTemplate.units[UnitID].callsign[3] = self.SpawnInitCallSignMajor
|
||||
SpawnTemplate.units[UnitID].callsign["name"] = string.format("%s%d%d",self.SpawnInitCallSignName,self.SpawnInitCallSignMinor,self.SpawnInitCallSignMajor)
|
||||
--UTILS.PrintTableToLog(SpawnTemplate.units[UnitID].callsign,1)
|
||||
if self.SpawnInitCallSignRED == true then
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].callsign = self.SpawnInitCallSignID
|
||||
self.SpawnInitCallSignID = self.SpawnInitCallSignID + 1
|
||||
end
|
||||
else
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
local Callsign = SpawnTemplate.units[UnitID].callsign
|
||||
if Callsign and type( Callsign ) ~= "number" then
|
||||
SpawnTemplate.units[UnitID].callsign[1] = self.SpawnInitCallSignID
|
||||
SpawnTemplate.units[UnitID].callsign[2] = self.SpawnInitCallSignMinor
|
||||
SpawnTemplate.units[UnitID].callsign[3] = self.SpawnInitCallSignMajor
|
||||
SpawnTemplate.units[UnitID].callsign["name"] = string.format("%s%d%d",self.SpawnInitCallSignName,self.SpawnInitCallSignMinor,self.SpawnInitCallSignMajor)
|
||||
--UTILS.PrintTableToLog(SpawnTemplate.units[UnitID].callsign,1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3572,7 +3661,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
||||
local CallsignLen = CallsignName:len()
|
||||
SpawnTemplate.units[UnitID].callsign[2] = UnitID
|
||||
SpawnTemplate.units[UnitID].callsign["name"] = CallsignName:sub( 1, CallsignLen ) .. SpawnTemplate.units[UnitID].callsign[2] .. SpawnTemplate.units[UnitID].callsign[3]
|
||||
elseif type( Callsign ) == "number" then
|
||||
elseif type( Callsign ) == "number" and self.SpawnInitCallSignRED ~= true then
|
||||
SpawnTemplate.units[UnitID].callsign = Callsign + SpawnIndex
|
||||
end
|
||||
end
|
||||
|
||||
@@ -162,7 +162,7 @@ end
|
||||
--- Creates the main object to spawn a @{Wrapper.Static} given a template table.
|
||||
-- @param #SPAWNSTATIC self
|
||||
-- @param #table SpawnTemplate Template used for spawning.
|
||||
-- @param DCS#country.id CountryID The ID of the country. Default `country.id.USA`.
|
||||
-- @param DCS#country.id CountryID (Optional) The ID of the country. Default `country.id.USA`.
|
||||
-- @return #SPAWNSTATIC self
|
||||
function SPAWNSTATIC:NewFromTemplate(SpawnTemplate, CountryID)
|
||||
|
||||
@@ -180,7 +180,7 @@ end
|
||||
-- @param #SPAWNSTATIC self
|
||||
-- @param #string StaticType Type of the static.
|
||||
-- @param #string StaticCategory Category of the static, e.g. "Planes".
|
||||
-- @param DCS#country.id CountryID The ID of the country. Default `country.id.USA`.
|
||||
-- @param DCS#country.id CountryID (Optional) The ID of the country. Default `country.id.USA`.
|
||||
-- @return #SPAWNSTATIC self
|
||||
function SPAWNSTATIC:NewFromType(StaticType, StaticCategory, CountryID)
|
||||
|
||||
@@ -201,7 +201,7 @@ 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.
|
||||
-- @param #number CombinedWeight (Optional) 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
|
||||
@@ -300,9 +300,9 @@ end
|
||||
|
||||
--- Initialize parameters for spawning FARPs.
|
||||
-- @param #SPAWNSTATIC self
|
||||
-- @param #number CallsignID Callsign ID. Default 1 (="London").
|
||||
-- @param #number Frequency Frequency in MHz. Default 127.5 MHz.
|
||||
-- @param #number Modulation Modulation 0=AM, 1=FM.
|
||||
-- @param #number CallsignID (Optional) Callsign ID. Default 1 (="London").
|
||||
-- @param #number Frequency (Optional) Frequency in MHz. Default 127.5 MHz.
|
||||
-- @param #number Modulation (Optional) Modulation 0=AM, 1=FM. Defaults to 0
|
||||
-- @param #boolean DynamicSpawns If true, allow Dynamic Spawns
|
||||
-- @param #boolean DynamicHotStarts If true, and DynamicSpawns is true, then allow Dynamic Spawns with hot starts.
|
||||
-- @return #SPAWNSTATIC self
|
||||
|
||||
@@ -388,7 +388,7 @@ do
|
||||
|
||||
--- Set laser start position relative to the lasing unit.
|
||||
-- @param #SPOT self
|
||||
-- @param #table position Start position of the laser relative to the lasing unit. Default is { x = 0, y = 2, z = 0 }
|
||||
-- @param #table position (Optional) Start position of the laser relative to the lasing unit. Default is { x = 0, y = 2, z = 0 }
|
||||
-- @return #SPOT self
|
||||
-- @usage
|
||||
-- -- Set lasing position to be the position of the optics of the Gazelle M:
|
||||
|
||||
@@ -583,7 +583,7 @@ end
|
||||
--- Return an intermediate VECTOR between this and another given vector.
|
||||
-- @param #VECTOR self
|
||||
-- @param #VECTOR Vector The destination vector.
|
||||
-- @param #number Fraction The fraction (0,1) where the new vector is created. Default 0.5, *i.e.* in the middle.
|
||||
-- @param #number Fraction (Optional) The fraction (0,1) where the new vector is created. Default 0.5, *i.e.* in the middle.
|
||||
-- @return #VECTOR Vector between this and the other vector.
|
||||
function VECTOR:GetIntermediateVector(Vector, Fraction)
|
||||
|
||||
@@ -625,7 +625,7 @@ end
|
||||
|
||||
--- Set x-component of vector. The x-axis points to the North.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number x Value of x. Default 0.
|
||||
-- @param #number x (Optional) Value of x. Default 0.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:SetX(x)
|
||||
self.x=x or 0
|
||||
@@ -634,7 +634,7 @@ end
|
||||
|
||||
--- Set y-component of vector. The y-axis points to the upwards and describes the altitude above mean sea level.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number y Value of y. Default land/surface height at this point.
|
||||
-- @param #number y (Optional) Value of y. Default land/surface height at this point.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:SetY(y)
|
||||
|
||||
@@ -647,7 +647,7 @@ end
|
||||
|
||||
--- Set z-component of vector. The z-axis points to the East.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number z Value of z. Default 0.
|
||||
-- @param #number z (Optional) Value of z. Default 0.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:SetZ(z)
|
||||
self.z=z or 0
|
||||
@@ -783,8 +783,8 @@ end
|
||||
|
||||
--- Translate the vector by a given distance and angle.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Distance Distance in meters. Default 1000 meters.
|
||||
-- @param #number Heading Heading angle in degrees. Default 0° = North.
|
||||
-- @param #number Distance (Optional) Distance in meters. Default 1000 meters.
|
||||
-- @param #number Heading (Optional) Heading angle in degrees. Default 0° = North.
|
||||
-- @param #boolean Copy Create a copy of the VECTOR so the original stays unchanged.
|
||||
-- @return #VECTOR The translated vector or a copy of it.
|
||||
function VECTOR:Translate(Distance, Heading, Copy)
|
||||
@@ -807,7 +807,7 @@ end
|
||||
|
||||
--- Rotate the VECTOR clockwise in the 2D (x,z) plane.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Angle Rotation angle in degrees). Default 0.
|
||||
-- @param #number Angle (Optional) Rotation angle in degrees). Default 0.
|
||||
-- @param #boolean Copy Create a copy of the VECTOR so the original stays unchanged.
|
||||
-- @return #VECTOR The translated vector or a copy of it.
|
||||
function VECTOR:Rotate2D(Angle, Copy)
|
||||
@@ -1001,7 +1001,7 @@ end
|
||||
--- Returns an intercept point at which a ray drawn from the this vector in the passed normalized direction for a specified distance.
|
||||
-- @param #VECTOR self
|
||||
-- @param DCS#Vec3 DirectionVector Directional vector.
|
||||
-- @param #number Distance Distance in meters. Default 1000 m.
|
||||
-- @param #number Distance (Optional) Distance in meters. Default 1000 m.
|
||||
-- @return #VECTOR Intercept vector. Can be `nil` if no intercept point is found.
|
||||
function VECTOR:GetInterceptPoint(DirectionVector, Distance)
|
||||
|
||||
@@ -1080,7 +1080,7 @@ end
|
||||
|
||||
--- Creates a smoke at this vector.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Color Color of the smoke: 0=Green, 1=Red, 2=White, 3=Orange, 4=Blue. Default 0.
|
||||
-- @param #number Color (Optional) Color of the smoke: 0=Green, 1=Red, 2=White, 3=Orange, 4=Blue. Default 0.
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. Default nil.
|
||||
-- @return #string Name of the smoke object. Can be used to stop it.
|
||||
function VECTOR:Smoke(Color, Duration)
|
||||
@@ -1115,8 +1115,8 @@ end
|
||||
-- * 8 = huge smoke
|
||||
--
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Preset Preset of smoke. Default `BIGSMOKEPRESET.LargeSmokeAndFire`.
|
||||
-- @param #number Density Density between [0,1]. Default 0.5.
|
||||
-- @param #number Preset (Optional) Preset of smoke. Default `BIGSMOKEPRESET.LargeSmokeAndFire`.
|
||||
-- @param #number Density (Optional) Density between [0,1]. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @return #string Name of the smoke. Can be used to stop it.
|
||||
function VECTOR:SmokeAndFire(Preset, Density, Duration)
|
||||
@@ -1161,7 +1161,7 @@ end
|
||||
|
||||
--- Creates an illumination bomb at the specified point.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Power The power in Candela (cd). Should be between 1 and 1000000. Default 1000 cd.
|
||||
-- @param #number Power (Optional) The power in Candela (cd). Should be between 1 and 1000000. Default 1000 cd.
|
||||
-- @param #number Altitude (Optional) Altitude [m] at which the illumination bomb is created.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:IlluminationBomb(Power, Altitude)
|
||||
@@ -1180,7 +1180,7 @@ end
|
||||
|
||||
--- Creates an explosion at a given point at the specified power.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Power The power in kg TNT. Default 100 kg.
|
||||
-- @param #number Power (Optional) The power in kg TNT. Default 100 kg.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:Explosion(Power)
|
||||
|
||||
@@ -1193,8 +1193,8 @@ end
|
||||
|
||||
--- Creates a signal flare at the given point in the specified color. The flare will be launched in the direction of the azimuth angle.
|
||||
-- @param #VECTOR self
|
||||
-- @param #number Color Color of flare. Default Green.
|
||||
-- @param #number Azimuth Azimuth angle in degrees. Default 0.
|
||||
-- @param #number Color (Optional) Color of flare. Default Green.
|
||||
-- @param #number Azimuth (Optional) Azimuth angle in degrees. Default 0.
|
||||
-- @return #VECTOR self
|
||||
function VECTOR:Flare(Color, Azimuth)
|
||||
|
||||
@@ -1209,10 +1209,10 @@ end
|
||||
--- Creates a arrow from this VECTOR to another vector on the F10 map.
|
||||
-- @param #VECTOR self
|
||||
-- @param #VECTOR Vector The vector defining the endpoint.
|
||||
-- @param #number Coalition Coalition Id: -1=All, 0=Neutral, 1=Red, 2=Blue. Default -1.
|
||||
-- @param #table Color RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.7}.
|
||||
-- @param #table FillColor RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.5}.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot Dash, 5=Long Dash, 6=Two Dash. Default 1.
|
||||
-- @param #number Coalition (Optional) Coalition Id: -1=All, 0=Neutral, 1=Red, 2=Blue. Default -1.
|
||||
-- @param #table Color (Optional) RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.7}.
|
||||
-- @param #table FillColor (Optional) RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.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 1.
|
||||
-- @return #number Marker ID. Can be used to remove the drawing.
|
||||
function VECTOR:ArrowTo(Vector, Coalition, Color, FillColor, LineType)
|
||||
|
||||
@@ -1237,7 +1237,7 @@ end
|
||||
--- Create mark on F10 map.
|
||||
-- @param #VECTOR self
|
||||
-- @param #string MarkText Free format text that shows the marking clarification.
|
||||
-- @param #number Recipient Recipient of the mark: -1=All (default), 0=Neutral, 1=Red, 2=Blue. Can also be a `GROUP` object.
|
||||
-- @param #number Recipient (Optional) Recipient of the mark: -1=All (default), 0=Neutral, 1=Red, 2=Blue. Can also be a `GROUP` object.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @return #number Mark ID.
|
||||
function VECTOR:Mark(MarkText, Recipient, ReadOnly)
|
||||
|
||||
@@ -369,7 +369,7 @@ end
|
||||
|
||||
--- Set draw coalition of zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param #number Coalition Coalition. Default -1.
|
||||
-- @param #number Coalition (Optional) Coalition. Default -1.
|
||||
-- @return #ZONE_BASE self
|
||||
function ZONE_BASE:SetDrawCoalition(Coalition)
|
||||
self.drawCoalition=Coalition or -1
|
||||
@@ -385,8 +385,8 @@ end
|
||||
|
||||
--- Set color of zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`.
|
||||
-- @param #number Alpha Transparency between 0 and 1. Default 0.15.
|
||||
-- @param #table RGBcolor (Optional) RGB color table. Default `{1, 0, 0}`.
|
||||
-- @param #number Alpha (Optional) Transparency between 0 and 1. Default 0.15.
|
||||
-- @return #ZONE_BASE self
|
||||
function ZONE_BASE:SetColor(RGBcolor, Alpha)
|
||||
|
||||
@@ -432,8 +432,8 @@ end
|
||||
|
||||
--- Set fill color of zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`.
|
||||
-- @param #number Alpha Transparacy between 0 and 1. Default 0.15.
|
||||
-- @param #table RGBcolor (Optional) RGB color table. Default `{1, 0, 0}`.
|
||||
-- @param #number Alpha (Optional) Transparacy between 0 and 1. Default 0.15.
|
||||
-- @return #ZONE_BASE self
|
||||
function ZONE_BASE:SetFillColor(RGBcolor, Alpha)
|
||||
|
||||
@@ -586,7 +586,7 @@ end
|
||||
|
||||
--- Set the check time for ZONE:Trigger()
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param #number seconds Check every seconds for objects entering or leaving the zone. Defaults to 5 secs.
|
||||
-- @param #number seconds (Optional) Check every seconds for objects entering or leaving the zone. Defaults to 5 secs.
|
||||
-- @return #ZONE_BASE self
|
||||
function ZONE_BASE:SetCheckTime(seconds)
|
||||
self.Checktime = seconds or 5
|
||||
@@ -862,7 +862,7 @@ ZONE_RADIUS = {
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param DCS#Vec2 Vec2 The location of the zone.
|
||||
-- @param DCS#Distance Radius The radius of the zone.
|
||||
-- @param DCS#Boolean DoNotRegisterZone Determines if the Zone should not be registered in the _Database Table. Default=false
|
||||
-- @param DCS#Boolean DoNotRegisterZone (Optional) Determines if the Zone should not be registered in the _Database Table. Default=false
|
||||
-- @return #ZONE_RADIUS self
|
||||
function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone )
|
||||
|
||||
@@ -946,12 +946,12 @@ end
|
||||
|
||||
--- Draw the zone circle on the F10 map.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value.
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15.
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @return #ZONE_RADIUS self
|
||||
function ZONE_RADIUS:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)
|
||||
@@ -2506,7 +2506,7 @@ end
|
||||
|
||||
--- Get a vertex of the polygon.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #number Index Index of the vertex. Default 1.
|
||||
-- @param #number Index (Optional) Index of the vertex. Default 1.
|
||||
-- @return DCS#Vec2 Vertex of the polygon.
|
||||
function ZONE_POLYGON_BASE:GetVertexVec2(Index)
|
||||
return self._.Polygon[Index or 1]
|
||||
@@ -2514,7 +2514,7 @@ end
|
||||
|
||||
--- Get a vertex of the polygon.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #number Index Index of the vertex. Default 1.
|
||||
-- @param #number Index (Optional) Index of the vertex. Default 1.
|
||||
-- @return DCS#Vec3 Vertex of the polygon.
|
||||
function ZONE_POLYGON_BASE:GetVertexVec3(Index)
|
||||
local vec2=self:GetVertexVec2(Index)
|
||||
@@ -2527,7 +2527,7 @@ end
|
||||
|
||||
--- Get a vertex of the polygon.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #number Index Index of the vertex. Default 1.
|
||||
-- @param #number Index (Optional) Index of the vertex. Default 1.
|
||||
-- @return Core.Point#COORDINATE Vertex of the polygon.
|
||||
function ZONE_POLYGON_BASE:GetVertexCoordinate(Index)
|
||||
local vec2=self:GetVertexVec2(Index)
|
||||
@@ -2657,12 +2657,12 @@ end
|
||||
--- Draw the zone on the F10 map. Infinite number of points supported
|
||||
--- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15. -- doesn't seem to work
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. -- doesn't seem to work
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.s
|
||||
-- @return #ZONE_POLYGON_BASE self
|
||||
function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, IncludeTriangles)
|
||||
@@ -2710,7 +2710,7 @@ end
|
||||
--- Change/Re-fill a Polygon Zone
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @return #ZONE_POLYGON_BASE self
|
||||
function ZONE_POLYGON_BASE:ReFill(Color,Alpha)
|
||||
local color = Color or self:GetFillColorRGB() or {1,0,0}
|
||||
@@ -2740,8 +2740,8 @@ end
|
||||
--- Change/Re-draw the border of a Polygon Zone
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @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 1=Solid.
|
||||
-- @return #ZONE_POLYGON_BASE
|
||||
function ZONE_POLYGON_BASE:ReDrawBorderline(Color, Alpha, LineType)
|
||||
local color = Color or self:GetFillColorRGB() or {1,0,0}
|
||||
@@ -2840,7 +2840,7 @@ end
|
||||
|
||||
--- Remove junk inside the zone. Due to DCS limitations, this works only for rectangular zones. So we get the smallest rectangular zone encompassing all points points of the polygon zone.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #number Height Height of the box in meters. Default 1000.
|
||||
-- @param #number Height (Optional) Height of the box in meters. Default 1000.
|
||||
-- @return #number Number of removed objects.
|
||||
function ZONE_POLYGON_BASE:RemoveJunk(Height)
|
||||
|
||||
@@ -3761,8 +3761,8 @@ do -- ZONE_ELASTIC
|
||||
--- Update the convex hull of the polygon.
|
||||
-- This uses the [Graham scan](https://en.wikipedia.org/wiki/Graham_scan).
|
||||
-- @param #ZONE_ELASTIC self
|
||||
-- @param #number Delay Delay in seconds before the zone is updated. Default 0.
|
||||
-- @param #boolean Draw Draw the zone. Default `nil`.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the zone is updated. Default 0.
|
||||
-- @param #boolean Draw (Optional) Draw the zone. Default `nil`.
|
||||
-- @return #ZONE_ELASTIC self
|
||||
function ZONE_ELASTIC:Update(Delay, Draw)
|
||||
|
||||
@@ -3803,9 +3803,9 @@ do -- ZONE_ELASTIC
|
||||
--- Start the updating scheduler.
|
||||
-- @param #ZONE_ELASTIC self
|
||||
-- @param #number Tstart Time in seconds before the updating starts.
|
||||
-- @param #number dT Time interval in seconds between updates. Default 60 sec.
|
||||
-- @param #number Tstop Time in seconds after which the updating stops. Default `nil`.
|
||||
-- @param #boolean Draw Draw the zone. Default `nil`.
|
||||
-- @param #number dT (Optional) Time interval in seconds between updates. Default 60 sec.
|
||||
-- @param #number Tstop (Optional) Time in seconds after which the updating stops. Default `nil`.
|
||||
-- @param #boolean Draw (Optional) Draw the zone. Default `nil`.
|
||||
-- @return #ZONE_ELASTIC self
|
||||
function ZONE_ELASTIC:StartUpdate(Tstart, dT, Tstop, Draw)
|
||||
|
||||
@@ -3816,7 +3816,7 @@ do -- ZONE_ELASTIC
|
||||
|
||||
--- Stop the updating scheduler.
|
||||
-- @param #ZONE_ELASTIC self
|
||||
-- @param #number Delay Delay in seconds before the scheduler will be stopped. Default 0.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the scheduler will be stopped. Default 0.
|
||||
-- @return #ZONE_ELASTIC self
|
||||
function ZONE_ELASTIC:StopUpdate(Delay)
|
||||
|
||||
@@ -4066,12 +4066,12 @@ end
|
||||
--- Draw the zone on the F10 map.
|
||||
--- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua
|
||||
-- @param #ZONE_OVAL self
|
||||
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work
|
||||
-- @param #number FillAlpha Transparency [0,1]. Default 0.15. -- doesn't seem to work
|
||||
-- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
|
||||
-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red.
|
||||
-- @param #number Alpha (Optional) Transparency [0,1]. Default 1.
|
||||
-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work
|
||||
-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. -- doesn't seem to work
|
||||
-- @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 1=Solid.
|
||||
-- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.
|
||||
-- @return #ZONE_OVAL self
|
||||
function ZONE_OVAL:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType)
|
||||
|
||||
@@ -87,7 +87,8 @@ do -- world
|
||||
-- @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
|
||||
-- @field S_EVENT_GROUP_CHANGE_OPTION = 61
|
||||
-- @field S_EVENT_MAX = 62
|
||||
|
||||
--- The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
|
||||
-- @type world.BirthPlace
|
||||
@@ -131,7 +132,7 @@ do -- world
|
||||
|
||||
--- Returns a table of DCS airbase objects.
|
||||
-- @function [parent=#world] getAirbases
|
||||
-- @param #number coalitionId The coalition side number ID. Default is all airbases are returned.
|
||||
-- @param #number coalitionId (Optional) The coalition side number ID. Default is all airbases are returned.
|
||||
-- @return #table Table of DCS airbase objects.
|
||||
|
||||
|
||||
@@ -1033,7 +1034,7 @@ do -- Spot
|
||||
--- Sets the number that is used to define the laser code for which laser designation can track.
|
||||
-- @function [parent=#Spot] setCode
|
||||
-- @param #Spot self
|
||||
-- @param #number Code The laser code. Default value is 1688.
|
||||
-- @param #number Code (Optional) The laser code. Default value is 1688.
|
||||
|
||||
--- Destroys the spot.
|
||||
-- @function [parent=#Spot] destroy
|
||||
@@ -1672,6 +1673,9 @@ do -- AI
|
||||
-- @field OPTION_RADIO_USAGE_KILL
|
||||
-- @field JETT_TANKS_IF_EMPTY
|
||||
-- @field FORCED_ATTACK
|
||||
-- @field PREFER_VERTICAL
|
||||
-- @field ALLOW_FORMATION_SIDE_SWAP
|
||||
-- @field AI_RUNWAY_LINE_UP
|
||||
|
||||
---
|
||||
-- @type AI.Option.Air.val
|
||||
|
||||
@@ -308,7 +308,7 @@ AICSAR.RadioLength = {
|
||||
-- @param #string Helotemplate Helicopter template name.
|
||||
-- @param Wrapper.Airbase#AIRBASE FARP FARP object or Airbase from where to start.
|
||||
-- @param Core.Zone#ZONE MASHZone Zone where to drop pilots after rescue.
|
||||
-- @param #number Helonumber Max number of alive Ai Helos at the same time. Defaults to three.
|
||||
-- @param #number Helonumber (Optional) Max number of alive Ai Helos at the same time. Defaults to 3.
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:New(Alias,Coalition,Pilottemplate,Helotemplate,FARP,MASHZone,Helonumber)
|
||||
-- Inherit everything from FSM class.
|
||||
@@ -543,10 +543,10 @@ end
|
||||
-- @param #AICSAR self
|
||||
-- @param #boolean OnOff Switch on (true) or off (false).
|
||||
-- @param #string Path Path to your SRS Server External Audio Component, e.g. "C:\\\\Program Files\\\\DCS-SimpleRadio-Standalone\\\\ExternalAudio"
|
||||
-- @param #number Frequency Defaults to 243 (guard)
|
||||
-- @param #number Modulation Radio modulation. Defaults to radio.modulation.AM
|
||||
-- @param #string SoundPath Where to find the audio files. Defaults to nil, i.e. add messages via "Sound to..." in the Mission Editor.
|
||||
-- @param #number Port Port of the SRS, defaults to 5002.
|
||||
-- @param #number Frequency (Optional) Defaults to 243 (guard)
|
||||
-- @param #number Modulation (Optional) Radio modulation. Defaults to radio.modulation.AM
|
||||
-- @param #string SoundPath (Optional) Where to find the audio files. Defaults to nil, i.e. add messages via "Sound to..." in the Mission Editor.
|
||||
-- @param #number Port (Optional) Port of the SRS, defaults to 5002.
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:SetSRSRadio(OnOff,Path,Frequency,Modulation,SoundPath,Port)
|
||||
self:T(self.lid .. "SetSRSRadio")
|
||||
@@ -579,8 +579,10 @@ end
|
||||
-- @param #string Culture (Optional) The culture to be used, defaults to "en-GB"
|
||||
-- @param #string Gender (Optional) The gender to be used, defaults to "male"
|
||||
-- @param #string GoogleCredentials (Optional) Path to google credentials
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:SetSRSTTSRadio(OnOff,Path,Frequency,Modulation,Port,Voice,Culture,Gender,GoogleCredentials)
|
||||
function AICSAR:SetSRSTTSRadio(OnOff,Path,Frequency,Modulation,Port,Voice,Culture,Gender,GoogleCredentials,Provider,Speaker)
|
||||
self:T(self.lid .. "SetSRSTTSRadio")
|
||||
self.SRSTTSRadio = OnOff and true
|
||||
self.SRSRadio = false
|
||||
@@ -594,13 +596,19 @@ function AICSAR:SetSRSTTSRadio(OnOff,Path,Frequency,Modulation,Port,Voice,Cultur
|
||||
self.SRS:SetCoalition(self.coalition)
|
||||
self.SRS:SetLabel("ACSR")
|
||||
self.SRS:SetVoice(Voice)
|
||||
if Speaker then
|
||||
self.SRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRS:SetCulture(Culture)
|
||||
self.SRS:SetGender(Gender)
|
||||
if GoogleCredentials then
|
||||
if GoogleCredentials and not Provider then
|
||||
self.SRS:SetProviderOptionsGoogle(GoogleCredentials,GoogleCredentials)
|
||||
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
self.SRSGoogle = true
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
self.SRSQ = MSRSQUEUE:New(self.alias)
|
||||
end
|
||||
return self
|
||||
@@ -612,13 +620,17 @@ end
|
||||
-- Specific voices override culture and gender!
|
||||
-- @param #string Culture (Optional) The culture to be used, defaults to "en-US"
|
||||
-- @param #string Gender (Optional) The gender to be used, defaults to "male"
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:SetPilotTTSVoice(Voice,Culture,Gender)
|
||||
function AICSAR:SetPilotTTSVoice(Voice,Culture,Gender,Speaker)
|
||||
self:T(self.lid .. "SetPilotTTSVoice")
|
||||
self.SRSPilotVoice = true
|
||||
self.SRSPilot = MSRS:New(self.SRSPath,self.SRSFrequency,self.SRSModulation)
|
||||
self.SRSPilot:SetCoalition(self.coalition)
|
||||
self.SRSPilot:SetVoice(Voice)
|
||||
if Speaker then
|
||||
self.SRSPilot:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRSPilot:SetCulture(Culture or "en-US")
|
||||
self.SRSPilot:SetGender(Gender or "male")
|
||||
self.SRSPilot:SetLabel("PILOT")
|
||||
@@ -636,13 +648,17 @@ end
|
||||
-- Specific voices override culture and gender!
|
||||
-- @param #string Culture (Optional) The culture to be used, defaults to "en-GB"
|
||||
-- @param #string Gender (Optional) The gender to be used, defaults to "female"
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:SetOperatorTTSVoice(Voice,Culture,Gender)
|
||||
function AICSAR:SetOperatorTTSVoice(Voice,Culture,Gender,Speaker)
|
||||
self:T(self.lid .. "SetOperatorTTSVoice")
|
||||
self.SRSOperatorVoice = true
|
||||
self.SRSOperator = MSRS:New(self.SRSPath,self.SRSFrequency,self.SRSModulation)
|
||||
self.SRSOperator:SetCoalition(self.coalition)
|
||||
self.SRSOperator:SetVoice(Voice)
|
||||
if Speaker then
|
||||
self.SRSOperator:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRSOperator:SetCulture(Culture or "en-GB")
|
||||
self.SRSOperator:SetGender(Gender or "female")
|
||||
self.SRSOperator:SetLabel("RESCUE")
|
||||
@@ -657,8 +673,8 @@ end
|
||||
--- [User] Switch sound output on and use normale (DCS) radio
|
||||
-- @param #AICSAR self
|
||||
-- @param #boolean OnOff Switch on (true) or off (false).
|
||||
-- @param #number Frequency Defaults to 243 (guard).
|
||||
-- @param #number Modulation Radio modulation. Defaults to radio.modulation.AM.
|
||||
-- @param #number Frequency(Optional) Defaults to 243 (guard).
|
||||
-- @param #number Modulation (Optional) Radio modulation. Defaults to radio.modulation.AM.
|
||||
-- @param Wrapper.Group#GROUP Group The group to use as sending station.
|
||||
-- @return #AICSAR self
|
||||
function AICSAR:SetDCSRadio(OnOff,Frequency,Modulation,Group)
|
||||
|
||||
@@ -419,14 +419,6 @@
|
||||
-- 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.
|
||||
--
|
||||
-- ## Transporting
|
||||
--
|
||||
-- ARTY groups can be transported to another location as @{Cargo.Cargo} by means of classes such as @{AI.AI_Cargo_APC}, @{AI.AI_Cargo_Dispatcher_APC},
|
||||
-- @{AI.AI_Cargo_Helicopter}, @{AI.AI_Cargo_Dispatcher_Helicopter} or @{AI.AI_Cargo_Airplane}.
|
||||
--
|
||||
-- In order to do this, one needs to define an ARTY object via the @{#ARTY.NewFromCargoGroup}(*cargogroup*, *alias*) function.
|
||||
-- The first argument *cargogroup* has to be a @{Cargo.CargoGroup#CARGO_GROUP} object. The second argument *alias* is a string which can be freely chosen by the user.
|
||||
--
|
||||
-- ## Fine Tuning
|
||||
--
|
||||
-- The mission designer has a few options to tailor the ARTY object according to his needs.
|
||||
@@ -511,24 +503,6 @@
|
||||
-- -- Start ARTY process.
|
||||
-- normandy:Start()
|
||||
--
|
||||
-- ### Transportation as Cargo
|
||||
-- This example demonstates how an ARTY group can be transported to another location as cargo.
|
||||
-- -- Define a group as CARGO_GROUP
|
||||
-- CargoGroupMortars=CARGO_GROUP:New(GROUP:FindByName("Mortars"), "Mortars", "Mortar Platoon Alpha", 100 , 10)
|
||||
--
|
||||
-- -- Define the mortar CARGO GROUP as ARTY object
|
||||
-- mortars=ARTY:NewFromCargoGroup(CargoGroupMortars, "Mortar Platoon Alpha")
|
||||
--
|
||||
-- -- Start ARTY process
|
||||
-- mortars:Start()
|
||||
--
|
||||
-- -- Setup AI cargo dispatcher for e.g. helos
|
||||
-- SetHeloCarriers = SET_GROUP:New():FilterPrefixes("CH-47D"):FilterStart()
|
||||
-- SetCargoMortars = SET_CARGO:New():FilterTypes("Mortars"):FilterStart()
|
||||
-- SetZoneDepoly = SET_ZONE:New():FilterPrefixes("Deploy"):FilterStart()
|
||||
-- CargoHelo=AI_CARGO_DISPATCHER_HELICOPTER:New(SetHeloCarriers, SetCargoMortars, SetZoneDepoly)
|
||||
-- CargoHelo:Start()
|
||||
-- The ARTY group will be transported and resume its normal operation after it has been deployed. New targets can be assigned at any time also during the transportation process.
|
||||
--
|
||||
-- @field #ARTY
|
||||
ARTY={
|
||||
@@ -1230,37 +1204,6 @@ function ARTY:New(group, alias)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Creates a new ARTY object from a MOOSE CARGO_GROUP object.
|
||||
-- @param #ARTY self
|
||||
-- @param Cargo.CargoGroup#CARGO_GROUP cargogroup The CARGO GROUP object for which artillery tasks should be assigned.
|
||||
-- @param alias (Optional) Alias name the group will be calling itself when sending messages. Default is the group name.
|
||||
-- @return #ARTY ARTY object or nil if group does not exist or is not a ground or naval group.
|
||||
function ARTY:NewFromCargoGroup(cargogroup, alias)
|
||||
|
||||
if cargogroup then
|
||||
BASE:T(string.format("ARTY script version %s. Added CARGO group %s.", ARTY.version, cargogroup:GetName()))
|
||||
else
|
||||
BASE:E("ERROR: Requested ARTY CARGO GROUP does not exist! (Has to be a MOOSE CARGO(!) group.)")
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Get group belonging to the cargo group.
|
||||
local group=cargogroup:GetObject()
|
||||
|
||||
-- Create ARTY object.
|
||||
local arty=ARTY:New(group,alias)
|
||||
|
||||
-- Set iscargo flag.
|
||||
arty.iscargo=true
|
||||
|
||||
-- Set cargo group object.
|
||||
arty.cargogroup=cargogroup
|
||||
|
||||
return arty
|
||||
end
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- User Functions
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1448,7 +1391,7 @@ end
|
||||
-- @param #ARTY self
|
||||
-- @param Core.Point#COORDINATE coord Coordinates of the new position.
|
||||
-- @param #string time (Optional) Day time at which the group should start moving. Passed as a string in format "08:13:45". Default is now.
|
||||
-- @param #number speed (Optinal) Speed in km/h the group should move at. Default 70% of max posible speed of group.
|
||||
-- @param #number speed (Optional) Speed in km/h the group should move at. Default 70% of max posible speed of group.
|
||||
-- @param #boolean onroad (Optional) If true, group will mainly use roads. Default off, i.e. go directly towards the specified coordinate.
|
||||
-- @param #boolean cancel (Optional) If true, cancel any running attack when move should begin. Default is false.
|
||||
-- @param #string name (Optional) Name of the coordinate. Default is LL DMS string of the coordinate. If the name was already given, the numbering "#01", "#02",... is appended automatically.
|
||||
@@ -1559,7 +1502,7 @@ end
|
||||
|
||||
--- Set minimum firing range. Targets closer than this distance are not engaged.
|
||||
-- @param #ARTY self
|
||||
-- @param #number range Min range in kilometers. Default is 0.1 km.
|
||||
-- @param #number range (Optional) Min range in kilometers. Default is 0.1 km.
|
||||
-- @return self
|
||||
function ARTY:SetMinFiringRange(range)
|
||||
self:F({range=range})
|
||||
@@ -1569,7 +1512,7 @@ end
|
||||
|
||||
--- Set maximum firing range. Targets further away than this distance are not engaged.
|
||||
-- @param #ARTY self
|
||||
-- @param #number range Max range in kilometers. Default is 1000 km.
|
||||
-- @param #number range (Optional) Max range in kilometers. Default is 1000 km.
|
||||
-- @return self
|
||||
function ARTY:SetMaxFiringRange(range)
|
||||
self:F({range=range})
|
||||
@@ -1579,7 +1522,7 @@ end
|
||||
|
||||
--- Set time interval between status updates. During the status check, new events are triggered.
|
||||
-- @param #ARTY self
|
||||
-- @param #number interval Time interval in seconds. Default 10 seconds.
|
||||
-- @param #number interval (Optional) Time interval in seconds. Default 10 seconds.
|
||||
-- @return self
|
||||
function ARTY:SetStatusInterval(interval)
|
||||
self:F({interval=interval})
|
||||
@@ -1589,7 +1532,7 @@ end
|
||||
|
||||
--- Set time interval for weapon tracking.
|
||||
-- @param #ARTY self
|
||||
-- @param #number interval Time interval in seconds. Default 0.2 seconds.
|
||||
-- @param #number interval (Optional) Time interval in seconds. Default 0.2 seconds.
|
||||
-- @return self
|
||||
function ARTY:SetTrackInterval(interval)
|
||||
self.dtTrack=interval or 0.2
|
||||
@@ -1598,7 +1541,7 @@ end
|
||||
|
||||
--- Set time how it is waited a unit the first shot event happens. If no shot is fired after this time, the task to fire is aborted and the target removed.
|
||||
-- @param #ARTY self
|
||||
-- @param #number waittime Time in seconds. Default 300 seconds.
|
||||
-- @param #number waittime (Optional) Time in seconds. Default 300 seconds.
|
||||
-- @return self
|
||||
function ARTY:SetWaitForShotTime(waittime)
|
||||
self:F({waittime=waittime})
|
||||
@@ -1608,7 +1551,7 @@ end
|
||||
|
||||
--- Define the safe distance between ARTY group and rearming unit or rearming place at which rearming process is possible.
|
||||
-- @param #ARTY self
|
||||
-- @param #number distance Safe distance in meters. Default is 100 m.
|
||||
-- @param #number distance (Optional) Safe distance in meters. Default is 100 m.
|
||||
-- @return self
|
||||
function ARTY:SetRearmingDistance(distance)
|
||||
self:F({distance=distance})
|
||||
@@ -1870,7 +1813,7 @@ end
|
||||
|
||||
--- Set nuclear warhead explosion strength.
|
||||
-- @param #ARTY self
|
||||
-- @param #number strength Explosion strength in kilo tons TNT. Default is 0.075 kt.
|
||||
-- @param #number strength (Optional) Explosion strength in kilo tons TNT. Default is 0.075 kt.
|
||||
-- @return self
|
||||
function ARTY:SetTacNukeWarhead(strength)
|
||||
self.nukewarhead=strength or 0.075
|
||||
@@ -3960,7 +3903,7 @@ end
|
||||
|
||||
--- Get the number of shells a unit or group currently has. For a group the ammo count of all units is summed up.
|
||||
-- @param #ARTY self
|
||||
-- @param #boolean display Display ammo table as message to all. Default false.
|
||||
-- @param #boolean display (Optional) Display ammo table as message to all. Default false.
|
||||
-- @return #number Total amount of ammo the whole group has left.
|
||||
-- @return #number Number of shells the group has left.
|
||||
-- @return #number Number of rockets the group has left.
|
||||
|
||||
@@ -427,7 +427,7 @@ end
|
||||
|
||||
--- (User) Set minimum threat level for target selection, can be 0 (lowest) to 10 (highest).
|
||||
-- @param #AUTOLASE self
|
||||
-- @param #number Level Level used for filtering, defaults to 0. SAM systems and manpads have level 7 to 10, AAA level 6, MTBs and armoured vehicles level 3 to 5, APC, Artillery, Infantry and EWR level 1 to 2.
|
||||
-- @param #number Level (Optional) Level used for filtering, defaults to 0. SAM systems and manpads have level 7 to 10, AAA level 6, MTBs and armoured vehicles level 3 to 5, APC, Artillery, Infantry and EWR level 1 to 2.
|
||||
-- @return #AUTOLASE self
|
||||
-- @usage Filter for level 3 and above:
|
||||
-- `myautolase:SetMinThreatLevel(3)`
|
||||
@@ -502,10 +502,12 @@ end
|
||||
-- @param #number Port (Optional) Defaults to 5002
|
||||
-- @param #string Voice (Optional) Use a specifc voice with the @{Sound.SRS#SetVoice} function, e.g, `:SetVoice("Microsoft Hedda Desktop")`.
|
||||
-- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
|
||||
-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest)
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS
|
||||
-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest).
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AUTOLASE self
|
||||
function AUTOLASE:SetUsingSRS(OnOff,Path,Frequency,Modulation,Label,Gender,Culture,Port,Voice,Volume,PathToGoogleKey)
|
||||
function AUTOLASE:SetUsingSRS(OnOff,Path,Frequency,Modulation,Label,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Provider,Speaker)
|
||||
if OnOff then
|
||||
self.useSRS = true
|
||||
self.SRSPath = Path or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
@@ -526,12 +528,18 @@ function AUTOLASE:SetUsingSRS(OnOff,Path,Frequency,Modulation,Label,Gender,Cultu
|
||||
self.SRS:SetCulture(self.Culture)
|
||||
self.SRS:SetPort(self.Port)
|
||||
self.SRS:SetVoice(self.Voice)
|
||||
if Speaker then
|
||||
self.SRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRS:SetCoalition(self.coalition)
|
||||
self.SRS:SetVolume(self.Volume)
|
||||
if self.PathToGoogleKey then
|
||||
if self.PathToGoogleKey and not Provider then
|
||||
self.SRS:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
self.SRSQueue = MSRSQUEUE:New(self.alias)
|
||||
else
|
||||
self.useSRS = false
|
||||
@@ -593,8 +601,8 @@ end
|
||||
|
||||
--- (User) Function to force laser cooldown and cool down time
|
||||
-- @param #AUTOLASE self
|
||||
-- @param #boolean OnOff Switch cool down on (true) or off (false) - defaults to true
|
||||
-- @param #number Seconds Number of seconds for cooldown - dafaults to 60 seconds
|
||||
-- @param #boolean OnOff (Optional) Switch cool down on (true) or off (false) - defaults to true
|
||||
-- @param #number Seconds (Optional) Number of seconds for cooldown - dafaults to 60 seconds
|
||||
-- @return #AUTOLASE self
|
||||
function AUTOLASE:SetLaserCoolDown(OnOff, Seconds)
|
||||
self.forcecooldown = OnOff and true
|
||||
@@ -615,8 +623,8 @@ end
|
||||
|
||||
--- (User) Function to set lasing distance in meters and duration in seconds
|
||||
-- @param #AUTOLASE self
|
||||
-- @param #number Distance (Max) distance for lasing in meters - default 5000 meters
|
||||
-- @param #number Duration (Max) duration for lasing in seconds - default 300 secs
|
||||
-- @param #number Distance (Optional) Max distance for lasing in meters - default 5000 meters
|
||||
-- @param #number Duration (Optional) Max duration for lasing in seconds - default 300 secs
|
||||
-- @return #AUTOLASE self
|
||||
function AUTOLASE:SetLasingParameters(Distance, Duration)
|
||||
self.LaseDistance = Distance or 5000
|
||||
@@ -640,7 +648,7 @@ 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.
|
||||
-- @param #number IDP (Optional) 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
|
||||
|
||||
@@ -178,7 +178,7 @@ end
|
||||
-- Note, one can also use the method @{#CLEANUP_AIRBASE.RemoveAirbase}() to remove the airbase from the control process as a whole,
|
||||
-- when an enemy unit is near. That is also an option...
|
||||
-- @param #CLEANUP_AIRBASE self
|
||||
-- @param #string CleanMissiles (Default=true) If true, missiles fired are immediately destroyed. If false missiles are not controlled.
|
||||
-- @param #boolean CleanMissiles (Optional) (Default=true) If true, missiles fired are immediately destroyed. If false missiles are not controlled.
|
||||
-- @return #CLEANUP_AIRBASE
|
||||
function CLEANUP_AIRBASE:SetCleanMissiles( CleanMissiles )
|
||||
|
||||
|
||||
@@ -301,12 +301,11 @@ do -- DESIGNATE
|
||||
|
||||
--- DESIGNATE Constructor. This class is an abstract class and should not be instantiated.
|
||||
-- @param #DESIGNATE self
|
||||
-- @param Tasking.CommandCenter#COMMANDCENTER CC
|
||||
-- @param Wrapper.Group#GROUP CC Group as Commandcenter standin. Currently unused (03/2026)
|
||||
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||
-- @param Core.Set#SET_GROUP AttackSet The Attack collection of GROUP objects to designate and report for.
|
||||
-- @param Tasking.Mission#MISSION Mission (Optional) The Mission where the menu needs to be attached.
|
||||
-- @return #DESIGNATE
|
||||
function DESIGNATE:New( CC, Detection, AttackSet, Mission )
|
||||
function DESIGNATE:New( CC, Detection, AttackSet )
|
||||
|
||||
local self = BASE:Inherit( self, FSM:New() ) -- #DESIGNATE
|
||||
self:F( { Detection } )
|
||||
@@ -468,7 +467,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
-- @param #number Delay
|
||||
|
||||
self.CC = CC
|
||||
--self.CC = CC
|
||||
self.Detection = Detection
|
||||
self.AttackSet = AttackSet
|
||||
self.RecceSet = Detection:GetDetectionSet()
|
||||
@@ -480,7 +479,7 @@ do -- DESIGNATE
|
||||
|
||||
self:SetFlashStatusMenu( false )
|
||||
self:SetFlashDetectionMessages( true )
|
||||
self:SetMission( Mission )
|
||||
--self:SetMission( Mission )
|
||||
|
||||
self:SetLaserCodes( { 1688, 1130, 4785, 6547, 1465, 4578 } ) -- set self.LaserCodes
|
||||
self:SetAutoLase( false, false ) -- set self.Autolase and don't send message.
|
||||
@@ -682,7 +681,7 @@ do -- DESIGNATE
|
||||
|
||||
--- Set the lase duration for designations.
|
||||
-- @param #DESIGNATE self
|
||||
-- @param #number LaseDuration The time in seconds a lase will continue to hold on target. The default is 120 seconds.
|
||||
-- @param #number LaseDuration (Optional) The time in seconds a lase will continue to hold on target. The default is 120 seconds.
|
||||
-- @return #DESIGNATE
|
||||
function DESIGNATE:SetLaseDuration( LaseDuration )
|
||||
self.LaseDuration = LaseDuration or 120
|
||||
@@ -754,10 +753,12 @@ do -- DESIGNATE
|
||||
|
||||
if Message then
|
||||
local AutoLaseOnOff = ( self.AutoLase == true ) and "On" or "Off"
|
||||
local CC = self.CC:GetPositionable()
|
||||
if CC then
|
||||
CC:MessageToSetGroup( self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".", 15, self.AttackSet )
|
||||
end
|
||||
|
||||
MESSAGE:New(self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".",15):ToSet(self.AttackSet)
|
||||
--local CC = self.CC:GetPositionable()
|
||||
--if CC then
|
||||
--CC:MessageToSetGroup( self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".", 15, self.AttackSet )
|
||||
--end
|
||||
end
|
||||
|
||||
self:CoordinateLase()
|
||||
@@ -777,14 +778,14 @@ do -- DESIGNATE
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the MISSION object for which designate will function.
|
||||
--- [DEPRECATED DO NOT USE] Set the MISSION object for which designate will function.
|
||||
-- When a MISSION object is assigned, the menu for the designation will be located at the Mission Menu.
|
||||
-- @param #DESIGNATE self
|
||||
-- @param Tasking.Mission#MISSION Mission The MISSION object.
|
||||
-- @return #DESIGNATE
|
||||
function DESIGNATE:SetMission( Mission ) --R2.2
|
||||
|
||||
self.Mission = Mission
|
||||
--self.Mission = Mission
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -830,7 +831,8 @@ do -- DESIGNATE
|
||||
function( AttackGroup )
|
||||
if AttackGroup:IsAlive() == true then
|
||||
local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
|
||||
self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName )
|
||||
--self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName )
|
||||
MESSAGE:New("Targets out of LOS\n" .. DetectionText,10,self.DesignateName):ToGroup(AttackGroup)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -855,7 +857,8 @@ do -- DESIGNATE
|
||||
function( AttackGroup )
|
||||
if self.FlashDetectionMessage[AttackGroup] == true then
|
||||
local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
|
||||
self.CC:GetPositionable():MessageToGroup( "Targets detected at \n" .. DetectionText, 10, AttackGroup, self.DesignateName )
|
||||
--self.CC:GetPositionable():MessageToGroup( "Targets detected at \n" .. DetectionText, 10, AttackGroup, self.DesignateName )
|
||||
MESSAGE:New( "Targets detected at \n" .. DetectionText,10,self.DesignateName):ToGroup(AttackGroup)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -929,9 +932,10 @@ do -- DESIGNATE
|
||||
end
|
||||
end
|
||||
|
||||
local CC = self.CC:GetPositionable()
|
||||
-- local CC = self.CC:GetPositionable()
|
||||
|
||||
CC:MessageTypeToGroup( DetectedReport:Text( "\n" ), MESSAGE.Type.Information, AttackGroup, self.DesignateName )
|
||||
--CC:MessageTypeToGroup( DetectedReport:Text( "\n" ), MESSAGE.Type.Information, AttackGroup, self.DesignateName )
|
||||
MESSAGE:New( DetectedReport:Text( "\n" ),15,self.DesignateName):ToGroup(AttackGroup)
|
||||
|
||||
local DesignationReport = REPORT:New( "Marking Targets:" )
|
||||
|
||||
@@ -965,10 +969,10 @@ do -- DESIGNATE
|
||||
|
||||
local MissionMenu = nil
|
||||
|
||||
if self.Mission then
|
||||
--if self.Mission then
|
||||
--MissionMenu = self.Mission:GetRootMenu( AttackGroup )
|
||||
MissionMenu = self.Mission:GetMenu( AttackGroup )
|
||||
end
|
||||
--MissionMenu = self.Mission:GetMenu( AttackGroup )
|
||||
--end
|
||||
|
||||
local MenuTime = timer.getTime()
|
||||
|
||||
@@ -1356,12 +1360,13 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
-- @return #DESIGNATE
|
||||
function DESIGNATE:onafterLaseOff( From, Event, To, Index )
|
||||
|
||||
local CC = self.CC:GetPositionable()
|
||||
|
||||
MESSAGE:New("Stopped lasing.",5,self.DesignateName):ToSet(self.AttackSet)
|
||||
--local CC = self.CC:GetPositionable()
|
||||
|
||||
if CC then
|
||||
CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName )
|
||||
end
|
||||
--if CC then
|
||||
--CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName )
|
||||
--end
|
||||
|
||||
local DetectedItem = self.Detection:GetDetectedItemByIndex( Index )
|
||||
local TargetSetUnit = self.Detection:GetDetectedItemSet( DetectedItem )
|
||||
|
||||
@@ -1052,9 +1052,9 @@ do -- DETECTION_BASE
|
||||
--- Method to make the radar detection less accurate, e.g. for WWII scenarios.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number minheight Minimum flight height to be detected, in meters AGL (above ground)
|
||||
-- @param #number thresheight Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance)
|
||||
-- @param #number thresblur Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found)
|
||||
-- @param #number closing Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20.
|
||||
-- @param #number thresheight (Optional) Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance)
|
||||
-- @param #number thresblur (Optional) Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found)
|
||||
-- @param #number closing (Optional) Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20.
|
||||
-- @return #DETECTION_BASE self
|
||||
function DETECTION_BASE:SetRadarBlur(minheight,thresheight,thresblur,closing)
|
||||
self.RadarBlur = true
|
||||
@@ -1104,12 +1104,14 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Set the parameters to calculate to optimal intercept point.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #boolean Intercept Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false.
|
||||
-- @param #boolean Intercept (Optional) Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false.
|
||||
-- @param #number InterceptDelay If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne.
|
||||
-- @return #DETECTION_BASE self
|
||||
function DETECTION_BASE:SetIntercept( Intercept, InterceptDelay )
|
||||
self:F2()
|
||||
|
||||
Intercept = Intercept or false
|
||||
|
||||
self.Intercept = Intercept
|
||||
self.InterceptDelay = InterceptDelay
|
||||
|
||||
@@ -1611,8 +1613,8 @@ do -- DETECTION_BASE
|
||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #string ItemPrefix Prefix of detected item.
|
||||
-- @param #number DetectedItemKey The key of the DetectedItem. Default self.DetectedItemMax. Could also be a string in principle.
|
||||
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
||||
-- @param #number DetectedItemKey (Optional) The key of the DetectedItem. Default self.DetectedItemMax. Could also be a string in principle.
|
||||
-- @param Core.Set#SET_UNIT Set (Optional) The Set of Units to be added.
|
||||
-- @return #DETECTION_BASE.DetectedItem
|
||||
function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemKey, Set )
|
||||
|
||||
@@ -1846,7 +1848,7 @@ do -- DETECTION_BASE
|
||||
return self
|
||||
end
|
||||
|
||||
--- Validate if the detected item is locked.
|
||||
--- Validate if the detected item is locked (not in the radar sense, though!).
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return #boolean
|
||||
@@ -1856,7 +1858,7 @@ do -- DETECTION_BASE
|
||||
|
||||
end
|
||||
|
||||
--- Lock a detected item.
|
||||
--- Lock a detected item (not in the radar sense, though!).
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return #DETECTION_BASE
|
||||
@@ -1867,7 +1869,7 @@ do -- DETECTION_BASE
|
||||
return self
|
||||
end
|
||||
|
||||
--- Unlock a detected item.
|
||||
--- Unlock a detected item (not in the radar sense, though!).
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return #DETECTION_BASE
|
||||
@@ -2536,7 +2538,7 @@ do -- DETECTION_AREAS
|
||||
--- DETECTION_AREAS constructor.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @param #number DetectionZoneRange The range in meters within which targets are grouped upon the first detected target. Default 5000m.
|
||||
-- @param #number DetectionZoneRange (Optional) The range in meters within which targets are grouped upon the first detected target. Default 5000m.
|
||||
-- @return #DETECTION_AREAS
|
||||
function DETECTION_AREAS:New( DetectionSetGroup, DetectionZoneRange )
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ ESCORT = {
|
||||
-- @param Wrapper.Client#CLIENT EscortClient The client escorted by the EscortGroup.
|
||||
-- @param Wrapper.Group#GROUP EscortGroup The group AI escorting the EscortClient.
|
||||
-- @param #string EscortName Name of the escort.
|
||||
-- @param #string EscortBriefing A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
||||
-- @param #string EscortBriefing (Optional) A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
||||
-- @return #ESCORT self
|
||||
-- @usage
|
||||
-- -- Declare a new EscortPlanes object as follows:
|
||||
@@ -333,9 +333,9 @@ end
|
||||
--- Defines a menu slot to let the escort hold at their current position and stay low with a specified height during a specified time in seconds.
|
||||
-- This menu will appear under **Hold position**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
||||
function ESCORT:MenuHoldAtEscortPosition( Height, Seconds, MenuTextFormat )
|
||||
@@ -394,9 +394,9 @@ end
|
||||
--- Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds.
|
||||
-- This menu will appear under **Navigation**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
||||
function ESCORT:MenuHoldAtLeaderPosition( Height, Seconds, MenuTextFormat )
|
||||
@@ -455,9 +455,9 @@ end
|
||||
--- Defines a menu slot to let the escort scan for targets at a certain height for a certain time in seconds.
|
||||
-- This menu will appear under **Scan targets**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat )
|
||||
self:F( { Height, Seconds, MenuTextFormat } )
|
||||
@@ -514,7 +514,7 @@ end
|
||||
-- This menu will appear under **Navigation**.
|
||||
-- The flare will be fired from the first unit in the group.
|
||||
-- @param #ESCORT self
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. If no text is given, the default text will be displayed.
|
||||
-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuFlare( MenuTextFormat )
|
||||
self:F()
|
||||
@@ -546,7 +546,7 @@ end
|
||||
-- Note that smoke menu options will only be displayed for ships and ground units. Not for air units.
|
||||
-- The smoke will be fired from the first unit in the group.
|
||||
-- @param #ESCORT self
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. If no text is given, the default text will be displayed.
|
||||
-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuSmoke( MenuTextFormat )
|
||||
self:F()
|
||||
@@ -580,7 +580,7 @@ end
|
||||
-- This menu will appear under **Report targets**.
|
||||
-- Note that if a report targets menu is not specified, no targets will be detected by the escort, and the attack and assisted attack menus will not be displayed.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCS#Time Seconds Optional parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds.
|
||||
-- @param DCS#Time Seconds (Optional) parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuReportTargets( Seconds )
|
||||
self:F( { Seconds } )
|
||||
|
||||
@@ -515,7 +515,7 @@ end
|
||||
|
||||
--- Set time interval between updates of the formation.
|
||||
-- @param #FORMATION self
|
||||
-- @param #number dt Time step in seconds between formation updates. Default is every 0.5 seconds.
|
||||
-- @param #number dt (Optional) Time step in seconds between formation updates. Default is every 0.5 seconds.
|
||||
-- @return #FORMATION
|
||||
function FORMATION:SetFollowTimeInterval(dt)
|
||||
self.dtFollow=dt or 0.5
|
||||
|
||||
@@ -459,7 +459,7 @@ end
|
||||
--- Set explosion power. This is an "artificial" explosion generated when the missile is destroyed. Just for the visual effect.
|
||||
-- Don't set the explosion power too big or it will harm the aircraft in the vicinity.
|
||||
-- @param #FOX self
|
||||
-- @param #number power Explosion power in kg TNT. Default 0.1 kg.
|
||||
-- @param #number power (Optional) Explosion power in kg TNT. Default 0.1 kg.
|
||||
-- @return #FOX self
|
||||
function FOX:SetExplosionPower(power)
|
||||
|
||||
@@ -470,7 +470,7 @@ end
|
||||
|
||||
--- Set missile-player distance when missile is destroyed.
|
||||
-- @param #FOX self
|
||||
-- @param #number distance Distance in meters. Default 200 m.
|
||||
-- @param #number distance (Optional) Distance in meters. Default 200 m.
|
||||
-- @return #FOX self
|
||||
function FOX:SetExplosionDistance(distance)
|
||||
|
||||
@@ -481,8 +481,8 @@ end
|
||||
|
||||
--- Set missile-player distance when BIG missiles are destroyed.
|
||||
-- @param #FOX self
|
||||
-- @param #number distance Distance in meters. Default 500 m.
|
||||
-- @param #number explosivemass Explosive mass of missile threshold in kg TNT. Default 50 kg.
|
||||
-- @param #number distance (Optional) Distance in meters. Default 500 m.
|
||||
-- @param #number explosivemass (Optional) Explosive mass of missile threshold in kg TNT. Default 50 kg.
|
||||
-- @return #FOX self
|
||||
function FOX:SetExplosionDistanceBigMissiles(distance, explosivemass)
|
||||
|
||||
@@ -516,7 +516,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #FOX self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #FOX self
|
||||
function FOX:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -172,7 +172,7 @@ end
|
||||
|
||||
--- Set duration how long messages are displayed.
|
||||
-- @param #PSEUDOATC self
|
||||
-- @param #number duration Time in seconds. Default is 30 sec.
|
||||
-- @param #number duration (Optional) Time in seconds. Default is 30 sec.
|
||||
function PSEUDOATC:SetMessageDuration(duration)
|
||||
self.mdur=duration or 30
|
||||
end
|
||||
@@ -186,21 +186,21 @@ end
|
||||
|
||||
--- Set time interval after which the F10 radio menu is refreshed.
|
||||
-- @param #PSEUDOATC self
|
||||
-- @param #number interval Interval in seconds. Default is every 120 sec.
|
||||
-- @param #number interval (Optional) Interval in seconds. Default is every 120 sec.
|
||||
function PSEUDOATC:SetMenuRefresh(interval)
|
||||
self.mrefresh=interval or 120
|
||||
end
|
||||
|
||||
--- [Deprecated] Enable/disable event handling by MOOSE or DCS.
|
||||
-- @param #PSEUDOATC self
|
||||
-- @param #boolean switch If true, events are handled by MOOSE (default). If false, events are handled directly by DCS.
|
||||
-- @param #boolean switch (Optional) If true, events are handled by MOOSE (default). If false, events are handled directly by DCS.
|
||||
function PSEUDOATC:SetEventsMoose(switch)
|
||||
self.eventsmoose=switch
|
||||
end
|
||||
|
||||
--- Set time interval for reporting altitude until touchdown.
|
||||
-- @param #PSEUDOATC self
|
||||
-- @param #number interval Interval in seconds. Default is every 3 sec.
|
||||
-- @param #number interval (Optional) Interval in seconds. Default is every 3 sec.
|
||||
function PSEUDOATC:SetReportAltInterval(interval)
|
||||
self.talt=interval or 3
|
||||
end
|
||||
|
||||
@@ -1055,7 +1055,7 @@ end
|
||||
|
||||
--- Set the friendly coalitions from which the airports can be used as departure and destination.
|
||||
-- @param #RAT self
|
||||
-- @param #string friendly "same"=own coalition+neutral (default), "sameonly"=own coalition only, "neutral"=all neutral airports.
|
||||
-- @param #string friendly (Optional) "same"=own coalition+neutral (default), "sameonly"=own coalition only, "neutral"=all neutral airports.
|
||||
-- Default is "same", so aircraft will use airports of the coalition their spawn template has plus all neutral airports.
|
||||
-- @return #RAT RAT self object.
|
||||
-- @usage yak:SetCoalition("neutral") will spawn aircraft randomly on all neutral airports.
|
||||
@@ -1137,7 +1137,7 @@ end
|
||||
|
||||
--- Set the scan radius around parking spots. Parking spot is considered to be occupied if any obstacle is found with the radius.
|
||||
-- @param #RAT self
|
||||
-- @param #number radius Radius in meters. Default 50 m.
|
||||
-- @param #number radius (Optional) Radius in meters. Default 50 m.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetParkingScanRadius(radius)
|
||||
self:F2(radius)
|
||||
@@ -1503,7 +1503,7 @@ end
|
||||
|
||||
--- Set the delay before first group is spawned.
|
||||
-- @param #RAT self
|
||||
-- @param #number delay Delay in seconds. Default is 5 seconds. Minimum delay is 0.5 seconds.
|
||||
-- @param #number delay (Optional) Delay in seconds. Default is 5 seconds. Minimum delay is 0.5 seconds.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetSpawnDelay(delay)
|
||||
self:F2(delay)
|
||||
@@ -1514,7 +1514,7 @@ end
|
||||
|
||||
--- Set the interval between spawnings of the template group.
|
||||
-- @param #RAT self
|
||||
-- @param #number interval Interval in seconds. Default is 5 seconds. Minimum is 0.5 seconds.
|
||||
-- @param #number interval (Optional) Interval in seconds. Default is 5 seconds. Minimum is 0.5 seconds.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetSpawnInterval(interval)
|
||||
self:F2(interval)
|
||||
@@ -1525,7 +1525,7 @@ end
|
||||
|
||||
--- Set max number of groups that will be spawned. When this limit is reached, no more RAT groups are spawned.
|
||||
-- @param #RAT self
|
||||
-- @param #number Nmax Max number of groups. Default `nil`=unlimited.
|
||||
-- @param #number Nmax (Optional) Max number of groups. Default `nil`=unlimited.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetSpawnLimit(Nmax)
|
||||
self.NspawnMax=Nmax
|
||||
@@ -1545,7 +1545,7 @@ end
|
||||
|
||||
--- Sets the delay between despawning and respawning aircraft.
|
||||
-- @param #RAT self
|
||||
-- @param #number delay Delay in seconds until respawn happens. Default is 1 second. Minimum is 1 second.
|
||||
-- @param #number delay (Optional) Delay in seconds until respawn happens. Default is 1 second. Minimum is 1 second.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetRespawnDelay(delay)
|
||||
self:F2(delay)
|
||||
@@ -1566,7 +1566,7 @@ end
|
||||
|
||||
--- Number of tries to respawn an aircraft in case it has accidentally been spawned on runway.
|
||||
-- @param #RAT self
|
||||
-- @param #number n Number of retries. Default is 3.
|
||||
-- @param #number n (Optional) Number of retries. Default is 3.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetMaxRespawnTriedWhenSpawnedOnRunway(n)
|
||||
self:F2(n)
|
||||
@@ -1624,7 +1624,7 @@ end
|
||||
--- Check if aircraft have accidentally been spawned on the runway. If so they will be removed immediately.
|
||||
-- @param #RAT self
|
||||
-- @param #boolean switch If true, check is performed. If false, this check is omitted.
|
||||
-- @param #number radius Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m.
|
||||
-- @param #number radius (Optional) Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:CheckOnRunway(switch, distance)
|
||||
self:F2(switch)
|
||||
@@ -1639,7 +1639,7 @@ end
|
||||
--- Check if aircraft have accidentally been spawned on top of each other. If yes, they will be removed immediately.
|
||||
-- @param #RAT self
|
||||
-- @param #boolean switch If true, check is performed. If false, this check is omitted.
|
||||
-- @param #number radius Radius in meters until which a unit is considered to be on top of each other. Default is 2 m.
|
||||
-- @param #number radius (Optional) Radius in meters until which a unit is considered to be on top of each other. Default is 2 m.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:CheckOnTop(switch, radius)
|
||||
self:F2(switch)
|
||||
@@ -1755,10 +1755,10 @@ end
|
||||
|
||||
--- Define how aircraft that are spawned in uncontrolled state are activate.
|
||||
-- @param #RAT self
|
||||
-- @param #number maxactivated Maximal numnber of activated aircraft. Absolute maximum will be the number of spawned groups. Default is 1.
|
||||
-- @param #number delay Time delay in seconds before (first) aircraft is activated. Default is 1 second.
|
||||
-- @param #number delta Time difference in seconds before next aircraft is activated. Default is 1 second.
|
||||
-- @param #number frand Factor [0,...,1] for randomization of time difference between aircraft activations. Default is 0, i.e. no randomization.
|
||||
-- @param #number maxactivated (Optional) Maximal numnber of activated aircraft. Absolute maximum will be the number of spawned groups. Default is 1.
|
||||
-- @param #number delay (Optional) Time delay in seconds before (first) aircraft is activated. Default is 1 second.
|
||||
-- @param #number delta (Optional) Time difference in seconds before next aircraft is activated. Default is 1 second.
|
||||
-- @param #number frand (Optional) Factor [0,...,1] for randomization of time difference between aircraft activations. Default is 0, i.e. no randomization.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:ActivateUncontrolled(maxactivated, delay, delta, frand)
|
||||
self:F2({max=maxactivated, delay=delay, delta=delta, rand=frand})
|
||||
@@ -1784,7 +1784,7 @@ end
|
||||
|
||||
--- Set the time after which inactive groups will be destroyed.
|
||||
-- @param #RAT self
|
||||
-- @param #number time Time in seconds. Default is 600 seconds = 10 minutes. Minimum is 60 seconds.
|
||||
-- @param #number time (Optional) Time in seconds. Default is 600 seconds = 10 minutes. Minimum is 60 seconds.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:TimeDestroyInactive(time)
|
||||
self:F2(time)
|
||||
@@ -1818,7 +1818,7 @@ end
|
||||
|
||||
--- Set the climb rate. This automatically sets the climb angle.
|
||||
-- @param #RAT self
|
||||
-- @param #number rate Climb rate in ft/min. Default is 1500 ft/min. Minimum is 100 ft/min. Maximum is 15,000 ft/min.
|
||||
-- @param #number rate (Optional) Climb rate in ft/min. Default is 1500 ft/min. Minimum is 100 ft/min. Maximum is 15,000 ft/min.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:SetClimbRate(rate)
|
||||
self:F2(rate)
|
||||
@@ -1912,7 +1912,7 @@ end
|
||||
|
||||
--- Max number of planes that get landing clearance of the RAT ATC. This setting effects all RAT objects and groups!
|
||||
-- @param #RAT self
|
||||
-- @param #number n Number of aircraft that are allowed to land simultaniously. Default is 2.
|
||||
-- @param #number n (Optional) Number of aircraft that are allowed to land simultaniously. Default is 2.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:ATC_Clearance(n)
|
||||
self:F2(n)
|
||||
@@ -1922,7 +1922,7 @@ end
|
||||
|
||||
--- Delay between granting landing clearance for simultanious landings. This setting effects all RAT objects and groups!
|
||||
-- @param #RAT self
|
||||
-- @param #number time Delay time when the next aircraft will get landing clearance event if the previous one did not land yet. Default is 240 sec.
|
||||
-- @param #number time (Optional) Delay time when the next aircraft will get landing clearance event if the previous one did not land yet. Default is 240 sec.
|
||||
-- @return #RAT RAT self object.
|
||||
function RAT:ATC_Delay(time)
|
||||
self:F2(time)
|
||||
@@ -2102,6 +2102,8 @@ function RAT:_InitAircraft(DCSgroup)
|
||||
local DCSdesc=DCSunit:getDesc()
|
||||
local DCScategory=DCSgroup:getCategory()
|
||||
local DCStype=DCSunit:getTypeName()
|
||||
self:I({typename=DCStype})
|
||||
UTILS.PrintTableToLog(DCSdesc.box,1,noprint,3,seen)
|
||||
|
||||
-- set category
|
||||
if DCScategory==Group.Category.AIRPLANE then
|
||||
@@ -2136,7 +2138,12 @@ function RAT:_InitAircraft(DCSgroup)
|
||||
|
||||
-- Store all descriptors.
|
||||
--self.aircraft.descriptors=DCSdesc
|
||||
|
||||
|
||||
-- Tomcat sizing as default
|
||||
self.aircraft.length=12
|
||||
self.aircraft.height=4
|
||||
self.aircraft.width=10.3
|
||||
|
||||
-- aircraft dimensions
|
||||
if DCSdesc.box then
|
||||
self.aircraft.length=DCSdesc.box.max.x
|
||||
@@ -2158,6 +2165,10 @@ function RAT:_InitAircraft(DCSgroup)
|
||||
self.aircraft.length=11.48
|
||||
self.aircraft.height=4.11
|
||||
self.aircraft.width=13.41
|
||||
elseif DCStype == "F-14A-135-GR" then
|
||||
self.aircraft.length=12
|
||||
self.aircraft.height=4
|
||||
self.aircraft.width=10.3
|
||||
end
|
||||
|
||||
self.aircraft.box=math.max(self.aircraft.length,self.aircraft.width)
|
||||
@@ -2767,7 +2778,7 @@ end
|
||||
--- Despawn group. The `FLIGHTGROUP` is despawned and stopped. The ratcraft is removed from the self.ratcraft table. Menues are removed.
|
||||
-- @param #RAT self
|
||||
-- @param Wrapper.Group#GROUP group Group to be despawned.
|
||||
-- @param #number delay Delay in seconds before the despawn happens. Default is immidiately.
|
||||
-- @param #number delay (Optional) Delay in seconds before the despawn happens. Default is immidiately.
|
||||
function RAT:_Despawn(group, delay)
|
||||
|
||||
if delay and delay>0 then
|
||||
@@ -3042,6 +3053,14 @@ function RAT:_SetRoute(takeoff, landing, _departure, _destination, _waypoint)
|
||||
if landing==RAT.wp.air then
|
||||
local vec2=destination:GetRandomVec2()
|
||||
Pdestination=COORDINATE:NewFromVec2(vec2)
|
||||
elseif destination:IsShip() then
|
||||
-- Crudely predict where the ship will be
|
||||
local _ship = UNIT:FindByName(destination:GetName())
|
||||
local _shipHeading = _ship:GetHeading()
|
||||
Pdestination=destination:GetCoordinate()
|
||||
local _transitTime = Pdeparture:Get2DDistance(Pdestination) / VxCruise
|
||||
Pdestination.x = Pdestination.x + (_ship:GetGroundSpeed() * math.cos(math.rad(_shipHeading)) * _transitTime)
|
||||
Pdestination.z = Pdestination.z + (_ship:GetGroundSpeed() * math.sin(math.rad(_shipHeading)) * _transitTime)
|
||||
else
|
||||
Pdestination=destination:GetCoordinate()
|
||||
end
|
||||
@@ -4697,7 +4716,7 @@ end
|
||||
|
||||
--- Anticipated group name from alias and spawn index.
|
||||
-- @param #RAT self
|
||||
-- @param #number index Spawnindex of group if given or self.SpawnIndex+1 by default.
|
||||
-- @param #number index (Optional) Spawnindex of group if given or self.SpawnIndex+1 by default.
|
||||
-- @return #string Name the group will get after it is spawned.
|
||||
function RAT:_AnticipatedGroupName(index)
|
||||
local index=index or self.SpawnIndex+1
|
||||
@@ -6005,7 +6024,7 @@ end
|
||||
--- Adds a RAT object to the RAT manager. Parameter min specifies the limit how many RAT groups are at least alive.
|
||||
-- @param #RATMANAGER self
|
||||
-- @param #RAT ratobject RAT object to be managed.
|
||||
-- @param #number min Minimum number of groups for this RAT object. Default is 1.
|
||||
-- @param #number min (Optional) Minimum number of groups for this RAT object. Default is 1.
|
||||
-- @return #RATMANAGER RATMANAGER self object.
|
||||
function RATMANAGER:Add(ratobject,min)
|
||||
|
||||
@@ -6033,7 +6052,7 @@ end
|
||||
|
||||
--- Starts the RAT manager and spawns the initial random number RAT groups for each RAT object.
|
||||
-- @param #RATMANAGER self
|
||||
-- @param #number delay Time delay in seconds after which the RAT manager is started. Default is 5 seconds.
|
||||
-- @param #number delay (Optional) Time delay in seconds after which the RAT manager is started. Default is 5 seconds.
|
||||
-- @return #RATMANAGER RATMANAGER self object.
|
||||
function RATMANAGER:Start(delay)
|
||||
|
||||
@@ -6106,7 +6125,7 @@ end
|
||||
|
||||
--- Stops the RAT manager.
|
||||
-- @param #RATMANAGER self
|
||||
-- @param #number delay Delay in seconds before the manager is stopped. Default is 1 second.
|
||||
-- @param #number delay (Optional) Delay in seconds before the manager is stopped. Default is 1 second.
|
||||
-- @return #RATMANAGER RATMANAGER self object.
|
||||
function RATMANAGER:Stop(delay)
|
||||
delay=delay or 1
|
||||
@@ -6142,7 +6161,7 @@ end
|
||||
|
||||
--- Sets the time interval between spawning of groups.
|
||||
-- @param #RATMANAGER self
|
||||
-- @param #number dt Time interval in seconds. Default is 1 second.
|
||||
-- @param #number dt (Optional) Time interval in seconds. Default is 1 second.
|
||||
-- @return #RATMANAGER RATMANAGER self object.
|
||||
function RATMANAGER:SetTspawn(dt)
|
||||
self.dTspawn=dt or 1.0
|
||||
|
||||
@@ -949,7 +949,7 @@ end
|
||||
|
||||
--- Set maximal strafing altitude. Player entering a strafe pit above that altitude are not registered for a valid pass.
|
||||
-- @param #RANGE self
|
||||
-- @param #number maxalt Maximum altitude in meters AGL. Default is 914 m = 3000 ft.
|
||||
-- @param #number maxalt (Optional) Maximum altitude in meters AGL. Default is 914 m = 3000 ft.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetMaxStrafeAlt( maxalt )
|
||||
self.strafemaxalt = maxalt or RANGE.Defaults.strafemaxalt
|
||||
@@ -958,7 +958,7 @@ end
|
||||
|
||||
--- Set time interval for tracking bombs. A smaller time step increases accuracy but needs more CPU time.
|
||||
-- @param #RANGE self
|
||||
-- @param #number dt Time interval in seconds. Default is 0.005 s.
|
||||
-- @param #number dt (Optional) Time interval in seconds. Default is 0.005 s.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetBombtrackTimestep( dt )
|
||||
self.dtBombtrack = dt or RANGE.Defaults.dtBombtrack
|
||||
@@ -967,7 +967,7 @@ end
|
||||
|
||||
--- Set time how long (most) messages are displayed.
|
||||
-- @param #RANGE self
|
||||
-- @param #number time Time in seconds. Default is 30 s.
|
||||
-- @param #number time (Optional) Time in seconds. Default is 30 s.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetMessageTimeDuration( time )
|
||||
self.Tmsg = time or RANGE.Defaults.Tmsg
|
||||
@@ -1009,8 +1009,8 @@ end
|
||||
--- Set FunkMan socket. Bombing and strafing results will be send to your Discord bot.
|
||||
-- **Requires running FunkMan program**.
|
||||
-- @param #RANGE self
|
||||
-- @param #number Port Port. Default `10042`.
|
||||
-- @param #string Host Host. Default "127.0.0.1".
|
||||
-- @param #number Port (Optional) Port. Default `10042`.
|
||||
-- @param #string Host (Optional) Host. Default "127.0.0.1".
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetFunkManOn(Port, Host)
|
||||
|
||||
@@ -1032,7 +1032,7 @@ end
|
||||
|
||||
--- Set max number of player results that are displayed.
|
||||
-- @param #RANGE self
|
||||
-- @param #number nmax Number of results. Default is 10.
|
||||
-- @param #number nmax (Optional) Number of results. Default is 10.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetDisplayedMaxPlayerResults( nmax )
|
||||
self.ndisplayresult = nmax or RANGE.Defaults.ndisplayresult
|
||||
@@ -1041,7 +1041,7 @@ end
|
||||
|
||||
--- Set range radius. Defines the area in which e.g. bomb impacts are smoked.
|
||||
-- @param #RANGE self
|
||||
-- @param #number radius Radius in km. Default 5 km.
|
||||
-- @param #number radius (Optional) Radius in km. Default 5 km.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetRangeRadius( radius )
|
||||
self.rangeradius = radius * 1000 or RANGE.Defaults.rangeradius
|
||||
@@ -1050,7 +1050,7 @@ end
|
||||
|
||||
--- Set player setting whether bomb impact points are smoked or not.
|
||||
-- @param #RANGE self
|
||||
-- @param #boolean switch If true nor nil default is to smoke impact points of bombs.
|
||||
-- @param #boolean switch (Optional) If true nor nil default is to smoke impact points of bombs.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetDefaultPlayerSmokeBomb( switch )
|
||||
if switch == true or switch == nil then
|
||||
@@ -1063,7 +1063,7 @@ end
|
||||
|
||||
--- Set bomb track threshold distance. Bombs/rockets/missiles are only tracked if player-range distance is less than this distance. Default 25 km.
|
||||
-- @param #RANGE self
|
||||
-- @param #number distance Threshold distance in km. Default 25 km.
|
||||
-- @param #number distance (Optional) Threshold distance in km. Default 25 km.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetBombtrackThreshold( distance )
|
||||
self.BombtrackThreshold = (distance or 25) * 1000
|
||||
@@ -1110,7 +1110,7 @@ end
|
||||
|
||||
--- Enable range ceiling. Aircraft must be below the ceiling altitude to be considered in the range zone.
|
||||
-- @param #RANGE self
|
||||
-- @param #boolean enabled True if you would like to enable the ceiling check. If no value give, will Default to false.
|
||||
-- @param #boolean enabled (Optional) True if you would like to enable the ceiling check. If no value give, will Default to false.
|
||||
-- @return #RANGE self
|
||||
function RANGE:EnableRangeCeiling( enabled )
|
||||
self:T(self.lid.."EnableRangeCeiling")
|
||||
@@ -1126,7 +1126,7 @@ end
|
||||
|
||||
--- Set smoke color for marking bomb targets. By default bomb targets are marked by red smoke.
|
||||
-- @param #RANGE self
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.Red`.
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.Red`.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetBombTargetSmokeColor( colorid )
|
||||
self.BombSmokeColor = colorid or SMOKECOLOR.Red
|
||||
@@ -1135,7 +1135,7 @@ end
|
||||
|
||||
--- Set score bomb distance.
|
||||
-- @param #RANGE self
|
||||
-- @param #number distance Distance in meters. Default 1000 m.
|
||||
-- @param #number distance (Optional) Distance in meters. Default 1000 m.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetScoreBombDistance( distance )
|
||||
self.scorebombdistance = distance or 1000
|
||||
@@ -1144,7 +1144,7 @@ end
|
||||
|
||||
--- Set smoke color for marking strafe targets. By default strafe targets are marked by green smoke.
|
||||
-- @param #RANGE self
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.Green`.
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.Green`.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetStrafeTargetSmokeColor( colorid )
|
||||
self.StrafeSmokeColor = colorid or SMOKECOLOR.Green
|
||||
@@ -1153,7 +1153,7 @@ end
|
||||
|
||||
--- Set smoke color for marking strafe pit approach boxes. By default strafe pit boxes are marked by white smoke.
|
||||
-- @param #RANGE self
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.White`.
|
||||
-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.White`.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetStrafePitSmokeColor( colorid )
|
||||
self.StrafePitSmokeColor = colorid or SMOKECOLOR.White
|
||||
@@ -1162,7 +1162,7 @@ end
|
||||
|
||||
--- Set time delay between bomb impact and starting to smoke the impact point.
|
||||
-- @param #RANGE self
|
||||
-- @param #number delay Time delay in seconds. Default is 3 seconds.
|
||||
-- @param #number delay (Optional) Time delay in seconds. Default is 3 seconds.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSmokeTimeDelay( delay )
|
||||
self.TdelaySmoke = delay or RANGE.Defaults.TdelaySmoke
|
||||
@@ -1252,14 +1252,16 @@ end
|
||||
--- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary.
|
||||
-- @param #RANGE self
|
||||
-- @param #string PathToSRS Path to SRS directory.
|
||||
-- @param #number Port SRS port. Default 5002.
|
||||
-- @param #number Coalition Coalition side, e.g. `coalition.side.BLUE` or `coalition.side.RED`. Default `coalition.side.BLUE`.
|
||||
-- @param #number Frequency Frequency to use. Default is 256 MHz for range control and 305 MHz for instructor. If given, both control and instructor get this frequency.
|
||||
-- @param #number Modulation Modulation to use, defaults to radio.modulation.AM
|
||||
-- @param #number Volume Volume, between 0.0 and 1.0. Defaults to 1.0
|
||||
-- @param #number Port (Optional) SRS port. Default 5002.
|
||||
-- @param #number Coalition (Optional) Coalition side, e.g. `coalition.side.BLUE` or `coalition.side.RED`. Default `coalition.side.BLUE`.
|
||||
-- @param #number Frequency (Optional) Frequency to use. Default is 256 MHz for range control and 305 MHz for instructor. If given, both control and instructor get this frequency.
|
||||
-- @param #number Modulation (Optional) Modulation to use, defaults to radio.modulation.AM
|
||||
-- @param #number Volume (Optional) Volume, between 0.0 and 1.0. Defaults to 1.0
|
||||
-- @param #string PathToGoogleKey Path to Google TTS credentials.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Backend (Optional) TTS Backend to be used.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume, PathToGoogleKey)
|
||||
function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume, PathToGoogleKey,Provider,Backend)
|
||||
|
||||
if PathToSRS or MSRS.path then
|
||||
|
||||
@@ -1273,6 +1275,9 @@ function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume,
|
||||
if self.rangezone then
|
||||
self.controlmsrs:SetCoordinate(self.rangezone:GetCoordinate())
|
||||
end
|
||||
if Backend then
|
||||
self.controlmsrs:SetBackend(Backend)
|
||||
end
|
||||
self.controlsrsQ = MSRSQUEUE:New("CONTROL")
|
||||
|
||||
self.instructmsrs=MSRS:New(PathToSRS or MSRS.path, Frequency or 305, Modulation or radio.modulation.AM)
|
||||
@@ -1291,7 +1296,13 @@ function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume,
|
||||
self.instructmsrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||
self.instructmsrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
|
||||
if Backend then
|
||||
self.instructmsrs:SetBackend(Backend)
|
||||
end
|
||||
if Provider then
|
||||
self.controlmsrs:SetProvider(Provider)
|
||||
self.instructmsrs:SetProvider(Provider)
|
||||
end
|
||||
else
|
||||
self:E(self.lid..string.format("ERROR: No SRS path specified!"))
|
||||
end
|
||||
@@ -1300,14 +1311,15 @@ end
|
||||
|
||||
--- (SRS) Set range control frequency and voice. Use `RANGE:SetSRS()` once first before using this function.
|
||||
-- @param #RANGE self
|
||||
-- @param #number frequency Frequency in MHz. Default 256 MHz.
|
||||
-- @param #number modulation Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #number frequency (Optional) Frequency in MHz. Default 256 MHz.
|
||||
-- @param #number modulation (Optional) Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #string voice Voice.
|
||||
-- @param #string culture Culture, defaults to "en-US".
|
||||
-- @param #string gender Gender, defaults to "female".
|
||||
-- @param #string culture (Optional) Culture, defaults to "en-US".
|
||||
-- @param #string gender (Optional) Gender, defaults to "female".
|
||||
-- @param #string relayunitname Name of the unit used for transmission location.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSRSRangeControl( frequency, modulation, voice, culture, gender, relayunitname )
|
||||
function RANGE:SetSRSRangeControl( frequency, modulation, voice, culture, gender, relayunitname, Speaker )
|
||||
if not self.instructmsrs then
|
||||
self:E(self.lid.."Use myrange:SetSRS() once first before using myrange:SetSRSRangeControl!")
|
||||
return self
|
||||
@@ -1316,6 +1328,9 @@ function RANGE:SetSRSRangeControl( frequency, modulation, voice, culture, gender
|
||||
self.controlmsrs:SetFrequencies(self.rangecontrolfreq)
|
||||
self.controlmsrs:SetModulations(modulation or radio.modulation.AM)
|
||||
self.controlmsrs:SetVoice(voice)
|
||||
if Speaker then
|
||||
self.controlmsrs:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.controlmsrs:SetCulture(culture or "en-US")
|
||||
self.controlmsrs:SetGender(gender or "female")
|
||||
self.rangecontrol = true
|
||||
@@ -1334,14 +1349,15 @@ end
|
||||
|
||||
--- (SRS) Set range instructor frequency and voice. Use `RANGE:SetSRS()` once first before using this function.
|
||||
-- @param #RANGE self
|
||||
-- @param #number frequency Frequency in MHz. Default 305 MHz.
|
||||
-- @param #number modulation Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #number frequency (Optional) Frequency in MHz. Default 305 MHz.
|
||||
-- @param #number modulation (Optional) Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #string voice Voice.
|
||||
-- @param #string culture Culture, defaults to "en-US".
|
||||
-- @param #string gender Gender, defaults to "male".
|
||||
-- @param #string culture (Optional) Culture, defaults to "en-US".
|
||||
-- @param #string gender (Optional) Gender, defaults to "male".
|
||||
-- @param #string relayunitname Name of the unit used for transmission location.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSRSRangeInstructor( frequency, modulation, voice, culture, gender, relayunitname )
|
||||
function RANGE:SetSRSRangeInstructor( frequency, modulation, voice, culture, gender, relayunitname, Speaker )
|
||||
if not self.instructmsrs then
|
||||
self:E(self.lid.."Use myrange:SetSRS() once first before using myrange:SetSRSRangeInstructor!")
|
||||
return self
|
||||
@@ -1350,6 +1366,9 @@ function RANGE:SetSRSRangeInstructor( frequency, modulation, voice, culture, gen
|
||||
self.instructmsrs:SetFrequencies(self.instructorfreq)
|
||||
self.instructmsrs:SetModulations(modulation or radio.modulation.AM)
|
||||
self.instructmsrs:SetVoice(voice)
|
||||
if Speaker then
|
||||
self.instructmsrs:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.instructmsrs:SetCulture(culture or "en-US")
|
||||
self.instructmsrs:SetGender(gender or "male")
|
||||
self.instructor = true
|
||||
@@ -1368,7 +1387,7 @@ end
|
||||
|
||||
--- Enable range control and set frequency (non-SRS).
|
||||
-- @param #RANGE self
|
||||
-- @param #number frequency Frequency in MHz. Default 256 MHz.
|
||||
-- @param #number frequency (Optional) Frequency in MHz. Default 256 MHz.
|
||||
-- @param #string relayunitname Name of the unit used for transmission.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetRangeControl( frequency, relayunitname )
|
||||
@@ -1379,7 +1398,7 @@ end
|
||||
|
||||
--- Enable instructor radio and set frequency (non-SRS).
|
||||
-- @param #RANGE self
|
||||
-- @param #number frequency Frequency in MHz. Default 305 MHz.
|
||||
-- @param #number frequency (Optional) Frequency in MHz. Default 305 MHz.
|
||||
-- @param #string relayunitname Name of the unit used for transmission.
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetInstructorRadio( frequency, relayunitname )
|
||||
@@ -1390,7 +1409,7 @@ end
|
||||
|
||||
--- Set sound files folder within miz file.
|
||||
-- @param #RANGE self
|
||||
-- @param #string path Path for sound files. Default "Range Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @param #string path (Optional) Path for sound files. Default "Range Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSoundfilesPath( path )
|
||||
self.soundpath = tostring( path or "Range Soundfiles/" )
|
||||
@@ -1630,11 +1649,13 @@ end
|
||||
-- @param #RANGE self
|
||||
-- @param #table targetnames Single or multiple (Table) names of unit or static objects serving as bomb targets.
|
||||
-- @param #number goodhitrange (Optional) Max distance from target unit (in meters) which is considered as a good hit. Default is 25 m.
|
||||
-- @param #boolean randommove If true, unit will move randomly within the range. Default is false.
|
||||
-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false.
|
||||
-- @return #RANGE self
|
||||
function RANGE:AddBombingTargets( targetnames, goodhitrange, randommove )
|
||||
self:F( { targetnames = targetnames, goodhitrange = goodhitrange, randommove = randommove } )
|
||||
|
||||
randommove = randommove or false
|
||||
|
||||
-- Create a table if necessary.
|
||||
if type( targetnames ) ~= "table" then
|
||||
targetnames = { targetnames }
|
||||
@@ -1669,7 +1690,7 @@ end
|
||||
-- @param #RANGE self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE unit Positionable (unit or static) of the bombing target.
|
||||
-- @param #number goodhitrange Max distance from unit which is considered as a good hit.
|
||||
-- @param #boolean randommove If true, unit will move randomly within the range. Default is false.
|
||||
-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false.
|
||||
-- @return #RANGE self
|
||||
function RANGE:AddBombingTargetUnit( unit, goodhitrange, randommove )
|
||||
self:F( { unit = unit, goodhitrange = goodhitrange, randommove = randommove } )
|
||||
@@ -1785,7 +1806,7 @@ end
|
||||
-- @param #RANGE self
|
||||
-- @param Wrapper.Group#GROUP group Group of bombing targets. Can also be given as group name.
|
||||
-- @param #number goodhitrange Max distance from unit which is considered as a good hit.
|
||||
-- @param #boolean randommove If true, unit will move randomly within the range. Default is false.
|
||||
-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false.
|
||||
-- @return #RANGE self
|
||||
function RANGE:AddBombingTargetGroup( group, goodhitrange, randommove )
|
||||
self:F( { group = group, goodhitrange = goodhitrange, randommove = randommove } )
|
||||
|
||||
@@ -394,7 +394,7 @@ end
|
||||
|
||||
--- Set a prefix string that will be displayed at each scoring message sent.
|
||||
-- @param #SCORING self
|
||||
-- @param #string DisplayMessagePrefix (Default="Scoring: ") The scoring prefix string.
|
||||
-- @param #string DisplayMessagePrefix (Optional) (Default="Scoring: ") The scoring prefix string.
|
||||
-- @return #SCORING
|
||||
function SCORING:SetDisplayMessagePrefix( DisplayMessagePrefix )
|
||||
self.DisplayMessagePrefix = DisplayMessagePrefix or ""
|
||||
|
||||
@@ -182,7 +182,7 @@ end
|
||||
|
||||
--- Sets the engagement range of the SAMs. Defaults to 75% to make it more deadly. Feature Request #1355
|
||||
-- @param #SEAD self
|
||||
-- @param #number range Set the engagement range in percent, e.g. 55 (default 75)
|
||||
-- @param #number range (Optional) Set the engagement range in percent, e.g. 55 (default 75)
|
||||
-- @return #SEAD self
|
||||
function SEAD:SetEngagementRange(range)
|
||||
self:T( { range } )
|
||||
@@ -197,7 +197,7 @@ end
|
||||
|
||||
--- Set the padding in seconds, which extends the radar off time calculated by SEAD
|
||||
-- @param #SEAD self
|
||||
-- @param #number Padding Extra number of seconds to add for the switch-on (default 10 seconds)
|
||||
-- @param #number Padding (Optional) Extra number of seconds to add for the switch-on (default 10 seconds)
|
||||
-- @return #SEAD self
|
||||
function SEAD:SetPadding(Padding)
|
||||
self:T( { Padding } )
|
||||
|
||||
@@ -158,15 +158,15 @@ do
|
||||
|
||||
--- Instantiates a new SHORAD object
|
||||
-- @param #SHORAD self
|
||||
-- @param #string Name Name of this SHORAD
|
||||
-- @param #string ShoradPrefix Filter for the Shorad #SET_GROUP
|
||||
-- @param Core.Set#SET_GROUP Samset The #SET_GROUP of SAM sites to defend
|
||||
-- @param #number Radius Defense radius in meters, used to switch on SHORAD groups **within** this radius
|
||||
-- @param #number ActiveTimer Determines how many seconds the systems stay on red alert after wake-up call
|
||||
-- @param #string Name (Optional) Name of this SHORAD. Default "MyShorad"
|
||||
-- @param #string ShoradPrefix (Optional) Filter for the Shorad #SET_GROUP. Default "SAM SHORAD"
|
||||
-- @param Core.Set#SET_GROUP Samset (Optional) The #SET_GROUP of SAM sites to defend. Default is based on default ShoradPrefix and default Coalition.
|
||||
-- @param #number Radius (Optional) Defense radius in meters, used to switch on SHORAD groups **within** this radius. Default is 20000m.
|
||||
-- @param #number ActiveTimer (Optional) Determines how many seconds the systems stay on red alert after wake-up call. Default 600s
|
||||
-- @param #string Coalition Coalition, i.e. "blue", "red", or "neutral"
|
||||
-- @param #boolean UseEmOnOff Use Emissions On/Off rather than Alarm State Red/Green (default: use Emissions switch)
|
||||
-- @param #boolean SmokeDecoy Throw smoke decoy when getting activated. Defaults to false.
|
||||
-- @param #number SmokeDecoyColor SMOLECOLOR to use. Defaults to SMOLECOLOR.White
|
||||
-- @param #boolean SmokeDecoy (Optional) Throw smoke decoy when getting activated. Defaults to false.
|
||||
-- @param #number SmokeDecoyColor (Optional) SMOLECOLOR to use. Defaults to SMOLECOLOR.White
|
||||
-- @return #SHORAD self
|
||||
function SHORAD:New(Name, ShoradPrefix, Samset, Radius, ActiveTimer, Coalition, UseEmOnOff, SmokeDecoy, SmokeDecoyColor)
|
||||
local self = BASE:Inherit( self, FSM:New() )
|
||||
@@ -240,9 +240,9 @@ do
|
||||
--- Add a SET_ZONE of zones for Shoot&Scoot
|
||||
-- @param #SHORAD self
|
||||
-- @param Core.Set#SET_ZONE ZoneSet Set of zones to be used. Units will move around to the next (random) zone between 100m and 3000m away.
|
||||
-- @param #number Number Number of closest zones to be considered, defaults to 3.
|
||||
-- @param #number Number (Optional) Number of closest zones to be considered, defaults to 3.
|
||||
-- @param #boolean Random If true, use a random coordinate inside the next zone to scoot to.
|
||||
-- @param #string Formation Formation to use, defaults to "Cone". See mission editor dropdown for options.
|
||||
-- @param #string Formation (Optional) Formation to use, defaults to "Cone". See mission editor dropdown for options.
|
||||
-- @return #SHORAD self
|
||||
function SHORAD:AddScootZones(ZoneSet, Number, Random, Formation)
|
||||
self:T(self.lid .. " AddScootZones")
|
||||
@@ -795,15 +795,20 @@ do
|
||||
local tgtgrp1 = self.Samset:FindNearestGroupFromPointVec2(tgtcoord)
|
||||
local tgtcoord1 = tgtgrp1:GetCoordinate()
|
||||
local tgtgrp2 = self.Groupset:FindNearestGroupFromPointVec2(tgtcoord)
|
||||
local tgtcoord2 = tgtgrp2:GetCoordinate()
|
||||
local dist1 = tgtcoord:Get2DDistance(tgtcoord1)
|
||||
local dist2 = tgtcoord:Get2DDistance(tgtcoord2)
|
||||
|
||||
if dist1 < dist2 then
|
||||
targetunit = tgtgrp1
|
||||
targetcat = Object.Category.UNIT
|
||||
if tgtgrp2 then
|
||||
local tgtcoord2 = tgtgrp2:GetCoordinate()
|
||||
local dist1 = tgtcoord:Get2DDistance(tgtcoord1)
|
||||
local dist2 = tgtcoord:Get2DDistance(tgtcoord2)
|
||||
|
||||
if dist1 < dist2 then
|
||||
targetunit = tgtgrp1
|
||||
targetcat = Object.Category.UNIT
|
||||
else
|
||||
targetunit = tgtgrp2
|
||||
targetcat = Object.Category.UNIT
|
||||
end
|
||||
else
|
||||
targetunit = tgtgrp2
|
||||
targetunit = tgtgrp1
|
||||
targetcat = Object.Category.UNIT
|
||||
end
|
||||
end
|
||||
|
||||
@@ -251,7 +251,7 @@ STRATEGO.Type = {
|
||||
-- @param #STRATEGO self
|
||||
-- @param #string Name Name of the Adviser.
|
||||
-- @param #number Coalition Coalition, e.g. coalition.side.BLUE.
|
||||
-- @param #number MaxDist Maximum distance of a single route in kilometers, defaults to 150.
|
||||
-- @param #number MaxDist (Optional) Maximum distance of a single route in kilometers, defaults to 150.
|
||||
-- @return #STRATEGO self
|
||||
function STRATEGO:New(Name,Coalition,MaxDist)
|
||||
-- Inherit everything from FSM class.
|
||||
@@ -362,7 +362,7 @@ end
|
||||
--- [USER] Set up usage of budget and set an initial budget in points.
|
||||
-- @param #STRATEGO self
|
||||
-- @param #boolean Usebudget If true, use budget for advisory calculations.
|
||||
-- @param #number StartBudget Initial budget to be used, defaults to 500.
|
||||
-- @param #number StartBudget (Optional) Initial budget to be used, defaults to 500.
|
||||
function STRATEGO:SetUsingBudget(Usebudget,StartBudget)
|
||||
self:T(self.lid.."SetUsingBudget")
|
||||
self.usebudget = Usebudget
|
||||
@@ -394,10 +394,10 @@ end
|
||||
|
||||
--- [USER] Set weights for nodes and routes to determine their importance.
|
||||
-- @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 PortWeight Set what weight a port node has. Defaults to 3.
|
||||
-- @param #number POIWeight Set what weight a POI node has. Defaults to 1.
|
||||
-- @param #number RouteFactor Defines which weight each route between two defined nodes gets: Weight * RouteFactor.
|
||||
-- @param #number MaxRunways (Optional) 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 PortWeight (Optional) Set what weight a port node has. Defaults to 3.
|
||||
-- @param #number POIWeight (Optional) Set what weight a POI node has. Defaults to 1.
|
||||
-- @param #number RouteFactor (Optional) Defines which weight each route between two defined nodes gets: Weight * RouteFactor. Defaults to 5.
|
||||
-- @return #STRATEGO self
|
||||
function STRATEGO:SetWeights(MaxRunways,PortWeight,POIWeight,RouteFactor)
|
||||
self:T(self.lid.."SetWeights")
|
||||
@@ -410,7 +410,7 @@ end
|
||||
|
||||
--- [USER] Set neutral benefit, i.e. how many points it is cheaper to decide for a neutral vs an enemy node when taking decisions.
|
||||
-- @param #STRATEGO self
|
||||
-- @param #number NeutralBenefit Pointsm defaults to 100.
|
||||
-- @param #number NeutralBenefit (Optional) Pointsm defaults to 100.
|
||||
-- @return #STRATEGO self
|
||||
function STRATEGO:SetNeutralBenefit(NeutralBenefit)
|
||||
self:T(self.lid.."SetNeutralBenefit")
|
||||
@@ -420,9 +420,9 @@ end
|
||||
|
||||
--- [USER] Set how many units of which minimum threat level are needed to capture one node (i.e. the underlying OpsZone).
|
||||
-- @param #STRATEGO self
|
||||
-- @param #number CaptureUnits Number of units needed, defaults to three.
|
||||
-- @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}`.
|
||||
-- @param #number CaptureUnits (Optional) Number of units needed, defaults to 3.
|
||||
-- @param #number CaptureThreatlevel (Optional) Threat level needed, can be 0..10, defaults to 1.
|
||||
-- @param #table CaptureCategories (Optional) Table of object categories which can capture a node, defaults to `{Object.Category.UNIT}`.
|
||||
-- @return #STRATEGO self
|
||||
function STRATEGO:SetCaptureOptions(CaptureUnits,CaptureThreatlevel,CaptureCategories)
|
||||
self:T(self.lid.."SetCaptureOptions")
|
||||
|
||||
@@ -308,7 +308,7 @@ SUPPRESSION.version="0.9.4"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--- Creates a new AI_suppression object.
|
||||
--- Creates a new suppression object.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param Wrapper.Group#GROUP group The GROUP object for which suppression should be applied.
|
||||
-- @return #SUPPRESSION self
|
||||
@@ -642,7 +642,7 @@ end
|
||||
|
||||
--- Set average, minimum and maximum time a unit is suppressed each time it gets hit.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #number Tave Average time [seconds] a group will be suppressed. Default is 15 seconds.
|
||||
-- @param #number Tave (Optional) Average time [seconds] a group will be suppressed. Default is 15 seconds.
|
||||
-- @param #number Tmin (Optional) Minimum time [seconds] a group will be suppressed. Default is 5 seconds.
|
||||
-- @param #number Tmax (Optional) Maximum time a group will be suppressed. Default is 25 seconds.
|
||||
function SUPPRESSION:SetSuppressionTime(Tave, Tmin, Tmax)
|
||||
@@ -697,7 +697,7 @@ end
|
||||
|
||||
--- Set the formation a group uses for fall back, hide or retreat.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #string formation Formation of the group. Default "Vee".
|
||||
-- @param #string formation (Optional) Formation of the group. Default "Vee".
|
||||
function SUPPRESSION:SetFormation(formation)
|
||||
self:F(formation)
|
||||
self.Formation=formation or "Vee"
|
||||
@@ -705,7 +705,7 @@ end
|
||||
|
||||
--- Set speed a group moves at for fall back, hide or retreat.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #number speed Speed in km/h of group. Default max speed the group can do.
|
||||
-- @param #number speed (Optional) Speed in km/h of group. Default max speed the group can do.
|
||||
function SUPPRESSION:SetSpeed(speed)
|
||||
self:F(speed)
|
||||
self.Speed=speed or self.SpeedMax
|
||||
@@ -793,7 +793,7 @@ end
|
||||
-- If the group consists of only a singe unit, this referrs to the life of the unit.
|
||||
-- If the group consists of more than one unit, this referrs to the group strength relative to its initial strength.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #number damage Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %.
|
||||
-- @param #number damage (Optional) Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %.
|
||||
function SUPPRESSION:SetRetreatDamage(damage)
|
||||
self:F(damage)
|
||||
self.RetreatDamage=damage or 50
|
||||
@@ -801,7 +801,7 @@ end
|
||||
|
||||
--- Set time a group waits in the retreat zone before it resumes its mission. Default is two hours.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #number time Time in seconds. Default 7200 seconds = 2 hours.
|
||||
-- @param #number time (Optional) Time in seconds. Default 7200 seconds = 2 hours.
|
||||
function SUPPRESSION:SetRetreatWait(time)
|
||||
self:F(time)
|
||||
self.RetreatWait=time or 7200
|
||||
@@ -809,7 +809,7 @@ end
|
||||
|
||||
--- Set alarm state a group will get after it returns from a fall back or take cover.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #string alarmstate Alarm state. Possible "Auto", "Green", "Red". Default is "Auto".
|
||||
-- @param #string alarmstate (Optional) Alarm state. Possible "Auto", "Green", "Red". Default is "Auto".
|
||||
function SUPPRESSION:SetDefaultAlarmState(alarmstate)
|
||||
self:F(alarmstate)
|
||||
if alarmstate:lower()=="auto" then
|
||||
@@ -825,7 +825,7 @@ end
|
||||
|
||||
--- Set Rules of Engagement (ROE) a group will get when it recovers from suppression.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #string roe ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free".
|
||||
-- @param #string roe (Optional) ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free".
|
||||
function SUPPRESSION:SetDefaultROE(roe)
|
||||
self:F(roe)
|
||||
if roe:lower()=="free" then
|
||||
@@ -841,7 +841,7 @@ end
|
||||
|
||||
--- Create an F10 menu entry for the suppressed group. The menu is mainly for Debugging purposes.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #boolean switch Enable=true or disable=false menu group. Default is true.
|
||||
-- @param #boolean switch (Optional) Enable=true or disable=false menu group. Default is true.
|
||||
function SUPPRESSION:MenuOn(switch)
|
||||
self:F(switch)
|
||||
if switch==nil then
|
||||
@@ -909,7 +909,7 @@ function SUPPRESSION:StatusReport(message)
|
||||
self:GetState(), nunits, self.IniGroupStrength, self.CurrentROE, self.CurrentAlarmState, self.Nhit, life_min, life_max, life_ave, life_ave0, ammotot, detectedG, detectedU)
|
||||
|
||||
MESSAGE:New(text, 10):ToAllIf(message or self.Debug)
|
||||
self:I(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1194,7 +1194,7 @@ function SUPPRESSION:onafterFightBack(Controllable, From, Event, To)
|
||||
local Waypoints = group:GetTemplateRoutePoints()
|
||||
|
||||
-- env.info("FF waypoints",showMessageBox)
|
||||
-- self:I(Waypoints)
|
||||
self:T2({Waypoints})
|
||||
|
||||
group:Route(Waypoints, 5)
|
||||
|
||||
@@ -1337,7 +1337,7 @@ function SUPPRESSION:onafterOutOfAmmo(Controllable, From, Event, To)
|
||||
self:_EventFromTo("onafterOutOfAmmo", Event, From, To)
|
||||
|
||||
-- Info to log.
|
||||
self:I(self.lid..string.format("Out of ammo!"))
|
||||
self:T(self.lid..string.format("Out of ammo!"))
|
||||
|
||||
-- Order retreat if retreat zone was specified.
|
||||
if self.RetreatZone then
|
||||
@@ -1485,7 +1485,7 @@ function SUPPRESSION:onafterStop(Controllable, From, Event, To)
|
||||
|
||||
local text=string.format("Stopping SUPPRESSION for group %s", self.Controllable:GetName())
|
||||
MESSAGE:New(text, 10):ToAllIf(self.Debug)
|
||||
self:I(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
|
||||
-- Clear all pending schedules
|
||||
self.CallScheduler:Clear()
|
||||
@@ -1682,9 +1682,9 @@ end
|
||||
--- Make group run/drive to a certain point. We put in several intermediate waypoints because sometimes the group stops before it arrived at the desired point.
|
||||
--@param #SUPPRESSION self
|
||||
--@param Core.Point#COORDINATE fin Coordinate where we want to go.
|
||||
--@param #number speed Speed of group. Default is 20.
|
||||
--@param #string formation Formation of group. Default is "Vee".
|
||||
--@param #number wait Time the group will wait/hold at final waypoint. Default is 30 seconds.
|
||||
--@param #number speed (Optional) Speed of group. Default is 20.
|
||||
--@param #string formation (Optional) Formation of group. Default is "Vee".
|
||||
--@param #number wait (Optional) Time the group will wait/hold at final waypoint. Default is 30 seconds.
|
||||
function SUPPRESSION:_Run(fin, speed, formation, wait)
|
||||
|
||||
speed=speed or 20
|
||||
@@ -1946,7 +1946,7 @@ end
|
||||
|
||||
--- Sets the ROE for the group and updates the current ROE variable.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #string roe ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE.
|
||||
-- @param #string roe (Optional) ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE.
|
||||
function SUPPRESSION:_SetROE(roe)
|
||||
local group=self.Controllable --Wrapper.Controllable#CONTROLLABLE
|
||||
|
||||
@@ -1975,7 +1975,7 @@ end
|
||||
|
||||
--- Sets the alarm state of the group and updates the current alarm state variable.
|
||||
-- @param #SUPPRESSION self
|
||||
-- @param #string state Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState.
|
||||
-- @param #string state (Optional) Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState.
|
||||
function SUPPRESSION:_SetAlarmState(state)
|
||||
local group=self.Controllable --Wrapper.Controllable#CONTROLLABLE
|
||||
|
||||
|
||||
@@ -181,8 +181,8 @@ end
|
||||
|
||||
--- [USER] Set activation radius for Helos and Planes in Nautical Miles.
|
||||
-- @param #TIRESIAS self
|
||||
-- @param #number HeloMiles Radius around a Helicopter in which AI ground units will be activated. Defaults to 10NM.
|
||||
-- @param #number PlaneMiles Radius around an Airplane in which AI ground units will be activated. Defaults to 25NM.
|
||||
-- @param #number HeloMiles (Optional) Radius around a Helicopter in which AI ground units will be activated. Defaults to 10NM.
|
||||
-- @param #number PlaneMiles (Optional) Radius around an Airplane in which AI ground units will be activated. Defaults to 25NM.
|
||||
-- @return #TIRESIAS self
|
||||
function TIRESIAS:SetActivationRanges(HeloMiles, PlaneMiles)
|
||||
self.HeloSwitchRange = HeloMiles or 10
|
||||
@@ -194,8 +194,8 @@ end
|
||||
|
||||
---[USER] Set AAA Ranges - AAA equals non-SAM systems which qualify as AAA in DCS world.
|
||||
-- @param #TIRESIAS self
|
||||
-- @param #number FiringRange The engagement range that AAA units will be set to. Can be 0 to 100 (percent). Defaults to 60.
|
||||
-- @param #boolean SwitchAAA Decide if these system will have their AI switched off, too. Defaults to true.
|
||||
-- @param #number FiringRange (Optional) The engagement range that AAA units will be set to. Can be 0 to 100 (percent). Defaults to 60.
|
||||
-- @param #boolean SwitchAAA (Optional) Decide if these system will have their AI switched off, too. Defaults to true.
|
||||
-- @return #TIRESIAS self
|
||||
function TIRESIAS:SetAAARanges(FiringRange, SwitchAAA)
|
||||
self.AAARange = FiringRange or 60
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **funkyfranky**
|
||||
-- ### Co-author: FlightControl (cargo dispatcher classes)
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -132,14 +131,7 @@
|
||||
-- a reasonable degree in DCS at the moment and hence cannot be used yet.
|
||||
--
|
||||
-- Furthermore, ground assets can be transferred between warehouses by transport units. These are APCs, helicopters and airplanes. The transportation process is modeled
|
||||
-- in a realistic way by using the corresponding cargo dispatcher classes, i.e.
|
||||
--
|
||||
-- * @{AI.AI_Cargo_Dispatcher_APC#AI_DISPATCHER_APC}
|
||||
-- * @{AI.AI_Cargo_Dispatcher_Helicopter#AI_DISPATCHER_HELICOPTER}
|
||||
-- * @{AI.AI_Cargo_Dispatcher_Airplane#AI_DISPATCHER_AIRPLANE}
|
||||
--
|
||||
-- Depending on which cargo dispatcher is used (ground or airbore), similar considerations like in the self propelled case are necessary. Howver, note that
|
||||
-- the dispatchers as of yet cannot use user defined off road paths for example since they are classes of their own and use a different routing logic.
|
||||
-- in a realistic way by using the @{Ops.OpsTransport#OPSTRANSPORT} class.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -230,18 +222,6 @@
|
||||
-- of 630 kg. This is important as groups cannot be split between carrier units when transporting, i.e. the total weight of the whole group must be smaller than the
|
||||
-- cargo bay of the transport carrier.
|
||||
--
|
||||
-- ### Setting the Load Radius
|
||||
-- Boading and loading of cargo into a carrier is modeled in a realistic fashion in the AI\_CARGO\DISPATCHER classes, which are used inernally by the WAREHOUSE class.
|
||||
-- Meaning that troops (cargo) will board, i.e. run or drive to the carrier, and only once they are in close proximity to the transporter they will be loaded (disappear).
|
||||
--
|
||||
-- Unfortunately, there are some situations where problems can occur. For example, in DCS tanks have the strong tentendcy not to drive around obstacles but rather to roll over them.
|
||||
-- I have seen cases where an aircraft of the same coalition as the tank was in its way and the tank drove right through the plane waiting on a parking spot and destroying it.
|
||||
--
|
||||
-- As a workaround it is possible to set a larger load radius so that the cargo units are despawned further away from the carrier via the optional **loadradius** parameter:
|
||||
--
|
||||
-- warehouseBatumi:AddAsset("Leopard 2", nil, nil, nil, nil, 250)
|
||||
--
|
||||
-- Adding the asset like this will cause the units to be loaded into the carrier already at a distance of 250 meters.
|
||||
--
|
||||
-- ### Setting the AI Skill
|
||||
--
|
||||
@@ -486,7 +466,7 @@
|
||||
-- and the road connection is less than 3 km.
|
||||
--
|
||||
-- The user can set the road connection manually with the @{#WAREHOUSE.SetRoadConnection} function. This is only functional for self propelled assets at the moment
|
||||
-- and not if using the AI dispatcher classes since these have a different logic to find the route.
|
||||
-- and not if using the OPSTRANSPORT class since this has a different logic to find the route.
|
||||
--
|
||||
-- ## Off Road Connections
|
||||
--
|
||||
@@ -595,7 +575,7 @@
|
||||
--
|
||||
-- ## Cargo Bay and Weight Limitations
|
||||
--
|
||||
-- The transportation of cargo is handled by the AI\_Dispatcher classes. These take the cargo bay of a carrier and the weight of
|
||||
-- The transportation of cargo is handled by the `OPSTRANSPORT` class. This takes the cargo bay of a carrier and the weight of
|
||||
-- the cargo into account so that a carrier can only load a realistic amount of cargo.
|
||||
--
|
||||
-- However, if troops are supposed to be transported between warehouses, there is one important limitations one has to keep in mind.
|
||||
@@ -1798,12 +1778,13 @@ _WAREHOUSEDB = {
|
||||
|
||||
--- Warehouse class version.
|
||||
-- @field #string version
|
||||
WAREHOUSE.version="1.0.2a"
|
||||
WAREHOUSE.version="2.0.0"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO: Warehouse todo list.
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- DONE: Switch from AI Dispatchers to OPSTRANSPORT
|
||||
-- TODO: Add check if assets "on the move" are stationary. Can happen if ground units get stuck in buildings. If stationary auto complete transport by adding assets to request warehouse? Time?
|
||||
-- TODO: Optimize findpathonroad. Do it only once (first time) and safe paths between warehouses similar to off-road paths.
|
||||
-- NOGO: Spawn assets only virtually, i.e. remove requested assets from stock but do NOT spawn them ==> Interface to A2A dispatcher! Maybe do a negative sign on asset number?
|
||||
@@ -2486,14 +2467,14 @@ function WAREHOUSE:New(warehouse, alias)
|
||||
--- Triggers the FSM event "Save" when the warehouse assets are saved to file on disk.
|
||||
-- @function [parent=#WAREHOUSE] Save
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string path Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
--- Triggers the FSM event "Save" with a delay when the warehouse assets are saved to a file.
|
||||
-- @function [parent=#WAREHOUSE] __Save
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #number delay Delay in seconds.
|
||||
-- @param #string path Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
--- On after "Save" event user function. Called when the warehouse assets are saved to disk.
|
||||
@@ -2502,21 +2483,21 @@ function WAREHOUSE:New(warehouse, alias)
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #string path Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
|
||||
--- Triggers the FSM event "Load" when the warehouse is loaded from a file on disk.
|
||||
-- @function [parent=#WAREHOUSE] Load
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string path Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
--- Triggers the FSM event "Load" with a delay when the warehouse assets are loaded from disk.
|
||||
-- @function [parent=#WAREHOUSE] __Load
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #number delay Delay in seconds.
|
||||
-- @param #string path Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
--- On after "Load" event user function. Called when the warehouse assets are loaded from disk.
|
||||
@@ -2525,7 +2506,7 @@ function WAREHOUSE:New(warehouse, alias)
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #string path Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory.
|
||||
-- @param #string filename (Optional) File name. Default is WAREHOUSE-<UID>_<ALIAS>.txt.
|
||||
|
||||
|
||||
@@ -2595,7 +2576,7 @@ end
|
||||
|
||||
--- Set low fuel threshold. If one unit of an asset has less fuel than this number, the event AssetLowFuel will be fired.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #number threshold Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%).
|
||||
-- @param #number threshold (Optional) Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%).
|
||||
-- @return #WAREHOUSE self
|
||||
function WAREHOUSE:SetLowFuelThreshold(threshold)
|
||||
self.lowfuelthresh=threshold or 0.15
|
||||
@@ -2613,7 +2594,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #WAREHOUSE self
|
||||
function WAREHOUSE:SetVerbosityLevel(VerbosityLevel)
|
||||
self.verbosity=VerbosityLevel or 0
|
||||
@@ -2724,7 +2705,7 @@ end
|
||||
--- Enable auto save of warehouse assets at mission end event.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string path Path where to save the asset data file.
|
||||
-- @param #string filename File name. Default is generated automatically from warehouse id.
|
||||
-- @param #string filename (Optional) File name. Default is generated automatically from warehouse id.
|
||||
-- @return #WAREHOUSE self
|
||||
function WAREHOUSE:SetSaveOnMissionEnd(path, filename)
|
||||
self.autosave=true
|
||||
@@ -3368,7 +3349,7 @@ end
|
||||
-- Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting.
|
||||
-- You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600 sec (one hour).
|
||||
-- @param #number RepairTime (Optional) Time in seconds until the runway is repaired. Default 3600 sec (one hour).
|
||||
-- @return #WAREHOUSE self
|
||||
function WAREHOUSE:SetRunwayRepairtime(RepairTime)
|
||||
self.runwayrepairtime=RepairTime or 3600
|
||||
@@ -3743,12 +3724,15 @@ function WAREHOUSE:_JobDone()
|
||||
|
||||
-- Check conditions for being back home.
|
||||
local ishome=false
|
||||
if category==Group.Category.GROUND or category==Group.Category.HELICOPTER then
|
||||
-- Units go back to the spawn zone, helicopters land and they should not move any more.
|
||||
ishome=inspawnzone and onground and notmoving
|
||||
if category==Group.Category.GROUND then
|
||||
-- Ground units go back to the spawn zone and they should not move any more.
|
||||
ishome=inspawnzone and notmoving
|
||||
elseif category==Group.Category.AIRPLANE then
|
||||
-- Planes need to be on ground at their home airbase and should not move any more.
|
||||
ishome=athomebase and onground and notmoving
|
||||
elseif category==Group.Category.HELICOPTER then
|
||||
-- Helicopters go back to their airbase or spawn zone and should not move any more.
|
||||
ishome=(athomebase or inspawnzone) and onground and notmoving
|
||||
end
|
||||
|
||||
-- Debug text.
|
||||
@@ -3907,7 +3891,7 @@ end
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param Wrapper.Group#GROUP group Group or template group to be added to the warehouse stock.
|
||||
-- @param #number ngroups Number of groups to add to the warehouse stock. Default is 1.
|
||||
-- @param #number ngroups (Optional) Number of groups to add to the warehouse stock. Default is 1.
|
||||
-- @param #WAREHOUSE.Attribute forceattribute (Optional) Explicitly force a generalized attribute for the asset. This has to be an @{#WAREHOUSE.Attribute}.
|
||||
-- @param #number forcecargobay (Optional) Explicitly force cargobay weight limit in kg for cargo carriers. This is for each *unit* of the group.
|
||||
-- @param #number forceweight (Optional) Explicitly force weight in kg of each unit in the group.
|
||||
@@ -4113,7 +4097,7 @@ function WAREHOUSE:_RegisterAsset(group, ngroups, forceattribute, forcecargobay,
|
||||
-- Get name of template group.
|
||||
local templategroupname=group:GetName()
|
||||
local unit = group:GetUnit(1)
|
||||
local Descriptors= (unit and unit:IsAlive()) and unit:GetDesc() or {}
|
||||
local Descriptors= (unit and unit:IsAlive()~=nil) and unit:GetDesc() or {}
|
||||
local Category=group:GetCategory()
|
||||
local TypeName=group:GetTypeName() or "none"
|
||||
local SpeedMax=group:GetSpeedMax()
|
||||
@@ -4131,7 +4115,7 @@ function WAREHOUSE:_RegisterAsset(group, ngroups, forceattribute, forcecargobay,
|
||||
for _i,_unit in pairs(group:GetUnits()) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
local Desc=unit:GetDesc()
|
||||
|
||||
|
||||
-- Weight. We sum up all units in the group.
|
||||
local unitweight=forceweight or Desc.massEmpty
|
||||
if unitweight then
|
||||
@@ -4697,136 +4681,48 @@ function WAREHOUSE:onafterRequestSpawned(From, Event, To, Request, CargoGroupSet
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- Prepare cargo groups for transport
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- TODO: set asset.weight for cargos
|
||||
|
||||
-- Board radius, i.e. when the cargo will begin to board the carrier
|
||||
local _boardradius=500
|
||||
-------------------------
|
||||
-- Create OPSTRANSPORT --
|
||||
-------------------------
|
||||
|
||||
if Request.transporttype==WAREHOUSE.TransportType.AIRPLANE then
|
||||
_boardradius=5000
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.HELICOPTER then
|
||||
--_loadradius=1000
|
||||
--_boardradius=nil
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.APC then
|
||||
--_boardradius=nil
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.SHIP or Request.transporttype==WAREHOUSE.TransportType.AIRCRAFTCARRIER
|
||||
or Request.transporttype==WAREHOUSE.TransportType.ARMEDSHIP or Request.transporttype==WAREHOUSE.TransportType.WARSHIP then
|
||||
_boardradius=6000
|
||||
end
|
||||
|
||||
-- Empty cargo group set.
|
||||
local CargoGroups=SET_CARGO:New()
|
||||
|
||||
-- Add cargo groups to set.
|
||||
for _,_group in pairs(CargoGroupSet:GetSetObjects()) do
|
||||
|
||||
-- Find asset belonging to this group.
|
||||
local asset=self:FindAssetInDB(_group)
|
||||
-- New cargo group object.
|
||||
local cargogroup=CARGO_GROUP:New(_group, _cargotype,_group:GetName(),_boardradius, asset.loadradius)
|
||||
|
||||
-- Set weight for this group.
|
||||
cargogroup:SetWeight(asset.weight)
|
||||
|
||||
-- Add group to group set.
|
||||
CargoGroups:AddCargo(cargogroup)
|
||||
|
||||
end
|
||||
|
||||
------------------------
|
||||
-- Create Dispatchers --
|
||||
------------------------
|
||||
|
||||
-- Cargo dispatcher.
|
||||
local CargoTransport --AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
|
||||
-- OPSTRANSPORT
|
||||
local CargoTransport --Ops.OpsTransport#OPSTRANSPORT
|
||||
|
||||
if Request.transporttype==WAREHOUSE.TransportType.AIRPLANE then
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local PickupAirbaseSet = SET_ZONE:New():AddZone(ZONE_AIRBASE:New(self.airbase:GetName()))
|
||||
local DeployAirbaseSet = SET_ZONE:New():AddZone(ZONE_AIRBASE:New(Request.airbase:GetName()))
|
||||
|
||||
-- Define dispatcher for this task.
|
||||
CargoTransport = AI_CARGO_DISPATCHER_AIRPLANE:New(TransportGroupSet, CargoGroups, PickupAirbaseSet, DeployAirbaseSet)
|
||||
|
||||
-- Set home zone.
|
||||
CargoTransport:SetHomeZone(ZONE_AIRBASE:New(self.airbase:GetName()))
|
||||
CargoTransport = OPSTRANSPORT:New(CargoGroupSet, ZONE_AIRBASE:New(self.airbase:GetName()), ZONE_AIRBASE:New(Request.airbase:GetName()))
|
||||
CargoTransport:SetEmbarkZone(self.spawnzone)
|
||||
CargoTransport:SetDisembarkZone(Request.warehouse.spawnzone)
|
||||
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.HELICOPTER then
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local PickupZoneSet = SET_ZONE:New():AddZone(self.spawnzone)
|
||||
local DeployZoneSet = SET_ZONE:New():AddZone(Request.warehouse.spawnzone)
|
||||
|
||||
-- Define dispatcher for this task.
|
||||
CargoTransport = AI_CARGO_DISPATCHER_HELICOPTER:New(TransportGroupSet, CargoGroups, PickupZoneSet, DeployZoneSet)
|
||||
|
||||
-- Home zone.
|
||||
CargoTransport:SetHomeZone(self.spawnzone)
|
||||
|
||||
CargoTransport = OPSTRANSPORT:New(CargoGroupSet, self.spawnzone, Request.warehouse.spawnzone)
|
||||
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.APC then
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local PickupZoneSet = SET_ZONE:New():AddZone(self.spawnzone)
|
||||
local DeployZoneSet = SET_ZONE:New():AddZone(Request.warehouse.spawnzone)
|
||||
|
||||
-- Define dispatcher for this task.
|
||||
CargoTransport = AI_CARGO_DISPATCHER_APC:New(TransportGroupSet, CargoGroups, PickupZoneSet, DeployZoneSet, 0)
|
||||
|
||||
-- Set home zone.
|
||||
CargoTransport:SetHomeZone(self.spawnzone)
|
||||
CargoTransport = OPSTRANSPORT:New(CargoGroupSet, self.spawnzone, Request.warehouse.spawnzone)
|
||||
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.SHIP or Request.transporttype==WAREHOUSE.TransportType.AIRCRAFTCARRIER
|
||||
or Request.transporttype==WAREHOUSE.TransportType.ARMEDSHIP or Request.transporttype==WAREHOUSE.TransportType.WARSHIP then
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local PickupZoneSet = SET_ZONE:New():AddZone(self.portzone)
|
||||
PickupZoneSet:AddZone(self.harborzone)
|
||||
local DeployZoneSet = SET_ZONE:New():AddZone(Request.warehouse.harborzone)
|
||||
|
||||
or Request.transporttype==WAREHOUSE.TransportType.ARMEDSHIP or Request.transporttype==WAREHOUSE.TransportType.WARSHIP then
|
||||
|
||||
CargoTransport = OPSTRANSPORT:New(CargoGroupSet, self.portzone, Request.warehouse.portzone)
|
||||
CargoTransport:SetEmbarkZone(self.spawnzone)
|
||||
CargoTransport:SetDisembarkZone(Request.warehouse.spawnzone)
|
||||
|
||||
-- Get the shipping lane to use and pass it to the Dispatcher
|
||||
local remotename = Request.warehouse.warehouse:GetName()
|
||||
local ShippingLane = self.shippinglanes[remotename][math.random(#self.shippinglanes[remotename])]
|
||||
|
||||
-- Define dispatcher for this task.
|
||||
CargoTransport = AI_CARGO_DISPATCHER_SHIP:New(TransportGroupSet, CargoGroups, PickupZoneSet, DeployZoneSet, ShippingLane)
|
||||
|
||||
-- Set home zone
|
||||
CargoTransport:SetHomeZone(self.portzone)
|
||||
|
||||
-- TODO: Add shipping lane
|
||||
-- CargoTransport:AddPathTransport(PathGroup)
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Unknown transporttype!")
|
||||
end
|
||||
|
||||
-- Set pickup and deploy radii.
|
||||
-- The 20 m inner radius are to ensure that the helo does not land on the warehouse itself in the middle of the default spawn zone.
|
||||
local pickupouter = 200
|
||||
local pickupinner = 0
|
||||
local deployouter = 200
|
||||
local deployinner = 0
|
||||
if Request.transporttype==WAREHOUSE.TransportType.SHIP or Request.transporttype==WAREHOUSE.TransportType.AIRCRAFTCARRIER
|
||||
or Request.transporttype==WAREHOUSE.TransportType.ARMEDSHIP or Request.transporttype==WAREHOUSE.TransportType.WARSHIP then
|
||||
pickupouter=1000
|
||||
pickupinner=20
|
||||
deployouter=1000
|
||||
deployinner=0
|
||||
else
|
||||
pickupouter=200
|
||||
pickupinner=0
|
||||
if self.spawnzone.Radius~=nil then
|
||||
pickupouter=self.spawnzone.Radius
|
||||
pickupinner=20
|
||||
end
|
||||
deployouter=200
|
||||
deployinner=0
|
||||
if self.spawnzone.Radius~=nil then
|
||||
deployouter=Request.warehouse.spawnzone.Radius
|
||||
deployinner=20
|
||||
end
|
||||
end
|
||||
CargoTransport:SetPickupRadius(pickupouter, pickupinner)
|
||||
CargoTransport:SetDeployRadius(deployouter, deployinner)
|
||||
|
||||
|
||||
-- Adjust carrier units. This has to come AFTER the dispatchers have been defined because they set the cargobay free weight!
|
||||
Request.carriercargo={}
|
||||
@@ -4847,111 +4743,63 @@ function WAREHOUSE:onafterRequestSpawned(From, Event, To, Request, CargoGroupSet
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------
|
||||
-- Dispatcher Event Functions --
|
||||
--------------------------------
|
||||
----------------------------------
|
||||
-- Opstransport Event Functions --
|
||||
----------------------------------
|
||||
|
||||
--- Function called after carrier picked up something.
|
||||
function CargoTransport:OnAfterPickedUp(From, Event, To, Carrier, PickupZone)
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
|
||||
-- Debug message.
|
||||
local text=string.format("Carrier group %s picked up at pickup zone %s.", Carrier:GetName(), PickupZone:GetName())
|
||||
warehouse:T(warehouse.lid..text)
|
||||
|
||||
end
|
||||
|
||||
--- Function called if something was deployed.
|
||||
function CargoTransport:OnAfterDeployed(From, Event, To, Carrier, DeployZone)
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
|
||||
-- Debug message.
|
||||
-- TODO: Depoloy zone is nil!
|
||||
--local text=string.format("Carrier group %s deployed at deploy zone %s.", Carrier:GetName(), DeployZone:GetName())
|
||||
--warehouse:T(warehouse.lid..text)
|
||||
|
||||
end
|
||||
|
||||
--- Function called if carrier group is going home.
|
||||
function CargoTransport:OnAfterHome(From, Event, To, Carrier, Coordinate, Speed, Height, HomeZone)
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
|
||||
-- Debug message.
|
||||
local text=string.format("Carrier group %s going home to zone %s.", Carrier:GetName(), HomeZone:GetName())
|
||||
warehouse:T(warehouse.lid..text)
|
||||
|
||||
end
|
||||
CargoTransport.warehouse = self
|
||||
|
||||
--- Function called when a carrier unit has loaded a cargo group.
|
||||
function CargoTransport:OnAfterLoaded(From, Event, To, Carrier, Cargo, CarrierUnit, PickupZone)
|
||||
function CargoTransport:OnAfterLoaded(From, Event, To, OpsGroupCargo, OpsGroupCarrier, CarrierElement)
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
|
||||
-- Debug message.
|
||||
local text=string.format("Carrier group %s loaded cargo %s into unit %s in pickup zone %s", Carrier:GetName(), Cargo:GetName(), CarrierUnit:GetName(), PickupZone:GetName())
|
||||
warehouse:T(warehouse.lid..text)
|
||||
local warehouse=CargoTransport.warehouse --#WAREHOUSE
|
||||
|
||||
-- Get cargo group object.
|
||||
local group=Cargo:GetObject() --Wrapper.Group#GROUP
|
||||
local group=OpsGroupCargo:GetGroup() --Cargo:GetObject() --Wrapper.Group#GROUP
|
||||
|
||||
-- Get request.
|
||||
local request=warehouse:_GetRequestOfGroup(group, warehouse.pending)
|
||||
|
||||
-- Add cargo group to this carrier.
|
||||
table.insert(request.carriercargo[CarrierUnit:GetName()], warehouse:_GetNameWithOut(Cargo:GetName()))
|
||||
table.insert(request.carriercargo[CarrierElement.name], warehouse:_GetNameWithOut(group:GetName()))
|
||||
|
||||
end
|
||||
|
||||
--- Function called when cargo has arrived and was unloaded.
|
||||
function CargoTransport:OnAfterUnloaded(From, Event, To, Carrier, Cargo, CarrierUnit, DeployZone)
|
||||
function CargoTransport:OnAfterUnloaded(From, Event, To, OpsGroupCargo, OpsGroupCarrier)
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
local warehouse=CargoTransport.warehouse --Carrier:GetState(Carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
|
||||
-- Get group obejet.
|
||||
local group=Cargo:GetObject() --Wrapper.Group#GROUP
|
||||
local group=OpsGroupCargo:GetGroup() --Cargo:GetObject() --Wrapper.Group#GROUP
|
||||
|
||||
-- Debug message.
|
||||
local text=string.format("Cargo group %s was unloaded from carrier unit %s.", tostring(group:GetName()), tostring(CarrierUnit:GetName()))
|
||||
local text=string.format("Cargo group %s was unloaded from carrier group %s.", tostring(group:GetName()), tostring(OpsGroupCarrier:GetName()))
|
||||
warehouse:T(warehouse.lid..text)
|
||||
|
||||
-- Load the cargo in the warehouse.
|
||||
--Cargo:Load(warehouse.warehouse)
|
||||
|
||||
-- Trigger Arrived event.
|
||||
warehouse:Arrived(group)
|
||||
end
|
||||
|
||||
-- TODO: Probably can also add some cargo/carrier dead functions here to simplify things at other places
|
||||
|
||||
--- On after BackHome event.
|
||||
function CargoTransport:OnAfterBackHome(From, Event, To, Carrier)
|
||||
|
||||
-- Intellisense.
|
||||
local carrier=Carrier --Wrapper.Group#GROUP
|
||||
|
||||
-- Get warehouse state.
|
||||
local warehouse=carrier:GetState(carrier, "WAREHOUSE") --#WAREHOUSE
|
||||
carrier:SmokeWhite()
|
||||
|
||||
-- Debug info.
|
||||
local text=string.format("Carrier %s is back home at warehouse %s.", tostring(Carrier:GetName()), tostring(warehouse.warehouse:GetName()))
|
||||
MESSAGE:New(text, 5):ToAllIf(warehouse.Debug)
|
||||
warehouse:I(warehouse.lid..text)
|
||||
|
||||
-- Call arrived event for carrier.
|
||||
warehouse:__Arrived(1, Carrier)
|
||||
|
||||
-- Assign cargo to carriers
|
||||
for _,carriergroup in pairs(TransportGroupSet:GetSetObjects()) do
|
||||
local opsgroup=nil
|
||||
if Request.transporttype==WAREHOUSE.TransportType.AIRPLANE or Request.transporttype==WAREHOUSE.TransportType.HELICOPTER then
|
||||
opsgroup=FLIGHTGROUP:New(carriergroup)
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.APC then
|
||||
opsgroup=ARMYGROUP:New(carriergroup)
|
||||
elseif Request.transporttype==WAREHOUSE.TransportType.SHIP or Request.transporttype==WAREHOUSE.TransportType.AIRCRAFTCARRIER
|
||||
or Request.transporttype==WAREHOUSE.TransportType.ARMEDSHIP or Request.transporttype==WAREHOUSE.TransportType.WARSHIP then
|
||||
opsgroup=NAVYGROUP:New(carriergroup)
|
||||
end
|
||||
opsgroup:AddOpsTransport(CargoTransport)
|
||||
end
|
||||
|
||||
-- Start dispatcher.
|
||||
CargoTransport:__Start(5)
|
||||
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -6378,7 +6226,7 @@ end
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param Wrapper.Group#GROUP Group The train group.
|
||||
-- @param Core.Point#COORDINATE Coordinate of the destination. Tail will be routed to the closest point
|
||||
-- @param #number Speed Speed in km/h to drive to the destination coordinate. Default is 60% of max possible speed the unit can go.
|
||||
-- @param #number Speed (Optional) Speed in km/h to drive to the destination coordinate. Default is 60% of max possible speed the unit can go.
|
||||
function WAREHOUSE:_RouteTrain(Group, Coordinate, Speed)
|
||||
|
||||
if Group and Group:IsAlive() then
|
||||
@@ -8935,7 +8783,7 @@ end
|
||||
--- Info Message. Message send to coalition if reports or debug mode activated (and duration > 0). Text self:I(text) added to DCS.log file.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string text The text of the error message.
|
||||
-- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
function WAREHOUSE:_InfoMessage(text, duration)
|
||||
duration=duration or 20
|
||||
if duration>0 and self.Debug or self.Report then
|
||||
@@ -8948,7 +8796,7 @@ end
|
||||
--- Debug message. Message send to all if debug mode is activated (and duration > 0). Text self:T(text) added to DCS.log file.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string text The text of the error message.
|
||||
-- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
function WAREHOUSE:_DebugMessage(text, duration)
|
||||
duration=duration or 20
|
||||
if self.Debug and duration>0 then
|
||||
@@ -8960,7 +8808,7 @@ end
|
||||
--- Error message. Message send to all (if duration > 0). Text self:E(text) added to DCS.log file.
|
||||
-- @param #WAREHOUSE self
|
||||
-- @param #string text The text of the error message.
|
||||
-- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.
|
||||
function WAREHOUSE:_ErrorMessage(text, duration)
|
||||
duration=duration or 20
|
||||
if duration>0 then
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
do -- ZONE_CAPTURE_COALITION
|
||||
|
||||
-- @type ZONE_CAPTURE_COALITION
|
||||
--- @type ZONE_CAPTURE_COALITION
|
||||
-- @field #string ClassName Name of the class.
|
||||
-- @field #number MarkBlue ID of blue F10 mark.
|
||||
-- @field #number MarkRed ID of red F10 mark.
|
||||
@@ -220,36 +220,6 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- A capture zone has been setup that guards the presence of the troops.
|
||||
-- Troops are guarded by red forces. Blue is required to destroy the red forces and capture the zones.
|
||||
--
|
||||
-- At first, we setup the Command Centers
|
||||
--
|
||||
-- do
|
||||
--
|
||||
-- RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" )
|
||||
-- US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" )
|
||||
--
|
||||
-- end
|
||||
--
|
||||
-- Next, we define the mission, and add some scoring to it.
|
||||
--
|
||||
-- do -- Missions
|
||||
--
|
||||
-- US_Mission_EchoBay = MISSION:New( US_CC, "Echo Bay", "Primary",
|
||||
-- "Welcome trainee. The airport Groom Lake in Echo Bay needs to be captured.\n" ..
|
||||
-- "There are five random capture zones located at the airbase.\n" ..
|
||||
-- "Move to one of the capture zones, destroy the fuel tanks in the capture zone, " ..
|
||||
-- "and occupy each capture zone with a platoon.\n " ..
|
||||
-- "Your orders are to hold position until all capture zones are taken.\n" ..
|
||||
-- "Use the map (F10) for a clear indication of the location of each capture zone.\n" ..
|
||||
-- "Note that heavy resistance can be expected at the airbase!\n" ..
|
||||
-- "Mission 'Echo Bay' is complete when all five capture zones are taken, and held for at least 5 minutes!"
|
||||
-- , coalition.side.RED )
|
||||
--
|
||||
-- US_Mission_EchoBay:Start()
|
||||
--
|
||||
-- end
|
||||
--
|
||||
--
|
||||
-- Now the real work starts.
|
||||
-- We define a **CaptureZone** object, which is a ZONE object.
|
||||
-- Within the mission, a trigger zone is created with the name __CaptureZone__, with the defined radius within the mission editor.
|
||||
--
|
||||
@@ -280,12 +250,12 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- self:E( { Coalition = Coalition } )
|
||||
-- if Coalition == coalition.side.BLUE then
|
||||
-- ZoneCaptureCoalition:Smoke( SMOKECOLOR.Blue )
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- MESSAGE:New(string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- else
|
||||
-- ZoneCaptureCoalition:Smoke( SMOKECOLOR.Red )
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- MESSAGE:New(string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
@@ -297,8 +267,8 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- -- @param Functional.Protect#ZONE_CAPTURE_COALITION self
|
||||
-- function ZoneCaptureCoalition:OnEnterEmpty()
|
||||
-- self:Smoke( SMOKECOLOR.Green )
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- MESSAGE:New(string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- end
|
||||
--
|
||||
-- The next Event Handlers speak for itself.
|
||||
@@ -310,11 +280,11 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- local Coalition = self:GetCoalition()
|
||||
-- self:E({Coalition = Coalition})
|
||||
-- if Coalition == coalition.side.BLUE then
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- MESSAGE:New(string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- else
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- MESSAGE:New(string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
@@ -326,12 +296,12 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- local Coalition = self:GetCoalition()
|
||||
-- self:E({Coalition = Coalition})
|
||||
-- if Coalition == coalition.side.BLUE then
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- MESSAGE:New(string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- MESSAGE:New(string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- else
|
||||
-- US_CC:MessageTypeToCoalition( string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- RU_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information )
|
||||
-- end
|
||||
-- MESSAGE:New(string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.BLUE)
|
||||
-- MESSAGE:New(string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ),15,MESSAGE.Type.Information):ToCoalition(coalition.side.RED)
|
||||
-- end
|
||||
--
|
||||
-- self:__Guard( 30 )
|
||||
-- end
|
||||
@@ -365,8 +335,8 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- @param #ZONE_CAPTURE_COALITION self
|
||||
-- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{Core.Zone#ZONE_POLYGON} with its waypoints.
|
||||
-- @param #number Coalition The initial coalition owning the zone.
|
||||
-- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS.
|
||||
-- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @param #table ObjectCategories (Optional) Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS.
|
||||
-- @return #ZONE_CAPTURE_COALITION
|
||||
-- @usage
|
||||
--
|
||||
|
||||
@@ -1,458 +0,0 @@
|
||||
--- **Functional** - Base class that models processes to achieve goals involving a Zone and Cargo.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ZONE_GOAL_CARGO models processes that have a Goal with a defined achievement involving a Zone and Cargo.
|
||||
-- Derived classes implement the ways how the achievements can be realized.
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **FlightControl**
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Functional.ZoneGoalCargo
|
||||
-- @image MOOSE.JPG
|
||||
|
||||
do -- ZoneGoal
|
||||
|
||||
-- @type ZONE_GOAL_CARGO
|
||||
-- @extends Functional.ZoneGoal#ZONE_GOAL
|
||||
|
||||
|
||||
--- Models processes that have a Goal with a defined achievement involving a Zone and Cargo.
|
||||
-- Derived classes implement the ways how the achievements can be realized.
|
||||
--
|
||||
-- ## 1. ZONE_GOAL_CARGO constructor
|
||||
--
|
||||
-- * @{#ZONE_GOAL_CARGO.New}(): Creates a new ZONE_GOAL_CARGO object.
|
||||
--
|
||||
-- ## 2. ZONE_GOAL_CARGO is a finite state machine (FSM).
|
||||
--
|
||||
-- ### 2.1 ZONE_GOAL_CARGO States
|
||||
--
|
||||
-- * **Deployed**: The Zone has been captured by an other coalition.
|
||||
-- * **Airborne**: The Zone is currently intruded by an other coalition. There are units of the owning coalition and an other coalition in the Zone.
|
||||
-- * **Loaded**: The Zone is guarded by the owning coalition. There is no other unit of an other coalition in the Zone.
|
||||
-- * **Empty**: The Zone is empty. There is not valid unit in the Zone.
|
||||
--
|
||||
-- ### 2.2 ZONE_GOAL_CARGO Events
|
||||
--
|
||||
-- * **Capture**: The Zone has been captured by an other coalition.
|
||||
-- * **Attack**: The Zone is currently intruded by an other coalition. There are units of the owning coalition and an other coalition in the Zone.
|
||||
-- * **Guard**: The Zone is guarded by the owning coalition. There is no other unit of an other coalition in the Zone.
|
||||
-- * **Empty**: The Zone is empty. There is not valid unit in the Zone.
|
||||
--
|
||||
-- ### 2.3 ZONE_GOAL_CARGO State Machine
|
||||
--
|
||||
-- @field #ZONE_GOAL_CARGO
|
||||
ZONE_GOAL_CARGO = {
|
||||
ClassName = "ZONE_GOAL_CARGO",
|
||||
}
|
||||
|
||||
-- @field #table ZONE_GOAL_CARGO.States
|
||||
ZONE_GOAL_CARGO.States = {}
|
||||
|
||||
--- ZONE_GOAL_CARGO Constructor.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved.
|
||||
-- @param #number Coalition The initial coalition owning the zone.
|
||||
-- @return #ZONE_GOAL_CARGO
|
||||
function ZONE_GOAL_CARGO:New( Zone, Coalition )
|
||||
|
||||
local self = BASE:Inherit( self, ZONE_GOAL:New( Zone ) ) -- #ZONE_GOAL_CARGO
|
||||
self:F( { Zone = Zone, Coalition = Coalition } )
|
||||
|
||||
self:SetCoalition( Coalition )
|
||||
|
||||
do
|
||||
|
||||
--- Captured State Handler OnLeave for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnLeaveCaptured
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Captured State Handler OnEnter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnEnterCaptured
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
end
|
||||
|
||||
|
||||
do
|
||||
|
||||
--- Attacked State Handler OnLeave for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnLeaveAttacked
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Attacked State Handler OnEnter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnEnterAttacked
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
end
|
||||
|
||||
do
|
||||
|
||||
--- Guarded State Handler OnLeave for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnLeaveGuarded
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Guarded State Handler OnEnter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnEnterGuarded
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
end
|
||||
|
||||
|
||||
do
|
||||
|
||||
--- Empty State Handler OnLeave for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnLeaveEmpty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Empty State Handler OnEnter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnEnterEmpty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
end
|
||||
|
||||
self:AddTransition( "*", "Guard", "Guarded" )
|
||||
|
||||
--- Guard Handler OnBefore for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnBeforeGuard
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Guard Handler OnAfter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnAfterGuard
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
--- Guard Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] Guard
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
|
||||
--- Guard Asynchronous Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] __Guard
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #number Delay
|
||||
|
||||
self:AddTransition( "*", "Empty", "Empty" )
|
||||
|
||||
--- Empty Handler OnBefore for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnBeforeEmpty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Empty Handler OnAfter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnAfterEmpty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
--- Empty Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] Empty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
|
||||
--- Empty Asynchronous Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] __Empty
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #number Delay
|
||||
|
||||
|
||||
self:AddTransition( { "Guarded", "Empty" }, "Attack", "Attacked" )
|
||||
|
||||
--- Attack Handler OnBefore for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnBeforeAttack
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Attack Handler OnAfter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnAfterAttack
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
--- Attack Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] Attack
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
|
||||
--- Attack Asynchronous Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] __Attack
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #number Delay
|
||||
|
||||
self:AddTransition( { "Guarded", "Attacked", "Empty" }, "Capture", "Captured" )
|
||||
|
||||
--- Capture Handler OnBefore for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnBeforeCapture
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #boolean
|
||||
|
||||
--- Capture Handler OnAfter for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] OnAfterCapture
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
|
||||
--- Capture Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] Capture
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
|
||||
--- Capture Asynchronous Trigger for ZONE_GOAL_CARGO
|
||||
-- @function [parent=#ZONE_GOAL_CARGO] __Capture
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #number Delay
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Set the owning coalition of the zone.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @param #number Coalition
|
||||
function ZONE_GOAL_CARGO:SetCoalition( Coalition )
|
||||
self.Coalition = Coalition
|
||||
end
|
||||
|
||||
|
||||
--- Get the owning coalition of the zone.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @return #number Coalition.
|
||||
function ZONE_GOAL_CARGO:GetCoalition()
|
||||
return self.Coalition
|
||||
end
|
||||
|
||||
|
||||
--- Get the owning coalition name of the zone.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
-- @return #string Coalition name.
|
||||
function ZONE_GOAL_CARGO:GetCoalitionName()
|
||||
|
||||
if self.Coalition == coalition.side.BLUE then
|
||||
return "Blue"
|
||||
end
|
||||
|
||||
if self.Coalition == coalition.side.RED then
|
||||
return "Red"
|
||||
end
|
||||
|
||||
if self.Coalition == coalition.side.NEUTRAL then
|
||||
return "Neutral"
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsGuarded()
|
||||
|
||||
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
||||
self:F( { IsGuarded = IsGuarded } )
|
||||
return IsGuarded
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsEmpty()
|
||||
|
||||
local IsEmpty = self.Zone:IsNoneInZone()
|
||||
self:F( { IsEmpty = IsEmpty } )
|
||||
return IsEmpty
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Mark.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
function ZONE_GOAL_CARGO:Mark()
|
||||
|
||||
local Coord = self.Zone:GetCoordinate()
|
||||
local ZoneName = self:GetZoneName()
|
||||
local State = self:GetState()
|
||||
|
||||
if self.MarkRed and self.MarkBlue then
|
||||
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
Coord:RemoveMark( self.MarkRed )
|
||||
Coord:RemoveMark( self.MarkBlue )
|
||||
end
|
||||
|
||||
if self.Coalition == coalition.side.BLUE then
|
||||
self.MarkBlue = Coord:MarkToCoalitionBlue( "Guard Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||
self.MarkRed = Coord:MarkToCoalitionRed( "Capture Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||
else
|
||||
self.MarkRed = Coord:MarkToCoalitionRed( "Guard Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||
self.MarkBlue = Coord:MarkToCoalitionBlue( "Capture Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||
end
|
||||
end
|
||||
|
||||
--- Bound.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
function ZONE_GOAL_CARGO:onenterGuarded()
|
||||
|
||||
--self:GetParent( self ):onenterGuarded()
|
||||
|
||||
if self.Coalition == coalition.side.BLUE then
|
||||
--elf.ProtectZone:BoundZone( 12, country.id.USA )
|
||||
else
|
||||
--self.ProtectZone:BoundZone( 12, country.id.RUSSIA )
|
||||
end
|
||||
|
||||
self:Mark()
|
||||
|
||||
end
|
||||
|
||||
function ZONE_GOAL_CARGO:onenterCaptured()
|
||||
|
||||
--self:GetParent( self ):onenterCaptured()
|
||||
|
||||
local NewCoalition = self.Zone:GetCoalition()
|
||||
self:F( { NewCoalition = NewCoalition } )
|
||||
self:SetCoalition( NewCoalition )
|
||||
|
||||
self:Mark()
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:onenterEmpty()
|
||||
|
||||
--self:GetParent( self ):onenterEmpty()
|
||||
|
||||
self:Mark()
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:onenterAttacked()
|
||||
|
||||
--self:GetParent( self ):onenterAttacked()
|
||||
|
||||
self:Mark()
|
||||
end
|
||||
|
||||
|
||||
--- When started, check the Coalition status.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
function ZONE_GOAL_CARGO:onafterGuard()
|
||||
|
||||
--self:F({BASE:GetParent( self )})
|
||||
--BASE:GetParent( self ).onafterGuard( self )
|
||||
|
||||
if not self.SmokeScheduler then
|
||||
self.SmokeScheduler = self:ScheduleRepeat( 1, 1, 0.1, nil, self.StatusSmoke, self )
|
||||
end
|
||||
if not self.ScheduleStatusZone then
|
||||
self.ScheduleStatusZone = self:ScheduleRepeat( 15, 15, 0.1, nil, self.StatusZone, self )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
|
||||
function ZONE_GOAL_CARGO:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
--- Check status Coalition ownership.
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
function ZONE_GOAL_CARGO:StatusZone()
|
||||
|
||||
local State = self:GetState()
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self.Zone:Scan()
|
||||
|
||||
if State ~= "Guarded" and self:IsGuarded() then
|
||||
self:Guard()
|
||||
end
|
||||
|
||||
if State ~= "Empty" and self:IsEmpty() then
|
||||
self:Empty()
|
||||
end
|
||||
|
||||
if State ~= "Attacked" and self:IsAttacked() then
|
||||
self:Attack()
|
||||
end
|
||||
|
||||
if State ~= "Captured" and self:IsCaptured() then
|
||||
self:Capture()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -54,8 +54,8 @@ do -- ZoneGoal
|
||||
--- ZONE_GOAL_COALITION Constructor.
|
||||
-- @param #ZONE_GOAL_COALITION self
|
||||
-- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved.
|
||||
-- @param #number Coalition The initial coalition owning the zone. Default coalition.side.NEUTRAL.
|
||||
-- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @param #number Coalition (Optional) The initial coalition owning the zone. Default coalition.side.NEUTRAL.
|
||||
-- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @return #ZONE_GOAL_COALITION
|
||||
function ZONE_GOAL_COALITION:New( Zone, Coalition, UnitCategories )
|
||||
|
||||
@@ -90,7 +90,7 @@ do -- ZoneGoal
|
||||
|
||||
--- Set the owning coalition of the zone.
|
||||
-- @param #ZONE_GOAL_COALITION self
|
||||
-- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
|
||||
-- @return #ZONE_GOAL_COALITION
|
||||
function ZONE_GOAL_COALITION:SetUnitCategories( UnitCategories )
|
||||
|
||||
@@ -105,7 +105,7 @@ do -- ZoneGoal
|
||||
|
||||
--- Set the owning coalition of the zone.
|
||||
-- @param #ZONE_GOAL_COALITION self
|
||||
-- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS.
|
||||
-- @param #table ObjectCategories (Optional) Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS.
|
||||
-- @return #ZONE_GOAL_COALITION
|
||||
function ZONE_GOAL_COALITION:SetObjectCategories( ObjectCategories )
|
||||
|
||||
|
||||
@@ -13,9 +13,6 @@ _DATABASE = DATABASE:New() -- Core.Database#DATABASE
|
||||
_SETTINGS = SETTINGS:Set() -- Core.Settings#SETTINGS
|
||||
_SETTINGS:SetPlayerMenuOn()
|
||||
|
||||
--- Register cargos.
|
||||
_DATABASE:_RegisterCargos()
|
||||
|
||||
--- Register zones.
|
||||
_DATABASE:_RegisterZones()
|
||||
_DATABASE:_RegisterAirbases()
|
||||
|
||||
@@ -50,11 +50,6 @@ __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/DynamicCargo.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/CargoSlingload.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/CargoCrate.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Cargo/CargoGroup.lua' )
|
||||
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Scoring.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/CleanUp.lua' )
|
||||
@@ -80,7 +75,6 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Shorad.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/AICSAR.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/AmmoTruck.lua' )
|
||||
__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/Tiresias.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/Stratego.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Functional/ClientWatch.lua')
|
||||
@@ -91,6 +85,9 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RecoveryTanker.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RescueHelo.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/ATIS.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_CARGO.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_Localization.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_Hercules.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CSAR.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/AirWing.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/ArmyGroup.lua' )
|
||||
@@ -118,6 +115,7 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/Squadron.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/Target.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/EasyGCICAP.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/EasyA2G.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/TARS.lua' )
|
||||
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/ShapeBase.lua' )
|
||||
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Shapes/Circle.lua' )
|
||||
|
||||
@@ -242,7 +242,7 @@ end
|
||||
--- Find closest beacons to a given coordinate.
|
||||
-- @param #BEACONS self
|
||||
-- @param Core.Point#COORDINATE Coordinate The reference coordinate.
|
||||
-- @param #number Nmax Max number of beacons. Default 5.
|
||||
-- @param #number Nmax (Optional) Max number of beacons. Default 5.
|
||||
-- @param #number TypeID (Optional) Only search for specific beacon types, *e.g.* `BEACON.Type.TACAN`.
|
||||
-- @param #number DistMax (Optional) Max search distance in meters.
|
||||
-- @return #table Table of #BEACONS.Beacon closest beacons.
|
||||
|
||||
@@ -115,7 +115,7 @@ NAVFIX.version="0.1.0"
|
||||
--- Create a new NAVFIX class instance from a given VECTOR.
|
||||
-- @param #NAVFIX self
|
||||
-- @param #string Name Name/ident of the point. Should be unique!
|
||||
-- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param Core.Vector#VECTOR Vector Position vector of the navpoint.
|
||||
-- @return #NAVFIX self
|
||||
function NAVFIX:NewFromVector(Name, Type, Vector)
|
||||
@@ -150,7 +150,7 @@ end
|
||||
--- Create a new NAVFIX class instance from a given COORDINATE.
|
||||
-- @param #NAVFIX self
|
||||
-- @param #string Name Name of the fix. Should be unique!
|
||||
-- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the point.
|
||||
-- @return #NAVFIX self
|
||||
function NAVFIX:NewFromCoordinate(Name, Type, Coordinate)
|
||||
@@ -168,7 +168,7 @@ end
|
||||
--- Create a new NAVFIX instance from given latitude and longitude in degrees, minutes and seconds (DMS).
|
||||
-- @param #NAVFIX self
|
||||
-- @param #string Name Name of the fix. Should be unique!
|
||||
-- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Latitude Latitude in DMS as string.
|
||||
-- @param #string Longitude Longitude in DMS as string.
|
||||
-- @return #NAVFIX self
|
||||
@@ -186,7 +186,7 @@ end
|
||||
--- Create a new NAVFIX instance from given latitude and longitude in decimal degrees (DD).
|
||||
-- @param #NAVFIX self
|
||||
-- @param #string Name Name of the fix. Should be unique!
|
||||
-- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #number Latitude Latitude in DD.
|
||||
-- @param #number Longitude Longitude in DD.
|
||||
-- @return #NAVFIX self
|
||||
@@ -523,7 +523,7 @@ NAVAID.version="0.1.0"
|
||||
--- Create a new NAVAID class instance.
|
||||
-- @param #NAVAID self
|
||||
-- @param #string Name Name/ident of this navaid.
|
||||
-- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`.
|
||||
-- @param #string ZoneName Name of the zone to scan the scenery.
|
||||
-- @param #string SceneryName Name of the scenery object.
|
||||
-- @return #NAVAID self
|
||||
@@ -579,7 +579,7 @@ end
|
||||
--- Set channel of, *e.g.*, TACAN beacons.
|
||||
-- @param #NAVAID self
|
||||
-- @param #number Channel The channel.
|
||||
-- @param #string Band The band either `"X"` (default) or `"Y"`.
|
||||
-- @param #string Band (Optional) The band either `"X"` (default) or `"Y"`.
|
||||
-- @return #NAVAID self
|
||||
function NAVAID:SetChannel(Channel, Band)
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ end
|
||||
--- Find closest radios to a given coordinate.
|
||||
-- @param #RADIOS self
|
||||
-- @param Core.Point#COORDINATE Coordinate The reference coordinate.
|
||||
-- @param #number Nmax Max number of radios. Default 5.
|
||||
-- @param #number Nmax (Optional) Max number of radios. Default 5.
|
||||
-- @param #number DistMax (Optional) Max search distance in meters.
|
||||
-- @return #table Table of #RADIOS.Radio closest radios.
|
||||
function RADIOS:GetClosestRadios(Coordinate, Nmax, DistMax)
|
||||
|
||||
@@ -240,7 +240,7 @@ end
|
||||
--- Find closest towns to a given coordinate.
|
||||
-- @param #TOWNS self
|
||||
-- @param Core.Point#COORDINATE Coordinate The reference coordinate.
|
||||
-- @param #number Nmax Max number of towns. Default 5.
|
||||
-- @param #number Nmax (Optional) Max number of towns. Default 5.
|
||||
-- @param #number DistMax (Optional) Max search distance in meters.
|
||||
-- @return #table Table of #TOWNS.Town closest towns.
|
||||
function TOWNS:GetClosestTowns(Coordinate, Nmax, DistMax)
|
||||
|
||||
@@ -1003,8 +1003,8 @@ ATIS.version = "1.0.1"
|
||||
--- Create a new ATIS class object for a specific airbase.
|
||||
-- @param #ATIS self
|
||||
-- @param #string AirbaseName Name of the airbase.
|
||||
-- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. When using **SRS** this can be passed as a table of multiple frequencies.
|
||||
-- @param #number Modulation Radio modulation: 0=AM, 1=FM. Default 0=AM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. When using **SRS** this can be passed as a table of multiple modulations.
|
||||
-- @param #number Frequency (Optional) Radio frequency in MHz. Default 143.00 MHz. When using **SRS** this can be passed as a table of multiple frequencies.
|
||||
-- @param #number Modulation (Optional) Radio modulation: 0=AM, 1=FM. Default 0=AM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. When using **SRS** this can be passed as a table of multiple modulations.
|
||||
-- @return #ATIS self
|
||||
function ATIS:New(AirbaseName, Frequency, Modulation)
|
||||
|
||||
@@ -1161,9 +1161,9 @@ end
|
||||
|
||||
--- Set sound files folder within miz file (not your local hard drive!).
|
||||
-- @param #ATIS self
|
||||
-- @param #string pathMain Path to folder containing main sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @param #string pathAirports Path folder containing the airport names sound files. Default is `"ATIS Soundfiles/<Map Name>"`, *e.g.* `"ATIS Soundfiles/Caucasus/"`.
|
||||
-- @param #string pathNato Path folder containing the NATO alphabet sound files. Default is "ATIS Soundfiles/NATO Alphabet/".
|
||||
-- @param #string pathMain (Optional) Path to folder containing main sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @param #string pathAirports (Optional) Path folder containing the airport names sound files. Default is `"ATIS Soundfiles/<Map Name>"`, *e.g.* `"ATIS Soundfiles/Caucasus/"`.
|
||||
-- @param #string pathNato (Optional) Path folder containing the NATO alphabet sound files. Default is "ATIS Soundfiles/NATO Alphabet/".
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetSoundfilesPath( pathMain, pathAirports, pathNato )
|
||||
self.soundpath = tostring( pathMain or "ATIS Soundfiles/" )
|
||||
@@ -1283,8 +1283,8 @@ end
|
||||
|
||||
--- Set the active runway for landing.
|
||||
-- @param #ATIS self
|
||||
-- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||
-- @param #string runway (Optional) Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean preferleft (Optional) If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetActiveRunwayLanding(runway, preferleft)
|
||||
self.airbase:SetActiveRunwayLanding(runway,preferleft)
|
||||
@@ -1294,7 +1294,7 @@ end
|
||||
--- Set the active runway for take-off.
|
||||
-- @param #ATIS self
|
||||
-- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||
-- @param #boolean preferleft (Optional) If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetActiveRunwayTakeoff(runway,preferleft)
|
||||
self.airbase:SetActiveRunwayTakeoff(runway,preferleft)
|
||||
@@ -1328,7 +1328,7 @@ end
|
||||
|
||||
--- Set radio power. Note that this only applies if no relay unit is used.
|
||||
-- @param #ATIS self
|
||||
-- @param #number power Radio power in Watts. Default 100 W.
|
||||
-- @param #number power (Optional) Radio power in Watts. Default 100 W.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetRadioPower( power )
|
||||
self.power = power or 100
|
||||
@@ -1337,7 +1337,7 @@ end
|
||||
|
||||
--- Use F10 map mark points.
|
||||
-- @param #ATIS self
|
||||
-- @param #boolean switch If *true* or *nil*, marks are placed on F10 map. If *false* this feature is set to off (default).
|
||||
-- @param #boolean switch (Optional) If *true* or *nil*, marks are placed on F10 map. If *false* this feature is set to off (default).
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetMapMarks( switch )
|
||||
if switch == nil or switch == true then
|
||||
@@ -1406,7 +1406,7 @@ end
|
||||
|
||||
--- Set duration how long subtitles are displayed.
|
||||
-- @param #ATIS self
|
||||
-- @param #number duration Duration in seconds. Default 10 seconds.
|
||||
-- @param #number duration (Optional) Duration in seconds. Default 10 seconds.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetSubtitleDuration( duration )
|
||||
self.subduration = tonumber( duration or 10 )
|
||||
@@ -1449,7 +1449,7 @@ end
|
||||
--- Set relative humidity. This is used to approximately calculate the dew point.
|
||||
-- Note that the dew point is only an artificial information as DCS does not have an atmospheric model that includes humidity (yet).
|
||||
-- @param #ATIS self
|
||||
-- @param #number Humidity Relative Humidity, i.e. a number between 0 and 100 %. Default is 50 %.
|
||||
-- @param #number Humidity (Optional) Relative Humidity, i.e. a number between 0 and 100 %. Default is 50 %.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetRelativeHumidity( Humidity )
|
||||
self.relHumidity = Humidity or 50
|
||||
@@ -1524,7 +1524,7 @@ end
|
||||
-- Or you make your life simple and just include the sign so you don't have to bother about East/West.
|
||||
--
|
||||
-- @param #ATIS self
|
||||
-- @param #number magvar Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.Utils#UTILS.GetMagneticDeclination}.
|
||||
-- @param #number magvar (Optional) Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.Utils#UTILS.GetMagneticDeclination}.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetMagneticDeclination( magvar )
|
||||
self.magvar = magvar or UTILS.GetMagneticDeclination()
|
||||
@@ -1654,7 +1654,7 @@ end
|
||||
|
||||
--- Place marks with runway data on the F10 map.
|
||||
-- @param #ATIS self
|
||||
-- @param #boolean markall If true, mark all runways of the map. By default only the current ATIS runways are marked.
|
||||
-- @param #boolean markall (Optional) If true, mark all runways of the map. By default only the current ATIS runways are marked.
|
||||
function ATIS:MarkRunways( markall )
|
||||
local airbases = AIRBASE.GetAllAirbases()
|
||||
for _, _airbase in pairs( airbases ) do
|
||||
@@ -1667,14 +1667,16 @@ end
|
||||
|
||||
--- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary.`SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible.
|
||||
-- @param #ATIS self
|
||||
-- @param #string PathToSRS Path to SRS directory (only necessary if SRS exe backend is used).
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port SRS port. Default 5002.
|
||||
-- @param #string GoogleKey Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend).
|
||||
-- @param #string PathToSRS (Optional) Path to SRS directory (only necessary if SRS exe backend is used).
|
||||
-- @param #string Gender (Optional) Gender: "male" or "female" (default).
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice (Optional) Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port (Optional) SRS port. Default 5002.
|
||||
-- @param #string GoogleKey (Optional) Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend).
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey,Provider,Speaker)
|
||||
--if PathToSRS or MSRS.path then
|
||||
self.useSRS=true
|
||||
|
||||
@@ -1700,6 +1702,12 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
||||
end
|
||||
self.msrs:SetVoice(voice)
|
||||
self.msrs:SetCoordinate(self.airbase:GetCoordinate())
|
||||
if Provider then
|
||||
self.msrs:SetProvider(Provider)
|
||||
end
|
||||
if Speaker then
|
||||
self.msrs:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.msrsQ = MSRSQUEUE:New("ATIS")
|
||||
self.msrsQ:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
||||
if self.dTQueueCheck<=10 then
|
||||
@@ -1727,7 +1735,7 @@ end
|
||||
|
||||
--- Set the time interval between radio queue updates.
|
||||
-- @param #ATIS self
|
||||
-- @param #number TimeInterval Interval in seconds. Default 5 sec.
|
||||
-- @param #number TimeInterval (Optional) Interval in seconds. Default 5 sec.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetQueueUpdateTime( TimeInterval )
|
||||
self.dTQueueCheck = TimeInterval or 5
|
||||
@@ -3195,7 +3203,7 @@ end
|
||||
|
||||
--- Get active runway runway.
|
||||
-- @param #ATIS self
|
||||
-- @param #boolean Takeoff If `true`, get runway for takeoff. Default is for landing.
|
||||
-- @param #boolean Takeoff (Optional) If `true`, get runway for takeoff. Default is for landing.
|
||||
-- @return #string Active runway, e.g. "31" for 310 deg.
|
||||
-- @return #boolean Use Left=true, Right=false, or nil.
|
||||
function ATIS:GetActiveRunway(Takeoff)
|
||||
@@ -3305,7 +3313,7 @@ end
|
||||
-- @param #ATIS.Soundfile sound ATIS sound object.
|
||||
-- @param #number interval Interval in seconds after the last transmission finished.
|
||||
-- @param #string subtitle Subtitle of the transmission.
|
||||
-- @param #string path Path to sound file. Default `self.soundpath`.
|
||||
-- @param #string path (Optional) Path to sound file. Default `self.soundpath`.
|
||||
function ATIS:Transmission( sound, interval, subtitle, path )
|
||||
self.radioqueue:NewTransmission( sound.filename, sound.duration, path or self.soundpath, nil, interval, subtitle, self.subduration )
|
||||
end
|
||||
|
||||
@@ -369,9 +369,9 @@ end
|
||||
--- Add a **new** payload to the airwing resources.
|
||||
-- @param #AIRWING self
|
||||
-- @param Wrapper.Unit#UNIT Unit The unit, the payload is extracted from. Can also be given as *#string* name of the unit.
|
||||
-- @param #number Npayloads Number of payloads to add to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.
|
||||
-- @param #number Npayloads (Optional) Number of payloads to add to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.
|
||||
-- @param #table MissionTypes Mission types this payload can be used for.
|
||||
-- @param #number Performance A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.
|
||||
-- @param #number Performance (Optional) A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.
|
||||
-- @return #AIRWING.Payload The payload table or nil if the unit does not exist.
|
||||
function AIRWING:NewPayload(Unit, Npayloads, MissionTypes, Performance)
|
||||
|
||||
@@ -454,7 +454,7 @@ end
|
||||
--- Set the number of payload available.
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.Payload Payload The payload table created by the `:NewPayload` function.
|
||||
-- @param #number Navailable Number of payloads available to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.
|
||||
-- @param #number Navailable (Optional) Number of payloads available to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetPayloadAmount(Payload, Navailable)
|
||||
|
||||
@@ -477,7 +477,7 @@ end
|
||||
--- Increase or decrease the amount of available payloads. Unlimited playloads first need to be set to a limited number with the `SetPayloadAmount` function.
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.Payload Payload The payload table created by the `:NewPayload` function.
|
||||
-- @param #number N Number of payloads to be added. Use negative number to decrease amount. Default 1.
|
||||
-- @param #number N (Optional) Number of payloads to be added. Use negative number to decrease amount. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:IncreasePayloadAmount(Payload, N)
|
||||
|
||||
@@ -516,7 +516,7 @@ end
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.Payload Payload The payload table to which the capability should be added.
|
||||
-- @param #table MissionTypes Mission types to be added.
|
||||
-- @param #number Performance A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.
|
||||
-- @param #number Performance (Optional) A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:AddPayloadCapability(Payload, MissionTypes, Performance)
|
||||
|
||||
@@ -739,7 +739,7 @@ end
|
||||
|
||||
--- Set number of CAP flights constantly carried out.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number n Number of flights. Default 1.
|
||||
-- @param #number n (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberCAP(n)
|
||||
self.nflightsCAP=n or 1
|
||||
@@ -757,7 +757,7 @@ end
|
||||
|
||||
--- Set CAP close race track.We'll utilize the AUFTRAG PatrolRaceTrack instead of a standard race track orbit task.
|
||||
-- @param #AIRWING self
|
||||
-- @param #boolean OnOff If true, switch this on, else switch off. Off by default.
|
||||
-- @param #boolean OnOff (Optional) If true, switch this on, else switch off. Off by default.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetCapCloseRaceTrack(OnOff)
|
||||
self.capOptionPatrolRaceTrack = OnOff
|
||||
@@ -777,7 +777,7 @@ end
|
||||
|
||||
--- Set number of TANKER flights with Boom constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Nboom Number of flights. Default 1.
|
||||
-- @param #number Nboom (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberTankerBoom(Nboom)
|
||||
self.nflightsTANKERboom=Nboom or 1
|
||||
@@ -799,7 +799,7 @@ end
|
||||
|
||||
--- Set number of TANKER flights with Probe constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Nprobe Number of flights. Default 1.
|
||||
-- @param #number Nprobe (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberTankerProbe(Nprobe)
|
||||
self.nflightsTANKERprobe=Nprobe or 1
|
||||
@@ -808,7 +808,7 @@ end
|
||||
|
||||
--- Set number of AWACS flights constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number n Number of flights. Default 1.
|
||||
-- @param #number n (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberAWACS(n)
|
||||
self.nflightsAWACS=n or 1
|
||||
@@ -817,7 +817,7 @@ end
|
||||
|
||||
--- Set number of RECON flights constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number n Number of flights. Default 1.
|
||||
-- @param #number n (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberRecon(n)
|
||||
self.nflightsRecon=n or 1
|
||||
@@ -826,7 +826,7 @@ end
|
||||
|
||||
--- Set number of Rescue helo flights constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number n Number of flights. Default 1.
|
||||
-- @param #number n (Optional) Number of flights. Default 1.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetNumberRescuehelo(n)
|
||||
self.nflightsRescueHelo=n or 1
|
||||
@@ -868,13 +868,13 @@ end
|
||||
|
||||
--- Create a new generic patrol point.
|
||||
-- @param #AIRWING self
|
||||
-- @param #string Type Patrol point type, e.g. "CAP" or "AWACS". Default "Unknown".
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the patrol point. Default 10-15 NM away from the location of the airwing. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Orbit altitude in feet. Default random between Angels 10 and 20.
|
||||
-- @param #number Heading Heading in degrees. Default random (0, 360] degrees.
|
||||
-- @param #number LegLength Length of race-track orbit in NM. Default 15 NM.
|
||||
-- @param #number Speed Orbit speed in knots. Default 350 knots.
|
||||
-- @param #number RefuelSystem Refueling system: 0=Boom, 1=Probe. Default nil=any.
|
||||
-- @param #string Type (Optional) Patrol point type, e.g. "CAP" or "AWACS". Default "Unknown".
|
||||
-- @param Core.Point#COORDINATE Coordinate (Optional) Coordinate of the patrol point. Default 10-15 NM away from the location of the airwing. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default random between Angels 10 and 20.
|
||||
-- @param #number Heading (Optional) Heading in degrees. Default random (0, 360] degrees.
|
||||
-- @param #number LegLength (Optional) Length of race-track orbit in NM. Default 15 NM.
|
||||
-- @param #number Speed (Optional) Orbit speed in knots. Default 350 knots.
|
||||
-- @param #number RefuelSystem (Optional) Refueling system: 0=Boom, 1=Probe. Default nil=any.
|
||||
-- @return #AIRWING.PatrolData Patrol point table.
|
||||
function AIRWING:NewPatrolPoint(Type, Coordinate, Altitude, Speed, Heading, LegLength, RefuelSystem)
|
||||
|
||||
@@ -944,7 +944,7 @@ end
|
||||
-- @param #number Speed Orbit speed in knots.
|
||||
-- @param #number Heading Heading in degrees.
|
||||
-- @param #number LegLength Length of race-track orbit in NM.
|
||||
-- @param #number RefuelSystem Set refueling system of tanker: 0=boom, 1=probe. Default any (=nil).
|
||||
-- @param #number RefuelSystem (Optional) Set refueling system of tanker: 0=boom, 1=probe. Default any (=nil).
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:AddPatrolPointTANKER(Coordinate, Altitude, Speed, Heading, LegLength, RefuelSystem)
|
||||
|
||||
@@ -984,7 +984,7 @@ end
|
||||
--- Set takeoff type. All assets of this airwing will be spawned with this takeoff type.
|
||||
-- Spawning on runways is not supported.
|
||||
-- @param #AIRWING self
|
||||
-- @param #string TakeoffType Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air.
|
||||
-- @param #string TakeoffType (Optional) Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetTakeoffType(TakeoffType)
|
||||
TakeoffType=TakeoffType or "Cold"
|
||||
@@ -1067,7 +1067,7 @@ end
|
||||
--- Set despawn after landing. Aircraft will be despawned after the landing event.
|
||||
-- Can help to avoid DCS AI taxiing issues.
|
||||
-- @param #AIRWING self
|
||||
-- @param #boolean Switch If `true` (default), activate despawn after landing.
|
||||
-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetDespawnAfterLanding(Switch)
|
||||
if Switch then
|
||||
@@ -1081,7 +1081,7 @@ end
|
||||
--- Set despawn after holding. Aircraft will be despawned when they arrive at their holding position at the airbase.
|
||||
-- Can help to avoid DCS AI taxiing issues.
|
||||
-- @param #AIRWING self
|
||||
-- @param #boolean Switch If `true` (default), activate despawn after landing.
|
||||
-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetDespawnAfterHolding(Switch)
|
||||
if Switch then
|
||||
@@ -1581,9 +1581,9 @@ end
|
||||
|
||||
--- Count payloads in stock.
|
||||
-- @param #AIRWING self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #table UnitTypes Types of units.
|
||||
-- @param #table Payloads Specific payloads to be counted only.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #table UnitTypes (Optional) Types of units.
|
||||
-- @param #table Payloads (Optional) Specific payloads to be counted only.
|
||||
-- @return #number Count of available payloads in stock.
|
||||
function AIRWING:CountPayloadsInStock(MissionTypes, UnitTypes, Payloads)
|
||||
|
||||
|
||||
@@ -2456,7 +2456,7 @@ end
|
||||
--- Set carrier controlled area (CCA).
|
||||
-- This is a large zone around the carrier, which is constantly updated wrt the carrier position.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Radius Radius of zone in nautical miles (NM). Default 50 NM.
|
||||
-- @param #number Radius (Optional) Radius of zone in nautical miles (NM). Default 50 NM.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetCarrierControlledArea( Radius )
|
||||
|
||||
@@ -2470,7 +2470,7 @@ end
|
||||
--- Set carrier controlled zone (CCZ).
|
||||
-- This is a small zone (usually 5 NM radius) around the carrier, which is constantly updated wrt the carrier position.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Radius Radius of zone in nautical miles (NM). Default 5 NM.
|
||||
-- @param #number Radius (Optional) Radius of zone in nautical miles (NM). Default 5 NM.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetCarrierControlledZone( Radius )
|
||||
|
||||
@@ -2483,7 +2483,7 @@ end
|
||||
|
||||
--- Set distance up to which water ahead is scanned for collisions.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Distance Distance in NM. Default 5 NM.
|
||||
-- @param #number Distance (Optional) Distance in NM. Default 5 NM.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetCollisionDistance( Distance )
|
||||
self.collisiondist = UTILS.NMToMeters( Distance or 5 )
|
||||
@@ -2492,7 +2492,7 @@ end
|
||||
|
||||
--- Set the default recovery case.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Case Case of recovery. Either 1, 2 or 3. Default 1.
|
||||
-- @param #number Case (Optional) Case of recovery. Either 1, 2 or 3. Default 1.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetRecoveryCase( Case )
|
||||
|
||||
@@ -2509,7 +2509,7 @@ end
|
||||
-- Usually, this is +-15 or +-30 degrees. You should not use and offset angle >= 90 degrees, because this will cause a devision by zero in some of the equations used to calculate the approach corridor.
|
||||
-- So best stick to the defaults up to 30 degrees.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Offset Offset angle in degrees. Default 0.
|
||||
-- @param #number Offset (Optional) Offset angle in degrees. Default 0.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetHoldingOffsetAngle( Offset )
|
||||
|
||||
@@ -2524,10 +2524,10 @@ end
|
||||
|
||||
--- Enable F10 menu to manually start recoveries.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Duration Default duration of the recovery in minutes. Default 30 min.
|
||||
-- @param #number WindOnDeck Default wind on deck in knots. Default 25 knots.
|
||||
-- @param #boolean Uturn U-turn after recovery window closes on=true or off=false/nil. Default off.
|
||||
-- @param #number Offset Relative Marshal radial in degrees for Case II/III recoveries. Default 30°.
|
||||
-- @param #number Duration (Optional) Default duration of the recovery in minutes. Default 30 min.
|
||||
-- @param #number WindOnDeck(Optional) Default wind on deck in knots. Default 25 knots.
|
||||
-- @param #boolean Uturn (Optional) U-turn after recovery window closes on=true or off=false/nil. Default off.
|
||||
-- @param #number Offset (Optional) Relative Marshal radial in degrees for Case II/III recoveries. Default 30°.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMenuRecovery( Duration, WindOnDeck, Uturn, Offset )
|
||||
|
||||
@@ -2547,13 +2547,13 @@ end
|
||||
|
||||
--- Add aircraft recovery time window and recovery case.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number case Recovery case for that time slot. Number between one and three.
|
||||
-- @param #number holdingoffset Only for CASE II/III: Angle in degrees the holding pattern is offset.
|
||||
-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number case (Optional) Recovery case for that time slot. Number between one and three. Defaults to 1.
|
||||
-- @param #number holdingoffset (Optional) Only for CASE II/III: Angle in degrees the holding pattern is offset. Defaults to 0.
|
||||
-- @param #boolean turnintowind If true, carrier will turn into the wind 5 minutes before the recovery window opens.
|
||||
-- @param #number speed Speed in knots during turn into wind leg.
|
||||
-- @param #boolean uturn If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @param #number speed (Optional) Speed in knots during turn into wind leg. Default is 20.
|
||||
-- @param #boolean uturn (Optional) If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @return #AIRBOSS.Recovery Recovery window.
|
||||
function AIRBOSS:AddRecoveryWindow( starttime, stoptime, case, holdingoffset, turnintowind, speed, uturn )
|
||||
|
||||
@@ -2717,17 +2717,27 @@ function AIRBOSS:DeleteRecoveryWindow( Window, Delay )
|
||||
self:ScheduleOnce( Delay, self.DeleteRecoveryWindow, self, Window )
|
||||
else
|
||||
|
||||
for i, _recovery in pairs( self.recoverytimes ) do
|
||||
local recovery = _recovery -- #AIRBOSS.Recovery
|
||||
if not Window then
|
||||
return
|
||||
end
|
||||
|
||||
if Window and Window.ID == recovery.ID then
|
||||
if Window.OPEN then
|
||||
-- Window is currently open.
|
||||
self:RecoveryStop()
|
||||
else
|
||||
table.remove( self.recoverytimes, i )
|
||||
end
|
||||
-- If this window is currently open, stop recovery first. Mark it OVER so the
|
||||
-- recovery time check cannot re-open it before/while we remove it.
|
||||
if Window.OPEN then
|
||||
Window.OPEN = false
|
||||
Window.OVER = true
|
||||
if self:IsRecovering() then
|
||||
self:RecoveryStop()
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove the window from the queue by its unique ID. Iterate over a numerically
|
||||
-- indexed copy of the keys and remove via ipairs-safe reverse loop so that the
|
||||
-- removal does not corrupt traversal (the window may appear once).
|
||||
for i = #self.recoverytimes, 1, -1 do
|
||||
local recovery = self.recoverytimes[i] -- #AIRBOSS.Recovery
|
||||
if recovery and recovery.ID == Window.ID then
|
||||
table.remove( self.recoverytimes, i )
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2735,7 +2745,7 @@ end
|
||||
|
||||
--- Set time before carrier turns and recovery window opens.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Interval Time interval in seconds. Default 300 sec.
|
||||
-- @param #number Interval (Optional) Time interval in seconds. Default 300 sec.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetRecoveryTurnTime( Interval )
|
||||
self.dTturn = Interval or 300
|
||||
@@ -2744,7 +2754,7 @@ end
|
||||
|
||||
--- Set multiplayer environment wire correction.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Dcorr Correction distance in meters. Default 12 m.
|
||||
-- @param #number Dcorr (Optional) Correction distance in meters. Default 12 m.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMPWireCorrection( Dcorr )
|
||||
self.mpWireCorrection = Dcorr or 12
|
||||
@@ -2753,7 +2763,7 @@ end
|
||||
|
||||
--- Set time interval for updating queues and other stuff.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number TimeInterval Time interval in seconds. Default 30 sec.
|
||||
-- @param #number TimeInterval (Optional) Time interval in seconds. Default 30 sec.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetQueueUpdateTime( TimeInterval )
|
||||
self.dTqueue = TimeInterval or 30
|
||||
@@ -2762,7 +2772,7 @@ end
|
||||
|
||||
--- Set time interval between LSO calls. Optimal time in the groove is ~16 seconds. So the default of 4 seconds gives around 3-4 correction calls in the groove.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number TimeInterval Time interval in seconds between LSO calls. Default 4 sec.
|
||||
-- @param #number TimeInterval (Optional) Time interval in seconds between LSO calls. Default 4 sec.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetLSOCallInterval( TimeInterval )
|
||||
self.LSOdT = TimeInterval or 4
|
||||
@@ -2835,7 +2845,7 @@ end
|
||||
|
||||
--- Give AI aircraft the refueling task if a recovery tanker is present or send them to the nearest divert airfield.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number LowFuelThreshold Low fuel threshold in percent. AI will go refueling if their fuel level drops below this value. Default 10 %.
|
||||
-- @param #number LowFuelThreshold (Optional) Low fuel threshold in percent. AI will go refueling if their fuel level drops below this value. Default 10 %.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetRefuelAI( LowFuelThreshold )
|
||||
self.lowfuelAI = LowFuelThreshold or 10
|
||||
@@ -2844,7 +2854,7 @@ end
|
||||
|
||||
--- Set max altitude to register flights in the initial zone. Aircraft above this altitude will not be registerered.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number MaxAltitude Max altitude in feet. Default 1300 ft.
|
||||
-- @param #number MaxAltitude (Optional) Max altitude in feet. Default 1300 ft.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetInitialMaxAlt( MaxAltitude )
|
||||
self.initialmaxalt = UTILS.FeetToMeters( MaxAltitude or 1300 )
|
||||
@@ -2878,7 +2888,7 @@ end
|
||||
|
||||
--- Set time interval for updating player status and other things.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number TimeInterval Time interval in seconds. Default 0.5 sec.
|
||||
-- @param #number TimeInterval (Optional) Time interval in seconds. Default 0.5 sec.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetStatusUpdateTime( TimeInterval )
|
||||
self.dTstatus = TimeInterval or 0.5
|
||||
@@ -2887,7 +2897,7 @@ end
|
||||
|
||||
--- Set duration how long messages are displayed to players.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Duration Duration in seconds. Default 10 sec.
|
||||
-- @param #number Duration (Optional) Duration in seconds. Default 10 sec.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetDefaultMessageDuration( Duration )
|
||||
self.Tmessage = Duration or 10
|
||||
@@ -2978,7 +2988,7 @@ end
|
||||
--- Set Case I Marshal radius. This is the radius of the valid zone around "the post" aircraft are supposed to be holding in the Case I Marshal stack.
|
||||
-- The post is 2.5 NM port of the carrier.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Radius Radius in NM. Default 2.8 NM, which gives a diameter of 5.6 NM.
|
||||
-- @param #number Radius (Optional) Radius in NM. Default 2.8 NM, which gives a diameter of 5.6 NM.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMarshalRadius( Radius )
|
||||
self.marshalradius = UTILS.NMToMeters( Radius or 2.8 )
|
||||
@@ -3112,9 +3122,9 @@ end
|
||||
--- Set up SRS for usage without sound files
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string PathToSRS Path to SRS folder, e.g. "C:\\Program Files\\DCS-SimpleRadio\\ExternalAudio".
|
||||
-- @param #number Port Port of the SRS server, defaults to 5002.
|
||||
-- @param #string Culture (Optional, Airboss Culture) Culture, defaults to "en-US".
|
||||
-- @param #string Gender (Optional, Airboss Gender) Gender, e.g. "male" or "female". Defaults to "male".
|
||||
-- @param #number Port (Optional) Port of the SRS server, defaults to 5002.
|
||||
-- @param #string Culture (Optional) (Optional, Airboss Culture) Culture, defaults to "en-US".
|
||||
-- @param #string Gender (Optional) (Optional, Airboss Gender) Gender, e.g. "male" or "female". Defaults to "male".
|
||||
-- @param #string Voice (Optional, Airboss Voice) Set to use a specific voice. Will **override gender and culture** settings.
|
||||
-- @param #string GoogleCreds (Optional) Path to Google credentials, e.g. "C:\\Program Files\\DCS-SimpleRadio-Standalone\\yourgooglekey.json".
|
||||
-- @param #number Volume (Optional) E.g. 0.75. Defaults to 1.0 (loudest).
|
||||
@@ -3143,7 +3153,10 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum
|
||||
self.SRS:SetVoice(Voice)
|
||||
end
|
||||
if (not Voice) and self.SRS and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
self.SRS.voice = MSRS.poptions["gcloud"].voice or MSRS.Voices.Google.Standard.en_US_Standard_B
|
||||
self.SRS.voice = MSRS.Voices.Google.Standard.en_US_Standard_B
|
||||
if MSRS.poptions and MSRS.poptions["gcloud"] and MSRS.poptions["gcloud"].voice then
|
||||
self.SRS.voice = MSRS.poptions["gcloud"].voice
|
||||
end
|
||||
end
|
||||
--self.SRS:SetVolume(Volume or 1.0)
|
||||
-- SRSQUEUE
|
||||
@@ -3362,7 +3375,7 @@ end
|
||||
|
||||
--- Set number of aircraft units, which can be in the landing pattern before the pattern is full.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number nmax Max number. Default 4. Minimum is 1, maximum is 6.
|
||||
-- @param #number nmax (Optional) Max number. Default 4. Minimum is 1, maximum is 6.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMaxLandingPattern( nmax )
|
||||
nmax = nmax or 4
|
||||
@@ -3375,7 +3388,7 @@ end
|
||||
--- Set number available Case I Marshal stacks. If Marshal stacks are full, flights requesting Marshal will be told to hold outside 10 NM zone until a stack becomes available again.
|
||||
-- Marshal stacks for Case II/III are unlimited.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number nmax Max number of stacks available to players and AI flights. Default 3, i.e. angels 2, 3, 4. Minimum is 1.
|
||||
-- @param #number nmax (Optional) Max number of stacks available to players and AI flights. Default 3, i.e. angels 2, 3, 4. Minimum is 1.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMaxMarshalStacks( nmax )
|
||||
self.Nmaxmarshal = nmax or 3
|
||||
@@ -3397,7 +3410,7 @@ end
|
||||
|
||||
--- Set maximum distance up to which section members are allowed (default: 100 meters).
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number dmax Max distance in meters (default 100 m). Minimum is 10 m, maximum is 5000 m.
|
||||
-- @param #number dmax (Optional) Max distance in meters (default 100 m). Minimum is 10 m, maximum is 5000 m.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMaxSectionDistance( dmax )
|
||||
if dmax then
|
||||
@@ -3413,7 +3426,7 @@ end
|
||||
|
||||
--- Set max number of flights per stack. All members of a section count as one "flight".
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number nmax Number of max allowed flights per stack. Default is two. Minimum is one, maximum is 4.
|
||||
-- @param #number nmax (Optional) Number of max allowed flights per stack. Default is two. Minimum is one, maximum is 4.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMaxFlightsPerStack( nmax )
|
||||
nmax = nmax or 2
|
||||
@@ -3433,7 +3446,7 @@ end
|
||||
|
||||
--- Will play the inbound calls, commencing, initial, etc. from the player when requesteing marshal
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON)
|
||||
-- @param #AIRBOSS status (Optional) Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON)
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetExtraVoiceOvers(status)
|
||||
self.xtVoiceOvers=status
|
||||
@@ -3442,7 +3455,7 @@ end
|
||||
|
||||
--- Will simulate the inbound call, commencing, initial, etc from the AI when requested by Airboss
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON)
|
||||
-- @param #AIRBOSS status (Optional) Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON)
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetExtraVoiceOversAI(status)
|
||||
self.xtVoiceOversAI=status
|
||||
@@ -3481,7 +3494,7 @@ end
|
||||
-- * "Naval Aviator" = @{#AIRBOSS.Difficulty.Normal}
|
||||
-- * "TOPGUN Graduate" = @{#AIRBOSS.Difficulty.Hard}
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string skill Player skill. Default "Naval Aviator".
|
||||
-- @param #string skill (Optional) Player skill. Default "Naval Aviator".
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetDefaultPlayerSkill( skill )
|
||||
|
||||
@@ -3507,8 +3520,8 @@ end
|
||||
|
||||
--- Enable auto save of player results each time a player is *finally* graded. *Finally* means after the player landed on the carrier! After intermediate passes (bolter or waveoff) the stats are *not* saved.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string path Path where to save the asset data file. Default is the DCS root installation directory or your "Saved Games\\DCS" folder if lfs was desanitized.
|
||||
-- @param #string filename File name. Default is generated automatically from airboss carrier name/alias.
|
||||
-- @param #string path (Optional) Path where to save the asset data file. Default is the DCS root installation directory or your "Saved Games\\DCS" folder if lfs was desanitized.
|
||||
-- @param #string filename (Optional) File name. Default is generated automatically from airboss carrier name/alias.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetAutoSave( path, filename )
|
||||
self.autosave = true
|
||||
@@ -3540,7 +3553,7 @@ end
|
||||
|
||||
--- Set the magnetic declination (or variation). By default this is set to the standard declination of the map.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number declination Declination in degrees or nil for default declination of the map.
|
||||
-- @param #number declination (Optional) Declination in degrees or nil for default declination of the map.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMagneticDeclination( declination )
|
||||
self.magvar = declination or UTILS.GetMagneticDeclination()
|
||||
@@ -3559,8 +3572,8 @@ end
|
||||
--- Set FunkMan socket. LSO grades and trap sheets will be send to your Discord bot.
|
||||
-- **Requires running FunkMan program**.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number Port Port. Default `10042`.
|
||||
-- @param #string Host Host. Default `"127.0.0.1"`.
|
||||
-- @param #number Port (Optional) Port. Default `10042`.
|
||||
-- @param #string Host (Optional) Host. Default `"127.0.0.1"`.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetFunkManOn(Port, Host)
|
||||
|
||||
@@ -3571,7 +3584,7 @@ end
|
||||
|
||||
--- Get next time the carrier will start recovering aircraft.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #boolean InSeconds If true, abs. mission time seconds is returned. Default is a clock #string.
|
||||
-- @param #boolean InSeconds (Optional) If true, abs. mission time seconds is returned. Default is a clock #string.
|
||||
-- @return #string Clock start (or start time in abs. seconds).
|
||||
-- @return #string Clock stop (or stop time in abs. seconds).
|
||||
function AIRBOSS:GetNextRecoveryTime( InSeconds )
|
||||
@@ -4075,15 +4088,23 @@ function AIRBOSS:_CheckRecoveryTimes()
|
||||
if self:IsRecovering() then
|
||||
-- Carrier is already recovering.
|
||||
state = "in progress"
|
||||
else
|
||||
-- Start recovery.
|
||||
elseif not recovery.OVER then
|
||||
-- Start recovery. Only if the window has not already been closed/cancelled.
|
||||
-- The OVER guard prevents a window that was stopped manually (e.g. via the
|
||||
-- Skipper "Stop Recovery" menu) from being immediately re-opened on the next
|
||||
-- status tick while its [START,STOP) range is still active.
|
||||
self:RecoveryStart( recovery.CASE, recovery.OFFSET )
|
||||
state = "starting now"
|
||||
recovery.OPEN = true
|
||||
else
|
||||
-- Window was already closed/cancelled within its active time range.
|
||||
state = "cancelled"
|
||||
end
|
||||
|
||||
-- Set current recovery window.
|
||||
currwindow = recovery
|
||||
-- Set current recovery window (unless this window has been cancelled).
|
||||
if not recovery.OVER then
|
||||
currwindow = recovery
|
||||
end
|
||||
|
||||
else -- Stop time HAS passed.
|
||||
|
||||
@@ -4180,13 +4201,16 @@ function AIRBOSS:_CheckRecoveryTimes()
|
||||
-- Time into the wind 1 day or if longer recovery time + the 5 min early.
|
||||
local t = math.max( nextwindow.STOP - nextwindow.START + self.dTturn, 60 * 60 * 24 )
|
||||
|
||||
-- Recovery wind on deck in knots.
|
||||
-- Recovery wind on deck in knots.
|
||||
-- NOTE: Do NOT clamp the desired wind-over-deck (WOD) to the carrier's max hull
|
||||
-- speed here. WOD = carrier speed + headwind, so a WOD target above the hull's
|
||||
-- top speed is achievable whenever there is wind. CarrierTurnIntoWind ->
|
||||
-- GetHeadingIntoWind already converts the WOD target into the required hull
|
||||
-- speed and caps THAT at the carrier's max speed (Vmax) internally. Clamping the
|
||||
-- WOD target itself capped achievable WOD at ~30 kts (the supercarrier's max
|
||||
-- hull speed) even in strong wind, which made high-WOD recovery windows fall
|
||||
-- short of their requested value.
|
||||
local v = UTILS.KnotsToMps( nextwindow.SPEED )
|
||||
|
||||
-- Check that we do not go above max possible speed.
|
||||
local vmax = self.carrier:GetSpeedMax() / 3.6 -- convert to m/s
|
||||
v = math.min( v, vmax )
|
||||
|
||||
-- Route carrier into the wind. Sets self.turnintowind=true
|
||||
self:CarrierTurnIntoWind( t, v, uturn )
|
||||
|
||||
@@ -4358,11 +4382,20 @@ function AIRBOSS:onafterRecoveryStop( From, Event, To )
|
||||
self:CarrierResumeRoute( coord )
|
||||
end
|
||||
|
||||
-- Delete current recovery window if open.
|
||||
if self.recoverywindow and self.recoverywindow.OPEN == true then
|
||||
-- Mark the current recovery window closed and cancelled, then remove it from the
|
||||
-- queue. We do NOT gate this on Window.OPEN: that flag is only set by
|
||||
-- _CheckRecoveryTimes (not by RecoveryStart), and the recovery time check nils and
|
||||
-- rebuilds self.recoverywindow every status tick, so OPEN is not a reliable signal
|
||||
-- here. Setting OVER=true is what actually prevents the window from being re-opened
|
||||
-- on the next tick while its [START,STOP) range is still active.
|
||||
--
|
||||
-- The removal is deferred by one tick (Delay>0) so it does not mutate the
|
||||
-- recoverytimes table while _CheckRecoveryTimes may be iterating over it (the natural
|
||||
-- close path calls RecoveryStop() from inside that loop).
|
||||
if self.recoverywindow then
|
||||
self.recoverywindow.OPEN = false
|
||||
self.recoverywindow.OVER = true
|
||||
self:DeleteRecoveryWindow( self.recoverywindow )
|
||||
self:DeleteRecoveryWindow( self.recoverywindow, 1 )
|
||||
end
|
||||
|
||||
-- Check recovery windows. This sets self.recoverywindow to the next window.
|
||||
@@ -6734,7 +6767,7 @@ end
|
||||
--- Get marshal altitude and two positions of a counter-clockwise race track pattern.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number stack Assigned stack number. Counting starts at one, i.e. stack=1 is the first stack.
|
||||
-- @param #number case Recovery case. Default is self.case.
|
||||
-- @param #number case (Optional) Recovery case. Default is self.case.
|
||||
-- @return #number Holding altitude in meters.
|
||||
-- @return Core.Point#COORDINATE First race track coordinate.
|
||||
-- @return Core.Point#COORDINATE Second race track coordinate.
|
||||
@@ -7095,8 +7128,8 @@ end
|
||||
--- Get next free Marshal stack. Depending on AI/human and recovery case.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #boolean ai If true, get a free stack for an AI flight group.
|
||||
-- @param #number case Recovery case. Default current (self) case in progress.
|
||||
-- @param #boolean empty Return lowest stack that is completely empty.
|
||||
-- @param #number case (Optional) Recovery case. Default current (self) case in progress.
|
||||
-- @param #boolean empty (Optional) Return lowest stack that is completely empty.
|
||||
-- @return #number Lowest free stack available for the given case or nil if all Case I stacks are taken.
|
||||
function AIRBOSS:_GetFreeStack( ai, case, empty )
|
||||
|
||||
@@ -7185,7 +7218,7 @@ end
|
||||
--- Get next free Marshal stack. Depending on AI/human and recovery case.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #boolean ai If true, get a free stack for an AI flight group.
|
||||
-- @param #number case Recovery case. Default current (self) case in progress.
|
||||
-- @param #number case (Optional) Recovery case. Default current (self) case in progress.
|
||||
-- @param #boolean empty Return lowest stack that is completely empty.
|
||||
-- @return #number Lowest free stack available for the given case or nil if all Case I stacks are taken.
|
||||
function AIRBOSS:_GetFreeStack_Old( ai, case, empty )
|
||||
@@ -7253,7 +7286,7 @@ end
|
||||
--- Get number of (airborne) units in a flight.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS.FlightGroup flight The flight group.
|
||||
-- @param #boolean onground If true, include units on the ground. By default only airborne units are counted.
|
||||
-- @param #boolean onground (Optional) If true, include units on the ground. By default only airborne units are counted.
|
||||
-- @return #number Number of units in flight including section members.
|
||||
-- @return #number Number of units in flight excluding section members.
|
||||
-- @return #number Number of section members.
|
||||
@@ -10958,9 +10991,9 @@ end
|
||||
|
||||
--- Get groove zone.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number l Length of the groove in NM. Default 1.5 NM.
|
||||
-- @param #number w Width of the groove in NM. Default 0.25 NM.
|
||||
-- @param #number b Width of the beginning in NM. Default 0.10 NM.
|
||||
-- @param #number l (Optional) Length of the groove in NM. Default 1.5 NM.
|
||||
-- @param #number w (Optional) Width of the groove in NM. Default 0.25 NM.
|
||||
-- @param #number b (Optional) Width of the beginning in NM. Default 0.10 NM.
|
||||
-- @return Core.Zone#ZONE_POLYGON_BASE Groove zone.
|
||||
function AIRBOSS:_GetZoneGroove( l, w, b )
|
||||
|
||||
@@ -11131,7 +11164,7 @@ end
|
||||
--- Get approach corridor zone. Shape depends on recovery case.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number case Recovery case.
|
||||
-- @param #number l Length of the zone in NM. Default 31 (=21+10) NM.
|
||||
-- @param #number l (Optional) Length of the zone in NM. Default 31 (=21+10) NM.
|
||||
-- @return Core.Zone#ZONE_POLYGON_BASE Box zone.
|
||||
function AIRBOSS:_GetZoneCorridor( case, l )
|
||||
|
||||
@@ -11977,7 +12010,7 @@ end
|
||||
|
||||
--- Get true (or magnetic) heading of carrier.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned.
|
||||
-- @param #boolean magnetic (Optional) If true, calculate magnetic heading. By default true heading is returned.
|
||||
-- @return #number Carrier heading in degrees.
|
||||
function AIRBOSS:GetHeading( magnetic )
|
||||
self:F3( { magnetic = magnetic } )
|
||||
@@ -12010,8 +12043,8 @@ end
|
||||
|
||||
--- Get wind direction and speed at carrier position.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number alt Altitude ASL in meters. Default 18 m.
|
||||
-- @param #boolean magnetic Direction including magnetic declination.
|
||||
-- @param #number alt (Optional) Altitude ASL in meters. Default 18 m.
|
||||
-- @param #boolean magnetic (Optional) Direction including magnetic declination.
|
||||
-- @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 Wind speed in m/s.
|
||||
@@ -12037,7 +12070,7 @@ end
|
||||
|
||||
--- Get wind speed on carrier deck parallel and perpendicular to runway.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number alt Altitude in meters. Default 18 m.
|
||||
-- @param #number alt (Optional) Altitude in meters. Default 18 m.
|
||||
-- @return #number Wind component parallel to runway im m/s.
|
||||
-- @return #number Wind component perpendicular to runway in m/s.
|
||||
-- @return #number Total wind strength in m/s.
|
||||
@@ -12083,7 +12116,7 @@ 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 #boolean magnetic (Optional) 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.
|
||||
-- @return #number Carrier speed in knots to reach desired wind speed on deck.
|
||||
@@ -12103,7 +12136,7 @@ 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 #boolean magnetic (Optional) 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 )
|
||||
@@ -12176,7 +12209,7 @@ end
|
||||
-- Implementation based on [Mags & Bambi](https://magwo.github.io/carrier-cruise/).
|
||||
-- @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 (Optional) 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.
|
||||
-- @return #number Carrier speed in knots to reach desired wind speed on deck.
|
||||
@@ -12307,9 +12340,9 @@ end
|
||||
--
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number case Recovery case.
|
||||
-- @param #boolean magnetic If true, magnetic radial is returned. Default is true radial.
|
||||
-- @param #boolean offset If true, inlcude holding offset.
|
||||
-- @param #boolean inverse Return inverse, i.e. radial-180 degrees.
|
||||
-- @param #boolean magnetic (Optional) If true, magnetic radial is returned. Default is true radial.
|
||||
-- @param #boolean offset (Optional) If true, inlcude holding offset.
|
||||
-- @param #boolean inverse (Optional) Return inverse, i.e. radial-180 degrees.
|
||||
-- @return #number Radial in degrees.
|
||||
function AIRBOSS:GetRadial( case, magnetic, offset, inverse )
|
||||
|
||||
@@ -12900,6 +12933,14 @@ function AIRBOSS:_LSOgrade( playerData )
|
||||
-- Circuit edit only take points awary from a 1 wire if there are more than 4 other deviations
|
||||
if playerData.wire == 1 and points >= 3 and N > 4 then
|
||||
points = points -1
|
||||
-- We also need to change the grade based on the new points.
|
||||
if points == 4 then
|
||||
grade = "OK"
|
||||
elseif points == 3 then
|
||||
grade = "(OK)"
|
||||
elseif points == 2 then
|
||||
grade = "--"
|
||||
end
|
||||
end
|
||||
|
||||
env.info("Returning: " .. grade .. " " .. points .. " " .. G)
|
||||
@@ -13255,7 +13296,7 @@ end
|
||||
--- Get short name of the grove step.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string step Player step.
|
||||
-- @param #number n Use -1 for previous or +1 for next. Default 0.
|
||||
-- @param #number n (Optional) Use -1 for previous or +1 for next. Default 0.
|
||||
-- @return #string Shortcut name "X", "RB", "IM", "AR", "IW".
|
||||
function AIRBOSS:_GS( step, n )
|
||||
local gp
|
||||
@@ -13454,7 +13495,7 @@ end
|
||||
--- Display hint to player.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS.PlayerData playerData Player data table.
|
||||
-- @param #number delay Delay before playing sound messages. Default 0 sec.
|
||||
-- @param #number delay (Optional) Delay before playing sound messages. Default 0 sec.
|
||||
-- @param #boolean soundoff If true, don't play and sound hint.
|
||||
function AIRBOSS:_PlayerHint( playerData, delay, soundoff )
|
||||
|
||||
@@ -14276,7 +14317,7 @@ end
|
||||
|
||||
--- Check Collision.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param Core.Point#COORDINATE fromcoord Coordinate from which the path to the next WP is calculated. Default current carrier position.
|
||||
-- @param Core.Point#COORDINATE fromcoord (Optional) Coordinate from which the path to the next WP is calculated. Default current carrier position.
|
||||
-- @return #boolean If true, surface type ahead is not deep water.
|
||||
function AIRBOSS:_CheckFreePathToNextWP( fromcoord )
|
||||
|
||||
@@ -14354,9 +14395,9 @@ end
|
||||
--- Let the carrier make a detour to a given point. When it reaches the point, it will resume its normal route.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param Core.Point#COORDINATE coord Coordinate of the detour.
|
||||
-- @param #number speed Speed in knots. Default is current carrier velocity.
|
||||
-- @param #number speed (Optional) Speed in knots. Default is current carrier velocity.
|
||||
-- @param #boolean uturn (Optional) If true, carrier will go back to where it came from before it resumes its route to the next waypoint.
|
||||
-- @param #number uspeed Speed in knots after U-turn. Default is same as before.
|
||||
-- @param #number uspeed (Optional) Speed in knots after U-turn. Default is same as before.
|
||||
-- @param Core.Point#COORDINATE tcoord Additional coordinate to make turn smoother.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:CarrierDetour( coord, speed, uturn, uspeed, tcoord )
|
||||
@@ -16090,11 +16131,11 @@ end
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS.PlayerData playerData Player data.
|
||||
-- @param #string message The message to send.
|
||||
-- @param #string sender The person who sends the message or nil.
|
||||
-- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear If true, clear screen from previous messages.
|
||||
-- @param #number delay Delay in seconds, before the message is displayed.
|
||||
-- @param #string sender (Optional) The person who sends the message or nil. Defaults to nil.
|
||||
-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration (Optional) Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear I(Optional) f true, clear screen from previous messages. Defaults to false.
|
||||
-- @param #number delay (Optional) Delay in seconds, before the message is displayed.
|
||||
function AIRBOSS:MessageToPlayer( playerData, message, sender, receiver, duration, clear, delay )
|
||||
self:T({sender,receiver,message})
|
||||
if playerData and message and message ~= "" then
|
||||
@@ -16218,11 +16259,11 @@ end
|
||||
-- Message format will be "SENDER: RECCEIVER, MESSAGE".
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string message The message to send.
|
||||
-- @param #string sender The person who sends the message or nil.
|
||||
-- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear If true, clear screen from previous messages.
|
||||
-- @param #number delay Delay in seconds, before the message is displayed.
|
||||
-- @param #string sender (Optional) The person who sends the message or nil. Defaults to "LSO".
|
||||
-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration (Optional) Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear (Optional) If true, clear screen from previous messages.
|
||||
-- @param #number delay (Optional) Delay in seconds, before the message is displayed.
|
||||
function AIRBOSS:MessageToPattern( message, sender, receiver, duration, clear, delay )
|
||||
|
||||
-- Create new (fake) radio call to show the subtitile.
|
||||
@@ -16237,11 +16278,11 @@ end
|
||||
-- Message format will be "SENDER: RECCEIVER, MESSAGE".
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string message The message to send.
|
||||
-- @param #string sender The person who sends the message or nil.
|
||||
-- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear If true, clear screen from previous messages.
|
||||
-- @param #number delay Delay in seconds, before the message is displayed.
|
||||
-- @param #string sender (Optional) The person who sends the message or nil. Defaults to "Marshal".
|
||||
-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver.
|
||||
-- @param #number duration (Optional) Display message duration. Default 10 seconds.
|
||||
-- @param #boolean clear (Optional) If true, clear screen from previous messages.
|
||||
-- @param #number delay (Optional) Delay in seconds, before the message is displayed.
|
||||
function AIRBOSS:MessageToMarshal( message, sender, receiver, duration, clear, delay )
|
||||
|
||||
-- Create new (fake) radio call to show the subtitile.
|
||||
@@ -16255,11 +16296,11 @@ end
|
||||
--- Generate a new radio call (deepcopy) from an existing default call.
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #AIRBOSS.RadioCall call Radio call to be enhanced.
|
||||
-- @param #string sender Sender of the message. Default is the radio alias.
|
||||
-- @param #string subtitle Subtitle of the message. Default from original radio call. Use "" for no subtitle.
|
||||
-- @param #number subduration Time in seconds the subtitle is displayed. Default 10 seconds.
|
||||
-- @param #string modexreceiver Onboard number of the receiver or nil.
|
||||
-- @param #string modexsender Onboard number of the sender or nil.
|
||||
-- @param #string sender (Optional) Sender of the message. Default is the radio alias.
|
||||
-- @param #string subtitle (Optional) Subtitle of the message. Default from original radio call. Use "" for no subtitle.
|
||||
-- @param #number subduration (Optional) Time in seconds the subtitle is displayed. Default 10 seconds.
|
||||
-- @param #string modexreceiver (Optional) Onboard number of the receiver or nil.
|
||||
-- @param #string modexsender (Optional) Onboard number of the sender or nil.
|
||||
function AIRBOSS:_NewRadioCall( call, sender, subtitle, subduration, modexreceiver, modexsender )
|
||||
|
||||
-- Create a new call
|
||||
@@ -19201,7 +19242,7 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #string path Path where the file is loaded from. Default is the DCS root installation folder or your "Saved Games\\DCS" folder if lfs was desanizied.
|
||||
-- @param #string path (Optional) Path where the file is loaded from. Default is the DCS root installation folder or your "Saved Games\\DCS" folder if lfs was desanizied.
|
||||
-- @param #string filename (Optional) File name for saving the player grades. Default is "AIRBOSS-<ALIAS>_LSOgrades.csv".
|
||||
function AIRBOSS:onafterLoad( From, Event, To, path, filename )
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ ARMYGROUP = {
|
||||
|
||||
--- Army Group version.
|
||||
-- @field #string version
|
||||
ARMYGROUP.version="1.0.3"
|
||||
ARMYGROUP.version="1.0.4"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -463,10 +463,10 @@ end
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the target.
|
||||
-- @param #string Clock Time when to start the attack.
|
||||
-- @param #number Radius Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots (Optional) Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task table.
|
||||
function ARMYGROUP:AddTaskFireAtPoint(Coordinate, Clock, Radius, Nshots, WeaponType, Prio)
|
||||
|
||||
@@ -485,10 +485,10 @@ end
|
||||
-- @param #number Heading Heading min in Degrees.
|
||||
-- @param #number Alpha Shooting angle in Degrees.
|
||||
-- @param #number Altitude Altitude in meters.
|
||||
-- @param #number Radius Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots Number of shots to fire. Default nil.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots (Optional) Number of shots to fire. Default nil.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task table.
|
||||
function ARMYGROUP:AddTaskBarrage(Clock, Heading, Alpha, Altitude, Radius, Nshots, WeaponType, Prio)
|
||||
|
||||
@@ -516,11 +516,11 @@ end
|
||||
--- Add a *waypoint* task to fire at a given coordinate.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the target.
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint Where the task is executed. Default is next waypoint.
|
||||
-- @param #number Radius Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint (Optional) Where the task is executed. Default is next waypoint.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots (Optional) Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task table.
|
||||
function ARMYGROUP:AddTaskWaypointFireAtPoint(Coordinate, Waypoint, Radius, Nshots, WeaponType, Prio)
|
||||
|
||||
@@ -538,10 +538,10 @@ end
|
||||
--- Add a *scheduled* task.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Wrapper.Group#GROUP TargetGroup Target group.
|
||||
-- @param #number WeaponExpend How much weapons does are used.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #string Clock Time when to start the attack.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param #number WeaponExpend (Optional) How much weapons does are used. Defaults to "Auto".
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #string Clock (Optional) Time when to start the attack. Defaults to 5.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task table.
|
||||
function ARMYGROUP:AddTaskAttackGroup(TargetGroup, WeaponExpend, WeaponType, Clock, Prio)
|
||||
|
||||
@@ -574,7 +574,7 @@ end
|
||||
|
||||
--- Define a set of possible retreat zones.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Set#SET_ZONE RetreatZoneSet The retreat zone set. Default is an empty set.
|
||||
-- @param Core.Set#SET_ZONE RetreatZoneSet (Optional) The retreat zone set. Default is an empty set.
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:SetRetreatZones(RetreatZoneSet)
|
||||
self.retreatZones=RetreatZoneSet or SET_ZONE:New()
|
||||
@@ -592,7 +592,7 @@ end
|
||||
|
||||
--- Set suppression on. average, minimum and maximum time a unit is suppressed each time it gets hit.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param #number Tave Average time [seconds] a group will be suppressed. Default is 15 seconds.
|
||||
-- @param #number Tave (Optional) Average time [seconds] a group will be suppressed. Default is 15 seconds.
|
||||
-- @param #number Tmin (Optional) Minimum time [seconds] a group will be suppressed. Default is 5 seconds.
|
||||
-- @param #number Tmax (Optional) Maximum time a group will be suppressed. Default is 25 seconds.
|
||||
-- @return #ARMYGROUP self
|
||||
@@ -995,10 +995,10 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number Speed Speed in knots. Default cruise speed.
|
||||
-- @param #number Formation Formation of the group.
|
||||
-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default cruise speed.
|
||||
-- @param #number Formation (Optional) Formation of the group.
|
||||
function ARMYGROUP:onbeforeUpdateRoute(From, Event, To, n, N, Speed, Formation)
|
||||
|
||||
-- Is transition allowed? We assume yes until proven otherwise.
|
||||
@@ -1082,10 +1082,10 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number Speed Speed in knots. Default cruise speed.
|
||||
-- @param #number Formation Formation of the group.
|
||||
-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default cruise speed.
|
||||
-- @param #number Formation (Optional) Formation of the group.
|
||||
function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation)
|
||||
|
||||
-- Update route from this waypoint number onwards.
|
||||
@@ -1358,7 +1358,7 @@ end
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate where to go.
|
||||
-- @param #number Speed Speed in knots. Default cruise speed.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default cruise speed.
|
||||
-- @param #number Formation Formation of the group.
|
||||
-- @param #number ResumeRoute If true, resume route after detour point was reached. If false, the group will stop at the detour point and wait for futher commands.
|
||||
function ARMYGROUP:onafterDetour(From, Event, To, Coordinate, Speed, Formation, ResumeRoute)
|
||||
@@ -1738,7 +1738,7 @@ end
|
||||
-- @param #string To To state.
|
||||
-- @param Wrapper.Group#GROUP Group the group to be engaged.
|
||||
-- @param #number Speed Speed in knots.
|
||||
-- @param #string Formation Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`.
|
||||
-- @param #string Formation (Optional) Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`.
|
||||
function ARMYGROUP:onbeforeEngageTarget(From, Event, To, Target, Speed, Formation)
|
||||
|
||||
local dt=nil
|
||||
@@ -1779,7 +1779,7 @@ end
|
||||
-- @param #string To To state.
|
||||
-- @param Ops.Target#TARGET Target The target to be engaged. Can also be a group or unit.
|
||||
-- @param #number Speed Attack speed in knots.
|
||||
-- @param #string Formation Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`.
|
||||
-- @param #string Formation (Optional) Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`.
|
||||
function ARMYGROUP:onafterEngageTarget(From, Event, To, Target, Speed, Formation)
|
||||
self:T(self.lid.."Engaging Target")
|
||||
|
||||
@@ -1983,10 +1983,10 @@ end
|
||||
--- Add an a waypoint to the route.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint.
|
||||
-- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed.
|
||||
-- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #string Formation Formation the group will use.
|
||||
-- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default is default cruise speed or 70% of max speed.
|
||||
-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #string Formation (Optional) Formation the group will use.
|
||||
-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table.
|
||||
function ARMYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Formation, Updateroute)
|
||||
|
||||
@@ -2047,8 +2047,8 @@ end
|
||||
|
||||
--- Initialize group parameters. Also initializes waypoints if self.waypoints is nil.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param #table Template Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @param #table Template (Optional) Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:_InitGroup(Template, Delay)
|
||||
|
||||
@@ -2145,9 +2145,9 @@ end
|
||||
|
||||
--- Switch to a specific formation.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param #number Formation New formation the group will fly in. Default is the setting of `SetDefaultFormation()`.
|
||||
-- @param #boolean Permanently If true, formation always used from now on.
|
||||
-- @param #boolean NoRouteUpdate If true, route is not updated.
|
||||
-- @param #number Formation (Optional) New formation the group will fly in. Default is the setting of `SetDefaultFormation()`.
|
||||
-- @param #boolean Permanently (Optional) If true, formation always used from now on. Defaults to false.
|
||||
-- @param #boolean NoRouteUpdate (Optional) If true, route is not updated. Defaults to false.
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:SwitchFormation(Formation, Permanently, NoRouteUpdate)
|
||||
|
||||
@@ -2191,7 +2191,7 @@ end
|
||||
|
||||
--- Find the neares ammo supply group within a given radius.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param #number Radius Search radius in NM. Default 30 NM.
|
||||
-- @param #number Radius (Optional) Search radius in NM. Default 30 NM.
|
||||
-- @return Wrapper.Group#GROUP Closest ammo supplying group or `nil` if no group is in the given radius.
|
||||
-- @return #number Distance to closest group in meters.
|
||||
function ARMYGROUP:FindNearestAmmoSupply(Radius)
|
||||
@@ -2332,6 +2332,213 @@ function ARMYGROUP:onafterUnsuppressed(From, Event, To)
|
||||
|
||||
end
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- HuntingPatrol.lua
|
||||
--
|
||||
-- Adds simple "hunting patrol" behavior on top of ARMYGROUP:
|
||||
--
|
||||
-- * Group patrols normally using its existing waypoints
|
||||
-- * While combat-ready, periodically scans a zone for enemies
|
||||
-- * When an enemy is found, lock it and call EngageTarget()
|
||||
-- * Stay on that target until it dies
|
||||
-- * When target is dead, Disengage() and let ARMYGROUP resume patrol
|
||||
----------------------------------------------------------------
|
||||
|
||||
--- Module table
|
||||
ARMYGROUP.HuntingPatrol = {}
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- ARMYGROUP extension state
|
||||
----------------------------------------------------------------
|
||||
-- We store a few extra fields on ARMYGROUP:
|
||||
-- hp_zone : ZONE object to hunt inside
|
||||
-- hp_speed : speed in knots when engaging
|
||||
-- hp_formation : formation string when engaging
|
||||
-- hp_target : currently locked UNIT (or nil)
|
||||
-- hp_timer : TIMER object for periodic updates
|
||||
-- hp_interval : scan interval in seconds
|
||||
----------------------------------------------------------------
|
||||
|
||||
--- Enable hunting patrol behavior for this ARMYGROUP.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to hunt inside.
|
||||
-- @param #number Speed Speed in knots when engaging.
|
||||
-- @param #string Formation Formation used during engagement (optional).
|
||||
-- @param #number Interval Scan interval in seconds (optional, default 5).
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:EnableHuntingPatrol(Zone, Speed, Formation, Interval)
|
||||
|
||||
self.hp_zone = Zone
|
||||
self.hp_speed = tonumber(Speed) or 20
|
||||
self.hp_formation = Formation or nil
|
||||
|
||||
-- Force numeric, safe interval
|
||||
local intervalNum = tonumber(Interval)
|
||||
if not intervalNum or intervalNum <= 0 then
|
||||
intervalNum = 5
|
||||
end
|
||||
self.hp_interval = intervalNum
|
||||
|
||||
self.hp_target = nil
|
||||
|
||||
if self.hp_timer then
|
||||
self.hp_timer:Stop()
|
||||
self.hp_timer = nil
|
||||
end
|
||||
|
||||
self.hp_timer = TIMER:New(self._HuntingPatrolUpdate, self):Start(1, self.hp_interval)
|
||||
|
||||
self:T(self.lid .. "HuntingPatrol: enabled. Interval=" .. tostring(self.hp_interval))
|
||||
return self
|
||||
end
|
||||
|
||||
--- Disable hunting patrol behavior.
|
||||
-- @param #ARMYGROUP self
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:DisableHuntingPatrol()
|
||||
if self.hp_timer then
|
||||
self.hp_timer:Stop()
|
||||
self.hp_timer = nil
|
||||
end
|
||||
if self.HuntingEnemySet then
|
||||
self.HuntingEnemySet:FilterStop()
|
||||
self.HuntingEnemySet = nil
|
||||
end
|
||||
self.hp_target = nil
|
||||
self:T(self.lid .. "HuntingPatrol: disabled.")
|
||||
return self
|
||||
end
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Internal: periodic update
|
||||
----------------------------------------------------------------
|
||||
-- This is called by the TIMER created in EnableHuntingPatrol().
|
||||
-- It:
|
||||
--
|
||||
-- - checks if group is alive & combat-ready
|
||||
-- - if a target is locked, checks if it is still alive
|
||||
-- - if no target, scans the zone for enemies and locks one
|
||||
-- - uses ARMYGROUP:EngageTarget() / Disengage()
|
||||
--
|
||||
----------------------------------------------------------------
|
||||
-- @param #ARMYGROUP self
|
||||
-- @return #ARMYGROUP self
|
||||
function ARMYGROUP:_HuntingPatrolUpdate()
|
||||
|
||||
-- If group is dead, stop.
|
||||
if not self:IsAlive() then
|
||||
self:DisableHuntingPatrol()
|
||||
return
|
||||
end
|
||||
|
||||
-- Only run during PATROLZONE missions
|
||||
local mission = self:GetMissionCurrent()
|
||||
if not mission or mission.type ~= AUFTRAG.Type.PATROLZONE then
|
||||
return
|
||||
end
|
||||
|
||||
-- Only act when combat-ready
|
||||
if not self:IsCombatReady() then
|
||||
return
|
||||
end
|
||||
|
||||
-- If we have a locked target, keep or drop it
|
||||
if self.hp_target then
|
||||
if not self.hp_target:IsAlive() then
|
||||
self.hp_target = nil
|
||||
self:Disengage()
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- No target → scan for new enemies
|
||||
local enemy = self:_HuntingPatrolFindEnemyInZone(self.hp_zone)
|
||||
if enemy then
|
||||
self.hp_target = enemy
|
||||
self:EngageTarget(enemy, self.hp_speed, self.hp_formation)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Internal: find one enemy ground unit inside a zone
|
||||
----------------------------------------------------------------
|
||||
-- Very simple: build a SET_UNIT, filter by coalition and zone,
|
||||
-- and pick the closest unit to this ARMYGROUP.
|
||||
----------------------------------------------------------------
|
||||
-- @param #ARMYGROUP self
|
||||
-- @param Core.Zone#ZONE Zone The zont to look at
|
||||
-- @return Wrapper.Unit#UNIT Enemy The nearest enemy UNIT in zone
|
||||
function ARMYGROUP:_HuntingPatrolFindEnemyInZone(Zone)
|
||||
|
||||
if not Zone then return nil end
|
||||
|
||||
-- Determine our coalition.
|
||||
local myCoalition = self:GetCoalition()
|
||||
|
||||
if not self.HuntingEnemySet then
|
||||
|
||||
self.HuntingEnemySet = SET_UNIT:New()
|
||||
:FilterActive(true)
|
||||
:FilterCategories("ground")
|
||||
:FilterStart()
|
||||
|
||||
end
|
||||
|
||||
local enemies = {}
|
||||
|
||||
self.HuntingEnemySet:ForEachUnitCompletelyInZone(Zone, function(unit)
|
||||
if unit:GetCoalition() ~= myCoalition and unit:IsAlive() then
|
||||
table.insert(enemies, unit)
|
||||
end
|
||||
end)
|
||||
|
||||
if #enemies == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Pick the closest enemy.
|
||||
local myCoord = self:GetCoordinate()
|
||||
|
||||
table.sort(enemies, function(a, b)
|
||||
return myCoord:Get2DDistance(a:GetCoordinate()) <
|
||||
myCoord:Get2DDistance(b:GetCoordinate())
|
||||
end)
|
||||
|
||||
return enemies[1]
|
||||
end
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Optional helper: convenience wrapper for your campaign code
|
||||
----------------------------------------------------------------
|
||||
-- Example usage in your ArmyManagement:
|
||||
--
|
||||
-- local group = GROUP:FindByName("MyDefenseGroup")
|
||||
-- local army = ARMYGROUP:New(group)
|
||||
-- army:SetPatrolAdInfinitum(true)
|
||||
-- army:EnableHuntingPatrol(myZone, 20, "Off Road", 5)
|
||||
--
|
||||
-- ARMYGROUP will:
|
||||
--
|
||||
-- * patrol its waypoints forever
|
||||
-- * periodically scan myZone
|
||||
-- * when an enemy appears, EngageTarget()
|
||||
-- * when target dies, Disengage() and resume patrol
|
||||
--
|
||||
----------------------------------------------------------------
|
||||
-- @param Wrapper.Group#GROUP group The GROUP object to be made into an ARMYGROUP and send hunting.
|
||||
-- @param Core.Zone#ZONE zone The zone object where to search for enemies.
|
||||
-- @param #number speed Speed in knots when engaging.
|
||||
-- @param #string formation Formation used during engagement (optional).
|
||||
-- @param #number interval Scan interval in seconds (optional, default 5).
|
||||
-- @return #ARMYGROUP ArmyGroup The new ArmyGroup.
|
||||
function ARMYGROUP.EnableHuntingPatrolForGroup(group, zone, speed, formation, interval)
|
||||
local army = ARMYGROUP:New(group)
|
||||
army:SetPatrolAdInfinitum(true)
|
||||
army:EnableHuntingPatrol(zone, speed, formation, interval)
|
||||
return army
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **applevangelist**
|
||||
-- @date Last Update July 2025
|
||||
-- @date Last Update Feb 2026
|
||||
-- @module Ops.AWACS
|
||||
-- @image OPS_AWACS.jpg
|
||||
|
||||
@@ -1410,16 +1410,18 @@ end
|
||||
|
||||
--- [User] Set the tactical information option, create 10 radio channels groups can subscribe and get Bogey Dope on a specific frequency automatically. You **need** to set up SRS first before using this!
|
||||
-- @param #AWACS self
|
||||
-- @param #number BaseFreq Base Frequency to use, defaults to 130.
|
||||
-- @param #number Increase Increase to use, defaults to 0.5, thus channels created are 130, 130.5, 131 .. etc.
|
||||
-- @param #number Modulation Modulation to use, defaults to radio.modulation.AM.
|
||||
-- @param #number BaseFreq (Optional) Base Frequency to use, defaults to 130.
|
||||
-- @param #number Increase (Optional) Increase to use, defaults to 0.5, thus channels created are 130, 130.5, 131 .. etc.
|
||||
-- @param #number Modulation (Optional) Modulation to use, defaults to radio.modulation.AM.
|
||||
-- @param #number Interval Seconds between each update call.
|
||||
-- @param #number Number Number of Frequencies to create, can be 1..10.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
||||
function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number,Provider,Speaker)
|
||||
self:T(self.lid.."SetTacticalRadios")
|
||||
if not self.AwacsSRS then
|
||||
MESSAGE:New("AWACS: Setup SRS in your code BEFORE trying to add tac radios please!",30,"ERROR",true):ToLog():ToAll()
|
||||
MESSAGE:New("AWACS: Setup SRS in your code BEFORE trying to add tactical radios please!",30,"ERROR",true):ToLog():ToAll()
|
||||
return self
|
||||
end
|
||||
self.TacticalMenu = true
|
||||
@@ -1440,6 +1442,9 @@ function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
||||
self.TacticalSRS:SetGender(self.Gender)
|
||||
self.TacticalSRS:SetCulture(self.Culture)
|
||||
self.TacticalSRS:SetVoice(self.Voice)
|
||||
if Speaker then
|
||||
self.TacticalSRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.TacticalSRS:SetPort(self.Port)
|
||||
self.TacticalSRS:SetLabel("AWACS")
|
||||
self.TacticalSRS:SetVolume(self.Volume)
|
||||
@@ -1448,6 +1453,9 @@ function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
||||
self.TacticalSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||
self.TacticalSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.TacticalSRS:SetProvider(Provider)
|
||||
end
|
||||
self.TacticalSRSQ = MSRSQUEUE:New("Tactical AWACS")
|
||||
end
|
||||
return self
|
||||
@@ -1694,8 +1702,8 @@ end
|
||||
|
||||
--- [User] Set TOS Time-on-Station in Hours
|
||||
-- @param #AWACS self
|
||||
-- @param #number AICHours AWACS stays this number of hours on station before shift change, default is 4.
|
||||
-- @param #number CapHours (optional) CAP stays this number of hours on station before shift change, default is 4.
|
||||
-- @param #number AICHours (Optional) AWACS stays this number of hours on station before shift change, default is 4.
|
||||
-- @param #number CapHours (Optional) CAP stays this number of hours on station before shift change, default is 4.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetTOS(AICHours,CapHours)
|
||||
self:T(self.lid.."SetTOS")
|
||||
@@ -1990,7 +1998,7 @@ end
|
||||
|
||||
--- [User] Set AWACS Player Guidance - influences missile callout and the "New" label in group callouts.
|
||||
-- @param #AWACS self
|
||||
-- @param #boolean Switch If true (default) it is on, if false, it is off.
|
||||
-- @param #boolean Switch (Optional) If true (default) it is on, if false, it is off.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetPlayerGuidance(Switch)
|
||||
if (Switch == nil) or (Switch == true) then
|
||||
@@ -2010,9 +2018,9 @@ end
|
||||
|
||||
--- [User] Set AWACS intercept timeline support distance.
|
||||
-- @param #AWACS self
|
||||
-- @param #number TacDistance Distance for TAC call, default 45nm
|
||||
-- @param #number MeldDistance Distance for Meld call, default 35nm
|
||||
-- @param #number ThreatDistance Distance for Threat call, default 25nm
|
||||
-- @param #number TacDistance (Optional) Distance for TAC call, default 45nm
|
||||
-- @param #number MeldDistance (Optional) Distance for Meld call, default 35nm
|
||||
-- @param #number ThreatDistance (Optional) Distance for Threat call, default 25nm
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetInterceptTimeline(TacDistance, MeldDistance, ThreatDistance)
|
||||
self.TacDistance = TacDistance or 45
|
||||
@@ -2119,12 +2127,12 @@ end
|
||||
|
||||
--- [User] Set AWACS flight details
|
||||
-- @param #AWACS self
|
||||
-- @param #number CallSign Defaults to CALLSIGN.AWACS.Magic
|
||||
-- @param #number CallSignNo Defaults to 1
|
||||
-- @param #number Angels Defaults to 25 (i.e. 25000 ft)
|
||||
-- @param #number Speed Defaults to 250kn
|
||||
-- @param #number Heading Defaults to 0 (North)
|
||||
-- @param #number Leg Defaults to 25nm
|
||||
-- @param #number CallSign (Optional) Defaults to CALLSIGN.AWACS.Magic
|
||||
-- @param #number CallSignNo (Optional) Defaults to 1
|
||||
-- @param #number Angels (Optional) Defaults to 25 (i.e. 25000 ft)
|
||||
-- @param #number Speed (Optional) Defaults to 250kn
|
||||
-- @param #number Heading (Optional) Defaults to 0 (North)
|
||||
-- @param #number Leg (Optional) Defaults to 25nm
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetAwacsDetails(CallSign,CallSignNo,Angels,Speed,Heading,Leg)
|
||||
self:T(self.lid.."SetAwacsDetails")
|
||||
@@ -2176,18 +2184,20 @@ end
|
||||
|
||||
--- [User] Set AWACS SRS TTS details - see @{Sound.SRS} for details. `SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible.
|
||||
-- @param #AWACS self
|
||||
-- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #string Gender Defaults to "male"
|
||||
-- @param #string Culture Defaults to "en-US"
|
||||
-- @param #number Port Defaults to 5002
|
||||
-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #string Gender (Optional) Defaults to "male"
|
||||
-- @param #string Culture (Optional) Defaults to "en-US"
|
||||
-- @param #number Port (Optional) Defaults to 5002
|
||||
-- @param #string Voice (Optional) Use a specifc voice with the @{Sound.SRS#SetVoice} function, e.g, `:SetVoice("Microsoft Hedda Desktop")`.
|
||||
-- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
|
||||
-- @param #number Volume Volume - between 0.0 (silent) and 1.0 (loudest)
|
||||
-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest) Defaults to 1.0.
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string Backend (Optional) Your MSRS Backend if different from your config file settings, e.g. MSRS.Backend.SRSEXE or MSRS.Backend.GRPC
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Backend)
|
||||
function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Backend,Provider,Speaker)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
self.Gender = Gender or MSRS.gender or "male"
|
||||
@@ -2198,6 +2208,7 @@ function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey
|
||||
self.AccessKey = AccessKey
|
||||
self.Volume = Volume or 1.0
|
||||
self.Backend = Backend or MSRS.backend
|
||||
self.Provider = Provider
|
||||
BASE:I({backend = self.Backend})
|
||||
self.AwacsSRS = MSRS:New(self.PathToSRS,self.MultiFrequency,self.MultiModulation,self.Backend)
|
||||
self.AwacsSRS:SetCoalition(self.coalition)
|
||||
@@ -2206,10 +2217,16 @@ function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey
|
||||
self.AwacsSRS:SetPort(self.Port)
|
||||
self.AwacsSRS:SetLabel("AWACS")
|
||||
self.AwacsSRS:SetVolume(Volume)
|
||||
if Speaker then
|
||||
self.AwacsSRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
if self.PathToGoogleKey then
|
||||
--self.AwacsSRS:SetGoogle(self.PathToGoogleKey)
|
||||
self.AwacsSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||
self.AwacsSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.AwacsSRS:SetProvider(Provider)
|
||||
end
|
||||
-- Pre-configured Google?
|
||||
if (not PathToGoogleKey) and self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
@@ -2223,25 +2240,27 @@ end
|
||||
|
||||
--- [User] Set AWACS Voice Details for AI CAP Planes - SRS TTS - see @{Sound.SRS} for details
|
||||
-- @param #AWACS self
|
||||
-- @param #string Gender Defaults to "male"
|
||||
-- @param #string Culture Defaults to "en-US"
|
||||
-- @param #string Gender (Optional) Defaults to "male"
|
||||
-- @param #string Culture (Optional) Defaults to "en-US"
|
||||
-- @param #string Voice (Optional) Use a specifc voice with the @{#MSRS.SetVoice} function, e.g, `:SetVoice("Microsoft Hedda Desktop")`.
|
||||
-- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetSRSVoiceCAP(Gender, Culture, Voice)
|
||||
function AWACS:SetSRSVoiceCAP(Gender, Culture, Voice, Speaker)
|
||||
self:T(self.lid.."SetSRSVoiceCAP")
|
||||
self.CAPGender = Gender or "male"
|
||||
self.CAPCulture = Culture or "en-US"
|
||||
self.CAPVoice = Voice or "en-GB-Standard-B"
|
||||
self.CAPSpeaker = Speaker
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Set AI CAP Plane Details
|
||||
-- @param #AWACS self
|
||||
-- @param #number Callsign Callsign name of AI CAP, e.g. CALLSIGN.Aircraft.Dodge. Defaults to CALLSIGN.Aircraft.Colt. Note that not all available callsigns work for all plane types.
|
||||
-- @param #number MaxAICap Maximum number of AI CAP planes on station that AWACS will set up automatically. Default to 4.
|
||||
-- @param #number TOS Time on station, in hours. AI planes might go back to base earlier if they run out of fuel or missiles.
|
||||
-- @param #number Speed Airspeed to be used in knots. Will be adjusted to flight height automatically. Defaults to 270.
|
||||
-- @param #number Callsign (Optional) Callsign name of AI CAP, e.g. CALLSIGN.Aircraft.Dodge. Defaults to CALLSIGN.Aircraft.Colt. Note that not all available callsigns work for all plane types.
|
||||
-- @param #number MaxAICap (Optional) Maximum number of AI CAP planes on station that AWACS will set up automatically. Default to 4.
|
||||
-- @param #number TOS (Optional) Time on station, in hours. AI planes might go back to base earlier if they run out of fuel or missiles. Defaults to 4.
|
||||
-- @param #number Speed (Optional) Airspeed to be used in knots. Will be adjusted to flight height automatically. Defaults to 270.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetAICAPDetails(Callsign,MaxAICap,TOS,Speed)
|
||||
self:T(self.lid.."SetAICAPDetails")
|
||||
@@ -2257,7 +2276,7 @@ end
|
||||
-- @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.
|
||||
-- @param #number EscortEngageMaxDistance (Optional) Escorts engage air targets max this NM away, defaults to 45NM.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetEscort(EscortNumber,Formation,OffsetVector,EscortEngageMaxDistance)
|
||||
self:T(self.lid.."SetEscort")
|
||||
@@ -3823,7 +3842,13 @@ function AWACS:_CheckInAI(FlightGroup,Group,AuftragsNr)
|
||||
CAPVoice = self.CapVoices[math.floor(math.random(1,10))]
|
||||
end
|
||||
|
||||
FlightGroup:SetSRS(self.PathToSRS,self.CAPGender,self.CAPCulture,CAPVoice,self.Port,self.PathToGoogleKey,"FLIGHT",1)
|
||||
FlightGroup:SetSRS(self.PathToSRS,self.CAPGender,self.CAPCulture,CAPVoice,self.Port,self.PathToGoogleKey,"FLIGHT",1,self.Provider)
|
||||
if self.Backend then
|
||||
FlightGroup.srs:SetBackend(self.Backend)
|
||||
end
|
||||
if self.CAPSpeaker then
|
||||
FlightGroup.srs:SetSpeakerPiper(self.CAPSpeaker)
|
||||
end
|
||||
|
||||
local checkai = self.gettext:GetEntry("CHECKINAI",self.locale)
|
||||
text = string.format(checkai,self.callsigntxt, managedgroup.CallSign, self.CAPTimeOnStation, self.AOName)
|
||||
@@ -6855,7 +6880,7 @@ function AWACS:onafterCheckTacticalQueue(From,Event,To)
|
||||
end
|
||||
-- AI AWACS Speaking
|
||||
local gtext = RadioEntry.TextTTS
|
||||
if self.PathToGoogleKey then
|
||||
if self.PathToGoogleKey and self.Backend ~= MSRS.Backend.HOUND then
|
||||
gtext = string.format("<speak><prosody rate='medium'>%s</prosody></speak>",gtext)
|
||||
end
|
||||
self.TacticalSRSQ:NewTransmission(gtext,nil,self.TacticalSRS,nil,0.5,nil,nil,nil,frequency,self.TacticalModulation)
|
||||
@@ -6914,7 +6939,7 @@ function AWACS:onafterCheckRadioQueue(From,Event,To)
|
||||
|
||||
if not RadioEntry.FromAI then
|
||||
-- AI AWACS Speaking
|
||||
if self.PathToGoogleKey then
|
||||
if self.PathToGoogleKey and self.Backend ~= MSRS.Backend.HOUND then
|
||||
local gtext = RadioEntry.TextTTS
|
||||
gtext = string.format("<speak><prosody rate='medium'>%s</prosody></speak>",gtext)
|
||||
self.AwacsSRS:PlayTextExt(gtext,nil,self.MultiFrequency,self.MultiModulation,self.Gender,self.Culture,self.Voice,self.Volume,"AWACS")
|
||||
@@ -6927,7 +6952,7 @@ function AWACS:onafterCheckRadioQueue(From,Event,To)
|
||||
if RadioEntry.GroupID and RadioEntry.GroupID ~= 0 then
|
||||
local managedgroup = self.ManagedGrps[RadioEntry.GroupID] -- #AWACS.ManagedGroup
|
||||
if managedgroup and managedgroup.FlightGroup and managedgroup.FlightGroup:IsAlive() then
|
||||
if self.PathToGoogleKey then
|
||||
if self.PathToGoogleKey and self.Backend ~= MSRS.Backend.HOUND then
|
||||
local gtext = RadioEntry.TextTTS
|
||||
gtext = string.format("<speak><prosody rate='medium'>%s</prosody></speak>",gtext)
|
||||
managedgroup.FlightGroup:RadioTransmission(gtext,1,false)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
-- @image OPS_CSAR.jpg
|
||||
|
||||
---
|
||||
-- Last Update Jan 2026
|
||||
-- Last Update Feb 2026
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
||||
@@ -136,11 +136,16 @@
|
||||
-- mycsar.SRSModulation = radio.modulation.AM -- modulation
|
||||
-- mycsar.SRSport = 5002 -- and SRS Server port
|
||||
-- mycsar.SRSCulture = "en-GB" -- SRS voice culture
|
||||
-- mycsar.SRSVoice = nil -- SRS voice for downed pilot, relevant for Google TTS
|
||||
-- mycsar.SRSGPathToCredentials = nil -- Path to your Google credentials json file, set this if you want to use Google TTS
|
||||
-- mycsar.SRSVoice = nil -- TTS voice for downed pilot, relevant for Google TTS
|
||||
-- mycsar.SRSSpeaker = nil -- TTS sub-voice, only relevant for Piper TTS with Hound backend
|
||||
-- mycsar.SRSGPathToCredentials = nil -- Path to your Google credentials json file, set this if you want to use Google TTS as provider
|
||||
-- mycsar.SRSBackend = MSRS.Backend.SRSEXE -- default backend is windows
|
||||
-- mycsar.SRSProvider = MSRS.Provider.WINDOWS -- default TTS provider is windows
|
||||
-- mycsar.SRSSpeed = 1.0 -- default speech speed - does not work with all providers
|
||||
-- mycsar.SRSVolume = 1 -- Volume, between 0 and 1
|
||||
-- mycsar.SRSGender = "male" -- male or female voice
|
||||
-- mycsar.CSARVoice = MSRS.Voices.Google.Standard.en_US_Standard_A -- SRS voice for CSAR Controller, relevant for Google TTS
|
||||
-- mycsar.CSARVoice = MSRS.Voices.Google.Standard.en_US_Standard_A -- TTS voice for CSAR Controller, relevant for Google TTS
|
||||
-- mycsar.CSARSpeaker = nil -- TTS sub-voice, only relevant for Piper TTS with Hound backend
|
||||
-- mycsar.CSARVoiceMS = MSRS.Voices.Microsoft.Hedda -- SRS voice for CSAR Controller, relevant for MS Desktop TTS
|
||||
-- mycsar.coordinate -- Coordinate from which CSAR TTS is sending. Defaults to a random MASH object position
|
||||
-- --
|
||||
@@ -231,6 +236,65 @@
|
||||
-- **Caveat:**
|
||||
-- Dropped troop noMessage and forcedesc parameters aren't saved.
|
||||
--
|
||||
-- ## 6. Message localization
|
||||
--
|
||||
-- Use the following option to use one of the build-in translations,"en" is the default one:
|
||||
--
|
||||
-- mycsar.locale = "fr" -- available are "en", "de" and "fr" (English, German, French)
|
||||
--
|
||||
-- To add your own text, you can do this by adding your locale and translations for these texts before calling `CSAR:New()`:
|
||||
-- (NOTE - the lua placeholders like %s, %d must remain the same in type and number!)
|
||||
--
|
||||
-- CSAR.Messages.EN = {
|
||||
-- HEARYOULONG = "%s: %s. I hear you! Finally, that is music in my ears!\nI'll pop a smoke when you are %s away.\nLand or hover by the smoke.",
|
||||
-- HEARYOUSHORT = "%s: %s. I hear you! Finally, that is music in my ears!\nRequest a flare or smoke if you need.",
|
||||
-- WEARECRAMMED = "%s, %s. We\'re already crammed with %d guys! Sorry!",
|
||||
-- IAMINHELO = "%s: %s I\'m in! Get to the MASH ASAP! ",
|
||||
-- YOUARECLOSE = "%s: %s. You\'re close now! Land or hover at the smoke.",
|
||||
-- YOUARECLOSELONG = "%s: %s. You\'re close now! Land in a safe place, I will go there ",
|
||||
-- WAITMORE = "Wait till %s gets in. \nETA %d more seconds.",
|
||||
-- OPENTHEDOORIN = "Open the door to let me in!",
|
||||
-- HOVERABOVE = "Hovering above %s. \n\nHold hover for %d seconds to winch them up. \n\nIf the countdown stops you\'re too far away!",
|
||||
-- TOOHIGHWINCH = "Too high to winch %s \nReduce height and hover for 10 seconds!",
|
||||
-- OPENTHEDOOROUT = "Open the door to let me out!",
|
||||
-- TAKECLINIC = "%s: The %d pilot(s) have been taken to the\nmedical clinic. Good job!",
|
||||
-- KILOMETERS = " kilometer",
|
||||
-- NAUTMILES = " nautical miles",
|
||||
-- FIRINGFLARE = "%s - Firing signal flare at your %s o\'clock. Distance %s",
|
||||
-- NOPILOTSINRANGE = "No Pilots within %s",
|
||||
-- IRSTROBE = "%s - IR Strobe active at your %s o\'clock. Distance %s",
|
||||
-- POPPINGSMOKE = "%s - Popping smoke at your %s o\'clock. Distance %s",
|
||||
-- POPPINGSMOKEMASH = "%s - Popping smoke at the closest rescue point: %s",
|
||||
-- NORESCUEPOINTWITHIN = "No rescue point within %s",
|
||||
-- NOPILOTSONBOARD = "No Rescued Pilots onboard",
|
||||
-- MENUTOP = "CSAR",
|
||||
-- MENUACTIVE = "List Active CSAR",
|
||||
-- MENUCHECK = "Check Onboard",
|
||||
-- MENUFLARE = "Request Signal Flare",
|
||||
-- MENUSMOKE = "Request Smoke",
|
||||
-- MENUSTROBE = "Request IR Strobe",
|
||||
-- MENUMASH = "Smoke Closest MASH",
|
||||
-- BOARDED = "Onboard - RTB to FARP/Airfield or MASH: ",
|
||||
-- MAYDAY = "MAYDAY MAYDAY! %s is down. ",
|
||||
-- CONTACT = "Troops In Contact. %s requests CASEVAC. ",
|
||||
-- PICKUPZONE = "Pickup Zone at %s.",
|
||||
-- REQUESTSAR = "%s requests SAR at %s, beacon at %.2f KHz!",
|
||||
-- REQUESTSARBEACON = "%s requests SAR at %s, beacon at %.2f KHz!",
|
||||
-- KHZ = "kilo hertz",
|
||||
-- FILLAT = "at",
|
||||
-- FILLFOR = "for",
|
||||
-- },
|
||||
--
|
||||
-- e.g. for Spanish:
|
||||
--
|
||||
-- CSAR.Messages.ES = {
|
||||
-- HEARYOULONG = "%s: %s. ¡Te escucho! ¡Por fin, eso es música para mis oídos!\nLanzaré una señal de humo cuando estés a %s de distancia.\nAterrice o quédese en vuelo estacionario junto al humo.",
|
||||
-- HEARYOUSHORT = "%s: %s. ¡Te escucho! ¡Por fin, eso es música para mis oídos!\nSolicite una bengala o humo si lo necesita.",
|
||||
-- WEARECRAMMED = "%s, %s. ¡Ya estamos abarrotados con %d personas! ¡Lo siento!",
|
||||
-- IAMINHELO = "%s: %s ¡Estoy dentro! ¡Dirígete al MASH lo antes posible!",
|
||||
-- ...
|
||||
-- }
|
||||
--
|
||||
-- @field #CSAR
|
||||
CSAR = {
|
||||
ClassName = "CSAR",
|
||||
@@ -275,6 +339,129 @@ CSAR = {
|
||||
IRStrobeRuntime = 300,
|
||||
FARPRescueDistance = 500,
|
||||
EnableMenuSmokeMASH = true,
|
||||
locale = "en",
|
||||
}
|
||||
|
||||
---
|
||||
-- @field Messages
|
||||
CSAR.Messages = {
|
||||
EN = {
|
||||
HEARYOULONG = "%s: %s. I hear you! Finally, that is music in my ears!\nI'll pop a smoke when you are %s away.\nLand or hover by the smoke.",
|
||||
HEARYOUSHORT = "%s: %s. I hear you! Finally, that is music in my ears!\nRequest a flare or smoke if you need.",
|
||||
WEARECRAMMED = "%s, %s. We\'re already crammed with %d guys! Sorry!",
|
||||
IAMINHELO = "%s: %s I\'m in! Get to the MASH ASAP! ",
|
||||
YOUARECLOSE = "%s: %s. You\'re close now! Land or hover at the smoke.",
|
||||
YOUARECLOSELONG = "%s: %s. You\'re close now! Land in a safe place, I will go there ",
|
||||
WAITMORE = "Wait till %s gets in. \nETA %d more seconds.",
|
||||
OPENTHEDOORIN = "Open the door to let me in!",
|
||||
HOVERABOVE = "Hovering above %s. \n\nHold hover for %d seconds to winch them up. \n\nIf the countdown stops you\'re too far away!",
|
||||
TOOHIGHWINCH = "Too high to winch %s \nReduce height and hover for 10 seconds!",
|
||||
OPENTHEDOOROUT = "Open the door to let me out!",
|
||||
TAKECLINIC = "%s: The %d pilot(s) have been taken to the\nmedical clinic. Good job!",
|
||||
KILOMETERS = " kilometer",
|
||||
NAUTMILES = " nautical miles",
|
||||
FIRINGFLARE = "%s - Firing signal flare at your %s o\'clock. Distance %s",
|
||||
NOPILOTSINRANGE = "No Pilots within %s",
|
||||
IRSTROBE = "%s - IR Strobe active at your %s o\'clock. Distance %s",
|
||||
POPPINGSMOKE = "%s - Popping smoke at your %s o\'clock. Distance %s",
|
||||
POPPINGSMOKEMASH = "%s - Popping smoke at the closest rescue point: %s",
|
||||
NORESCUEPOINTWITHIN = "No rescue point within %s",
|
||||
NOPILOTSONBOARD = "No Rescued Pilots onboard",
|
||||
MENUTOP = "CSAR",
|
||||
MENUACTIVE = "List Active CSAR",
|
||||
MENUCHECK = "Check Onboard",
|
||||
MENUFLARE = "Request Signal Flare",
|
||||
MENUSMOKE = "Request Smoke",
|
||||
MENUSTROBE = "Request IR Strobe",
|
||||
MENUMASH = "Smoke Closest MASH",
|
||||
BOARDED = "Onboard - RTB to FARP/Airfield or MASH: ",
|
||||
MAYDAY = "MAYDAY MAYDAY! %s is down. ",
|
||||
CONTACT = "Troops In Contact. %s requests CASEVAC. ",
|
||||
PICKUPZONE = "Pickup Zone at %s.",
|
||||
REQUESTSAR = "%s requests SAR at %s, beacon at %.2f KHz!",
|
||||
REQUESTSARBEACON = "%s requests SAR at %s, beacon at %.2f KHz!",
|
||||
KHZ = "kilo hertz",
|
||||
FILLAT = "at",
|
||||
FILLFOR = "for",
|
||||
},
|
||||
DE = {
|
||||
HEARYOULONG = "%s: %s. Ich höre Sie! Endlich, das ist Musik in meinen Ohren!\nIch zünde eine Rauchgranate, wenn Sie %s entfernt sind.\nLanden Sie oder hovern Sie beim Rauch.",
|
||||
HEARYOUSHORT = "%s: %s. Ich höre Sie! Endlich, das ist Musik in meinen Ohren!\nFordern Sie eine Leuchtrakete oder Rauch an, falls nötig.",
|
||||
IAMINHELO = "%s: %s Ich bin drin! Jetzt sofort zum Lazarett! ",
|
||||
YOUARECLOSE = "%s: %s. Sie sind jetzt nah dran! Landen Sie oder hovern Sie beim Rauch.",
|
||||
YOUARECLOSELONG = "%s: %s. Sie sind jetzt nah dran! Landen Sie an einem sicheren Ort, ich komme dorthin.",
|
||||
WAITMORE = "Warten Sie, bis %s eingestiegen ist. \nNoch %d Sekunden.",
|
||||
OPENTHEDOORIN = "Öffnen Sie die Tür, damit ich einsteigen kann!",
|
||||
HOVERABOVE = "Hovere über %s. \n\nPositon für %d Sekunden halten, um zu winschen. \n\nWenn der Countdown stoppt, sind Sie zu weit entfernt!",
|
||||
TOOHIGHWINCH = "Zu hoch, um %s zu winschen. \nHöhe reduzieren und %d Sekunden halten!",
|
||||
OPENTHEDOOROUT = "Öffnen Sie die Tür, damit ich aussteigen kann!",
|
||||
FIRINGFLARE = "%s - Feuere Signalrakete auf Ihrer %s-Uhr-Position ab. Entfernung %s",
|
||||
NOPILOTSINRANGE = "Keine Piloten in %s Reichweite",
|
||||
IRSTROBE = "%s - IR-Blinklicht aktiv auf Ihrer %s-Uhr-Position. Entfernung %s",
|
||||
POPPINGSMOKE = "%s - Zünde Rauchgranate auf Ihrer %s-Uhr-Position. Entfernung %s",
|
||||
POPPINGSMOKEMASH = "%s - Zünde Rauchgranate am nächsten Rettungspunkt: %s",
|
||||
NORESCUEPOINTWITHIN = "Kein Rettungspunkt innerhalb von %s",
|
||||
NOPILOTSONBOARD = "Keine geretteten Piloten an Bord",
|
||||
MENUTOP = "CSAR",
|
||||
MENUACTIVE = "Aktive CSAR",
|
||||
MENUCHECK = "Ladung prüfen",
|
||||
MENUFLARE = "Signalrakete anfordern",
|
||||
MENUSMOKE = "Rauch anfordern",
|
||||
MENUSTROBE = "IR-Blinklicht anfordern",
|
||||
MENUMASH = "Nächstes MASH markieren",
|
||||
WEARECRAMMED = "%s, %s. Wir sind bereits voll mit %d Mann! Tut mir leid!",
|
||||
TAKECLINIC = "%s: Die %d Pilot(en) wurden ins\nLazarett gebracht. Gute Arbeit!",
|
||||
KILOMETERS = " Kilometer",
|
||||
NAUTMILES = " Meilen",
|
||||
BOARDED = "An Bord - RTB zu FARP/Flugplatz oder Lazarett: ",
|
||||
MAYDAY = "MAYDAY MAYDAY! %s ist abgestürzt. ",
|
||||
CONTACT = "Truppen im Kontakt. %s fordern CASEVAC an. ",
|
||||
PICKUPZONE = "Aufnahmezone bei %s.",
|
||||
REQUESTSAR = "%s fordert SAR bei %s an, ADF %.2f KHz!",
|
||||
REQUESTSARBEACON = "%s fordert SAR bei %s an, ADF %.2f KHz!",
|
||||
KHZ = "Kilohertz",
|
||||
FILLAT = "bei",
|
||||
FILLFOR = "für",
|
||||
},
|
||||
FR = {
|
||||
HEARYOULONG = "%s: %s. Je vous entends! Enfin, c'est de la musique dans mes oreilles!\nJe lancerai une fumée quand vous serez à %s.\nAtterrissez ou survolez la fumée.",
|
||||
HEARYOUSHORT = "%s: %s. Je vous entends! Enfin, c'est de la musique dans mes oreilles!\nDemandez une fusée éclairante ou de la fumée si nécessaire.",
|
||||
IAMINHELO = "%s: %s Je suis à bord! Direction le MASH immédiatement! ",
|
||||
YOUARECLOSE = "%s: %s. Vous êtes proche maintenant! Atterrissez ou survolez la fumée.",
|
||||
YOUARECLOSELONG = "%s: %s. Vous êtes proche maintenant! Atterrissez dans un endroit sûr, j'y vais.",
|
||||
WAITMORE = "Attendez que %s monte à bord. \nEncore %d secondes.",
|
||||
OPENTHEDOORIN = "Ouvrez la porte pour me laisser entrer!",
|
||||
HOVERABOVE = "En vol stationnaire au-dessus de %s. \n\nMaintenir la position pendant %d secondes pour hélitreuiller. \n\nSi le compte à rebours s'arrête, vous êtes trop loin!",
|
||||
TOOHIGHWINCH = "Trop haut pour hélitreuiller %s. \nRéduisez l'altitude et maintenez la position pendant %d secondes!",
|
||||
OPENTHEDOOROUT = "Ouvrez la porte pour me laisser sortir!",
|
||||
FIRINGFLARE = "%s - Tir d'une fusée éclairante à vos %s heures. Distance %s",
|
||||
NOPILOTSINRANGE = "Aucun pilote dans un rayon de %s",
|
||||
IRSTROBE = "%s - Stroboscope IR actif à vos %s heures. Distance %s",
|
||||
POPPINGSMOKE = "%s - Lancement de fumigène à vos %s heures. Distance %s",
|
||||
POPPINGSMOKEMASH = "%s - Lancement de fumigène au point de sauvetage le plus proche: %s",
|
||||
NORESCUEPOINTWITHIN = "Aucun point de sauvetage dans un rayon de %s",
|
||||
NOPILOTSONBOARD = "Aucun pilote secouru à bord",
|
||||
MENUTOP = "CSAR",
|
||||
MENUACTIVE = "Lister les CSAR actifs",
|
||||
MENUCHECK = "Vérifier qui est à bord",
|
||||
MENUFLARE = "Demander une fusée éclairante",
|
||||
MENUSMOKE = "Demander un fumigène",
|
||||
MENUSTROBE = "Demander un stroboscope IR",
|
||||
MENUMASH = "Fumée au MASH le plus proche",
|
||||
WEARECRAMMED = "%s, %s. Nous sommes déjà pleins avec %d hommes! Désolé!",
|
||||
TAKECLINIC = "%s: Les %d pilote(s) ont été transportés à \n l'hôpital. Bon travail!",
|
||||
KILOMETERS = " kilomètres",
|
||||
NAUTMILES = " milles nautiques",
|
||||
BOARDED = "À bord - RTB vers FARP/Aérodrome ou MASH: ",
|
||||
MAYDAY = "MAYDAY MAYDAY ! %s est à terre. ",
|
||||
CONTACT = "Troupes au contact. %s demande un CASEVAC. ",
|
||||
PICKUPZONE = "Zone de ramassage à %s.",
|
||||
REQUESTSAR = "%s demande un SAR à %s, balise à %.2f KHz!",
|
||||
REQUESTSARBEACON = "%s demande un SAR à %s, balise à %.2f KHz!",
|
||||
KHZ = "kilohertz",
|
||||
FILLAT = "au",
|
||||
FILLFOR = "pour",
|
||||
},
|
||||
}
|
||||
|
||||
--- Downed pilots info.
|
||||
@@ -317,10 +504,13 @@ CSAR.AircraftType["OH58D"] = 2
|
||||
CSAR.AircraftType["CH-47Fbl1"] = 31
|
||||
CSAR.AircraftType["AH-6J"] = 2
|
||||
CSAR.AircraftType["MH-6J"] = 2
|
||||
CSAR.AircraftType["Ka-50_3"] = 0
|
||||
CSAR.AircraftType["Ka-50"] = 0
|
||||
CSAR.AircraftType["AV8BNA"] = 0
|
||||
|
||||
--- CSAR class version.
|
||||
-- @field #string version
|
||||
CSAR.version="1.0.36"
|
||||
CSAR.version="1.1.39"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@@ -329,6 +519,7 @@ CSAR.version="1.0.36"
|
||||
-- DONE: SRS Integration (to be tested)
|
||||
-- TODO: Maybe - add option to smoke/flare closest MASH
|
||||
-- DONE: shagrat Add cargoWeight to helicopter when pilot boarded
|
||||
-- DONE: Localization
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- Constructor
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -499,7 +690,11 @@ function CSAR:New(Coalition, Template, Alias)
|
||||
self.SRSGender = "male" -- male or female
|
||||
self.CSARVoice = MSRS.Voices.Google.Standard.en_US_Standard_A
|
||||
self.CSARVoiceMS = MSRS.Voices.Microsoft.Hedda
|
||||
self.SRSBackend = MSRS.Backend.SRSEXE
|
||||
self.SRSProvider = MSRS.Provider.WINDOWS
|
||||
self.SRSSpeed = 1.0
|
||||
self.coordinate = nil -- Core.Point#COORDINATE
|
||||
self.locale = "en"
|
||||
|
||||
local AliaS = string.gsub(self.alias," ","_")
|
||||
self.filename = string.format("CSAR_%s_Persist.csv",AliaS)
|
||||
@@ -649,6 +844,23 @@ end
|
||||
--- Helper Functions ---
|
||||
------------------------
|
||||
|
||||
--- [Internal] Init localization
|
||||
-- @param #CSAR self
|
||||
-- @return #CSAR self
|
||||
function CSAR:_InitLocalization()
|
||||
self:T(self.lid.."_InitLocalization")
|
||||
self.gettext = TEXTANDSOUND:New("CSAR","en") -- Core.TextAndSound#TEXTANDSOUND
|
||||
for locale,table in pairs(self.Messages) do
|
||||
local Locale = string.lower(tostring(locale))
|
||||
self:T("**** Adding locale: "..Locale)
|
||||
for ID,Text in pairs(table) do
|
||||
self:T(string.format('Adding ID %s',tostring(ID)))
|
||||
self.gettext:AddEntry(Locale,tostring(ID),Text)
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Function to insert downed pilot tracker object.
|
||||
-- @param #CSAR self
|
||||
-- @param Wrapper.Group#GROUP Group The #GROUP object
|
||||
@@ -842,9 +1054,13 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
|
||||
|
||||
if not noMessage then
|
||||
if _freq ~= 0 then --shagrat different CASEVAC msg
|
||||
self:_DisplayToAllSAR("MAYDAY MAYDAY! " .. _typeName .. " is down. ", self.coalition, self.messageTime)
|
||||
local text = self.gettext:GetEntry("MAYDAY",self.locale)
|
||||
text = string.format(text,_typeName)
|
||||
self:_DisplayToAllSAR(text, self.coalition, self.messageTime)
|
||||
else
|
||||
self:_DisplayToAllSAR("Troops In Contact. " .. _typeName .. " requests CASEVAC. ", self.coalition, self.messageTime)
|
||||
local text = self.gettext:GetEntry("CONTACT",self.locale)
|
||||
text = string.format(text,_typeName)
|
||||
self:_DisplayToAllSAR(text, self.coalition, self.messageTime)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1304,23 +1520,26 @@ function CSAR:_InitSARForPilot(_downedGroup, _GroupName, _freq, _nomessage, _pla
|
||||
|
||||
if not _nomessage then
|
||||
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 request = self.gettext:GetEntry("REQUESTSAR",self.locale)
|
||||
local _text = string.format(request, _groupName, _coordinatesText, _freqk)--shagrat _groupName to prevent 'f15_Pilot_Parachute'
|
||||
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)
|
||||
local coordtext = UTILS.MGRSStringToSRSFriendly(_coordinatesText,true,self.SRSBackend)
|
||||
local request = self.gettext:GetEntry("REQUESTSARBEACON",self.locale)
|
||||
local _text = string.format(request, _groupName, coordtext, _freqk)
|
||||
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,true,false,self.SRSBackend)
|
||||
end
|
||||
else --shagrat CASEVAC msg
|
||||
local _text = string.format("Pickup Zone at %s.", _coordinatesText )
|
||||
local request = self.gettext:GetEntry("PICKUPZONE",self.locale)
|
||||
local _text = string.format(request, _coordinatesText )
|
||||
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 )
|
||||
local coordtext = UTILS.MGRSStringToSRSFriendly(_coordinatesText,true,self.SRSBackend)
|
||||
local _text = string.format(request, coordtext )
|
||||
self:_DisplayToAllSAR(_text,self.coalition,self.messageTime,true,false)
|
||||
end
|
||||
end
|
||||
@@ -1459,9 +1678,11 @@ function CSAR:_CheckWoundedGroupStatus(heliname,woundedgroupname)
|
||||
local dist = UTILS.MetersToNM(self.autosmokedistance)
|
||||
disttext = string.format("%.0fnm",dist)
|
||||
end
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Finally, that is music in my ears!\nI'll pop a smoke when you are %s away.\nLand or hover by the smoke.", self:_GetCustomCallSign(_heliName), _pilotName, disttext), self.messageTime,false,true)
|
||||
local text = self.gettext:GetEntry("HEARYOULONG",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, self:_GetCustomCallSign(_heliName), _pilotName, disttext), self.messageTime,false,true)
|
||||
else
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Finally, that is music in my ears!\nRequest a flare or smoke if you need.", self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||
local text = self.gettext:GetEntry("HEARYOUSHORT",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||
end
|
||||
--mark as shown for THIS heli and THIS group
|
||||
self.heliVisibleMessage[_lookupKeyHeli] = true
|
||||
@@ -1525,7 +1746,8 @@ function CSAR:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupNam
|
||||
_maxUnits = self.max_units
|
||||
end
|
||||
if _unitsInHelicopter + 1 > _maxUnits then
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s, %s. We\'re already crammed with %d guys! Sorry!", _pilotName, self:_GetCustomCallSign(_heliName), _unitsInHelicopter, _unitsInHelicopter), self.messageTime,false,false,true)
|
||||
local text = self.gettext:GetEntry("WEARECRAMMED",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, _pilotName, self:_GetCustomCallSign(_heliName), _unitsInHelicopter, _unitsInHelicopter), self.messageTime,false,false,true)
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -1542,8 +1764,9 @@ function CSAR:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupNam
|
||||
|
||||
_woundedGroup:Destroy(false)
|
||||
self:_RemoveNameFromDownedPilots(_woundedGroupName,true)
|
||||
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s I\'m in! Get to the MASH ASAP! ", self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,true,true)
|
||||
|
||||
local text = self.gettext:GetEntry("IAMINHELO",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,true,true)
|
||||
|
||||
self:_UpdateUnitCargoMass(_heliName)
|
||||
|
||||
@@ -1613,9 +1836,11 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
self:T(self.lid .. "[Pickup Debug] Helo closer than 500m: ".._lookupKeyHeli)
|
||||
if self.heliCloseMessage[_lookupKeyHeli] == nil 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)
|
||||
local text = self.gettext:GetEntry("YOUARECLOSE",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||
else
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. You\'re close now! Land in a safe place, I will go there ", self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||
local text = self.gettext:GetEntry("YOUARECLOSELONG",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, string.format(text, self:_GetCustomCallSign(_heliName), _pilotName), self.messageTime,false,true)
|
||||
end
|
||||
self.heliCloseMessage[_lookupKeyHeli] = true
|
||||
end
|
||||
@@ -1633,7 +1858,9 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
_time = self.landedStatus[_lookupKeyHeli]
|
||||
_woundedGroup:OptionAlarmStateGreen()
|
||||
self:_OrderGroupToMoveToPoint(_woundedGroup, _heliUnit:GetCoordinate())
|
||||
self:_DisplayMessageToSAR(_heliUnit, "Wait till " .. _pilotName .. " gets in. \nETA " .. _time .. " more seconds.", self.messageTime, false)
|
||||
local text = self.gettext:GetEntry("WAITMORE",self.locale)
|
||||
text = string.format(text,_pilotName, _time)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, false)
|
||||
else
|
||||
_time = self.landedStatus[_lookupKeyHeli] - 10
|
||||
self.landedStatus[_lookupKeyHeli] = _time
|
||||
@@ -1643,7 +1870,8 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
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
|
||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
||||
local text = self.gettext:GetEntry("OPENTHEDOORIN",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, true, true)
|
||||
self:T(self.lid .. "[Pickup Debug] Door closed, try again next loop ".._lookupKeyHeli)
|
||||
return false
|
||||
else
|
||||
@@ -1660,7 +1888,8 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
self:T(self.lid .. "[Pickup Debug] Helo close enough, door check ".._lookupKeyHeli)
|
||||
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)
|
||||
local text = self.gettext:GetEntry("OPENTHEDOORIN",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, true, true)
|
||||
return false
|
||||
else
|
||||
self:T(self.lid .. "[Pickup Debug] Pick up Pilot ".._lookupKeyHeli)
|
||||
@@ -1701,11 +1930,14 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
self:T(self.lid .. "[Pickup Debug] Check hover timer ".._lookupKeyHeli)
|
||||
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)
|
||||
local text = self.gettext:GetEntry("HOVERABOVE",self.locale)
|
||||
text = string.format(text,_pilotName,_time)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, true)
|
||||
else
|
||||
self:T(self.lid .. "[Pickup Debug] Helo hovering long enough - door check ".._lookupKeyHeli)
|
||||
if self.pilotmustopendoors and (self:_IsLoadingDoorOpen(_heliName) == false) then
|
||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me in!", self.messageTime, true, true)
|
||||
local text = self.gettext:GetEntry("OPENTHEDOORIN",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, true, true)
|
||||
self:T(self.lid .. "[Pickup Debug] Door closed, try again next loop ".._lookupKeyHeli)
|
||||
return false
|
||||
else
|
||||
@@ -1718,7 +1950,8 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
||||
_reset = false
|
||||
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)
|
||||
local text = self.gettext:GetEntry("TOOHIGHWINCH",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit,string.format(text,_pilotName), self.messageTime, true,true)
|
||||
self:T(self.lid .. "[Pickup Debug] Hovering too high, try again next loop ".._lookupKeyHeli)
|
||||
return false
|
||||
end
|
||||
@@ -1782,7 +2015,8 @@ function CSAR:_ScheduledSARFlight(heliname,groupname, isairport, noreschedule, I
|
||||
if ( _dist < self.FARPRescueDistance or isairport ) and ((_heliUnit:InAir() == false) or (IsHeloBase == true)) then
|
||||
self:T(self.lid.."[Drop off debug] Distance ok, door check")
|
||||
if self.pilotmustopendoors and self:_IsLoadingDoorOpen(heliname) == false then
|
||||
self:_DisplayMessageToSAR(_heliUnit, "Open the door to let me out!", self.messageTime, true, true)
|
||||
local text = self.gettext:GetEntry("OPENTHEDOOROUT",self.locale)
|
||||
self:_DisplayMessageToSAR(_heliUnit, text, self.messageTime, true, true)
|
||||
self:T(self.lid.."[Drop off debug] Door closed, try again next loop")
|
||||
else
|
||||
self:T(self.lid.."[Drop off debug] Rescued!")
|
||||
@@ -1815,8 +2049,9 @@ function CSAR:_RescuePilots(_heliUnit)
|
||||
local PilotsSaved = self:_PilotsOnboard(_heliName)
|
||||
|
||||
self.inTransitGroups[_heliName] = nil
|
||||
|
||||
local _txt = string.format("%s: The %d pilot(s) have been taken to the\nmedical clinic. Good job!", self:_GetCustomCallSign(_heliName), PilotsSaved)
|
||||
|
||||
local text = self.gettext:GetEntry("OPENTHEDOOROUT",self.locale)
|
||||
local _txt = string.format(text, self:_GetCustomCallSign(_heliName), PilotsSaved)
|
||||
|
||||
self:_DisplayMessageToSAR(_heliUnit, _txt, self.messageTime)
|
||||
|
||||
@@ -1863,9 +2098,11 @@ function CSAR:_DisplayMessageToSAR(_unit, _text, _time, _clear, _speak, _overrid
|
||||
if coord then
|
||||
self.msrs:SetCoordinate(coord)
|
||||
end
|
||||
_text = string.gsub(_text,"km"," kilometer")
|
||||
_text = string.gsub(_text,"nm"," nautical miles")
|
||||
self.SRSQueue:NewTransmission(_text,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,self.SRSVoice,volume,label,coord)
|
||||
local km = self.gettext:GetEntry("KILOMETERS",self.locale)
|
||||
local nm = self.gettext:GetEntry("NAUTMILES",self.locale)
|
||||
_text = string.gsub(_text,"km",km)
|
||||
_text = string.gsub(_text,"nm",nm)
|
||||
self.SRSQueue:NewTransmission(_text,duration,self.msrs,tstart,2,subgroups,subtitle,subduration,self.SRSchannel,self.SRSModulation,gender,culture,self.SRSVoice,volume,label,coord,nil,self.SRSSpeaker)
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -1906,6 +2143,8 @@ function CSAR:_GetPositionOfWounded(_woundedGroup,_Unit)
|
||||
-- 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)
|
||||
local fillfor = self.gettext:GetEntry("FILLFOR",self.locale)
|
||||
_coordinatesText = string.gsub(_coordinatesText,"for","")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1950,10 +2189,11 @@ function CSAR:_DisplayActiveSAR(_unitName)
|
||||
else
|
||||
distancetext = string.format("%.1fkm", _distance/1000.0)
|
||||
end
|
||||
local fillat = self.gettext:GetEntry("FILLAT",self.locale)
|
||||
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 %s %s - %s ", _value.desc, fillat, _coordinatesText, distancetext) })
|
||||
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 %s %s - %.2f KHz ADF - %s ", _value.desc, fillat, _coordinatesText, _value.frequency / 1000, distancetext) })
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2035,7 +2275,8 @@ function CSAR:_SignalFlare(_unitName)
|
||||
else
|
||||
_distance = string.format("%.1fkm",_closest.distance/1000)
|
||||
end
|
||||
local _msg = string.format("%s - Firing signal flare at your %s o\'clock. Distance %s", self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||
local text = self.gettext:GetEntry("FIRINGFLARE",self.locale)
|
||||
local _msg = string.format(text, self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||
|
||||
local _coord = _closest.pilot:GetCoordinate()
|
||||
@@ -2048,7 +2289,8 @@ function CSAR:_SignalFlare(_unitName)
|
||||
else
|
||||
dtext = string.format("%.1fkm",smokedist/1000)
|
||||
end
|
||||
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",dtext), self.messageTime, false, false, true)
|
||||
local text = self.gettext:GetEntry("NOPILOTSINRANGE",self.locale)
|
||||
self:_DisplayMessageToSAR(_heli, string.format(text,dtext), self.messageTime, false, false, true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2066,11 +2308,14 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
|
||||
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 speaker = self.CSARSpeaker
|
||||
if self.msrs:GetProvider() == MSRS.Provider.WINDOWS then
|
||||
voice = self.CSARVoiceMS or MSRS.Voices.Microsoft.Hedda
|
||||
end
|
||||
local kilohertz = self.gettext:GetEntry("KHZ",self.locale)
|
||||
_message = string.gsub(_message,"KHz",kilohertz)
|
||||
--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,nil,speaker)
|
||||
end
|
||||
if ToScreen == true or ToScreen == nil then
|
||||
for _, _unitName in pairs(self.csarUnits) do
|
||||
@@ -2103,7 +2348,8 @@ function CSAR:_ReqIRStrobe( _unitName )
|
||||
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)
|
||||
local text = self.gettext:GetEntry("IRSTROBE",self.locale)
|
||||
local _msg = string.format(text, self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||
_closest.pilot:NewIRMarker(true,self.IRStrobeRuntime or 300)
|
||||
else
|
||||
@@ -2113,7 +2359,8 @@ function CSAR:_ReqIRStrobe( _unitName )
|
||||
else
|
||||
_distance = string.format("%.1fkm",smokedist/1000)
|
||||
end
|
||||
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",_distance), self.messageTime, false, false, true)
|
||||
local text = self.gettext:GetEntry("NOPILOTSINRANGE",self.locale)
|
||||
self:_DisplayMessageToSAR(_heli, string.format(text,_distance), self.messageTime, false, false, true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2138,7 +2385,8 @@ function CSAR:_Reqsmoke( _unitName )
|
||||
else
|
||||
_distance = string.format("%.1fkm",_closest.distance/1000)
|
||||
end
|
||||
local _msg = string.format("%s - Popping smoke at your %s o\'clock. Distance %s", self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||
local text = self.gettext:GetEntry("POPPINGSMOKE",self.locale)
|
||||
local _msg = string.format(text, self:_GetCustomCallSign(_unitName), _clockDir, _distance)
|
||||
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||
local _coord = _closest.pilot:GetCoordinate()
|
||||
local color = self.smokecolor
|
||||
@@ -2150,7 +2398,8 @@ function CSAR:_Reqsmoke( _unitName )
|
||||
else
|
||||
_distance = string.format("%.1fkm",smokedist/1000)
|
||||
end
|
||||
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",_distance), self.messageTime, false, false, true)
|
||||
local text = self.gettext:GetEntry("NOPILOTSINRANGE",self.locale)
|
||||
self:_DisplayMessageToSAR(_heli, string.format(text,_distance), self.messageTime, false, false, true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2174,7 +2423,8 @@ function CSAR:_ReqsmokeMash( _unitName )
|
||||
else
|
||||
disttext = string.format("%.1fkm",distance/1000)
|
||||
end
|
||||
local _msg = string.format("%s - Popping smoke at the closest rescue point: %s", self:_GetCustomCallSign(_unitName), disttext)
|
||||
local text = self.gettext:GetEntry("POPPINGSMOKEMASH",self.locale)
|
||||
local _msg = string.format(text, self:_GetCustomCallSign(_unitName), disttext)
|
||||
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime, false, true, true)
|
||||
local color = self.smokecolor
|
||||
coordinate:Smoke(color)
|
||||
@@ -2185,7 +2435,8 @@ function CSAR:_ReqsmokeMash( _unitName )
|
||||
else
|
||||
_distance = string.format("%.1fkm",smokedist/1000)
|
||||
end
|
||||
self:_DisplayMessageToSAR(_heli, string.format("No rescue point within %s",_distance), self.messageTime, false, false, true)
|
||||
local text = self.gettext:GetEntry("NORESCUEPOINTWITHIN",self.locale)
|
||||
self:_DisplayMessageToSAR(_heli, string.format(text,_distance), self.messageTime, false, false, true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2263,9 +2514,10 @@ function CSAR:_CheckOnboard(_unitName)
|
||||
--list onboard pilots
|
||||
local _inTransit = self.inTransitGroups[_unitName]
|
||||
if _inTransit == nil then
|
||||
self:_DisplayMessageToSAR(_unit, "No Rescued Pilots onboard", self.messageTime, false, false, true)
|
||||
local text = self.gettext:GetEntry("NOPILOTSONBOARD",self.locale)
|
||||
self:_DisplayMessageToSAR(_unit, text, self.messageTime, false, false, true)
|
||||
else
|
||||
local _text = "Onboard - RTB to FARP/Airfield or MASH: "
|
||||
local _text = self.gettext:GetEntry("BOARDED",self.locale)
|
||||
for _, _onboard in pairs(self.inTransitGroups[_unitName]) do
|
||||
_text = _text .. "\n" .. _onboard.desc
|
||||
end
|
||||
@@ -2289,8 +2541,11 @@ function CSAR:_AddMedevacMenuItem()
|
||||
if _unit then
|
||||
--self:T("Unitname ".._unit:GetName().." IsAlive "..tostring(_unit:IsAlive()).." IsPlayer "..tostring(_unit:IsPlayer()))
|
||||
if _unit:IsAlive() and _unit:IsPlayer() then
|
||||
local unitName = _unit:GetName()
|
||||
_UnitList[unitName] = unitName
|
||||
local _maxUnits = self.AircraftType[_unit:GetTypeName()]
|
||||
if _maxUnits == nil or _maxUnits > 0 then
|
||||
local unitName = _unit:GetName()
|
||||
_UnitList[unitName] = unitName
|
||||
end
|
||||
end -- end isAlive
|
||||
end -- end if _unit
|
||||
end -- end for
|
||||
@@ -2305,17 +2560,24 @@ function CSAR:_AddMedevacMenuItem()
|
||||
local groupname = _group:GetName()
|
||||
if self.addedTo[groupname] == nil then
|
||||
self.addedTo[groupname] = true
|
||||
local menuname = self.topmenuname or "CSAR"
|
||||
local menuname = self.gettext:GetEntry("MENUTOP",self.locale)
|
||||
menuname = self.topmenuname or menuname
|
||||
local Menu1T = self.gettext:GetEntry("MENUACTIVE",self.locale)
|
||||
local Menu2T = self.gettext:GetEntry("MENUCHECK",self.locale)
|
||||
local Menu3T = self.gettext:GetEntry("MENUFLARE",self.locale)
|
||||
local Menu4T = self.gettext:GetEntry("MENUSMOKE",self.locale)
|
||||
local Menu5T = self.gettext:GetEntry("MENUSTROBE",self.locale)
|
||||
local Menu6T = self.gettext:GetEntry("MENUMASH",self.locale)
|
||||
local _rootPath = MENU_GROUP:New(_group,menuname)
|
||||
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 _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)
|
||||
local _rootMenu1 = MENU_GROUP_COMMAND:New(_group,Menu1T,_rootPath, self._DisplayActiveSAR,self,_unitName)
|
||||
local _rootMenu2 = MENU_GROUP_COMMAND:New(_group,Menu2T,_rootPath, self._CheckOnboard,self,_unitName)
|
||||
local _rootMenu3 = MENU_GROUP_COMMAND:New(_group,Menu3T,_rootPath, self._SignalFlare,self,_unitName)
|
||||
local _rootMenu4 = MENU_GROUP_COMMAND:New(_group,Menu4T,_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()
|
||||
local _rootMenu5 = MENU_GROUP_COMMAND:New(_group,Menu5T,_rootPath, self._ReqIRStrobe,self,_unitName):Refresh()
|
||||
end
|
||||
if self.EnableMenuSmokeMASH then
|
||||
local _rootMenu6 = MENU_GROUP_COMMAND:New(_group,"Smoke Closest MASH",_rootPath, self._ReqsmokeMash,self,_unitName)
|
||||
local _rootMenu6 = MENU_GROUP_COMMAND:New(_group,Menu6T,_rootPath, self._ReqsmokeMash,self,_unitName)
|
||||
else
|
||||
_rootMenu4:Refresh()
|
||||
end
|
||||
@@ -2580,14 +2842,22 @@ function CSAR:onafterStart(From, Event, To)
|
||||
self.msrs = MSRS:New(path,channel,modulation) -- Sound.SRS#MSRS
|
||||
self.msrs:SetPort(self.SRSport)
|
||||
self.msrs:SetLabel("CSAR")
|
||||
self.msrs:SetBackend(self.SRSBackend)
|
||||
self.msrs.speed = self.SRSSpeed
|
||||
self.msrs:SetCulture(self.SRSCulture)
|
||||
self.msrs:SetCoalition(self.coalition)
|
||||
self.msrs:SetVoice(self.SRSVoice)
|
||||
self.msrs:SetGender(self.SRSGender)
|
||||
if self.SRSGPathToCredentials then
|
||||
if self.SRSGPathToCredentials and (not self.SRSProvider) then
|
||||
self.msrs:SetProviderOptionsGoogle(self.SRSGPathToCredentials,self.SRSGPathToCredentials)
|
||||
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if self.SRSProvider then
|
||||
self.msrs:SetProvider(self.SRSProvider)
|
||||
end
|
||||
if self.SRSSpeaker then
|
||||
self.msrs:SetSpeakerPiper(self.SRSSpeaker)
|
||||
end
|
||||
self.msrs:SetVolume(self.SRSVolume)
|
||||
self.msrs:SetLabel("CSAR")
|
||||
self.SRSQueue = MSRSQUEUE:New("CSAR") -- Sound.SRS#MSRSQUEUE
|
||||
@@ -2601,7 +2871,9 @@ function CSAR:onafterStart(From, Event, To)
|
||||
local filepath = self.filepath
|
||||
self:__Save(interval,filepath,filename)
|
||||
end
|
||||
|
||||
|
||||
self:_InitLocalization(self.locale)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
+2710
-1804
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,720 @@
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO CTLD_CARGO
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
do
|
||||
|
||||
------------------------------------------------------
|
||||
--- **CTLD_CARGO** class, extends Core.Base#BASE
|
||||
-- @type CTLD_CARGO
|
||||
-- @field #string ClassName Class name.
|
||||
-- @field #number ID ID of this cargo.
|
||||
-- @field #string Name Name for menu.
|
||||
-- @field #string DisplayName Display name for menu/messages.
|
||||
-- @field #table Templates Table of #POSITIONABLE objects.
|
||||
-- @field #string CargoType Enumerator of Type.
|
||||
-- @field #boolean HasBeenMoved Flag for moving.
|
||||
-- @field #boolean LoadDirectly Flag for direct loading.
|
||||
-- @field #number CratesNeeded Crates needed to build.
|
||||
-- @field Wrapper.Positionable#POSITIONABLE Positionable Representation of cargo in the mission.
|
||||
-- @field #boolean HasBeenDropped True if dropped from heli.
|
||||
-- @field #number PerCrateMass Mass in kg.
|
||||
-- @field #number Stock Number of builds available, -1 for unlimited.
|
||||
-- @field #string Subcategory Sub-category name.
|
||||
-- @field #boolean DontShowInMenu Show this item in menu or not.
|
||||
-- @field Core.Zone#ZONE Location Location (if set) where to get this cargo item.
|
||||
-- @field #table ResourceMap Resource Map information table if it has been set for static cargo items.
|
||||
-- @field #string StaticShape Individual shape if set.
|
||||
-- @field #string StaticType Individual type if set.
|
||||
-- @field #string StaticCategory Individual static category if set.
|
||||
-- @field #list<#string> TypeNames Table of unit types able to pick this cargo up.
|
||||
-- @field #number Stock0 Initial stock, if any given.
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
---
|
||||
-- @field #CTLD_CARGO CTLD_CARGO
|
||||
CTLD_CARGO = {
|
||||
ClassName = "CTLD_CARGO",
|
||||
ID = 0,
|
||||
Name = "none",
|
||||
DisplayName = "none",
|
||||
Templates = {},
|
||||
CargoType = "none",
|
||||
HasBeenMoved = false,
|
||||
LoadDirectly = false,
|
||||
CratesNeeded = 0,
|
||||
Positionable = nil,
|
||||
HasBeenDropped = false,
|
||||
PerCrateMass = 0,
|
||||
Stock = nil,
|
||||
Stock0 = nil,
|
||||
Mark = nil,
|
||||
DontShowInMenu = false,
|
||||
Location = nil,
|
||||
}
|
||||
|
||||
--- Define cargo types.
|
||||
-- @type CTLD_CARGO.Enum
|
||||
-- @field #string VEHICLE
|
||||
-- @field #string TROOPS
|
||||
-- @field #string FOB
|
||||
-- @field #string CRATE
|
||||
-- @field #string REPAIR
|
||||
-- @field #string ENGINEERS
|
||||
-- @field #string STATIC
|
||||
-- @field #string GCLOADABLE
|
||||
CTLD_CARGO.Enum = {
|
||||
VEHICLE = "Vehicle", -- #string vehicles
|
||||
TROOPS = "Troops", -- #string troops
|
||||
FOB = "FOB", -- #string FOB
|
||||
CRATE = "Crate", -- #string crate
|
||||
REPAIR = "Repair", -- #string repair
|
||||
ENGINEERS = "Engineers", -- #string engineers
|
||||
STATIC = "Static", -- #string statics
|
||||
GCLOADABLE = "GC_Loadable", -- #string dynamiccargo
|
||||
}
|
||||
|
||||
--- Function to create new CTLD_CARGO object.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #number ID ID of this #CTLD_CARGO
|
||||
-- @param #string Name Name for menu.
|
||||
-- @param #table Templates Table of #POSITIONABLE objects.
|
||||
-- @param #CTLD_CARGO.Enum Sorte Enumerator of Type.
|
||||
-- @param #boolean HasBeenMoved Flag for moving.
|
||||
-- @param #boolean LoadDirectly Flag for direct loading.
|
||||
-- @param #number CratesNeeded Crates needed to build.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE Positionable Representation of cargo in the mission.
|
||||
-- @param #boolean Dropped Cargo/Troops have been unloaded from a chopper.
|
||||
-- @param #number PerCrateMass Mass in kg
|
||||
-- @param #number Stock Number of builds available, nil for unlimited
|
||||
-- @param #string Subcategory Name of subcategory, handy if using > 10 types to load.
|
||||
-- @param #boolean DontShowInMenu (Optional) Show this item in menu or not (default: false == show it).
|
||||
-- @param Core.Zone#ZONE Location (Optional) Where the cargo is available (one location only).
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:New(ID, Name, Templates, Sorte, HasBeenMoved, LoadDirectly, CratesNeeded, Positionable, Dropped, PerCrateMass, Stock, Subcategory, DontShowInMenu, Location)
|
||||
-- Inherit everything from BASE class.
|
||||
local self=BASE:Inherit(self, BASE:New()) -- #CTLD_CARGO
|
||||
self:T({ID, Name, Templates, Sorte, HasBeenMoved, LoadDirectly, CratesNeeded, Positionable, Dropped})
|
||||
self.ID = ID or math.random(100000,1000000)
|
||||
self.Name = Name or "none" -- #string
|
||||
self.DisplayName = Name or "none" -- #string
|
||||
self.Templates = Templates or {} -- #table
|
||||
self.CargoType = Sorte or "type" -- #CTLD_CARGO.Enum
|
||||
self.HasBeenMoved = HasBeenMoved or false -- #boolean
|
||||
self.LoadDirectly = LoadDirectly or false -- #boolean
|
||||
self.CratesNeeded = CratesNeeded or 0 -- #number
|
||||
self.Positionable = Positionable or nil -- Wrapper.Positionable#POSITIONABLE
|
||||
self.HasBeenDropped = Dropped or false --#boolean
|
||||
self.PerCrateMass = PerCrateMass or 0 -- #number
|
||||
self.Stock = Stock or nil --#number
|
||||
self.Stock0 = Stock or nil --#number
|
||||
self.Mark = nil
|
||||
self.Subcategory = Subcategory or "Other"
|
||||
self.DontShowInMenu = DontShowInMenu or false
|
||||
self.ResourceMap = nil
|
||||
self.StaticType = "container_cargo" -- "container_cargo"
|
||||
if self:IsStatic() then
|
||||
self.StaticType = self.Templates
|
||||
end
|
||||
self.StaticShape = nil
|
||||
self.TypeNames = nil
|
||||
self.StaticCategory = "Cargos"
|
||||
if type(Location) == "string" then
|
||||
Location = ZONE:New(Location)
|
||||
end
|
||||
self.Location = Location
|
||||
self.NoMoveToZone = false
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add specific static type and shape to this CARGO.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #string TypeName
|
||||
-- @param #string ShapeName
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:SetStaticTypeAndShape(Category,TypeName,ShapeName)
|
||||
self.StaticCategory = Category or "Cargos"
|
||||
self.StaticType = TypeName or "container_cargo"
|
||||
self.StaticShape = ShapeName
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get the specific static type and shape from this CARGO if set.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #string Category
|
||||
-- @return #string TypeName
|
||||
-- @return #string ShapeName
|
||||
function CTLD_CARGO:GetStaticTypeAndShape()
|
||||
return self.StaticCategory, self.StaticType, self.StaticShape
|
||||
end
|
||||
|
||||
--- Add specific unit types to this CARGO (restrict what types can pick this up).
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #string UnitTypes Unit type name, can also be a #list<#string> table of unit type names.
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:AddUnitTypeName(UnitTypes)
|
||||
if not self.TypeNames then self.TypeNames = {} end
|
||||
if type(UnitTypes) ~= "table" then UnitTypes = {UnitTypes} end
|
||||
for _,_singletype in pairs(UnitTypes or {}) do
|
||||
self.TypeNames[_singletype]=_singletype
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Check if a specific unit can carry this CARGO (restrict what types can pick this up).
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param Wrapper.Unit#UNIT Unit
|
||||
-- @return #boolean Outcome
|
||||
function CTLD_CARGO:UnitCanCarry(Unit)
|
||||
if not Unit then return false end
|
||||
if self.TypeNames == nil then return true end
|
||||
local typename = Unit:GetTypeName() or "none"
|
||||
if self.TypeNames[typename] then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Add Resource Map information table
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #table ResourceMap
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:SetStaticResourceMap(ResourceMap)
|
||||
self.ResourceMap = ResourceMap
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get Resource Map information table
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #table ResourceMap
|
||||
function CTLD_CARGO:GetStaticResourceMap()
|
||||
return self.ResourceMap
|
||||
end
|
||||
|
||||
--- Query Location.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return Core.Zone#ZONE location or `nil` if not set
|
||||
function CTLD_CARGO:GetLocation()
|
||||
return self.Location
|
||||
end
|
||||
|
||||
--- Query ID.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number ID
|
||||
function CTLD_CARGO:GetID()
|
||||
return self.ID
|
||||
end
|
||||
|
||||
--- Query Subcategory
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #string SubCategory
|
||||
function CTLD_CARGO:GetSubCat()
|
||||
return self.Subcategory
|
||||
end
|
||||
|
||||
--- Query Mass.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number Mass in kg
|
||||
function CTLD_CARGO:GetMass()
|
||||
return self.PerCrateMass
|
||||
end
|
||||
|
||||
--- Query Name.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #string Name
|
||||
function CTLD_CARGO:GetName()
|
||||
return self.Name
|
||||
end
|
||||
|
||||
--- Set display name.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #string DisplayName Display label used in menus/messages (optional).
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:SetDisplayName(DisplayName)
|
||||
if type(DisplayName) == "string" and DisplayName ~= "" then
|
||||
self.DisplayName = DisplayName
|
||||
else
|
||||
self.DisplayName = self.Name
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Query display name.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #string Display name, or Name if not set
|
||||
function CTLD_CARGO:GetDisplayName()
|
||||
return self.DisplayName or self.Name
|
||||
end
|
||||
|
||||
--- Query Templates.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #table Templates
|
||||
function CTLD_CARGO:GetTemplates()
|
||||
return self.Templates
|
||||
end
|
||||
|
||||
--- Query has moved.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #boolean Has moved
|
||||
function CTLD_CARGO:HasMoved()
|
||||
return self.HasBeenMoved
|
||||
end
|
||||
|
||||
--- Query was dropped.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #boolean hercOnly If true, only treat Herc drops as 'dropped'.
|
||||
-- @return #boolean Has been dropped.
|
||||
function CTLD_CARGO:WasDropped(hercOnly)
|
||||
if hercOnly then
|
||||
return self.HasBeenDropped and self.IsHercDrop==true
|
||||
end
|
||||
return self.HasBeenDropped
|
||||
end
|
||||
|
||||
--- Query directly loadable.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #boolean loadable
|
||||
function CTLD_CARGO:CanLoadDirectly()
|
||||
return self.LoadDirectly
|
||||
end
|
||||
|
||||
--- Query number of crates or troopsize.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number Crates or size of troops.
|
||||
function CTLD_CARGO:GetCratesNeeded()
|
||||
return self.CratesNeeded
|
||||
end
|
||||
|
||||
--- Query type.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #CTLD_CARGO.Enum Type
|
||||
function CTLD_CARGO:GetType()
|
||||
return self.CargoType
|
||||
end
|
||||
|
||||
--- Query type.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return Wrapper.Positionable#POSITIONABLE Positionable
|
||||
function CTLD_CARGO:GetPositionable()
|
||||
return self.Positionable
|
||||
end
|
||||
|
||||
--- Set HasMoved.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #boolean moved
|
||||
function CTLD_CARGO:SetHasMoved(moved)
|
||||
self.HasBeenMoved = moved or false
|
||||
end
|
||||
|
||||
--- Query if cargo has been loaded.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #boolean loaded
|
||||
function CTLD_CARGO:Isloaded()
|
||||
if self.HasBeenMoved and not self:WasDropped() then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Set WasDropped.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #boolean dropped
|
||||
-- @param #boolean isHercDrop set when _GetCrates is used by the herc
|
||||
function CTLD_CARGO:SetWasDropped(dropped, isHercDrop)
|
||||
self.HasBeenDropped = dropped or false
|
||||
self.IsHercDrop = isHercDrop or false
|
||||
end
|
||||
|
||||
--- Get Stock.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number Stock or -1 if unlimited.
|
||||
function CTLD_CARGO:GetStock()
|
||||
if self.Stock then
|
||||
return self.Stock
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
--- Get Stock0.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number Stock0 or -1 if unlimited.
|
||||
function CTLD_CARGO:GetStock0()
|
||||
if self.Stock0 then
|
||||
return self.Stock0
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
--- Get relative Stock.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number Stock Percentage like 75, or -1 if unlimited.
|
||||
function CTLD_CARGO:GetRelativeStock()
|
||||
if self.Stock and self.Stock0 then
|
||||
return math.floor((self.Stock/self.Stock0)*100)
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
--- Add Stock.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #number Number to add, none if nil.
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:AddStock(Number)
|
||||
if self.Stock then -- Stock nil?
|
||||
local number = Number or 1
|
||||
self.Stock = self.Stock + number
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Remove Stock.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #number Number to reduce, none if nil.
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:RemoveStock(Number)
|
||||
if self.Stock then -- Stock nil?
|
||||
local number = Number or 1
|
||||
self.Stock = self.Stock - number
|
||||
if self.Stock < 0 then self.Stock = 0 end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set Stock.
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #number Number to set, nil means unlimited.
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:SetStock(Number)
|
||||
self.Stock = Number
|
||||
return self
|
||||
end
|
||||
|
||||
--- Query crate type for REPAIR
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @param #boolean
|
||||
function CTLD_CARGO:IsRepair()
|
||||
if self.CargoType == "Repair" then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Query crate type for STATIC
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #boolean
|
||||
function CTLD_CARGO:IsStatic()
|
||||
if self.CargoType == "Static" then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Add mark
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:AddMark(Mark)
|
||||
self.Mark = Mark
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get mark
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #string Mark
|
||||
function CTLD_CARGO:GetMark(Mark)
|
||||
return self.Mark
|
||||
end
|
||||
|
||||
--- Wipe mark
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #CTLD_CARGO self
|
||||
function CTLD_CARGO:WipeMark()
|
||||
self.Mark = nil
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get overall mass of a cargo object, i.e. crates needed x mass per crate
|
||||
-- @param #CTLD_CARGO self
|
||||
-- @return #number mass
|
||||
function CTLD_CARGO:GetNetMass()
|
||||
return self.CratesNeeded * self.PerCrateMass
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- END CTLD_CARGO
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
do
|
||||
|
||||
------------------------------------------------------
|
||||
--- **CTLD_ENGINEERING** class, extends Core.Base#BASE
|
||||
-- @type CTLD_ENGINEERING
|
||||
-- @field #string ClassName
|
||||
-- @field #string lid
|
||||
-- @field #string Name
|
||||
-- @field Wrapper.Group#GROUP Group
|
||||
-- @field Wrapper.Unit#UNIT Unit
|
||||
-- @field Wrapper.Group#GROUP HeliGroup
|
||||
-- @field Wrapper.Unit#UNIT HeliUnit
|
||||
-- @field #string State
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
---
|
||||
-- @field #CTLD_ENGINEERING CTLD_ENGINEERING
|
||||
CTLD_ENGINEERING = {
|
||||
ClassName = "CTLD_ENGINEERING",
|
||||
lid = "",
|
||||
Name = "none",
|
||||
Group = nil,
|
||||
Unit = nil,
|
||||
--C_Ops = nil,
|
||||
HeliGroup = nil,
|
||||
HeliUnit = nil,
|
||||
State = "",
|
||||
}
|
||||
|
||||
--- CTLD_ENGINEERING class version.
|
||||
-- @field #string version
|
||||
CTLD_ENGINEERING.Version = "0.0.3"
|
||||
|
||||
--- Create a new instance.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param #string Name
|
||||
-- @param #string GroupName Name of Engineering #GROUP object
|
||||
-- @param Wrapper.Group#GROUP HeliGroup HeliGroup
|
||||
-- @param Wrapper.Unit#UNIT HeliUnit HeliUnit
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:New(Name, GroupName, HeliGroup, HeliUnit)
|
||||
|
||||
-- Inherit everything from BASE class.
|
||||
local self=BASE:Inherit(self, BASE:New()) -- #CTLD_ENGINEERING
|
||||
|
||||
--BASE:I({Name, GroupName})
|
||||
|
||||
self.Name = Name or "Engineer Squad" -- #string
|
||||
self.Group = GROUP:FindByName(GroupName) -- Wrapper.Group#GROUP
|
||||
self.Unit = self.Group:GetUnit(1) -- Wrapper.Unit#UNIT
|
||||
self.HeliGroup = HeliGroup -- Wrapper.Group#GROUP
|
||||
self.HeliUnit = HeliUnit -- Wrapper.Unit#UNIT
|
||||
self.currwpt = nil -- Core.Point#COORDINATE
|
||||
self.lid = string.format("%s (%s) | ",self.Name, self.Version)
|
||||
-- Start State.
|
||||
self.State = "Stopped"
|
||||
self.marktimer = 300 -- wait this many secs before trying a crate again
|
||||
self:Start()
|
||||
local parent = self:GetParent(self)
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Set the status
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param #string State
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:SetStatus(State)
|
||||
self.State = State
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Get the status
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #string State
|
||||
function CTLD_ENGINEERING:GetStatus()
|
||||
return self.State
|
||||
end
|
||||
|
||||
--- (Internal) Check the status
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param #string State
|
||||
-- @return #boolean Outcome
|
||||
function CTLD_ENGINEERING:IsStatus(State)
|
||||
return self.State == State
|
||||
end
|
||||
|
||||
--- (Internal) Check the negative status
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param #string State
|
||||
-- @return #boolean Outcome
|
||||
function CTLD_ENGINEERING:IsNotStatus(State)
|
||||
return self.State ~= State
|
||||
end
|
||||
|
||||
--- (Internal) Set start status.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Start()
|
||||
self:T(self.lid.."Start")
|
||||
self:SetStatus("Running")
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Set stop status.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Stop()
|
||||
self:T(self.lid.."Stop")
|
||||
self:SetStatus("Stopped")
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Set build status.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Build()
|
||||
self:T(self.lid.."Build")
|
||||
self:SetStatus("Building")
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Set done status.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Done()
|
||||
self:T(self.lid.."Done")
|
||||
local grp = self.Group -- Wrapper.Group#GROUP
|
||||
grp:RelocateGroundRandomInRadius(7,100,false,false,"Diamond")
|
||||
self:SetStatus("Running")
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Search for crates in reach.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param #table crates Table of found crate Ops.CTLD#CTLD_CARGO objects.
|
||||
-- @param #number number Number of crates found.
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Search(crates,number)
|
||||
self:T(self.lid.."Search")
|
||||
self:SetStatus("Searching")
|
||||
-- find crates close by
|
||||
--local COps = self.C_Ops -- Ops.CTLD#CTLD
|
||||
local dist = self.distance -- #number
|
||||
local group = self.Group -- Wrapper.Group#GROUP
|
||||
--local crates,number = COps:_FindCratesNearby(group,nil, dist) -- #table
|
||||
local ctable = {}
|
||||
local ind = 0
|
||||
if number > 0 then
|
||||
-- get set of dropped only
|
||||
for _,_cargo in pairs (crates) do
|
||||
local cgotype = _cargo:GetType()
|
||||
if _cargo:WasDropped() and cgotype ~= CTLD_CARGO.Enum.STATIC then
|
||||
local ok = false
|
||||
local chalk = _cargo:GetMark()
|
||||
if chalk == nil then
|
||||
ok = true
|
||||
else
|
||||
-- have we tried this cargo recently?
|
||||
local tag = chalk.tag or "none"
|
||||
local timestamp = chalk.timestamp or 0
|
||||
-- enough time gone?
|
||||
local gone = timer.getAbsTime() - timestamp
|
||||
if gone >= self.marktimer then
|
||||
ok = true
|
||||
_cargo:WipeMark()
|
||||
end -- end time check
|
||||
end -- end chalk
|
||||
if ok then
|
||||
local chalk = {}
|
||||
chalk.tag = "Engineers"
|
||||
chalk.timestamp = timer.getAbsTime()
|
||||
_cargo:AddMark(chalk)
|
||||
ind = ind + 1
|
||||
table.insert(ctable,ind,_cargo)
|
||||
end
|
||||
end -- end dropped
|
||||
end -- end for
|
||||
end -- end number
|
||||
|
||||
if ind > 0 then
|
||||
local crate = ctable[1] -- Ops.CTLD#CTLD_CARGO
|
||||
local static = crate:GetPositionable() -- Wrapper.Static#STATIC
|
||||
local crate_pos = static:GetCoordinate() -- Core.Point#COORDINATE
|
||||
local gpos = group:GetCoord() -- Core.Point#COORDINATE
|
||||
-- see how far we are from the crate
|
||||
local distance = self:_GetDistance(gpos,crate_pos)
|
||||
self:T(string.format("%s Distance to crate: %d", self.lid, distance))
|
||||
-- move there
|
||||
if distance > 30 and distance ~= -1 and self:IsStatus("Searching") then
|
||||
group:RouteGroundTo(crate_pos,15,"Line abreast",1)
|
||||
self.currwpt = crate_pos -- Core.Point#COORDINATE
|
||||
self:Move()
|
||||
elseif distance <= 30 and distance ~= -1 then
|
||||
-- arrived
|
||||
self:Arrive()
|
||||
end
|
||||
else
|
||||
self:T(self.lid.."No crates in reach!")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Move towards crates in reach.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Move()
|
||||
self:T(self.lid.."Move")
|
||||
self:SetStatus("Moving")
|
||||
-- check if we arrived on target
|
||||
--local COps = self.C_Ops -- Ops.CTLD#CTLD
|
||||
local group = self.Group -- Wrapper.Group#GROUP
|
||||
local tgtpos = self.currwpt -- Core.Point#COORDINATE
|
||||
local gpos = group:GetCoord() -- Core.Point#COORDINATE
|
||||
-- see how far we are from the crate
|
||||
local distance = self:_GetDistance(gpos,tgtpos)
|
||||
self:T(string.format("%s Distance remaining: %d", self.lid, distance))
|
||||
if distance <= 30 and distance ~= -1 then
|
||||
-- arrived
|
||||
self:Arrive()
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Arrived at crates in reach. Stop group.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @return #CTLD_ENGINEERING self
|
||||
function CTLD_ENGINEERING:Arrive()
|
||||
self:T(self.lid.."Arrive")
|
||||
self:SetStatus("Arrived")
|
||||
self.currwpt = nil
|
||||
local Grp = self.Group -- Wrapper.Group#GROUP
|
||||
Grp:RouteStop()
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Return distance in meters between two coordinates.
|
||||
-- @param #CTLD_ENGINEERING self
|
||||
-- @param Core.Point#COORDINATE _point1 Coordinate one
|
||||
-- @param Core.Point#COORDINATE _point2 Coordinate two
|
||||
-- @return #number Distance in meters or -1
|
||||
function CTLD_ENGINEERING:_GetDistance(_point1, _point2)
|
||||
self:T(self.lid .. " _GetDistance")
|
||||
if _point1 and _point2 then
|
||||
local distance1 = _point1:Get2DDistance(_point2)
|
||||
local distance2 = _point1:DistanceFromPointVec2(_point2)
|
||||
if distance1 and type(distance1) == "number" then
|
||||
return distance1
|
||||
elseif distance2 and type(distance2) == "number" then
|
||||
return distance2
|
||||
else
|
||||
self:E("*****Cannot calculate distance!")
|
||||
self:E({_point1,_point2})
|
||||
return -1
|
||||
end
|
||||
else
|
||||
self:E("******Cannot calculate distance!")
|
||||
self:E({_point1,_point2})
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- END CTLD_ENGINEERING
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,669 @@
|
||||
do
|
||||
--- **Hercules Cargo AIR Drop Events** by Anubis Yinepu
|
||||
-- Moose CTLD OO refactoring by Applevangelist
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO CTLD_HERCULES
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- This script will only work for the Herculus mod by Anubis, and only for **Air Dropping** cargo from the Hercules.
|
||||
-- It *DOES NOT* work with the purchaseable Hercules module from ED.
|
||||
-- Use the standard Moose CTLD if you want to unload on the ground.
|
||||
-- Payloads carried by pylons 11, 12 and 13 need to be declared in the Herculus_Loadout.lua file
|
||||
-- Except for Ammo pallets, this script will spawn whatever payload gets launched from pylons 11, 12 and 13
|
||||
-- Pylons 11, 12 and 13 are moveable within the Hercules cargobay area
|
||||
-- Ammo pallets can only be jettisoned from these pylons with no benefit to DCS world
|
||||
-- To benefit DCS world, Ammo pallets need to be off/on loaded using DCS arming and refueling window
|
||||
-- Cargo_Container_Enclosed = true: Cargo enclosed in container with parachute, need to be dropped from 100m (300ft) or more, except when parked on ground
|
||||
-- Cargo_Container_Enclosed = false: Open cargo with no parachute, need to be dropped from 10m (30ft) or less
|
||||
|
||||
------------------------------------------------------
|
||||
--- **CTLD_HERCULES** class, extends Core.Base#BASE
|
||||
-- @type CTLD_HERCULES
|
||||
-- @field #string ClassName
|
||||
-- @field #string lid
|
||||
-- @field #string Name
|
||||
-- @field #string Version
|
||||
-- @extends Core.Base#BASE
|
||||
CTLD_HERCULES = {
|
||||
ClassName = "CTLD_HERCULES",
|
||||
lid = "",
|
||||
Name = "",
|
||||
Version = "0.0.3",
|
||||
}
|
||||
|
||||
--- Define cargo types.
|
||||
-- @type CTLD_HERCULES.Types
|
||||
-- @field #table Type Name of cargo type, container (boolean) in container or not.
|
||||
CTLD_HERCULES.Types = {
|
||||
["ATGM M1045 HMMWV TOW Air [7183lb]"] = {['name'] = "M1045 HMMWV TOW", ['container'] = true},
|
||||
["ATGM M1045 HMMWV TOW Skid [7073lb]"] = {['name'] = "M1045 HMMWV TOW", ['container'] = false},
|
||||
["APC M1043 HMMWV Armament Air [7023lb]"] = {['name'] = "M1043 HMMWV Armament", ['container'] = true},
|
||||
["APC M1043 HMMWV Armament Skid [6912lb]"] = {['name'] = "M1043 HMMWV Armament", ['container'] = false},
|
||||
["SAM Avenger M1097 Air [7200lb]"] = {['name'] = "M1097 Avenger", ['container'] = true},
|
||||
["SAM Avenger M1097 Skid [7090lb]"] = {['name'] = "M1097 Avenger", ['container'] = false},
|
||||
["APC Cobra Air [10912lb]"] = {['name'] = "Cobra", ['container'] = true},
|
||||
["APC Cobra Skid [10802lb]"] = {['name'] = "Cobra", ['container'] = false},
|
||||
["APC M113 Air [21624lb]"] = {['name'] = "M-113", ['container'] = true},
|
||||
["APC M113 Skid [21494lb]"] = {['name'] = "M-113", ['container'] = false},
|
||||
["Tanker M978 HEMTT [34000lb]"] = {['name'] = "M978 HEMTT Tanker", ['container'] = false},
|
||||
["HEMTT TFFT [34400lb]"] = {['name'] = "HEMTT TFFT", ['container'] = false},
|
||||
["SPG M1128 Stryker MGS [33036lb]"] = {['name'] = "M1128 Stryker MGS", ['container'] = false},
|
||||
["AAA Vulcan M163 Air [21666lb]"] = {['name'] = "Vulcan", ['container'] = true},
|
||||
["AAA Vulcan M163 Skid [21577lb]"] = {['name'] = "Vulcan", ['container'] = false},
|
||||
["APC M1126 Stryker ICV [29542lb]"] = {['name'] = "M1126 Stryker ICV", ['container'] = false},
|
||||
["ATGM M1134 Stryker [30337lb]"] = {['name'] = "M1134 Stryker ATGM", ['container'] = false},
|
||||
["APC LAV-25 Air [22520lb]"] = {['name'] = "LAV-25", ['container'] = true},
|
||||
["APC LAV-25 Skid [22514lb]"] = {['name'] = "LAV-25", ['container'] = false},
|
||||
["M1025 HMMWV Air [6160lb]"] = {['name'] = "Hummer", ['container'] = true},
|
||||
["M1025 HMMWV Skid [6050lb]"] = {['name'] = "Hummer", ['container'] = false},
|
||||
["IFV M2A2 Bradley [34720lb]"] = {['name'] = "M-2 Bradley", ['container'] = false},
|
||||
["IFV MCV-80 [34720lb]"] = {['name'] = "MCV-80", ['container'] = false},
|
||||
["IFV BMP-1 [23232lb]"] = {['name'] = "BMP-1", ['container'] = false},
|
||||
["IFV BMP-2 [25168lb]"] = {['name'] = "BMP-2", ['container'] = false},
|
||||
["IFV BMP-3 [32912lb]"] = {['name'] = "BMP-3", ['container'] = false},
|
||||
["ARV BRDM-2 Air [12320lb]"] = {['name'] = "BRDM-2", ['container'] = true},
|
||||
["ARV BRDM-2 Skid [12210lb]"] = {['name'] = "BRDM-2", ['container'] = false},
|
||||
["APC BTR-80 Air [23936lb]"] = {['name'] = "BTR-80", ['container'] = true},
|
||||
["APC BTR-80 Skid [23826lb]"] = {['name'] = "BTR-80", ['container'] = false},
|
||||
["APC BTR-82A Air [24998lb]"] = {['name'] = "BTR-82A", ['container'] = true},
|
||||
["APC BTR-82A Skid [24888lb]"] = {['name'] = "BTR-82A", ['container'] = false},
|
||||
["SAM ROLAND ADS [34720lb]"] = {['name'] = "Roland Radar", ['container'] = false},
|
||||
["SAM ROLAND LN [34720b]"] = {['name'] = "Roland ADS", ['container'] = false},
|
||||
["SAM SA-13 STRELA [21624lb]"] = {['name'] = "Strela-10M3", ['container'] = false},
|
||||
["AAA ZSU-23-4 Shilka [32912lb]"] = {['name'] = "ZSU-23-4 Shilka", ['container'] = false},
|
||||
["SAM SA-19 Tunguska 2S6 [34720lb]"] = {['name'] = "2S6 Tunguska", ['container'] = false},
|
||||
["Transport UAZ-469 Air [3747lb]"] = {['name'] = "UAZ-469", ['container'] = true},
|
||||
["Transport UAZ-469 Skid [3630lb]"] = {['name'] = "UAZ-469", ['container'] = false},
|
||||
["AAA GEPARD [34720lb]"] = {['name'] = "Gepard", ['container'] = false},
|
||||
["SAM CHAPARRAL Air [21624lb]"] = {['name'] = "M48 Chaparral", ['container'] = true},
|
||||
["SAM CHAPARRAL Skid [21516lb]"] = {['name'] = "M48 Chaparral", ['container'] = false},
|
||||
["SAM LINEBACKER [34720lb]"] = {['name'] = "M6 Linebacker", ['container'] = false},
|
||||
["Transport URAL-375 [14815lb]"] = {['name'] = "Ural-375", ['container'] = false},
|
||||
["Transport M818 [16000lb]"] = {['name'] = "M 818", ['container'] = false},
|
||||
["IFV MARDER [34720lb]"] = {['name'] = "Marder", ['container'] = false},
|
||||
["Transport Tigr Air [15900lb]"] = {['name'] = "Tigr_233036", ['container'] = true},
|
||||
["Transport Tigr Skid [15730lb]"] = {['name'] = "Tigr_233036", ['container'] = false},
|
||||
["IFV TPZ FUCH [33440lb]"] = {['name'] = "TPZ", ['container'] = false},
|
||||
["IFV BMD-1 Air [18040lb]"] = {['name'] = "BMD-1", ['container'] = true},
|
||||
["IFV BMD-1 Skid [17930lb]"] = {['name'] = "BMD-1", ['container'] = false},
|
||||
["IFV BTR-D Air [18040lb]"] = {['name'] = "BTR_D", ['container'] = true},
|
||||
["IFV BTR-D Skid [17930lb]"] = {['name'] = "BTR_D", ['container'] = false},
|
||||
["EWR SBORKA Air [21624lb]"] = {['name'] = "Dog Ear radar", ['container'] = true},
|
||||
["EWR SBORKA Skid [21624lb]"] = {['name'] = "Dog Ear radar", ['container'] = false},
|
||||
["ART 2S9 NONA Air [19140lb]"] = {['name'] = "SAU 2-C9", ['container'] = true},
|
||||
["ART 2S9 NONA Skid [19030lb]"] = {['name'] = "SAU 2-C9", ['container'] = false},
|
||||
["ART GVOZDIKA [34720lb]"] = {['name'] = "SAU Gvozdika", ['container'] = false},
|
||||
["APC MTLB Air [26400lb]"] = {['name'] = "MTLB", ['container'] = true},
|
||||
["APC MTLB Skid [26290lb]"] = {['name'] = "MTLB", ['container'] = false},
|
||||
}
|
||||
|
||||
--- Cargo Object
|
||||
-- @type CTLD_HERCULES.CargoObject
|
||||
-- @field #number Cargo_Drop_Direction
|
||||
-- @field #table Cargo_Contents
|
||||
-- @field #string Cargo_Type_name
|
||||
-- @field #boolean Container_Enclosed
|
||||
-- @field #boolean ParatrooperGroupSpawn
|
||||
-- @field #number Cargo_Country
|
||||
-- @field #boolean offload_cargo
|
||||
-- @field #boolean all_cargo_survive_to_the_ground
|
||||
-- @field #boolean all_cargo_gets_destroyed
|
||||
-- @field #boolean destroy_cargo_dropped_without_parachute
|
||||
-- @field Core.Timer#TIMER scheduleFunctionID
|
||||
|
||||
--- [User] Instantiate a new object
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param #string Coalition Coalition side, "red", "blue" or "neutral"
|
||||
-- @param #string Alias Name of this instance
|
||||
-- @param Ops.CTLD#CTLD CtldObject CTLD instance to link into
|
||||
-- @return #CTLD_HERCULES self
|
||||
-- @usage
|
||||
-- Integrate to your CTLD instance like so, where `my_ctld` is a previously created CTLD instance:
|
||||
--
|
||||
-- my_ctld.enableFixedWing = false -- avoid dual loading via CTLD F10 and F8 ground crew
|
||||
-- local herccargo = CTLD_HERCULES:New("blue", "Hercules Test", my_ctld)
|
||||
--
|
||||
-- You also need:
|
||||
-- * A template called "Infantry" for 10 Paratroopers (as set via herccargo.infantrytemplate).
|
||||
-- * Depending on what you are loading with the help of the ground crew, there are 42 more templates for the various vehicles that are loadable.
|
||||
-- There's a **quick check output in the `dcs.log`** which tells you what's there and what not.
|
||||
-- E.g.:
|
||||
-- ...Checking template for APC BTR-82A Air [24998lb] (BTR-82A) ... MISSING)
|
||||
-- ...Checking template for ART 2S9 NONA Skid [19030lb] (SAU 2-C9) ... MISSING)
|
||||
-- ...Checking template for EWR SBORKA Air [21624lb] (Dog Ear radar) ... MISSING)
|
||||
-- ...Checking template for Transport Tigr Air [15900lb] (Tigr_233036) ... OK)
|
||||
--
|
||||
-- Expected template names are the ones in the rounded brackets.
|
||||
--
|
||||
-- ### HINTS
|
||||
--
|
||||
-- The script works on the EVENTS.Shot trigger, which is used by the mod when you **drop cargo from the Hercules while flying**. Unloading on the ground does
|
||||
-- not achieve anything here. If you just want to unload on the ground, use the normal Moose CTLD.
|
||||
-- **Do not use** the **splash damage** script together with this, your cargo will just explode when reaching the ground!
|
||||
--
|
||||
-- ### Airdrops
|
||||
--
|
||||
-- There are two ways of airdropping:
|
||||
-- 1) Very low and very slow (>5m and <10m AGL) - here you can drop stuff which has "Skid" at the end of the cargo name (loaded via F8 Ground Crew menu)
|
||||
-- 2) Higher up and slow (>100m AGL) - here you can drop paratroopers and cargo which has "Air" at the end of the cargo name (loaded via F8 Ground Crew menu)
|
||||
--
|
||||
-- ### General
|
||||
--
|
||||
-- Use either this method to integrate the Hercules **or** the one from the "normal" CTLD. Never both!
|
||||
function CTLD_HERCULES:New(Coalition, Alias, CtldObject)
|
||||
-- Inherit everything from FSM class.
|
||||
local self=BASE:Inherit(self, FSM:New()) -- #CTLD_HERCULES
|
||||
|
||||
--set Coalition
|
||||
if Coalition and type(Coalition)=="string" then
|
||||
if Coalition=="blue" then
|
||||
self.coalition=coalition.side.BLUE
|
||||
self.coalitiontxt = Coalition
|
||||
elseif Coalition=="red" then
|
||||
self.coalition=coalition.side.RED
|
||||
self.coalitiontxt = Coalition
|
||||
elseif Coalition=="neutral" then
|
||||
self.coalition=coalition.side.NEUTRAL
|
||||
self.coalitiontxt = Coalition
|
||||
else
|
||||
self:E("ERROR: Unknown coalition in CTLD!")
|
||||
end
|
||||
else
|
||||
self.coalition = Coalition
|
||||
self.coalitiontxt = string.lower(UTILS.GetCoalitionName(self.coalition))
|
||||
end
|
||||
|
||||
-- Set alias.
|
||||
if Alias then
|
||||
self.alias=tostring(Alias)
|
||||
else
|
||||
self.alias="UNHCR"
|
||||
if self.coalition then
|
||||
if self.coalition==coalition.side.RED then
|
||||
self.alias="Red CTLD Hercules"
|
||||
elseif self.coalition==coalition.side.BLUE then
|
||||
self.alias="Blue CTLD Hercules"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("%s (%s) | ", self.alias, self.coalitiontxt)
|
||||
|
||||
self.infantrytemplate = "Infantry" -- template for a group of 10 paratroopers
|
||||
self.CTLD = CtldObject -- Ops.CTLD#CTLD
|
||||
|
||||
self.verbose = true
|
||||
|
||||
self.j = 0
|
||||
self.carrierGroups = {}
|
||||
self.Cargo = {}
|
||||
self.ParatrooperCount = {}
|
||||
|
||||
self.ObjectTracker = {}
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("%s (%s) | ", self.alias, self.coalition and UTILS.GetCoalitionName(self.coalition) or "unknown")
|
||||
|
||||
self:HandleEvent(EVENTS.Shot, self._HandleShot)
|
||||
|
||||
self:I(self.lid .. "Started")
|
||||
|
||||
self:CheckTemplates()
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to check availability of templates
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:CheckTemplates()
|
||||
self:T(self.lid .. 'CheckTemplates')
|
||||
-- inject Paratroopers
|
||||
self.Types["Paratroopers 10"] = {
|
||||
name = self.infantrytemplate,
|
||||
container = false,
|
||||
available = false,
|
||||
}
|
||||
local missing = {}
|
||||
local nomissing = 0
|
||||
local found = {}
|
||||
local nofound = 0
|
||||
|
||||
-- list of groundcrew loadables
|
||||
for _index,_tab in pairs (self.Types) do
|
||||
local outcometxt = "MISSING"
|
||||
if _DATABASE.Templates.Groups[_tab.name] then
|
||||
outcometxt = "OK"
|
||||
self.Types[_index].available= true
|
||||
found[_tab.name] = true
|
||||
else
|
||||
self.Types[_index].available = false
|
||||
missing[_tab.name] = true
|
||||
end
|
||||
if self.verbose then
|
||||
self:I(string.format(self.lid .. "Checking template for %s (%s) ... %s", _index,_tab.name,outcometxt))
|
||||
end
|
||||
end
|
||||
for _,_name in pairs(found) do
|
||||
nofound = nofound + 1
|
||||
end
|
||||
for _,_name in pairs(missing) do
|
||||
nomissing = nomissing + 1
|
||||
end
|
||||
self:I(string.format(self.lid .. "Template Check Summary: Found %d, Missing %d, Total %d",nofound,nomissing,nofound+nomissing))
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to spawn a soldier group of 10 units
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Cargo_Drop_initiator
|
||||
-- @param Core.Point#COORDINATE Cargo_Drop_Position
|
||||
-- @param #string Cargo_Type_name
|
||||
-- @param #number CargoHeading
|
||||
-- @param #number Cargo_Country
|
||||
-- @param #number GroupSpacing
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Soldier_SpawnGroup(Cargo_Drop_initiator,Cargo_Drop_Position, Cargo_Type_name, CargoHeading, Cargo_Country, GroupSpacing)
|
||||
--- TODO: Rework into Moose Spawns
|
||||
self:T(self.lid .. 'Soldier_SpawnGroup')
|
||||
self:T(Cargo_Drop_Position)
|
||||
-- create a matching #CTLD_CARGO type
|
||||
local InjectTroopsType = CTLD_CARGO:New(nil,self.infantrytemplate,{self.infantrytemplate},CTLD_CARGO.Enum.TROOPS,true,true,10,nil,false,80)
|
||||
-- get a #ZONE object
|
||||
local position = Cargo_Drop_Position:GetVec2()
|
||||
local dropzone = ZONE_RADIUS:New("Infantry " .. math.random(1,10000),position,100)
|
||||
-- and go:
|
||||
self.CTLD:InjectTroops(dropzone,InjectTroopsType)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to spawn a group
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Cargo_Drop_initiator
|
||||
-- @param Core.Point#COORDINATE Cargo_Drop_Position
|
||||
-- @param #string Cargo_Type_name
|
||||
-- @param #number CargoHeading
|
||||
-- @param #number Cargo_Country
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Cargo_SpawnGroup(Cargo_Drop_initiator,Cargo_Drop_Position, Cargo_Type_name, CargoHeading, Cargo_Country)
|
||||
--- TODO: Rework into Moose Spawns
|
||||
self:T(self.lid .. "Cargo_SpawnGroup")
|
||||
self:T(Cargo_Type_name)
|
||||
if Cargo_Type_name ~= 'Container red 1' then
|
||||
-- create a matching #CTLD_CARGO type
|
||||
local InjectVehicleType = CTLD_CARGO:New(nil,Cargo_Type_name,{Cargo_Type_name},CTLD_CARGO.Enum.VEHICLE,true,true,1,nil,false,1000)
|
||||
-- get a #ZONE object
|
||||
local position = Cargo_Drop_Position:GetVec2()
|
||||
local dropzone = ZONE_RADIUS:New("Vehicle " .. math.random(1,10000),position,100)
|
||||
-- and go:
|
||||
self.CTLD:InjectVehicles(dropzone,InjectVehicleType)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to spawn static cargo
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Cargo_Drop_initiator
|
||||
-- @param Core.Point#COORDINATE Cargo_Drop_Position
|
||||
-- @param #string Cargo_Type_name
|
||||
-- @param #number CargoHeading
|
||||
-- @param #boolean dead
|
||||
-- @param #number Cargo_Country
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Drop_Position, Cargo_Type_name, CargoHeading, dead, Cargo_Country)
|
||||
--- TODO: Rework into Moose Static Spawns
|
||||
self:T(self.lid .. "Cargo_SpawnStatic")
|
||||
self:T("Static " .. Cargo_Type_name .. " Dead " .. tostring(dead))
|
||||
local position = Cargo_Drop_Position:GetVec2()
|
||||
local Zone = ZONE_RADIUS:New("Cargo Static " .. math.random(1,10000),position,100)
|
||||
if not dead then
|
||||
local injectstatic = CTLD_CARGO:New(nil,"Cargo Static Group "..math.random(1,10000),"iso_container",CTLD_CARGO.Enum.STATIC,true,false,1,nil,true,4500,1)
|
||||
self.CTLD:InjectStatics(Zone,injectstatic,true,true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to spawn cargo by type at position
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param #string Cargo_Type_name
|
||||
-- @param Core.Point#COORDINATE Cargo_Drop_Position
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Cargo_SpawnDroppedAsCargo(_name, _pos)
|
||||
local theCargo = self.CTLD:_FindCratesCargoObject(_name) -- #CTLD_CARGO
|
||||
if theCargo then
|
||||
self.CTLD.CrateCounter = self.CTLD.CrateCounter + 1
|
||||
local CCat, CType, CShape = theCargo:GetStaticTypeAndShape()
|
||||
local basetype = CType or self.CTLD.basetype or "container_cargo"
|
||||
CCat = CCat or "Cargos"
|
||||
local theStatic = SPAWNSTATIC:NewFromType(basetype,CCat,self.cratecountry)
|
||||
:InitCargoMass(theCargo.PerCrateMass)
|
||||
:InitCargo(self.CTLD.enableslingload)
|
||||
:InitCoordinate(_pos)
|
||||
if CShape then
|
||||
theStatic:InitShape(CShape)
|
||||
end
|
||||
theStatic:Spawn(270,_name .. "-Container-".. math.random(1,100000))
|
||||
|
||||
self.CTLD.Spawned_Crates[self.CTLD.CrateCounter] = theStatic
|
||||
local newCargo = CTLD_CARGO:New(self.CTLD.CargoCounter, theCargo.Name, theCargo.Templates, theCargo.CargoType, true, false, theCargo.CratesNeeded, self.CTLD.Spawned_Crates[self.CTLD.CrateCounter], true, theCargo.PerCrateMass, nil, theCargo.Subcategory)
|
||||
local map=theCargo:GetStaticResourceMap()
|
||||
newCargo:SetStaticResourceMap(map)
|
||||
table.insert(self.CTLD.Spawned_Cargo, newCargo)
|
||||
|
||||
newCargo:SetWasDropped(true)
|
||||
newCargo:SetHasMoved(true)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Spawn cargo objects
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Cargo_Drop_initiator
|
||||
-- @param #number Cargo_Drop_Direction
|
||||
-- @param Core.Point#COORDINATE Cargo_Content_position
|
||||
-- @param #string Cargo_Type_name
|
||||
-- @param #boolean Cargo_over_water
|
||||
-- @param #boolean Container_Enclosed
|
||||
-- @param #boolean ParatrooperGroupSpawn
|
||||
-- @param #boolean offload_cargo
|
||||
-- @param #boolean all_cargo_survive_to_the_ground
|
||||
-- @param #boolean all_cargo_gets_destroyed
|
||||
-- @param #boolean destroy_cargo_dropped_without_parachute
|
||||
-- @param #number Cargo_Country
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Cargo_SpawnObjects(Cargo_Drop_initiator,Cargo_Drop_Direction, Cargo_Content_position, Cargo_Type_name, Cargo_over_water, Container_Enclosed, ParatrooperGroupSpawn, offload_cargo, all_cargo_survive_to_the_ground, all_cargo_gets_destroyed, destroy_cargo_dropped_without_parachute, Cargo_Country)
|
||||
self:T(self.lid .. 'Cargo_SpawnObjects')
|
||||
|
||||
local CargoHeading = self.CargoHeading
|
||||
|
||||
if offload_cargo == true or ParatrooperGroupSpawn == true then
|
||||
if ParatrooperGroupSpawn == true then
|
||||
self:Soldier_SpawnGroup(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, Cargo_Country, 10)
|
||||
else
|
||||
self:Cargo_SpawnGroup(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, Cargo_Country)
|
||||
end
|
||||
else
|
||||
if all_cargo_gets_destroyed == true or Cargo_over_water == true then
|
||||
|
||||
else
|
||||
if all_cargo_survive_to_the_ground == true then
|
||||
if ParatrooperGroupSpawn == true then
|
||||
self:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, true, Cargo_Country)
|
||||
else
|
||||
self:Cargo_SpawnGroup(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, Cargo_Country)
|
||||
end
|
||||
if Container_Enclosed == true then
|
||||
if ParatrooperGroupSpawn == false then
|
||||
self:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Content_position, "Hercules_Container_Parachute_Static", CargoHeading, false, Cargo_Country)
|
||||
end
|
||||
end
|
||||
end
|
||||
if destroy_cargo_dropped_without_parachute == true then
|
||||
if Container_Enclosed == true then
|
||||
if ParatrooperGroupSpawn == true then
|
||||
self:Soldier_SpawnGroup(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, Cargo_Country, 0)
|
||||
else
|
||||
if self.CTLD.dropAsCargoCrate then
|
||||
self:Cargo_SpawnDroppedAsCargo(Cargo_Type_name, Cargo_Content_position)
|
||||
else
|
||||
self:Cargo_SpawnGroup(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, Cargo_Country)
|
||||
self:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Content_position, "Hercules_Container_Parachute_Static", CargoHeading, false, Cargo_Country)
|
||||
end
|
||||
end
|
||||
else
|
||||
self:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Content_position, Cargo_Type_name, CargoHeading, true, Cargo_Country)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to calculate object height
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP group The group for which to calculate the height
|
||||
-- @return #number height over ground
|
||||
function CTLD_HERCULES:Calculate_Object_Height_AGL(group)
|
||||
self:T(self.lid .. "Calculate_Object_Height_AGL")
|
||||
if group.ClassName and group.ClassName == "GROUP" then
|
||||
local gcoord = group:GetCoordinate()
|
||||
local height = group:GetHeight()
|
||||
local lheight = gcoord:GetLandHeight()
|
||||
self:T(self.lid .. "Height " .. height - lheight)
|
||||
return height - lheight
|
||||
else
|
||||
-- DCS object
|
||||
if group:isExist() then
|
||||
local dcsposition = group:getPosition().p
|
||||
local dcsvec2 = {x = dcsposition.x, y = dcsposition.z} -- Vec2
|
||||
local height = math.floor(group:getPosition().p.y - land.getHeight(dcsvec2))
|
||||
self.ObjectTracker[group.id_] = dcsposition -- Vec3
|
||||
self:T(self.lid .. "Height " .. height)
|
||||
return height
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- [Internal] Function to check surface type
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP group The group for which to calculate the height
|
||||
-- @return #number height over ground
|
||||
function CTLD_HERCULES:Check_SurfaceType(object)
|
||||
self:T(self.lid .. "Check_SurfaceType")
|
||||
-- LAND,--1 SHALLOW_WATER,--2 WATER,--3 ROAD,--4 RUNWAY--5
|
||||
if object:isExist() then
|
||||
return land.getSurfaceType({x = object:getPosition().p.x, y = object:getPosition().p.z})
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
--- [Internal] Function to track cargo objects
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param #CTLD_HERCULES.CargoObject cargo
|
||||
-- @param Wrapper.Group#GROUP initiator
|
||||
-- @return #number height over ground
|
||||
function CTLD_HERCULES:Cargo_Track(cargo, initiator)
|
||||
self:T(self.lid .. "Cargo_Track")
|
||||
local Cargo_Drop_initiator = initiator
|
||||
if cargo.Cargo_Contents ~= nil then
|
||||
if self:Calculate_Object_Height_AGL(cargo.Cargo_Contents) < 10 then --pallet less than 5m above ground before spawning
|
||||
if self:Check_SurfaceType(cargo.Cargo_Contents) == 2 or self:Check_SurfaceType(cargo.Cargo_Contents) == 3 then
|
||||
cargo.Cargo_over_water = true--pallets gets destroyed in water
|
||||
end
|
||||
local dcsvec3 = self.ObjectTracker[cargo.Cargo_Contents.id_] or initiator:GetVec3() -- last known position
|
||||
self:T("SPAWNPOSITION: ")
|
||||
self:T({dcsvec3})
|
||||
local Vec2 = {
|
||||
x=dcsvec3.x,
|
||||
y=dcsvec3.z,
|
||||
}
|
||||
local vec3 = COORDINATE:NewFromVec2(Vec2)
|
||||
self.ObjectTracker[cargo.Cargo_Contents.id_] = nil
|
||||
self:Cargo_SpawnObjects(Cargo_Drop_initiator,cargo.Cargo_Drop_Direction, vec3, cargo.Cargo_Type_name, cargo.Cargo_over_water, cargo.Container_Enclosed, cargo.ParatrooperGroupSpawn, cargo.offload_cargo, cargo.all_cargo_survive_to_the_ground, cargo.all_cargo_gets_destroyed, cargo.destroy_cargo_dropped_without_parachute, cargo.Cargo_Country)
|
||||
if cargo.Cargo_Contents:isExist() then
|
||||
cargo.Cargo_Contents:destroy()--remove pallet+parachute before hitting ground and replace with Cargo_SpawnContents
|
||||
end
|
||||
--timer.removeFunction(cargo.scheduleFunctionID)
|
||||
cargo.scheduleFunctionID:Stop()
|
||||
cargo = {}
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to calc north correction
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Core.Point#POINT_Vec3 point Position Vec3
|
||||
-- @return #number north correction
|
||||
function CTLD_HERCULES:Calculate_Cargo_Drop_initiator_NorthCorrection(point)
|
||||
self:T(self.lid .. "Calculate_Cargo_Drop_initiator_NorthCorrection")
|
||||
if not point.z then --Vec2; convert to Vec3
|
||||
point.z = point.y
|
||||
point.y = 0
|
||||
end
|
||||
local lat, lon = coord.LOtoLL(point)
|
||||
local north_posit = coord.LLtoLO(lat + 1, lon)
|
||||
return math.atan2(north_posit.z - point.z, north_posit.x - point.x)
|
||||
end
|
||||
|
||||
--- [Internal] Function to calc initiator heading
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Cargo_Drop_initiator
|
||||
-- @return #number north corrected heading
|
||||
function CTLD_HERCULES:Calculate_Cargo_Drop_initiator_Heading(Cargo_Drop_initiator)
|
||||
self:T(self.lid .. "Calculate_Cargo_Drop_initiator_Heading")
|
||||
local Heading = Cargo_Drop_initiator:GetHeading()
|
||||
Heading = Heading + self:Calculate_Cargo_Drop_initiator_NorthCorrection(Cargo_Drop_initiator:GetVec3())
|
||||
if Heading < 0 then
|
||||
Heading = Heading + (2 * math.pi)-- put heading in range of 0 to 2*pi
|
||||
end
|
||||
return Heading + 0.06 -- rad
|
||||
end
|
||||
|
||||
--- [Internal] Function to initialize dropped cargo
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Wrapper.Group#GROUP Initiator
|
||||
-- @param #table Cargo_Contents Table 'weapon' from event data
|
||||
-- @param #string Cargo_Type_name Name of this cargo
|
||||
-- @param #boolean Container_Enclosed Is container?
|
||||
-- @param #boolean SoldierGroup Is soldier group?
|
||||
-- @param #boolean ParatrooperGroupSpawnInit Is paratroopers?
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:Cargo_Initialize(Initiator, Cargo_Contents, Cargo_Type_name, Container_Enclosed, SoldierGroup, ParatrooperGroupSpawnInit)
|
||||
self:T(self.lid .. "Cargo_Initialize")
|
||||
local Cargo_Drop_initiator = Initiator:GetName()
|
||||
if Cargo_Drop_initiator ~= nil then
|
||||
if ParatrooperGroupSpawnInit == true then
|
||||
self:T("Paratrooper Drop")
|
||||
-- Paratroopers
|
||||
if not self.ParatrooperCount[Cargo_Drop_initiator] then
|
||||
self.ParatrooperCount[Cargo_Drop_initiator] = 1
|
||||
else
|
||||
self.ParatrooperCount[Cargo_Drop_initiator] = self.ParatrooperCount[Cargo_Drop_initiator] + 1
|
||||
end
|
||||
|
||||
local Paratroopers = self.ParatrooperCount[Cargo_Drop_initiator]
|
||||
|
||||
self:T("Paratrooper Drop Number " .. self.ParatrooperCount[Cargo_Drop_initiator])
|
||||
|
||||
local SpawnParas = false
|
||||
|
||||
if math.fmod(Paratroopers,10) == 0 then
|
||||
SpawnParas = true
|
||||
end
|
||||
|
||||
self.j = self.j + 1
|
||||
self.Cargo[self.j] = {}
|
||||
self.Cargo[self.j].Cargo_Drop_Direction = self:Calculate_Cargo_Drop_initiator_Heading(Initiator)
|
||||
self.Cargo[self.j].Cargo_Contents = Cargo_Contents
|
||||
self.Cargo[self.j].Cargo_Type_name = Cargo_Type_name
|
||||
self.Cargo[self.j].Container_Enclosed = Container_Enclosed
|
||||
self.Cargo[self.j].ParatrooperGroupSpawn = SpawnParas
|
||||
self.Cargo[self.j].Cargo_Country = Initiator:GetCountry()
|
||||
|
||||
if self:Calculate_Object_Height_AGL(Initiator) < 5.0 then --aircraft on ground
|
||||
self.Cargo[self.j].offload_cargo = true
|
||||
elseif self:Calculate_Object_Height_AGL(Initiator) < 10.0 then --aircraft less than 10m above ground
|
||||
self.Cargo[self.j].all_cargo_survive_to_the_ground = true
|
||||
elseif self:Calculate_Object_Height_AGL(Initiator) < 100.0 then --aircraft more than 10m but less than 100m above ground
|
||||
self.Cargo[self.j].all_cargo_gets_destroyed = true
|
||||
else
|
||||
self.Cargo[self.j].all_cargo_gets_destroyed = false
|
||||
end
|
||||
|
||||
local timer = TIMER:New(self.Cargo_Track,self,self.Cargo[self.j],Initiator)
|
||||
self.Cargo[self.j].scheduleFunctionID = timer
|
||||
timer:Start(1,1,600)
|
||||
|
||||
else
|
||||
-- no paras
|
||||
self.j = self.j + 1
|
||||
self.Cargo[self.j] = {}
|
||||
self.Cargo[self.j].Cargo_Drop_Direction = self:Calculate_Cargo_Drop_initiator_Heading(Initiator)
|
||||
self.Cargo[self.j].Cargo_Contents = Cargo_Contents
|
||||
self.Cargo[self.j].Cargo_Type_name = Cargo_Type_name
|
||||
self.Cargo[self.j].Container_Enclosed = Container_Enclosed
|
||||
self.Cargo[self.j].ParatrooperGroupSpawn = false
|
||||
self.Cargo[self.j].Cargo_Country = Initiator:GetCountry()
|
||||
|
||||
if self:Calculate_Object_Height_AGL(Initiator) < 5.0 then--aircraft on ground
|
||||
self.Cargo[self.j].offload_cargo = true
|
||||
elseif self:Calculate_Object_Height_AGL(Initiator) < 10.0 then--aircraft less than 10m above ground
|
||||
self.Cargo[self.j].all_cargo_survive_to_the_ground = true
|
||||
elseif self:Calculate_Object_Height_AGL(Initiator) < 100.0 then--aircraft more than 10m but less than 100m above ground
|
||||
self.Cargo[self.j].all_cargo_gets_destroyed = true
|
||||
else
|
||||
self.Cargo[self.j].destroy_cargo_dropped_without_parachute = true --aircraft more than 100m above ground
|
||||
end
|
||||
|
||||
local timer = TIMER:New(self.Cargo_Track,self,self.Cargo[self.j],Initiator)
|
||||
self.Cargo[self.j].scheduleFunctionID = timer
|
||||
timer:Start(1,1,600)
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to change cargotype per group (Wrench)
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param #number key Carrier key id
|
||||
-- @param #string cargoType Type of cargo
|
||||
-- @param #number cargoNum Number of cargo objects
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:SetType(key,cargoType,cargoNum)
|
||||
self:T(self.lid .. "SetType")
|
||||
self.carrierGroups[key]['cargoType'] = cargoType
|
||||
self.carrierGroups[key]['cargoNum'] = cargoNum
|
||||
return self
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- EventHandlers
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--- [Internal] Function to capture SHOT event
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Core.Event#EVENTDATA Cargo_Drop_Event The event data
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:_HandleShot(Cargo_Drop_Event)
|
||||
self:T(self.lid .. "Shot Event ID:" .. Cargo_Drop_Event.id)
|
||||
if Cargo_Drop_Event.id == EVENTS.Shot then
|
||||
|
||||
local GT_Name = ""
|
||||
local SoldierGroup = false
|
||||
local ParatrooperGroupSpawnInit = false
|
||||
|
||||
local GT_DisplayName = Weapon.getDesc(Cargo_Drop_Event.weapon).typeName:sub(15, -1)--Remove "weapons.bombs." from string
|
||||
self:T(string.format("%sCargo_Drop_Event: %s", self.lid, Weapon.getDesc(Cargo_Drop_Event.weapon).typeName))
|
||||
|
||||
if (GT_DisplayName == "Squad 30 x Soldier [7950lb]") then
|
||||
self:Cargo_Initialize(Cargo_Drop_Event.IniGroup, Cargo_Drop_Event.weapon, "Soldier M4 GRG", false, true, true)
|
||||
end
|
||||
|
||||
if self.Types[GT_DisplayName] then
|
||||
local GT_Name = self.Types[GT_DisplayName]['name']
|
||||
local Cargo_Container_Enclosed = self.Types[GT_DisplayName]['container']
|
||||
self:Cargo_Initialize(Cargo_Drop_Event.IniGroup, Cargo_Drop_Event.weapon, GT_Name, Cargo_Container_Enclosed)
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Internal] Function to capture BIRTH event
|
||||
-- @param #CTLD_HERCULES self
|
||||
-- @param Core.Event#EVENTDATA event The event data
|
||||
-- @return #CTLD_HERCULES self
|
||||
function CTLD_HERCULES:_HandleBirth(event)
|
||||
-- not sure what this is needed for? I think this for setting generic crates "content" setting.
|
||||
self:T(self.lid .. "Birth Event ID:" .. event.id)
|
||||
return self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- End Ops.CTLD.lua
|
||||
-------------------------------------------------------------------
|
||||
File diff suppressed because it is too large
Load Diff
@@ -257,6 +257,7 @@ CHIEF = {
|
||||
tacview = false,
|
||||
Nsuccess = 0,
|
||||
Nfailure = 0,
|
||||
LegionRecruitMinRange = {}
|
||||
}
|
||||
|
||||
--- Defence condition.
|
||||
@@ -332,7 +333,7 @@ CHIEF.Strategy = {
|
||||
|
||||
--- CHIEF class version.
|
||||
-- @field #string version
|
||||
CHIEF.version="0.7.0"
|
||||
CHIEF.version="0.7.1"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -362,8 +363,8 @@ CHIEF.version="0.7.0"
|
||||
--- Create a new CHIEF object and start the FSM.
|
||||
-- @param #CHIEF self
|
||||
-- @param #number Coalition Coalition side, e.g. `coaliton.side.BLUE`. Can also be passed as a string "red", "blue" or "neutral".
|
||||
-- @param Core.Set#SET_GROUP AgentSet Set of agents (groups) providing intel. Default is an empty set.
|
||||
-- @param #string Alias An *optional* alias how this object is called in the logs etc.
|
||||
-- @param Core.Set#SET_GROUP AgentSet (Optional) Set of agents (groups) providing intel. Default is an empty set.
|
||||
-- @param #string Alias (Optional) An *optional* alias how this object is called in the logs etc.
|
||||
-- @return #CHIEF self
|
||||
function CHIEF:New(Coalition, AgentSet, Alias)
|
||||
|
||||
@@ -388,6 +389,8 @@ function CHIEF:New(Coalition, AgentSet, Alias)
|
||||
self:SetBorderZones()
|
||||
self:SetConflictZones()
|
||||
self:SetAttackZones()
|
||||
self:SetCorridorZones()
|
||||
self:SetRejectZones()
|
||||
self:SetThreatLevelRange()
|
||||
|
||||
-- Init stuff.
|
||||
@@ -739,8 +742,8 @@ end
|
||||
--- Set a threat level range that will be engaged. Threat level is a number between 0 and 10, where 10 is a very dangerous threat.
|
||||
-- Targets with threat level 0 are usually harmless.
|
||||
-- @param #CHIEF self
|
||||
-- @param #number ThreatLevelMin Min threat level. Default 1.
|
||||
-- @param #number ThreatLevelMax Max threat level. Default 10.
|
||||
-- @param #number ThreatLevelMin (Optional) Min threat level. Default 1.
|
||||
-- @param #number ThreatLevelMax (Optional) Max threat level. Default 10.
|
||||
-- @return #CHIEF self
|
||||
function CHIEF:SetThreatLevelRange(ThreatLevelMin, ThreatLevelMax)
|
||||
|
||||
@@ -782,10 +785,10 @@ end
|
||||
--- Create a new resource list of required assets.
|
||||
-- @param #CHIEF self
|
||||
-- @param #string MissionType The mission type.
|
||||
-- @param #number Nmin Min number of required assets. Default 1.
|
||||
-- @param #number Nmax Max number of requried assets. Default 1.
|
||||
-- @param #table Attributes Generalized attribute(s). Default `nil`.
|
||||
-- @param #table Properties DCS attribute(s). Default `nil`.
|
||||
-- @param #number Nmin (Optional) Min number of required assets. Default 1.
|
||||
-- @param #number Nmax (Optional) Max number of requried assets. Default 1.
|
||||
-- @param #table Attributes (Optional) Generalized attribute(s). Default `nil`.
|
||||
-- @param #table Properties (Optional) DCS attribute(s). Default `nil`.
|
||||
-- @param #table Categories Group categories.
|
||||
-- @return #CHIEF.Resources The newly created resource list table.
|
||||
-- @return #CHIEF.Resource The resource object that was added.
|
||||
@@ -802,8 +805,8 @@ end
|
||||
-- @param #CHIEF self
|
||||
-- @param #CHIEF.Resources Resource List of resources.
|
||||
-- @param #string MissionType Mission Type.
|
||||
-- @param #number Nmin Min number of required assets. Default 1.
|
||||
-- @param #number Nmax Max number of requried assets. Default equal `Nmin`.
|
||||
-- @param #number Nmin (Optional) Min number of required assets. Default 1.
|
||||
-- @param #number Nmax (Optional) Max number of requried assets. Default equal `Nmin`.
|
||||
-- @param #table Attributes Generalized attribute(s).
|
||||
-- @param #table Properties DCS attribute(s). Default `nil`.
|
||||
-- @param #table Categories Group categories.
|
||||
@@ -845,8 +848,8 @@ end
|
||||
--- Define which assets will be transported and define the number and attributes/properties of the cargo carrier assets.
|
||||
-- @param #CHIEF self
|
||||
-- @param #CHIEF.Resource Resource Resource table.
|
||||
-- @param #number Nmin Min number of required assets. Default 1.
|
||||
-- @param #number Nmax Max number of requried assets. Default is equal to `Nmin`.
|
||||
-- @param #number Nmin (Optional) Min number of required assets. Default 1.
|
||||
-- @param #number Nmax (Optional) Max number of requried assets. Default is equal to `Nmin`.
|
||||
-- @param #table CarrierAttributes Generalized attribute(s) of the carrier assets.
|
||||
-- @param #table CarrierProperties DCS attribute(s) of the carrier assets.
|
||||
-- @param #table CarrierCategories Group categories of the carrier assets.
|
||||
@@ -884,12 +887,12 @@ end
|
||||
|
||||
--- Set number of assets requested for detected targets.
|
||||
-- @param #CHIEF self
|
||||
-- @param #number NassetsMin Min number of assets. Should be at least 1. Default 1.
|
||||
-- @param #number NassetsMax Max number of assets. Default is same as `NassetsMin`.
|
||||
-- @param #number ThreatLevel Only apply this setting if the target threat level is greater or equal this number. Default 0.
|
||||
-- @param #number NassetsMin (Optional) Min number of assets. Should be at least 1. Default 1.
|
||||
-- @param #number NassetsMax (Optional) Max number of assets. Default is same as `NassetsMin`.
|
||||
-- @param #number ThreatLevel (Optional) Only apply this setting if the target threat level is greater or equal this number. Default 0.
|
||||
-- @param #string TargetCategory Only apply this setting if the target is of this category, e.g. `TARGET.Category.AIRCRAFT`.
|
||||
-- @param #string MissionType Only apply this setting for this mission type, e.g. `AUFTRAG.Type.INTERCEPT`.
|
||||
-- @param #string Nunits Only apply this setting if the number of enemy units is greater or equal this number.
|
||||
-- @param #string Nunits (Optional) Only apply this setting if the number of enemy units is greater or equal this number. Defaults to 1.
|
||||
-- @param #string Defcon Only apply this setting if this defense condition is in place.
|
||||
-- @param #string Strategy Only apply this setting if this strategy is in currently. place.
|
||||
-- @return #CHIEF self
|
||||
@@ -1038,8 +1041,8 @@ end
|
||||
|
||||
--- Set limit for number of total or specific missions to be executed simultaniously.
|
||||
-- @param #CHIEF self
|
||||
-- @param #number Limit Number of max. mission of this type. Default 10.
|
||||
-- @param #string MissionType Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions.
|
||||
-- @param #number Limit (Optional) Number of max. mission of this type. Default 10.
|
||||
-- @param #string MissionType (Optional) Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions.
|
||||
-- @return #CHIEF self
|
||||
function CHIEF:SetLimitMission(Limit, MissionType)
|
||||
self.commander:SetLimitMission(Limit, MissionType)
|
||||
@@ -1065,7 +1068,7 @@ end
|
||||
|
||||
--- Set strategy.
|
||||
-- @param #CHIEF self
|
||||
-- @param #string Strategy Strategy. See @{#CHIEF.strategy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default).
|
||||
-- @param #string Strategy (Optional) Strategy. See @{#CHIEF.strategy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default).
|
||||
-- @return #CHIEF self
|
||||
function CHIEF:SetStrategy(Strategy)
|
||||
|
||||
@@ -1295,8 +1298,8 @@ end
|
||||
--
|
||||
-- @param #CHIEF self
|
||||
-- @param Ops.OpsZone#OPSZONE OpsZone OPS zone object.
|
||||
-- @param #number Priority Priority. Default 50.
|
||||
-- @param #number Importance Importance. Default `#nil`.
|
||||
-- @param #number Priority (Optional) Priority. Default 50.
|
||||
-- @param #number Importance (Optional) Importance. Default `#nil`.
|
||||
-- @param #CHIEF.Resources ResourceOccupied (Optional) Resources used then zone is occupied by the enemy.
|
||||
-- @param #CHIEF.Resources ResourceEmpty (Optional) Resources used then zone is empty.
|
||||
-- @return #CHIEF.StrategicZone The strategic zone.
|
||||
@@ -1393,7 +1396,7 @@ end
|
||||
--- Remove strategically important zone. All runing missions are cancelled.
|
||||
-- @param #CHIEF self
|
||||
-- @param Ops.OpsZone#OPSZONE OpsZone OPS zone object.
|
||||
-- @param #number Delay Delay in seconds before the zone is removed. Default immidiately.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the zone is removed. Default immidiately.
|
||||
-- @return #CHIEF self
|
||||
function CHIEF:RemoveStrategicZone(OpsZone, Delay)
|
||||
|
||||
@@ -1467,10 +1470,10 @@ end
|
||||
--- Add a CAP zone. Flights will engage detected targets inside this zone.
|
||||
-- @param #CHIEF self
|
||||
-- @param Core.Zone#ZONE Zone CAP Zone. Has to be a circular zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading(Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data.
|
||||
function CHIEF:AddCapZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -1483,10 +1486,10 @@ end
|
||||
--- Add a GCI CAP.
|
||||
-- @param #CHIEF self
|
||||
-- @param Core.Zone#ZONE Zone Zone, where the flight orbits.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data.
|
||||
function CHIEF:AddGciCapZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -1510,10 +1513,10 @@ end
|
||||
--- Add an AWACS zone.
|
||||
-- @param #CHIEF self
|
||||
-- @param Core.Zone#ZONE Zone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The AWACS zone data.
|
||||
function CHIEF:AddAwacsZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -1537,10 +1540,10 @@ end
|
||||
--- Add a refuelling tanker zone.
|
||||
-- @param #CHIEF self
|
||||
-- @param Core.Zone#ZONE Zone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number RefuelSystem Refuelling system.
|
||||
-- @return Ops.Airwing#AIRWING.TankerZone The tanker zone data.
|
||||
function CHIEF:AddTankerZone(Zone, Altitude, Speed, Heading, Leg, RefuelSystem)
|
||||
@@ -2463,9 +2466,9 @@ function CHIEF:CheckTargetQueue()
|
||||
|
||||
-- Debug info.
|
||||
self:T2(self.lid..string.format("Recruiting assets for mission type %s [performance=%d] of target %s", mp.MissionType, mp.Performance, target:GetName()))
|
||||
|
||||
local minRange = self.LegionRecruitMinRange[target.category]
|
||||
-- Recruit assets.
|
||||
local recruited, assets, legions=self.commander:RecruitAssetsForTarget(target, mp.MissionType, NassetsMin, NassetsMax)
|
||||
local recruited, assets, legions=self.commander:RecruitAssetsForTarget(target, mp.MissionType, NassetsMin, NassetsMax, minRange)
|
||||
|
||||
if recruited then
|
||||
|
||||
@@ -3367,6 +3370,15 @@ function CHIEF:CanMission(Mission)
|
||||
return self.commander and self.commander:CanMission(Mission)
|
||||
end
|
||||
|
||||
--- Exclude legion recruitment that are below a minimum range to target based on the target category.
|
||||
--- Ex. Prevent intercepts from spawning too close to the target.
|
||||
-- @param #CHIEF self
|
||||
-- @param #string TargetCategory The target category.
|
||||
-- @param #number MinRange Minimum range in meters.
|
||||
function CHIEF:AddLegionRecruitMinRange(TargetCategory, MinRange)
|
||||
self.LegionRecruitMinRange[TargetCategory] = MinRange
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -109,8 +109,8 @@ _COHORTNAMES={}
|
||||
--- Create a new COHORT object and start the FSM.
|
||||
-- @param #COHORT self
|
||||
-- @param #string TemplateGroupName Name of the template group.
|
||||
-- @param #number Ngroups Number of asset groups of this Cohort. Default 3.
|
||||
-- @param #string CohortName Name of the cohort.
|
||||
-- @param #number Ngroups (Optional) Number of asset groups of this Cohort. Default 3.
|
||||
-- @param #string CohortName (Optional) Name of the cohort. Defaults to TemplateGroupName.
|
||||
-- @return #COHORT self
|
||||
function COHORT:New(TemplateGroupName, Ngroups, CohortName)
|
||||
|
||||
@@ -357,7 +357,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #COHORT self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #COHORT self
|
||||
function COHORT:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -366,8 +366,8 @@ end
|
||||
|
||||
--- Set turnover and repair time. If an asset returns from a mission, it will need some time until the asset is available for further missions.
|
||||
-- @param #COHORT self
|
||||
-- @param #number MaintenanceTime Time in minutes it takes until a flight is combat ready again. Default is 0 min.
|
||||
-- @param #number RepairTime Time in minutes it takes to repair a flight for each life point taken. Default is 0 min.
|
||||
-- @param #number MaintenanceTime (Optional) Time in minutes it takes until a flight is combat ready again. Default is 0 min.
|
||||
-- @param #number RepairTime (Optional) Time in minutes it takes to repair a flight for each life point taken. Default is 0 min.
|
||||
-- @return #COHORT self
|
||||
function COHORT:SetTurnoverTime(MaintenanceTime, RepairTime)
|
||||
self.maintenancetime=MaintenanceTime and MaintenanceTime*60 or 0
|
||||
@@ -377,8 +377,8 @@ end
|
||||
|
||||
--- Set radio frequency and modulation the cohort uses.
|
||||
-- @param #COHORT self
|
||||
-- @param #number Frequency Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #number Modulation Radio modulation. Default 0=AM.
|
||||
-- @param #number Frequency (Optional) Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default 0=AM.
|
||||
-- @return #COHORT self
|
||||
function COHORT:SetRadio(Frequency, Modulation)
|
||||
self.radioFreq=Frequency or 251
|
||||
@@ -388,7 +388,7 @@ end
|
||||
|
||||
--- Set number of units in groups.
|
||||
-- @param #COHORT self
|
||||
-- @param #number nunits Number of units. Default 2.
|
||||
-- @param #number nunits (Optional) Number of units. Default 2.
|
||||
-- @return #COHORT self
|
||||
function COHORT:SetGrouping(nunits)
|
||||
self.ngrouping=nunits or 2
|
||||
@@ -398,7 +398,7 @@ end
|
||||
--- Set mission types this cohort is able to perform.
|
||||
-- @param #COHORT self
|
||||
-- @param #table MissionTypes Table of mission types. Can also be passed as a #string if only one type.
|
||||
-- @param #number Performance Performance describing how good this mission can be performed. Higher is better. Default 50. Max 100.
|
||||
-- @param #number Performance (Optional) Performance describing how good this mission can be performed. Higher is better. Default 50. Max 100.
|
||||
-- @return #COHORT self
|
||||
function COHORT:AddMissionCapability(MissionTypes, Performance)
|
||||
|
||||
@@ -505,7 +505,7 @@ end
|
||||
|
||||
--- Set max mission range. Only missions in a circle of this radius around the cohort base are executed.
|
||||
-- @param #COHORT self
|
||||
-- @param #number Range Range in NM. Default 150 NM.
|
||||
-- @param #number Range (Optional) Range in NM. Default 150 NM.
|
||||
-- @return #COHORT self
|
||||
function COHORT:SetMissionRange(Range)
|
||||
self.engageRange=UTILS.NMToMeters(Range or 150)
|
||||
@@ -628,8 +628,8 @@ 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.
|
||||
-- @param #number Delay Delay in seconds before assets are removed.
|
||||
-- @param #number N (Optional) Number of assets to be removed. Default 1.
|
||||
-- @param #number Delay (Optional) Delay in seconds before assets are removed. Defaults to 0.
|
||||
-- @return #COHORT self
|
||||
function COHORT:RemoveAssets(N, Delay)
|
||||
self:T2(self.lid..string.format("Remove %d assets of Cohort", N))
|
||||
@@ -818,9 +818,9 @@ end
|
||||
|
||||
--- Add a weapon range for ARTY missions (@{Ops.Auftrag#AUFTRAG}).
|
||||
-- @param #COHORT self
|
||||
-- @param #number RangeMin Minimum range in nautical miles. Default 0 NM.
|
||||
-- @param #number RangeMax Maximum range in nautical miles. Default 10 NM.
|
||||
-- @param #number BitType Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types.
|
||||
-- @param #number RangeMin (Optional) Minimum range in nautical miles. Default 0 NM.
|
||||
-- @param #number RangeMax (Optional) Maximum range in nautical miles. Default 10 NM.
|
||||
-- @param #number BitType (Optional) Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types.
|
||||
-- @return #COHORT self
|
||||
function COHORT:AddWeaponRange(RangeMin, RangeMax, BitType)
|
||||
|
||||
@@ -1474,7 +1474,7 @@ function COHORT:_CheckAmmo()
|
||||
|
||||
-- Descriptors.
|
||||
local Desc=weapon["desc"]
|
||||
|
||||
|
||||
-- Warhead.
|
||||
local Warhead=Desc["warhead"]
|
||||
|
||||
|
||||
@@ -389,7 +389,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #COMMANDER self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #COMMANDER self
|
||||
function COMMANDER:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -398,8 +398,8 @@ end
|
||||
|
||||
--- Set limit for number of total or specific missions to be executed simultaniously.
|
||||
-- @param #COMMANDER self
|
||||
-- @param #number Limit Number of max. mission of this type. Default 10.
|
||||
-- @param #string MissionType Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions.
|
||||
-- @param #number Limit (Optional) Number of max. mission of this type. Default 10.
|
||||
-- @param #string MissionType (Optional) Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions.
|
||||
-- @return #COMMANDER self
|
||||
function COMMANDER:SetLimitMission(Limit, MissionType)
|
||||
MissionType=MissionType or "Total"
|
||||
@@ -664,10 +664,10 @@ end
|
||||
--- Add a CAP zone.
|
||||
-- @param #COMMANDER self
|
||||
-- @param Core.Zone#ZONE Zone CapZone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data.
|
||||
function COMMANDER:AddCapZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -690,10 +690,10 @@ end
|
||||
--- Add a GCICAP zone.
|
||||
-- @param #COMMANDER self
|
||||
-- @param Core.Zone#ZONE Zone CapZone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data.
|
||||
function COMMANDER:AddGciCapZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -736,10 +736,10 @@ end
|
||||
--- Add an AWACS zone.
|
||||
-- @param #COMMANDER self
|
||||
-- @param Core.Zone#ZONE Zone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @return Ops.Airwing#AIRWING.PatrolZone The AWACS zone data.
|
||||
function COMMANDER:AddAwacsZone(Zone, Altitude, Speed, Heading, Leg)
|
||||
|
||||
@@ -783,10 +783,10 @@ end
|
||||
--- Add a refuelling tanker zone.
|
||||
-- @param #COMMANDER self
|
||||
-- @param Core.Zone#ZONE Zone Zone.
|
||||
-- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @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 Leg Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet.
|
||||
-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts.
|
||||
-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West).
|
||||
-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM.
|
||||
-- @param #number RefuelSystem Refuelling system.
|
||||
-- @return Ops.Airwing#AIRWING.TankerZone The tanker zone data.
|
||||
function COMMANDER:AddTankerZone(Zone, Altitude, Speed, Heading, Leg, RefuelSystem)
|
||||
@@ -851,10 +851,10 @@ end
|
||||
-- @param #COMMANDER self
|
||||
-- @param Ops.Cohort#COHORT Cohort The cohort to be relocated.
|
||||
-- @param Ops.Legion#LEGION Legion The legion where the cohort is relocated to.
|
||||
-- @param #number Delay Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP.
|
||||
-- @param #number NcarriersMin Min number of transport carriers in case the troops should be transported. Default `nil` for no transport.
|
||||
-- @param #number Delay (Optional) Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP.
|
||||
-- @param #number NcarriersMin (Optional) Min number of transport carriers in case the troops should be transported. Default `nil` for no transport.
|
||||
-- @param #number NcarriersMax Max number of transport carriers.
|
||||
-- @param #table TransportLegions Legion(s) assigned for transportation. Default is all legions of the commander.
|
||||
-- @param #table TransportLegions (Optional) Legion(s) assigned for transportation. Default is all legions of the commander.
|
||||
-- @return #COMMANDER self
|
||||
function COMMANDER:RelocateCohort(Cohort, Legion, Delay, NcarriersMin, NcarriersMax, TransportLegions)
|
||||
|
||||
@@ -1620,7 +1620,7 @@ end
|
||||
--- Set how many missions can be assigned in a single status iteration. (eg. This is useful for persistent missions where you need to load all AUFTRAGs on mission start and then change it back to default)
|
||||
--- Warning: Increasing this value will increase the number of missions started per iteration and thus may lead to performance issues if too many missions are started at once.
|
||||
-- @param #COMMANDER self
|
||||
-- @param #number Number of missions assigned per status iteration. Default is 1.
|
||||
-- @param #number MaxMissionsAssignPerCycle (Optional) Number of missions assigned per status iteration. Default is 1.
|
||||
-- @return #COMMANDER self.
|
||||
function COMMANDER:SetMaxMissionsAssignPerCycle(MaxMissionsAssignPerCycle)
|
||||
self.maxMissionsAssignPerCycle = MaxMissionsAssignPerCycle or 1
|
||||
@@ -1914,10 +1914,11 @@ end
|
||||
-- @param #string MissionType Mission Type.
|
||||
-- @param #number NassetsMin Min number of required assets.
|
||||
-- @param #number NassetsMax Max number of required assets.
|
||||
-- @param #number (optional) RangeMin Minimum range to target. (Default is 0, which means no minimum range)
|
||||
-- @return #boolean If `true` enough assets could be recruited.
|
||||
-- @return #table Assets that have been recruited from all legions.
|
||||
-- @return #table Legions that have recruited assets.
|
||||
function COMMANDER:RecruitAssetsForTarget(Target, MissionType, NassetsMin, NassetsMax)
|
||||
function COMMANDER:RecruitAssetsForTarget(Target, MissionType, NassetsMin, NassetsMax, RangeMin)
|
||||
|
||||
-- Cohorts.
|
||||
local Cohorts=self:_GetCohorts()
|
||||
@@ -1926,7 +1927,7 @@ function COMMANDER:RecruitAssetsForTarget(Target, MissionType, NassetsMin, Nasse
|
||||
local TargetVec2=Target:GetVec2()
|
||||
|
||||
-- Recruite assets.
|
||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2)
|
||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2, nil, nil, nil , nil, nil, nil, nil, nil, nil, nil, RangeMin)
|
||||
|
||||
|
||||
return recruited, assets, legions
|
||||
@@ -2229,7 +2230,7 @@ end
|
||||
|
||||
--- Get assets on given mission or missions.
|
||||
-- @param #COMMANDER self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default all.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all.
|
||||
-- @return #table Assets on pending requests.
|
||||
function COMMANDER:GetAssetsOnMission(MissionTypes)
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ end
|
||||
|
||||
--- Set Tanker and Scouts to be invisible to enemy AI eyes
|
||||
-- @param #EASYA2G self
|
||||
-- @param #boolean Switch Set to true or false, by default this is set to true already
|
||||
-- @param #boolean Switch (Optional) Set to true or false, by default this is set to true already
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetTankerAndScoutsInvisible(Switch)
|
||||
self:T(self.lid.."SetTankerAndScoutsInvisible")
|
||||
@@ -418,7 +418,7 @@ end
|
||||
|
||||
--- Set default A2G Speed in knots
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Speed Speed defaults to 300
|
||||
-- @param #number Speed (Optional) Speed defaults to 300
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetDefaultA2GSpeed(Speed)
|
||||
self:T(self.lid.."SetDefaultSpeed")
|
||||
@@ -428,7 +428,7 @@ end
|
||||
|
||||
--- Set A2G Flight formation.
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Formation Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
-- @param #number Formation (Optional) Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetA2GFormation(Formation)
|
||||
self:T(self.lid.."SetA2GFormation")
|
||||
@@ -438,7 +438,7 @@ end
|
||||
|
||||
--- Set default A2G Altitude in feet
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Altitude Altitude defaults to 25000
|
||||
-- @param #number Altitude (Optional) Altitude defaults to 25000
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetDefaultA2GAlt(Altitude)
|
||||
self:T(self.lid.."SetDefaultAltitude")
|
||||
@@ -448,7 +448,7 @@ end
|
||||
|
||||
--- Set default A2G lieg initial direction in degrees
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Direction Direction defaults to 90 (East)
|
||||
-- @param #number Direction (Optional) Direction defaults to 90 (East)
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetDefaultA2GDirection(Direction)
|
||||
self:T(self.lid.."SetDefaultDirection")
|
||||
@@ -458,7 +458,7 @@ end
|
||||
|
||||
--- Set default leg length in NM
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Leg Leg defaults to 5
|
||||
-- @param #number Leg (Optional) Leg defaults to 5
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetDefaultA2GLeg(Leg)
|
||||
self:T(self.lid.."SetDefaultLeg")
|
||||
@@ -468,7 +468,7 @@ end
|
||||
|
||||
--- Set default grouping, i.e. how many airplanes per A2G point
|
||||
-- @param #EASYA2G self
|
||||
-- @param #number Grouping Grouping defaults to 2
|
||||
-- @param #number Grouping (Optional) Grouping defaults to 2
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetDefaultA2GGrouping(Grouping)
|
||||
self:T(self.lid.."SetDefaultA2GGrouping")
|
||||
@@ -489,7 +489,7 @@ end
|
||||
|
||||
--- Set which target types A2G flights will prefer to engage, defaults to {"Ground"}
|
||||
-- @param #EASYA2G self
|
||||
-- @param #table types Table of comma separated #string entries, defaults to {"Ground"} (everything that is ground and is not a weapon). Useful other options are e.g. {"Armored vehicles"}, {"Tanks"},
|
||||
-- @param #table types (Optional) Table of comma separated #string entries, defaults to {"Ground"} (everything that is ground and is not a weapon). Useful other options are e.g. {"Armored vehicles"}, {"Tanks"},
|
||||
-- or {"APC"} or combinations like {"APC", "Tanks", "Artillery"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes).
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:SetA2GEngageTargetTypes(types)
|
||||
@@ -501,10 +501,10 @@ end
|
||||
-- @param #EASYA2G self
|
||||
-- @param #string AirbaseName Name of the Wing's airbase
|
||||
-- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Defaults to 25000 feet ASL.
|
||||
-- @param #number Speed Defaults to 300 knots TAS.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @param #number Altitude (Optional) Defaults to 25000 feet ASL.
|
||||
-- @param #number Speed (Optional) Defaults to 300 knots TAS.
|
||||
-- @param #number Heading (Optional) Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength (Optional) Defaults to 15 NM.
|
||||
-- @return #EASYA2G self
|
||||
function EASYA2G:AddHoldingPointA2G(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||
self:T(self.lid.."AddHoldingPointA2G")--..Coordinate:ToStringLLDDM())
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: September 2023
|
||||
-- Last Update: Jan 2026
|
||||
-- Last Update: June 2026
|
||||
-------------------------------------------------------------------------
|
||||
--
|
||||
--- **Ops** - Easy GCI & CAP Manager
|
||||
@@ -135,6 +135,7 @@
|
||||
-- local mywing = EASYGCICAP:New("Blue CAP Operations",AIRBASE.Caucasus.Kutaisi,"blue","Blue EWR")
|
||||
--
|
||||
-- -- Add a CAP patrol point belonging to our airbase, we'll be at 30k ft doing 400 kn, initial direction 90 degrees (East), leg 20NM
|
||||
-- -- NOTE - Skip this function and do not create CAP Points if you want GCI behaviour only.
|
||||
-- mywing:AddPatrolPointCAP(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone 1"):GetCoordinate(),30000,400,90,20)
|
||||
--
|
||||
-- -- Add a Squadron with template "Blue Sq1 M2000c", 20 airframes, skill good, Modex starting with 102 and skin "Vendee Jeanne"
|
||||
@@ -190,9 +191,10 @@
|
||||
-- * @{#EASYGCICAP.SetDefaultResurrection}: Set how many seconds the AirWing stays inoperable after the AirWing STATIC HQ ist destroyed, default 900 secs.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPSpeed}: Set how many knots the CAP flights should do (will be altitude corrected), default 300 kn.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPAlt}: Set at which altitude (ASL) the CAP planes will fly, default 25,000 ft.
|
||||
-- * @{#EASYGCICAP.SetDefaultINTERCEPTAlt}: Set at which altitude (ASL) the Intercept planes will fly, default 25,000 ft.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPDirection}: Set the initial direction from the CAP point the planes will fly in degrees, default is 90°.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPLeg}: Set the length of the CAP leg, default is 15 NM.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPGrouping}: Set how many planes will be spawned per mission (CVAP/GCI), defaults to 2.
|
||||
-- * @{#EASYGCICAP.SetDefaultCAPGrouping}: Set how many planes will be spawned per mission (CAP/GCI), defaults to 2.
|
||||
-- * @{#EASYGCICAP.SetDefaultMissionRange}: Set how many NM the planes can go from the home base, defaults to 100.
|
||||
-- * @{#EASYGCICAP.SetDefaultNumberAlert5Standby}: Set how many planes will be spawned on cold standby (Alert5), default 2.
|
||||
-- * @{#EASYGCICAP.SetDefaultEngageRange}: Set max engage range for CAP flights if they detect intruders, defaults to 50.
|
||||
@@ -286,7 +288,7 @@ EASYGCICAP = {
|
||||
|
||||
--- EASYGCICAP class version.
|
||||
-- @field #string version
|
||||
EASYGCICAP.version="0.1.34"
|
||||
EASYGCICAP.version="0.1.38"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
@@ -355,6 +357,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
||||
-- From State --> Event --> To State
|
||||
self:SetStartState("Stopped")
|
||||
self:AddTransition("Stopped", "Start", "Running")
|
||||
self:AddTransition("Stopped", "Restart", "Running")
|
||||
self:AddTransition("Running", "Stop", "Stopped")
|
||||
self:AddTransition("*", "Status", "*")
|
||||
|
||||
@@ -392,6 +395,20 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
|
||||
--- On Before "Restart" event. Use `myinstance:Restart()` in case you Stopped the instance before and want to restart it now.
|
||||
-- @function [parent=#EASYGCICAP] OnBeforeRestart
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
|
||||
--- On After "Restart" event. Use `myinstance:Restart()` in case you Stopped the instance before and want to restart it now.
|
||||
-- @function [parent=#EASYGCICAP] OnAfterRestart
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -447,7 +464,7 @@ end
|
||||
|
||||
--- Set "fuel low" threshold for CAP and INTERCEPT flights.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Percent RTB if fuel at this percent. Values: 1..100, defaults to 25.
|
||||
-- @param #number Percent (Optional) RTB if fuel at this percent. Values: 1..100, defaults to 25.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetFuelLow(Percent)
|
||||
self:T(self.lid.."SetFuelLow")
|
||||
@@ -470,7 +487,7 @@ end
|
||||
|
||||
--- Set "fuel critical" threshold for CAP and INTERCEPT flights.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Percent RTB if fuel at this percent. Values: 1..100, defaults to 10.
|
||||
-- @param #number Percent (Optional) RTB if fuel at this percent. Values: 1..100, defaults to 10.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetFuelCritical(Percent)
|
||||
self:T(self.lid.."SetFuelCritical")
|
||||
@@ -480,7 +497,7 @@ end
|
||||
|
||||
--- Set CAP formation.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Formation Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
-- @param #number Formation (Optional) Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetCAPFormation(Formation)
|
||||
self:T(self.lid.."SetCAPFormation")
|
||||
@@ -514,7 +531,7 @@ end
|
||||
|
||||
--- Set Maximum of alive missions created by this instance to stop airplanes spamming the map
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Intercept-Missions + Alert5-Missions, default is 8
|
||||
-- @param #number Maxiumum (Optional) Maxmimum number of parallel missions allowed. Count is Intercept-Missions + Alert5-Missions, default is 8
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetMaxAliveMissions(Maxiumum)
|
||||
self:T(self.lid.."SetMaxAliveMissions")
|
||||
@@ -524,7 +541,7 @@ end
|
||||
|
||||
--- Add default time to resurrect Airwing building if destroyed
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Seconds Seconds, defaults to 900
|
||||
-- @param #number Seconds (Optional) Seconds, defaults to 900
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultResurrection(Seconds)
|
||||
self:T(self.lid.."SetDefaultResurrection")
|
||||
@@ -534,7 +551,7 @@ end
|
||||
|
||||
--- Add default repeat attempts if an Intruder intercepts fails.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Retries Retries, defaults to 3
|
||||
-- @param #number Retries (Optional) Retries, defaults to 3
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultRepeatOnFailure(Retries)
|
||||
self:T(self.lid.."SetDefaultRepeatOnFailure")
|
||||
@@ -544,7 +561,7 @@ end
|
||||
|
||||
--- Add default take off type for the airwings.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string Takeoff Can be "hot", "cold", or "air" - default is "hot".
|
||||
-- @param #string Takeoff (Optional) Can be "hot", "cold", or "air" - default is "hot".
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultTakeOffType(Takeoff)
|
||||
self:T(self.lid.."SetDefaultTakeOffType")
|
||||
@@ -554,7 +571,7 @@ end
|
||||
|
||||
--- Set default CAP Speed in knots
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Speed Speed defaults to 300
|
||||
-- @param #number Speed (Optional) Speed defaults to 300
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultCAPSpeed(Speed)
|
||||
self:T(self.lid.."SetDefaultSpeed")
|
||||
@@ -564,7 +581,7 @@ end
|
||||
|
||||
--- Set default CAP Altitude in feet
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Altitude Altitude defaults to 25000
|
||||
-- @param #number Altitude (Optional) Altitude defaults to 25000
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultCAPAlt(Altitude)
|
||||
self:T(self.lid.."SetDefaultAltitude")
|
||||
@@ -572,9 +589,20 @@ function EASYGCICAP:SetDefaultCAPAlt(Altitude)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set default INTERCEPT Altitude in feet
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Altitude (Optional) Altitude defaults to 25000
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultINTERCEPTAlt(Altitude)
|
||||
self:T(self.lid.."SetDefaultINTERCEPTAlt")
|
||||
self.interceptalt = Altitude or 25000
|
||||
return self
|
||||
end
|
||||
--
|
||||
|
||||
--- Set default CAP lieg initial direction in degrees
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Direction Direction defaults to 90 (East)
|
||||
-- @param #number Direction (Optional) Direction defaults to 90 (East)
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultCAPDirection(Direction)
|
||||
self:T(self.lid.."SetDefaultDirection")
|
||||
@@ -584,7 +612,7 @@ end
|
||||
|
||||
--- Set default leg length in NM
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Leg Leg defaults to 15
|
||||
-- @param #number Leg (Optional) Leg defaults to 15
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultCAPLeg(Leg)
|
||||
self:T(self.lid.."SetDefaultLeg")
|
||||
@@ -594,7 +622,7 @@ end
|
||||
|
||||
--- Set default grouping, i.e. how many airplanes per CAP point
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Grouping Grouping defaults to 2
|
||||
-- @param #number Grouping (Optional) Grouping defaults to 2
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultCAPGrouping(Grouping)
|
||||
self:T(self.lid.."SetDefaultCAPGrouping")
|
||||
@@ -604,7 +632,7 @@ end
|
||||
|
||||
--- Set default range planes can fly from their homebase in NM
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Range Range defaults to 100 NM
|
||||
-- @param #number Range (Optional) Range defaults to 100 NM
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultMissionRange(Range)
|
||||
self:T(self.lid.."SetDefaultMissionRange")
|
||||
@@ -614,8 +642,8 @@ end
|
||||
|
||||
--- Set default turnover times for squadrons in minutes
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number MaintenanceTime Time in minutes it takes until a flight is combat ready again. Default is 5 min.
|
||||
-- @param #number RepairTime Time in minutes it takes to repair a flight for each life point taken. Default is 10 min.
|
||||
-- @param #number MaintenanceTime (Optional) Time in minutes it takes until a flight is combat ready again. Default is 5 min.
|
||||
-- @param #number RepairTime (Optional) Time in minutes it takes to repair a flight for each life point taken. Default is 10 min.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultTurnoverTime(MaintenanceTime,RepairTime)
|
||||
self:T(self.lid.."SetDefaultTurnoverTime")
|
||||
@@ -626,7 +654,7 @@ end
|
||||
|
||||
--- Set default number of airframes standing by for intercept tasks (visible on the airfield)
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Airframes defaults to 2
|
||||
-- @param #number Airframes (Optional) defaults to 2
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultNumberAlert5Standby(Airframes)
|
||||
self:T(self.lid.."SetDefaultNumberAlert5Standby")
|
||||
@@ -636,7 +664,7 @@ end
|
||||
|
||||
--- Set default engage range for intruders detected by CAP flights in NM.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Range defaults to 50NM
|
||||
-- @param #number Range (Optional) defaults to 50NM
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultEngageRange(Range)
|
||||
self:T(self.lid.."SetDefaultEngageRange")
|
||||
@@ -689,7 +717,7 @@ end
|
||||
|
||||
--- Set which target types CAP flights will prefer to engage, defaults to {"Air"}
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #table types Table of comma separated #string entries, defaults to {"Air"} (everything that flies and is not a weapon). Useful other options are e.g. {"Bombers"}, {"Fighters"},
|
||||
-- @param #table types (Optional) Table of comma separated #string entries, defaults to {"Air"} (everything that flies and is not a weapon). Useful other options are e.g. {"Bombers"}, {"Fighters"},
|
||||
-- or {"Helicopters"} or combinations like {"Bombers", "Fighters", "UAVs"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes).
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetCAPEngageTargetTypes(types)
|
||||
@@ -739,6 +767,15 @@ end
|
||||
function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
self:T(self.lid.."_AddAirwing "..Airbasename)
|
||||
|
||||
-- Gather Some Stats
|
||||
local function counttable(tbl)
|
||||
local count = 0
|
||||
for _,_data in pairs(tbl) do
|
||||
count = count + 1
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
local CapFormation = self.CapFormation
|
||||
local DespawnAfterLanding = self.DespawnAfterLanding
|
||||
local DespawnAfterHolding = self.DespawnAfterHolding
|
||||
@@ -757,7 +794,11 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
CAP_Wing:SetMarker(false)
|
||||
CAP_Wing:SetAirbase(AIRBASE:FindByName(Airbasename))
|
||||
CAP_Wing:SetRespawnAfterDestroyed()
|
||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
||||
|
||||
--- #DONE avoid wings with no CAP points starting CAP anyhow; AirWing uses this to start CAP and creates points when there are none.
|
||||
if counttable(self.ManagedCP) >0 then
|
||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
||||
end
|
||||
CAP_Wing:SetCapCloseRaceTrack(true)
|
||||
|
||||
if self.showpatrolpointmarks then
|
||||
@@ -839,16 +880,18 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
end
|
||||
|
||||
if self.noalert5 > 0 then
|
||||
local alert
|
||||
if self.ClassName == "EASYGCICAP" then
|
||||
alert = AUFTRAG:NewALERT5(AUFTRAG.Type.INTERCEPT)
|
||||
elseif self.ClassName == "EASYA2G" then
|
||||
alert = AUFTRAG:NewALERT5(AUFTRAG.Type.BAI)
|
||||
for i=1,self.noalert5 do
|
||||
local alert
|
||||
if self.ClassName == "EASYGCICAP" then
|
||||
alert = AUFTRAG:NewALERT5(AUFTRAG.Type.INTERCEPT)
|
||||
elseif self.ClassName == "EASYA2G" then
|
||||
alert = AUFTRAG:NewALERT5(AUFTRAG.Type.BAI)
|
||||
end
|
||||
alert:SetRequiredAssets(self.capgrouping)
|
||||
alert:SetRepeat(99)
|
||||
CAP_Wing:AddMission(alert)
|
||||
table.insert(self.ListOfAuftrag,alert)
|
||||
end
|
||||
alert:SetRequiredAssets(self.noalert5)
|
||||
alert:SetRepeat(99)
|
||||
CAP_Wing:AddMission(alert)
|
||||
table.insert(self.ListOfAuftrag,alert)
|
||||
end
|
||||
|
||||
self.wings[Airbasename] = { CAP_Wing, AIRBASE:FindByName(Airbasename):GetZone(), Airbasename }
|
||||
@@ -860,10 +903,10 @@ end
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string AirbaseName Name of the Wing's airbase
|
||||
-- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Defaults to 25000 feet ASL.
|
||||
-- @param #number Speed Defaults to 300 knots TAS.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @param #number Altitude (Optional) Defaults to 25000 feet ASL.
|
||||
-- @param #number Speed (Optional) Defaults to 300 knots TAS.
|
||||
-- @param #number Heading (Optional) Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength(Optional) Defaults to 15 NM.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddPatrolPointCAP(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||
self:T(self.lid.."AddPatrolPointCAP")--..Coordinate:ToStringLLDDM())
|
||||
@@ -891,10 +934,10 @@ end
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string AirbaseName Name of the Wing's airbase
|
||||
-- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Defaults to 25000 feet.
|
||||
-- @param #number Speed Defaults to 300 knots.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @param #number Altitude (Optional) Defaults to 25000 feet.
|
||||
-- @param #number Speed (Optional) Defaults to 300 knots.
|
||||
-- @param #number Heading (Optional) Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength (Optional) Defaults to 15 NM.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddPatrolPointRecon(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||
self:T(self.lid.."AddPatrolPointRecon "..Coordinate:ToStringLLDDM())
|
||||
@@ -916,10 +959,10 @@ end
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string AirbaseName Name of the Wing's airbase
|
||||
-- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Defaults to 25000 feet.
|
||||
-- @param #number Speed Defaults to 300 knots.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @param #number Altitude (Optional) Defaults to 25000 feet.
|
||||
-- @param #number Speed (Optional) Defaults to 300 knots.
|
||||
-- @param #number Heading (Optional) Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength (Optional) Defaults to 15 NM.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddPatrolPointTanker(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||
self:T(self.lid.."AddPatrolPointTanker "..Coordinate:ToStringLLDDM())
|
||||
@@ -941,10 +984,10 @@ end
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string AirbaseName Name of the Wing's airbase
|
||||
-- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone).
|
||||
-- @param #number Altitude Defaults to 25000 feet.
|
||||
-- @param #number Speed Defaults to 300 knots.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @param #number Altitude (Optional) Defaults to 25000 feet.
|
||||
-- @param #number Speed (Optional) Defaults to 300 knots.
|
||||
-- @param #number Heading (Optional) Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength (Optional) Defaults to 15 NM.
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddPatrolPointAwacs(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||
self:T(self.lid.."AddPatrolPointAwacs "..Coordinate:ToStringLLDDM())
|
||||
@@ -1022,7 +1065,7 @@ function EASYGCICAP:_SetCAPPatrolPoints()
|
||||
MESSAGE:New(self.lid.."You are trying to create a CAP point for which there is no wing! "..tostring(data.AirbaseName),30,"CHECK"):ToAllIf(self.debug):ToLog()
|
||||
return
|
||||
end
|
||||
local Wing = self.wings[data.AirbaseName][1] -- Ops.Airwing#AIRWING
|
||||
local Wing = self.wings[data.AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||
local Coordinate = data.Coordinate
|
||||
local Altitude = data.Altitude
|
||||
local Speed = data.Speed
|
||||
@@ -1239,10 +1282,11 @@ function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames
|
||||
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
||||
Squadron_One:SetMissionRange(self.missionrange)
|
||||
|
||||
local wing = self.wings[AirbaseName][1] -- Ops.Airwing#AIRWING
|
||||
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||
|
||||
wing:AddSquadron(Squadron_One)
|
||||
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5},75)
|
||||
--local countsquads = UTILS.TableLength(wing.cohorts)
|
||||
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5},100)
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -1487,6 +1531,7 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
||||
local overhead = self.overhead
|
||||
local capspeed = self.capspeed + 100
|
||||
local capalt = self.capalt
|
||||
local interalt = self.interceptalt or self.capalt
|
||||
local maxsize = self.maxinterceptsize
|
||||
local repeatsonfailure = self.repeatsonfailure
|
||||
|
||||
@@ -1574,6 +1619,7 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
||||
:SetRepeatOnFailure(repeats)
|
||||
:SetMissionSpeed(UTILS.KnotsToAltKIAS(capspeed,capalt))
|
||||
:SetMissionAltitude(capalt)
|
||||
:SetEngageAltitude(interalt)
|
||||
|
||||
if nogozoneset:Count() > 0 then
|
||||
InterceptAuftrag:AddConditionSuccess(
|
||||
@@ -1797,8 +1843,32 @@ end
|
||||
function EASYGCICAP:onafterStop(From,Event,To)
|
||||
self:T({From,Event,To})
|
||||
self.Intel:Stop()
|
||||
-- self.wings[Airbasename] = { CAP_Wing, AIRBASE:FindByName(Airbasename):GetZone(), Airbasename }
|
||||
for _,_wing in pairs(self.wings or {}) do
|
||||
_wing:Stop()
|
||||
for _,_aw in pairs(_wing) do
|
||||
_wing[1]:Stop()
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) FSM Function onafterRestart
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:onafterRestart(From,Event,To)
|
||||
self:T({From,Event,To})
|
||||
if self:Is("Stopped") then
|
||||
self.Intel:Start()
|
||||
-- self.wings[Airbasename] = { CAP_Wing, AIRBASE:FindByName(Airbasename):GetZone(), Airbasename }
|
||||
for _,_wing in pairs(self.wings or {}) do
|
||||
for _,_aw in pairs(_wing) do
|
||||
_wing[1]:Restart()
|
||||
end
|
||||
end
|
||||
end
|
||||
self:__Status(5)
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -359,13 +359,14 @@ FLIGHTCONTROL.version="0.7.7"
|
||||
--- Create a new FLIGHTCONTROL class object for an associated airbase.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string AirbaseName Name of the airbase.
|
||||
-- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. Can also be given as a `#table` of multiple frequencies.
|
||||
-- @param #number Modulation Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a `#table` of multiple modulations.
|
||||
-- @param #string PathToSRS Path to the directory, where SRS is located.
|
||||
-- @param #number Port Port of SRS Server, defaults to 5002
|
||||
-- @param #string GoogleKey Path to the Google JSON-Key.
|
||||
-- @param #number Frequency (Optional) Radio frequency in MHz. Default 143.00 MHz. Can also be given as a `#table` of multiple frequencies.
|
||||
-- @param #number Modulation (Optional) Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a `#table` of multiple modulations.
|
||||
-- @param #string PathToSRS (Optional) Path to the directory, where SRS is located.
|
||||
-- @param #number Port (Optional) Port of SRS Server, defaults to 5002
|
||||
-- @param #string GoogleKey (Optional) Path to the Google JSON-Key.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, GoogleKey)
|
||||
function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, GoogleKey,Provider)
|
||||
|
||||
-- Inherit everything from FSM class.
|
||||
local self=BASE:Inherit(self, FSM:New()) -- #FLIGHTCONTROL
|
||||
@@ -436,6 +437,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
||||
if GoogleKey then
|
||||
self.msrsTower:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||
self.msrsTower:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrsTower:SetProvider(Provider)
|
||||
end
|
||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||
self:SetSRSTower()
|
||||
@@ -446,6 +450,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
||||
if GoogleKey then
|
||||
self.msrsPilot:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||
self.msrsPilot:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrsPilot:SetProvider(Provider)
|
||||
end
|
||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||
self:SetSRSPilot()
|
||||
@@ -570,7 +577,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -620,8 +627,8 @@ end
|
||||
|
||||
--- Set the tower frequency.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Frequency Frequency in MHz. Default 305 MHz.
|
||||
-- @param #number Modulation Modulation `radio.modulation.AM`=0, `radio.modulation.FM`=1. Default `radio.modulation.AM`.
|
||||
-- @param #number Frequency (Optional) Frequency in MHz. Default 305 MHz.
|
||||
-- @param #number Modulation (Optional) Modulation `radio.modulation.AM`=0, `radio.modulation.FM`=1. Default `radio.modulation.AM`.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetFrequency(Frequency, Modulation)
|
||||
|
||||
@@ -643,7 +650,7 @@ end
|
||||
|
||||
--- Set the SRS server port.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Port Port to be used. Defaults to 5002.
|
||||
-- @param #number Port (Optional) Port to be used. Defaults to 5002.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetSRSPort(Port)
|
||||
self.Port = Port or 5002
|
||||
@@ -653,15 +660,16 @@ end
|
||||
--- Set SRS options for a given MSRS object.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param Sound.SRS#MSRS msrs Moose SRS object.
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Gender (Optional) Gender: "male" or "female" (default).
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #number Volume (Optional) Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmits.
|
||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
||||
-- @param #number Port Server port for SRS
|
||||
-- @param #string PathToGoogleCredentials (Optional) Path to google credentials json file.
|
||||
-- @param #number Port (Optional) Server port for SRS. Defaults to 5002.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:_SetSRSOptions(msrs, Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials, Port)
|
||||
function FLIGHTCONTROL:_SetSRSOptions(msrs, Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials, Port, Speaker)
|
||||
|
||||
-- Defaults:
|
||||
Gender=Gender or "female"
|
||||
@@ -672,6 +680,9 @@ function FLIGHTCONTROL:_SetSRSOptions(msrs, Gender, Culture, Voice, Volume, Labe
|
||||
msrs:SetGender(Gender)
|
||||
msrs:SetCulture(Culture)
|
||||
msrs:SetVoice(Voice)
|
||||
if Speaker then
|
||||
msrs:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
msrs:SetVolume(Volume)
|
||||
msrs:SetLabel(Label)
|
||||
msrs:SetCoalition(self:GetCoalition())
|
||||
@@ -683,16 +694,17 @@ end
|
||||
|
||||
--- Set SRS options for tower voice.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Gender (Optional) Gender: "male" or "female" (default).
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. See [Google Voices](https://cloud.google.com/text-to-speech/docs/voices).
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmits. Default `self.alias`.
|
||||
-- @param #number Volume (Optional) Volume. Default 1.0.
|
||||
-- @param #string Label (Optional) Name under which SRS transmits. Default `self.alias`.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label)
|
||||
function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label, Speaker)
|
||||
|
||||
if self.msrsTower then
|
||||
self:_SetSRSOptions(self.msrsTower, Gender or "female", Culture or "en-GB", Voice, Volume, Label or self.alias)
|
||||
self:_SetSRSOptions(self.msrsTower, Gender or "female", Culture or "en-GB", Voice, Volume, Label or self.alias,nil,nil,Speaker)
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -700,16 +712,17 @@ end
|
||||
|
||||
--- Set SRS options for pilot voice.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Gender Gender: "male" (default) or "female".
|
||||
-- @param #string Culture Culture, e.g. "en-US" (default).
|
||||
-- @param #string Gender (Optional) Gender: "male" (default) or "female".
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-US" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmits. Default "Pilot".
|
||||
-- @param #number Volume (Optional) Volume. Default 1.0.
|
||||
-- @param #string Label (Optional) Name under which SRS transmits. Default "Pilot".
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label)
|
||||
function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label, Speaker)
|
||||
|
||||
if self.msrsPilot then
|
||||
self:_SetSRSOptions(self.msrsPilot, Gender or "male", Culture or "en-US", Voice, Volume, Label or "Pilot")
|
||||
self:_SetSRSOptions(self.msrsPilot, Gender or "male", Culture or "en-US", Voice, Volume, Label or "Pilot",nil,nil,Speaker)
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -726,8 +739,8 @@ end
|
||||
-- in cases where simultaneous takeoffs and landings are unproblematic. Note that only because there are multiple runways, it does not mean the AI uses them.
|
||||
--
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Nlanding Max number of aircraft landing simultaneously. Default 2.
|
||||
-- @param #number Ntakeoff Allowed number of aircraft taking off for groups to get landing clearance. Default 0.
|
||||
-- @param #number Nlanding (Optional) Max number of aircraft landing simultaneously. Default 2.
|
||||
-- @param #number Ntakeoff (Optional) Allowed number of aircraft taking off for groups to get landing clearance. Default 0.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetLimitLanding(Nlanding, Ntakeoff)
|
||||
|
||||
@@ -740,7 +753,7 @@ end
|
||||
|
||||
--- Set time interval between landing clearance of groups.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number dt Time interval in seconds. Default 180 sec (3 min).
|
||||
-- @param #number dt (Optional) Time interval in seconds. Default 180 sec (3 min).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetLandingInterval(dt)
|
||||
|
||||
@@ -763,9 +776,9 @@ end
|
||||
-- NOTE that human players are *not* restricted as they should behave better (hopefully) than the AI.
|
||||
--
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Ntaxi Max number of groups allowed to taxi. Default 2.
|
||||
-- @param #number Ntaxi (Optional) Max number of groups allowed to taxi. Default 2.
|
||||
-- @param #boolean IncludeInbound If `true`, the above
|
||||
-- @param #number Nlanding Max number of landing flights. Default 0.
|
||||
-- @param #number Nlanding (Optional) Max number of landing flights. Default 0.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetLimitTaxi(Ntaxi, IncludeInbound, Nlanding)
|
||||
|
||||
@@ -783,10 +796,10 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param Core.Zone#ZONE ArrivalZone Zone where planes arrive.
|
||||
-- @param #number Heading Heading in degrees.
|
||||
-- @param #number Length Length in nautical miles. Default 15 NM.
|
||||
-- @param #number FlightlevelMin Min flight level. Default 5.
|
||||
-- @param #number FlightlevelMax Max flight level. Default 15.
|
||||
-- @param #number Prio Priority. Lower is higher. Default 50.
|
||||
-- @param #number Length (Optional) Length in nautical miles. Default 15 NM.
|
||||
-- @param #number FlightlevelMin (Optional) Min flight level. Default 5.
|
||||
-- @param #number FlightlevelMax (Optional) Max flight level. Default 15.
|
||||
-- @param #number Prio (Optional) Priority. Lower is higher. Default 50.
|
||||
-- @return #FLIGHTCONTROL.HoldingPattern Holding pattern table.
|
||||
function FLIGHTCONTROL:AddHoldingPattern(ArrivalZone, Heading, Length, FlightlevelMin, FlightlevelMax, Prio)
|
||||
|
||||
@@ -946,7 +959,7 @@ end
|
||||
-- Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting.
|
||||
-- You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600sec (one hour).
|
||||
-- @param #number RepairTime (Optional) Time in seconds until the runway is repaired. Default 3600sec (one hour).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetRunwayRepairtime(RepairTime)
|
||||
self.runwayrepairtime=RepairTime or 3600
|
||||
@@ -2020,7 +2033,7 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Status Return only flights in this flightcontrol status, e.g. `FLIGHTCONTROL.Status.XXX`.
|
||||
-- @param #string GroupStatus Return only flights in this FSM status, e.g. `OPSGROUP.GroupStatus.TAXIING`.
|
||||
-- @param #boolean AI If `true` only AI flights are returned. If `false`, only flights with clients are returned. If `nil` (default), all flights are returned.
|
||||
-- @param #boolean AI (Optional) If `true` only AI flights are returned. If `false`, only flights with clients are returned. If `nil` (default), all flights are returned.
|
||||
-- @return #table Table of flights.
|
||||
function FLIGHTCONTROL:GetFlights(Status, GroupStatus, AI)
|
||||
|
||||
@@ -2054,7 +2067,7 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Status Return only flights in this status.
|
||||
-- @param #string GroupStatus Count only flights in this FSM status, e.g. `OPSGROUP.GroupStatus.TAXIING`.
|
||||
-- @param #boolean AI If `true` only AI flights are counted. If `false`, only flights with clients are counted. If `nil` (default), all flights are counted.
|
||||
-- @param #boolean AI (Optional) If `true` only AI flights are counted. If `false`, only flights with clients are counted. If `nil` (default), all flights are counted.
|
||||
-- @return #number Number of flights.
|
||||
function FLIGHTCONTROL:CountFlights(Status, GroupStatus, AI)
|
||||
|
||||
@@ -2101,7 +2114,7 @@ end
|
||||
|
||||
--- Get the name of the active runway.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #boolean Takeoff If true, return takeoff runway name. Default is landing.
|
||||
-- @param #boolean Takeoff (Optional) If true, return takeoff runway name. Default is landing.
|
||||
-- @return #string Runway text, e.g. "31L" or "09".
|
||||
function FLIGHTCONTROL:GetActiveRunwayText(Takeoff)
|
||||
|
||||
@@ -2243,7 +2256,7 @@ end
|
||||
--- Set parking spot to RESERVED and update F10 marker.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param Wrapper.Airbase#AIRBASE.ParkingSpot spot The parking spot data table.
|
||||
-- @param #string unitname Name of the unit occupying the spot. Default "unknown".
|
||||
-- @param #string unitname (Optional) Name of the unit occupying the spot. Default "unknown".
|
||||
function FLIGHTCONTROL:SetParkingReserved(spot, unitname)
|
||||
|
||||
-- Get spot.
|
||||
@@ -2263,7 +2276,7 @@ end
|
||||
--- Set parking spot to OCCUPIED and update F10 marker.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param Wrapper.Airbase#AIRBASE.ParkingSpot spot The parking spot data table.
|
||||
-- @param #string unitname Name of the unit occupying the spot. Default "unknown".
|
||||
-- @param #string unitname (Optional) Name of the unit occupying the spot. Default "unknown".
|
||||
function FLIGHTCONTROL:SetParkingOccupied(spot, unitname)
|
||||
|
||||
-- Get spot.
|
||||
@@ -4351,7 +4364,7 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Text The text to transmit.
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight.
|
||||
-- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
function FLIGHTCONTROL:TransmissionTower(Text, Flight, Delay)
|
||||
|
||||
if self.radioOnlyIfPlayers==true and self.Nplayers==0 then
|
||||
@@ -4387,7 +4400,7 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Text The text to transmit.
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight.
|
||||
-- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
function FLIGHTCONTROL:TransmissionPilot(Text, Flight, Delay)
|
||||
|
||||
if self.radioOnlyIfPlayers==true and self.Nplayers==0 then
|
||||
@@ -4445,9 +4458,9 @@ end
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #string Text The text to transmit.
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight.
|
||||
-- @param #number Duration Duration in seconds. Default 5.
|
||||
-- @param #number Duration (Optional) Duration in seconds. Default 5.
|
||||
-- @param #boolean Clear Clear screen.
|
||||
-- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec.
|
||||
function FLIGHTCONTROL:TextMessageToFlight(Text, Flight, Duration, Clear, Delay)
|
||||
|
||||
if Delay and Delay>0 then
|
||||
@@ -4591,8 +4604,8 @@ end
|
||||
|
||||
--- [User] Set callsign options for TTS output. See @{Wrapper.Group#GROUP.GetCustomCallSign}() on how to set customized callsigns.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #boolean ShortCallsign If true, only call out the major flight number. Default = `true`.
|
||||
-- @param #boolean Keepnumber If true, keep the **customized callsign** in the #GROUP name for players as-is, no amendments or numbers. Default = `true`.
|
||||
-- @param #boolean ShortCallsign (Optional) If true, only call out the major flight number. Default = `true`.
|
||||
-- @param #boolean Keepnumber (Optional) If true, keep the **customized callsign** in the #GROUP name for players as-is, no amendments or numbers. Default = `true`.
|
||||
-- @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.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
|
||||
@@ -217,7 +217,7 @@ FLIGHTGROUP.Players={}
|
||||
|
||||
--- FLIGHTGROUP class version.
|
||||
-- @field #string version
|
||||
FLIGHTGROUP.version="1.0.3"
|
||||
FLIGHTGROUP.version="1.0.4"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -837,7 +837,7 @@ end
|
||||
--- Set if group is ready for taxi/takeoff if controlled by a `FLIGHTCONTROL`.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #boolean ReadyTO If `true`, flight is ready for takeoff.
|
||||
-- @param #number Delay Delay in seconds before value is set. Default 0 sec.
|
||||
-- @param #number Delay (Optional) Delay in seconds before value is set. Default 0 sec.
|
||||
-- @return #FLIGHTGROUP self
|
||||
function FLIGHTGROUP:SetReadyForTakeoff(ReadyTO, Delay)
|
||||
if Delay and Delay>0 then
|
||||
@@ -922,7 +922,7 @@ end
|
||||
|
||||
--- Set low fuel threshold. Triggers event "FuelLow" and calls event function "OnAfterFuelLow".
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #number threshold Fuel threshold in percent. Default 25 %.
|
||||
-- @param #number threshold (Optional) Fuel threshold in percent. Default 25 %.
|
||||
-- @return #FLIGHTGROUP self
|
||||
function FLIGHTGROUP:SetFuelLowThreshold(threshold)
|
||||
self.fuellowthresh=threshold or 25
|
||||
@@ -983,7 +983,7 @@ end
|
||||
|
||||
--- Set fuel critical threshold. Triggers event "FuelCritical" and event function "OnAfterFuelCritical".
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #number threshold Fuel threshold in percent. Default 10 %.
|
||||
-- @param #number threshold (Optional) Fuel threshold in percent. Default 10 %.
|
||||
-- @return #FLIGHTGROUP self
|
||||
function FLIGHTGROUP:SetFuelCriticalThreshold(threshold)
|
||||
self.fuelcriticalthresh=threshold or 10
|
||||
@@ -1354,8 +1354,10 @@ function FLIGHTGROUP:Status()
|
||||
-- If mission, check if DCS task needs to be updated.
|
||||
if mission and mission.updateDCSTask then
|
||||
|
||||
local mtype=mission:GetType()
|
||||
|
||||
-- Orbit missions might need updates.
|
||||
if (mission:GetType()==AUFTRAG.Type.ORBIT or mission:GetType()==AUFTRAG.Type.RECOVERYTANKER or mission:GetType()==AUFTRAG.Type.CAP) and mission.orbitVec2 then
|
||||
if (mtype==AUFTRAG.Type.ORBIT or mtype==AUFTRAG.Type.RECOVERYTANKER or mtype==AUFTRAG.Type.CAP or mtype==AUFTRAG.Type.AWACS) and mission.orbitVec2 then
|
||||
|
||||
-- Get 2D vector of orbit target.
|
||||
local vec2=mission:GetTargetVec2()
|
||||
@@ -2629,8 +2631,8 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N(Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @return #boolean Transision allowed?
|
||||
function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n, N)
|
||||
|
||||
@@ -2752,8 +2754,8 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||
-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||
function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n, N)
|
||||
|
||||
-- Update route from this waypoint number onwards.
|
||||
@@ -2782,7 +2784,7 @@ function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n, N)
|
||||
-- Set current waypoint or we get problem that the _PassingWaypoint function is triggered too early, i.e. right now and not when passing the next WP.
|
||||
local current=self:GetCoordinate():WaypointAir(COORDINATE.WaypointAltType.BARO, waypointType, waypointAction, speed, true, nil, {}, "Current")
|
||||
table.insert(wp, current)
|
||||
|
||||
|
||||
-- Add remaining waypoints to route.
|
||||
for i=n, N do
|
||||
table.insert(wp, self.waypoints[i])
|
||||
@@ -3100,9 +3102,9 @@ end
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param Wrapper.Airbase#AIRBASE airbase The airbase to hold at.
|
||||
-- @param #number SpeedTo Speed used for traveling from current position to holding point in knots. Default 75% of max speed.
|
||||
-- @param #number SpeedHold Holding speed in knots. Default 250 kts.
|
||||
-- @param #number SpeedLand Landing speed in knots. Default 170 kts.
|
||||
-- @param #number SpeedTo (Optional) Speed used for traveling from current position to holding point in knots. Default 75% of max speed.
|
||||
-- @param #number SpeedHold (Optional) Holding speed in knots. Default 250 kts.
|
||||
-- @param #number SpeedLand (Optional) Landing speed in knots. Default 170 kts.
|
||||
function FLIGHTGROUP:onafterRTB(From, Event, To, airbase, SpeedTo, SpeedHold, SpeedLand)
|
||||
|
||||
-- Debug info.
|
||||
@@ -3195,9 +3197,9 @@ end
|
||||
--- Land at an airbase.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param Wrapper.Airbase#AIRBASE airbase Airbase where the group shall land.
|
||||
-- @param #number SpeedTo Speed used for travelling from current position to holding point in knots.
|
||||
-- @param #number SpeedHold Holding speed in knots.
|
||||
-- @param #number SpeedLand Landing speed in knots. Default 170 kts.
|
||||
-- @param #number (Optional) SpeedTo Speed used for travelling from current position to holding point in knots. Defaults to speedCruise.
|
||||
-- @param #number (Optional) SpeedHold Holding speed in knots. Defaults to 250kts.
|
||||
-- @param #number (Optional) SpeedLand Landing speed in knots. Default 170 kts.
|
||||
function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
|
||||
|
||||
-- Set current airbase.
|
||||
@@ -3381,9 +3383,9 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number Duration Duration how long the group will be waiting in seconds. Default `nil` (=forever).
|
||||
-- @param #number Altitude Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos.
|
||||
-- @param #number Speed Speed in knots. Default 250 kts for airplanes and 20 kts for helos.
|
||||
-- @param #number Duration (Optional) Duration how long the group will be waiting in seconds. Default `nil` (=forever).
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default 250 kts for airplanes and 20 kts for helos.
|
||||
function FLIGHTGROUP:onbeforeWait(From, Event, To, Duration, Altitude, Speed)
|
||||
|
||||
local allowed=true
|
||||
@@ -3417,9 +3419,9 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #number Duration Duration how long the group will be waiting in seconds. Default `nil` (=forever).
|
||||
-- @param #number Altitude Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos.
|
||||
-- @param #number Speed Speed in knots. Default 250 kts for airplanes and 20 kts for helos.
|
||||
-- @param #number Duration (Optional) Duration how long the group will be waiting in seconds. Default `nil` (=forever).
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default 250 kts for airplanes and 20 kts for helos.
|
||||
function FLIGHTGROUP:onafterWait(From, Event, To, Duration, Altitude, Speed)
|
||||
|
||||
-- Group will orbit at its current position.
|
||||
@@ -3696,8 +3698,8 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate where to land. Default is current position.
|
||||
-- @param #number Duration The duration in seconds to remain on ground. Default 600 sec (10 min).
|
||||
-- @param Core.Point#COORDINATE (Optional) Coordinate The coordinate where to land. Default is current position.
|
||||
-- @param #number Duration (Optional) The duration in seconds to remain on ground. Default 600 sec (10 min).
|
||||
function FLIGHTGROUP:onbeforeLandAt(From, Event, To, Coordinate, Duration)
|
||||
return self.isHelo
|
||||
end
|
||||
@@ -3707,8 +3709,8 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate where to land. Default is current position.
|
||||
-- @param #number Duration The duration in seconds to remain on ground. Default `nil` = forever.
|
||||
-- @param Core.Point#COORDINATE (Optional) Coordinate The coordinate where to land. Default is current position.
|
||||
-- @param #number Duration (Optional) The duration in seconds to remain on ground. Default `nil` = forever.
|
||||
function FLIGHTGROUP:onafterLandAt(From, Event, To, Coordinate, Duration)
|
||||
|
||||
-- Duration.
|
||||
@@ -3879,8 +3881,8 @@ end
|
||||
|
||||
--- Initialize group parameters. Also initializes waypoints if self.waypoints is nil.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #table Template Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @param #table Template (Optional) Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @return #FLIGHTGROUP self
|
||||
function FLIGHTGROUP:_InitGroup(Template, Delay)
|
||||
|
||||
@@ -4040,7 +4042,7 @@ end
|
||||
|
||||
--- Find the nearest friendly airbase (same or neutral coalition).
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #number Radius Search radius in NM. Default 50 NM.
|
||||
-- @param #number Radius (Optional) Search radius in NM. Default 50 NM.
|
||||
-- @return Wrapper.Airbase#AIRBASE Closest tanker group #nil.
|
||||
function FLIGHTGROUP:FindNearestAirbase(Radius)
|
||||
|
||||
@@ -4075,7 +4077,7 @@ end
|
||||
|
||||
--- Find the nearest tanker.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #number Radius Search radius in NM. Default 50 NM.
|
||||
-- @param #number Radius (Optional) Search radius in NM. Default 50 NM.
|
||||
-- @return Wrapper.Group#GROUP Closest tanker group or `nil` if no tanker is in the given radius.
|
||||
function FLIGHTGROUP:FindNearestTanker(Radius)
|
||||
|
||||
@@ -4226,7 +4228,7 @@ end
|
||||
|
||||
--- Check if the final waypoint is in the air.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #table wp Waypoint. Default final waypoint.
|
||||
-- @param #table wp (Optional) Waypoint. Default final waypoint.
|
||||
-- @return #boolean If `true` final waypoint is a turning or flyover but not a landing type waypoint.
|
||||
function FLIGHTGROUP:IsLandingAir(wp)
|
||||
|
||||
@@ -4247,7 +4249,7 @@ end
|
||||
|
||||
--- Check if the final waypoint is at an airbase.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #table wp Waypoint. Default final waypoint.
|
||||
-- @param #table wp (Optional) Waypoint. Default final waypoint.
|
||||
-- @return #boolean If `true`, final waypoint is a landing waypoint at an airbase.
|
||||
function FLIGHTGROUP:IsLandingAirbase(wp)
|
||||
|
||||
@@ -4270,10 +4272,10 @@ end
|
||||
--- Add an AIR waypoint to the flight plan.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. Use COORDINATE:SetAltitude(altitude) to define the altitude.
|
||||
-- @param #number Speed Speed in knots. Default is cruise speed.
|
||||
-- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Altitude Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude).
|
||||
-- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default is cruise speed.
|
||||
-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude).
|
||||
-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table.
|
||||
function FLIGHTGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Altitude, Updateroute)
|
||||
|
||||
@@ -4323,10 +4325,10 @@ end
|
||||
--- Add an LANDING waypoint to the flight plan.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param Wrapper.Airbase#AIRBASE Airbase The airbase where the group should land.
|
||||
-- @param #number Speed Speed in knots. Default 350 kts.
|
||||
-- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Altitude Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude).
|
||||
-- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default 350 kts.
|
||||
-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude).
|
||||
-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table.
|
||||
function FLIGHTGROUP:AddWaypointLanding(Airbase, Speed, AfterWaypointWithID, Altitude, Updateroute)
|
||||
|
||||
@@ -4541,7 +4543,7 @@ end
|
||||
--- Returns the parking spot of the element.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Element element Element of the flight group.
|
||||
-- @param #number maxdist Distance threshold in meters. Default 5 m.
|
||||
-- @param #number maxdist (Optional) Distance threshold in meters. Default 5 m.
|
||||
-- @param Wrapper.Airbase#AIRBASE airbase (Optional) The airbase to check for parking. Default is closest airbase to the element.
|
||||
-- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold.
|
||||
function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
|
||||
|
||||
@@ -56,7 +56,7 @@ FLOTILLA.version="0.1.0"
|
||||
--- Create a new FLOTILLA object and start the FSM.
|
||||
-- @param #FLOTILLA self
|
||||
-- @param #string TemplateGroupName Name of the template group.
|
||||
-- @param #number Ngroups Number of asset groups of this flotilla. Default 3.
|
||||
-- @param #number Ngroups (Optional) Number of asset groups of this flotilla. Default 3.
|
||||
-- @param #string FlotillaName Name of the flotilla. Must be **unique**!
|
||||
-- @return #FLOTILLA self
|
||||
function FLOTILLA:New(TemplateGroupName, Ngroups, FlotillaName)
|
||||
|
||||
@@ -111,6 +111,12 @@ INTEL = {
|
||||
DetectAccoustic = false,
|
||||
DetectAccousticRadius = 1000,
|
||||
DetectAccousticUnitTypes = {Unit.Category.HELICOPTER},
|
||||
DopplerRadar = false,
|
||||
DopplerMinAltAGL = 500,
|
||||
DopplerNotchSin = math.sin(math.rad(15)),
|
||||
DopplerMinSpeedMps = 50,
|
||||
DopplerRCS = true,
|
||||
DopplerRadarRangeM = 200 * 1000,
|
||||
}
|
||||
|
||||
--- Detected item info.
|
||||
@@ -171,6 +177,161 @@ INTEL.Ctype={
|
||||
-- @field #string version
|
||||
INTEL.version="0.3.10"
|
||||
|
||||
---
|
||||
-- ══════════════════════════════════════════════════════════════════
|
||||
-- INTEL Doppler radar extension
|
||||
--
|
||||
-- Models four phenomena of a 1970/80s pulse-Doppler ground radar
|
||||
-- (representative types: Soviet P-18 Spoon Rest, P-37 Bar Lock,
|
||||
-- P-80 Back Net / NATO AN/TPS-43 / Hughes AN/TPS-70):
|
||||
--
|
||||
-- A) GROUND CLUTTER (AGL threshold)
|
||||
-- Low-flying targets blend into terrain returns. Below DopplerMinAltAGL
|
||||
-- detection probability drops linearly to 0 at 0 m AGL.
|
||||
--
|
||||
-- B) VELOCITY NOTCH (beam aspect)
|
||||
-- The MTI (Moving Target Indicator) filter suppresses returns with
|
||||
-- near-zero Doppler shift. Targets flying perpendicular to the radar
|
||||
-- beam (radial-velocity fraction < sin(NotchHalfDeg)) are rejected.
|
||||
-- Classic P-18/P-37 notch was ≈ ±12–18° around 90° aspect.
|
||||
--
|
||||
-- C) MINIMUM SPEED GATE
|
||||
-- Very slow targets (taxiing aircraft, hovering) cannot be separated
|
||||
-- from ground clutter by their Doppler shift alone.
|
||||
--
|
||||
-- D) RADAR CROSS SECTION (RCS)
|
||||
-- Larger targets are detectable at longer ranges. The radar range
|
||||
-- equation gives R_max ∝ σ^0.25, so detection range is scaled by
|
||||
-- (σ / σ_ref)^0.25 relative to a reference aircraft (default: 5 m²).
|
||||
-- RCS also varies with aspect: nose-on ≈ 15% of side-on value.
|
||||
-- Known DCS aircraft values are stored in INTEL.RCS_Table; unknowns
|
||||
-- fall back to a category default (fighter/bomber/helicopter).
|
||||
-- Values are approximate averages from public IISS/Jane's data.
|
||||
-- ══════════════════════════════════════════════════════════════════
|
||||
--
|
||||
-- ── RCS lookup table (nominal side-on RCS in m²) ─────────────────
|
||||
-- Frontal (nose-on / tail-on) RCS is modelled as 15% of these values
|
||||
-- via aspect interpolation in _GetAspectRCS().
|
||||
-- Sources: public declassified estimates, Jane's, IISS assessments.
|
||||
--- @field INTEL.RCS_Table
|
||||
INTEL.RCS_Table = {
|
||||
-- ── US / NATO fixed-wing ──────────────────────────────────────
|
||||
["A-10C"] = 8.0, -- large, flat surfaces, no LO shaping
|
||||
["A-10C_2"] = 8.0,
|
||||
["F-14A-135-GR"] = 6.0, -- variable-sweep; larger than F-16
|
||||
["F-14B"] = 6.0,
|
||||
["F-15C"] = 5.0,
|
||||
["F-15E"] = 5.0, -- CFTs add modest signature
|
||||
["F-15ESE"] = 5.0,
|
||||
["F-16A"] = 1.2,
|
||||
["F-16C bl.50"] = 1.2,
|
||||
["F-16C bl.52d"] = 1.2,
|
||||
["F/A-18C"] = 1.5,
|
||||
["FA-18C_hornet"] = 1.5,
|
||||
["F/A-18C_hornet"] = 1.5,
|
||||
["F/A-18F"] = 2.0, -- slightly larger two-seater
|
||||
["F-117A"] = 0.003, -- faceted LO design
|
||||
["F-22A"] = 0.0001,-- VLO
|
||||
["F-35A"] = 0.001, -- VLO, approx
|
||||
["B-52H"] = 100.0, -- very large, many flat reflectors
|
||||
["B-1B"] = 0.75, -- blended-wing LO shaping
|
||||
["B-2A"] = 0.001, -- VLO flying wing
|
||||
["AV8BNA"] = 2.0,
|
||||
["Harrier"] = 2.0,
|
||||
["A-4E-C"] = 3.0,
|
||||
["Tornado_IDS"] = 5.0,
|
||||
["Tornado_GR4"] = 5.0,
|
||||
["F-111F"] = 5.0,
|
||||
["F-4E"] = 6.0, -- large, blunt nose
|
||||
["F-5E"] = 1.0, -- small fighter
|
||||
["F-5E-3"] = 1.0,
|
||||
["Mirage-F1CE"] = 2.5,
|
||||
["Mirage-F1EE"] = 2.5,
|
||||
["M-2000C"] = 2.0,
|
||||
["M-2000-5"] = 2.0,
|
||||
["C-17A"] = 50.0,
|
||||
["C-130"] = 40.0,
|
||||
["KC-130"] = 40.0,
|
||||
["KC-135"] = 50.0,
|
||||
["IL-76MD"] = 45.0,
|
||||
["E-3A"] = 50.0, -- plus large rotodome
|
||||
-- ── Soviet / Russian fixed-wing ──────────────────────────────
|
||||
["MiG-15bis"] = 4.0,
|
||||
["MiG-19P"] = 3.5,
|
||||
["MiG-21Bis"] = 2.5, -- small delta
|
||||
["MiG-23MLD"] = 7.0, -- variable-sweep, large intakes
|
||||
["MiG-25PD"] = 14.0, -- very large, all-metal, Mach-3 design
|
||||
["MiG-25RBT"] = 14.0,
|
||||
["MiG-29A"] = 5.0,
|
||||
["MiG-29S"] = 5.0,
|
||||
["MiG-29G"] = 5.0,
|
||||
["MiG-29K"] = 4.0,
|
||||
["MiG-31"] = 14.0, -- similar to MiG-25
|
||||
["Su-7B"] = 6.0,
|
||||
["Su-17M4"] = 7.0, -- variable-sweep
|
||||
["Su-24M"] = 6.0,
|
||||
["Su-24MR"] = 6.0,
|
||||
["Su-25"] = 10.0,
|
||||
["Su-25T"] = 10.0,
|
||||
["Su-25TM"] = 10.0,
|
||||
["Su-27"] = 15.0,
|
||||
["Su-30"] = 15.0,
|
||||
["Su-33"] = 15.0, -- wing fold + canards
|
||||
["Su-34"] = 10.0, -- some reduction vs Su-27
|
||||
["Su-57"] = 0.01, -- PAK-FA LO shaping
|
||||
["Tu-22M3"] = 20.0,
|
||||
["Tu-95MS"] = 80.0,
|
||||
["Tu-142"] = 80.0,
|
||||
["Tu-160"] = 12.0, -- blended wing reduces vs Tu-95
|
||||
["An-26B"] = 30.0,
|
||||
["An-30M"] = 30.0,
|
||||
["IL-78M"] = 45.0,
|
||||
["A-50"] = 50.0, -- plus rotodome
|
||||
-- ── Helicopters ──────────────────────────────────────────────
|
||||
["Mi-8MT"] = 5.0,
|
||||
["Mi-8MSB"] = 5.0,
|
||||
["Mi-8MSB-V"] = 5.0,
|
||||
["Mi-8AMTSh"] = 5.0,
|
||||
["Mi-24V"] = 3.5,
|
||||
["Mi-24P"] = 3.5,
|
||||
["Mi-28N"] = 2.5,
|
||||
["Ka-50"] = 2.0,
|
||||
["Ka-52"] = 2.0,
|
||||
["AH-64D"] = 3.5,
|
||||
["AH-64D_BLK_II"] = 3.5,
|
||||
["UH-1H"] = 3.0,
|
||||
["UH-60L"] = 3.0,
|
||||
["CH-47D"] = 8.0, -- large tandem-rotor
|
||||
["OH-58D"] = 0.8, -- small scout
|
||||
["SA342M"] = 0.8,
|
||||
["SA342L"] = 0.8,
|
||||
}
|
||||
|
||||
---
|
||||
-- Category-based defaults for aircraft types not in the table.
|
||||
-- Keyed by DCS Group.Category integer.
|
||||
--- @type INTEL.RCS_CategoryDefault
|
||||
-- @field #number Group.Category.AIRPLANE RCS Airplane (fightrt) fallback == 5
|
||||
-- @field #number Group.Category.HELICOPTER RCS Helo fallback == 2.5
|
||||
INTEL.RCS_CategoryDefault = {
|
||||
[Group.Category.AIRPLANE] = 5.0, -- generic fighter-sized
|
||||
[Group.Category.HELICOPTER] = 2.5, -- generic helicopter
|
||||
}
|
||||
|
||||
---
|
||||
-- Reference RCS (m²) for range scaling. Detection range in Set
|
||||
-- is the range at which this reference aircraft is reliably detected.
|
||||
-- @field INTEL.RCS_Reference
|
||||
INTEL.RCS_Reference = 5.0 -- m²
|
||||
|
||||
---
|
||||
-- Nose-on/tail-on RCS as a fraction of the side-on value.
|
||||
-- Public estimates for conventional (non-LO) aircraft: ~0.10–0.20.
|
||||
-- @field INTEL.RCS_NoseOnFraction
|
||||
INTEL.RCS_NoseOnFraction = 0.15
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -278,6 +439,7 @@ function INTEL:New(DetectionSet, Coalition, Alias)
|
||||
self:SetRejectZones()
|
||||
self:SetCorridorZones()
|
||||
self:SetConflictZones()
|
||||
self.DopplerRadar = false
|
||||
|
||||
------------------------
|
||||
--- Pseudo Functions ---
|
||||
@@ -411,8 +573,8 @@ end
|
||||
|
||||
--- Set to accept accoustic detection.
|
||||
-- @param #INTEL self
|
||||
-- @param #number Radius Radius in which we can "hear" units. Defaults to 1000 meters.
|
||||
-- @param #table UnitCategories Set what Unit Categories we can "hear". Defaults to `{Unit.Category.GROUND_UNIT,Unit.Category.HELICOPTER}`
|
||||
-- @param #number Radius (Optional) Radius in which we can "hear" units. Defaults to 1000 meters.
|
||||
-- @param #table UnitCategories(Optional) Set what Unit Categories we can "hear". Defaults to `{Unit.Category.GROUND_UNIT,Unit.Category.HELICOPTER}`
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetAccousticDetectionOn(Radius,UnitCategories)
|
||||
self.DetectAccoustic = true
|
||||
@@ -572,7 +734,7 @@ end
|
||||
-- Previously known contacts that are not detected any more, are "lost" after this time.
|
||||
-- This avoids fast oscillations between a contact being detected and undetected.
|
||||
-- @param #INTEL self
|
||||
-- @param #number TimeInterval Time interval in seconds. Default is 120 sec.
|
||||
-- @param #number TimeInterval (Optional) Time interval in seconds. Default is 120 sec.
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetForgetTime(TimeInterval)
|
||||
return self
|
||||
@@ -607,10 +769,10 @@ end
|
||||
|
||||
--- Method to make the radar detection less accurate, e.g. for WWII scenarios.
|
||||
-- @param #INTEL self
|
||||
-- @param #number minheight Minimum flight height to be detected, in meters AGL (above ground)
|
||||
-- @param #number thresheight Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance)
|
||||
-- @param #number thresblur Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found)
|
||||
-- @param #number closing Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20.
|
||||
-- @param #number minheight (Optional) Minimum flight height to be detected, in meters AGL (above ground). Defaults to 250m.
|
||||
-- @param #number thresheight (Optional) Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance)
|
||||
-- @param #number thresblur (Optional) Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found)
|
||||
-- @param #number closing (Optional) Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20.
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetRadarBlur(minheight,thresheight,thresblur,closing)
|
||||
self.RadarBlur = true
|
||||
@@ -737,7 +899,7 @@ end
|
||||
|
||||
--- Change radius of the Clusters.
|
||||
-- @param #INTEL self
|
||||
-- @param #number radius The radius of the clusters in kilometers. Default 15 km.
|
||||
-- @param #number radius (Optional) The radius of the clusters in kilometers. Default 15 km.
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetClusterRadius(radius)
|
||||
self.clusterradius = (radius or 15)*1000
|
||||
@@ -921,8 +1083,11 @@ function INTEL:UpdateIntel()
|
||||
local recce=_recce --Wrapper.Unit#UNIT
|
||||
|
||||
-- Get detected units.
|
||||
self:GetDetectedUnits(recce, DetectedUnits, RecceDetecting, self.DetectVisual, self.DetectOptical, self.DetectRadar, self.DetectIRST, self.DetectRWR, self.DetectDLINK)
|
||||
|
||||
if self.DopplerRadar == true then
|
||||
self:GetDetectedUnitsDoppler(recce, DetectedUnits, RecceDetecting, self.DetectVisual, self.DetectOptical, self.DetectRadar, self.DetectIRST, self.DetectRWR, self.DetectDLINK)
|
||||
else
|
||||
self:GetDetectedUnits(recce, DetectedUnits, RecceDetecting, self.DetectVisual, self.DetectOptical, self.DetectRadar, self.DetectIRST, self.DetectRWR, self.DetectDLINK)
|
||||
end
|
||||
end
|
||||
|
||||
if self.DetectAccoustic then
|
||||
@@ -1105,6 +1270,15 @@ function INTEL:_UpdateContact(Contact)
|
||||
else
|
||||
Contact.maneuvering = false
|
||||
end
|
||||
local typename = Contact.group:GetTypeName()
|
||||
local base_rcs = INTEL.RCS_Table[typename]
|
||||
|
||||
if not base_rcs then
|
||||
-- Fallback: category default
|
||||
local cat = Contact.group:GetCategory()
|
||||
base_rcs = (cat and INTEL.RCS_CategoryDefault[cat]) or INTEL.RCS_Reference
|
||||
end
|
||||
Contact.rcs = base_rcs
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1445,7 +1619,7 @@ end
|
||||
-- @param #INTEL self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE Positionable Group or static object.
|
||||
-- @param #string RecceName Name of the recce group that detected this object.
|
||||
-- @param #number Tdetected Abs. mission time in seconds, when the object is detected. Default now.
|
||||
-- @param #number Tdetected (Optional) Abs. mission time in seconds, when the object is detected. Default now.
|
||||
-- @return #INTEL self
|
||||
function INTEL:KnowObject(Positionable, RecceName, Tdetected)
|
||||
|
||||
@@ -2016,7 +2190,7 @@ end
|
||||
--- Calculate cluster future position after given seconds.
|
||||
-- @param #INTEL self
|
||||
-- @param #INTEL.Cluster cluster The cluster of contacts.
|
||||
-- @param #number seconds Time interval in seconds. Default is `self.prediction`.
|
||||
-- @param #number seconds (Optional) Time interval in seconds. Default is `self.prediction`.
|
||||
-- @return Core.Point#COORDINATE Calculated future position of the cluster.
|
||||
function INTEL:CalcClusterFuturePosition(cluster, seconds)
|
||||
|
||||
@@ -2258,7 +2432,7 @@ end
|
||||
--- Get the coordinate of a cluster.
|
||||
-- @param #INTEL self
|
||||
-- @param #INTEL.Cluster Cluster The cluster.
|
||||
-- @param #boolean Update If `true`, update the coordinate. Default is to just return the last stored position.
|
||||
-- @param #boolean Update (Optional) If `true`, update the coordinate. Default is to just return the last stored position.
|
||||
-- @return Core.Point#COORDINATE The coordinate of this cluster.
|
||||
function INTEL:GetClusterCoordinate(Cluster, Update)
|
||||
|
||||
@@ -2309,8 +2483,8 @@ end
|
||||
--- Check if the coordindate of the cluster changed.
|
||||
-- @param #INTEL self
|
||||
-- @param #INTEL.Cluster Cluster The cluster.
|
||||
-- @param #number Threshold in meters. Default 100 m.
|
||||
-- @param Core.Point#COORDINATE Coordinate Reference coordinate. Default is the last known coordinate of the cluster.
|
||||
-- @param #number (Optional) Threshold in meters. Default 100 m.
|
||||
-- @param Core.Point#COORDINATE Coordinate (Optional) Reference coordinate. Default is the last known coordinate of the cluster.
|
||||
-- @return #boolean If `true`, the coordinate changed by more than the given threshold.
|
||||
function INTEL:_CheckClusterCoordinateChanged(Cluster, Coordinate, Threshold)
|
||||
|
||||
@@ -2445,12 +2619,230 @@ function INTEL:GetHighestThreatContact(Cluster)
|
||||
return rcontact
|
||||
end
|
||||
|
||||
--- Enable 70/80s era pulse-Doppler ground-clutter simulation.
|
||||
-- Only affects contacts detected via radar (DetectRadar=true paths).
|
||||
-- Has no effect on visual, optical, IRST, RWR or datalink detections.
|
||||
-- @param #INTEL self
|
||||
-- @param #number MinAltAGL Min AGL altitude in metres for reliable detection.
|
||||
-- Below this the detection probability drops linearly.
|
||||
-- Default 500 m (≈ clutter floor for P-18 / P-37).
|
||||
-- @param #number NotchHalfDeg Half-width of the velocity notch in degrees.
|
||||
-- Targets with radial-velocity fraction < sin(NotchHalf)
|
||||
-- are suppressed. Default 15° (≈ P-18 / Bar Lock spec).
|
||||
-- @param #number MinSpeedMps Minimum speed in m/s that the MTI filter can track.
|
||||
-- Default 50 m/s (≈ 100 kt).
|
||||
-- @param #number RadarRangeKm Nominal detection range in km for the reference aircraft
|
||||
-- (RCS_Reference, default 5 m²). Used only for RCS range
|
||||
-- scaling; has no effect when DopplerRCS is false.
|
||||
-- Default 200 km (≈ P-37 instrumented range vs fighter).
|
||||
-- @param #boolean RCS If false, disable RCS range scaling (keep A–C only).
|
||||
-- Default true.
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetDopplerRadar(MinAltAGL, NotchHalfDeg, MinSpeedMps, RadarRangeKm, RCS)
|
||||
self:T(self.lid .. "SetDopplerRadar")
|
||||
self.DopplerRadar = true
|
||||
self.DopplerMinAltAGL = MinAltAGL or 500
|
||||
self.DopplerNotchSin = math.sin(math.rad(NotchHalfDeg or 15))
|
||||
self.DopplerMinSpeedMps = MinSpeedMps or 50
|
||||
self.DopplerRCS = (RCS ~= false) -- default true
|
||||
self.DopplerRadarRangeM = (RadarRangeKm or 200) * 1000
|
||||
return self
|
||||
end
|
||||
|
||||
--- Disable Doppler radar simulation.
|
||||
-- @param #INTEL self
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetDopplerRadarOff()
|
||||
self:T(self.lid .. "SetDopplerRadarOff")
|
||||
self.DopplerRadar = false
|
||||
return self
|
||||
end
|
||||
|
||||
--- Override the per-type RCS value for a DCS unit type name.
|
||||
-- Useful for modded aircraft or mission-specific tweaks.
|
||||
-- @param #INTEL self
|
||||
-- @param #string TypeName DCS unit type name (e.g. "MiG-29A")
|
||||
-- @param #number RCS_m2 Side-on RCS in m²
|
||||
-- @return #INTEL self
|
||||
function INTEL:SetTypeRCS(TypeName, RCS_m2)
|
||||
self:T(self.lid .. "SetTypeRCS")
|
||||
INTEL.RCS_Table[TypeName] = RCS_m2
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Compute the aspect-weighted RCS for a target unit as seen
|
||||
-- from a given radar position.
|
||||
--
|
||||
-- The model blends the side-on (maximum) and nose/tail-on (minimum) RCS
|
||||
-- using the geometry of the target's velocity relative to the radar line:
|
||||
--
|
||||
-- σ_eff = σ_base × ( f_nose + (1 − f_nose) × sin²(aspect_from_radial) )
|
||||
--
|
||||
-- where aspect_from_radial is 0° when the target flies toward/away from
|
||||
-- the radar (nose-on) and 90° when the target crosses the beam (side-on).
|
||||
--
|
||||
-- @param #INTEL self
|
||||
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||
-- @param #table rpos Radar position as Vec3 {x,y,z}
|
||||
-- @param #number spd Target speed in m/s (pre-computed for efficiency)
|
||||
-- @param DCS#Vec3 tvel Target velocity vector (pre-computed)
|
||||
-- @return #number Effective RCS in m²
|
||||
function INTEL:_GetAspectRCS(TargetUnit, rpos, spd, tvel)
|
||||
self:T(self.lid .. "_GetAspectRCS")
|
||||
-- Look up base (side-on) RCS
|
||||
local typename = TargetUnit:GetTypeName()
|
||||
local base_rcs = INTEL.RCS_Table[typename]
|
||||
|
||||
if not base_rcs then
|
||||
-- Fallback: category default
|
||||
local cat = TargetUnit:GetGroup() and TargetUnit:GetGroup():GetCategory()
|
||||
base_rcs = (cat and INTEL.RCS_CategoryDefault[cat]) or INTEL.RCS_Reference
|
||||
end
|
||||
|
||||
-- Aspect-dependent factor
|
||||
if spd < 1 then return base_rcs end
|
||||
|
||||
local tpos = TargetUnit:GetVec3()
|
||||
local dx = rpos.x - tpos.x -- vector target → radar (horizontal)
|
||||
local dz = rpos.z - tpos.z
|
||||
local d = math.sqrt(dx * dx + dz * dz)
|
||||
if d < 1 then return base_rcs end
|
||||
|
||||
-- cos of angle between target velocity and target→radar line
|
||||
-- = 1: nose/tail directly toward radar; = 0: pure crossing (beam)
|
||||
local cos_a = (tvel.x * dx + tvel.z * dz) / (spd * d)
|
||||
-- sin²(aspect_from_radial) = 1 − cos² ; gives 0 nose-on, 1 beam-on
|
||||
local sin2_a = 1.0 - cos_a * cos_a
|
||||
|
||||
local f = INTEL.RCS_NoseOnFraction
|
||||
return base_rcs * (f + (1.0 - f) * sin2_a)
|
||||
end
|
||||
|
||||
--- (Internal) Check whether a target unit would be detected by a 70/80s
|
||||
-- pulse-Doppler radar located at the given radar unit position.
|
||||
-- @param #INTEL self
|
||||
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||
-- @param Wrapper.Unit#UNIT RadarUnit
|
||||
-- @return #boolean true = detected
|
||||
-- @return #string rejection reason: "speed" | "clutter" | "notch" | "rcs"
|
||||
function INTEL:_CheckDopplerDetection(TargetUnit, RadarUnit)
|
||||
self:T(self.lid .. "_CheckDopplerDetection")
|
||||
-- Pre-compute common geometry (shared by notch + RCS checks)
|
||||
local spd = TargetUnit:GetVelocityMPS()
|
||||
local rpos = RadarUnit:GetVec3()
|
||||
local tpos = TargetUnit:GetVec3()
|
||||
local tvel = TargetUnit:GetVelocityVec3()
|
||||
|
||||
local dx = tpos.x - rpos.x
|
||||
local dz = tpos.z - rpos.z
|
||||
local slant = math.sqrt(dx * dx + dz * dz) -- 2-D slant range in metres
|
||||
|
||||
-- ── A. Minimum speed gate ──────────────────────────────────
|
||||
if spd < self.DopplerMinSpeedMps then
|
||||
return false, "speed"
|
||||
end
|
||||
|
||||
-- ── B. AGL ground-clutter rejection ───────────────────────
|
||||
local agl = TargetUnit:GetAltitude(true) -- metres AGL
|
||||
if agl < self.DopplerMinAltAGL then
|
||||
-- P(detect) rises linearly from 0 at deck to 1 at DopplerMinAltAGL
|
||||
if math.random() > (agl / self.DopplerMinAltAGL) then
|
||||
return false, "clutter"
|
||||
end
|
||||
end
|
||||
|
||||
-- ── C. Velocity notch ─────────────────────────────────────
|
||||
if slant > 1 then
|
||||
local nx = dx / slant
|
||||
local nz = dz / slant
|
||||
local vr = tvel.x * nx + tvel.z * nz -- radial velocity (m/s)
|
||||
local vr_frac = math.abs(vr) / math.max(spd, 1)
|
||||
|
||||
if vr_frac < self.DopplerNotchSin then
|
||||
return false, "notch"
|
||||
end
|
||||
end
|
||||
|
||||
-- ── D. RCS-based range scaling ─────────────────────────────
|
||||
-- R_max ∝ σ^0.25 (from the radar range equation).
|
||||
-- Effective detection range = DopplerRadarRangeM × (σ_eff / σ_ref)^0.25
|
||||
-- Beyond that range: target not detected (hard cutoff at 100%; soft fade
|
||||
-- starts at 80% of R_max to smooth the transition).
|
||||
if self.DopplerRCS == true and slant > 1 then
|
||||
local sigma = self:_GetAspectRCS(TargetUnit, rpos, spd, tvel)
|
||||
-- (σ/σ_ref)^0.25 — clamp to avoid log of 0 for VLO aircraft
|
||||
local scale = (sigma / INTEL.RCS_Reference) ^ 0.25
|
||||
local R_max = self.DopplerRadarRangeM * scale
|
||||
|
||||
if slant > R_max then
|
||||
return false, "rcs"
|
||||
end
|
||||
|
||||
-- Soft fade zone: linear probability drop from 1 at 80% R_max to 0 at R_max
|
||||
local fade_start = R_max * 0.80
|
||||
if slant > fade_start then
|
||||
local p = (R_max - slant) / (R_max - fade_start) -- 1→0
|
||||
if math.random() > p then
|
||||
return false, "rcs"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
---(Internal) Return the detected target groups of the controllable as a table.
|
||||
-- We wrap the original function so the Doppler post-filter is transparent:
|
||||
-- the existing RadarBlur / RadarAcceptRange logic is unchanged, and the
|
||||
-- Doppler check runs once after all units have been collected.
|
||||
-- The optional parameters specify the detection methods that can be applied.
|
||||
-- If no detection method is given, the detection will use all the available methods by default.
|
||||
-- @param #INTEL self
|
||||
-- @param Wrapper.Unit#UNIT Unit The unit detecting.
|
||||
-- @param #table DetectedUnits Table of detected units to be filled.
|
||||
-- @param #table RecceDetecting Table of recce per unit to be filled.
|
||||
-- @param #boolean DetectVisual (Optional) If *false*, do not include visually detected targets.
|
||||
-- @param #boolean DetectOptical (Optional) If *false*, do not include optically detected targets.
|
||||
-- @param #boolean DetectRadar (Optional) If *false*, do not include targets detected by radar.
|
||||
-- @param #boolean DetectIRST (Optional) If *false*, do not include targets detected by IRST.
|
||||
-- @param #boolean DetectRWR (Optional) If *false*, do not include targets detected by RWR.
|
||||
-- @param #boolean DetectDLINK (Optional) If *false*, do not include targets detected by data link.
|
||||
function INTEL:GetDetectedUnitsDoppler(Unit, DetectedUnits, RecceDetecting,DetectVisual, DetectOptical, DetectRadar,DetectIRST, DetectRWR, DetectDLINK)
|
||||
self:T(self.lid .. "GetDetectedUnitsDoppler")
|
||||
-- Run the original detection
|
||||
self:GetDetectedUnits(Unit,DetectedUnits,RecceDetecting,DetectVisual,DetectOptical,DetectRadar,DetectIRST,DetectRWR,DetectDLINK)
|
||||
|
||||
-- Apply Doppler post-filter only when radar channel is active
|
||||
if self.DopplerRadar == false then return end
|
||||
if DetectRadar == false then return end
|
||||
|
||||
local remove = {}
|
||||
for name, unit in pairs(DetectedUnits) do
|
||||
-- Only filter live UNIT objects (not STATICs) that are airborne
|
||||
if unit:IsInstanceOf("UNIT") and unit:IsAir() then
|
||||
local ok, reason = self:_CheckDopplerDetection(unit, Unit)
|
||||
if not ok then
|
||||
table.insert(remove, name)
|
||||
--if self.verbose and self.verbose >= 2 then
|
||||
self:T(string.format("%sDoppler: suppressed %s [%s] by %s",self.lid, name, reason, Unit:GetName()))
|
||||
--end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, name in ipairs(remove) do
|
||||
DetectedUnits[name] = nil
|
||||
RecceDetecting[name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
-- Start INTEL_DLINK
|
||||
-- TODO Start INTEL_DLINK
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
--- **Ops_DLink** - Support for Office of Military Intelligence.
|
||||
@@ -2641,11 +3033,11 @@ end
|
||||
|
||||
--- Function to set how long INTEL DLINK remembers contacts.
|
||||
-- @param #INTEL_DLINK self
|
||||
-- @param #number seconds Remember this many seconds. Defaults to 180.
|
||||
-- @param #number seconds (Optional) Remember this many seconds. Defaults to 120.
|
||||
-- @return #INTEL_DLINK self
|
||||
function INTEL_DLINK:SetDLinkCacheTime(seconds)
|
||||
self.cachetime = math.abs(seconds or 120)
|
||||
self:I(self.lid.."Caching for "..self.cachetime.." seconds.")
|
||||
self:T(self.lid.."Caching for "..self.cachetime.." seconds.")
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -2735,7 +3127,7 @@ end
|
||||
function INTEL_DLINK:onafterStop(From, Event, To)
|
||||
self:T({From, Event, To})
|
||||
local text = string.format("Version %s stopped.", self.version)
|
||||
self:I(self.lid .. text)
|
||||
self:T(self.lid .. text)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #LEGION self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #LEGION self
|
||||
function LEGION:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -468,10 +468,10 @@ end
|
||||
-- @param #LEGION self
|
||||
-- @param Ops.Cohort#COHORT Cohort The cohort to be relocated.
|
||||
-- @param Ops.Legion#LEGION Legion The legion where the cohort is relocated to.
|
||||
-- @param #number Delay Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP.
|
||||
-- @param #number NcarriersMin Min number of transport carriers in case the troops should be transported. Default `nil` for no transport.
|
||||
-- @param #number Delay (Optional) Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP.
|
||||
-- @param #number NcarriersMin (Optional) Min number of transport carriers in case the troops should be transported. Default `nil` for no transport.
|
||||
-- @param #number NcarriersMax Max number of transport carriers.
|
||||
-- @param #table TransportLegions Legion(s) assigned for transportation. Default is that transport assets can only be recruited from this legion.
|
||||
-- @param #table TransportLegions (Optional) Legion(s) assigned for transportation. Default is that transport assets can only be recruited from this legion.
|
||||
-- @return #LEGION self
|
||||
function LEGION:RelocateCohort(Cohort, Legion, Delay, NcarriersMin, NcarriersMax, TransportLegions)
|
||||
|
||||
@@ -1927,7 +1927,7 @@ end
|
||||
--- Check if an asset is currently on a mission (STARTED or EXECUTING).
|
||||
-- @param #LEGION self
|
||||
-- @param Functional.Warehouse#WAREHOUSE.Assetitem asset The asset.
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default all.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all.
|
||||
-- @return #boolean If true, asset has at least one mission of that type in the queue.
|
||||
function LEGION:IsAssetOnMission(asset, MissionTypes)
|
||||
|
||||
@@ -1980,7 +1980,7 @@ end
|
||||
|
||||
--- Count payloads in stock.
|
||||
-- @param #LEGION self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #table UnitTypes Types of units.
|
||||
-- @param #table Payloads Specific payloads to be counted only.
|
||||
-- @return #number Count of available payloads in stock.
|
||||
@@ -2056,7 +2056,7 @@ end
|
||||
|
||||
--- Count missions in mission queue.
|
||||
-- @param #LEGION self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`.
|
||||
-- @param #boolean OnlyRunning If `true`, only count running missions.
|
||||
-- @return #number Number of missions that are not over yet.
|
||||
function LEGION:CountMissionsInQueue(MissionTypes, OnlyRunning)
|
||||
@@ -2171,8 +2171,8 @@ end
|
||||
|
||||
--- Count assets on mission.
|
||||
-- @param #LEGION self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default all.
|
||||
-- @param Ops.Cohort#COHORT Cohort Only count assets of this cohort. Default count assets of all cohorts.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all.
|
||||
-- @param Ops.Cohort#COHORT Cohort (Optional) Only count assets of this cohort. Default count assets of all cohorts.
|
||||
-- @return #number Number of pending and queued assets.
|
||||
-- @return #number Number of pending assets.
|
||||
-- @return #number Number of queued assets.
|
||||
@@ -2215,7 +2215,7 @@ end
|
||||
|
||||
--- Get assets on mission.
|
||||
-- @param #LEGION self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default all.
|
||||
-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all.
|
||||
-- @return #table Assets on pending requests.
|
||||
function LEGION:GetAssetsOnMission(MissionTypes)
|
||||
|
||||
@@ -2248,7 +2248,7 @@ end
|
||||
--- Get the unit types of this legion. These are the unit types of all assigned cohorts.
|
||||
-- @param #LEGION self
|
||||
-- @param #boolean onlyactive Count only the active ones.
|
||||
-- @param #table cohorts Table of cohorts. Default all.
|
||||
-- @param #table cohorts (Optional) Table of cohorts. Default all.
|
||||
-- @return #table Table of unit types.
|
||||
function LEGION:GetAircraftTypes(onlyactive, cohorts)
|
||||
|
||||
@@ -2577,8 +2577,11 @@ end
|
||||
-- @param #number RefuelSystem Refueling system (boom or probe).
|
||||
-- @param #number CargoWeight Cargo weight [kg]. This checks the cargo bay of the cohort assets and ensures that it is large enough to carry the given cargo weight.
|
||||
-- @param #number MaxWeight Max weight [kg]. This checks whether the cohort asset group is not too heavy.
|
||||
-- @param RangeMin Min range in meters. (Default is 0, i.e. no minimum range.)
|
||||
-- @return #boolean Returns `true` if given cohort can meet all requirements.
|
||||
function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight)
|
||||
function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight, RangeMin)
|
||||
|
||||
RangeMin = RangeMin or -1
|
||||
|
||||
--- Function to check category.
|
||||
local function CheckCategory(_cohort)
|
||||
@@ -2656,8 +2659,8 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
||||
-- Is in range?
|
||||
local Rmax=cohort:GetMissionRange(WeaponTypes)
|
||||
local RangeMax = RangeMax or 0
|
||||
local InRange=(RangeMax and math.max(RangeMax, Rmax) or Rmax) >= TargetDistance
|
||||
|
||||
local InRange=(RangeMax and math.max(RangeMax, Rmax) or Rmax) >= TargetDistance and TargetDistance > RangeMin
|
||||
|
||||
--env.info(string.format("Range TargetDist=%.1f Rmax=%.1f RangeMax=%.1f InRange=%s", TargetDistance, Rmax, RangeMax, tostring(InRange)))
|
||||
|
||||
return InRange
|
||||
@@ -2789,7 +2792,7 @@ end
|
||||
--- Recruit assets from Cohorts for the given parameters. **NOTE** that we set the `asset.isReserved=true` flag so it cannot be recruited by anyone else.
|
||||
-- @param #table Cohorts Cohorts included.
|
||||
-- @param #string MissionTypeRecruit Mission type for recruiting the cohort assets.
|
||||
-- @param #string MissionTypeOpt Mission type for which the assets are optimized. Default is the same as `MissionTypeRecruit`.
|
||||
-- @param #string MissionTypeOpt (Optional) Mission type for which the assets are optimized. Default is the same as `MissionTypeRecruit`.
|
||||
-- @param #number NreqMin Minimum number of required assets.
|
||||
-- @param #number NreqMax Maximum number of required assets.
|
||||
-- @param DCS#Vec2 TargetVec2 Target position as 2D vector.
|
||||
@@ -2803,10 +2806,11 @@ end
|
||||
-- @param #table Attributes Group attributes. See `GROUP.Attribute.`
|
||||
-- @param #table Properties DCS attributes.
|
||||
-- @param #table WeaponTypes Bit of weapon types.
|
||||
-- @param #number RangeMin Min range in meters. (Default is 0, i.e. no minimum range.)
|
||||
-- @return #boolean If `true` enough assets could be recruited.
|
||||
-- @return #table Recruited assets. **NOTE** that we set the `asset.isReserved=true` flag so it cant be recruited by anyone else.
|
||||
-- @return #table Legions of recruited assets.
|
||||
function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt, NreqMin, NreqMax, TargetVec2, Payloads, RangeMax, RefuelSystem, CargoWeight, TotalWeight, MaxWeight, Categories, Attributes, Properties, WeaponTypes)
|
||||
function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt, NreqMin, NreqMax, TargetVec2, Payloads, RangeMax, RefuelSystem, CargoWeight, TotalWeight, MaxWeight, Categories, Attributes, Properties, WeaponTypes, RangeMin)
|
||||
|
||||
-- The recruited assets.
|
||||
local Assets={}
|
||||
@@ -2824,7 +2828,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
||||
local cohort=_cohort --Ops.Cohort#COHORT
|
||||
|
||||
-- Check if cohort can do the mission.
|
||||
local can=LEGION._CohortCan(cohort, MissionTypeRecruit, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight)
|
||||
local can=LEGION._CohortCan(cohort, MissionTypeRecruit, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight, RangeMin)
|
||||
|
||||
--env.info(string.format("RecruitCohortAssets %s Cohort=%s can=%s", MissionTypeRecruit, cohort:GetName(), tostring(can)))
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ end
|
||||
--- Enable/disable pathfinding.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #boolean Switch If true, enable pathfinding.
|
||||
-- @param #number CorridorWidth Corridor with in meters. Default 400 m.
|
||||
-- @param #number CorridorWidth (Optional) Corridor with in meters. Default 400 m.
|
||||
-- @return #NAVYGROUP self
|
||||
function NAVYGROUP:SetPathfinding(Switch, CorridorWidth)
|
||||
self.pathfindingOn=Switch
|
||||
@@ -444,7 +444,7 @@ end
|
||||
|
||||
--- Enable pathfinding.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #number CorridorWidth Corridor with in meters. Default 400 m.
|
||||
-- @param #number CorridorWidth (Optional) Corridor with in meters. Default 400 m.
|
||||
-- @return #NAVYGROUP self
|
||||
function NAVYGROUP:SetPathfindingOn(CorridorWidth)
|
||||
self:SetPathfinding(true, CorridorWidth)
|
||||
@@ -476,9 +476,9 @@ end
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the target.
|
||||
-- @param #string Clock Time when to start the attack.
|
||||
-- @param #number Radius Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots (Optional) Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task data.
|
||||
function NAVYGROUP:AddTaskFireAtPoint(Coordinate, Clock, Radius, Nshots, WeaponType, Prio)
|
||||
@@ -493,12 +493,12 @@ end
|
||||
--- Add a *waypoint* task.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate of the target.
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint Where the task is executed. Default is next waypoint.
|
||||
-- @param #number Radius Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param #number Duration Duration in seconds after which the task is cancelled. Default *never*.
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Waypoint (Optional) Waypoint Where the task is executed. Default is next waypoint.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 100 m.
|
||||
-- @param #number Nshots (Optional) Number of shots to fire. Default 3.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @param #number Duration (Optional) Duration in seconds after which the task is cancelled. Default *never*.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task table.
|
||||
function NAVYGROUP:AddTaskWaypointFireAtPoint(Coordinate, Waypoint, Radius, Nshots, WeaponType, Prio, Duration)
|
||||
|
||||
@@ -515,10 +515,10 @@ end
|
||||
--- Add a *scheduled* task.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param Wrapper.Group#GROUP TargetGroup Target group.
|
||||
-- @param #number WeaponExpend How much weapons does are used.
|
||||
-- @param #number WeaponType Type of weapon. Default auto.
|
||||
-- @param #string Clock Time when to start the attack.
|
||||
-- @param #number Prio Priority of the task.
|
||||
-- @param #number WeaponExpend (Optional) How much weapons does are used.
|
||||
-- @param #number WeaponType (Optional) Type of weapon. Default auto.
|
||||
-- @param #string Clock (Optional) Time when to start the attack.
|
||||
-- @param #number Prio (Optional) Priority of the task. Defaults to 50.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Task The task data.
|
||||
function NAVYGROUP:AddTaskAttackGroup(TargetGroup, WeaponExpend, WeaponType, Clock, Prio)
|
||||
|
||||
@@ -531,11 +531,11 @@ end
|
||||
|
||||
--- Create a turn into wind window. Note that this is not executed as it not added to the queue.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number speed Speed in knots during turn into wind leg.
|
||||
-- @param #boolean uturn If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @param #number offset Offset angle in degrees, e.g. to account for an angled runway. Default 0 deg.
|
||||
-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number speed (Optional) Speed in knots during turn into wind leg. Defaults to 20.
|
||||
-- @param #boolean uturn (Optional) If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @param #number offset (Optional) Offset angle in degrees, e.g. to account for an angled runway. Default 0 deg.
|
||||
-- @return #NAVYGROUP.IntoWind Recovery window.
|
||||
function NAVYGROUP:_CreateTurnIntoWind(starttime, stoptime, speed, uturn, offset)
|
||||
|
||||
@@ -598,11 +598,11 @@ end
|
||||
|
||||
--- Add a time window, where the groups steams into the wind.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number speed Wind speed on deck in knots during turn into wind leg. Default 20 knots.
|
||||
-- @param #boolean uturn If `true` (or `nil`), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @param #number offset Offset angle clock-wise in degrees, *e.g.* to account for an angled runway. Default 0 deg. Use around -9.1° for US carriers.
|
||||
-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now.
|
||||
-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time.
|
||||
-- @param #number speed (Optional) Wind speed on deck in knots during turn into wind leg. Default 20 knots.
|
||||
-- @param #boolean uturn (Optional) If `true` (or `nil`), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint.
|
||||
-- @param #number offset (Optional) Offset angle clock-wise in degrees, *e.g.* to account for an angled runway. Default 0 deg. Use around -9.1° for US carriers.
|
||||
-- @return #NAVYGROUP.IntoWind Turn into window data table.
|
||||
function NAVYGROUP:AddTurnIntoWind(starttime, stoptime, speed, uturn, offset)
|
||||
|
||||
@@ -644,7 +644,7 @@ end
|
||||
|
||||
--- Extend duration of turn into wind.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #number Duration Duration in seconds. Default 300 sec.
|
||||
-- @param #number Duration (Optional) Duration in seconds. Default 300 sec.
|
||||
-- @param #NAVYGROUP.IntoWind TurnIntoWind (Optional) Turn into window data table. If not given, the currently open one is used (if there is any).
|
||||
-- @return #NAVYGROUP self
|
||||
function NAVYGROUP:ExtendTurnIntoWind(Duration, TurnIntoWind)
|
||||
@@ -1832,10 +1832,10 @@ end
|
||||
--- Add an a waypoint to the route.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. Use `COORDINATE:SetAltitude()` to define the altitude.
|
||||
-- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed.
|
||||
-- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Depth Depth at waypoint in feet. Only for submarines.
|
||||
-- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default is default cruise speed or 70% of max speed.
|
||||
-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
|
||||
-- @param #number Depth (Optional) Depth at waypoint in feet. Only for submarines.
|
||||
-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table.
|
||||
function NAVYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Depth, Updateroute)
|
||||
|
||||
@@ -1875,8 +1875,8 @@ end
|
||||
|
||||
--- Initialize group parameters. Also initializes waypoints if self.waypoints is nil.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #table Template Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @param #table Template (Optional) Template used to init the group. Default is `self.template`.
|
||||
-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous.
|
||||
-- @return #NAVYGROUP self
|
||||
function NAVYGROUP:_InitGroup(Template, Delay)
|
||||
|
||||
@@ -1981,7 +1981,7 @@ end
|
||||
|
||||
--- Check for possible collisions between two coordinates.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #number DistanceMax Max distance in meters ahead to check. Default 5000.
|
||||
-- @param #number DistanceMax (Optional) Max distance in meters ahead to check. Default 5000.
|
||||
-- @param #number dx
|
||||
-- @return #number Free distance in meters.
|
||||
function NAVYGROUP:_CheckFreePath(DistanceMax, dx)
|
||||
@@ -2167,7 +2167,7 @@ end
|
||||
|
||||
--- Get wind direction and speed at current position.
|
||||
-- @param #NAVYGROUP self
|
||||
-- @param #number Altitude Altitude in meters above main sea level at which the wind is calculated. Default 18 meters.
|
||||
-- @param #number Altitude (Optional) Altitude in meters above main sea level at which the wind is calculated. Default 18 meters.
|
||||
-- @return #number Direction the wind is blowing **from** in degrees.
|
||||
-- @return #number Wind speed in m/s.
|
||||
function NAVYGROUP:GetWind(Altitude)
|
||||
|
||||
@@ -145,7 +145,7 @@ OPERATION.version="0.2.0"
|
||||
|
||||
--- Create a new generic OPERATION object.
|
||||
-- @param #OPERATION self
|
||||
-- @param #string Name Name of the operation. Be creative! Default "Operation-01" where the last number is a running number.
|
||||
-- @param #string Name (Optional) Name of the operation. Be creative! Default "Operation-01" where the last number is a running number.
|
||||
-- @return #OPERATION self
|
||||
function OPERATION:New(Name)
|
||||
|
||||
@@ -349,7 +349,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #OPERATION self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #OPERATION self
|
||||
function OPERATION:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -358,7 +358,7 @@ end
|
||||
|
||||
--- Set start and stop time of the operation.
|
||||
-- @param #OPERATION self
|
||||
-- @param #string ClockStart Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added.
|
||||
-- @param #string ClockStart (Optional) Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added.
|
||||
-- @param #string ClockStop (Optional) Time the mission is stopped, e.g. "13:00" for 1 pm. If mission could not be started at that time, it will be removed from the queue. If specified as a #number it will be relative (in seconds) to the current mission time.
|
||||
-- @return #OPERATION self
|
||||
function OPERATION:SetTime(ClockStart, ClockStop)
|
||||
@@ -415,9 +415,9 @@ end
|
||||
|
||||
--- Add a new phase to the operation. This is added add the end of all previously added phases (if any).
|
||||
-- @param #OPERATION self
|
||||
-- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #OPERATION.Branch Branch The branch to which this phase is added. Default is the master branch.
|
||||
-- @param #number Duration Duration in seconds how long the phase will last. Default `nil`=forever.
|
||||
-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #OPERATION.Branch Branch (Optional) The branch to which this phase is added. Default is the master branch.
|
||||
-- @param #number Duration (Optional) Duration in seconds how long the phase will last. Default `nil`=forever.
|
||||
-- @return #OPERATION.Phase Phase table object.
|
||||
function OPERATION:AddPhase(Name, Branch, Duration)
|
||||
|
||||
@@ -445,7 +445,7 @@ end
|
||||
---Insert a new phase after an already defined phase of the operation.
|
||||
-- @param #OPERATION self
|
||||
-- @param #OPERATION.Phase PhaseAfter The phase after which the new phase is inserted.
|
||||
-- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @return #OPERATION.Phase Phase table object.
|
||||
function OPERATION:InsertPhaseAfter(PhaseAfter, Name)
|
||||
|
||||
@@ -472,7 +472,7 @@ end
|
||||
|
||||
--- Get a phase by its name.
|
||||
-- @param #OPERATION self
|
||||
-- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @return #OPERATION.Phase Phase table object or nil if phase could not be found.
|
||||
function OPERATION:GetPhaseByName(Name)
|
||||
|
||||
@@ -610,7 +610,7 @@ end
|
||||
|
||||
--- Get name of a phase.
|
||||
-- @param #OPERATION self
|
||||
-- @param #OPERATION.Phase Phase The phase of which the name is returned. Default is the currently active phase.
|
||||
-- @param #OPERATION.Phase Phase (Optional) The phase of which the name is returned. Default is the currently active phase.
|
||||
-- @return #string The name of the phase or "None" if no phase is given or active.
|
||||
function OPERATION:GetPhaseName(Phase)
|
||||
|
||||
@@ -752,7 +752,7 @@ end
|
||||
|
||||
--- Get name of the branch.
|
||||
-- @param #OPERATION self
|
||||
-- @param #OPERATION.Branch Branch The branch of which the name is requested. Default is the currently active or master branch.
|
||||
-- @param #OPERATION.Branch (Optional) Branch The branch of which the name is requested. Default is the currently active or master branch.
|
||||
-- @return #string Name Name or "None"
|
||||
function OPERATION:GetBranchName(Branch)
|
||||
Branch=Branch or self:GetBranchActive()
|
||||
@@ -1336,7 +1336,7 @@ end
|
||||
|
||||
--- Create a new phase object.
|
||||
-- @param #OPERATION self
|
||||
-- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @return #OPERATION.Phase Phase table object.
|
||||
function OPERATION:_CreatePhase(Name)
|
||||
|
||||
@@ -1356,7 +1356,7 @@ end
|
||||
|
||||
--- Create a new branch object.
|
||||
-- @param #OPERATION self
|
||||
-- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number.
|
||||
-- @return #OPERATION.Branch Branch table object.
|
||||
function OPERATION:_CreateBranch(Name)
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ OPSGROUP.CargoStatus={
|
||||
|
||||
--- OpsGroup version.
|
||||
-- @field #string version
|
||||
OPSGROUP.version="1.0.4"
|
||||
OPSGROUP.version="1.0.6"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -1016,7 +1016,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -1068,7 +1068,7 @@ end
|
||||
|
||||
--- Set default cruise altitude.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Altitude Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultAltitude(Altitude)
|
||||
if Altitude then
|
||||
@@ -1097,7 +1097,7 @@ end
|
||||
|
||||
--- Set current altitude.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Altitude Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters.
|
||||
-- @param #boolean Keep If `true` the group will maintain that speed on passing waypoints. If `nil` or `false` the group will return to the speed as defined by their route.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetAltitude(Altitude, Keep, RadarAlt)
|
||||
@@ -1147,7 +1147,7 @@ end
|
||||
|
||||
--- Set current speed.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Speed Speed in knots. Default is 70% of max speed.
|
||||
-- @param #number Speed (Optional) Speed in knots. Default is 70% of max speed.
|
||||
-- @param #boolean Keep If `true` the group will maintain that speed on passing waypoints. If `nil` or `false` the group will return to the speed as defined by their route.
|
||||
-- @param #boolean AltCorrected If `true`, use altitude corrected indicated air speed.
|
||||
-- @return #OPSGROUP self
|
||||
@@ -1176,7 +1176,7 @@ end
|
||||
--- Set detection on or off.
|
||||
-- If detection is on, detected targets of the group will be evaluated and FSM events triggered.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean Switch If `true`, detection is on. If `false` or `nil`, detection is off. Default is off.
|
||||
-- @param #boolean Switch (Optional) If `true`, detection is on. If `false` or `nil`, detection is off. Default is off.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDetection(Switch)
|
||||
self:T(self.lid..string.format("Detection is %s", tostring(Switch)))
|
||||
@@ -1335,7 +1335,7 @@ end
|
||||
-- @param Core.Point#COORDINATE TargetCoord Coordinate of the target.
|
||||
-- @param #number WeaponBitType Weapon type.
|
||||
-- @param Core.Point#COORDINATE RefCoord Reference coordinate.
|
||||
-- @param #table SurfaceTypes Valid surfaces types of the coordinate. Default any (nil).
|
||||
-- @param #table SurfaceTypes (Optional) Valid surfaces types of the coordinate. Default any (nil).
|
||||
-- @return Core.Point#COORDINATE Coordinate in weapon range
|
||||
function OPSGROUP:GetCoordinateInRange(TargetCoord, WeaponBitType, RefCoord, SurfaceTypes)
|
||||
|
||||
@@ -1411,10 +1411,10 @@ end
|
||||
|
||||
--- Set LASER parameters.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Code Laser code. Default 1688.
|
||||
-- @param #boolean CheckLOS Check if lasing unit has line of sight to target coordinate. Default is `true`.
|
||||
-- @param #number Code (Optional) Laser code. Default 1688.
|
||||
-- @param #boolean CheckLOS (Optional) Check if lasing unit has line of sight to target coordinate. Default is `true`.
|
||||
-- @param #boolean IROff If true, then dont switch on the additional IR pointer.
|
||||
-- @param #number UpdateTime Time interval in seconds the beam gets up for moving targets. Default every 0.5 sec.
|
||||
-- @param #number UpdateTime (Optional) Time interval in seconds the beam gets up for moving targets. Default every 0.5 sec.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetLaser(Code, CheckLOS, IROff, UpdateTime)
|
||||
self.spot.Code=Code or 1688
|
||||
@@ -1473,10 +1473,10 @@ end
|
||||
|
||||
--- Add a weapon range for ARTY auftrag.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number RangeMin Minimum range in nautical miles. Default 0 NM.
|
||||
-- @param #number RangeMax Maximum range in nautical miles. Default 10 NM.
|
||||
-- @param #number BitType Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types.
|
||||
-- @param #function ConversionToMeters Function that converts input units of ranges to meters. Defaul `UTILS.NMToMeters`.
|
||||
-- @param #number RangeMin (Optional) Minimum range in nautical miles. Default 0 NM.
|
||||
-- @param #number RangeMax (Optional) Maximum range in nautical miles. Default 10 NM.
|
||||
-- @param #number BitType (Optional) Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types.
|
||||
-- @param #function ConversionToMeters (Optional) Function that converts input units of ranges to meters. Defaul `UTILS.NMToMeters`.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:AddWeaponRange(RangeMin, RangeMax, BitType, ConversionToMeters)
|
||||
|
||||
@@ -1536,8 +1536,8 @@ end
|
||||
|
||||
--- Get highest detected threat. Detection must be turned on. The threat level is a number between 0 and 10, where 0 is the lowest, e.g. unarmed units.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number ThreatLevelMin Only consider threats with level greater or equal to this number. Default 1 (so unarmed units wont be considered).
|
||||
-- @param #number ThreatLevelMax Only consider threats with level smaller or queal to this number. Default 10.
|
||||
-- @param #number ThreatLevelMin (Optional) Only consider threats with level greater or equal to this number. Default 1 (so unarmed units wont be considered).
|
||||
-- @param #number ThreatLevelMax (Optional) Only consider threats with level smaller or queal to this number. Default 10.
|
||||
-- @return Wrapper.Unit#UNIT Highest threat unit detected by the group or `nil` if no threat is currently detected.
|
||||
-- @return #number Threat level.
|
||||
function OPSGROUP:GetThreat(ThreatLevelMin, ThreatLevelMax)
|
||||
@@ -1593,10 +1593,10 @@ end
|
||||
|
||||
--- Enable to automatically engage detected targets.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number RangeMax Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM.
|
||||
-- @param #table TargetTypes Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All".
|
||||
-- @param Core.Set#SET_ZONE EngageZoneSet Set of zones in which targets are engaged. Default is anywhere.
|
||||
-- @param Core.Set#SET_ZONE NoEngageZoneSet Set of zones in which targets are *not* engaged. Default is nowhere.
|
||||
-- @param #number RangeMax (Optional) Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM.
|
||||
-- @param #table TargetTypes (Optional) Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All".
|
||||
-- @param Core.Set#SET_ZONE EngageZoneSet (Optional) Set of zones in which targets are engaged. Default is anywhere.
|
||||
-- @param Core.Set#SET_ZONE NoEngageZoneSet (Optional) Set of zones in which targets are *not* engaged. Default is nowhere.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetEngageDetectedOn(RangeMax, TargetTypes, EngageZoneSet, NoEngageZoneSet)
|
||||
|
||||
@@ -1783,7 +1783,7 @@ end
|
||||
|
||||
--- Get MOOSE UNIT object.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number UnitNumber Number of the unit in the group. Default first unit.
|
||||
-- @param #number UnitNumber (Optional) Number of the unit in the group. Default first unit.
|
||||
-- @return Wrapper.Unit#UNIT The MOOSE UNIT object.
|
||||
function OPSGROUP:GetUnit(UnitNumber)
|
||||
|
||||
@@ -1799,7 +1799,7 @@ end
|
||||
|
||||
--- Get DCS GROUP object.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number UnitNumber Number of the unit in the group. Default first unit.
|
||||
-- @param #number UnitNumber (Optional) Number of the unit in the group. Default first unit.
|
||||
-- @return DCS#Unit DCS group object.
|
||||
function OPSGROUP:GetDCSUnit(UnitNumber)
|
||||
|
||||
@@ -2059,8 +2059,8 @@ end
|
||||
--- Despawn a unit of the group. A "Remove Unit" event is generated by default.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit
|
||||
-- @param #number Delay Delay in seconds before the group will be despawned. Default immediately.
|
||||
-- @param #boolean NoEventRemoveUnit If true, no event "Remove Unit" is generated.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately.
|
||||
-- @param #boolean NoEventRemoveUnit (Optional) If true, no event "Remove Unit" is generated.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:DespawnUnit(UnitName, Delay, NoEventRemoveUnit)
|
||||
|
||||
@@ -2096,8 +2096,8 @@ end
|
||||
--- Despawn an element/unit of the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #OPSGROUP.Element Element The element that will be despawned.
|
||||
-- @param #number Delay Delay in seconds before the element will be despawned. Default immediately.
|
||||
-- @param #boolean NoEventRemoveUnit If true, no event "Remove Unit" is generated.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the element will be despawned. Default immediately.
|
||||
-- @param #boolean NoEventRemoveUnit (Optional) If true, no event "Remove Unit" is generated.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:DespawnElement(Element, Delay, NoEventRemoveUnit)
|
||||
|
||||
@@ -2133,7 +2133,7 @@ end
|
||||
-- If no `Remove Unit` event should be generated, the second optional parameter needs to be set to `true`.
|
||||
-- If this group belongs to an AIRWING, BRIGADE or FLEET, it will be added to the warehouse stock if the `NoEventRemoveUnit` parameter is `false` or `nil`.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before the group will be despawned. Default immediately.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately.
|
||||
-- @param #boolean NoEventRemoveUnit If `true`, **no** event "Remove Unit" is generated.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:Despawn(Delay, NoEventRemoveUnit)
|
||||
@@ -2176,7 +2176,7 @@ end
|
||||
--- Return group back to the legion it belongs to.
|
||||
-- Group is despawned and added back to the stock.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before the group will be despawned. Default immediately
|
||||
-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:ReturnToLegion(Delay)
|
||||
|
||||
@@ -2200,7 +2200,7 @@ end
|
||||
--- Destroy a unit of the group. A *Unit Lost* for aircraft or *Dead* event for ground/naval units is generated.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit which should be destroyed.
|
||||
-- @param #number Delay Delay in seconds before the group will be destroyed. Default immediately.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the group will be destroyed. Default immediately.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:DestroyUnit(UnitName, Delay)
|
||||
|
||||
@@ -2232,7 +2232,7 @@ end
|
||||
|
||||
--- Destroy group. The whole group is despawned and a *Unit Lost* for aircraft or *Dead* event for ground/naval units is generated for all current units.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before the group will be destroyed. Default immediately.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the group will be destroyed. Default immediately.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:Destroy(Delay)
|
||||
|
||||
@@ -2316,9 +2316,9 @@ end
|
||||
|
||||
--- Self destruction of group. An explosion is created at the position of each element.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds. Default now.
|
||||
-- @param #number Delay (Optional) Delay in seconds. Default now.
|
||||
-- @param #number ExplosionPower (Optional) Explosion power in kg TNT. Default 100 kg.
|
||||
-- @param #string ElementName Name of the element that should be destroyed. Default is all elements.
|
||||
-- @param #string ElementName (Optional) Name of the element that should be destroyed. Default is all elements.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SelfDestruction(Delay, ExplosionPower, ElementName)
|
||||
|
||||
@@ -2348,15 +2348,17 @@ end
|
||||
--- Use SRS Simple-Text-To-Speech for transmissions.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string PathToSRS Path to SRS directory.
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port SRS port. Default 5002.
|
||||
-- @param #string PathToGoogleKey Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`.
|
||||
-- @param #string Label Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed!
|
||||
-- @param #number Volume Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0
|
||||
-- @param #string Gender (Optional) Gender: "male" or "female" (default).
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice (Optional) Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port (Optional) SRS port. Default 5002.
|
||||
-- @param #string PathToGoogleKey (Optional) Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`.
|
||||
-- @param #string Label (Optional) Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed!
|
||||
-- @param #number Volume (Optional) Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume)
|
||||
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume,Provider,Speaker)
|
||||
self.useSRS=true
|
||||
local path = PathToSRS or MSRS.path
|
||||
local port = Port or MSRS.port
|
||||
@@ -2364,12 +2366,18 @@ function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKe
|
||||
self.msrs:SetGender(Gender)
|
||||
self.msrs:SetCulture(Culture)
|
||||
self.msrs:SetVoice(Voice)
|
||||
if Speaker then
|
||||
self.msrs:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.msrs:SetPort(port)
|
||||
self.msrs:SetLabel(Label)
|
||||
if PathToGoogleKey then
|
||||
self.msrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrs:SetProvider(Provider)
|
||||
end
|
||||
self.msrs:SetCoalition(self:GetCoalition())
|
||||
self.msrs:SetVolume(Volume)
|
||||
return self
|
||||
@@ -2379,8 +2387,8 @@ end
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string Text Text of transmission.
|
||||
-- @param #number Delay Delay in seconds before the transmission is started.
|
||||
-- @param #boolean SayCallsign If `true`, the callsign is prepended to the given text. Default `false`.
|
||||
-- @param #number Frequency Override sender frequency, helpful when you need multiple radios from the same sender. Default is the frequency set for the OpsGroup.
|
||||
-- @param #boolean SayCallsign (Optional) If `true`, the callsign is prepended to the given text. Default `false`.
|
||||
-- @param #number Frequency (Optional) Override sender frequency, helpful when you need multiple radios from the same sender. Default is the frequency set for the OpsGroup.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign, Frequency)
|
||||
|
||||
@@ -2421,8 +2429,8 @@ end
|
||||
|
||||
--- Set that this carrier is an all aspect loader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierLoaderAllAspect(Length, Width)
|
||||
self.carrierLoader.type="front"
|
||||
@@ -2433,8 +2441,8 @@ end
|
||||
|
||||
--- Set that this carrier is a front loader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierLoaderFront(Length, Width)
|
||||
self.carrierLoader.type="front"
|
||||
@@ -2445,8 +2453,8 @@ end
|
||||
|
||||
--- Set that this carrier is a back loader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierLoaderBack(Length, Width)
|
||||
self.carrierLoader.type="back"
|
||||
@@ -2457,8 +2465,8 @@ end
|
||||
|
||||
--- Set that this carrier is a starboard (right side) loader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierLoaderStarboard(Length, Width)
|
||||
self.carrierLoader.type="right"
|
||||
@@ -2469,8 +2477,8 @@ end
|
||||
|
||||
--- Set that this carrier is a port (left side) loader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierLoaderPort(Length, Width)
|
||||
self.carrierLoader.type="left"
|
||||
@@ -2482,8 +2490,8 @@ end
|
||||
|
||||
--- Set that this carrier is an all aspect unloader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierUnloaderAllAspect(Length, Width)
|
||||
self.carrierUnloader.type="front"
|
||||
@@ -2494,8 +2502,8 @@ end
|
||||
|
||||
--- Set that this carrier is a front unloader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierUnloaderFront(Length, Width)
|
||||
self.carrierUnloader.type="front"
|
||||
@@ -2506,8 +2514,8 @@ end
|
||||
|
||||
--- Set that this carrier is a back unloader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierUnloaderBack(Length, Width)
|
||||
self.carrierUnloader.type="back"
|
||||
@@ -2518,8 +2526,8 @@ end
|
||||
|
||||
--- Set that this carrier is a starboard (right side) unloader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierUnloaderStarboard(Length, Width)
|
||||
self.carrierUnloader.type="right"
|
||||
@@ -2530,8 +2538,8 @@ end
|
||||
|
||||
--- Set that this carrier is a port (left side) unloader.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Length Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width Width of loading zone in meters. Default 20 m.
|
||||
-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m.
|
||||
-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetCarrierUnloaderPort(Length, Width)
|
||||
self.carrierUnloader.type="left"
|
||||
@@ -3076,7 +3084,7 @@ end
|
||||
|
||||
--- Mark waypoints on F10 map.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Duration Duration in seconds how long the waypoints are displayed before they are automatically removed. Default is that they are never removed.
|
||||
-- @param #number Duration (Optional) Duration in seconds how long the waypoints are displayed before they are automatically removed. Default is that they are never removed.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:MarkWaypoints(Duration)
|
||||
|
||||
@@ -3106,7 +3114,7 @@ end
|
||||
|
||||
--- Remove waypoints markers on the F10 map.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before the markers are removed. Default is immediately.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the markers are removed. Default is immediately.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:RemoveWaypointMarkers(Delay)
|
||||
|
||||
@@ -3196,8 +3204,8 @@ end
|
||||
|
||||
--- Get next waypoint index.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean cyclic If `true`, return first waypoint if last waypoint was reached. Default is patrol ad infinitum value set.
|
||||
-- @param #number i Waypoint index from which the next index is returned. Default is the last waypoint passed.
|
||||
-- @param #boolean cyclic (Optional) If `true`, return first waypoint if last waypoint was reached. Default is patrol ad infinitum value set.
|
||||
-- @param #number i (Optional) Waypoint index from which the next index is returned. Default is the last waypoint passed.
|
||||
-- @return #number Next waypoint index.
|
||||
function OPSGROUP:GetWaypointIndexNext(cyclic, i)
|
||||
|
||||
@@ -3232,7 +3240,7 @@ end
|
||||
|
||||
--- Get waypoint index after waypoint with given ID. So if the waypoint has index 3 it will return 4.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number uid Unique ID of the waypoint. Default is new waypoint index after the last current one.
|
||||
-- @param #number uid (Optional) Unique ID of the waypoint. Default is new waypoint index after the last current one.
|
||||
-- @return #number Index after waypoint with given ID.
|
||||
function OPSGROUP:GetWaypointIndexAfterID(uid)
|
||||
|
||||
@@ -3369,7 +3377,7 @@ end
|
||||
|
||||
--- Get distance to waypoint.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number indx Waypoint index. Default is the next waypoint.
|
||||
-- @param #number indx (Optional) Waypoint index. Default is the next waypoint.
|
||||
-- @return #number Distance in meters.
|
||||
function OPSGROUP:GetDistanceToWaypoint(indx)
|
||||
local dist=0
|
||||
@@ -3394,7 +3402,7 @@ end
|
||||
|
||||
--- Get time to waypoint based on current velocity.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number indx Waypoint index. Default is the next waypoint.
|
||||
-- @param #number indx (Optional) Waypoint index. Default is the next waypoint.
|
||||
-- @return #number Time in seconds. If velocity is 0
|
||||
function OPSGROUP:GetTimeToWaypoint(indx)
|
||||
|
||||
@@ -3847,10 +3855,10 @@ end
|
||||
--- Add a *scheduled* task.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #table task DCS task table structure.
|
||||
-- @param #string clock Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
|
||||
-- @param #string clock (Optional) Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
|
||||
-- @param #string description Brief text describing the task, e.g. "Attack SAM".
|
||||
-- @param #number prio Priority of the task.
|
||||
-- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @param #number prio (Optional) Priority of the task. Default is 50.
|
||||
-- @param #number duration (Optional) Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @return #OPSGROUP.Task The task structure.
|
||||
function OPSGROUP:AddTask(task, clock, description, prio, duration)
|
||||
|
||||
@@ -3869,10 +3877,10 @@ end
|
||||
--- Create a *scheduled* task.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #table task DCS task table structure.
|
||||
-- @param #string clock Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
|
||||
-- @param #string clock (Optional) Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
|
||||
-- @param #string description Brief text describing the task, e.g. "Attack SAM".
|
||||
-- @param #number prio Priority of the task.
|
||||
-- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @param #number prio (Optional) Priority of the task. Default is 50.
|
||||
-- @param #number duration (Optional) Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @return #OPSGROUP.Task The task structure.
|
||||
function OPSGROUP:NewTaskScheduled(task, clock, description, prio, duration)
|
||||
|
||||
@@ -3909,10 +3917,10 @@ end
|
||||
--- Add a *waypoint* task.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #table task DCS task table structure.
|
||||
-- @param #OPSGROUP.Waypoint Waypoint where the task is executed. Default is the at *next* waypoint.
|
||||
-- @param #OPSGROUP.Waypoint Waypoint (Optional) where the task is executed. Default is the at *next* waypoint.
|
||||
-- @param #string description Brief text describing the task, e.g. "Attack SAM".
|
||||
-- @param #number prio Priority of the task. Number between 1 and 100. Default is 50.
|
||||
-- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @param #number prio (Optional) Priority of the task. Number between 1 and 100. Default is 50.
|
||||
-- @param #number duration(Optional) Duration before task is cancelled in seconds counted after task started. Default never.
|
||||
-- @return #OPSGROUP.Task The task structure.
|
||||
function OPSGROUP:AddTaskWaypoint(task, Waypoint, description, prio, duration)
|
||||
|
||||
@@ -4767,7 +4775,7 @@ function OPSGROUP:_UpdateTask(Task, Mission)
|
||||
local tvec2=UTILS.Vec2Translate(vec2, distance, heading)
|
||||
|
||||
-- Debug info.
|
||||
self:T(self.lid..string.format("Barrage: Shots=%s, Altitude=%d m, Angle=%d°, heading=%03d°, distance=%d m", tostring(param.shots), Altitude, Alpha, heading, distance))
|
||||
self:T(self.lid..string.format("Barrage: Shots=%s, Altitude=%d m, Angle=%d°, heading=%03d°, distance=%d m", tostring(param.shots), Altitude, Alpha, heading, distance))
|
||||
|
||||
-- Set fire at point task.
|
||||
DCSTask=CONTROLLABLE.TaskFireAtPoint(nil, tvec2, param.radius, param.shots, param.weaponType, Altitude)
|
||||
@@ -4842,8 +4850,8 @@ end
|
||||
-- @param #OPSGROUP self
|
||||
-- @param DCS#Task DCSTask The DCS task.
|
||||
-- @param Ops.OpsGroup#OPSGROUP.Task Task
|
||||
-- @param #boolean SetTask Set task instead of pushing it.
|
||||
-- @param #number Delay Delay in seconds. Default nil.
|
||||
-- @param #boolean SetTask (Optional) Set task instead of pushing it. Default is to push it.
|
||||
-- @param #number Delay (Optional) Delay in seconds. Default nil.
|
||||
function OPSGROUP:_SandwitchDCSTask(DCSTask, Task, SetTask, Delay)
|
||||
|
||||
if Delay and Delay>0 then
|
||||
@@ -4896,7 +4904,7 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
-- @param #OPSGROUP.Task Task The task to cancel. Default is the current task (if any).
|
||||
-- @param #OPSGROUP.Task Task (Optional) The task to cancel. Default is the current task (if any).
|
||||
function OPSGROUP:onafterTaskCancel(From, Event, To, Task)
|
||||
|
||||
-- Get current task.
|
||||
@@ -5100,7 +5108,7 @@ function OPSGROUP:onafterTaskDone(From, Event, To, Task)
|
||||
|
||||
if Task.description=="Task_Land_At" then
|
||||
self:T(self.lid.."Taske DONE Task_Land_At ==> Wait")
|
||||
self:Cruise()
|
||||
-- After the land task, we set the helo to wait. This is because of an issue that the passing waypoint function is triggered immidiately if we do not do this!
|
||||
self:Wait(20, 100)
|
||||
else
|
||||
self:T(self.lid.."Task Done but NO mission found ==> _CheckGroupDone in 1 sec")
|
||||
@@ -5946,6 +5954,9 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
|
||||
-- Debug info.
|
||||
self:T(self.lid..string.format("Route To Mission"))
|
||||
|
||||
-- Delay in seconds before cruise or updateroute is called.
|
||||
local delayGo=-1
|
||||
|
||||
-- Catch dead or stopped groups.
|
||||
if self:IsDead() or self:IsStopped() then
|
||||
@@ -6150,7 +6161,65 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
elseif mission.type==AUFTRAG.Type.FREIGHTTRANSPORT then
|
||||
|
||||
---
|
||||
-- FREIGHTTRANSPORT
|
||||
---
|
||||
|
||||
local destination=mission.DCStask.params.destination
|
||||
local cargo=mission.DCStask.params.cargo
|
||||
|
||||
-- Set the waypoint coordinate directly above the airbase.
|
||||
-- The only way to ensure the cargo is delivered there, because when the task is executed, the cargo is delivered to the closest airbase.
|
||||
-- Hopefully, ED will change the behaviour of this task but at the moment, it is what it is.
|
||||
waypointcoord=destination:GetCoordinate()
|
||||
|
||||
-- Get additional parameters
|
||||
mission.DCStask.params.destination=destination --Wrapper.Airbase#AIRBASE
|
||||
mission.DCStask.params.cargo=cargo --Core.Set#SET_STATIC
|
||||
|
||||
-- Get transport unit
|
||||
local unit=self.group:GetFirstUnit()
|
||||
local unitIdTransport=unit:GetID()
|
||||
local vec2=unit:GetVec2()
|
||||
|
||||
-- Create tasks to load/transport statics cargos
|
||||
local tasks={}
|
||||
for StaticName, StaticObject in pairs(cargo:GetSet()) do
|
||||
local static=StaticObject --Wrapper.Static#STATIC
|
||||
|
||||
-- Task to transport cargo.
|
||||
local TaskCargoTransportation={
|
||||
id = "CargoTransportationPlane",
|
||||
params = {
|
||||
x=vec2.x,
|
||||
y=vec2.y,
|
||||
unitIdTransport=unitIdTransport,
|
||||
groupId=static:GetID(),
|
||||
unitId=static:GetID(),
|
||||
}
|
||||
}
|
||||
|
||||
table.insert(tasks, TaskCargoTransportation)
|
||||
end
|
||||
|
||||
-- If we have multiple tasks, we create a combo task
|
||||
local TaskCargo=nil
|
||||
if #tasks==1 then
|
||||
TaskCargo=tasks[1]
|
||||
else
|
||||
TaskCargo=CONTROLLABLE.TaskCombo(nil, tasks)
|
||||
end
|
||||
|
||||
-- We set the task to load the cargo into the aircraft.
|
||||
-- We must be careful when calling updateroute because there the task is overwritten.
|
||||
-- We also clear present "UpdateRoute" FSM events
|
||||
self:_ClearFSMEvent( "UpdateRoute" )
|
||||
delayGo=-50 --30 sec was not enough for CH-47 to load more than one cargo item
|
||||
self.group:SetTask(TaskCargo)
|
||||
|
||||
elseif mission.type==AUFTRAG.Type.ARTY then
|
||||
|
||||
---
|
||||
@@ -6309,7 +6378,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
elseif self:IsNavygroup() then
|
||||
self:Cruise(SpeedToMission)
|
||||
elseif self:IsFlightgroup() then
|
||||
self:UpdateRoute()
|
||||
self:__UpdateRoute(delayGo)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7711,8 +7780,8 @@ end
|
||||
--- Teleport the group to a different location.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate where the group is teleported to.
|
||||
-- @param #number Delay Delay in seconds before respawn happens. Default 0.
|
||||
-- @param #boolean NoPauseMission If `true`, dont pause a running mission.
|
||||
-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0.
|
||||
-- @param #boolean NoPauseMission (Optional) If `true`, dont pause a running mission.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:Teleport(Coordinate, Delay, NoPauseMission)
|
||||
|
||||
@@ -7800,9 +7869,9 @@ end
|
||||
|
||||
--- Respawn the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before respawn happens. Default 0.
|
||||
-- @param DCS#Template Template (optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself.
|
||||
-- @param #boolean Reset Reset waypoints and reinit group if `true`.
|
||||
-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0.
|
||||
-- @param DCS#Template Template (Optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself.
|
||||
-- @param #boolean Reset (Optional) Reset waypoints and reinit group if `true`.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:_Respawn(Delay, Template, Reset)
|
||||
|
||||
@@ -7895,8 +7964,8 @@ end
|
||||
|
||||
--- Spawn group from a given template.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Delay Delay in seconds before respawn happens. Default 0.
|
||||
-- @param DCS#Template Template (optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself.
|
||||
-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0.
|
||||
-- @param DCS#Template Template (Optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:_Spawn(Delay, Template)
|
||||
if Delay and Delay>0 then
|
||||
@@ -8331,7 +8400,8 @@ function OPSGROUP:_CheckCargoTransport()
|
||||
end
|
||||
|
||||
-- Boarding finished ==> Transport cargo.
|
||||
if gotcargo and self.cargoTransport:_CheckRequiredCargos(self.cargoTZC, self) and not boarding then
|
||||
local required=self.cargoTransport:_CheckRequiredCargos(self.cargoTZC, self)
|
||||
if gotcargo and required and not boarding then
|
||||
self:T(self.lid.."Boarding/loading finished ==> Loaded")
|
||||
self.Tloading=nil
|
||||
self:LoadingDone()
|
||||
@@ -8898,8 +8968,8 @@ end
|
||||
|
||||
--- Get total weight of the group including cargo. Optionally, the total weight of a specific unit can be requested.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @return #number Total weight in kg.
|
||||
function OPSGROUP:GetWeightTotal(UnitName, IncludeReserved)
|
||||
|
||||
@@ -8934,8 +9004,8 @@ end
|
||||
|
||||
--- Get free cargo bay weight.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @return #number Free cargo bay in kg.
|
||||
function OPSGROUP:GetFreeCargobay(UnitName, IncludeReserved)
|
||||
|
||||
@@ -8956,8 +9026,8 @@ end
|
||||
|
||||
--- Get relative free cargo bay in percent.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @return #number Free cargo bay in percent.
|
||||
function OPSGROUP:GetFreeCargobayRelative(UnitName, IncludeReserved)
|
||||
|
||||
@@ -8972,8 +9042,8 @@ end
|
||||
|
||||
--- Get relative used (loaded) cargo bay in percent.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @return #number Used cargo bay in percent.
|
||||
function OPSGROUP:GetUsedCargobayRelative(UnitName, IncludeReserved)
|
||||
local free=self:GetFreeCargobayRelative(UnitName, IncludeReserved)
|
||||
@@ -9013,8 +9083,8 @@ end
|
||||
|
||||
--- Get weight of the internal cargo the group is carriing right now.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included.
|
||||
-- @return #number Cargo weight in kg.
|
||||
function OPSGROUP:GetWeightCargo(UnitName, IncludeReserved)
|
||||
|
||||
@@ -9063,7 +9133,7 @@ end
|
||||
|
||||
--- Get max weight of the internal cargo the group can carry. Optionally, the max cargo weight of a specific unit can be requested.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @return #number Max cargo weight in kg. This does **not** include any cargo loaded or reserved currently.
|
||||
function OPSGROUP:GetWeightCargoMax(UnitName)
|
||||
|
||||
@@ -9101,7 +9171,7 @@ end
|
||||
|
||||
--- Add weight to the internal cargo of an element of the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string UnitName Name of the unit. Default is of the whole group.
|
||||
-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group.
|
||||
-- @param #number Weight Cargo weight to be added in kg.
|
||||
function OPSGROUP:AddWeightCargo(UnitName, Weight)
|
||||
|
||||
@@ -9967,6 +10037,10 @@ function OPSGROUP:onafterTransport(From, Event, To)
|
||||
self:T(self.lid.."ERROR: No current task but landed at?!")
|
||||
end
|
||||
end
|
||||
|
||||
if self:IsWaiting() then
|
||||
self:__Cruise(-10)
|
||||
end
|
||||
|
||||
elseif self:IsArmygroup() then
|
||||
|
||||
@@ -11463,7 +11537,7 @@ end
|
||||
--- Initialize Mission Editor waypoints.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #OPSGROUP.Waypoint waypoint Waypoint data.
|
||||
-- @param #number wpnumber Waypoint index/number. Default is as last waypoint.
|
||||
-- @param #number wpnumber (Optional) Waypoint index/number. Default is as last waypoint.
|
||||
function OPSGROUP:_AddWaypoint(waypoint, wpnumber)
|
||||
|
||||
-- Index.
|
||||
@@ -11933,7 +12007,7 @@ end
|
||||
|
||||
--- Set the default ROE for the group. This is the ROE state gets when the group is spawned or to which it defaults back after a mission.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number roe ROE of group. Default is `ENUMS.ROE.ReturnFire`.
|
||||
-- @param #number roe (Optional) ROE of group. Default is `ENUMS.ROE.ReturnFire`.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultROE(roe)
|
||||
self.optionDefault.ROE=roe or ENUMS.ROE.ReturnFire
|
||||
@@ -11942,7 +12016,7 @@ end
|
||||
|
||||
--- Set current ROE for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string roe ROE of group. Default is value set in `SetDefaultROE` (usually `ENUMS.ROE.ReturnFire`).
|
||||
-- @param #string roe (Optional) ROE of group. Default is value set in `SetDefaultROE` (usually `ENUMS.ROE.ReturnFire`).
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchROE(roe)
|
||||
|
||||
@@ -11995,7 +12069,7 @@ end
|
||||
|
||||
--- Set the default ROT for the group. This is the ROT state gets when the group is spawned or to which it defaults back after a mission.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number rot ROT of group. Default is `ENUMS.ROT.PassiveDefense`.
|
||||
-- @param #number rot (Optional) ROT of group. Default is `ENUMS.ROT.PassiveDefense`.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultROT(rot)
|
||||
self.optionDefault.ROT=rot or ENUMS.ROT.PassiveDefense
|
||||
@@ -12004,7 +12078,7 @@ end
|
||||
|
||||
--- Set ROT for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string rot ROT of group. Default is value set in `:SetDefaultROT` (usually `ENUMS.ROT.PassiveDefense`).
|
||||
-- @param #string rot (Optional) ROT of group. Default is value set in `:SetDefaultROT` (usually `ENUMS.ROT.PassiveDefense`).
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchROT(rot)
|
||||
|
||||
@@ -12044,7 +12118,7 @@ end
|
||||
|
||||
--- Set the default Alarm State for the group. This is the state gets when the group is spawned or to which it defaults back after a mission.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number alarmstate Alarm state of group. Default is `AI.Option.Ground.val.ALARM_STATE.AUTO` (0).
|
||||
-- @param #number alarmstate (Optional) Alarm state of group. Default is `AI.Option.Ground.val.ALARM_STATE.AUTO` (0).
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultAlarmstate(alarmstate)
|
||||
self.optionDefault.Alarm=alarmstate or 0
|
||||
@@ -12058,7 +12132,7 @@ end
|
||||
-- * 2 = "Red"
|
||||
--
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number alarmstate Alarm state of group. Default is 0="Auto".
|
||||
-- @param #number alarmstate (Optional) Alarm state of group. Default is 0="Auto".
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchAlarmstate(alarmstate)
|
||||
|
||||
@@ -12105,7 +12179,7 @@ end
|
||||
|
||||
--- Set the default EPLRS for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean OnOffSwitch If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink.
|
||||
-- @param #boolean OnOffSwitch (Optional) If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultEPLRS(OnOffSwitch)
|
||||
|
||||
@@ -12160,7 +12234,7 @@ end
|
||||
|
||||
--- Set the default emission state for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean OnOffSwitch If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink.
|
||||
-- @param #boolean OnOffSwitch (Optional) If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultEmission(OnOffSwitch)
|
||||
|
||||
@@ -12215,7 +12289,7 @@ end
|
||||
|
||||
--- Set the default invisible for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean OnOffSwitch If `true`, group is ivisible by default.
|
||||
-- @param #boolean OnOffSwitch (Optional) If `true`, group is ivisible by default.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultInvisible(OnOffSwitch)
|
||||
|
||||
@@ -12264,7 +12338,7 @@ end
|
||||
|
||||
--- Set the default immortal for the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #boolean OnOffSwitch If `true`, group is immortal by default.
|
||||
-- @param #boolean OnOffSwitch (Optional) If `true`, group is immortal by default.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultImmortal(OnOffSwitch)
|
||||
|
||||
@@ -12316,11 +12390,11 @@ end
|
||||
|
||||
--- Set default TACAN parameters.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Channel TACAN channel. Default is 74.
|
||||
-- @param #string Morse Morse code. Default "XXX".
|
||||
-- @param #number Channel (Optional) TACAN channel. Default is 74.
|
||||
-- @param #string Morse(Optional) Morse code. Default "XXX".
|
||||
-- @param #string UnitName Name of the unit acting as beacon.
|
||||
-- @param #string Band TACAN mode. Default is "X" for ground and "Y" for airborne units.
|
||||
-- @param #boolean OffSwitch If true, TACAN is off by default.
|
||||
-- @param #string Band (Optional) TACAN mode. Default is "X" for ground and "Y" for airborne units.
|
||||
-- @param #boolean OffSwitch (Optional) If true, TACAN is off by default.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultTACAN(Channel, Morse, UnitName, Band, OffSwitch)
|
||||
|
||||
@@ -12349,7 +12423,7 @@ end
|
||||
|
||||
--- Activate/switch TACAN beacon settings.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #OPSGROUP.Beacon Tacan TACAN data table. Default is the default TACAN settings.
|
||||
-- @param #OPSGROUP.Beacon Tacan (Optional) TACAN data table. Default is the default TACAN settings.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:_SwitchTACAN(Tacan)
|
||||
|
||||
@@ -12372,9 +12446,9 @@ end
|
||||
--- Activate/switch TACAN beacon settings.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Channel TACAN Channel.
|
||||
-- @param #string Morse TACAN morse code. Default is the value set in @{#OPSGROUP.SetDefaultTACAN} or if not set "XXX".
|
||||
-- @param #string UnitName Name of the unit in the group which should activate the TACAN beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
|
||||
-- @param #string Band TACAN channel mode "X" or "Y". Default is "Y" for aircraft and "X" for ground and naval groups.
|
||||
-- @param #string Morse (Optional) TACAN morse code. Default is the value set in @{#OPSGROUP.SetDefaultTACAN} or if not set "XXX".
|
||||
-- @param #string UnitName (Optional) Name of the unit in the group which should activate the TACAN beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
|
||||
-- @param #string Band (Optional) TACAN channel mode "X" or "Y". Default is "Y" for aircraft and "X" for ground and naval groups.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchTACAN(Channel, Morse, UnitName, Band)
|
||||
|
||||
@@ -12481,10 +12555,10 @@ end
|
||||
|
||||
--- Set default ICLS parameters.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Channel ICLS channel. Default is 1.
|
||||
-- @param #string Morse Morse code. Default "XXX".
|
||||
-- @param #number Channel (Optional) ICLS channel. Default is 1.
|
||||
-- @param #string Morse (Optional) Morse code. Default "XXX".
|
||||
-- @param #string UnitName Name of the unit acting as beacon.
|
||||
-- @param #boolean OffSwitch If true, TACAN is off by default.
|
||||
-- @param #boolean OffSwitch (Optional) If true, TACAN is off by default.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultICLS(Channel, Morse, UnitName, OffSwitch)
|
||||
|
||||
@@ -12527,9 +12601,9 @@ end
|
||||
|
||||
--- Activate/switch ICLS beacon settings.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Channel ICLS Channel. Default is what is set in `SetDefaultICLS()` so usually channel 1.
|
||||
-- @param #string Morse ICLS morse code. Default is what is set in `SetDefaultICLS()` so usually "XXX".
|
||||
-- @param #string UnitName Name of the unit in the group which should activate the ICLS beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
|
||||
-- @param #number Channel (Optional) ICLS Channel. Default is what is set in `SetDefaultICLS()` so usually channel 1.
|
||||
-- @param #string Morse (Optional) ICLS morse code. Default is what is set in `SetDefaultICLS()` so usually "XXX".
|
||||
-- @param #string UnitName (Optional) Name of the unit in the group which should activate the ICLS beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchICLS(Channel, Morse, UnitName)
|
||||
|
||||
@@ -12603,9 +12677,9 @@ end
|
||||
|
||||
--- Set default Radio frequency and modulation.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Frequency Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #boolean OffSwitch If true, radio is OFF by default.
|
||||
-- @param #number Frequency (Optional) Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #boolean OffSwitch (Optional) If true, radio is OFF by default.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultRadio(Frequency, Modulation, OffSwitch)
|
||||
|
||||
@@ -12632,8 +12706,8 @@ end
|
||||
|
||||
--- Turn radio on or switch frequency/modulation.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Frequency Radio frequency in MHz. Default is value set in `SetDefaultRadio` (usually 251 MHz).
|
||||
-- @param #number Modulation Radio modulation. Default is value set in `SetDefaultRadio` (usually `radio.modulation.AM`).
|
||||
-- @param #number Frequency (Optional) Radio frequency in MHz. Default is value set in `SetDefaultRadio` (usually 251 MHz).
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default is value set in `SetDefaultRadio` (usually `radio.modulation.AM`).
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchRadio(Frequency, Modulation)
|
||||
|
||||
@@ -12712,7 +12786,7 @@ end
|
||||
|
||||
--- Switch to a specific formation.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number Formation New formation the group will fly in. Default is the setting of `SetDefaultFormation()`.
|
||||
-- @param #number Formation (Optional) New formation the group will fly in. Default is the setting of `SetDefaultFormation()`.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SwitchFormation(Formation)
|
||||
|
||||
@@ -12749,7 +12823,7 @@ end
|
||||
--- Set default callsign.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number CallsignName Callsign name.
|
||||
-- @param #number CallsignNumber Callsign number. Default 1.
|
||||
-- @param #number CallsignNumber (Optional) Callsign number. Default 1.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetDefaultCallsign(CallsignName, CallsignNumber)
|
||||
|
||||
@@ -13474,7 +13548,7 @@ end
|
||||
--- Get the number of shells a unit or group currently has. For a group the ammo count of all units is summed up.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param Wrapper.Unit#UNIT unit The unit object.
|
||||
-- @param #boolean display Display ammo table as message to all. Default false.
|
||||
-- @param #boolean display (Optional) Display ammo table as message to all. Default false.
|
||||
-- @return #OPSGROUP.Ammo Ammo data.
|
||||
function OPSGROUP:GetAmmoUnit(unit, display)
|
||||
|
||||
@@ -13909,7 +13983,7 @@ end
|
||||
|
||||
--- Set the template of the group.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #table Template Template to set. Default is from the GROUP.
|
||||
-- @param #table Template (Optional) Template to set. Default is from the GROUP.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:_SetTemplate(Template)
|
||||
|
||||
@@ -13946,8 +14020,8 @@ end
|
||||
|
||||
--- Clear waypoints.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number IndexMin Clear waypoints up to this min WP index. Default 1.
|
||||
-- @param #number IndexMax Clear waypoints up to this max WP index. Default `#self.waypoints`.
|
||||
-- @param #number IndexMin (Optional) Clear waypoints up to this min WP index. Default 1.
|
||||
-- @param #number IndexMax (Optional) Clear waypoints up to this max WP index. Default `#self.waypoints`.
|
||||
function OPSGROUP:ClearWaypoints(IndexMin, IndexMax)
|
||||
|
||||
IndexMin=IndexMin or 1
|
||||
|
||||
@@ -244,7 +244,7 @@ _OPSTRANSPORTID=0
|
||||
|
||||
--- Army Group version.
|
||||
-- @field #string version
|
||||
OPSTRANSPORT.version="0.8.0"
|
||||
OPSTRANSPORT.version="0.9.0"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -566,7 +566,7 @@ end
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param Core.Set#SET_GROUP GroupSet Set of groups to be transported. Can also be passed as a single GROUP or OPSGROUP object.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo.
|
||||
-- @param #boolean DisembarkActivation If `true`, cargo group is activated when disembarked. If `false`, cargo groups are late activated when disembarked. Default `nil` (usually activated).
|
||||
-- @param #boolean DisembarkActivation (Optional) If `true`, cargo group is activated when disembarked. If `false`, cargo groups are late activated when disembarked. Default `nil` (usually activated).
|
||||
-- @param Core.Zone#ZONE DisembarkZone Zone where the groups disembark to.
|
||||
-- @param Core.Set#SET_OPSGROUP DisembarkCarriers Carrier groups where the cargo directly disembarks to.
|
||||
-- @return #OPSTRANSPORT self
|
||||
@@ -644,8 +644,8 @@ end
|
||||
-- @param Wrapper.Storage#STORAGE StorageTo Storage warehouse to which the cargo is delivered.
|
||||
-- @param #string CargoType Type of cargo, *e.g.* `"weapons.bombs.Mk_84"` or liquid type as #number.
|
||||
-- @param #number CargoAmount Amount of cargo. Liquids in kg.
|
||||
-- @param #number CargoWeight Weight of a single cargo item in kg. Default 1 kg.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo if other than default.
|
||||
-- @param #number CargoWeight (Optional) Weight of a single cargo item in kg. Default 1 kg.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo (Optional) Transport zone combo if other than default.
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:AddCargoStorage(StorageFrom, StorageTo, CargoType, CargoAmount, CargoWeight, TransportZoneCombo)
|
||||
|
||||
@@ -1052,8 +1052,8 @@ end
|
||||
|
||||
--- Set number of required carrier groups for an OPSTRANSPORT assignment. Only used if transport is assigned at **LEGION** or higher level.
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param #number NcarriersMin Number of carriers *at least* required. Default 1.
|
||||
-- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`.
|
||||
-- @param #number NcarriersMin (Optional) Number of carriers *at least* required. Default 1.
|
||||
-- @param #number NcarriersMax (Optional) Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`.
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:SetRequiredCarriers(NcarriersMin, NcarriersMax)
|
||||
|
||||
@@ -1258,7 +1258,7 @@ end
|
||||
|
||||
--- Set transport start and stop time.
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param #string ClockStart Time the transport is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added.
|
||||
-- @param #string ClockStart (Optional) Time the transport is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added.
|
||||
-- @param #string ClockStop (Optional) Time the transport is stopped, e.g. "13:00" for 1 pm. If mission could not be started at that time, it will be removed from the queue. If specified as a #number it will be relative (in seconds) to the current mission time.
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:SetTime(ClockStart, ClockStop)
|
||||
@@ -1294,9 +1294,9 @@ end
|
||||
|
||||
--- Set mission priority and (optional) urgency. Urgent missions can cancel other running missions.
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param #number Prio Priority 1=high, 100=low. Default 50.
|
||||
-- @param #number Importance Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`.
|
||||
-- @param #boolean Urgent If *true*, another running mission might be cancelled if it has a lower priority.
|
||||
-- @param #number Prio (Optional) Priority 1=high, 100=low. Default 50.
|
||||
-- @param #number Importance (Optional) Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`.
|
||||
-- @param #boolean Urgent (Optional) If *true*, another running mission might be cancelled if it has a lower priority.
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:SetPriority(Prio, Importance, Urgent)
|
||||
self.prio=Prio or 50
|
||||
@@ -1307,7 +1307,7 @@ end
|
||||
|
||||
--- Set verbosity.
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param #number Verbosity Be more verbose. Default 0
|
||||
-- @param #number Verbosity (Optional) Be more verbose. Default 0
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:SetVerbosity(Verbosity)
|
||||
self.verbose=Verbosity or 0
|
||||
@@ -1345,8 +1345,8 @@ end
|
||||
-- path.
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param Wrapper.Group#GROUP PathGroup A (late activated) GROUP defining a transport path by their waypoints.
|
||||
-- @param #number Radius Randomization radius in meters. Default 0 m.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport Zone combo.
|
||||
-- @param #number Radius (Optional) Randomization radius in meters. Default 0 m.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo (Optional) Transport Zone combo.
|
||||
-- @return #OPSTRANSPORT self
|
||||
function OPSTRANSPORT:AddPathTransport(PathGroup, Reversed, Radius, TransportZoneCombo)
|
||||
|
||||
@@ -1731,7 +1731,7 @@ end
|
||||
|
||||
--- Check if all cargo was delivered (or is dead).
|
||||
-- @param #OPSTRANSPORT self
|
||||
-- @param #number Nmin Number of groups that must be actually delivered (and are not dead). Default 0.
|
||||
-- @param #number Nmin (Optional) Number of groups that must be actually delivered (and are not dead). Default 0.
|
||||
-- @return #boolean If true, all possible cargo was delivered.
|
||||
function OPSTRANSPORT:IsDelivered(Nmin)
|
||||
local is=self:is(OPSTRANSPORT.Status.DELIVERED)
|
||||
@@ -2127,7 +2127,9 @@ function OPSTRANSPORT:_CheckRequiredCargos(TransportZoneCombo, CarrierGroup)
|
||||
requiredCargos={}
|
||||
for _,_cargo in pairs(TransportZoneCombo.Cargos) do
|
||||
local cargo=_cargo --Ops.OpsGroup#OPSGROUP.CargoGroup
|
||||
table.insert(requiredCargos, cargo.opsgroup)
|
||||
if not cargo.delivered then
|
||||
table.insert(requiredCargos, cargo.opsgroup)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2296,7 +2298,7 @@ end
|
||||
-- @param Wrapper.Storage#STORAGE StorageTo Storage to.
|
||||
-- @param #string CargoType Type of cargo.
|
||||
-- @param #number CargoAmount Total amount of cargo that should be transported. Liquids in kg.
|
||||
-- @param #number CargoWeight Weight of a single cargo item in kg. Default 1 kg.
|
||||
-- @param #number CargoWeight (Optional) Weight of a single cargo item in kg. Default 1 kg.
|
||||
-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo.
|
||||
-- @return Ops.OpsGroup#OPSGROUP.CargoGroup Cargo group data.
|
||||
function OPSTRANSPORT:_CreateCargoStorage(StorageFrom, StorageTo, CargoType, CargoAmount, CargoWeight, TransportZoneCombo)
|
||||
|
||||
@@ -121,7 +121,7 @@ OPSZONE.version="0.6.2"
|
||||
--- Create a new OPSZONE class object.
|
||||
-- @param #OPSZONE self
|
||||
-- @param Core.Zone#ZONE Zone The zone. Can be passed as ZONE\_RADIUS, ZONE_POLYGON, ZONE\_AIRBASE or simply as the name of the airbase.
|
||||
-- @param #number CoalitionOwner Initial owner of the coaliton. Default `coalition.side.NEUTRAL`.
|
||||
-- @param #number CoalitionOwner (Optional) Initial owner of the coaliton. Default `coalition.side.NEUTRAL`.
|
||||
-- @return #OPSZONE self
|
||||
-- @usage
|
||||
-- myopszone = OPSZONE:New(ZONE:FindByName("OpsZoneOne"), coalition.side.RED) -- base zone from the mission editor
|
||||
@@ -385,7 +385,7 @@ end
|
||||
|
||||
--- Set verbosity level.
|
||||
-- @param #OPSZONE self
|
||||
-- @param #number VerbosityLevel Level of output (higher=more). Default 0.
|
||||
-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetVerbosity(VerbosityLevel)
|
||||
self.verbose=VerbosityLevel or 0
|
||||
@@ -400,7 +400,7 @@ end
|
||||
-- Which units can capture zones can be further refined by `:SetUnitCategories()`.
|
||||
--
|
||||
-- @param #OPSZONE self
|
||||
-- @param #table Categories Object categories. Default is `{Object.Category.UNIT, Object.Category.STATIC}`.
|
||||
-- @param #table Categories (Optional) Object categories. Default is `{Object.Category.UNIT, Object.Category.STATIC}`.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetObjectCategories(Categories)
|
||||
|
||||
@@ -417,7 +417,7 @@ end
|
||||
|
||||
--- Set categories of units that can capture or hold the zone. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit).
|
||||
-- @param #OPSZONE self
|
||||
-- @param #table Categories Table of unit categories. Default `{Unit.Category.GROUND_UNIT}`.
|
||||
-- @param #table Categories (Optional) Table of unit categories. Default `{Unit.Category.GROUND_UNIT}`.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetUnitCategories(Categories)
|
||||
|
||||
@@ -435,7 +435,7 @@ end
|
||||
--- Set threat level threshold that the offending units must have to capture a zone.
|
||||
-- The reason why you might want to set this is that unarmed units (*e.g.* fuel trucks) should not be able to capture a zone as they do not pose a threat.
|
||||
-- @param #OPSZONE self
|
||||
-- @param #number Threatlevel Threat level threshold. Default 0.
|
||||
-- @param #number Threatlevel (Optional) Threat level threshold. Default 0.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetCaptureThreatlevel(Threatlevel)
|
||||
|
||||
@@ -446,7 +446,7 @@ end
|
||||
|
||||
--- Set how many units must be present in a zone to capture it. By default, one unit is enough.
|
||||
-- @param #OPSZONE self
|
||||
-- @param #number Nunits Number of units. Default 1.
|
||||
-- @param #number Nunits (Optional) Number of units. Default 1.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetCaptureNunits(Nunits)
|
||||
|
||||
@@ -460,7 +460,7 @@ end
|
||||
|
||||
--- Set time how long an attacking coalition must have troops inside a zone before it captures the zone.
|
||||
-- @param #OPSZONE self
|
||||
-- @param #number Tcapture Time in seconds. Default 0.
|
||||
-- @param #number Tcapture (Optional) Time in seconds. Default 0.
|
||||
-- @return #OPSZONE self
|
||||
function OPSZONE:SetCaptureTime(Tcapture)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ PLATOON.version="0.1.0"
|
||||
--- Create a new PLATOON object and start the FSM.
|
||||
-- @param #PLATOON self
|
||||
-- @param #string TemplateGroupName Name of the template group.
|
||||
-- @param #number Ngroups Number of asset groups of this platoon. Default 3.
|
||||
-- @param #number Ngroups (Optional) Number of asset groups of this platoon. Default 3.
|
||||
-- @param #string PlatoonName Name of the platoon. Must be **unique**!
|
||||
-- @return #PLATOON self
|
||||
function PLATOON:New(TemplateGroupName, Ngroups, PlatoonName)
|
||||
|
||||
@@ -1542,9 +1542,9 @@ end
|
||||
|
||||
--- [User] Set SRS TTS details - see @{Sound.SRS} for details
|
||||
-- @param #PLAYERRECCE self
|
||||
-- @param #number Frequency Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
|
||||
-- @param #number Modulation Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
|
||||
-- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #number Frequency (Optional) Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
|
||||
-- @param #number Modulation (Optional) Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
|
||||
-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #string Gender (Optional) Defaults to "male"
|
||||
-- @param #string Culture (Optional) Defaults to "en-US"
|
||||
-- @param #number Port (Optional) Defaults to 5002
|
||||
@@ -1552,9 +1552,11 @@ end
|
||||
-- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
|
||||
-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest)
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS
|
||||
-- @param #string Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC
|
||||
-- @param #string Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC etc
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #PLAYERRECCE self
|
||||
function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Backend)
|
||||
function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Backend,Provider,Speaker)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" --
|
||||
self.Gender = Gender or MSRS.gender or "male" --
|
||||
@@ -1582,6 +1584,9 @@ function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,V
|
||||
if self.PathToGoogleKey then
|
||||
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.PathToGoogleKey)
|
||||
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
-- Pre-configured Google?
|
||||
if (not PathToGoogleKey) and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
@@ -1589,6 +1594,9 @@ function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,V
|
||||
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||
end
|
||||
self.SRS:SetVoice(self.Voice)
|
||||
if Speaker then
|
||||
self.SRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
|
||||
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
||||
return self
|
||||
|
||||
@@ -115,9 +115,9 @@ PLAYERTASK.version="0.1.31"
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param Ops.Auftrag#AUFTRAG.Type Type Type of this task
|
||||
-- @param Ops.Target#TARGET Target Target for this task
|
||||
-- @param #boolean Repeat Repeat this task if true (default = false)
|
||||
-- @param #number Times Repeat on failure this many times if Repeat is true (default = 1)
|
||||
-- @param #string TTSType TTS friendly task type name
|
||||
-- @param #boolean Repeat (Optional) Repeat this task if true (default = false)
|
||||
-- @param #number Times (Optional) Repeat on failure this many times if Repeat is true (default = 1)
|
||||
-- @param #string TTSType (Optional) TTS friendly task type name. Defaultsto "close air support".
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType)
|
||||
|
||||
@@ -272,8 +272,8 @@ end
|
||||
--- Constructor that automatically determines the task type based on the target.
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param Ops.Target#TARGET Target Target for this task
|
||||
-- @param #boolean Repeat Repeat this task if true (default = false)
|
||||
-- @param #number Times Repeat on failure this many times if Repeat is true (default = 1)
|
||||
-- @param #boolean Repeat (Optional) Repeat this task if true (default = false)
|
||||
-- @param #number Times (Optional) Repeat on failure this many times if Repeat is true (default = 1)
|
||||
-- @param #string TTSType TTS friendly task type name
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:NewFromTarget(Target, Repeat, Times, TTSType)
|
||||
@@ -486,7 +486,7 @@ end
|
||||
|
||||
--- [USER] Set if a task can have a smoke marker.
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #boolean OnOff If true (default) it can be smoke, false if not.
|
||||
-- @param #boolean OnOff (Optional) If true (default) it can be smoke, false if not.
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:SetCanSmoke(OnOff)
|
||||
self:T(self.lid.."AddSSetCanSmokeubType")
|
||||
@@ -496,7 +496,7 @@ end
|
||||
|
||||
--- [USER] Set if a task can show threat details.
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #boolean OnOff If true (default) it can be shown, false if not.
|
||||
-- @param #boolean OnOff (Optional) If true (default) it can be shown, false if not.
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:SetShowThreatDetails(OnOff)
|
||||
self:T(self.lid.."SetShowThreatDetails")
|
||||
@@ -686,7 +686,7 @@ end
|
||||
|
||||
--- [USER] Adds a time limit for the task to be completed.
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #number TimeLimit Time limit in seconds for the task to be completed. (Default 0 = no time limit)
|
||||
-- @param #number TimeLimit (Optional) Time limit in seconds for the task to be completed. (Default 0 = no time limit)
|
||||
-- @return #PLAYERTASK self
|
||||
-- @usage
|
||||
-- local mytask = PLAYERTASK:New(AUFTRAG.Type.RECON, ZONE:New("WF Zone"), true, 50, "Deep Earth")
|
||||
@@ -892,7 +892,7 @@ end
|
||||
|
||||
--- [User] Smoke Target
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #number Color, defaults to SMOKECOLOR.Red
|
||||
-- @param #number Color (Optional) Color, defaults to SMOKECOLOR.Red
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:SmokeTarget(Color)
|
||||
self:T(self.lid.."SmokeTarget")
|
||||
@@ -911,7 +911,7 @@ end
|
||||
|
||||
--- [User] Flare Target
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #number Color, defaults to FLARECOLOR.Red
|
||||
-- @param #number Color (Optional) Color, defaults to FLARECOLOR.Red
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:FlareTarget(Color)
|
||||
self:T(self.lid.."SmokeTarget")
|
||||
@@ -927,8 +927,8 @@ end
|
||||
|
||||
--- [User] Illuminate Target Area
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #number Power Power of illumination bomb in Candela. Default 1000 cd.
|
||||
-- @param #number Height Height above target used to release the bomb, default 150m.
|
||||
-- @param #number Power (Optional) Power of illumination bomb in Candela. Default 1000 cd.
|
||||
-- @param #number Height (Optional) Height above target used to release the bomb, default 150m.
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:IlluminateTarget(Power,Height)
|
||||
self:T(self.lid.."IlluminateTarget")
|
||||
@@ -2021,9 +2021,9 @@ PLAYERTASKCONTROLLER.version="0.1.73"
|
||||
--- Create and run a new TASKCONTROLLER instance.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #string Name Name of this controller
|
||||
-- @param #number Coalition of this controller, e.g. coalition.side.BLUE
|
||||
-- @param #string Type Type of the tasks controlled, defaults to PLAYERTASKCONTROLLER.Type.A2G
|
||||
-- @param #string ClientFilter (optional) Additional prefix filter for the SET_CLIENT. Can be handed as @{Core.Set#SET_CLIENT} also.
|
||||
-- @param #number Coalition (Optional) Coalition of this controller. Defaults to coalition.side.BLUE
|
||||
-- @param #string Type (Optional) Type of the tasks controlled, defaults to PLAYERTASKCONTROLLER.Type.A2G
|
||||
-- @param #string ClientFilter (Optional) Additional prefix filter for the SET_CLIENT. Can be handed as @{Core.Set#SET_CLIENT} also.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter)
|
||||
|
||||
@@ -2317,7 +2317,7 @@ end
|
||||
|
||||
--- [User] Set flash directions option for player (player based info)
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off. Default is OFF.
|
||||
-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off. Default is OFF.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetAllowFlashDirection(OnOff)
|
||||
self:T(self.lid.."SetAllowFlashDirection")
|
||||
@@ -2327,7 +2327,7 @@ end
|
||||
|
||||
--- [User] Set to show a menu entry to retrieve the radio frequencies used.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off. Default is OFF.
|
||||
-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off. Default is OFF.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetShowRadioInfoMenu(OnOff)
|
||||
self:T(self.lid.."SetAllowRadioInfoMenu")
|
||||
@@ -2436,8 +2436,8 @@ end
|
||||
|
||||
--- [User] Set repetition options for tasks.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off (defaults to true)
|
||||
-- @param #number Repeats Number of repeats (defaults to 5)
|
||||
-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off (defaults to true)
|
||||
-- @param #number Repeats (Optional) Number of repeats (defaults to 5)
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
-- @usage `taskmanager:SetTaskRepetition(true, 5)`
|
||||
function PLAYERTASKCONTROLLER:SetTaskRepetition(OnOff, Repeats)
|
||||
@@ -2454,7 +2454,7 @@ end
|
||||
|
||||
--- [User] Set how long the briefing is shown on screen.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #number Seconds Duration in seconds. Defaults to 30 seconds.
|
||||
-- @param #number Seconds (Optional) Duration in seconds. Defaults to 30 seconds.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetBriefingDuration(Seconds)
|
||||
self:T(self.lid.."SetBriefingDuration")
|
||||
@@ -2484,7 +2484,7 @@ end
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP FlightGroup The FlightGroup (e.g. drone) to be used for lasing (one unit in one group only).
|
||||
-- Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - **Note** might not find an LOS spot or get lost on the way. Cannot island-hop.
|
||||
-- @param #number LaserCode The lasercode to be used. Defaults to 1688.
|
||||
-- @param #number LaserCode (Optional) The lasercode to be used. Defaults to 1688.
|
||||
-- @param Core.Point#COORDINATE HoldingPoint (Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition.
|
||||
-- @param #number Alt (Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000.
|
||||
-- @param #number Speed (Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120.
|
||||
@@ -2567,7 +2567,7 @@ end
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP FlightGroup The FlightGroup (e.g. drone) to be used for lasing (one unit in one group only).
|
||||
-- Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - **Note** might not find an LOS spot or get lost on the way. Cannot island-hop.
|
||||
-- @param #number LaserCode The lasercode to be used. Defaults to 1688.
|
||||
-- @param #number LaserCode (Optional) The lasercode to be used. Defaults to 1688.
|
||||
-- @param Core.Point#COORDINATE HoldingPoint (Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition.
|
||||
-- @param #number Alt (Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000.
|
||||
-- @param #number Speed (Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120.
|
||||
@@ -2704,8 +2704,8 @@ end
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean InfoMenu If `true` this option will allow to show the Task Info-Menu also when a player has an active task.
|
||||
-- Since the menu isn't refreshed if a player holds an active task, the info in there might be stale.
|
||||
-- @param #number ItemLimit Number of items per task type to show, default 5.
|
||||
-- @param #number HoldTime Minimum number of seconds between menu refreshes (called every 30 secs) if a player has **no active task**.
|
||||
-- @param #number ItemLimit (Optional) Number of items per task type to show, default 5.
|
||||
-- @param #number HoldTime (Optional) Minimum number of seconds between menu refreshes (called every 30 secs) if a player has **no active task**.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetMenuOptions(InfoMenu,ItemLimit,HoldTime)
|
||||
self:T(self.lid.."SetMenuOptions")
|
||||
@@ -2840,7 +2840,7 @@ end
|
||||
|
||||
--- [User] Set target radius. Determines the zone radius to distinguish CAS from BAI tasks and to find enemies if the TARGET object is a COORDINATE.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #number Radius Radius to use in meters. Defaults to 500 meters.
|
||||
-- @param #number Radius (Optional) Radius to use in meters. Defaults to 500 meters.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetTargetRadius(Radius)
|
||||
self:T(self.lid.."SetTargetRadius")
|
||||
@@ -2851,7 +2851,7 @@ end
|
||||
--- [User] Set the cluster radius if you want to use target clusters rather than single group detection.
|
||||
-- Note that for a controller type A2A target clustering is on by default. Also remember that the diameter of the resulting zone is double the radius.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #number Radius Target cluster radius in kilometers. Default is 0.5km.
|
||||
-- @param #number Radius (Optional) Target cluster radius in kilometers. Default is 0.5km.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetClusterRadius(Radius)
|
||||
self:T(self.lid.."SetClusterRadius")
|
||||
@@ -2873,7 +2873,7 @@ end
|
||||
|
||||
--- [User] Switch usage of target names for menu entries on or off
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean OnOff If true, set to on (default), if nil or false, set to off
|
||||
-- @param #boolean OnOff (Optional) If true, set to on (default), if nil or false, set to off
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SwitchUseGroupNames(OnOff)
|
||||
self:T(self.lid.."SwitchUseGroupNames")
|
||||
@@ -2887,7 +2887,7 @@ end
|
||||
|
||||
--- [User] Switch showing additional magnetic angles
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #boolean OnOff If true, set to on (default), if nil or false, set to off
|
||||
-- @param #boolean OnOff (Optional) If true, set to on (default), if nil or false, set to off
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SwitchMagenticAngles(OnOff)
|
||||
self:T(self.lid.."SwitchMagenticAngles")
|
||||
@@ -3782,7 +3782,7 @@ end
|
||||
--- Calculate group future position after given seconds.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Wrapper.Group#GROUP group The group to calculate for.
|
||||
-- @param #number seconds Time interval in seconds. Default is `self.prediction`.
|
||||
-- @param #number seconds (Optional) Time interval in seconds. Default is `self.prediction`.
|
||||
-- @return Core.Point#COORDINATE Calculated future position of the cluster.
|
||||
function PLAYERTASKCONTROLLER:_CalcGroupFuturePosition(group, seconds)
|
||||
|
||||
@@ -4898,9 +4898,9 @@ end
|
||||
|
||||
--- [User] Set SRS TTS details - see @{Sound.SRS} for details.`SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #number Frequency Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
|
||||
-- @param #number Modulation Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
|
||||
-- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #number Frequency (Optional) Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
|
||||
-- @param #number Modulation (Optional) Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
|
||||
-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
-- @param #string Gender (Optional) Defaults to "male"
|
||||
-- @param #string Culture (Optional) Defaults to "en-US"
|
||||
-- @param #number Port (Optional) Defaults to 5002
|
||||
@@ -4908,11 +4908,13 @@ end
|
||||
-- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
|
||||
-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest)
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate from which the controller radio is sending
|
||||
-- @param #string Backend (Optional) MSRS Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, you can hand in nil here.
|
||||
-- @param Core.Point#COORDINATE Coordinate (Optional) Coordinate from which the controller radio is sending
|
||||
-- @param #string Backend (Optional) MSRS Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC; if you use a config file for MSRS, you can hand in nil here.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @param #string Speaker (Optional) Use a specific speaker for a voice if Piper is used as provider (only Hound-TTS backend).
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate,Backend)
|
||||
function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate,Backend,Provider,Speaker)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" --
|
||||
self.Gender = Gender or MSRS.gender or "male" --
|
||||
@@ -4946,10 +4948,16 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu
|
||||
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
if Coordinate then
|
||||
self.SRS:SetCoordinate(Coordinate)
|
||||
end
|
||||
self.SRS:SetVoice(self.Voice)
|
||||
if Speaker then
|
||||
self.SRS:SetSpeakerPiper(Speaker)
|
||||
end
|
||||
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
|
||||
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
||||
return self
|
||||
|
||||
@@ -564,7 +564,7 @@ end
|
||||
|
||||
--- Set the speed the tanker flys in its orbit pattern.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number speed True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS.
|
||||
-- @param #number speed (Optional) True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetSpeed(speed)
|
||||
self.speed=UTILS.KnotsToMps(speed or 274)
|
||||
@@ -573,7 +573,7 @@ end
|
||||
|
||||
--- Set orbit pattern altitude of the tanker.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number altitude Tanker altitude in feet. Default 6000 ft.
|
||||
-- @param #number altitude (Optional) Tanker altitude in feet. Default 6000 ft.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetAltitude(altitude)
|
||||
self.altitude=UTILS.FeetToMeters(altitude or 6000)
|
||||
@@ -582,8 +582,8 @@ end
|
||||
|
||||
--- Set race-track distances.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number distbow Distance [NM] in front of the carrier. Default 10 NM.
|
||||
-- @param #number diststern Distance [NM] behind the carrier. Default 4 NM.
|
||||
-- @param #number distbow (Optional) Distance [NM] in front of the carrier. Default 10 NM.
|
||||
-- @param #number diststern (Optional) Distance [NM] behind the carrier. Default 4 NM.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetRacetrackDistances(distbow, diststern)
|
||||
self.distBow=UTILS.NMToMeters(distbow or 10)
|
||||
@@ -593,7 +593,7 @@ end
|
||||
|
||||
--- Set minimum pattern update interval. After a pattern update this time interval has to pass before the next update is allowed.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number interval Min interval in minutes. Default is 10 minutes.
|
||||
-- @param #number interval(Optional) Min interval in minutes. Default is 10 minutes.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetPatternUpdateInterval(interval)
|
||||
self.dTupdate=(interval or 10)*60
|
||||
@@ -602,7 +602,7 @@ end
|
||||
|
||||
--- Set pattern update distance threshold. Tanker will update its pattern when the carrier changes its position by more than this distance.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number distancechange Distance threshold in NM. Default 5 NM (=9.62 km).
|
||||
-- @param #number distancechange (Optional) Distance threshold in NM. Default 5 NM (=9.62 km).
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetPatternUpdateDistance(distancechange)
|
||||
self.Dupdate=UTILS.NMToMeters(distancechange or 5)
|
||||
@@ -611,7 +611,7 @@ end
|
||||
|
||||
--- Set pattern update heading threshold. Tanker will update its pattern when the carrier changes its heading by more than this value.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number headingchange Heading threshold in degrees. Default 5 degrees.
|
||||
-- @param #number headingchange (Optional) Heading threshold in degrees. Default 5 degrees.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetPatternUpdateHeading(headingchange)
|
||||
self.Hupdate=headingchange or 5
|
||||
@@ -620,7 +620,7 @@ end
|
||||
|
||||
--- Set low fuel state of tanker. When fuel is below this threshold, the tanker will RTB or be respawned if takeoff type is in air.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number fuelthreshold Low fuel threshold in percent. Default 10 % of max fuel.
|
||||
-- @param #number fuelthreshold (Optional) Low fuel threshold in percent. Default 10 % of max fuel.
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetLowFuelThreshold(fuelthreshold)
|
||||
self.lowfuel=fuelthreshold or 10
|
||||
@@ -794,9 +794,9 @@ end
|
||||
|
||||
--- Set TACAN channel of tanker. Note that mode is automatically set to "Y" for AA TACAN since only that works.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number channel TACAN channel. Default 1.
|
||||
-- @param #string morse TACAN morse code identifier. Three letters. Default "TKR".
|
||||
-- @param #string mode TACAN mode, which can be either "Y" (default) or "X".
|
||||
-- @param #number channel (Optional) TACAN channel. Default 1.
|
||||
-- @param #string morse (Optional) TACAN morse code identifier. Three letters. Default "TKR".
|
||||
-- @param #string mode (Optional) TACAN mode, which can be either "Y" (default) or "X".
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetTACAN(channel, morse, mode)
|
||||
self.TACANchannel=channel or 1
|
||||
@@ -808,8 +808,8 @@ end
|
||||
|
||||
--- Set radio frequency and optionally modulation of the tanker.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number frequency Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #string modulation Radio modulation, either "AM" or "FM". Default "AM".
|
||||
-- @param #number frequency (Optional) Radio frequency in MHz. Default 251 MHz.
|
||||
-- @param #string modulation (Optional) Radio modulation, either "AM" or "FM". Default "AM".
|
||||
-- @return #RECOVERYTANKER self
|
||||
function RECOVERYTANKER:SetRadio(frequency, modulation)
|
||||
self.RadioFreq=frequency or 251
|
||||
@@ -1537,8 +1537,8 @@ end
|
||||
|
||||
--- Init waypoint after spawn. Tanker is first guided to a position astern the carrier and starts its racetrack pattern from there.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number dist Distance [NM] of initial waypoint astern carrier. Default 8 NM.
|
||||
-- @param #number delay Delay before routing in seconds. Default 1 second.
|
||||
-- @param #number dist (Optional) Distance [NM] of initial waypoint astern carrier. Default 8 NM.
|
||||
-- @param #number delay (Optional) Delay before routing in seconds. Default 1 second.
|
||||
function RECOVERYTANKER:_InitRoute(dist, delay)
|
||||
|
||||
-- Defaults.
|
||||
|
||||
@@ -455,7 +455,7 @@ end
|
||||
|
||||
--- Set low fuel state of helo. When fuel is below this threshold, the helo will RTB or be respawned if takeoff type is in air.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number threshold Low fuel threshold in percent. Default 5%.
|
||||
-- @param #number threshold (Optional) Low fuel threshold in percent. Default 5%.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetLowFuelThreshold(threshold)
|
||||
self.lowfuel=threshold or 5
|
||||
@@ -480,7 +480,7 @@ end
|
||||
|
||||
--- Set rescue zone radius. Crashed or ejected units inside this radius of the carrier will be rescued if possible.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number radius Radius of rescue zone in nautical miles. Default is 15 NM.
|
||||
-- @param #number radius (Optional) Radius of rescue zone in nautical miles. Default is 15 NM.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetRescueZone(radius)
|
||||
radius=UTILS.NMToMeters(radius or 15)
|
||||
@@ -490,7 +490,7 @@ end
|
||||
|
||||
--- Set rescue hover speed.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number speed Speed in knots. Default 5 kts.
|
||||
-- @param #number speed (Optional) Speed in knots. Default 5 kts.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetRescueHoverSpeed(speed)
|
||||
self.rescuespeed=UTILS.KnotsToMps(speed or 5)
|
||||
@@ -499,7 +499,7 @@ end
|
||||
|
||||
--- Set rescue duration. This is the time it takes to rescue a pilot at the crash site.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number duration Duration in minutes. Default 5 min.
|
||||
-- @param #number duration (Optional) Duration in minutes. Default 5 min.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetRescueDuration(duration)
|
||||
self.rescueduration=(duration or 5)*60
|
||||
@@ -541,7 +541,7 @@ end
|
||||
|
||||
--- Set takeoff type.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number takeofftype Takeoff type. Default SPAWN.Takeoff.Hot.
|
||||
-- @param #number takeofftype (Optional) Takeoff type. Default SPAWN.Takeoff.Hot.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetTakeoff(takeofftype)
|
||||
self.takeoff=takeofftype or SPAWN.Takeoff.Hot
|
||||
@@ -574,7 +574,7 @@ end
|
||||
|
||||
--- Set altitude of helo.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number alt Altitude in meters. Default 70 m.
|
||||
-- @param #number alt (Optional) Altitude in meters. Default 70 m.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetAltitude(alt)
|
||||
self.altitude=alt or 70
|
||||
@@ -583,7 +583,7 @@ end
|
||||
|
||||
--- Set offset parallel to orientation of carrier.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number distance Offset distance in meters. Default 200 m (~660 ft).
|
||||
-- @param #number distance (Optional) Offset distance in meters. Default 200 m (~660 ft).
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetOffsetX(distance)
|
||||
self.offsetX=distance or 200
|
||||
@@ -592,7 +592,7 @@ end
|
||||
|
||||
--- Set offset perpendicular to orientation to carrier.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number distance Offset distance in meters. Default 240 m (~780 ft).
|
||||
-- @param #number distance (Optional) Offset distance in meters. Default 240 m (~780 ft).
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetOffsetZ(distance)
|
||||
self.offsetZ=distance or 240
|
||||
@@ -650,7 +650,7 @@ end
|
||||
|
||||
--- Set follow time update interval.
|
||||
-- @param #RESCUEHELO self
|
||||
-- @param #number dt Time interval in seconds. Default 1.0 sec.
|
||||
-- @param #number dt (Optional) Time interval in seconds. Default 1.0 sec.
|
||||
-- @return #RESCUEHELO self
|
||||
function RESCUEHELO:SetFollowTimeInterval(dt)
|
||||
self.dtFollow=dt or 1.0
|
||||
|
||||
@@ -92,7 +92,7 @@ SQUADRON.version="0.8.1"
|
||||
--- Create a new SQUADRON object and start the FSM.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #string TemplateGroupName Name of the template group.
|
||||
-- @param #number Ngroups Number of asset groups of this squadron. Default 3.
|
||||
-- @param #number Ngroups (Optional) Number of asset groups of this squadron. Default 3.
|
||||
-- @param #string SquadronName Name of the squadron, e.g. "VFA-37". Must be **unique**!
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName)
|
||||
@@ -125,7 +125,7 @@ end
|
||||
|
||||
--- Set number of units in groups.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #number nunits Number of units. Must be >=1 and <=4. Default 2.
|
||||
-- @param #number nunits (Optional) Number of units. Must be >=1 and <=4. Default 2.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetGrouping(nunits)
|
||||
self.ngrouping=nunits or 2
|
||||
@@ -150,7 +150,7 @@ end
|
||||
--- Set takeoff type. All assets of this squadron will be spawned with cold (default) or hot engines.
|
||||
-- Spawning on runways is not supported.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #string TakeoffType Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air.
|
||||
-- @param #string TakeoffType (Optional) Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetTakeoffType(TakeoffType)
|
||||
TakeoffType=TakeoffType or "Cold"
|
||||
@@ -193,7 +193,7 @@ end
|
||||
--- Set despawn after landing. Aircraft will be despawned after the landing event.
|
||||
-- Can help to avoid DCS AI taxiing issues.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #boolean Switch If `true` (default), activate despawn after landing.
|
||||
-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetDespawnAfterLanding(Switch)
|
||||
if Switch then
|
||||
@@ -207,7 +207,7 @@ end
|
||||
--- Set despawn after holding. Aircraft will be despawned when they arrive at their holding position at the airbase.
|
||||
-- Can help to avoid DCS AI taxiing issues.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #boolean Switch If `true` (default), activate despawn after holding.
|
||||
-- @param #boolean Switch (Optional) If `true` (default), activate despawn after holding.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetDespawnAfterHolding(Switch)
|
||||
if Switch then
|
||||
@@ -221,7 +221,7 @@ end
|
||||
|
||||
--- Set low fuel threshold.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #number LowFuel Low fuel threshold in percent. Default 25.
|
||||
-- @param #number LowFuel (Optional) Low fuel threshold in percent. Default 25.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetFuelLowThreshold(LowFuel)
|
||||
self.fuellow=LowFuel or 25
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -400,7 +400,7 @@ end
|
||||
|
||||
--- Set priority of the target.
|
||||
-- @param #TARGET self
|
||||
-- @param #number Priority Priority of the target. Default 50.
|
||||
-- @param #number Priority (Optional) Priority of the target. Default 50.
|
||||
-- @return #TARGET self
|
||||
function TARGET:SetPriority(Priority)
|
||||
self.prio=Priority or 50
|
||||
@@ -409,7 +409,7 @@ end
|
||||
|
||||
--- Set importance of the target.
|
||||
-- @param #TARGET self
|
||||
-- @param #number Importance Importance of the target. Default `nil`.
|
||||
-- @param #number Importance (Optional) Importance of the target. Default `nil`.
|
||||
-- @return #TARGET self
|
||||
function TARGET:SetImportance(Importance)
|
||||
self.importance=Importance
|
||||
@@ -508,10 +508,10 @@ end
|
||||
--- Add mission type and number of required assets to resource.
|
||||
-- @param #TARGET self
|
||||
-- @param #string MissionType Mission Type.
|
||||
-- @param #number Nmin Min number of required assets.
|
||||
-- @param #number Nmax Max number of requried assets.
|
||||
-- @param #number Nmin (Optional) Min number of required assets. Default is 1.
|
||||
-- @param #number Nmax (Optional) Max number of requried assets. Default is 1.
|
||||
-- @param #table Attributes Generalized attribute(s).
|
||||
-- @param #table Properties DCS attribute(s). Default `nil`.
|
||||
-- @param #table Properties (Optional) DCS attribute(s). Default `nil`.
|
||||
-- @return #TARGET.Resource The resource table.
|
||||
function TARGET:AddResource(MissionType, Nmin, Nmax, Attributes, Properties)
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ end
|
||||
|
||||
--- Set radio power. Note that this only applies if no relay unit is used.
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param #number power Radio power in Watts. Default 100 W.
|
||||
-- @param #number power (Optional) Radio power in Watts. Default 100 W.
|
||||
-- @return #RADIOQUEUE self The RADIOQUEUE object.
|
||||
function RADIOQUEUE:SetRadioPower(power)
|
||||
self.power=power or 100
|
||||
@@ -179,8 +179,8 @@ end
|
||||
|
||||
--- Set SRS.
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param #string PathToSRS Path to SRS.
|
||||
-- @param #number Port SRS port. Default 5002.
|
||||
-- @param #string PathToSRS (Optional) Path to SRS.
|
||||
-- @param #number Port (Optional) SRS port. Default 5002.
|
||||
-- @return #RADIOQUEUE self The RADIOQUEUE object.
|
||||
function RADIOQUEUE:SetSRS(PathToSRS, Port)
|
||||
local path = PathToSRS or MSRS.path
|
||||
@@ -195,9 +195,9 @@ end
|
||||
-- @param #number digit The digit 0-9.
|
||||
-- @param #string filename The name of the sound file.
|
||||
-- @param #number duration The duration of the sound file in seconds.
|
||||
-- @param #string path The directory within the miz file where the sound is located. Default "l10n/DEFAULT/".
|
||||
-- @param #string path (Optional) The directory within the miz file where the sound is located. Default "l10n/DEFAULT/".
|
||||
-- @param #string subtitle Subtitle of the transmission.
|
||||
-- @param #number subduration Duration [sec] of the subtitle being displayed. Default 5 sec.
|
||||
-- @param #number subduration (Optional) Duration [sec] of the subtitle being displayed. Default 5 sec.
|
||||
-- @return #RADIOQUEUE self The RADIOQUEUE object.
|
||||
function RADIOQUEUE:SetDigit(digit, filename, duration, path, subtitle, subduration)
|
||||
|
||||
@@ -245,11 +245,11 @@ end
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param #string filename Name of the sound file. Usually an ogg or wav file type.
|
||||
-- @param #number duration Duration in seconds the file lasts.
|
||||
-- @param #number path Directory path inside the miz file where the sound file is located. Default "l10n/DEFAULT/".
|
||||
-- @param #number tstart Start time (abs) seconds. Default now.
|
||||
-- @param #number interval Interval in seconds after the last transmission finished.
|
||||
-- @param #number path (Optional) Directory path inside the miz file where the sound file is located. Default "l10n/DEFAULT/".
|
||||
-- @param #number tstart (Optional) Start time (abs) seconds. Default now.
|
||||
-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0.
|
||||
-- @param #string subtitle Subtitle of the transmission.
|
||||
-- @param #number subduration Duration [sec] of the subtitle being displayed. Default 5 sec.
|
||||
-- @param #number subduration (Optional) Duration [sec] of the subtitle being displayed. Default 5 sec.
|
||||
-- @return #RADIOQUEUE.Transmission Radio transmission table.
|
||||
function RADIOQUEUE:NewTransmission(filename, duration, path, tstart, interval, subtitle, subduration)
|
||||
|
||||
@@ -295,8 +295,8 @@ end
|
||||
--- Add a SOUNDFILE to the radio queue.
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param Sound.SoundOutput#SOUNDFILE soundfile Sound file object to be added.
|
||||
-- @param #number tstart Start time (abs) seconds. Default now.
|
||||
-- @param #number interval Interval in seconds after the last transmission finished.
|
||||
-- @param #number tstart (Optional) Start time (abs) seconds. Default now.
|
||||
-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0.
|
||||
-- @return #RADIOQUEUE self
|
||||
function RADIOQUEUE:AddSoundFile(soundfile, tstart, interval)
|
||||
--env.info(string.format("FF add soundfile: name=%s%s", soundfile:GetPath(), soundfile:GetFileName()))
|
||||
@@ -308,8 +308,8 @@ end
|
||||
--- Add a SOUNDTEXT to the radio queue.
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param Sound.SoundOutput#SOUNDTEXT soundtext Text-to-speech text.
|
||||
-- @param #number tstart Start time (abs) seconds. Default now.
|
||||
-- @param #number interval Interval in seconds after the last transmission finished.
|
||||
-- @param #number tstart (Optional) Start time (abs) seconds. Default now.
|
||||
-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0.
|
||||
-- @return #RADIOQUEUE self
|
||||
function RADIOQUEUE:AddSoundText(soundtext, tstart, interval)
|
||||
|
||||
@@ -361,7 +361,6 @@ end
|
||||
-- @param #RADIOQUEUE self
|
||||
-- @param #RADIOQUEUE.Transmission transmission The transmission.
|
||||
function RADIOQUEUE:Broadcast(transmission)
|
||||
self:T("Broadcast")
|
||||
|
||||
if ((transmission.soundfile and transmission.soundfile.useSRS) or transmission.soundtext) and self.msrs then
|
||||
self:_BroadcastSRS(transmission)
|
||||
@@ -377,6 +376,9 @@ function RADIOQUEUE:Broadcast(transmission)
|
||||
if sender then
|
||||
|
||||
-- Broadcasting from aircraft. Only players tuned in to the right frequency will see the message.
|
||||
self:T(self.lid..string.format("Broadcasting from aircraft %s | sender init: %s", sender:GetName(),tostring(self.senderinit)))
|
||||
|
||||
|
||||
self:T(self.lid..string.format("Broadcasting from aircraft %s", sender:GetName()))
|
||||
|
||||
|
||||
@@ -421,7 +423,7 @@ function RADIOQUEUE:Broadcast(transmission)
|
||||
-- Debug message.
|
||||
if self.Debugmode then
|
||||
local text=string.format("file=%s, freq=%.2f MHz, duration=%.2f sec, subtitle=%s", filename, self.frequency/1000000, transmission.duration, transmission.subtitle or "")
|
||||
MESSAGE:New(text, 2, "RADIOQUEUE "..self.alias):ToAll()
|
||||
MESSAGE:New(text, 2, "RADIOQUEUE "..self.alias):ToAll():ToLog()
|
||||
end
|
||||
|
||||
else
|
||||
@@ -453,7 +455,7 @@ function RADIOQUEUE:Broadcast(transmission)
|
||||
-- Debug message.
|
||||
if self.Debugmode then
|
||||
local text=string.format("file=%s, freq=%.2f MHz, duration=%.2f sec, subtitle=%s", filename, self.frequency/1000000, transmission.duration, transmission.subtitle or "")
|
||||
MESSAGE:New(string.format(text, filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE "..self.alias):ToAll()
|
||||
MESSAGE:New(string.format(text, filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE "..self.alias):ToAll():ToLog()
|
||||
end
|
||||
else
|
||||
self:E("ERROR: Could not get vec3 to determine transmission origin! Did you specify a sender and is it still alive?")
|
||||
@@ -486,7 +488,7 @@ end
|
||||
--- Check radio queue for transmissions to be broadcasted.
|
||||
-- @param #RADIOQUEUE self
|
||||
function RADIOQUEUE:_CheckRadioQueue()
|
||||
|
||||
self:T("_CheckRadioQueue")
|
||||
-- Check if queue is empty.
|
||||
if #self.queue==0 then
|
||||
-- Queue is now empty. Nothing to else to do.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
||||
|
||||
do -- Sound Base
|
||||
|
||||
-- @type SOUNDBASE
|
||||
--- @type SOUNDBASE
|
||||
-- @field #string ClassName Name of the class.
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
@@ -61,7 +61,7 @@ do -- Sound Base
|
||||
-- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
|
||||
--
|
||||
-- @param #string Text The text string to analyze.
|
||||
-- @param #number Speed Speed factor. Default 1.
|
||||
-- @param #number Speed (Optional) Speed factor. Default 1.
|
||||
-- @param #boolean isGoogle If true, google text-to-speech is used.
|
||||
function SOUNDBASE:GetSpeechTime(length,speed,isGoogle)
|
||||
|
||||
@@ -100,7 +100,7 @@ end
|
||||
|
||||
do -- Sound File
|
||||
|
||||
-- @type SOUNDFILE
|
||||
--- @type SOUNDFILE
|
||||
-- @field #string ClassName Name of the class
|
||||
-- @field #string filename Name of the flag.
|
||||
-- @field #string path Directory path, where the sound file is located. This includes the final slash "/".
|
||||
@@ -158,9 +158,9 @@ do -- Sound File
|
||||
--- Constructor to create a new SOUNDFILE object.
|
||||
-- @param #SOUNDFILE self
|
||||
-- @param #string FileName The name of the sound file, e.g. "Hello World.ogg".
|
||||
-- @param #string Path The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.
|
||||
-- @param #number Duration Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.
|
||||
-- @param #boolean UseSrs Set if SRS should be used to play this file. Default is false.
|
||||
-- @param #string Path (Optional) The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.
|
||||
-- @param #number Duration (Optional) Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.
|
||||
-- @param #boolean UseSrs (Optional) Set if SRS should be used to play this file. Default is false.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:New(FileName, Path, Duration, UseSrs)
|
||||
|
||||
@@ -187,7 +187,7 @@ do -- Sound File
|
||||
|
||||
--- Set path, where the sound file is located.
|
||||
-- @param #SOUNDFILE self
|
||||
-- @param #string Path Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory.
|
||||
-- @param #string Path (Optional) Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:SetPath(Path)
|
||||
self:F( {Path} )
|
||||
@@ -228,7 +228,7 @@ do -- Sound File
|
||||
|
||||
--- Set sound file name. This must be a .ogg or .mp3 file!
|
||||
-- @param #SOUNDFILE self
|
||||
-- @param #string FileName Name of the file. Default is "Hello World.mp3".
|
||||
-- @param #string FileName (Optional) Name of the file. Default is "Hello World.mp3".
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:SetFileName(FileName)
|
||||
--TODO: check that sound file is really .ogg or .mp3
|
||||
@@ -246,7 +246,7 @@ do -- Sound File
|
||||
|
||||
--- Set duration how long it takes to play the sound file.
|
||||
-- @param #SOUNDFILE self
|
||||
-- @param #string Duration Duration in seconds. Default 3 seconds.
|
||||
-- @param #string Duration (Optional) Duration in seconds. Default 3 seconds.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:SetDuration(Duration)
|
||||
if Duration and type(Duration)=="string" then
|
||||
@@ -291,7 +291,8 @@ do -- Sound File
|
||||
end
|
||||
|
||||
do -- Text-To-Speech
|
||||
|
||||
|
||||
---
|
||||
-- @type SOUNDTEXT
|
||||
-- @field #string ClassName Name of the class
|
||||
-- @field #string text Text to speak.
|
||||
@@ -299,6 +300,8 @@ do -- Text-To-Speech
|
||||
-- @field #string gender Gender: "male", "female".
|
||||
-- @field #string culture Culture, e.g. "en-GB".
|
||||
-- @field #string voice Specific voice to use. Overrules `gender` and `culture` settings.
|
||||
-- @field #number speed Specific speed to be used.
|
||||
-- @field #string speaker (PIPER/HOUND only) sub-voice speaker to be used.
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
|
||||
@@ -351,7 +354,7 @@ do -- Text-To-Speech
|
||||
--- Constructor to create a new SOUNDTEXT object.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #string Text The text to speak.
|
||||
-- @param #number Duration Duration in seconds, how long it takes to play the text. Default is 3 seconds.
|
||||
-- @param #number Duration (Optional) Duration in seconds, how long it takes to play the text. Default is 3 seconds.
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:New(Text, Duration)
|
||||
|
||||
@@ -362,7 +365,7 @@ do -- Text-To-Speech
|
||||
self:SetDuration(Duration or MSRS.getSpeechTime(Text))
|
||||
--self:SetGender()
|
||||
--self:SetCulture()
|
||||
|
||||
self:SetSpeed()
|
||||
-- Debug info:
|
||||
self:T(string.format("New SOUNDTEXT: text=%s, duration=%.1f sec", self.text, self.duration))
|
||||
|
||||
@@ -371,7 +374,7 @@ do -- Text-To-Speech
|
||||
|
||||
--- Set text.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #string Text Text to speak. Default "Hello World!".
|
||||
-- @param #string Text (Optional) Text to speak. Default "Hello World!".
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetText(Text)
|
||||
|
||||
@@ -382,7 +385,7 @@ do -- Text-To-Speech
|
||||
|
||||
--- Set duration, how long it takes to speak the text.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #number Duration Duration in seconds. Default 3 seconds.
|
||||
-- @param #number Duration (Optional) Duration in seconds. Default 3 seconds.
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetDuration(Duration)
|
||||
|
||||
@@ -393,7 +396,7 @@ do -- Text-To-Speech
|
||||
|
||||
--- Set gender.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Gender (Optional) Gender: "male" or "female" (default).
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetGender(Gender)
|
||||
|
||||
@@ -404,7 +407,7 @@ do -- Text-To-Speech
|
||||
|
||||
--- Set TTS culture - local for the voice.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #string Culture TTS culture. Default "en-GB".
|
||||
-- @param #string Culture (Optional) TTS culture. Default "en-GB".
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetCulture(Culture)
|
||||
|
||||
@@ -425,4 +428,26 @@ do -- Text-To-Speech
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set to use a specific speed.
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #number Speed
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetSpeed(Speed)
|
||||
|
||||
self.speed = Speed or 1.0
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set to use a specific speaker (PIPER sub-voice).
|
||||
-- @param #SOUNDTEXT self
|
||||
-- @param #string Speaker
|
||||
-- @return #SOUNDTEXT self
|
||||
function SOUNDTEXT:SetSpeaker(Speaker)
|
||||
|
||||
self.speaker = Speaker
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
end
|
||||
@@ -131,14 +131,24 @@ ENUMS.WeaponFlag={
|
||||
Cannons = 805306368, -- GUN_POD + BuiltInCannon
|
||||
--- Torpedo
|
||||
Torpedo = 4294967296,
|
||||
--- Decoy
|
||||
Decoys = 8589934592,
|
||||
--- Shell
|
||||
SmokeShell = 17179869184,
|
||||
IlluminationShell = 34359738368,
|
||||
MarkerShell = 51539607552,
|
||||
MarkerWeapon = 51539620864,
|
||||
SubmunitionDispenserShell = 68719476736,
|
||||
ConventionalShell = 206963736576,
|
||||
---
|
||||
-- Even More Genral
|
||||
Auto = 3221225470, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons)
|
||||
AutoDCS = 1073741822, -- Something if often see
|
||||
AnyAG = 2956984318, -- Any Air-To-Ground Weapon
|
||||
AnyAA = 264241152, -- Any Air-To-Air Weapon
|
||||
AnyUnguided = 2952822768, -- Any Unguided Weapon
|
||||
AnyGuided = 268402702, -- Any Guided Weapon
|
||||
Auto = 265214230526, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons + Torpedos)
|
||||
AutoDCS = 1073741822, -- Something if often see
|
||||
AnyAG = 2956984318, -- Any Air-To-Ground Weapon
|
||||
AnyAA = 264241152, -- Any Air-To-Air Weapon
|
||||
AnyUnguided = 2952822768, -- Any Unguided Weapon
|
||||
AnyGuided = 268402702, -- Any Guided Weapon
|
||||
AnyShell = 258503344128, -- Any Shell
|
||||
}
|
||||
|
||||
--- Weapon types by category. See the [Weapon Flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag) enumerator on hoggit wiki.
|
||||
@@ -220,11 +230,11 @@ ENUMS.WeaponType.Torpedo={
|
||||
}
|
||||
ENUMS.WeaponType.Any={
|
||||
-- General combinations
|
||||
Weapon = 3221225470, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons)
|
||||
AG = 2956984318, -- Any Air-To-Ground Weapon
|
||||
AA = 264241152, -- Any Air-To-Air Weapon
|
||||
Unguided = 2952822768, -- Any Unguided Weapon
|
||||
Guided = 268402702, -- Any Guided Weapon
|
||||
Weapon = 265214230526, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons + Torpedos)
|
||||
AG = 2956984318, -- Any Air-To-Ground Weapon
|
||||
AA = 264241152, -- Any Air-To-Air Weapon
|
||||
Unguided = 2952822768, -- Any Unguided Weapon
|
||||
Guided = 268402702, -- Any Guided Weapon
|
||||
}
|
||||
|
||||
|
||||
@@ -513,7 +523,7 @@ ENUMS.ReportingName =
|
||||
Tornado = "Tornado",
|
||||
-- Transport / Bomber / Others
|
||||
Atlas = "A400",
|
||||
Lancer = "B1-B",
|
||||
Lancer = "B-1B",
|
||||
Stratofortress = "B-52H",
|
||||
Herc = "C-130",
|
||||
Hercules = "C-130J-30",
|
||||
@@ -558,7 +568,7 @@ ENUMS.ReportingName =
|
||||
Apache = "AH-64",
|
||||
Chinook = "CH-47",
|
||||
Sea_Stallion = "CH-53",
|
||||
Kiowa = "OH-58",
|
||||
Kiowa = "OH58D",
|
||||
Seahawk = "SH-60",
|
||||
Blackhawk = "UH-60",
|
||||
Sea_King = "S-61",
|
||||
@@ -1798,6 +1808,298 @@ ENUMS.Storage.weapons.missiles.Igla_S = 'weapons.missiles.Igla_S'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.{AKAN_NO_TRC}'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.{AKAN}'
|
||||
ENUMS.Storage.weapons.shells.M882_9x19 = 'weapons.shells.9x19_m882'
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_370gal = "weapons.droptanks.fuel_tank_370gal"
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_300gal = "weapons.droptanks.fuel_tank_300gal"
|
||||
|
||||
-- NEW
|
||||
ENUMS.Storage.weapons.adapters.HB_F_4E_ORD_LAU_77 = 'weapons.adapters.HB_F-4E_ORD_LAU_77'
|
||||
ENUMS.Storage.weapons.adapters.hb_a_6e_lau7_adu299 = 'weapons.adapters.hb_a-6e_lau7_adu299'
|
||||
ENUMS.Storage.weapons.adapters.CHAP_AIM92LN = 'weapons.adapters.CHAP_AIM92LN'
|
||||
ENUMS.Storage.weapons.adapters.CHAP_HOT3LN = 'weapons.adapters.CHAP_HOT3LN'
|
||||
ENUMS.Storage.weapons.adapters.CHAP_FZ225 = 'weapons.adapters.CHAP_FZ225'
|
||||
|
||||
ENUMS.Storage.weapons.bombs.AH6_SMOKE_BLUE = 'weapons.bombs.AH6_SMOKE_BLUE'
|
||||
ENUMS.Storage.weapons.bombs.AH6_SMOKE_GREEN = 'weapons.bombs.AH6_SMOKE_GREEN'
|
||||
ENUMS.Storage.weapons.bombs.AH6_SMOKE_RED = 'weapons.bombs.AH6_SMOKE_RED'
|
||||
ENUMS.Storage.weapons.bombs.AH6_SMOKE_YELLOW = 'weapons.bombs.AH6_SMOKE_YELLOW'
|
||||
ENUMS.Storage.weapons.bombs.AO_25SL = 'weapons.bombs.AO_25SL'
|
||||
|
||||
ENUMS.Storage.weapons.missiles.HB_AGM_78 = 'weapons.missiles.HB_AGM_78'
|
||||
ENUMS.Storage.weapons.missiles.V_1 = 'weapons.missiles.V-1'
|
||||
|
||||
ENUMS.Storage.weapons.shells.Oerlikon_20mm_HE = 'weapons.shells.Oerlikon_20mm_HE'
|
||||
ENUMS.Storage.weapons.shells.RM_15cm_HE = 'weapons.shells.RM_15cm_HE'
|
||||
ENUMS.Storage.weapons.shells.HE_T_MkII_40mm = 'weapons.shells.HE_T_MkII_40mm'
|
||||
ENUMS.Storage.weapons.shells.APCBC = 'weapons.shells.APCBC'
|
||||
ENUMS.Storage.weapons.shells.Sprgr_43_L71 = 'weapons.shells.Sprgr_43_L71'
|
||||
ENUMS.Storage.weapons.shells.Mk_20_HE_shell = 'weapons.shells.Mk_20_HE_shell'
|
||||
ENUMS.Storage.weapons.shells.Pzgr_39_42 = 'weapons.shells.Pzgr_39/42'
|
||||
ENUMS.Storage.weapons.shells.M1_37mm_37AP_T = 'weapons.shells.M1_37mm_37AP-T'
|
||||
ENUMS.Storage.weapons.shells.Sprgr_38 = 'weapons.shells.Sprgr_38'
|
||||
ENUMS.Storage.weapons.shells.Sprgr_39 = 'weapons.shells.Sprgr_39'
|
||||
ENUMS.Storage.weapons.shells.Pzgr_39_43 = 'weapons.shells.Pzgr_39/43'
|
||||
ENUMS.Storage.weapons.shells.Pzgr_39_5cm = 'weapons.shells.Pzgr_39_5cm'
|
||||
ENUMS.Storage.weapons.shells.AP_2A20_115mm = 'weapons.shells.2A20_115mm_AP'
|
||||
ENUMS.Storage.weapons.shells.AP_T_MkI_40mm = 'weapons.shells.AP_T_MkI_40mm'
|
||||
ENUMS.Storage.weapons.shells.AP_37x263 = 'weapons.shells.37x263_AP'
|
||||
ENUMS.Storage.weapons.shells.AP_20x138B = 'weapons.shells.20x138B_AP'
|
||||
ENUMS.Storage.weapons.shells.Besa7_92x57T = 'weapons.shells.Besa7_92x57T'
|
||||
ENUMS.Storage.weapons.shells.Sprgr_34_L70 = 'weapons.shells.Sprgr_34_L70'
|
||||
ENUMS.Storage.weapons.shells.QF94_AA_HE = 'weapons.shells.QF94_AA_HE'
|
||||
ENUMS.Storage.weapons.shells.AH_6762x51mm_M62 = 'weapons.shells.AH-6 7.62x51mm M62'
|
||||
ENUMS.Storage.weapons.shells.AH_6762x51mm_M80 = 'weapons.shells.AH-6 7.62x51mm M80'
|
||||
ENUMS.Storage.weapons.shells.AH_6_762x51mm_M61 = 'weapons.shells.AH-6 7.62x51mm M61'
|
||||
ENUMS.Storage.weapons.shells.leFH18_105HE = 'weapons.shells.leFH18_105HE'
|
||||
ENUMS.Storage.weapons.shells.M63_37HE = 'weapons.shells.M63_37HE'
|
||||
ENUMS.Storage.weapons.shells.QF95_206R_fixed = 'weapons.shells.QF95_206R_fixed'
|
||||
ENUMS.Storage.weapons.shells.UBR_365_85AP = 'weapons.shells.UBR_365_85AP'
|
||||
ENUMS.Storage.weapons.shells.M101 = 'weapons.shells.M101'
|
||||
ENUMS.Storage.weapons.shells.HE_M1_Shell = 'weapons.shells.HE_M1_Shell'
|
||||
ENUMS.Storage.weapons.shells.UO_365K_85HE = 'weapons.shells.UO_365K_85HE'
|
||||
ENUMS.Storage.weapons.shells.Flak41_Sprgr_39 = 'weapons.shells.Flak41_Sprgr_39'
|
||||
ENUMS.Storage.weapons.shells.M1_37mm_HE_T = 'weapons.shells.M1_37mm_HE-T'
|
||||
ENUMS.Storage.weapons.shells.QF17_HE = 'weapons.shells.QF17_HE'
|
||||
ENUMS.Storage.weapons.shells.Pzgr_39 = 'weapons.shells.Pzgr_39'
|
||||
ENUMS.Storage.weapons.shells.Besa7_92x57 = 'weapons.shells.Besa7_92x57'
|
||||
ENUMS.Storage.weapons.shells.I_Gr_33 = 'weapons.shells.I_Gr_33'
|
||||
ENUMS.Storage.weapons.shells.M62_APC = 'weapons.shells.M62_APC'
|
||||
ENUMS.Storage.weapons.shells.Mk_12_HE_shell = 'weapons.shells.Mk_12_HE_shell'
|
||||
ENUMS.Storage.weapons.shells.M51_37AP = 'weapons.shells.M51_37AP'
|
||||
ENUMS.Storage.weapons.shells.M42A1_HE = 'weapons.shells.M42A1_HE'
|
||||
ENUMS.Storage.weapons.shells.HE_20x138B = 'weapons.shells.20x138B_HE'
|
||||
ENUMS.Storage.weapons.shells.HE_37x263 = 'weapons.shells.37x263_HE'
|
||||
ENUMS.Storage.weapons.shells.HE_2A20_115mm = 'weapons.shells.2A20_115mm_HE'
|
||||
ENUMS.Storage.weapons.shells.AP_20x99R = 'weapons.shells.20x99R_AP'
|
||||
ENUMS.Storage.weapons.shells.IranFAC_DShK_API_T = 'weapons.shells.IranFAC_DShK_API_T'
|
||||
ENUMS.Storage.weapons.shells.IranFAC_DShK_API = 'weapons.shells.IranFAC_DShK_API'
|
||||
ENUMS.Storage.weapons.shells.HE_T_20x99R = 'weapons.shells.20x99R_HE_T'
|
||||
|
||||
ENUMS.Storage.weapons.gunmounts.B17_TailTurret_M2_L = 'weapons.gunmounts.B17_TailTurret_M2_L'
|
||||
ENUMS.Storage.weapons.gunmounts.AH6_M134L = 'weapons.gunmounts.{AH6_M134L}'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_Left_Nose_M2 = 'weapons.gunmounts.B17_Left_Nose_M2'
|
||||
ENUMS.Storage.weapons.gunmounts.Ju88_Turret_Top_Right_MG_81 = 'weapons.gunmounts.Ju88_Turret_Top_Right_MG_81'
|
||||
ENUMS.Storage.weapons.gunmounts.Ju88_Turret_Bottom_MG_81_L = 'weapons.gunmounts.Ju88_Turret_Bottom_MG_81_L'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_ChinTurret_M2_R = 'weapons.gunmounts.B17_ChinTurret_M2_R'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_Waist_Right_M2 = 'weapons.gunmounts.B17_Waist_Right_M2'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_Door_Gun = 'weapons.gunmounts.AH-6_Door_Gun'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_BallTurret_M2_L = 'weapons.gunmounts.B17_BallTurret_M2_L'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_BallTurret_M2_R = 'weapons.gunmounts.B17_BallTurret_M2_R'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_TopTurret_M2_R = 'weapons.gunmounts.B17_TopTurret_M2_R'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_Right_Nose_M2 = 'weapons.gunmounts.B17_Right_Nose_M2'
|
||||
ENUMS.Storage.weapons.gunmounts.Ju88_Turret_Bottom_MG_81_R = 'weapons.gunmounts.Ju88_Turret_Bottom_MG_81_R'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_TopTurret_M2_L = 'weapons.gunmounts.B17_TopTurret_M2_L'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_Waist_Left_M2 = 'weapons.gunmounts.B17_Waist_Left_M2'
|
||||
ENUMS.Storage.weapons.gunmounts.Ju88_Turret_ahead_MG_81 = 'weapons.gunmounts.Ju88_Turret_ahead_MG_81'
|
||||
ENUMS.Storage.weapons.gunmounts.AH6_M134R = 'weapons.gunmounts.{AH6_M134R}'
|
||||
ENUMS.Storage.weapons.gunmounts.Ju88_Turret_Top_Left_MG_81 = 'weapons.gunmounts.Ju88_Turret_Top_Left_MG_81'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_TailTurret_M2_R = 'weapons.gunmounts.B17_TailTurret_M2_R'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.AKAN_NO_TRC'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.AKAN'
|
||||
ENUMS.Storage.weapons.gunmounts.B17_ChinTurret_M2_L = 'weapons.gunmounts.B17_ChinTurret_M2_L'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.AKAN'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.AKAN_NO_TRC'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_Door = 'weapons.gunmounts.{AH-6_Door}'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_FN_HMP400 = 'weapons.gunmounts.{AH-6_FN_HMP400}'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_M134L = 'weapons.gunmounts.AH-6_M134L'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_M134R = 'weapons.gunmounts.AH-6_M134R'
|
||||
ENUMS.Storage.weapons.gunmounts.AH_6_HMP400 = 'weapons.gunmounts.AH-6_HMP400'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.{AKAN_NO_TRC}'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.{AKAN}'
|
||||
ENUMS.Storage.weapons.gunmounts.CHAP_HMP400LC = 'weapons.gunmounts.{CHAP_HMP400LC}'
|
||||
ENUMS.Storage.weapons.gunmounts.HMP400LC = 'weapons.gunmounts.HMP400LC'
|
||||
ENUMS.Storage.weapons.gunmounts.SHVAK_GUN = 'weapons.gunmounts.SHVAK_GUN'
|
||||
|
||||
ENUMS.Storage.weapons.droptanks.PTB_800 = 'weapons.droptanks.PTB-800'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_275 = 'weapons.droptanks.PTB-275'
|
||||
ENUMS.Storage.weapons.droptanks.HB_A6E_AERO1D_EMPTY = 'weapons.droptanks.HB_A6E_AERO1D_EMPTY'
|
||||
ENUMS.Storage.weapons.droptanks.Drop_tank_75gal = 'weapons.droptanks.Drop tank 75gal'
|
||||
ENUMS.Storage.weapons.droptanks.S_3_PTB = 'weapons.droptanks.S-3-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_3000 = 'weapons.droptanks.PTB-3000'
|
||||
ENUMS.Storage.weapons.droptanks.HB_A6E_D704 = 'weapons.droptanks.HB_A6E_D704'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1150_29 = 'weapons.droptanks.PTB-1150-29'
|
||||
ENUMS.Storage.weapons.droptanks.f_18c_ptb = 'weapons.droptanks.f-18c-ptb'
|
||||
ENUMS.Storage.weapons.droptanks.F4_BAK_L = 'weapons.droptanks.F4-BAK-L'
|
||||
ENUMS.Storage.weapons.droptanks.HB_A6E_AERO1D = 'weapons.droptanks.HB_A6E_AERO1D'
|
||||
ENUMS.Storage.weapons.droptanks.IAFS_ComboPak_100 = 'weapons.droptanks.{IAFS_ComboPak_100}'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_2000 = 'weapons.droptanks.PTB-2000'
|
||||
ENUMS.Storage.weapons.droptanks.M2000_PTB = 'weapons.droptanks.M2000-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_150 = 'weapons.droptanks.PTB-150'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1150 = 'weapons.droptanks.PTB-1150'
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_300gal = 'weapons.droptanks.fuel_tank_300gal'
|
||||
ENUMS.Storage.weapons.droptanks.MIG_25_PTB = 'weapons.droptanks.MIG-25-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1500 = 'weapons.droptanks.PTB-1500'
|
||||
ENUMS.Storage.weapons.droptanks.MIG_23_PTB = 'weapons.droptanks.MIG-23-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.FT600 = 'weapons.droptanks.FT600'
|
||||
ENUMS.Storage.weapons.droptanks.F15_PTB = 'weapons.droptanks.F15-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.ah6_auxtank = 'weapons.droptanks.ah6_auxtank'
|
||||
ENUMS.Storage.weapons.droptanks.T_PTB = 'weapons.droptanks.T-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_370gal = 'weapons.droptanks.fuel_tank_370gal'
|
||||
ENUMS.Storage.weapons.droptanks.F4_BAK_C = 'weapons.droptanks.F4-BAK-C'
|
||||
ENUMS.Storage.weapons.droptanks.F16_PTB_N2 = 'weapons.droptanks.F-16-PTB-N2'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_800 = 'weapons.droptanks.PTB-800'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_275 = 'weapons.droptanks.PTB-275'
|
||||
ENUMS.Storage.weapons.droptanks.T_PTB = 'weapons.droptanks.T-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.F16_PTB_N2 = 'weapons.droptanks.F-16-PTB-N2'
|
||||
ENUMS.Storage.weapons.droptanks.F4_BAK_C = 'weapons.droptanks.F4-BAK-C'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1150_29 = 'weapons.droptanks.PTB-1150-29'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1150 = 'weapons.droptanks.PTB-1150'
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_300gal = 'weapons.droptanks.fuel_tank_300gal'
|
||||
ENUMS.Storage.weapons.droptanks.MIG_25_PTB = 'weapons.droptanks.MIG-25-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_1500 = 'weapons.droptanks.PTB-1500'
|
||||
ENUMS.Storage.weapons.droptanks.FT600 = 'weapons.droptanks.FT600'
|
||||
ENUMS.Storage.weapons.droptanks.Drop_tank_75gal = 'weapons.droptanks.Drop tank 75gal'
|
||||
ENUMS.Storage.weapons.droptanks.F15_PTB = 'weapons.droptanks.F15-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.M2000_PTB = 'weapons.droptanks.M2000-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_150 = 'weapons.droptanks.PTB-150'
|
||||
ENUMS.Storage.weapons.droptanks.F4_BAK_L = 'weapons.droptanks.F4-BAK-L'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_3000 = 'weapons.droptanks.PTB-3000'
|
||||
ENUMS.Storage.weapons.droptanks.PTB_2000 = 'weapons.droptanks.PTB-2000'
|
||||
ENUMS.Storage.weapons.droptanks.S_3_PTB = 'weapons.droptanks.S-3-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.fuel_tank_370gal = 'weapons.droptanks.fuel_tank_370gal'
|
||||
ENUMS.Storage.weapons.droptanks.MIG_23_PTB = 'weapons.droptanks.MIG-23-PTB'
|
||||
ENUMS.Storage.weapons.droptanks.f_18c_ptb = 'weapons.droptanks.f-18c-ptb'
|
||||
ENUMS.Storage.weapons.droptanks.CHAP_TigerUHT_fueltank = 'weapons.droptanks.CHAP_TigerUHT_fueltank'
|
||||
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400_100 = 'weapons.containers.{FN_HMP400_100}'
|
||||
ENUMS.Storage.weapons.containers.AN_M3 = 'weapons.containers.{AN-M3}'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L500 = 'weapons.containers.OH58D_M3P_L500'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_HE = 'weapons.containers.{GIAT_M621_HE}'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7_MI24_L = 'weapons.containers.KORD_12_7_MI24_L'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M240H = 'weapons.containers.{CH47_STBD_M240H}'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M60D = 'weapons.containers.{CH47_AFT_M60D}'
|
||||
ENUMS.Storage.weapons.containers.UPK_23_250_MiG_21 = 'weapons.containers.{UPK-23-250 MiG-21}'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M134D = 'weapons.containers.{CH47_STBD_M134D}'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer = 'weapons.containers.{GAU_12_Equalizer}'
|
||||
ENUMS.Storage.weapons.containers.PKT_7_62 = 'weapons.containers.PKT_7_62'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M240H = 'weapons.containers.{CH47_AFT_M240H}'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_SAPHEI = 'weapons.containers.{GIAT_M621_SAPHEI}'
|
||||
ENUMS.Storage.weapons.containers.ADEN_GUNPOD = 'weapons.containers.{ADEN_GUNPOD}'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer_HE = 'weapons.containers.{GAU_12_Equalizer_HE}'
|
||||
ENUMS.Storage.weapons.containers.M60_SIDE_L = 'weapons.containers.M60_SIDE_L'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7_MI24_R = 'weapons.containers.KORD_12_7_MI24_R'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_APHE = 'weapons.containers.{GIAT_M621_APHE}'
|
||||
ENUMS.Storage.weapons.containers.MB339_ANM3_L = 'weapons.containers.{MB339_ANM3_L}'
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400 = 'weapons.containers.{FN_HMP400}'
|
||||
ENUMS.Storage.weapons.containers.AH_6_Door = 'weapons.containers.{AH-6_Door}'
|
||||
ENUMS.Storage.weapons.containers.MB339_DEFA553_L = 'weapons.containers.{MB339_DEFA553_L}'
|
||||
ENUMS.Storage.weapons.containers.MB339_ANM3_R = 'weapons.containers.{MB339_ANM3_R}'
|
||||
ENUMS.Storage.weapons.containers.PK_3 = 'weapons.containers.{PK-3}'
|
||||
ENUMS.Storage.weapons.containers.GUV_VOG = 'weapons.containers.GUV_VOG'
|
||||
ENUMS.Storage.weapons.containers.SA342_M134_SIDE_R = 'weapons.containers.{SA342_M134_SIDE_R}'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L100 = 'weapons.containers.OH58D_M3P_L100'
|
||||
ENUMS.Storage.weapons.containers.MXU_648 = 'weapons.containers.MXU-648'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L400 = 'weapons.containers.OH58D_M3P_L400'
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400_200 = 'weapons.containers.{FN_HMP400_200}'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_HE = 'weapons.containers.{GIAT_M621_HE}'
|
||||
ENUMS.Storage.weapons.containers.M134_L = 'weapons.containers.M134_L'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L200 = 'weapons.containers.OH58D_M3P_L200'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_AP = 'weapons.containers.{GIAT_M621_AP}'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M134D = 'weapons.containers.{CH47_STBD_M134D}'
|
||||
ENUMS.Storage.weapons.containers.PKT_7_62 = 'weapons.containers.PKT_7_62'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L300 = 'weapons.containers.OH58D_M3P_L300'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_SAPHEI = 'weapons.containers.{GIAT_M621_SAPHEI}'
|
||||
ENUMS.Storage.weapons.containers.M60_SIDE_L = 'weapons.containers.M60_SIDE_L'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M134D = 'weapons.containers.{CH47_PORT_M134D}'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M60D = 'weapons.containers.{CH47_PORT_M60D}'
|
||||
ENUMS.Storage.weapons.containers.ADEN_GUNPOD = 'weapons.containers.{ADEN_GUNPOD}'
|
||||
ENUMS.Storage.weapons.containers.C_101_DEFA553 = 'weapons.containers.{C-101-DEFA553}'
|
||||
ENUMS.Storage.weapons.containers.MB339_ANM3_R = 'weapons.containers.{MB339_ANM3_R}'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M60D = 'weapons.containers.{CH47_AFT_M60D}'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7 = 'weapons.containers.KORD_12_7'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_HEAP = 'weapons.containers.{GIAT_M621_HEAP}'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M3M = 'weapons.containers.{CH47_AFT_M3M}'
|
||||
ENUMS.Storage.weapons.containers.GUV_YakB_GSHP = 'weapons.containers.GUV_YakB_GSHP'
|
||||
ENUMS.Storage.weapons.containers.R_73U = 'weapons.containers.R-73U'
|
||||
ENUMS.Storage.weapons.containers.GUV_VOG = 'weapons.containers.GUV_VOG'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7_MI24_L = 'weapons.containers.KORD_12_7_MI24_L'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L100 = 'weapons.containers.OH58D_M3P_L100'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L400 = 'weapons.containers.OH58D_M3P_L400'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M240H = 'weapons.containers.{CH47_STBD_M240H}'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M240H = 'weapons.containers.{CH47_PORT_M240H}'
|
||||
ENUMS.Storage.weapons.containers.CC420_GUN_POD = 'weapons.containers.{CC420_GUN_POD}'
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400_100 = 'weapons.containers.{FN_HMP400_100}'
|
||||
ENUMS.Storage.weapons.containers.MB339_ANM3_L = 'weapons.containers.{MB339_ANM3_L}'
|
||||
ENUMS.Storage.weapons.containers.MB339_DEFA553_R = 'weapons.containers.{MB339_DEFA553_R}'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer_HE = 'weapons.containers.{GAU_12_Equalizer_HE}'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L500 = 'weapons.containers.OH58D_M3P_L500'
|
||||
ENUMS.Storage.weapons.containers.SUU_23_POD = 'weapons.containers.{SUU_23_POD}'
|
||||
ENUMS.Storage.weapons.containers.PK_3 = 'weapons.containers.{PK-3}'
|
||||
ENUMS.Storage.weapons.containers.AKAN = 'weapons.containers.{AKAN}'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M60D = 'weapons.containers.{CH47_STBD_M60D}'
|
||||
ENUMS.Storage.weapons.containers.SA342_M134_SIDE_R = 'weapons.containers.{SA342_M134_SIDE_R}'
|
||||
ENUMS.Storage.weapons.containers.M60_SIDE_R = 'weapons.containers.M60_SIDE_R'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer_AP = 'weapons.containers.{GAU_12_Equalizer_AP}'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer = 'weapons.containers.{GAU_12_Equalizer}'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7_MI24_R = 'weapons.containers.KORD_12_7_MI24_R'
|
||||
ENUMS.Storage.weapons.containers.M134_SIDE_R = 'weapons.containers.M134_SIDE_R'
|
||||
ENUMS.Storage.weapons.containers.AKAN_NO_TRC = 'weapons.containers.{AKAN_NO_TRC}'
|
||||
ENUMS.Storage.weapons.containers.oh_58_brauning = 'weapons.containers.oh-58-brauning'
|
||||
ENUMS.Storage.weapons.containers.MXU_648 = 'weapons.containers.MXU-648'
|
||||
ENUMS.Storage.weapons.containers.M134_R = 'weapons.containers.M134_R'
|
||||
ENUMS.Storage.weapons.containers.AN_M3 = 'weapons.containers.{AN-M3}'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_APHE = 'weapons.containers.{GIAT_M621_APHE}'
|
||||
ENUMS.Storage.weapons.containers.AIM_9S = 'weapons.containers.AIM-9S'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M240H = 'weapons.containers.{CH47_AFT_M240H}'
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400 = 'weapons.containers.{FN_HMP400}'
|
||||
ENUMS.Storage.weapons.containers.M134_SIDE_L = 'weapons.containers.M134_SIDE_L'
|
||||
ENUMS.Storage.weapons.containers.MB339_DEFA553_L = 'weapons.containers.{MB339_DEFA553_L}'
|
||||
ENUMS.Storage.weapons.containers.MISC_1 = 'weapons.containers.{05544F1A-C39C-466b-BC37-5BD1D52E57BB}'
|
||||
ENUMS.Storage.weapons.containers.MISC_2 = 'weapons.containers.{E92CBFE5-C153-11d8-9897-000476191836}'
|
||||
ENUMS.Storage.weapons.containers.hvar_SmokeGenerator = 'weapons.containers.hvar_SmokeGenerator'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_RED = 'weapons.containers.{INV-SMOKE-RED}'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_YELLOW = 'weapons.containers.{INV-SMOKE-YELLOW}'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_BLUE = 'weapons.containers.{INV-SMOKE-BLUE}'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_GREEN = 'weapons.containers.{INV-SMOKE-GREEN}'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_WHITE = 'weapons.containers.{INV-SMOKE-WHITE}'
|
||||
ENUMS.Storage.weapons.containers.INV_SMOKE_ORANGE = 'weapons.containers.{INV-SMOKE-ORANGE}'
|
||||
ENUMS.Storage.weapons.containers.GAU_12_Equalizer_AP = 'weapons.containers.{GAU_12_Equalizer_AP}'
|
||||
ENUMS.Storage.weapons.containers.AH_6_Gunners = 'weapons.containers.{AH-6_Gunners}'
|
||||
ENUMS.Storage.weapons.containers.AH_6_FN_HMP400 = 'weapons.containers.{AH-6_FN_HMP400}'
|
||||
ENUMS.Storage.weapons.containers.R_73U = 'weapons.containers.R-73U'
|
||||
ENUMS.Storage.weapons.containers.M60_SIDE_R = 'weapons.containers.M60_SIDE_R'
|
||||
ENUMS.Storage.weapons.containers.CH47_AFT_M3M = 'weapons.containers.{CH47_AFT_M3M}'
|
||||
ENUMS.Storage.weapons.containers.GUV_YakB_GSHP = 'weapons.containers.GUV_YakB_GSHP'
|
||||
ENUMS.Storage.weapons.containers.RKL609_L = 'weapons.containers.{RKL609_L}'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M134D = 'weapons.containers.{CH47_PORT_M134D}'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M60D = 'weapons.containers.{CH47_PORT_M60D}'
|
||||
ENUMS.Storage.weapons.containers.RKL609_R = 'weapons.containers.{RKL609_R}'
|
||||
ENUMS.Storage.weapons.containers.C_101_DEFA553 = 'weapons.containers.{C-101-DEFA553}'
|
||||
ENUMS.Storage.weapons.containers.AH6_M134L = 'weapons.containers.{AH6_M134L}'
|
||||
ENUMS.Storage.weapons.containers.KORD_12_7 = 'weapons.containers.KORD_12_7'
|
||||
ENUMS.Storage.weapons.containers.C130_M18_Sidearm = 'weapons.containers.{C130-M18-Sidearm}'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_HEAP = 'weapons.containers.{GIAT_M621_HEAP}'
|
||||
ENUMS.Storage.weapons.containers.BRU_42_LS = 'weapons.containers.BRU-42_LS'
|
||||
ENUMS.Storage.weapons.containers.CH47_STBD_M60D = 'weapons.containers.{CH47_STBD_M60D}'
|
||||
ENUMS.Storage.weapons.containers.SUU_23_POD = 'weapons.containers.{SUU_23_POD}'
|
||||
ENUMS.Storage.weapons.containers.M134_SIDE_R = 'weapons.containers.M134_SIDE_R'
|
||||
ENUMS.Storage.weapons.containers.AKAN_NO_TRC = 'weapons.containers.{AKAN_NO_TRC}'
|
||||
ENUMS.Storage.weapons.containers.oh_58_brauning = 'weapons.containers.oh-58-brauning'
|
||||
ENUMS.Storage.weapons.containers.AH_6_DOORS = 'weapons.containers.{AH-6_DOORS}'
|
||||
ENUMS.Storage.weapons.containers.CC420_GUN_POD = 'weapons.containers.{CC420_GUN_POD}'
|
||||
ENUMS.Storage.weapons.containers.CH47_PORT_M240H = 'weapons.containers.{CH47_PORT_M240H}'
|
||||
ENUMS.Storage.weapons.containers.MB339_DEFA553_R = 'weapons.containers.{MB339_DEFA553_R}'
|
||||
ENUMS.Storage.weapons.containers.AIM_9S = 'weapons.containers.AIM-9S'
|
||||
ENUMS.Storage.weapons.containers.hvar_SmokeGenerator = 'weapons.containers.hvar_SmokeGenerator'
|
||||
ENUMS.Storage.weapons.containers.M134_L = 'weapons.containers.M134_L'
|
||||
ENUMS.Storage.weapons.containers.AKAN = 'weapons.containers.{AKAN}'
|
||||
ENUMS.Storage.weapons.containers.C130_Cargo_Bay_M4 = 'weapons.containers.{C130-Cargo-Bay-M4}'
|
||||
ENUMS.Storage.weapons.containers.M134_SIDE_L = 'weapons.containers.M134_SIDE_L'
|
||||
ENUMS.Storage.weapons.containers.FN_HMP400_200 = 'weapons.containers.{FN_HMP400_200}'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L200 = 'weapons.containers.OH58D_M3P_L200'
|
||||
ENUMS.Storage.weapons.containers.GIAT_M621_AP = 'weapons.containers.{GIAT_M621_AP}'
|
||||
ENUMS.Storage.weapons.containers.M134_R = 'weapons.containers.M134_R'
|
||||
ENUMS.Storage.weapons.containers.OH58D_M3P_L300 = 'weapons.containers.OH58D_M3P_L300'
|
||||
ENUMS.Storage.weapons.containers.AH6_M134R = 'weapons.containers.{AH6_M134R}'
|
||||
ENUMS.Storage.weapons.containers.CHAP_HMP400LC = 'weapons.containers.{CHAP_HMP400LC}'
|
||||
|
||||
ENUMS.Storage.weapons.missiles.C701_AShM = 'weapons.missiles.C701 AShM'
|
||||
ENUMS.Storage.weapons.missiles.IGLA_9M39 = 'weapons.missiles.9M39_IGLA'
|
||||
ENUMS.Storage.weapons.missiles.CHAP_AIM92 = 'weapons.missiles.CHAP_AIM92'
|
||||
ENUMS.Storage.weapons.missiles.AM39 = 'weapons.missiles.AM39'
|
||||
ENUMS.Storage.weapons.missiles.Shahed136_LM = 'weapons.missiles.Shahed136_LM'
|
||||
|
||||
ENUMS.Storage.weapons.torpedoes.G7A_T1 = 'weapons.torpedoes.G7A_T1'
|
||||
|
||||
|
||||
-- UH-60L Mod
|
||||
ENUMS.Storage.weapons.gunmounts.UH60LGAU19 = 'weapons.gunmounts.UH-60L GAU-19'
|
||||
@@ -1814,6 +2116,56 @@ ENUMS.Storage.weapons.gunmounts.UH60L_M60_GUNNER = 'weapons.gunmounts.{UH60L_M60
|
||||
ENUMS.Storage.weapons.gunmounts.UH60L_M2_GUNNER = 'weapons.gunmounts.{UH60L_M2_GUNNER}'
|
||||
ENUMS.Storage.weapons.gunmounts.UH60_M230_LEFT = 'weapons.gunmounts.{UH60_M230_LEFT}'
|
||||
ENUMS.Storage.weapons.gunmounts.UH60_M230_RIGHT = 'weapons.gunmounts.{UH60_M230_RIGHT}'
|
||||
ENUMS.Storage.weapons.containers.UH60_M134_RIGHT = 'weapons.containers.{UH60_M134_RIGHT}'
|
||||
ENUMS.Storage.weapons.containers.UH60_M134_LEFT = 'weapons.containers.{UH60_M134_LEFT}'
|
||||
ENUMS.Storage.weapons.containers.UH60_M230_LEFT = 'weapons.containers.{UH60_M230_LEFT}'
|
||||
ENUMS.Storage.weapons.containers.UH60L_M134_GUNNER = 'weapons.containers.{UH60L_M134_GUNNER}'
|
||||
ENUMS.Storage.weapons.containers.UH60_GAU19_LEFT = 'weapons.containers.{UH60_GAU19_LEFT}'
|
||||
ENUMS.Storage.weapons.containers.UH60L_M60_GUNNER = 'weapons.containers.{UH60L_M60_GUNNER}'
|
||||
ENUMS.Storage.weapons.containers.UH60_GAU19_RIGHT = 'weapons.containers.{UH60_GAU19_RIGHT}'
|
||||
ENUMS.Storage.weapons.containers.UH60_M230_RIGHT = 'weapons.containers.{UH60_M230_RIGHT}'
|
||||
ENUMS.Storage.weapons.containers.UH60L_M2_GUNNER = 'weapons.containers.{UH60L_M2_GUNNER}'
|
||||
|
||||
|
||||
ENUMS.Storage.weapons.adapters.GD_F100_SUU_13 = 'weapons.adapters.GD_F100_SUU-13'
|
||||
ENUMS.Storage.weapons.containers.GPU_5_POD = 'weapons.containers.{GPU_5_POD}'
|
||||
ENUMS.Storage.weapons.bombs.BOLT_117 = 'weapons.bombs.BOLT-117'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_TP_T = 'weapons.shells.F100_M39_20_TP_T'
|
||||
ENUMS.Storage.weapons.gunmounts.M_39_F_100 = 'weapons.gunmounts.M-39 F-100'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_L = 'weapons.droptanks.GD_F100_TANK_275_L'
|
||||
ENUMS.Storage.weapons.bombs.BLU_4B_R_GROUP_R = 'weapons.bombs.BLU-4B_R_GROUP_R'
|
||||
ENUMS.Storage.weapons.containers.F100_CAMERA_P2 = 'weapons.containers.F100_CAMERA_P2'
|
||||
ENUMS.Storage.weapons.containers.HB_ORD_SUU_7 = 'weapons.containers.HB_ORD_SUU_7'
|
||||
ENUMS.Storage.weapons.adapters.SidewinderPylon = 'weapons.adapters.SidewinderPylon'
|
||||
ENUMS.Storage.weapons.adapters.apu_470 = 'weapons.adapters.apu_470'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_R = 'weapons.droptanks.GD_F100_TANK_335_R'
|
||||
ENUMS.Storage.weapons.bombs.BLU_3B_R_GROUP_R = 'weapons.bombs.BLU-3B_R_GROUP_R'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_L = 'weapons.droptanks.GD_F100_TANK_335_L'
|
||||
ENUMS.Storage.weapons.adapters.mbdz_u2t = 'weapons.adapters.mbdz_u2t'
|
||||
ENUMS.Storage.weapons.containers.ZellRocket = 'weapons.containers.ZellRocket'
|
||||
ENUMS.Storage.weapons.containers.apu_73 = 'weapons.containers.apu-73'
|
||||
ENUMS.Storage.weapons.gunmounts.GAU_13 = 'weapons.gunmounts.GAU-13'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_TP = 'weapons.shells.F100_M39_20_TP'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_API = 'weapons.shells.F100_M39_20_API'
|
||||
ENUMS.Storage.weapons.adapters.bdz_umk2b = 'weapons.adapters.bdz_umk2b'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_450 = 'weapons.droptanks.GD_F100_TANK_450'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_R = 'weapons.droptanks.GD_F100_TANK_275_R'
|
||||
ENUMS.Storage.weapons.bombs.BLU_18_B_GROUP = 'weapons.bombs.BLU-18/B_GROUP'
|
||||
ENUMS.Storage.weapons.containers.ZELL_Booster = 'weapons.containers.ZELL Booster'
|
||||
ENUMS.Storage.weapons.adapters.apu_60 = 'weapons.adapters.apu_60'
|
||||
ENUMS.Storage.weapons.gunmounts.GPU_5_POD = 'weapons.gunmounts.{GPU_5_POD}'
|
||||
ENUMS.Storage.weapons.containers.F100_CAMERA_KA71A = 'weapons.containers.F100_CAMERA_KA71A'
|
||||
ENUMS.Storage.weapons.bombs.BLU_3_R_GROUP_R = 'weapons.bombs.BLU-3_R_GROUP_R'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_HEI = 'weapons.shells.F100_M39_20_HEI'
|
||||
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_200 = 'weapons.droptanks.GD_F100_TANK_200'
|
||||
ENUMS.Storage.weapons.adapters.apu_73 = 'weapons.adapters.apu-73'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.AKAN_NO_TRC'
|
||||
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.AKAN'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_HEI_T = 'weapons.shells.F100_M39_20_HEI_T'
|
||||
ENUMS.Storage.weapons.shells.F100_M39_20_API_T = 'weapons.shells.F100_M39_20_API_T'
|
||||
ENUMS.Storage.weapons.containers.GD_F100_STRIKE_CAMERA = 'weapons.containers.GD_F100_STRIKE_CAMERA'
|
||||
ENUMS.Storage.weapons.bombs.BLU_49_B = 'weapons.bombs.BLU-49/B'
|
||||
ENUMS.Storage.weapons.containers.GD_F100_SUU_13 = 'weapons.containers.GD_F100_SUU-13'
|
||||
|
||||
---
|
||||
-- @type ENUMS.FARPType
|
||||
|
||||
@@ -126,8 +126,8 @@ PROFILER = {
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--- Start profiler.
|
||||
-- @param #number Delay Delay in seconds before profiler is stated. Default is immediately.
|
||||
-- @param #number Duration Duration in (game) seconds before the profiler is stopped. Default is when mission ends.
|
||||
-- @param #number Delay (Optional) Delay in seconds before profiler is stated. Default is immediately.
|
||||
-- @param #number Duration (Optional) Duration in (game) seconds before the profiler is stopped. Default is when mission ends.
|
||||
function PROFILER.Start( Delay, Duration )
|
||||
|
||||
-- Check if os, io and lfs are available.
|
||||
|
||||
@@ -77,8 +77,8 @@ SOCKET.version="0.3.0"
|
||||
|
||||
--- Create a new SOCKET object.
|
||||
-- @param #SOCKET self
|
||||
-- @param #number Port UDP port. Default `10042`.
|
||||
-- @param #string Host Host. Default `"127.0.0.1"`.
|
||||
-- @param #number Port (Optional) UDP port. Default `10042`.
|
||||
-- @param #string Host (Optional) Host. Default `"127.0.0.1"`.
|
||||
-- @return #SOCKET self
|
||||
function SOCKET:New(Port, Host)
|
||||
|
||||
@@ -103,7 +103,7 @@ end
|
||||
|
||||
--- Set port.
|
||||
-- @param #SOCKET self
|
||||
-- @param #number Port Port. Default 10042.
|
||||
-- @param #number Port (Optional) Port. Default 10042.
|
||||
-- @return #SOCKET self
|
||||
function SOCKET:SetPort(Port)
|
||||
self.port=Port or 10042
|
||||
@@ -111,7 +111,7 @@ end
|
||||
|
||||
--- Set host.
|
||||
-- @param #SOCKET self
|
||||
-- @param #string Host Host. Default `"127.0.0.1"`.
|
||||
-- @param #string Host (Optional) Host. Default `"127.0.0.1"`.
|
||||
-- @return #SOCKET self
|
||||
function SOCKET:SetHost(Host)
|
||||
self.host=Host or "127.0.0.1"
|
||||
@@ -159,11 +159,11 @@ end
|
||||
--- Send a text-to-speech message.
|
||||
-- @param #SOCKET self
|
||||
-- @param #string Text The text message to speek.
|
||||
-- @param #number Provider The TTS provider: 0=Microsoft (default), 1=Google.
|
||||
-- @param #number Provider (Optional) The TTS provider: 0=Microsoft (default), 1=Google.
|
||||
-- @param #string Voice The specific voice to use, e.g. `"Microsoft David Desktop"` or "`en-US-Standard-A`". If not set, the service will choose a voice based on the other parameters such as culture and gender.
|
||||
-- @param #string Culture The Culture or language code, *e.g.* `"en-US"`.
|
||||
-- @param #string Gender The Gender, *i.e.* "male", "female". Default "female".
|
||||
-- @param #number Volume The volume. Microsoft: [0,100] default 50, Google: [-96, 10] default 0.
|
||||
-- @param #string Gender (Optional) The Gender, *i.e.* "male", "female". Default "female".
|
||||
-- @param #number Volume (Optional) The volume. Microsoft: [0,100] default 50, Google: [-96, 10] default 0.
|
||||
-- @return #SOCKET self
|
||||
function SOCKET:SendTextToSpeech(Text, Provider, Voice, Culture, Gender, Volume)
|
||||
|
||||
|
||||
@@ -522,43 +522,77 @@ function UTILS.TableLength(T)
|
||||
end
|
||||
|
||||
--- Print a table to log in a nice format
|
||||
-- @param #table table The table to print
|
||||
-- @param #number indent Number of indents
|
||||
-- @param #table t The table to print
|
||||
-- @param #number indent (Optional) Number of indents. Defaults to 0.
|
||||
-- @param #boolean noprint Don't log but return text
|
||||
-- @param #number maxDepth (Optional) Only cycle this deep, defaults to 5.
|
||||
-- @param #table seen (Optional)
|
||||
-- @return #string text Text created on the fly of the log output
|
||||
function UTILS.PrintTableToLog(table, indent, noprint)
|
||||
local text = "\n"
|
||||
if not table or type(table) ~= "table" then
|
||||
function UTILS.PrintTableToLog(t, indent, noprint, maxDepth, seen)
|
||||
maxDepth = maxDepth or 5
|
||||
indent = indent or 0
|
||||
seen = seen or {}
|
||||
|
||||
if not t or type(t) ~= "table" then
|
||||
env.warning("No table passed!")
|
||||
return nil
|
||||
end
|
||||
if not indent then indent = 0 end
|
||||
for k, v in pairs(table) do
|
||||
if string.find(k," ") then k='"'..k..'"'end
|
||||
if type(v) == "table" and UTILS.TableLength(v) > 0 then
|
||||
|
||||
-- Max depth guard
|
||||
if indent > maxDepth then
|
||||
local msg = string.rep(" ", indent) .. "<max depth reached>\n"
|
||||
if not noprint then env.info(msg) end
|
||||
return msg
|
||||
end
|
||||
|
||||
-- Cycle / repeated reference guard
|
||||
if seen[t] then
|
||||
local msg = string.rep(" ", indent) .. "<cycle>\n"
|
||||
if not noprint then env.info(msg) end
|
||||
return msg
|
||||
end
|
||||
seen[t] = true
|
||||
|
||||
local text = "\n"
|
||||
|
||||
for k, v in pairs(t) do
|
||||
local key = k
|
||||
if type(key) == "string" and key:find(" ", 1, true) then
|
||||
key = '"' .. key .. '"'
|
||||
else
|
||||
key = tostring(key)
|
||||
end
|
||||
|
||||
if type(v) == "table" and next(v) ~= nil then
|
||||
if not noprint then
|
||||
env.info(string.rep(" ", indent) .. tostring(k) .. " = {")
|
||||
env.info(string.rep(" ", indent) .. key .. " = {")
|
||||
end
|
||||
text = text ..string.rep(" ", indent) .. tostring(k) .. " = {\n"
|
||||
text = text .. tostring(UTILS.PrintTableToLog(v, indent + 1), noprint).."\n"
|
||||
|
||||
text = text .. string.rep(" ", indent) .. key .. " = {\n"
|
||||
text = text .. UTILS.PrintTableToLog(v, indent + 1, noprint, maxDepth, seen)
|
||||
text = text .. string.rep(" ", indent) .. "},\n"
|
||||
|
||||
if not noprint then
|
||||
env.info(string.rep(" ", indent) .. "},")
|
||||
end
|
||||
text = text .. string.rep(" ", indent) .. "},\n"
|
||||
|
||||
elseif type(v) == "function" then
|
||||
-- skip functions (optional: log "<function>")
|
||||
else
|
||||
local value
|
||||
if tostring(v) == "true" or tostring(v) == "false" or tonumber(v) ~= nil then
|
||||
value=v
|
||||
if type(v) == "boolean" or type(v) == "number" then
|
||||
value = tostring(v)
|
||||
else
|
||||
value = '"'..tostring(v)..'"'
|
||||
value = '"' .. tostring(v) .. '"'
|
||||
end
|
||||
|
||||
if not noprint then
|
||||
env.info(string.rep(" ", indent) .. tostring(k) .. " = " .. tostring(value)..",\n")
|
||||
env.info(string.rep(" ", indent) .. key .. " = " .. value .. ",")
|
||||
end
|
||||
text = text .. string.rep(" ", indent) .. tostring(k) .. " = " .. tostring(value)..",\n"
|
||||
text = text .. string.rep(" ", indent) .. key .. " = " .. value .. ",\n"
|
||||
end
|
||||
end
|
||||
|
||||
return text
|
||||
end
|
||||
|
||||
@@ -1339,7 +1373,7 @@ function UTILS.ClockToSeconds(clock)
|
||||
end
|
||||
|
||||
--- Display clock and mission time on screen as a message to all.
|
||||
-- @param #number duration Duration in seconds how long the time is displayed. Default is 5 seconds.
|
||||
-- @param #number duration (Optional) Duration in seconds how long the time is displayed. Default is 5 seconds.
|
||||
function UTILS.DisplayMissionTime(duration)
|
||||
duration=duration or 5
|
||||
local Tnow=timer.getAbsTime()
|
||||
@@ -1353,7 +1387,7 @@ end
|
||||
|
||||
--- Replace illegal characters [<>|/?*:\\] in a string.
|
||||
-- @param #string Text Input text.
|
||||
-- @param #string ReplaceBy Replace illegal characters by this character or string. Default underscore "_".
|
||||
-- @param #string ReplaceBy (Optional) Replace illegal characters by this character or string. Default underscore "_".
|
||||
-- @return #string The input text with illegal chars replaced.
|
||||
function UTILS.ReplaceIllegalCharacters(Text, ReplaceBy)
|
||||
ReplaceBy=ReplaceBy or "_"
|
||||
@@ -2227,7 +2261,7 @@ function UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, Rising, Tlocal)
|
||||
-- @param #number Latitude Latitude.
|
||||
-- @param #number Longitude Longitude.
|
||||
-- @param #boolean Rising If true, calc sun rise, or sun set otherwise.
|
||||
-- @param #number Tlocal Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0.
|
||||
-- @param #number Tlocal (Optional) Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0.
|
||||
-- @return #number Sun rise in seconds of the day.
|
||||
function UTILS.GetSunrise(Day, Month, Year, Latitude, Longitude, Tlocal)
|
||||
|
||||
@@ -2243,7 +2277,7 @@ end
|
||||
-- @param #number Latitude Latitude.
|
||||
-- @param #number Longitude Longitude.
|
||||
-- @param #boolean Rising If true, calc sun rise, or sun set otherwise.
|
||||
-- @param #number Tlocal Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0.
|
||||
-- @param #number Tlocal (Optional) Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0.
|
||||
-- @return #number Sun rise in seconds of the day.
|
||||
function UTILS.GetSunset(Day, Month, Year, Latitude, Longitude, Tlocal)
|
||||
|
||||
@@ -2344,6 +2378,11 @@ function UTILS.IsLoadingDoorOpen( unit_name )
|
||||
BASE:T(unit_name .. " front door(s) are open or doors removed")
|
||||
return true
|
||||
end
|
||||
|
||||
if type_name == "Ka-50_3" and unit:getDrawArgumentValue(38) == 1 then
|
||||
BASE:T(unit_name .. " cockpit door is open")
|
||||
return true
|
||||
end
|
||||
|
||||
if type_name=="C-130J-30" and (unit:getDrawArgumentValue(86)==1)then
|
||||
BASE:T(unit_name.." rear doors are open")
|
||||
@@ -2921,12 +2960,12 @@ end
|
||||
-- @param #boolean Reduce If false, existing loaded groups will not be reduced to fit the saved number.
|
||||
-- @param #boolean Structured (Optional, needs Reduce = true) If true, and the data has been saved as structure before, remove the correct unit types as per the saved list.
|
||||
-- @param #boolean Cinematic (Optional, needs Structured = true) If true, place a fire/smoke effect on the dead static position.
|
||||
-- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @param #boolean Resurrection If true, dead units can be restored on load. Defaults to false.
|
||||
-- @param #number ResurrectPercentage Use this percentage of probability to resurrect a unit. [0..100], defaults to 25.
|
||||
-- @param #number Healmin If set, life points of a resurrected unit will be randomly restored to min this percentage. [0..100], defaults to 25.
|
||||
-- @param #number Healmax If set, life points of a resurrected unit will be randomly restored to max this percentage. [0..100], defaults to 75.
|
||||
-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @param #boolean Resurrection (Optional) If true, dead units can be restored on load. Defaults to false.
|
||||
-- @param #number ResurrectPercentage (Optional) Use this percentage of probability to resurrect a unit. [0..100], defaults to 25.
|
||||
-- @param #number Healmin (Optional) If set, life points of a resurrected unit will be randomly restored to min this percentage. [0..100], defaults to 25.
|
||||
-- @param #number Healmax (Optional) If set, life points of a resurrected unit will be randomly restored to max this percentage. [0..100], defaults to 75.
|
||||
-- @return #table Table of data objects (tables) containing groupname, coordinate and group object. Returns nil when file cannot be read.
|
||||
-- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )`
|
||||
function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce,Structured,Cinematic,Effect,Density,Resurrection,ResurrectPercentage,Healmin,Healmax)
|
||||
@@ -3049,8 +3088,8 @@ end
|
||||
-- @param #boolean Spawn If set to false, do not re-spawn the groups loaded in location and reduce to size.
|
||||
-- @param #boolean Structured (Optional, needs Spawn=true)If true, and the data has been saved as structure before, remove the correct unit types as per the saved list.
|
||||
-- @param #boolean Cinematic (Optional, needs Structured=true) If true, place a fire/smoke effect on the dead static position.
|
||||
-- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @return Core.Set#SET_GROUP Set of GROUP objects.
|
||||
-- Returns nil when file cannot be read. Returns a table of data entries if Spawn is false: `{ groupname=groupname, size=size, coordinate=coordinate, template=template }`
|
||||
-- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )`
|
||||
@@ -3235,8 +3274,8 @@ end
|
||||
-- @param #boolean Reduce If false, do not destroy the units with size=0.
|
||||
-- @param #boolean Dead (Optional, needs Reduce = true) If Dead is true, re-spawn the dead object as dead and do not just delete it.
|
||||
-- @param #boolean Cinematic (Optional, needs Dead = true) If true, place a fire/smoke effect on the dead static position.
|
||||
-- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke.
|
||||
-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5.
|
||||
-- @return #table Table of data objects (tables) containing staticname, size (0=dead else 1), coordinate and the static object. Dead objects will have coordinate points `{x=0,y=0,z=0}`
|
||||
-- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )`
|
||||
-- Returns nil when file cannot be read.
|
||||
@@ -3405,13 +3444,13 @@ end
|
||||
--- Helper function to plot a racetrack on the F10 Map - curtesy of Buur.
|
||||
-- @param Core.Point#COORDINATE Coordinate
|
||||
-- @param #number Altitude Altitude in feet
|
||||
-- @param #number Speed Speed in knots
|
||||
-- @param #number Heading Heading in degrees
|
||||
-- @param #number Leg Leg in NM
|
||||
-- @param #number Coalition Coalition side, e.g. coaltion.side.RED or coaltion.side.BLUE
|
||||
-- @param #table Color Color of the line in RGB, e.g. {1,0,0} for red
|
||||
-- @param #number Alpha Transparency factor, between 0.1 and 1
|
||||
-- @param #number LineType Line type to be used, line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #number Speed (Optional) Speed in knots. Defaults to 350.
|
||||
-- @param #number Heading (Optional) Heading in degrees. Defaults to 270.
|
||||
-- @param #number Leg (Optional) Leg in NM. Defaults to 10nm.
|
||||
-- @param #number Coalition (Optional) Coalition side, e.g. coaltion.side.RED or coaltion.side.BLUE. Defaults to -1.
|
||||
-- @param #table Color (Optional) Color of the line in RGB, e.g. {1,0,0} for red, Defaults to {1,0,0}.
|
||||
-- @param #number Alpha (Optional) Transparency factor, between 0.1 and 1. Defaults to 1.
|
||||
-- @param #number LineType (Optional) Line type to be used, line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.
|
||||
-- @param #boolean ReadOnly
|
||||
function UTILS.PlotRacetrack(Coordinate, Altitude, Speed, Heading, Leg, Coalition, Color, Alpha, LineType, ReadOnly)
|
||||
local fix_coordinate = Coordinate
|
||||
@@ -4112,9 +4151,10 @@ end
|
||||
|
||||
--- Get a NATO abbreviated MGRS text for SRS use, optionally with prosody slow tag
|
||||
-- @param #string Text The input string, e.g. "MGRS 4Q FJ 12345 67890"
|
||||
-- @param #boolean Slow Optional - add slow tags
|
||||
-- @param #boolean Slow Optional - add slow tags, if the backend is not Hound
|
||||
-- @param #string Backend The TTS Backend used
|
||||
-- @return #string Output for (Slow) spelling in SRS TTS e.g. "MGRS;<prosody rate="slow">4;Quebec;Foxtrot;Juliett;1;2;3;4;5;6;7;8;niner;zero;</prosody>"
|
||||
function UTILS.MGRSStringToSRSFriendly(Text,Slow)
|
||||
function UTILS.MGRSStringToSRSFriendly(Text,Slow,Backend)
|
||||
local Text = string.gsub(Text,"MGRS ","")
|
||||
Text = string.gsub(Text,"%s+","")
|
||||
Text = string.gsub(Text,"([%a%d])","%1;") -- "0;5;1;"
|
||||
@@ -4146,7 +4186,7 @@ function UTILS.MGRSStringToSRSFriendly(Text,Slow)
|
||||
Text = string.gsub(Text,"Z","Zulu")
|
||||
Text = string.gsub(Text,"0","zero")
|
||||
Text = string.gsub(Text,"9","niner")
|
||||
if Slow then
|
||||
if Slow and Backend ~= nil and Backend ~= MSRS.Backend.HOUND then
|
||||
Text = '<prosody rate="slow">'..Text..'</prosody>'
|
||||
end
|
||||
Text = "MGRS;"..Text
|
||||
@@ -4213,7 +4253,7 @@ function UTILS.ReadCSV(filename)
|
||||
end
|
||||
|
||||
--- Seed the LCG random number generator.
|
||||
-- @param #number seed Seed value. Default is a random number using math.random()
|
||||
-- @param #number seed (Optional) Seed value. Default is a random number using math.random()
|
||||
function UTILS.LCGRandomSeed(seed)
|
||||
UTILS.lcg = {
|
||||
seed = seed or math.random(1, 2^32 - 1),
|
||||
@@ -4227,7 +4267,7 @@ end
|
||||
-- @return #number Random number between 0 and 1.
|
||||
function UTILS.LCGRandom()
|
||||
if UTILS.lcg == nil then
|
||||
UTILS.LCGRandomSeed()
|
||||
UTILS.LCGRandomSeed(timer.getTime())
|
||||
end
|
||||
UTILS.lcg.seed = (UTILS.lcg.a * UTILS.lcg.seed + UTILS.lcg.c) % UTILS.lcg.m
|
||||
return UTILS.lcg.seed / UTILS.lcg.m
|
||||
@@ -4277,24 +4317,24 @@ end
|
||||
-- References: [DCS Forum Topic](https://forum.dcs.world/topic/282989-farp-equipment-to-run-it)
|
||||
-- @param #string Name Name of this FARP installation. Must be unique.
|
||||
-- @param Core.Point#COORDINATE Coordinate Where to spawn the FARP.
|
||||
-- @param #string FARPType Type of FARP, can be one of the known types ENUMS.FARPType.FARP, ENUMS.FARPType.INVISIBLE, ENUMS.FARPType.HELIPADSINGLE, ENUMS.FARPType.PADSINGLE. Defaults to ENUMS.FARPType.FARP.
|
||||
-- @param #number Coalition Coalition of this FARP, i.e. coalition.side.BLUE or coalition.side.RED, defaults to coalition.side.BLUE.
|
||||
-- @param #number Country Country of this FARP, defaults to country.id.USA (blue) or country.id.RUSSIA (red).
|
||||
-- @param #number CallSign Callsign of the FARP ATC, defaults to CALLSIGN.FARP.Berlin.
|
||||
-- @param #number Frequency Frequency of the FARP ATC Radio, defaults to 127.5 (MHz).
|
||||
-- @param #number Modulation Modulation of the FARP ATC Radio, defaults to radio.modulation.AM.
|
||||
-- @param #string FARPType (Optional) Type of FARP, can be one of the known types ENUMS.FARPType.FARP, ENUMS.FARPType.INVISIBLE, ENUMS.FARPType.HELIPADSINGLE, ENUMS.FARPType.PADSINGLE. Defaults to ENUMS.FARPType.FARP.
|
||||
-- @param #number Coalition (Optional) Coalition of this FARP, i.e. coalition.side.BLUE or coalition.side.RED, defaults to coalition.side.BLUE.
|
||||
-- @param #number Country (Optional) Country of this FARP, defaults to country.id.USA (blue) or country.id.RUSSIA (red).
|
||||
-- @param #number CallSign (Optional) Callsign of the FARP ATC, defaults to CALLSIGN.FARP.Berlin.
|
||||
-- @param #number Frequency (Optional) Frequency of the FARP ATC Radio, defaults to 127.5 (MHz).
|
||||
-- @param #number Modulation (Optional) Modulation of the FARP ATC Radio, defaults to radio.modulation.AM.
|
||||
-- @param #number ADF ADF Beacon (FM) Frequency in KHz, e.g. 428. If not nil, creates an VHF/FM ADF Beacon for this FARP. Requires a sound called "beacon.ogg" to be in the mission (trigger "sound to" ...)
|
||||
-- @param #number SpawnRadius Radius of the FARP, i.e. where the FARP objects will be placed in meters, not more than 150m away. Defaults to 100.
|
||||
-- @param #number SpawnRadius (Optional) Radius of the FARP, i.e. where the FARP objects will be placed in meters, not more than 150m away. Defaults to 100.
|
||||
-- @param #string VehicleTemplate, template name for additional vehicles. Can be nil for no additional vehicles.
|
||||
-- @param #number Liquids Tons of fuel to be added initially to the FARP. Defaults to 10 (tons). Set to 0 for no fill.
|
||||
-- @param #number Equipment Number of equipment items per known item to be added initially to the FARP. Defaults to 10 (items). Set to 0 for no fill.
|
||||
-- @param #number Liquids (Optional) Tons of fuel to be added initially to the FARP. Defaults to 10 (tons). Set to 0 for no fill.
|
||||
-- @param #number Equipment(Optional) Number of equipment items per known item to be added initially to the FARP. Defaults to 10 (items). Set to 0 for no fill.
|
||||
-- @param #number Airframes Number of helicopter airframes per known type in Ops.CSAR#CSAR.AircraftType to be added initially to the FARP. Set to 0 for no airframes.
|
||||
-- @param #string F10Text Text to display on F10 map if given. Handy to post things like the ADF beacon Frequency, Callsign and ATC Frequency.
|
||||
-- @param #boolean DynamicSpawns If true, allow Dynamic Spawns from this FARP.
|
||||
-- @param #boolean HotStart If true and DynamicSpawns is true, allow hot starts for Dynamic Spawns from this FARP.
|
||||
-- @param #number NumberPads If given, spawn this number of pads.
|
||||
-- @param #number SpacingX For NumberPads > 1, space this many meters horizontally. Defaults to 100.
|
||||
-- @param #number SpacingY For NumberPads > 1, space this many meters vertically. Defaults to 100.
|
||||
-- @param #number SpacingX (Optional) For NumberPads > 1, space this many meters horizontally. Defaults to 100.
|
||||
-- @param #number SpacingY (Optional) For NumberPads > 1, space this many meters vertically. Defaults to 100.
|
||||
-- @return #list<Wrapper.Static#STATIC> Table of spawned objects and vehicle object (if given).
|
||||
-- @return #string ADFBeaconName Name of the ADF beacon, to be able to remove/stop it later.
|
||||
-- @return #number MarkerID ID of the F10 Text, to be able to remove it later.
|
||||
@@ -4479,9 +4519,9 @@ end
|
||||
-- @param #number ADF (Optional) ADF Frequency in kHz (Kilohertz), if given activate an ADF Beacon at the location of the MASH.
|
||||
-- @param #string Livery (Optional) The livery of the static CH-47, defaults to dark green.
|
||||
-- @param #boolean DeployHelo (Optional) If true, deploy the helicopter static.
|
||||
-- @param #number MASHRadio MASH Radio Frequency, defaults to 127.5.
|
||||
-- @param #number MASHRadioModulation MASH Radio Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #number MASHCallsign Defaults to CALLSIGN.FARP.Berlin.
|
||||
-- @param #number MASHRadio (Optional) MASH Radio Frequency, defaults to 127.5.
|
||||
-- @param #number MASHRadioModulation (Optional) MASH Radio Modulation, defaults to radio.modulation.AM.
|
||||
-- @param #number MASHCallsign (Optional) Defaults to CALLSIGN.FARP.Berlin.
|
||||
-- @param #table Templates (Optional) You can hand in your own template table of numbered(!) entries. Each entry consist of a relative(!) x,y position and data of a
|
||||
-- static, shape_name is optional. Also, livery_id is optional, but is applied to the helicopter static only.
|
||||
-- @return #table Table of Wrapper.Static#STATIC objects that were spawned.
|
||||
@@ -4825,13 +4865,13 @@ end
|
||||
|
||||
--- Show a picture on the screen to all
|
||||
-- @param #string FileName File name of the picture
|
||||
-- @param #number Duration Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right
|
||||
-- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom
|
||||
-- @param #number Size Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size
|
||||
-- @param #number Duration (Optional) Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1.
|
||||
-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1.
|
||||
-- @param #number Size (Optional) Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0.
|
||||
function UTILS.ShowPictureToAll(FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits)
|
||||
ClearView = ClearView or false
|
||||
StartDelay = StartDelay or 0
|
||||
@@ -4848,13 +4888,13 @@ end
|
||||
--- Show a picture on the screen to Coalition
|
||||
-- @param #number Coalition Coalition ID, can be coalition.side.BLUE, coalition.side.RED or coalition.side.NEUTRAL
|
||||
-- @param #string FileName File name of the picture
|
||||
-- @param #number Duration Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right
|
||||
-- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom
|
||||
-- @param #number Size Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size
|
||||
-- @param #number Duration (Optional) Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1.
|
||||
-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1.
|
||||
-- @param #number Size (Optional) Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0.
|
||||
function UTILS.ShowPictureToCoalition(Coalition, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits)
|
||||
ClearView = ClearView or false
|
||||
StartDelay = StartDelay or 0
|
||||
@@ -4873,13 +4913,13 @@ end
|
||||
--- Show a picture on the screen to Country
|
||||
-- @param #number Country Country ID, can be country.id.USA, country.id.RUSSIA, etc.
|
||||
-- @param #string FileName File name of the picture
|
||||
-- @param #number Duration Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right
|
||||
-- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom
|
||||
-- @param #number Size Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size
|
||||
-- @param #number Duration (Optional) Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1.
|
||||
-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1.
|
||||
-- @param #number Size(Optional) Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0.
|
||||
function UTILS.ShowPictureToCountry(Country, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits)
|
||||
ClearView = ClearView or false
|
||||
StartDelay = StartDelay or 0
|
||||
@@ -4896,13 +4936,13 @@ end
|
||||
--- Show a picture on the screen to Group
|
||||
-- @param Wrapper.Group#GROUP Group Group to show the picture to
|
||||
-- @param #string FileName File name of the picture
|
||||
-- @param #number Duration Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right
|
||||
-- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom
|
||||
-- @param #number Size Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size
|
||||
-- @param #number Duration (Optional) Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1.
|
||||
-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1.
|
||||
-- @param #number Size (Optional) Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0.
|
||||
function UTILS.ShowPictureToGroup(Group, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits)
|
||||
ClearView = ClearView or false
|
||||
StartDelay = StartDelay or 0
|
||||
@@ -4919,13 +4959,13 @@ end
|
||||
--- Show a picture on the screen to Unit
|
||||
-- @param Wrapper.Unit#UNIT Unit Unit to show the picture to
|
||||
-- @param #string FileName File name of the picture
|
||||
-- @param #number Duration Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right
|
||||
-- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom
|
||||
-- @param #number Size Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size
|
||||
-- @param #number Duration (Optional) Duration in seconds, defaults to 10
|
||||
-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false
|
||||
-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0
|
||||
-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1.
|
||||
-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1.
|
||||
-- @param #number Size (Optional) Size of the picture in percent, defaults to 100
|
||||
-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0.
|
||||
function UTILS.ShowPictureToUnit(Unit, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits)
|
||||
ClearView = ClearView or false
|
||||
StartDelay = StartDelay or 0
|
||||
@@ -4947,8 +4987,8 @@ end
|
||||
|
||||
--- Set the mission briefing for a coalition.
|
||||
-- @param #number Coalition Briefing coalition ID, can be coalition.side.BLUE, coalition.side.RED or coalition.side.NEUTRAL
|
||||
-- @param #string Text Briefing text, can contain newlines, will be converted formatted properly for DCS
|
||||
-- @param #string Picture Picture file path, can be a file in the DEFAULT folder inside the .miz
|
||||
-- @param #string Text Briefing text, can contain newlines, will be converted formatted properly for DCS.
|
||||
-- @param #string Picture (Optional) Picture file path, can be a file in the DEFAULT folder inside the .miz. Defaults to "".
|
||||
function UTILS.SetMissionBriefing(Coalition, Text, Picture)
|
||||
Text = Text or ""
|
||||
Text = Text:gsub("\n", "\\n")
|
||||
@@ -5521,7 +5561,7 @@ end
|
||||
function UTILS.CalculateInterceptBearing(A1, V1, A2, V2_speed)
|
||||
|
||||
local function berechne_bearing(richtung)
|
||||
local bearing = math.deg(math.atan2(richtung.x, richtung.y))
|
||||
local bearing = math.deg(math.atan2(richtung.x, richtung.z))
|
||||
if bearing < 0 then
|
||||
bearing = bearing + 360
|
||||
end
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
-- @field #boolean isAirdrome Airbase is an airdrome.
|
||||
-- @field #boolean isHelipad Airbase is a helipad.
|
||||
-- @field #boolean isShip Airbase is a ship.
|
||||
-- @field #boolean isZell Airbase is a ZELL Booster.
|
||||
-- @field #table parking Parking spot data.
|
||||
-- @field #table parkingByID Parking spot data table with ID as key.
|
||||
-- @field #table parkingWhitelist List of parking spot terminal IDs considered for spawning.
|
||||
@@ -458,115 +459,420 @@ AIRBASE.TheChannel = {
|
||||
|
||||
--- Airbases of the Syria map
|
||||
--
|
||||
-- * `AIRBASE.Syria.Abu_al_Duhur` Abu al-Duhur
|
||||
-- * `AIRBASE.Syria.Adana_Sakirpasa` Adana Sakirpasa
|
||||
-- * `AIRBASE.Syria.Akrotiri` Akrotiri
|
||||
-- * `AIRBASE.Syria.Al_Qusayr` Al Qusayr
|
||||
-- * `AIRBASE.Syria.Al_Dumayr` Al-Dumayr
|
||||
-- * `AIRBASE.Syria.Aleppo` Aleppo
|
||||
-- * `AIRBASE.Syria.An_Nasiriyah` An Nasiriyah
|
||||
-- * `AIRBASE.Syria.At_Tanf` At Tanf
|
||||
-- * `AIRBASE.Syria.Bassel_Al_Assad` Bassel Al-Assad
|
||||
-- * `AIRBASE.Syria.Beirut_Rafic_Hariri` Beirut-Rafic Hariri
|
||||
-- * `AIRBASE.Syria.Ben_Gurion` Ben Gurion
|
||||
-- * `AIRBASE.Syria.Damascus` Damascus
|
||||
-- * `AIRBASE.Syria.Deir_ez_Zor` Deir ez-Zor
|
||||
-- * `AIRBASE.Syria.Ercan` Ercan
|
||||
-- * `AIRBASE.Syria.Eyn_Shemer` Eyn Shemer
|
||||
-- * `AIRBASE.Syria.Gaziantep` Gaziantep
|
||||
-- * `AIRBASE.Syria.Gazipasa` Gazipasa
|
||||
-- * `AIRBASE.Syria.Gecitkale` Gecitkale
|
||||
-- * `AIRBASE.Syria.H` H
|
||||
-- * `AIRBASE.Syria.H3` H3
|
||||
-- * `AIRBASE.Syria.H3_Northwest` H3 Northwest
|
||||
-- * `AIRBASE.Syria.H3_Southwest` H3 Southwest
|
||||
-- * `AIRBASE.Syria.H4` H4
|
||||
-- * `AIRBASE.Syria.Haifa` Haifa
|
||||
-- * `AIRBASE.Syria.Hama` Hama
|
||||
-- * `AIRBASE.Syria.Hatay` Hatay
|
||||
-- * `AIRBASE.Syria.Hatzor` Hatzor
|
||||
-- * `AIRBASE.Syria.Herzliya` Herzliya
|
||||
-- * `AIRBASE.Syria.Incirlik` Incirlik
|
||||
-- * `AIRBASE.Syria.Jirah` Jirah
|
||||
-- * `AIRBASE.Syria.Khalkhalah` Khalkhalah
|
||||
-- * `AIRBASE.Syria.Kharab_Ishk` Kharab Ishk
|
||||
-- * `AIRBASE.Syria.King_Abdullah_II` King Abdullah II
|
||||
-- * `AIRBASE.Syria.King_Hussein_Air_College` King Hussein Air College
|
||||
-- * `AIRBASE.Syria.Kingsfield` Kingsfield
|
||||
-- * `AIRBASE.Syria.Kiryat_Shmona` Kiryat Shmona
|
||||
-- * `AIRBASE.Syria.Kuweires` Kuweires
|
||||
-- * `AIRBASE.Syria.Lakatamia` Lakatamia
|
||||
-- * `AIRBASE.Syria.Larnaca` Larnaca
|
||||
-- * `AIRBASE.Syria.Marj_Ruhayyil` Marj Ruhayyil
|
||||
-- * `AIRBASE.Syria.Marj_as_Sultan_North` Marj as Sultan North
|
||||
-- * `AIRBASE.Syria.Marj_as_Sultan_South` Marj as Sultan South
|
||||
-- * `AIRBASE.Syria.Marka` Marka
|
||||
-- * `AIRBASE.Syria.Megiddo` Megiddo
|
||||
-- * `AIRBASE.Syria.Mezzeh` Mezzeh
|
||||
-- * `AIRBASE.Syria.Minakh` Minakh
|
||||
-- * `AIRBASE.Syria.Muwaffaq_Salti` Muwaffaq Salti
|
||||
-- * `AIRBASE.Syria.Naqoura` Naqoura
|
||||
-- * `AIRBASE.Syria.Nicosia` Nicosia
|
||||
-- * `AIRBASE.Syria.Palmachim` Palmachim
|
||||
-- * `AIRBASE.Syria.Palmyra` Palmyra
|
||||
-- * `AIRBASE.Syria.Paphos` Paphos
|
||||
-- * `AIRBASE.Syria.Pinarbashi` Pinarbashi
|
||||
-- * `AIRBASE.Syria.Prince_Hassan` Prince Hassan
|
||||
-- * `AIRBASE.Syria.Qabr_as_Sitt` Qabr as Sitt
|
||||
-- * `AIRBASE.Syria.Ramat_David` Ramat David
|
||||
-- * `AIRBASE.Syria.Rayak` Rayak
|
||||
-- * `AIRBASE.Syria.Rene_Mouawad` Rene Mouawad
|
||||
-- * `AIRBASE.Syria.Rosh_Pina` Rosh Pina
|
||||
-- * `AIRBASE.Syria.Ruwayshid` Ruwayshid
|
||||
-- * `AIRBASE.Syria.Sanliurfa` Sanliurfa
|
||||
-- * `AIRBASE.Syria.Sayqal` Sayqal
|
||||
-- * `AIRBASE.Syria.Shayrat` Shayrat
|
||||
-- * `AIRBASE.Syria.Tabqa` Tabqa
|
||||
-- * `AIRBASE.Syria.Taftanaz` Taftanaz
|
||||
-- * `AIRBASE.Syria.Tal_Siman` Tal Siman
|
||||
-- * `AIRBASE.Syria.Tel_Nof` Tel Nof
|
||||
-- * `AIRBASE.Syria.Tha_lah` Tha'lah
|
||||
-- * `AIRBASE.Syria.Tiyas` Tiyas
|
||||
-- * `AIRBASE.Syria.Wujah_Al_Hajar` Wujah Al Hajar
|
||||
-- * AIRBASE.Syria.Abu_al_Duhur
|
||||
-- * AIRBASE.Syria.Adana_Sakirpasa
|
||||
-- * AIRBASE.Syria.Adiyaman
|
||||
-- * AIRBASE.Syria.Akrotiri
|
||||
-- * AIRBASE.Syria.Al_Dumayr
|
||||
-- * AIRBASE.Syria.Al_Qusayr
|
||||
-- * AIRBASE.Syria.Aleppo
|
||||
-- * AIRBASE.Syria.An_Nasiriyah
|
||||
-- * AIRBASE.Syria.At_Tanf
|
||||
-- * AIRBASE.Syria.Bassel_Al_Assad
|
||||
-- * AIRBASE.Syria.Beirut_Rafic_Hariri
|
||||
-- * AIRBASE.Syria.Ben_Gurion
|
||||
-- * AIRBASE.Syria.Chukurova
|
||||
-- * AIRBASE.Syria.Damascus
|
||||
-- * AIRBASE.Syria.Deir_ez_Zor
|
||||
-- * AIRBASE.Syria.Diyarbakir
|
||||
-- * AIRBASE.Syria.Ercan
|
||||
-- * AIRBASE.Syria.Eyn_Shemer
|
||||
-- * AIRBASE.Syria.Gaziantep
|
||||
-- * AIRBASE.Syria.Gazipasa
|
||||
-- * AIRBASE.Syria.Gecitkale
|
||||
-- * AIRBASE.Syria.Gulechoba
|
||||
-- * AIRBASE.Syria.H3
|
||||
-- * AIRBASE.Syria.H3_Northwest
|
||||
-- * AIRBASE.Syria.H3_Southwest
|
||||
-- * AIRBASE.Syria.H4
|
||||
-- * AIRBASE.Syria.H4_Emergency
|
||||
-- * AIRBASE.Syria.HC01
|
||||
-- * AIRBASE.Syria.HC02
|
||||
-- * AIRBASE.Syria.HC03
|
||||
-- * AIRBASE.Syria.HC04
|
||||
-- * AIRBASE.Syria.HC05
|
||||
-- * AIRBASE.Syria.HC06
|
||||
-- * AIRBASE.Syria.HI01
|
||||
-- * AIRBASE.Syria.HI02
|
||||
-- * AIRBASE.Syria.HI03
|
||||
-- * AIRBASE.Syria.HI05
|
||||
-- * AIRBASE.Syria.HI06
|
||||
-- * AIRBASE.Syria.HI07
|
||||
-- * AIRBASE.Syria.HI08
|
||||
-- * AIRBASE.Syria.HI09
|
||||
-- * AIRBASE.Syria.HI11
|
||||
-- * AIRBASE.Syria.HI12
|
||||
-- * AIRBASE.Syria.HI13
|
||||
-- * AIRBASE.Syria.HI14
|
||||
-- * AIRBASE.Syria.HI15
|
||||
-- * AIRBASE.Syria.HI16
|
||||
-- * AIRBASE.Syria.HI17
|
||||
-- * AIRBASE.Syria.HI18
|
||||
-- * AIRBASE.Syria.HI20
|
||||
-- * AIRBASE.Syria.HI21
|
||||
-- * AIRBASE.Syria.HI22
|
||||
-- * AIRBASE.Syria.HI23
|
||||
-- * AIRBASE.Syria.HI24
|
||||
-- * AIRBASE.Syria.HI25
|
||||
-- * AIRBASE.Syria.HI26
|
||||
-- * AIRBASE.Syria.HJ01
|
||||
-- * AIRBASE.Syria.HJ02
|
||||
-- * AIRBASE.Syria.HJ03
|
||||
-- * AIRBASE.Syria.HJ04
|
||||
-- * AIRBASE.Syria.HL01
|
||||
-- * AIRBASE.Syria.HL02
|
||||
-- * AIRBASE.Syria.HL03
|
||||
-- * AIRBASE.Syria.HL04
|
||||
-- * AIRBASE.Syria.HL05
|
||||
-- * AIRBASE.Syria.HL06
|
||||
-- * AIRBASE.Syria.HL07
|
||||
-- * AIRBASE.Syria.HL08
|
||||
-- * AIRBASE.Syria.HL09
|
||||
-- * AIRBASE.Syria.HL10
|
||||
-- * AIRBASE.Syria.HL11
|
||||
-- * AIRBASE.Syria.HL12
|
||||
-- * AIRBASE.Syria.HL13
|
||||
-- * AIRBASE.Syria.HMed00
|
||||
-- * AIRBASE.Syria.HMed01
|
||||
-- * AIRBASE.Syria.HMed02
|
||||
-- * AIRBASE.Syria.HMed03
|
||||
-- * AIRBASE.Syria.HMed04
|
||||
-- * AIRBASE.Syria.HMed05
|
||||
-- * AIRBASE.Syria.HMed06
|
||||
-- * AIRBASE.Syria.HMed07
|
||||
-- * AIRBASE.Syria.HMed08
|
||||
-- * AIRBASE.Syria.HMed09
|
||||
-- * AIRBASE.Syria.HMed10
|
||||
-- * AIRBASE.Syria.HMed11
|
||||
-- * AIRBASE.Syria.HMed12
|
||||
-- * AIRBASE.Syria.HMed13
|
||||
-- * AIRBASE.Syria.HMed14
|
||||
-- * AIRBASE.Syria.HMed15
|
||||
-- * AIRBASE.Syria.HMed16
|
||||
-- * AIRBASE.Syria.HMed17
|
||||
-- * AIRBASE.Syria.HMed18
|
||||
-- * AIRBASE.Syria.HMed19
|
||||
-- * AIRBASE.Syria.HMed20
|
||||
-- * AIRBASE.Syria.HMed21
|
||||
-- * AIRBASE.Syria.HMed22
|
||||
-- * AIRBASE.Syria.HMed23
|
||||
-- * AIRBASE.Syria.HMed24
|
||||
-- * AIRBASE.Syria.HMed25
|
||||
-- * AIRBASE.Syria.HMed26
|
||||
-- * AIRBASE.Syria.HMed27
|
||||
-- * AIRBASE.Syria.HMed28
|
||||
-- * AIRBASE.Syria.HMed29
|
||||
-- * AIRBASE.Syria.HMed30
|
||||
-- * AIRBASE.Syria.HOil01
|
||||
-- * AIRBASE.Syria.HOil02
|
||||
-- * AIRBASE.Syria.HOil03
|
||||
-- * AIRBASE.Syria.HOil04
|
||||
-- * AIRBASE.Syria.HOil05
|
||||
-- * AIRBASE.Syria.HOil06
|
||||
-- * AIRBASE.Syria.HS02
|
||||
-- * AIRBASE.Syria.HS03
|
||||
-- * AIRBASE.Syria.HS04
|
||||
-- * AIRBASE.Syria.HS05
|
||||
-- * AIRBASE.Syria.HS06
|
||||
-- * AIRBASE.Syria.HS07
|
||||
-- * AIRBASE.Syria.HS08
|
||||
-- * AIRBASE.Syria.HS09
|
||||
-- * AIRBASE.Syria.HS10
|
||||
-- * AIRBASE.Syria.HS11
|
||||
-- * AIRBASE.Syria.HS12
|
||||
-- * AIRBASE.Syria.HS13
|
||||
-- * AIRBASE.Syria.HS14
|
||||
-- * AIRBASE.Syria.HS15
|
||||
-- * AIRBASE.Syria.HS16
|
||||
-- * AIRBASE.Syria.HS17
|
||||
-- * AIRBASE.Syria.HS18
|
||||
-- * AIRBASE.Syria.HS19
|
||||
-- * AIRBASE.Syria.HS20
|
||||
-- * AIRBASE.Syria.HS21
|
||||
-- * AIRBASE.Syria.HS22
|
||||
-- * AIRBASE.Syria.HS23
|
||||
-- * AIRBASE.Syria.HS24
|
||||
-- * AIRBASE.Syria.HS25
|
||||
-- * AIRBASE.Syria.HS26
|
||||
-- * AIRBASE.Syria.HS27
|
||||
-- * AIRBASE.Syria.HS28
|
||||
-- * AIRBASE.Syria.HS29
|
||||
-- * AIRBASE.Syria.HS30
|
||||
-- * AIRBASE.Syria.HS31
|
||||
-- * AIRBASE.Syria.HS32
|
||||
-- * AIRBASE.Syria.HS33
|
||||
-- * AIRBASE.Syria.HS34
|
||||
-- * AIRBASE.Syria.HS35
|
||||
-- * AIRBASE.Syria.HS36
|
||||
-- * AIRBASE.Syria.HS37
|
||||
-- * AIRBASE.Syria.HS38
|
||||
-- * AIRBASE.Syria.HS39
|
||||
-- * AIRBASE.Syria.HS40
|
||||
-- * AIRBASE.Syria.HS41
|
||||
-- * AIRBASE.Syria.HS42
|
||||
-- * AIRBASE.Syria.HStad01
|
||||
-- * AIRBASE.Syria.HStad02
|
||||
-- * AIRBASE.Syria.HStad03
|
||||
-- * AIRBASE.Syria.HStad04
|
||||
-- * AIRBASE.Syria.HStad05
|
||||
-- * AIRBASE.Syria.HStad06
|
||||
-- * AIRBASE.Syria.HT01
|
||||
-- * AIRBASE.Syria.HT02
|
||||
-- * AIRBASE.Syria.H_med_orig_01
|
||||
-- * AIRBASE.Syria.H_med_orig_02
|
||||
-- * AIRBASE.Syria.H_med_orig_03
|
||||
-- * AIRBASE.Syria.H_med_orig_04
|
||||
-- * AIRBASE.Syria.H_med_orig_05
|
||||
-- * AIRBASE.Syria.H_med_orig_06
|
||||
-- * AIRBASE.Syria.H_med_orig_07
|
||||
-- * AIRBASE.Syria.H_med_orig_08
|
||||
-- * AIRBASE.Syria.H_med_orig_09
|
||||
-- * AIRBASE.Syria.Haifa
|
||||
-- * AIRBASE.Syria.Hama
|
||||
-- * AIRBASE.Syria.Hatay
|
||||
-- * AIRBASE.Syria.Hatzerim
|
||||
-- * AIRBASE.Syria.Hatzor
|
||||
-- * AIRBASE.Syria.Herzliya
|
||||
-- * AIRBASE.Syria.Incirlik
|
||||
-- * AIRBASE.Syria.Jirah
|
||||
-- * AIRBASE.Syria.Kahramanmaras
|
||||
-- * AIRBASE.Syria.Kedem
|
||||
-- * AIRBASE.Syria.Khalkhalah
|
||||
-- * AIRBASE.Syria.Kharab_Ishk
|
||||
-- * AIRBASE.Syria.King_Abdullah_II
|
||||
-- * AIRBASE.Syria.King_Hussein_Air_College
|
||||
-- * AIRBASE.Syria.Kingsfield
|
||||
-- * AIRBASE.Syria.Kiryat_Shmona
|
||||
-- * AIRBASE.Syria.Konya
|
||||
-- * AIRBASE.Syria.Kuweires
|
||||
-- * AIRBASE.Syria.Lakatamia
|
||||
-- * AIRBASE.Syria.Larnaca
|
||||
-- * AIRBASE.Syria.Marj_Ruhayyil
|
||||
-- * AIRBASE.Syria.Marj_as_Sultan_North
|
||||
-- * AIRBASE.Syria.Marj_as_Sultan_South
|
||||
-- * AIRBASE.Syria.Marka
|
||||
-- * AIRBASE.Syria.Megiddo
|
||||
-- * AIRBASE.Syria.Mezzeh
|
||||
-- * AIRBASE.Syria.Minakh
|
||||
-- * AIRBASE.Syria.Muwaffaq_Salti
|
||||
-- * AIRBASE.Syria.Naqoura
|
||||
-- * AIRBASE.Syria.Nevatim
|
||||
-- * AIRBASE.Syria.Nicosia
|
||||
-- * AIRBASE.Syria.Palmachim
|
||||
-- * AIRBASE.Syria.Palmyra
|
||||
-- * AIRBASE.Syria.Paphos
|
||||
-- * AIRBASE.Syria.Pinarbashi
|
||||
-- * AIRBASE.Syria.Prince_Hassan
|
||||
-- * AIRBASE.Syria.Qabr_as_Sitt
|
||||
-- * AIRBASE.Syria.Ramat_David
|
||||
-- * AIRBASE.Syria.Rayak
|
||||
-- * AIRBASE.Syria.Rene_Mouawad
|
||||
-- * AIRBASE.Syria.Rosh_Pina
|
||||
-- * AIRBASE.Syria.Ruwayshid
|
||||
-- * AIRBASE.Syria.Sanliurfa
|
||||
-- * AIRBASE.Syria.Sanliurfa_Heliport
|
||||
-- * AIRBASE.Syria.Sayqal
|
||||
-- * AIRBASE.Syria.Shayrat
|
||||
-- * AIRBASE.Syria.T2
|
||||
-- * AIRBASE.Syria.T3
|
||||
-- * AIRBASE.Syria.Tabqa
|
||||
-- * AIRBASE.Syria.Taftanaz
|
||||
-- * AIRBASE.Syria.Tal_Siman
|
||||
-- * AIRBASE.Syria.Tel_Nof
|
||||
-- * AIRBASE.Syria.Teyman
|
||||
-- * AIRBASE.Syria.Tha_lah
|
||||
-- * AIRBASE.Syria.Tiyas
|
||||
-- * AIRBASE.Syria.Wujah_Al_Hajar
|
||||
-- * AIRBASE.Syria.Zarqa
|
||||
|
||||
--
|
||||
-- @field Syria
|
||||
AIRBASE.Syria = {
|
||||
["Abu_al_Duhur"] = "Abu al-Duhur",
|
||||
["Adana_Sakirpasa"] = "Adana Sakirpasa",
|
||||
["Adiyaman"] = "Adiyaman",
|
||||
["Akrotiri"] = "Akrotiri",
|
||||
["Al_Qusayr"] = "Al Qusayr",
|
||||
["Al_Dumayr"] = "Al-Dumayr",
|
||||
["Al_Qusayr"] = "Al Qusayr",
|
||||
["Aleppo"] = "Aleppo",
|
||||
["An_Nasiriyah"] = "An Nasiriyah",
|
||||
["At_Tanf"] = "At Tanf",
|
||||
["Bassel_Al_Assad"] = "Bassel Al-Assad",
|
||||
["Beirut_Rafic_Hariri"] = "Beirut-Rafic Hariri",
|
||||
["Ben_Gurion"] = "Ben Gurion",
|
||||
["Chukurova"] = "Chukurova",
|
||||
["Damascus"] = "Damascus",
|
||||
["Deir_ez_Zor"] = "Deir ez-Zor",
|
||||
["Diyarbakir"] = "Diyarbakir",
|
||||
["Ercan"] = "Ercan",
|
||||
["Eyn_Shemer"] = "Eyn Shemer",
|
||||
["Gaziantep"] = "Gaziantep",
|
||||
["Gazipasa"] = "Gazipasa",
|
||||
["Gecitkale"] = "Gecitkale",
|
||||
["H"] = "H",
|
||||
["Gulechoba"] = "Gulechoba",
|
||||
["H3"] = "H3",
|
||||
["H3_Northwest"] = "H3 Northwest",
|
||||
["H3_Southwest"] = "H3 Southwest",
|
||||
["H4"] = "H4",
|
||||
["H4_Emergency"] = "H4 Emergency",
|
||||
["HC01"] = "HC01",
|
||||
["HC02"] = "HC02",
|
||||
["HC03"] = "HC03",
|
||||
["HC04"] = "HC04",
|
||||
["HC05"] = "HC05",
|
||||
["HC06"] = "HC06",
|
||||
["HI01"] = "HI01",
|
||||
["HI02"] = "HI02",
|
||||
["HI03"] = "HI03",
|
||||
["HI05"] = "HI05",
|
||||
["HI06"] = "HI06",
|
||||
["HI07"] = "HI07",
|
||||
["HI08"] = "HI08",
|
||||
["HI09"] = "HI09",
|
||||
["HI11"] = "HI11",
|
||||
["HI12"] = "HI12",
|
||||
["HI13"] = "HI13",
|
||||
["HI14"] = "HI14",
|
||||
["HI15"] = "HI15",
|
||||
["HI16"] = "HI16",
|
||||
["HI17"] = "HI17",
|
||||
["HI18"] = "HI18",
|
||||
["HI20"] = "HI20",
|
||||
["HI21"] = "HI21",
|
||||
["HI22"] = "HI22",
|
||||
["HI23"] = "HI23",
|
||||
["HI24"] = "HI24",
|
||||
["HI25"] = "HI25",
|
||||
["HI26"] = "HI26",
|
||||
["HJ01"] = "HJ01",
|
||||
["HJ02"] = "HJ02",
|
||||
["HJ03"] = "HJ03",
|
||||
["HJ04"] = "HJ04",
|
||||
["HL01"] = "HL01",
|
||||
["HL02"] = "HL02",
|
||||
["HL03"] = "HL03",
|
||||
["HL04"] = "HL04",
|
||||
["HL05"] = "HL05",
|
||||
["HL06"] = "HL06",
|
||||
["HL07"] = "HL07",
|
||||
["HL08"] = "HL08",
|
||||
["HL09"] = "HL09",
|
||||
["HL10"] = "HL10",
|
||||
["HL11"] = "HL11",
|
||||
["HL12"] = "HL12",
|
||||
["HL13"] = "HL13",
|
||||
["HMed00"] = "HMed00",
|
||||
["HMed01"] = "HMed01",
|
||||
["HMed02"] = "HMed02",
|
||||
["HMed03"] = "HMed03",
|
||||
["HMed04"] = "HMed04",
|
||||
["HMed05"] = "HMed05",
|
||||
["HMed06"] = "HMed06",
|
||||
["HMed07"] = "HMed07",
|
||||
["HMed08"] = "HMed08",
|
||||
["HMed09"] = "HMed09",
|
||||
["HMed10"] = "HMed10",
|
||||
["HMed11"] = "HMed11",
|
||||
["HMed12"] = "HMed12",
|
||||
["HMed13"] = "HMed13",
|
||||
["HMed14"] = "HMed14",
|
||||
["HMed15"] = "HMed15",
|
||||
["HMed16"] = "HMed16",
|
||||
["HMed17"] = "HMed17",
|
||||
["HMed18"] = "HMed18",
|
||||
["HMed19"] = "HMed19",
|
||||
["HMed20"] = "HMed20",
|
||||
["HMed21"] = "HMed21",
|
||||
["HMed22"] = "HMed22",
|
||||
["HMed23"] = "HMed23",
|
||||
["HMed24"] = "HMed24",
|
||||
["HMed25"] = "HMed25",
|
||||
["HMed26"] = "HMed26",
|
||||
["HMed27"] = "HMed27",
|
||||
["HMed28"] = "HMed28",
|
||||
["HMed29"] = "HMed29",
|
||||
["HMed30"] = "HMed30",
|
||||
["HOil01"] = "HOil01",
|
||||
["HOil02"] = "HOil02",
|
||||
["HOil03"] = "HOil03",
|
||||
["HOil04"] = "HOil04",
|
||||
["HOil05"] = "HOil05",
|
||||
["HOil06"] = "HOil06",
|
||||
["HS02"] = "HS02",
|
||||
["HS03"] = "HS03",
|
||||
["HS04"] = "HS04",
|
||||
["HS05"] = "HS05",
|
||||
["HS06"] = "HS06",
|
||||
["HS07"] = "HS07",
|
||||
["HS08"] = "HS08",
|
||||
["HS09"] = "HS09",
|
||||
["HS10"] = "HS10",
|
||||
["HS11"] = "HS11",
|
||||
["HS12"] = "HS12",
|
||||
["HS13"] = "HS13",
|
||||
["HS14"] = "HS14",
|
||||
["HS15"] = "HS15",
|
||||
["HS16"] = "HS16",
|
||||
["HS17"] = "HS17",
|
||||
["HS18"] = "HS18",
|
||||
["HS19"] = "HS19",
|
||||
["HS20"] = "HS20",
|
||||
["HS21"] = "HS21",
|
||||
["HS22"] = "HS22",
|
||||
["HS23"] = "HS23",
|
||||
["HS24"] = "HS24",
|
||||
["HS25"] = "HS25",
|
||||
["HS26"] = "HS26",
|
||||
["HS27"] = "HS27",
|
||||
["HS28"] = "HS28",
|
||||
["HS29"] = "HS29",
|
||||
["HS30"] = "HS30",
|
||||
["HS31"] = "HS31",
|
||||
["HS32"] = "HS32",
|
||||
["HS33"] = "HS33",
|
||||
["HS34"] = "HS34",
|
||||
["HS35"] = "HS35",
|
||||
["HS36"] = "HS36",
|
||||
["HS37"] = "HS37",
|
||||
["HS38"] = "HS38",
|
||||
["HS39"] = "HS39",
|
||||
["HS40"] = "HS40",
|
||||
["HS41"] = "HS41",
|
||||
["HS42"] = "HS42",
|
||||
["HStad01"] = "HStad01",
|
||||
["HStad02"] = "HStad02",
|
||||
["HStad03"] = "HStad03",
|
||||
["HStad04"] = "HStad04",
|
||||
["HStad05"] = "HStad05",
|
||||
["HStad06"] = "HStad06",
|
||||
["HT01"] = "HT01",
|
||||
["HT02"] = "HT02",
|
||||
["H_med_orig_01"] = "H_med_orig_01",
|
||||
["H_med_orig_02"] = "H_med_orig_02",
|
||||
["H_med_orig_03"] = "H_med_orig_03",
|
||||
["H_med_orig_04"] = "H_med_orig_04",
|
||||
["H_med_orig_05"] = "H_med_orig_05",
|
||||
["H_med_orig_06"] = "H_med_orig_06",
|
||||
["H_med_orig_07"] = "H_med_orig_07",
|
||||
["H_med_orig_08"] = "H_med_orig_08",
|
||||
["H_med_orig_09"] = "H_med_orig_09",
|
||||
["Haifa"] = "Haifa",
|
||||
["Hama"] = "Hama",
|
||||
["Hatay"] = "Hatay",
|
||||
["Hatzerim"] = "Hatzerim",
|
||||
["Hatzor"] = "Hatzor",
|
||||
["Herzliya"] = "Herzliya",
|
||||
["Incirlik"] = "Incirlik",
|
||||
["Jirah"] = "Jirah",
|
||||
["Kahramanmaras"] = "Kahramanmaras",
|
||||
["Kedem"] = "Kedem",
|
||||
["Khalkhalah"] = "Khalkhalah",
|
||||
["Kharab_Ishk"] = "Kharab Ishk",
|
||||
["King_Abdullah_II"] = "King Abdullah II",
|
||||
["King_Hussein_Air_College"] = "King Hussein Air College",
|
||||
["Kingsfield"] = "Kingsfield",
|
||||
["Kiryat_Shmona"] = "Kiryat Shmona",
|
||||
["Konya"] = "Konya",
|
||||
["Kuweires"] = "Kuweires",
|
||||
["Lakatamia"] = "Lakatamia",
|
||||
["Larnaca"] = "Larnaca",
|
||||
@@ -579,6 +885,7 @@ AIRBASE.Syria = {
|
||||
["Minakh"] = "Minakh",
|
||||
["Muwaffaq_Salti"] = "Muwaffaq Salti",
|
||||
["Naqoura"] = "Naqoura",
|
||||
["Nevatim"] = "Nevatim",
|
||||
["Nicosia"] = "Nicosia",
|
||||
["Palmachim"] = "Palmachim",
|
||||
["Palmyra"] = "Palmyra",
|
||||
@@ -592,21 +899,26 @@ AIRBASE.Syria = {
|
||||
["Rosh_Pina"] = "Rosh Pina",
|
||||
["Ruwayshid"] = "Ruwayshid",
|
||||
["Sanliurfa"] = "Sanliurfa",
|
||||
["Sanliurfa_Heliport"] = "Sanliurfa Heliport",
|
||||
["Sayqal"] = "Sayqal",
|
||||
["Shayrat"] = "Shayrat",
|
||||
["T2"] = "T2",
|
||||
["T3"] = "T3",
|
||||
["Tabqa"] = "Tabqa",
|
||||
["Taftanaz"] = "Taftanaz",
|
||||
["Tal_Siman"] = "Tal Siman",
|
||||
["Tel_Nof"] = "Tel Nof",
|
||||
["Teyman"] = "Teyman",
|
||||
["Tha_lah"] = "Tha'lah",
|
||||
["Tiyas"] = "Tiyas",
|
||||
["Wujah_Al_Hajar"] = "Wujah Al Hajar",
|
||||
["Zarqa"] = "Zarqa",
|
||||
}
|
||||
|
||||
--- Airbases of the Mariana Islands map
|
||||
--
|
||||
-- * `AIRBASE.MarianaIslands.Andersen_AFB` Andersen AFB
|
||||
-- * `AIRBASE.MarianaIslands.Antonio_B._Won_Pat_Intl` Antonio B. Won Pat Intl
|
||||
-- * `AIRBASE.MarianaIslands.Antonio_B_Won_Pat_Intl` Antonio B. Won Pat Intl
|
||||
-- * `AIRBASE.MarianaIslands.North_West_Field` North West Field
|
||||
-- * `AIRBASE.MarianaIslands.Olf_Orote` Olf Orote
|
||||
-- * `AIRBASE.MarianaIslands.Pagan_Airstrip` Pagan Airstrip
|
||||
@@ -617,7 +929,7 @@ AIRBASE.Syria = {
|
||||
-- @field MarianaIslands
|
||||
AIRBASE.MarianaIslands = {
|
||||
["Andersen_AFB"] = "Andersen AFB",
|
||||
["Antonio_B._Won_Pat_Intl"] = "Antonio B. Won Pat Intl",
|
||||
["Antonio_B_Won_Pat_Intl"] = "Antonio B. Won Pat Intl",
|
||||
["North_West_Field"] = "North West Field",
|
||||
["Olf_Orote"] = "Olf Orote",
|
||||
["Pagan_Airstrip"] = "Pagan Airstrip",
|
||||
@@ -1673,6 +1985,7 @@ elseif self.category==Airbase.Category.SHIP then
|
||||
self.category=Airbase.Category.HELIPAD
|
||||
_DATABASE:AddStatic(AirbaseName)
|
||||
end
|
||||
if self:GetTypeName() == "Zell" then self.isZell = true end
|
||||
else
|
||||
self:E("ERROR: Unknown airbase category!")
|
||||
end
|
||||
@@ -2122,6 +2435,13 @@ function AIRBASE:IsShip()
|
||||
return self.isShip
|
||||
end
|
||||
|
||||
--- Check if airbase is a ZELL booster.
|
||||
-- @param #AIRBASE self
|
||||
-- @return #boolean If true, airbase is a ZELL booster.
|
||||
function AIRBASE:IsZell()
|
||||
return self.isZell
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- Parking
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -2164,7 +2484,7 @@ end
|
||||
|
||||
--- Get number of parking spots at an airbase. Optionally, a specific terminal type can be requested.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.TerminalType termtype Terminal type of which the number of spots is counted. Default all spots but spawn points on runway.
|
||||
-- @param #AIRBASE.TerminalType termtype (Optional) Terminal type of which the number of spots is counted. Default all spots but spawn points on runway.
|
||||
-- @return #number Number of parking spots at this airbase.
|
||||
function AIRBASE:GetParkingSpotsNumber(termtype)
|
||||
|
||||
@@ -2184,7 +2504,7 @@ end
|
||||
--- Get number of free parking spots at an airbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.TerminalType termtype Terminal type.
|
||||
-- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @return #number Number of free parking spots at this airbase.
|
||||
function AIRBASE:GetFreeParkingSpotsNumber(termtype, allowTOAC)
|
||||
|
||||
@@ -2207,7 +2527,7 @@ end
|
||||
--- Get the coordinates of free parking spots at an airbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.TerminalType termtype Terminal type.
|
||||
-- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @return #table Table of coordinates of the free parking spots.
|
||||
function AIRBASE:GetFreeParkingSpotsCoordinates(termtype, allowTOAC)
|
||||
|
||||
@@ -2434,7 +2754,7 @@ end
|
||||
--- Get a table containing the coordinates, terminal index and terminal type of free parking spots at an airbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.TerminalType termtype Terminal type.
|
||||
-- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships.
|
||||
-- @return #table Table free parking spots. Table has the elements ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
|
||||
function AIRBASE:GetFreeParkingSpotsTable(termtype, allowTOAC)
|
||||
|
||||
@@ -2486,7 +2806,7 @@ end
|
||||
--- Place markers of parking spots on the F10 map.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.TerminalType termtype Terminal type for which marks should be placed.
|
||||
-- @param #boolean mark If false, do not place markers but only give output to DCS.log file. Default true.
|
||||
-- @param #boolean mark (Optional) If false, do not place markers but only give output to DCS.log file. Default true.
|
||||
function AIRBASE:MarkParkingSpots(termtype, mark)
|
||||
|
||||
-- Default is true.
|
||||
@@ -3266,7 +3586,7 @@ end
|
||||
--- Set the active runway for landing and takeoff.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
function AIRBASE:SetActiveRunway(Name, PreferLeft)
|
||||
|
||||
self:SetActiveRunwayTakeoff(Name, PreferLeft)
|
||||
@@ -3278,7 +3598,7 @@ end
|
||||
--- Set the active runway for landing.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @return #AIRBASE.Runway The active runway for landing.
|
||||
function AIRBASE:SetActiveRunwayLanding(Name, PreferLeft)
|
||||
|
||||
@@ -3326,7 +3646,7 @@ end
|
||||
--- Set the active runway for takeoff.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||
-- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @return #AIRBASE.Runway The active runway for landing.
|
||||
function AIRBASE:SetActiveRunwayTakeoff(Name, PreferLeft)
|
||||
|
||||
@@ -3351,7 +3671,7 @@ end
|
||||
--- Get the runway where aircraft would be taking of or landing into the direction of the wind.
|
||||
-- NOTE that this requires the wind to be non-zero as set in the mission editor.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right.
|
||||
-- @return #AIRBASE.Runway Active runway data table.
|
||||
function AIRBASE:GetRunwayIntoWind(PreferLeft)
|
||||
|
||||
@@ -3407,7 +3727,7 @@ end
|
||||
|
||||
--- Get name of a given runway, e.g. "31L".
|
||||
-- @param #AIRBASE self
|
||||
-- @param #AIRBASE.Runway Runway The runway. Default is the active runway.
|
||||
-- @param #AIRBASE.Runway Runway (Optional) The runway. Default is the active runway.
|
||||
-- @param #boolean LongLeftRight If `true`, return "Left" or "Right" instead of "L" or "R".
|
||||
-- @return #string Name of the runway or "XX" if it could not be found.
|
||||
function AIRBASE:GetRunwayName(Runway, LongLeftRight)
|
||||
@@ -3438,7 +3758,7 @@ end
|
||||
--- Function that checks if at leat one unit of a group has been spawned close to a spawn point on the runway.
|
||||
-- @param #AIRBASE self
|
||||
-- @param Wrapper.Group#GROUP group Group to be checked.
|
||||
-- @param #number radius Radius around the spawn point to be checked. Default is 50 m.
|
||||
-- @param #number radius (Optional) Radius around the spawn point to be checked. Default is 50 m.
|
||||
-- @param #boolean despawn If true, the group is destroyed.
|
||||
-- @return #boolean True if group is within radius around spawn points on runway.
|
||||
function AIRBASE:CheckOnRunWay(group, radius, despawn)
|
||||
|
||||
@@ -117,7 +117,7 @@ end
|
||||
-- @param #CLIENT self
|
||||
-- @param #string ClientName Name of the DCS **Unit** as defined within the Mission Editor.
|
||||
-- @param #string ClientBriefing Text that describes the briefing of the mission when a Player logs into the Client.
|
||||
-- @param #boolean Error A flag that indicates whether an error should be raised if the CLIENT cannot be found. By default an error will be raised.
|
||||
-- @param #boolean Error (Optional) A flag that indicates whether an error should be raised if the CLIENT cannot be found. By default an error will be raised.
|
||||
-- @return #CLIENT
|
||||
-- @usage
|
||||
-- -- Create new Clients.
|
||||
@@ -148,7 +148,7 @@ function CLIENT:FindByName( ClientName, ClientBriefing, Error )
|
||||
end
|
||||
end
|
||||
|
||||
--- Transport defines that the Client is a Transport. Transports show cargo.
|
||||
--- Register a client.
|
||||
-- @param #CLIENT self
|
||||
-- @param #string ClientName Name of the client unit.
|
||||
-- @return #CLIENT self
|
||||
@@ -507,37 +507,6 @@ function CLIENT:GetClientGroupDCSUnit()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Evaluates if the CLIENT is a transport.
|
||||
-- @param #CLIENT self
|
||||
-- @return #boolean true is a transport.
|
||||
function CLIENT:IsTransport()
|
||||
self:F()
|
||||
return self.ClientTransport
|
||||
end
|
||||
|
||||
--- Shows the @{AI.AI_Cargo#CARGO} contained within the CLIENT to the player as a message.
|
||||
-- The @{AI.AI_Cargo#CARGO} is shown using the @{Core.Message#MESSAGE} distribution system.
|
||||
-- @param #CLIENT self
|
||||
function CLIENT:ShowCargo()
|
||||
self:F()
|
||||
|
||||
local CargoMsg = ""
|
||||
|
||||
for CargoName, Cargo in pairs( CARGOS ) do
|
||||
if self == Cargo:IsLoadedInClient() then
|
||||
CargoMsg = CargoMsg .. Cargo.CargoName .. " Type:" .. Cargo.CargoType .. " Weight: " .. Cargo.CargoWeight .. "\n"
|
||||
end
|
||||
end
|
||||
|
||||
if CargoMsg == "" then
|
||||
CargoMsg = "empty"
|
||||
end
|
||||
|
||||
self:Message( CargoMsg, 15, "Co-Pilot: Cargo Status", 30 )
|
||||
|
||||
end
|
||||
|
||||
--- The main message driver for the CLIENT.
|
||||
-- This function displays various messages to the Player logged into the CLIENT through the DCS World Messaging system.
|
||||
-- @param #CLIENT self
|
||||
|
||||
@@ -875,7 +875,7 @@ end
|
||||
--- Set callsign of the CONTROLLABLE. See [DCS command setCallsign](https://wiki.hoggitworld.com/view/DCS_command_setCallsign)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#CALLSIGN CallName Number corresponding the the callsign identifier you wish this group to be called.
|
||||
-- @param #number CallNumber The number value the group will be referred to as. Only valid numbers are 1-9. For example Uzi **5**-1. Default 1.
|
||||
-- @param #number CallNumber (Optional) The number value the group will be referred to as. Only valid numbers are 1-9. For example Uzi **5**-1. Default 1.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the callsign is set. Default is immediately.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:CommandSetCallsign( CallName, CallNumber, Delay )
|
||||
@@ -953,7 +953,7 @@ end
|
||||
--- Set radio frequency. See [DCS command SetFrequency](https://wiki.hoggitworld.com/view/DCS_command_setFrequency)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Frequency Radio frequency in MHz.
|
||||
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately.
|
||||
-- @return #CONTROLLABLE self
|
||||
@@ -980,7 +980,7 @@ end
|
||||
--- [AIR] Set radio frequency. See [DCS command SetFrequencyForUnit](https://wiki.hoggitworld.com/view/DCS_command_setFrequencyForUnit)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Frequency Radio frequency in MHz.
|
||||
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10.
|
||||
-- @param #number UnitID (Optional, if your object is a UNIT) The UNIT ID this is for.
|
||||
-- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately.
|
||||
@@ -1005,7 +1005,7 @@ end
|
||||
|
||||
--- [AIR] Set smoke on or off. See [DCS command smoke on off](https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean OnOff Set to true for on and false for off. Defaults to true.
|
||||
-- @param #boolean OnOff (Optional) Set to true for on and false for off. Defaults to true.
|
||||
-- @param #number Delay (Optional) Delay the command by this many seconds.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:CommandSmokeOnOff(OnOff, Delay)
|
||||
@@ -1065,7 +1065,7 @@ end
|
||||
--- Set EPLRS data link on/off.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean SwitchOnOff If true (or nil) switch EPLRS on. If false switch off.
|
||||
-- @param #number idx Task index. Default 1.
|
||||
-- @param #number idx (Optional) Task index. Default 1.
|
||||
-- @return #table Task wrapped action.
|
||||
function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx )
|
||||
|
||||
@@ -1099,32 +1099,14 @@ end
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aircraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aircraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCS#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param DCS#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.
|
||||
-- @param #boolean AttackQtyLimit (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackGroup" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.
|
||||
-- @param #boolean GroupAttack (Optional) If true, attack as group.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit, GroupAttack )
|
||||
-- self:F2( { self.ControllableName, AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit } )
|
||||
|
||||
-- AttackGroup = {
|
||||
-- id = 'AttackGroup',
|
||||
-- params = {
|
||||
-- groupId = Group.ID,
|
||||
-- weaponType = number,
|
||||
-- expend = enum AI.Task.WeaponExpend,
|
||||
-- attackQty = number,
|
||||
-- directionEnabled = boolean,
|
||||
-- direction = Azimuth,
|
||||
-- altitudeEnabled = boolean,
|
||||
-- altitude = Distance,
|
||||
-- attackQtyLimit = boolean,
|
||||
-- }
|
||||
-- }
|
||||
|
||||
|
||||
function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, GroupAttack )
|
||||
-- self:F2( { self.ControllableName, AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, GroupAttack } )
|
||||
local DCSTask = { id = 'AttackGroup',
|
||||
params = {
|
||||
groupId = AttackGroup:GetID(),
|
||||
weaponType = WeaponType or 1073741822,
|
||||
weaponType = WeaponType or ENUMS.WeaponFlag.Auto,
|
||||
expend = WeaponExpend or "Auto",
|
||||
attackQtyLimit = AttackQty and true or false,
|
||||
attackQty = AttackQty or 1,
|
||||
@@ -1135,7 +1117,6 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
||||
groupAttack = GroupAttack and true or false,
|
||||
},
|
||||
}
|
||||
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
@@ -1163,7 +1144,7 @@ function CONTROLLABLE:TaskAttackUnit( AttackUnit, GroupAttack, WeaponExpend, Att
|
||||
altitude = Altitude,
|
||||
attackQtyLimit = AttackQty and true or false,
|
||||
attackQty = AttackQty,
|
||||
weaponType = WeaponType or 1073741822,
|
||||
weaponType = WeaponType or ENUMS.WeaponFlag.Auto,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1197,7 +1178,7 @@ function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, D
|
||||
direction = Direction and math.rad(Direction) or 0,
|
||||
altitudeEnabled = Altitude and true or false,
|
||||
altitude = Altitude or 2000,
|
||||
weaponType = WeaponType or 1073741822,
|
||||
weaponType = WeaponType or ENUMS.WeaponFlag.AnyBomb,
|
||||
attackType = Divebomb and "Dive" or nil,
|
||||
},
|
||||
}
|
||||
@@ -1249,7 +1230,7 @@ end
|
||||
-- @param #number AttackQty (Optional) This parameter limits maximal quantity of attack. The aircraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aircraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCS#Azimuth Direction (Optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #number Altitude (Optional) The altitude [meters] from where to attack. Default 30 m.
|
||||
-- @param #number WeaponType (Optional) The WeaponType. Default Auto=1073741822.
|
||||
-- @param #number WeaponType (Optional) The WeaponType. Default `ENUMS.WeaponFlag.Auto`.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType )
|
||||
|
||||
@@ -1266,7 +1247,7 @@ function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, Atta
|
||||
direction = Direction and math.rad(Direction) or 0,
|
||||
altitudeEnabled = Altitude and true or false,
|
||||
altitude = Altitude,
|
||||
weaponType = WeaponType or 1073741822,
|
||||
weaponType = WeaponType or ENUMS.WeaponFlag.Auto,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1385,7 +1366,7 @@ end
|
||||
-- The controllable has to be an infantry group!
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinates where AI is expecting to be picked up.
|
||||
-- @param #number Radius Radius in meters. Default 200 m.
|
||||
-- @param #number Radius (Optional) Radius in meters. Default 200 m.
|
||||
-- @param #string UnitType The unit type name of the carrier, e.g. "UH-1H". Must not be specified.
|
||||
-- @return DCS#Task Embark to transport task.
|
||||
function CONTROLLABLE:TaskEmbarkToTransport( Coordinate, Radius, UnitType )
|
||||
@@ -1459,8 +1440,8 @@ end
|
||||
--- (AIR) Orbit at a position with at a given altitude and speed. Optionally, a race track pattern can be specified.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Core.Point#COORDINATE Coord Coordinate at which the CONTROLLABLE orbits. Can also be given as a `DCS#Vec3` or `DCS#Vec2` object.
|
||||
-- @param #number Altitude Altitude in meters of the orbit pattern. Default y component of Coord.
|
||||
-- @param #number Speed Speed [m/s] flying the orbit pattern. Default 128 m/s = 250 knots.
|
||||
-- @param #number Altitude (Optional) Altitude in meters of the orbit pattern. Default y component of Coord.
|
||||
-- @param #number Speed (Optional) Speed [m/s] flying the orbit pattern. Default 128 m/s = 250 knots.
|
||||
-- @param Core.Point#COORDINATE CoordRaceTrack (Optional) If this coordinate is specified, the CONTROLLABLE will fly a race-track pattern using this and the initial coordinate.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:TaskOrbit( Coord, Altitude, Speed, CoordRaceTrack )
|
||||
@@ -1530,11 +1511,11 @@ end
|
||||
--
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Wrapper.Airbase#AIRBASE Airbase Airbase to attack.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. See [DCS enum weapon flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag). Default 2147485694 = AnyBomb (GuidedBomb + AnyUnguidedBomb).
|
||||
-- @param DCS#AI.Task.WeaponExpend WeaponExpend Enum AI.Task.WeaponExpend that defines how much munitions the AI will expend per attack run. Default "ALL".
|
||||
-- @param #number AttackQty Number of times the group will attack if the target. Default 1.
|
||||
-- @param DCS#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean GroupAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a group and not to a single aircraft.
|
||||
-- @param #number WeaponType (Optional) Bitmask of weapon types those allowed to use. See [DCS enum weapon flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag). Default 2147485694 = AnyBomb (GuidedBomb + AnyUnguidedBomb).
|
||||
-- @param DCS#AI.Task.WeaponExpend (Optional) WeaponExpend Enum AI.Task.WeaponExpend that defines how much munitions the AI will expend per attack run. Default "ALL".
|
||||
-- @param #number AttackQty (Optional) Number of times the group will attack if the target. Default 1.
|
||||
-- @param DCS#Azimuth Direction (Optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean GroupAttack (Optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a group and not to a single aircraft.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskBombingRunway( Airbase, WeaponType, WeaponExpend, AttackQty, Direction, GroupAttack )
|
||||
|
||||
@@ -1725,7 +1706,7 @@ end
|
||||
-- @param DCS#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param #number LastWaypointIndex Detach waypoint of another controllable. Once reached the unit / controllable Escort task is finished.
|
||||
-- @param #number EngagementDistance Maximal distance from escorted controllable to threat in meters. If the threat is already engaged by escort escort will disengage if the distance becomes greater than 1.5 * engagementDistMax.
|
||||
-- @param DCS#AttributeNameArray TargetTypes Array of AttributeName that is contains threat categories allowed to engage. Default {"Air"}. See https://wiki.hoggit.us/view/DCS_enum_attributes
|
||||
-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of AttributeName that is contains threat categories allowed to engage. Default {"Air"}. See https://wiki.hoggit.us/view/DCS_enum_attributes
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes )
|
||||
|
||||
@@ -1765,7 +1746,7 @@ end
|
||||
-- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted).
|
||||
-- @param #number WeaponType (optional) Enum for weapon type ID. This value is only required if you want the group firing to use a specific weapon, for instance using the task on a ship to force it to fire guided missiles at targets within cannon range. See http://wiki.hoggit.us/view/DCS_enum_weapon_flag
|
||||
-- @param #number Altitude (Optional) Altitude in meters.
|
||||
-- @param #number ASL Altitude is above mean sea level. Default is above ground level.
|
||||
-- @param #number ASL (Optional) Altitude is above mean sea level. Default is above ground level.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Altitude, ASL )
|
||||
|
||||
@@ -1818,11 +1799,11 @@ end
|
||||
-- It's important to note that depending on the type of unit that is being assigned the task (AIR or GROUND), you must choose the correct type of callsign enumerator. For airborne controllables use CALLSIGN.Aircraft and for ground based use CALLSIGN.JTAC enumerators.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Wrapper.Group#GROUP AttackGroup Target GROUP object.
|
||||
-- @param #number WeaponType Bitmask of weapon types, which are allowed to use.
|
||||
-- @param DCS#AI.Task.Designation Designation (Optional) Designation type.
|
||||
-- @param #number WeaponType (Optional) Bitmask of weapon types, which are allowed to use. Defaults tp ENUMS.WeaponFlag.AutoDCS.
|
||||
-- @param DCS#AI.Task.Designation Designation (Optional) Designation type. Defaults to Auto.
|
||||
-- @param #boolean Datalink (Optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.
|
||||
-- @param #number Frequency Frequency in MHz used to communicate with the FAC. Default 133 MHz.
|
||||
-- @param #number Modulation Modulation of radio for communication. Default 0=AM.
|
||||
-- @param #number Frequency (Optional) Frequency in MHz used to communicate with the FAC. Default 133 MHz.
|
||||
-- @param #number Modulation (Optional) Modulation of radio for communication. Default 0=AM.
|
||||
-- @param #number CallsignName Callsign enumerator name of the FAC. (CALLSIGN.Aircraft.{name} for airborne controllables, CALLSIGN.JTACS.{name} for ground units)
|
||||
-- @param #number CallsignNumber Callsign number, e.g. Axeman-**1**.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
@@ -1848,8 +1829,8 @@ end
|
||||
--- (AIR) Engaging targets of defined types.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#Distance Distance Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.
|
||||
-- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
||||
-- @param #number Priority All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0.
|
||||
-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Defaults to {"Air"}.
|
||||
-- @param #number Priority (Optional) All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEngageTargets( Distance, TargetTypes, Priority )
|
||||
|
||||
@@ -1890,7 +1871,7 @@ end
|
||||
|
||||
--- (AIR) Enroute anti-ship task.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Ships"}`.
|
||||
-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Ships"}`.
|
||||
-- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskAntiShip(TargetTypes, Priority)
|
||||
@@ -1911,7 +1892,7 @@ end
|
||||
|
||||
--- (AIR) Enroute SEAD task.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Air Defence"}`.
|
||||
-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Air Defence"}`.
|
||||
-- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskSEAD(TargetTypes, Priority)
|
||||
@@ -1932,7 +1913,7 @@ end
|
||||
|
||||
--- (AIR) Enroute CAP task.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Air"}`.
|
||||
-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Air"}`.
|
||||
-- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskCAP(TargetTypes, Priority)
|
||||
@@ -2105,11 +2086,11 @@ end
|
||||
-- Target designation is set to auto and is dependent on the circumstances.
|
||||
-- See [hoggit](https://wiki.hoggitworld.com/view/DCS_task_fac).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Frequency Frequency in MHz. Default 133 MHz.
|
||||
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number Frequency (Optional) Frequency in MHz. Default 133 MHz.
|
||||
-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`.
|
||||
-- @param #number CallsignID CallsignID, e.g. `CALLSIGN.JTAC.Anvil` for ground or `CALLSIGN.Aircraft.Ford` for air.
|
||||
-- @param #number CallsignNumber Callsign first number, e.g. 2 for `Ford-2`.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Defaults to 0.
|
||||
-- @return DCS#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskFAC( Frequency, Modulation, CallsignID, CallsignNumber, Priority )
|
||||
|
||||
@@ -2185,6 +2166,7 @@ function CONTROLLABLE:TaskFunction( FunctionString, ... )
|
||||
self:SetState( self, ArgumentKey, arg )
|
||||
DCSScript[#DCSScript + 1] = "local Arguments = MissionControllable:GetState( MissionControllable, '" .. ArgumentKey .. "' ) "
|
||||
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, unpack( Arguments ) )"
|
||||
--DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, ((type(Arguments)=='table') and unpack(Arguments) or nil))" -- this doesn't work
|
||||
else
|
||||
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable )"
|
||||
end
|
||||
@@ -2338,8 +2320,8 @@ do -- Patrol methods
|
||||
-- @param #table ZoneList Table of zones.
|
||||
-- @param #number Speed Speed in km/h the group moves at.
|
||||
-- @param #string Formation (Optional) Formation the group should use.
|
||||
-- @param #number DelayMin Delay in seconds before the group progresses to the next route point. Default 1 sec.
|
||||
-- @param #number DelayMax Max. delay in seconds. Actual delay is randomly chosen between DelayMin and DelayMax. Default equal to DelayMin.
|
||||
-- @param #number DelayMin (Optional) Delay in seconds before the group progresses to the next route point. Default 1 sec.
|
||||
-- @param #number DelayMax (Optional) Max. delay in seconds. Actual delay is randomly chosen between DelayMin and DelayMax. Default equal to DelayMin.
|
||||
-- @return #CONTROLLABLE
|
||||
function CONTROLLABLE:PatrolZones( ZoneList, Speed, Formation, DelayMin, DelayMax )
|
||||
|
||||
@@ -2854,7 +2836,7 @@ do -- Route methods
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Core.Zone#ZONE Zone The zone where to route to.
|
||||
-- @param #boolean Randomize Defines whether to target point gets randomized within the Zone.
|
||||
-- @param #number Speed The speed in m/s. Default is 5.555 m/s = 20 km/h.
|
||||
-- @param #number Speed (Optional) The speed in m/s. Default is 5.555 m/s = 20 km/h.
|
||||
-- @param DCS#FORMATION Formation The formation string.
|
||||
function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
||||
self:F2( Zone )
|
||||
@@ -2914,7 +2896,7 @@ do -- Route methods
|
||||
-- A given formation can be given.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCS#Vec2 Vec2 The Vec2 where to route to.
|
||||
-- @param #number Speed The speed in m/s. Default is 5.555 m/s = 20 km/h.
|
||||
-- @param #number Speed (Optional) The speed in m/s. Default is 5.555 m/s = 20 km/h.
|
||||
-- @param DCS#FORMATION Formation The formation string.
|
||||
function CONTROLLABLE:TaskRouteToVec2( Vec2, Speed, Formation )
|
||||
|
||||
@@ -3658,6 +3640,66 @@ function CONTROLLABLE:OptionPreferVerticalLanding()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Air - Allow formation side swap
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionAllowFormationSideSwap()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
if DCSControllable then
|
||||
local Controller = self:_GetController()
|
||||
|
||||
if self:IsAir() then
|
||||
Controller:setOption( AI.Option.Air.id.ALLOW_FORMATION_SIDE_SWAP, true )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Air - Allow formation takeoff, if enough space
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionAIRunwayLineUp()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
if DCSControllable then
|
||||
local Controller = self:_GetController()
|
||||
|
||||
if self:IsAir() then
|
||||
Controller:setOption( 37, true )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Air - Allow to fly home after loss of formation
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionDisengageAndRTBAfterFormationLoss()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
if DCSControllable then
|
||||
local Controller = self:_GetController()
|
||||
|
||||
if self:IsAir() then
|
||||
Controller:setOption( 38, 1 )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Can the CONTROLLABLE evade on enemy fire?
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #boolean
|
||||
@@ -3806,7 +3848,7 @@ end
|
||||
|
||||
--- Set RTB on bingo fuel.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean RTB true if RTB on bingo fuel (default), false if no RTB on bingo fuel.
|
||||
-- @param #boolean RTB (Optional) true if RTB on bingo fuel (default), false if no RTB on bingo fuel.
|
||||
-- Warning! When you switch this option off, the airborne group will continue to fly until all fuel has been consumed, and will crash.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionRTBBingoFuel( RTB ) -- R2.2
|
||||
@@ -3933,7 +3975,7 @@ end
|
||||
|
||||
--- [Ground] Option that defines the vehicle spacing when in an on road and off road formation.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number meters Can be zero to 100 meters. Defaults to 50 meters.
|
||||
-- @param #number meters (Optional) Can be zero to 100 meters. Defaults to 50 meters.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionFormationInterval(meters)
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -3954,7 +3996,7 @@ end
|
||||
|
||||
--- [Air] Defines the usage of Electronic Counter Measures by airborne forces.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number ECMvalue Can be - 0=Never on, 1=if locked by radar, 2=if detected by radar, 3=always on, defaults to 1
|
||||
-- @param #number ECMvalue (Optional) Can be - 0=Never on, 1=if locked by radar, 2=if detected by radar, 3=always on, defaults to 1
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionECM( ECMvalue )
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -4250,7 +4292,7 @@ end
|
||||
|
||||
--- Defines the range at which a GROUND unit/group is allowed to use its weapons automatically.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number EngageRange Engage range limit in percent (a number between 0 and 100). Default 100.
|
||||
-- @param #number EngageRange (Optional) Engage range limit in percent (a number between 0 and 100). Default 100.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionEngageRange( EngageRange )
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -4272,6 +4314,19 @@ function CONTROLLABLE:OptionEngageRange( EngageRange )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- [AIR] Set if aircraft is allowed to drop empty fuel tanks - set to true to allow, and false to forbid it.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:SetOptionJettisonEmptyTanks(Switch)
|
||||
self:F2( { self.ControllableName } )
|
||||
-- Set default if not specified.
|
||||
Switch = Switch or true
|
||||
if self:IsAir() then
|
||||
self:SetOption( AI.Option.Air.id.JETT_TANKS_IF_EMPTY, Switch )
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [AIR] Set how the AI lands on an airfield. Here: Straight in.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #CONTROLLABLE self
|
||||
@@ -4400,7 +4455,7 @@ end
|
||||
|
||||
--- [AIR] Set the AI to report contact for certain types of objects.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:SetOptionRadioContact(Objects)
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -4414,7 +4469,7 @@ end
|
||||
|
||||
--- [AIR] Set the AI to report engaging certain types of objects.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:SetOptionRadioEngage(Objects)
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -4428,7 +4483,7 @@ end
|
||||
|
||||
--- [AIR] Set the AI to report killing certain types of objects.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:SetOptionRadioKill(Objects)
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -4442,12 +4497,12 @@ end
|
||||
|
||||
--- (GROUND) Relocate controllable to a random point within a given radius; use e.g.for evasive actions; Note that not all ground controllables can actually drive, also the alarm state of the controllable might stop it from moving.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number speed Speed of the controllable, default 20
|
||||
-- @param #number radius Radius of the relocation zone, default 500
|
||||
-- @param #boolean onroad If true, route on road (less problems with AI way finding), default true
|
||||
-- @param #boolean shortcut If true and onroad is set, take a shorter route - if available - off road, default false
|
||||
-- @param #string formation Formation string as in the mission editor, e.g. "Vee", "Diamond", "Line abreast", etc. Defaults to "Off Road"
|
||||
-- @param #boolean onland (optional) If true, try up to 50 times to get a coordinate on land.SurfaceType.LAND. Note - this descriptor value is not reliably implemented on all maps.
|
||||
-- @param #number speed (Optional) Speed of the controllable, default 20
|
||||
-- @param #number radius (Optional) Radius of the relocation zone, default 500
|
||||
-- @param #boolean onroad (Optional) If true, route on road (less problems with AI way finding), default true
|
||||
-- @param #boolean shortcut (Optional) If true and onroad is set, take a shorter route - if available - off road, default false
|
||||
-- @param #string formation (Optional) Formation string as in the mission editor, e.g. "Vee", "Diamond", "Line abreast", etc. Defaults to "Off Road"
|
||||
-- @param #boolean onland (Optional) If true, try up to 50 times to get a coordinate on land.SurfaceType.LAND. Note - this descriptor value is not reliably implemented on all maps.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:RelocateGroundRandomInRadius( speed, radius, onroad, shortcut, formation, onland )
|
||||
self:F2( { self.ControllableName } )
|
||||
@@ -5830,8 +5885,8 @@ end
|
||||
|
||||
--- [GROUND] Create and enable a new IR Marker for the given controllable UNIT or GROUP.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean EnableImmediately (Optionally) If true start up the IR Marker immediately. Else you need to call `myobject:EnableIRMarker()` later on.
|
||||
-- @param #number Runtime (Optionally) Run this IR Marker for the given number of seconds, then stop. Use in conjunction with EnableImmediately. Defaults to 60 seconds.
|
||||
-- @param #boolean EnableImmediately (Optional) If true start up the IR Marker immediately. Else you need to call `myobject:EnableIRMarker()` later on.
|
||||
-- @param #number Runtime (Optional) Run this IR Marker for the given number of seconds, then stop. Use in conjunction with EnableImmediately. Defaults to 60 seconds.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:NewIRMarker(EnableImmediately, Runtime)
|
||||
self:T2("NewIRMarker")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user