diff --git a/.editorconfig b/.editorconfig index e4ab4a9fd3..4ca23b300f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,8 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false +[*.yml] +indent_size = 2 + [Makefile] indent_style = tab diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index d0649a0ade..3ddfefd63f 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -27,15 +27,6 @@ jobs: - name: Validate function headers run: python3 docs/tools/document_functions.py --debug - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v4 - - name: Lint (sqflint) - uses: arma-actions/sqflint@master - continue-on-error: true # No failure due to many false-positives - build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 9693d2df22..8cafd847e2 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -1,29 +1,65 @@ name: Extensions on: - pull_request: + push: paths: - - 'extensions/**' + - 'extension/**' + - 'Cargo.toml' + - 'Cargo.lock' + - '.github/workflows/extensions.yml' jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@master + - name: Install dependencies + run: | + rustup toolchain update stable --no-self-update + rustup default stable + rustup component add clippy rustfmt + - name: Run rustfmt + run: cargo fmt -- --check + - name: Run clippy + run: cargo clippy --all -- -Dwarnings + + test: + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin + options: --security-opt seccomp=unconfined + steps: + - name: Checkout the source code + uses: actions/checkout@master + - name: Test & Coverage + run: cargo tarpaulin --verbose --no-default-features --workspace --timeout 240 + build: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest] - + arrays: [ + os: { tag: "windows-latest", target: "i686-pc-windows-msvc" }, + os: { tag: "windows-latest", target: "x86_64-pc-windows-msvc" }, + ] + runs-on: ${{ matrix.arrays.os.tag }} steps: - name: Checkout the source code uses: actions/checkout@v4 - - name: Build - shell: cmd - run: | - cd extensions - mkdir build - cd build - cmake .. && cmake --build . - - name: Upload Artifact - uses: actions/upload-artifact@v4 + - name: Install stable Rust + uses: actions-rs/toolchain@v1 with: - name: ace3_extensions-${{ matrix.os }}-debug - path: extensions/build + target: ${{ matrix.arrays.os.target }} + toolchain: stable + default: true + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Build + run: cargo build --verbose + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.arrays.os.target }} + path: target/debug/ace.dll + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/hemtt.yml b/.github/workflows/hemtt.yml index e606852285..23fad27560 100644 --- a/.github/workflows/hemtt.yml +++ b/.github/workflows/hemtt.yml @@ -33,6 +33,8 @@ jobs: xcopy /e /h /q pullrequest\addons addons\ xcopy /e /h /q pullrequest\optionals optionals\ xcopy /e /h /q pullrequest\include include\ + xcopy /y /h /q pullrequest\ace.dll ace.dll + xcopy /y /h /q pullrequest\ace_x64.dll ace_x64.dll - name: Run HEMTT build run: hemtt build - name: Rename build folder diff --git a/.gitignore b/.gitignore index 4ad0a5e1eb..15cc59d0d5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ *.zip release/* releases/* -extensions/vcproj32/* -extensions/vcproj64/* .vscode/* hemtt hemtt.exe @@ -20,4 +18,5 @@ CHANGELOG.md sqfvm.exe ArmaScriptCompiler.exe *.sqfc +target/ !extras/**/*.zip diff --git a/.hemtt/project.toml b/.hemtt/project.toml index f5ed361e3e..a9535dd2ba 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -34,32 +34,26 @@ workshop = [ ] [hemtt.launch.spe] -workshop = [ - "450814997", # CBA_A3 -] +extends = "default" dlc = [ "spe" ] [hemtt.launch.vn] -workshop = [ - "450814997", # CBA_A3's Workshop ID -] +extends = "default" dlc = [ "S.O.G. Prairie Fire", ] [hemtt.launch.ws] -workshop = [ - "450814997", # CBA_A3's Workshop ID -] +extends = "default" dlc = [ "Western Sahara", ] [hemtt.launch.rhs] +extends = "default" workshop = [ - "450814997", # CBA_A3's Workshop ID "843425103", # RHS AFRF Workshop ID "843577117", # RHS USAF Workshop ID "843593391", # RHS GREF Workshop ID diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000000..f65334dd2a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1364 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ace" +version = "0.1.0" +dependencies = [ + "arboard", + "arma-rs", + "git2", + "rand", + "rand_chacha", + "rayon", + "uuid", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "arboard" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" +dependencies = [ + "clipboard-win", + "core-graphics", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "windows-sys 0.48.0", + "x11rb", +] + +[[package]] +name = "arma-rs" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdda6c2cf1237405dd57f82875c77b4159d415445471b903a901d8a37a61b30c" +dependencies = [ + "arma-rs-proc", + "crossbeam-channel", + "libc", + "link_args", + "log", + "seq-macro", + "state", + "uuid", + "windows 0.51.1", +] + +[[package]] +name = "arma-rs-proc" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "517b1a9cc16bc93896216ffeed0c692df4af022ee55ec45e8fc31c90a201dcb4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "bytemuck" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cc" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-code" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "git2" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" +dependencies = [ + "bitflags 2.6.0", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.157" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" + +[[package]] +name = "libgit2-sys" +version = "0.17.0+1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link_args" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7721e472624c9aaad27a5eb6b7c9c6045c7a396f2efb6dabaec1b640d5e89b" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + +[[package]] +name = "serde" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.125" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + +[[package]] +name = "syn" +version = "2.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000000..a13ce613fd --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +resolver = "2" +members = [ + "extension" +] + +[profile.release] +opt-level = "z" +lto = true +codegen-units = 1 +strip = true diff --git a/ace.dll b/ace.dll new file mode 100644 index 0000000000..a92360dd4a Binary files /dev/null and b/ace.dll differ diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll deleted file mode 100644 index f5686a5a3f..0000000000 Binary files a/ace_advanced_ballistics.dll and /dev/null differ diff --git a/ace_advanced_ballistics_x64.dll b/ace_advanced_ballistics_x64.dll deleted file mode 100644 index f1802ce5e8..0000000000 Binary files a/ace_advanced_ballistics_x64.dll and /dev/null differ diff --git a/ace_artillerytables.dll b/ace_artillerytables.dll deleted file mode 100644 index 2f5855c81a..0000000000 Binary files a/ace_artillerytables.dll and /dev/null differ diff --git a/ace_artillerytables_x64.dll b/ace_artillerytables_x64.dll deleted file mode 100644 index 97a061c257..0000000000 Binary files a/ace_artillerytables_x64.dll and /dev/null differ diff --git a/ace_break_line.dll b/ace_break_line.dll deleted file mode 100644 index 8fc92175fe..0000000000 Binary files a/ace_break_line.dll and /dev/null differ diff --git a/ace_break_line_x64.dll b/ace_break_line_x64.dll deleted file mode 100644 index d021bf25d2..0000000000 Binary files a/ace_break_line_x64.dll and /dev/null differ diff --git a/ace_clipboard.dll b/ace_clipboard.dll deleted file mode 100644 index 8cf6744964..0000000000 Binary files a/ace_clipboard.dll and /dev/null differ diff --git a/ace_clipboard_x64.dll b/ace_clipboard_x64.dll deleted file mode 100644 index db7730f0fe..0000000000 Binary files a/ace_clipboard_x64.dll and /dev/null differ diff --git a/ace_fcs.dll b/ace_fcs.dll deleted file mode 100644 index 9c2a871b3d..0000000000 Binary files a/ace_fcs.dll and /dev/null differ diff --git a/ace_fcs_x64.dll b/ace_fcs_x64.dll deleted file mode 100644 index 4ee8dc1d89..0000000000 Binary files a/ace_fcs_x64.dll and /dev/null differ diff --git a/ace_x64.dll b/ace_x64.dll new file mode 100644 index 0000000000..d9d09835f2 Binary files /dev/null and b/ace_x64.dll differ diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 9d0dd0ee4b..25545d02aa 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -1,10 +1,10 @@ #include "script_component.hpp" -GVAR(currentbulletID) = -1; +#include "initKeybinds.inc.sqf" GVAR(Protractor) = false; GVAR(ProtractorStart) = CBA_missionTime; -GVAR(allBullets) = []; +GVAR(allBullets) = createHashMap; GVAR(currentGrid) = 0; if (!hasInterface) exitWith {}; @@ -24,22 +24,6 @@ if (!hasInterface) exitWith {}; // Register Perframe Handler [LINKFUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler; - - //Add warnings for missing compat PBOs (only if AB is on) - { - _x params ["_modPBO", "_compatPBO"]; - if ([_modPBO] call EFUNC(common,isModLoaded) && {!([_compatPBO] call EFUNC(common,isModLoaded))}) then { - WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO); - }; - } forEach [ - ["RH_acc","ace_compat_rh_acc"], - ["RH_de_cfg","ace_compat_rh_de"], - ["RH_m4_cfg","ace_compat_rh_m4"], - ["RH_PDW","ace_compat_rh_pdw"], - ["RKSL_PMII","ace_compat_rksl_pm_ii"], - ["iansky_opt","ace_compat_sma3_iansky"], - ["R3F_Armes","ace_compat_r3f"] - ]; }] call CBA_fnc_addEventHandler; #ifdef DEBUG_MODE_FULL diff --git a/addons/advanced_ballistics/config.cpp b/addons/advanced_ballistics/config.cpp index 17647d0647..e3fe6957d7 100644 --- a/addons/advanced_ballistics/config.cpp +++ b/addons/advanced_ballistics/config.cpp @@ -18,10 +18,3 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "RscTitles.hpp" #include "ACE_Settings.hpp" - -class ACE_Extensions { - class ace_advanced_ballistics { - windows = 1; - client = 1; - }; -}; diff --git a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf index a2156349f6..b197af9d70 100644 --- a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf +++ b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf @@ -80,7 +80,7 @@ for "_i" from 0 to (count _cfgWeapons)-1 do { diag_log text format ["AB_Diagnose_barrelTwist,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_twistDirection,_barrelTwist]; }; if (_barrelLength == 0) then { - diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_barrelLength]; + diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4",_weapon,_magazine,_ammo,_barrelLength]; }; }; } forEach _magazines; diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index e9180cb1c4..9c359bf833 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, Ruthberg, joko // Jonas + * Author: Glowbal, Ruthberg, joko // Jonas, Brett Mayson * Handle the PFH for Bullets * * Arguments: @@ -17,7 +17,7 @@ private _deleted = false; { - _x params ["_bullet","_caliber","_bulletTraceVisible","_index"]; + _y params ["_bullet","_caliber","_bulletTraceVisible"]; if (alive _bullet) then { private _bulletVelocity = velocity _bullet; @@ -27,13 +27,21 @@ private _deleted = false; drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; }; - _bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6", _index, _bulletVelocity, _bulletPosition, wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6]))); + ( + "ace" callExtension ["ballistics:bullet:simulate", [ + _x, + _bulletVelocity, + _bulletPosition, + wind, + ASLToATL(_bulletPosition) select 2, + CBA_missionTime toFixed 6 + ]] + ) params ["_data", "_code"]; + if (_code == 0) then { + _bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray (_data))); + }; } else { - GVAR(allBullets) set [_forEachIndex, objNull]; - _deleted = true; + GVAR(allBullets) deleteAt _x; + "ace" callExtension ["ballistics:bullet:delete", [_x]]; }; -} forEach GVAR(allBullets); - -if (_deleted) then { - GVAR(allBullets) = GVAR(allBullets) - [objNull]; -}; +} forEach GVAR(allBullets) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index ff2fe85ae4..7d00168160 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, Ruthberg + * Author: Glowbal, Ruthberg, Brett Mayson * * Handles advanced ballistics for (BulletBase) projectiles. Called from the unified fired EH only for players. * @@ -62,11 +62,11 @@ if (_abort) exitWith {}; // Get Weapon and Ammo Configurations private _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; if (isNil "_AmmoCacheEntry") then { - _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); + _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; private _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; if (isNil "_WeaponCacheEntry") then { - _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); + _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; @@ -120,8 +120,26 @@ if (_caliber * _bulletLength * _bulletMass * _barrelTwist > 0) then { _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; -GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; - -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _ammoCount, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _transonicStabilityCoef, getPosASL _projectile, _bulletVelocity, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), EGVAR(weather,currentOvercast), CBA_missionTime toFixed 6]; - -GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; +("ace" callExtension [ + "ballistics:bullet:new", [ + _ammoCount, + _airFriction, + _ballisticCoefficients, + _velocityBoundaries, + _atmosphereModel, + _dragModel, + _stabilityFactor, + _twistDirection, + _transonicStabilityCoef, + _bulletVelocity, + EGVAR(common,mapLatitude), + EGVAR(weather,currentTemperature), + EGVAR(common,mapAltitude), + EGVAR(weather,currentHumidity), + EGVAR(weather,currentOvercast), + CBA_missionTime toFixed 6 + ] +]) params ["_id", "_code"]; +if (_code == 0) then { + GVAR(allBullets) set [_id, [_projectile, _caliber, _bulletTraceVisible]]; +}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 89e89b9f7e..8c908639c3 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -21,7 +21,14 @@ if (!GVAR(enabled)) exitWith {}; private _initStartTime = diag_tickTime; private _mapSize = worldSize; -if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { +( + "ace" callExtension ["ballistics:map:init", [worldName, _mapSize]] +) params ["_data", "_code"]; +if (_code != 0) exitWith { + ERROR("Error initializing map") +}; + +if (_data == "true") exitWith { INFO_1("Terrain already initialized [world: %1]",worldName); #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; @@ -53,8 +60,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName private _gridCenter = [_x + 25, _y + 25]; private _gridHeight = round(getTerrainHeightASL _gridCenter); private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); - private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter); - "ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; + "ace" callExtension ["ballistics:map:set", [GVAR(currentGrid), _gridHeight, _gridNumObjects, surfaceIsWater _gridCenter]]; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; }; diff --git a/addons/advanced_ballistics/initSettings.inc.sqf b/addons/advanced_ballistics/initSettings.inc.sqf index 957044f343..28a1d6d826 100644 --- a/addons/advanced_ballistics/initSettings.inc.sqf +++ b/addons/advanced_ballistics/initSettings.inc.sqf @@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(enabled_DisplayName), LSTRING(enabled_Description)], _category, false, - 1 + 1, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -45,5 +47,7 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(simulationInterval_DisplayName), LSTRING(simulationInterval_Description)], _category, [0, 0.2, 0.05, 2], - 1 + 1, + {[QGVAR(simulationInterval), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index b077f53b6a..67022f7deb 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -46,7 +46,7 @@ Fejlett ballisztika Продвинутая баллистика Balistica Avanzata - アドバンスド弾道計算 + 高度な弾道計算 고급 탄도학 先進彈道系統 进阶弹道系统 @@ -63,7 +63,7 @@ Fejlett ballisztika Продвинутая баллистика Balistica Avanzata - アドバンスド弾道計算を有効化 + 高度な弾道計算を有効化 고급 탄도학 先進彈道系統 进阶弹道系统 @@ -80,7 +80,7 @@ Engedélyezi a fejlett ballisztikát Включает продвинутую баллистику Abilita Balistica Avanzata - アドバンスド弾道計算は高度な弾道計算処理を有効化します。 + 高度な弾道計算を有効化します。 고급 탄도학을 적용합니다 啟用先進彈道系統 启用进阶弹道系统 @@ -280,7 +280,7 @@ Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékek fejlett ballisztikát használnak Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам Definisce il raggio attorno al giocatore (in metri) entro il quale la Balistica Avanzata è applicata ai proiettili - アドバンスド弾道計算の適用半径範囲 (プレイヤー中心、メートル単位) を定義します。 + 高度な弾道計算が飛翔体に適用される半径距離 (プレイヤー中心、メートル単位) を定義します。 플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터) 以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍 定义玩家周围的半径(米),在这个半径内,进阶弹道系统会被启用 @@ -297,7 +297,7 @@ Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел. Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada. Questo modulo abilita la simulazione della Balistica Avanzata - essa comporta che la traiettoria dei proiettili è influenzata da variabili come la temperatura dell'aria, pressione atmosferica, umidità, gravità, il tipo di munizione e l'arma da cui è sparata. - アドバンスド弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。 + 高度な弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。 이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다. 該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響 该模块实现增强的弹道模拟—子弹的轨迹由空气温度、大气压力、湿度、重力、弹药类型和射击的武器等变量所影响 diff --git a/addons/advanced_fatigue/XEH_PREP.hpp b/addons/advanced_fatigue/XEH_PREP.hpp index 22bb99617a..509c85e375 100644 --- a/addons/advanced_fatigue/XEH_PREP.hpp +++ b/addons/advanced_fatigue/XEH_PREP.hpp @@ -10,3 +10,4 @@ PREP(mainLoop); PREP(moduleSettings); PREP(removeDutyFactor); PREP(renderDebugLines); +PREP(updateStaminaBar); diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 519d218b8c..e3b75a64a6 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -14,6 +14,8 @@ call FUNC(renderDebugLines); ["CBA_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; + [QEGVAR(ui,hideHud), LINKFUNC(updateStaminaBar)] call CBA_fnc_addEventHandler; + ["baseline", { private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0]; switch (stance ACE_player) do { diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index a07abae794..16d355a424 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -140,7 +140,7 @@ systemChat format ["---- velocity %1 - respiratoryRate: %2 ----", (vectorMagnitu [ACE_player, _perceivedFatigue, GVAR(anReserve) == 0, _fwdAngle, _sideAngle] call FUNC(handleEffects); -if (GVAR(enableStaminaBar)) then { +if (GVAR(enableStaminaBarRealized)) then { [GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar); }; diff --git a/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf b/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf new file mode 100644 index 0000000000..627430c820 --- /dev/null +++ b/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Updates the stamina bar state + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_advanced_fatigue_fnc_updateStaminaBar + * + * Public: No + */ + +GVAR(enableStaminaBarRealized) = GVAR(enabled) && GVAR(enableStaminaBar) && {!(missionNamespace getVariable [QEGVAR(ui,hideHud), false])}; +TRACE_1("updateStaminaBar",GVAR(enableStaminaBarRealized)); + +private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; +if (isNull _staminaBarContainer) exitWith {}; + +_staminaBarContainer ctrlSetFade ([1, 0] select GVAR(enableStaminaBarRealized)); +_staminaBarContainer ctrlCommit 0; diff --git a/addons/advanced_fatigue/initSettings.inc.sqf b/addons/advanced_fatigue/initSettings.inc.sqf index 01eba8652d..40d1d08f0d 100644 --- a/addons/advanced_fatigue/initSettings.inc.sqf +++ b/addons/advanced_fatigue/initSettings.inc.sqf @@ -6,12 +6,7 @@ true, 1, { - if (!_this) then { - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlSetFade 1; - _staminaBarContainer ctrlCommit 0; - }; - + call FUNC(updateStaminaBar); [QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged) }, true // Needs mission restart @@ -24,13 +19,7 @@ LSTRING(DisplayName), true, 1, - { - if (!_this) then { - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlSetFade 1; - _staminaBarContainer ctrlCommit 0; - }; - } + {call FUNC(updateStaminaBar)} ] call CBA_fnc_addSetting; [ diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index 5cd36ffce6..76e33a64e5 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -7,7 +7,7 @@ ACE Erweiterte Ausdauer ACE 進階疲勞 ACE 进阶体力 - ACE アドバンスド疲労 + ACE 高度な疲労 ACE Fatica Avanzata ACE 고급 피로도 ACE Fatigue avancée @@ -173,7 +173,7 @@ Enables/disables Advanced Fatigue. Activa/desactiva la fatiga avanzada Aktiviert/deaktiviert Advanced Fatigue. - アドバンスド疲労は高度な疲労管理システムを有効化します。 + 高度な疲労を有効/無効化します。 Włącza/wyłącza zaawansowaną wytrzymałość 고급 피로도 활성화/비활성화 Active/Désactive la fatigue avancée. diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index fc9cf2705a..99fba86630 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -5,7 +5,7 @@ Advanced Throwing Lanzamiento Avanzado Улучшенный бросок гранат - アドバンスド投擲 + 高度な投擲 Zaawansowane rzucanie Erweitertes Wurfsystem 고급 투척 @@ -21,7 +21,7 @@ Allows changing advanced throwing behaviour. Permite modificar el comportamiento del lanzamiento avanzado Позволяет настраивать поведение улучшенного броска гранат. - アドバンスド投擲は投擲の高度な動作挙動を変更可能にします。 + 高度な投擲挙動への変更を可能にします。 Zezwala na zmianę zachowania zaawansowanego trybu rzucania. Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern. 고급 투척 행위를 허가합니다 @@ -36,7 +36,7 @@ Enable Advanced Throwing Activar Lanzamiento Avanzado Вкл. улучшенный бросок - アドバンスド投擲を有効化 + 高度な投擲を有効化 Aktywuj zaawansowane rzucanie Aktiviere erweitertes Wurfsystem 고급 투척 활성화 @@ -52,7 +52,7 @@ Enables advanced throwing system. Activa el Lanzamiento Avanzado Включает систему улучшенного броска. - アドバンスド投擲は高度な投擲システムを有効化します。 + 高度な投擲システムを有効化します。 Aktywuje system zaawansowanego rzucania. Aktiviert das erweiterte Wurfsystem. 고급 투척을 활성화 합니다 diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 041653fe2b..bcec121106 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -182,6 +182,7 @@ Distanza di seguimento Folge-Entfernung 따라가는 거리 + Distance de suivi 追跡距離 @@ -189,6 +190,7 @@ Seguendo unità entro %1m Folgt Einheit bis zu %1m %1m 이내로 유닛을 따라갑니다 + Suivre l'unité jusqu'à %1m %1m 間隔で 目標を追跡します diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 94d4739b60..d0819056f2 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -78,6 +78,7 @@ PREP(removeStat); PREP(removeVirtualItems); PREP(renameDefaultLoadout); PREP(replaceUniqueItemsLoadout); +PREP(saveLoadout); PREP(scanConfig); PREP(showItem); PREP(sortPanel); diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index 10cc3989e9..248fc16db2 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -85,10 +85,10 @@ private _insigniaCondition = toString { // Ref fnc_addListBoxItem, 0/nil = configFile, 1 = campaignConfigFile, 2 = missionConfigFile { - GVAR(insigniaCache) set [_x, 1]; + GVAR(insigniaCache) set [configName _x, 1]; } forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia")); { - GVAR(insigniaCache) set [_x, 2]; + GVAR(insigniaCache) set [configName _x, 2]; } forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia")); ADDON = true; diff --git a/addons/arsenal/functions/fnc_buttonExport.sqf b/addons/arsenal/functions/fnc_buttonExport.sqf index 3e5039a504..abf7c7d6fc 100644 --- a/addons/arsenal/functions/fnc_buttonExport.sqf +++ b/addons/arsenal/functions/fnc_buttonExport.sqf @@ -26,28 +26,27 @@ if (GVAR(shiftState)) then { switch (true) do { // Beginning case (_index == -1): { - "ace_clipboard" callExtension (format ["[%1", endl]); + "ace" callExtension ["clipboard:append", [format ["[%1", endl]]]; }; // End case (_index == _listLength): { - "ace_clipboard" callExtension "];"; + "ace" callExtension ["clipboard:append", ["];"]]; }; // Rest default { - "ace_clipboard" callExtension ([" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""); + "ace" callExtension ["clipboard:append", [[" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""]]; }; }; }; - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportDefault)] call FUNC(message); } else { // Export singular loadout private _export = str (GVAR(center) call CBA_fnc_getLoadout); - - "ace_clipboard" callExtension (_export + ";"); - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:append", [_export]]; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportCurrent)] call FUNC(message); }; diff --git a/addons/arsenal/functions/fnc_buttonImport.sqf b/addons/arsenal/functions/fnc_buttonImport.sqf index 8a83fe3ff0..494bf159da 100644 --- a/addons/arsenal/functions/fnc_buttonImport.sqf +++ b/addons/arsenal/functions/fnc_buttonImport.sqf @@ -16,7 +16,13 @@ params ["_display"]; // Can be either a singular loadout or an array of loadouts -private _extendedLoadout = call compile copyFromClipboard; +private _extendedLoadout = if (isMultiplayer) then { + ("ace" callExtension ["clipboard:loadout", []]) params ["_loadout", "_code"]; + if (_code != 0) exitWith {}; + parseSimpleArray _loadout +} else { + call compile copyFromClipboard +}; // If error, exit if (isNil "_extendedLoadout" || {!(_extendedLoadout isEqualType [])}) exitWith { diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index 0f0a5817c6..ea05cf1769 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -138,14 +138,6 @@ _actionsBoxCtrl ctrlSetPosition [ ]; _actionsBoxCtrl ctrlCommit 0; -// Disable import in MP -if (isMultiplayer) then { - private _importButtonCtrl = _display displayCtrl IDC_buttonImport; - _importButtonCtrl ctrlEnable false; - _importButtonCtrl ctrlSetFade 0.6; - _importButtonCtrl ctrlCommit 0; -}; - //--------------- Camera prep cutText ["", "PLAIN"]; showCommandingMenu ""; diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 4d62075f78..fe69bb3486 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -94,8 +94,8 @@ if (!isNull _loadoutsDisplay) then { }; } params ["_className"]; - "ace_clipboard" callExtension (_className + ";"); - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:append", [_className]]; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportedClassnameText)] call FUNC(message); } else { diff --git a/addons/arsenal/functions/fnc_saveLoadout.sqf b/addons/arsenal/functions/fnc_saveLoadout.sqf new file mode 100644 index 0000000000..05e712e45f --- /dev/null +++ b/addons/arsenal/functions/fnc_saveLoadout.sqf @@ -0,0 +1,37 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Saves a given loadout to the client's profile. + * + * Arguments: + * 0: Name of loadout + * 1: CBA extended loadout or getUnitLoadout array + * 2: Replace existing loadout (default: false) + * + * Return Value: + * True if loadout was saved, otherwise false + * + * Example: + * ["Current Loadout", getUnitLoadout ACE_player] call ace_arsenal_fnc_saveLoadout + * + * Public: Yes + */ + +params [["_name", "", [""]], ["_loadout", [], [[]]], ["_replaceExisting", false, [false]]]; + +if (_name == "" || {_loadout isEqualTo []}) exitWith { false }; + +private _loadouts = profileNamespace getVariable [QGVAR(saved_loadouts), []]; +private _loadoutIndex = _loadouts findIf {(_x#0) == _name}; + +// If a loadout with same name already exists and no overwriting enabled, quit +if (!_replaceExisting && {_loadoutIndex != -1}) exitWith { false }; + +if (_loadoutIndex == -1) then { + _loadouts pushBack [_name, _loadout]; +} else { + _loadouts set [_loadoutIndex, [_name, _loadout]]; +}; + +profileNamespace setVariable [QGVAR(saved_loadouts), _loadouts]; +true diff --git a/addons/arsenal/functions/fnc_sortStatement_mod.sqf b/addons/arsenal/functions/fnc_sortStatement_mod.sqf index ab94520217..063aba0dbc 100644 --- a/addons/arsenal/functions/fnc_sortStatement_mod.sqf +++ b/addons/arsenal/functions/fnc_sortStatement_mod.sqf @@ -14,4 +14,9 @@ params ["_config"]; -(modParams [_config call EFUNC(common,getAddon), ["name"]]) param [0, ""] +private _addon = _config call EFUNC(common,getAddon); + +// Calling modParams with "" prints 'ModParams - Undefined or empty mod directory' in RPT +if (_addon == "") exitWith {""}; + +(modParams [_addon, ["name"]]) param [0, ""] diff --git a/addons/artillerytables/XEH_PREP.hpp b/addons/artillerytables/XEH_PREP.hpp index 7ef48b61dd..7f977dd6b3 100644 --- a/addons/artillerytables/XEH_PREP.hpp +++ b/addons/artillerytables/XEH_PREP.hpp @@ -1,8 +1,14 @@ TRACE_1("prep",_this); +PREP(adjustFire); +PREP(calculateElevation); +PREP(calculateMaxAngle); +PREP(calculateMuzzleVelocity); +PREP(calculateSolution); PREP(firedEH); PREP(interactMenuOpened); PREP(rangeTableOpen); PREP(rangeTableUpdate); +PREP(simulateShot); PREP(turretChanged); PREP(turretPFEH); diff --git a/addons/artillerytables/XEH_postInit.sqf b/addons/artillerytables/XEH_postInit.sqf index 4f0e203208..0696302ea9 100644 --- a/addons/artillerytables/XEH_postInit.sqf +++ b/addons/artillerytables/XEH_postInit.sqf @@ -4,10 +4,13 @@ TRACE_2("CBA_settingsInitialized",GVAR(advancedCorrections),GVAR(disableArtilleryComputer)); if (hasInterface) then { - // Add hud overlay for actuall azimuth and elevation: + // Add hud overlay for actual azimuth and elevation: GVAR(pfID) = -1; ["turret", LINKFUNC(turretChanged), true] call CBA_fnc_addPlayerEventHandler; + // Handles being teleported from one vehicle to another + ["vehicle", {[_this select 0, (_this select 1) unitTurret (_this select 0)] call FUNC(turretChanged)}] call CBA_fnc_addPlayerEventHandler; + // Add ability to dynamically open rangetables: ["ace_interactMenuOpened", LINKFUNC(interactMenuOpened)] call CBA_fnc_addEventHandler; }; @@ -30,6 +33,33 @@ }; }] call CBA_fnc_addEventHandler; +addMissionEventHandler ["ExtensionCallback", { + params ["_name", "_function", "_data"]; + if (_name == "ace:artillery" && {_function == "calculate_table"}) then { + (parseSimpleArray _data) params ["_line", "_data"]; + if (_data isEqualType []) then { + GVAR(tableData) set [_line, _data]; + }; + GVAR(tableSizeReceived) = GVAR(tableSizeReceived) + 1; + if (GVAR(tableSizeReceived) == GVAR(tableSizeActual)) then { + private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; + private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; + if (isNull _dialog) exitWith {true}; + for "_i" from 0 to GVAR(tableSizeActual) do { + private _row = GVAR(tableData) getOrDefault [_i, []]; + if (count _row == 12) then { + _ctrlRangeTable lnbAddRow _row; + }; + }; + private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; + private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; + if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);}; + _ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""]; + TRACE_1("table filled",_ctrlRangeTable); + }; + }; +}]; + #ifdef DEBUG_MODE_FULL #include "dev\showShotInfo.inc.sqf" #include "dev\checkConfigs.inc.sqf" diff --git a/addons/artillerytables/config.cpp b/addons/artillerytables/config.cpp index 1f6fa9f74e..5aafdfb9b2 100644 --- a/addons/artillerytables/config.cpp +++ b/addons/artillerytables/config.cpp @@ -14,13 +14,6 @@ class CfgPatches { }; }; -class ACE_Extensions { - class ace_artillerytables { - windows = 1; - client = 1; - }; -}; - #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/artillerytables/functions/fnc_adjustFire.sqf b/addons/artillerytables/functions/fnc_adjustFire.sqf new file mode 100644 index 0000000000..96c884880d --- /dev/null +++ b/addons/artillerytables/functions/fnc_adjustFire.sqf @@ -0,0 +1,41 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Adjusts a target point north and east, and recalculates a solution in air based on atmospheric conditions + * + * Arguments: + * 0: Gun Position ASL + * 1: Target Position ASL + * 2: Adjustment to the East (negative is West); meters + * 3: Adjustment to the North (negative is South); meters + * 4: Adjustment vertically (negative is Down); meters + * 5: Muzzle velocity; meters/second + * 6: Air Friction; meters^-1 (m/s^2)/(m^2/s^2) + * 7: High angle boolean (true is high angle) + * 8: Temperature; degrees Celsius + * 9: Atmospheric Density; kg/(meters^3) + * 10: Direction of wind; degrees clockwise from north + * 11: Speed of wind; meters/second + * + * Return Value: + * Array of returns + * 0: Angle of shot; Milliradians + * 1: Angle adjust left or right; Milliradians + * 2: Time of flight; seconds + * + * Example: + * [getposASL vehicle player, targetPos, 20, 50, 0, 200, -0.0001, true, 15, 1.225, 225, 5] call ace_artilleryTables_fnc_adjustFire + * + * Public: No + */ + +params ["_gunPos", "_targetPos", "_adjustEast", "_adjustNorth", "_adjustUp", "_muzzleVelocity", "_airFriction", ["_highAngle", true], ["_temperature", 15], ["_airDensity", 1.225], ["_windDir", 0], ["_windSpeed", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +private _resultPos = [_adjustEast + _targetPos select 0, _adjustNorth + _targetPos select 1, _adjustUp + _targetPos select 2]; + +private _returns = ["_gunPos", "_resultPos", "_muzzleVelocity", "_highAngle", "_airFriction", "_temperature", "_airDensity", "_windDir", "_windSpeed"] call FUNC(calculateSolution); + +_returns diff --git a/addons/artillerytables/functions/fnc_calculateElevation.sqf b/addons/artillerytables/functions/fnc_calculateElevation.sqf new file mode 100644 index 0000000000..f37ddaad92 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateElevation.sqf @@ -0,0 +1,71 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Adjusts a target point north and east, and recalculates a solution in air based on atmospheric conditions + * + * Arguments: + * 0: Distance to Target; meters + * 1: Height of target; meters, relative to gun altitude (positive means target higher than gun) + * 2: Muzzle velocity; meters/second + * 3: High angle boolean (true is high angle) + * 4: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] + * 5: Temperature; degrees Celsius + * 6: Atmospheric Density; kg/(meters^3) + * 7: Cross wind; meters/second (negative is Right to Left) + * 8: Tail wind; meters/second (negative is flying against the wind) + * + * Return Value: + * Array of returns + * 0: Angle of shot; Milliradians + * 1: Angle adjust left or right; Milliradians + * 2: Time of flight; seconds + * + * Example: + * [myPos, 0, 200, true, -0.0001, 15, 1.225, 5, -10] call ace_artilleryTables_fnc_calculateElevation + * + * Public: No + */ + +params ["_targetDistance", "_targetHeight", "_muzzleVelocity", ["_highArc", true], ["_airFriction", 0], ["_temperature", 15], ["_airDensity", 1.225], ["_crossWind", 0], ["_tailWind", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +if (_airFriction != 0) then { + _muzzleVelocity = [_muzzleVelocity, _temperature, _atmosphericDensity] call FUNC(calculateMuzzleVelocity); +}; +private _maxResults = [_muzzleVelocity, _airFriction] call FUNC(calculateMaxAngle); + +private _testShot = [_maxResults select 0, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(simulateShot); +if (_testShot select 1 < _targetDistance) exitWith { + //No way we can hit it so don't bother; + [-1, -1, -1] +}; + +private _useDistance = _targetDistance; +private _useAngle = 0; +private _resultDistance = 0; +private _xDeviation = 0; +private _tof = 0; + +while {abs(_resultDistance - _targetDistance) > 0.5} do { + TRACE_7("callExtension:artillery:simulate_find_solution",_useDistance,_targetHeight,_muzzleVelocity,_airFriction,_higharc,DEFAULT_MIN_ELEV,DEFAULT_MAX_ELEV); + ( + "ace" callExtension ["artillery:simulate_find_solution", [_useDistance, _targetHeight, _muzzleVelocity, _airFriction, _higharc, DEFAULT_MIN_ELEV, DEFAULT_MAX_ELEV]] + ) params ["_data", "_code"]; + TRACE_1("",_code); + (parseSimpleArray _data) params ["", "_useAngleRad", ""]; + _useAngle = deg(_useAngleRad) * DEGTOMILS; + + private _shotResults = [_useAngle, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(simulateShot); + + _xDeviation = _shotResults select 0; + _resultDistance = _shotResults select 1; + _tof = _shotResults select 2; + _useDistance = (2 * _targetDistance) - _resultDistance; +}; + +private _angleOffsetDeg = _xDeviation atan2 _resultDistance; +private _angleOffset = _angleOffsetDeg * DEGTOMILS; + +[_useAngle, -_angleOffset, _tof] diff --git a/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf b/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf new file mode 100644 index 0000000000..62d3cc91a2 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf @@ -0,0 +1,31 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Calculates the best possible angle to shoot farthest based on muzzle velocity and air friction. + * + * Arguments: + * 0: Initial Muzzle Velocity; meters/second + * 1: Air Friction; meters^-1 (m/s^2)/(m^2/s^2) + * + * Return Values: + * 1: Best Angle; Milliradians + * 2: Furthest Distance; Meters + * + * Example: + * [200, -0.00006] call ace_artilleryTables_fnc_calculateMaxAngle + * + * Public: No + */ + +params ["_muzzleVelocity", "_airFriction"]; + +TRACE_2("callExtension:artillery:find_max_angle",_muzzleVelocity,_airFriction); +( + "ace" callExtension ["artillery:find_max_angle", [_muzzleVelocity, _airFriction]] +) params ["_data", "_code"]; +TRACE_1("",_code); +(parseSimpleArray _data) params ["_bestAngle", "_bestDistance", ""]; +_returns = [deg _bestAngle * 6400 / 360, _bestDistance]; +_returns params ["_bestAngle", "_bestDistance"]; + +_returns diff --git a/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf new file mode 100644 index 0000000000..6f00f74c14 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf @@ -0,0 +1,28 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Calculates the muzzleVelocity change with advanced calculations. + * + * Arguments: + * 0: Initial Muzzle velocity; meters/second + * 1: Temperature; degrees Celsius + * 2: Atmospheric Density; kg/(meters^3) + * + * Return Value: + * Adjusted Muzzle Velocity; Meters + * + * Example: + * [200, 15, 1.225] call ace_artilleryTables_fnc_calculateMuzzleVelocity + * + * Public: No + */ + +params ["_muzzleVelocity", "_temperature", "_airDensity"]; + +// Calculate air density +private _relativeDensity = _airDensity / 1.225; +private _newMuzzleVelocityCoefficient = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); + +private _newMuzzleVelocity = _muzzleVelocity * _newMuzzleVelocityCoefficient; + +_newMuzzleVelocity diff --git a/addons/artillerytables/functions/fnc_calculateSolution.sqf b/addons/artillerytables/functions/fnc_calculateSolution.sqf new file mode 100644 index 0000000000..13e798568c --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateSolution.sqf @@ -0,0 +1,44 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Provides fire angle and deflection solutions on a target of set distance and height, including accounting for drag and atmospheric wind conditions. + * + * Arguments: + * 0: Gun Position ASL; + * 1: Target Position ASL; + * 2: Muzzle Velocity; meters/second + * 3: High angle boolean (true is high angle) + * 4: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] + * 5: Temperature; degrees Celsius + * 6: Atmospheric Density; kg/(meters^3) + * 7: Direction of wind; degrees clockwise from north + * 8: Speed of wind; meters/second + * + * Return Value: + * array of returns + * 0: Angle of shot; Milliradians + * 1: Angle adjust left or right; Milliradians + * 2: Time of flight; seconds + * + * Example: + * [myPos, targetPos, 200, true, -0.0001, 15, 1.225, 225, 5] call ace_artilleryTables_fnc_calculateSolution + * + * Public: No + */ + +params ["_ownPos", "_targetPos", "_muzzleVelocity", ["_highAngle", true], ["_airFriction", 0], ["_temperature", 15], ["_airDensity", 1.225], ["_windDir", 0], ["_windSpeed", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +private _relPos = _targetPos vectorDiff _ownPos; + +private _targetDir = (_relpos select 0) atan2 (_relPos select 1); +private _targetDist = sqrt( (_relPos select 0)^2 + (_relpos select 1)^2 ); +private _heightDif = _relPos select 2; +private _crossWind = sin(_targetDir - _windDir) * _windSpeed; +private _tailWind = -cos(_targetDir - _windDir) * _windSpeed; + +private _solutionReturns = [_targetDist, _heightDif, _muzzleVelocity, _highAngle, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(calculateElevation); + +_solutionReturns diff --git a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf index 508b8c894c..3984e4dacb 100644 --- a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf @@ -34,7 +34,7 @@ TRACE_2("created dialog",_dialog,_ctrlChargeList); // Get Mags: private _mags = [_weaponName] call CBA_fnc_compatibleMagazines; -if (_mags isEqualTo []) exitWith {WARNING_1("No Mags",_weaponName);}; +if (_mags isEqualTo []) exitWith {WARNING_1("No Mags %1",_weaponName);}; private _magCfg = configFile >> "CfgMagazines"; private _magParamsArray = []; _mags = _mags apply { diff --git a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf index 3e50f9d7ad..4cce2499cf 100644 --- a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf @@ -34,31 +34,12 @@ _ctrlElevationLow ctrlSetTextColor ([[1,1,1,1],[0.25,0.25,0.25,1]] select GVAR(l lnbClear _ctrlRangeTable; // Call extension with current data and start workers -TRACE_5("callExtension:start",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)); -private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)]]; -TRACE_1("",_ret); +TRACE_5("callExtension:artillery:calculate_table",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)); +( + "ace" callExtension ["artillery:calculate_table", [_muzzleVelocity, _airFriction, _elevMin, _elevMax, GVAR(lastElevationMode)]] +) params ["_data", "_code"]; +TRACE_1("",_code); -// Non-blocking read data out of extension as it becomes availiable -[{ - private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; - private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; - if (isNull _dialog) exitWith {true}; - - private _status = 1; // 1 = data on line, 2 - data not ready, 3 - done - while {_status == 1} do { - private _ret = ("ace_artillerytables" callExtension ["getline", []]); - // TRACE_1("callExtension:getline",_ret); - _status = _ret select 1; - if (_status == 1) then { _ctrlRangeTable lnbAddRow parseSimpleArray (_ret select 0) }; - }; - - (_status == 3) // exit loop when all data read -}, { - // put dummy line at end because scrolling is problematic and can't see last line - private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; - private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; - if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);}; - - _ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""]; - TRACE_1("table filled",_ctrlRangeTable); -}, []] call CBA_fnc_waitUntilAndExecute; +GVAR(tableData) = createHashMap; +GVAR(tableSizeActual) = (parseSimpleArray _data) select 1; +GVAR(tableSizeReceived) = 0; diff --git a/addons/artillerytables/functions/fnc_simulateShot.sqf b/addons/artillerytables/functions/fnc_simulateShot.sqf new file mode 100644 index 0000000000..be747e862a --- /dev/null +++ b/addons/artillerytables/functions/fnc_simulateShot.sqf @@ -0,0 +1,47 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Simulates an indirect shot on a target of known height with given drag, wind, and atmospheric conditions + * + * Arguments: + * 0: Gun Elevation Angle; milliradians + * 1: Relative Target Height; meters, relative to gun altitude (positive means target higher than gun) + * 2: Muzzle Velocity; meters/second + * 3: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] + * 4: Cross wind; meters/second (negative is Right to Left) + * 5: Tail wind; meters/second (negative is flying against the wind) + * 6: Temperature; degrees Celsius + * 7: Atmospheric Density; kg/(meters^3) + * + * Return Value: + * array of returns + * 0: Deflection Adjustment To Hit; Milliradians (negative is Left) + * 1: Distance of Shot; meters + * 2: Time of Flight; seconds + * + * Example: + * [900, 10, 200, -0.0001, 4, 0, 15, 1.225] call ace_artilleryTables_fnc_simulateShot + * + * Public: No + */ + +params ["_angle", "_targetHeight", "_muzzleVelocity", ["_airFriction", 0], ["_crossWind", 0], ["_tailWind", 0], ["_temperature", 15], ["_atmosphericDensity", 1.225]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +if (_airFriction != 0) then { + _muzzleVelocity = [_muzzleVelocity, _temperature, _atmosphericDensity] call FUNC(calculateMuzzleVelocity); +}; + +private _atmosphericDensityRatio = _atmosphericDensity / 1.225; +private _radAngle = rad(_angle / DEGTOMILS); + +TRACE_8("callExtension:artillery:simulate_shot",_radAngle,_targetHeight,_muzzleVelocity,_airFriction,_crossWind,_tailWind,_temperature,_atmosphericDensityRatio); +( + "ace" callExtension ["artillery:simulate_shot", [_radAngle, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _atmosphericDensityRatio]] +) params ["_data", "_code"]; +TRACE_1("",_code); + +//[xDeviation, yDistance, timeOfFlight] +parseSimpleArray _data diff --git a/addons/artillerytables/functions/fnc_turretPFEH.sqf b/addons/artillerytables/functions/fnc_turretPFEH.sqf index 9ad10de1aa..e1964f7e41 100644 --- a/addons/artillerytables/functions/fnc_turretPFEH.sqf +++ b/addons/artillerytables/functions/fnc_turretPFEH.sqf @@ -30,7 +30,10 @@ if (isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { }; private _ctrlGroup = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl 1000; -if (cameraView != "GUNNER") exitWith { // need to be in gunner mode, so we can check where the optics are aiming at + +// Need to be in gunner mode, so we can check where the optics are aiming at +// However, if there are no optics, ignore the above +if (!_invalidGunnerMem && {cameraView != "GUNNER"}) exitWith { _ctrlGroup ctrlShow false; }; _ctrlGroup ctrlShow true; diff --git a/addons/artillerytables/script_component.hpp b/addons/artillerytables/script_component.hpp index 128c3c17ff..a2303b2a76 100644 --- a/addons/artillerytables/script_component.hpp +++ b/addons/artillerytables/script_component.hpp @@ -12,6 +12,10 @@ // This is a good fit for most large artillery, but a little low for lighter mortars #define DEFAULT_AIR_FRICTION -0.00006 +#define DEFAULT_MIN_ELEV 0 +// 90 degrees in radians +#define DEFAULT_MAX_ELEV 1.5708 + #define DEGTOMILS 17.7777778 #define IDC_MODECONTROLGROUP 1000 diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index 125d4a488e..9b02aba491 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_ATragMX"}; weapons[] = {"ACE_ATragMX"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics", "ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf index 9fe18a258d..e667d22e75 100644 --- a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf +++ b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf @@ -30,9 +30,16 @@ while {_velocity > _thresholdVelocity} do { private _bc = GVAR(targetSolutionInput) select 14; private _dragModel = GVAR(targetSolutionInput) select 15; private _temperature = GVAR(targetSolutionInput) select 5; - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _velocity, _temperature])); _distance = _distance + _velocity * __DELTA_T; - _velocity = _velocity - (_drag * __DELTA_T); + private _data = ( + "ace" callExtension ["ballistics:retard", [ + _dragModel, + _bc, + _velocity, + _temperature + ]] + ) select 0; + _velocity = _velocity - ((parseNumber _data) * __DELTA_T); }; _distance diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 7efc25ebbf..5f09fb35b1 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -90,7 +90,14 @@ private _wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windD private _wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; private _windDrift = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [ + _bc, + _temperature, + _barometricPressure, + _relativeHumidity, + _atmosphereModel + ]] + ) select 0); }; private _eoetvoesMultiplier = 0; @@ -113,8 +120,15 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); - _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); + private _data = ( + "ace" callExtension ["ballistics:retard", [ + _dragModel, + _bc, + _trueSpeed, + _temperature + ]] + ) select 0; + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * (parseNumber _data)); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); }; diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index 8a3eca1344..d29ad18b68 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -36,11 +36,25 @@ if (!GVAR(atmosphereModeTBH)) then { }; private _scopeBaseAngle = if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [ + _zeroRange, + _muzzleVelocity, + _airFriction, + _boreHeight + ]]) select 0) } else { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, _temperature, _barometricPressure, _relativeHumidity, _bc, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_advanced", [ + _zeroRange, + _muzzleVelocity, + _airFriction, + _boreHeight, + _temperature, + _barometricPressure, + _relativeHumidity, + _bc, + _dragModel, + _atmosphereModel + ]]) select 0) }; GVAR(workingMemory) set [2, _zeroRange]; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6a0c408271..d1e9f12987 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -50,8 +50,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment } else { GVAR(placeAction) = PLACE_WAITING; - [_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; @@ -88,8 +88,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { [_idPFH] call CBA_fnc_removePerFrameHandler; - [_unit, "forceWalk", "ACE_Attach", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); _unit removeAction _actionID; diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 1dc6ca7bfa..f3c728d053 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -40,12 +40,12 @@ if (_respawn > 3) then { if (_unit getVariable [QGVAR(isHandcuffed), false]) then { [_unit, false] call FUNC(setHandcuffed); }; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { [_unit, false] call FUNC(setSurrendered); }; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isEscorting), false]) then { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index d3d9fa4e6b..2ccd36493c 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -41,8 +41,8 @@ if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith if (_state) then { _unit setVariable [QGVAR(isHandcuffed), true, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop [_unit, false] call FUNC(setSurrendered); @@ -82,8 +82,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 887bfb2680..3a3724c94d 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -44,8 +44,8 @@ if (_state) then { _unit setVariable [QGVAR(isSurrendering), true, true]; - [_unit, "setCaptive", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); if (_unit == ACE_player) then { ["captive", [false, false, false, false, false, false, false, false, false, true]] call EFUNC(common,showHud); @@ -71,8 +71,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isSurrendering), false, true]; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 4fc86ec58f..dfc293028d 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -158,6 +158,7 @@ 目隠しを外す Снять повязку с глаз Quitar vendas de los ojos + Remover a venda Cable Tie diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 21ebc0d52a..aa3117c7dd 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -62,6 +62,17 @@ if (_item isEqualType objNull) then { // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) [_item, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + + // Prevent UAVs from firing + private _UAVCrew = _item call EFUNC(common,getVehicleUAVCrew); + + if (_UAVCrew isNotEqualTo []) then { + { + [_x, true] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _item setVariable [QGVAR(isUAV), _UAVCrew, true]; + }; }; // Invoke listenable event diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index acd780f463..6a84a20799 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -100,14 +100,26 @@ if (_item isEqualType objNull) then { // Create smoke effect when crate landed [{ - (_this select 0) params ["_object"]; + params ["_object", "_pfhID"]; if (isNull _object) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; }; if (getPos _object select 2 < 1) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then { private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0]; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index f32215fdd7..7580de8488 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -96,6 +96,18 @@ if (_object isEqualType objNull) then { [QEGVAR(zeus,addObjects), [[_object], _objectCurators]] call CBA_fnc_serverEvent; }; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; } else { _object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; diff --git a/addons/chemlights/config.cpp b/addons/chemlights/config.cpp index 263fcb1a57..7f30429e79 100644 --- a/addons/chemlights/config.cpp +++ b/addons/chemlights/config.cpp @@ -3,6 +3,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {"ACE_Box_Chemlights","ACE_Item_Chemlight_Shield","ACE_Item_Chemlight_Shield_Green","ACE_Item_Chemlight_Shield_Red","ACE_Item_Chemlight_Shield_Blue","ACE_Item_Chemlight_Shield_Yellow","ACE_Item_Chemlight_Shield_Orange","ACE_Item_Chemlight_Shield_White","ModuleChemlightOrange","ModuleChemlightWhite","ModuleChemlightHiRed","ModuleChemlightHiYellow","ModuleChemlightHiWhite","ModuleChemlightHiBlue","ModuleChemlightHiGreen","ModuleChemlightUltraHiOrange"}; weapons[] = {"ACE_Chemlight_Shield", "ACE_Chemlight_Shield_Green","ACE_Chemlight_Shield_Red","ACE_Chemlight_Shield_Blue","ACE_Chemlight_Shield_Yellow","ACE_Chemlight_Shield_Orange","ACE_Chemlight_Shield_White"}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/chemlights/script_component.hpp b/addons/chemlights/script_component.hpp index 324af2c55c..5095ebe666 100644 --- a/addons/chemlights/script_component.hpp +++ b/addons/chemlights/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT chemlights +#define COMPONENT_BEAUTIFIED Chemlights #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 3a5838a230..3614775345 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -43,6 +43,7 @@ PREP(deviceKeyFindValidIndex); PREP(deviceKeyRegisterNew); PREP(deprecateComponent); PREP(disableAI); +PREP(disableAiUAV); PREP(disableUserInput); PREP(displayIcon); PREP(displayText); @@ -177,6 +178,7 @@ PREP(setupLocalUnitsHandler); PREP(setVariableJIP); PREP(setVariablePublic); PREP(setVolume); +PREP(setWeaponLightLaserState); PREP(showHud); PREP(statusEffect_addType); PREP(statusEffect_get); @@ -189,6 +191,7 @@ PREP(stopGesture); PREP(stringCompare); PREP(stringToColoredText); PREP(swayLoop); +PREP(switchAttachmentMode); PREP(switchPersistentLaser); PREP(switchToGroupSide); PREP(throttledPublicVariable); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index b569a4608e..44197df81a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -19,16 +19,16 @@ //Status Effect EHs: [QGVAR(setStatusEffect), LINKFUNC(statusEffect_set)] call CBA_fnc_addEventHandler; -["forceWalk", false, ["ace_advanced_fatigue", "ACE_SwitchUnits", "ACE_Attach", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_Trenches", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered)]] call FUNC(statusEffect_addType); -["blockDamage", false, ["fixCollision", "ACE_cargo"]] call FUNC(statusEffect_addType); -["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); -["blockThrow", false, ["ACE_Attach", "ACE_concertina_wire", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_rearm", "ACE_refuel", "ACE_Sandbag", "ACE_Trenches", "ACE_tripod"]] call FUNC(statusEffect_addType); +["forceWalk", false, ["ace_advanced_fatigue", "ace_attach", "ace_dragging", "ace_explosives", QEGVAR(medical,fracture), "ace_rearm", "ace_refuel", "ace_sandbag", "ace_switchunits", "ace_tacticalladder", "ace_trenches"]] call FUNC(statusEffect_addType); +["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", QEGVAR(medical,fracture)]] call FUNC(statusEffect_addType); +["setCaptive", true, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered)]] call FUNC(statusEffect_addType); +["blockDamage", false, ["fixCollision", "ace_cargo"]] call FUNC(statusEffect_addType); +["blockEngine", false, ["ace_refuel"]] call FUNC(statusEffect_addType); +["blockThrow", false, ["ace_attach", "ace_concertina_wire", "ace_dragging", "ace_explosives", "ace_rearm", "ace_refuel", "ace_sandbag", "ace_tacticalladder", "ace_trenches", "ace_tripod"]] call FUNC(statusEffect_addType); ["setHidden", true, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); +["blockRadio", false, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); ["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType); +["disableWeaponAssembly", false, ["ace_common", QGVAR(lockVehicle), "ace_csw"]] call FUNC(statusEffect_addType); ["lockInventory", true, [], true] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { @@ -133,6 +133,30 @@ _object lockInventory (_set > 0); }] call CBA_fnc_addEventHandler; +[QGVAR(disableAiUAV), { + params ["_unit", "_disable"]; + + if (_disable) then { + private _features = ["AUTOTARGET", "TARGET", "WEAPONAIM"/*, "FIREWEAPON"*/, "RADIOPROTOCOL"]; // TODO: Uncomment in 2.18 + + // Save current status + _unit setVariable [QGVAR(featuresAiUAV), _features apply {[_x, _unit checkAIFeature _x]}]; + + { + _unit enableAIFeature [_x, false]; + } forEach _features; + } else { + // Restore previous status + private _features = _unit getVariable [QGVAR(featuresAiUAV), []]; + + { + _unit enableAIFeature [_x select 0, _x select 1]; + } forEach _features; + + _unit setVariable [QGVAR(featuresAiUAV), nil]; + }; +}] call CBA_fnc_addEventHandler; + //Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit //This variable is used for isPlayer checks if (isServer) then { @@ -192,6 +216,7 @@ if (isServer) then { [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; [QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; +[QGVAR(triggerAmmo), {triggerAmmo _this}] call CBA_fnc_addEventHandler; [QGVAR(setVanillaHitPointDamage), { params ["_object", "_hitPointAnddamage"]; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b559cb5dd9..f2194deb64 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -12,6 +12,8 @@ GVAR(showHudHash) = createHashMap; GVAR(vehicleIconCache) = createHashMap; // for getVehicleIcon GVAR(wheelSelections) = createHashMap; +GVAR(InteractionConditions) = createHashMap; + GVAR(blockItemReplacement) = false; // Cache for FUNC(isModLoaded) diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index 208adea7b1..3168243c06 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -15,3 +15,25 @@ uiNamespace setVariable [QGVAR(addonCache), createHashMap]; // Cache for FUNC(getConfigName) uiNamespace setVariable [QGVAR(configNames), createHashMap]; + +//Add warnings for missing compat PBOs +GVAR(isModLoadedCache) = createHashMap; +{ + _x params ["_modPBO", "_compatPBO"]; + if ([_modPBO] call FUNC(isModLoaded) && {!([_compatPBO] call FUNC(isModLoaded))}) then { + WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2]",_modPBO,_compatPBO); + }; +} forEach [ + ["CUP_Creatures_People_LoadOrder","ace_compat_cup_units"], + ["CUP_Vehicles_LoadOrder","ace_compat_cup_vehicles"], + ["CUP_Weapons_LoadOrder","ace_compat_cup_weapons"], + ["r3f_armes_c","ace_compat_r3f"], + ["RF_Data_Loadorder","ace_compat_rf"], + ["RH_acc","ace_compat_rh_acc"], + ["RH_de_cfg","ace_compat_rh_de"], + ["RH_m4_cfg","ace_compat_rh_m4"], + ["RH_PDW","ace_compat_rh_pdw"], + ["RKSL_PMII","ace_compat_rksl_pm_ii"], + ["iansky_opt","ace_compat_sma3_iansky"], + ["R3F_Armes","ace_compat_r3f"] +]; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 144e7d96c6..f7b27ce374 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -70,8 +70,6 @@ class ctrlMapEmpty; #include "CompassControl.hpp" #include "CfgUIGrids.hpp" -class ACE_Extensions {}; - class ACE_Tests { vehicleTransportInventory = QPATHTOF(dev\test_vehicleInventory.sqf); mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf); diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 3dce27cf55..1d315f5aa5 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -19,17 +19,4 @@ params ["_conditionName", "_conditionFunc"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) then { - _index = count _conditionNames; -}; - -_conditionNames set [_index, _conditionName]; -_conditionFuncs set [_index, _conditionFunc]; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) set [_conditionName, _conditionFunc]; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index dd684d0619..134a3101e4 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -27,15 +27,11 @@ private _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - private _canInteract = true; - { - if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { + if (!(_x in _exceptions) && {!([_unit, _target] call _y)}) exitWith { _canInteract = false; }; -} forEach _conditionNames; +} forEach GVAR(InteractionConditions); _canInteract diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 7b90a1b0a8..27623454ed 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -103,47 +103,29 @@ if (_oldCompats isNotEqualTo []) then { /////////////// private _platform = toLowerANSI (productVersion select 6); -if (!isServer && {_platform in ["linux", "osx"]}) then { +if (_platform in ["linux", "osx"]) then { // Linux and OSX client ports do not support extensions at all - INFO("Operating system does not support extensions"); + if (hasInterface) then { + WARNING("Operating system does not support extensions"); + } else { + INFO("Operating system does not support extensions"); + }; } else { - { - private _extension = configName _x; - private _isWindows = _platform == "windows" && {getNumber (_x >> "windows") == 1}; - private _isLinux = _platform == "linux" && {getNumber (_x >> "linux") == 1}; - private _isClient = hasInterface && {getNumber (_x >> "client") == 1}; - private _isServer = !hasInterface && {getNumber (_x >> "server") == 1}; + ("ace" callExtension ["version", []]) params [["_versionEx", "", [""]], ["_returnCode", -1, [-1]]]; - if ((_isWindows || _isLinux) && {_isClient || _isServer}) then { - private _versionEx = _extension callExtension "version"; + if (_returnCode != 0 || {_versionEx == ""}) then { + private _errorMsg = format ["Extension not found. [Return Code: %1]", _returnCode]; + ERROR(_errorMsg); - if (_versionEx == "") then { - private _extensionFile = _extension; - - if (productVersion select 7 == "x64") then { - _extensionFile = format ["%1_x64", _extensionFile]; - }; - - private _platformExt = [".dll", ".so"] select (_platform == "linux"); - _extensionFile = format ["%1%2", _extensionFile, _platformExt]; - - private _errorMsg = format ["Extension %1 not found.", _extensionFile]; - ERROR(_errorMsg); - - if (hasInterface) then { - ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); - }; - } else { - // Print the current extension version - INFO_2("Extension version: %1: %2",_extension,_versionEx); - }; + if (hasInterface) then { + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; - } forEach ("true" configClasses (configFile >> "ACE_Extensions")); + } else { + _versionEx = _versionEx select [0, 8]; // git hash + INFO_1("Extension [Version: %1]",_versionEx); + }; }; -if (isArray (configFile >> "ACE_Extensions" >> "extensions")) then { - WARNING("extensions[] array no longer supported"); -}; /////////////// // Check server version/addons diff --git a/addons/common/functions/fnc_deprecateComponent.sqf b/addons/common/functions/fnc_deprecateComponent.sqf index 5408a896a1..d979c043ef 100644 --- a/addons/common/functions/fnc_deprecateComponent.sqf +++ b/addons/common/functions/fnc_deprecateComponent.sqf @@ -38,7 +38,7 @@ if (_isDeprecatedLoaded && {!_isReplacementLoaded}) then { switch (true) do { case (_componentMajor >= _major && {_componentMinor >= _minor} && {_componentPatch >= _patch}): { // Removed from this version private _message = format[ - "Component %1 is deprecated. It has been replaced by %2. The component %1 is no longer usable on this version. ", _oldComponentName, _newComponentName, _version]; + "Component %1 is deprecated. It has been replaced by %2. The component %1 is no longer usable on this version %3. ", _oldComponentName, _newComponentName, _version]; systemChat format["ACE [ERROR] - %1", _message]; ERROR(_message); }; diff --git a/addons/common/functions/fnc_disableAiUAV.sqf b/addons/common/functions/fnc_disableAiUAV.sqf new file mode 100644 index 0000000000..195e3ed2dc --- /dev/null +++ b/addons/common/functions/fnc_disableAiUAV.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Disables/Enables UAV AI crew members, can be run on any machine and is applied globally. + * + * Arguments: + * 0: Unit + * 1: Disable AI + * + * Return Value: + * None + * + * Example: + * [cursorObject, true] call ace_common_fnc_disableAiUAV + * + * Public: No + */ + +params [["_unit", objNull, [objNull]], ["_disable", true, [false]]]; + +// Allow disabling of Zeus remote controlled units +if (!alive _unit || {isPlayer _unit} || {!unitIsUAV _unit}) exitWith {}; + +if (_disable) then { + // Ignore if already disabled + if (!isNil "_jipID") exitWith {}; + + // Disable shooting and targeting on every machine + // Give predefined JIP ID, in case of simultaneous executions on different machines + private _jipID = [QGVAR(disableAiUAV), [_unit, _disable], QGVAR(disableAiUAV_) + hashValue _unit] call CBA_fnc_globalEventJIP; + [_jipID, _unit] call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), _jipID, true]; +} else { + // Restore shooting and targeting to each client's individual state prior to disabling + private _jipID = _unit getVariable QGVAR(disableAiUavJipID); + + if (isNil "_jipID") exitWith {}; + + _jipID call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), nil, true]; + + [QGVAR(disableAiUAV), [_unit, _disable]] call CBA_fnc_globalEvent; +}; diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index 11fffaf196..0184a0c8c8 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Get the muzzles of a weapon. * * Arguments: @@ -10,19 +10,30 @@ * All weapon muzzles * * Example: - * ["gun"] call ace_common_fnc_getWeaponMuzzles + * "arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles * * Public: Yes */ params [["_weapon", "", [""]]]; -private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); +private _config = configFile >> "CfgWeapons" >> _weapon; +if (!isClass _config) exitWith { + [] // return +}; + +private _muzzles = []; + +// Get config case muzzle names { if (_x == "this") then { - _muzzles set [_forEachIndex, configName (configFile >> "CfgWeapons" >> _weapon)]; + _muzzles pushBack (configName _config); + } else { + if (isClass (_config >> _x)) then { + _muzzles pushBack (configName (_config >> _x)); + }; }; -} forEach _muzzles; +} forEach getArray (_config >> "muzzles"); -_muzzles +_muzzles // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index f564e5e872..1ab4ed21b0 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -17,4 +17,4 @@ params ["_unit"]; -alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])} +lifeState _unit in ["HEALTHY", "INJURED"] diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 6c5e8b56b6..841a9a00b1 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -18,16 +18,4 @@ params ["_conditionName"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; - -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) exitWith {}; - -_conditionNames deleteAt _index; -_conditionFuncs deleteAt _index; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) deleteAt _conditionName; diff --git a/addons/common/functions/fnc_setWeaponLightLaserState.sqf b/addons/common/functions/fnc_setWeaponLightLaserState.sqf new file mode 100644 index 0000000000..7f50573acb --- /dev/null +++ b/addons/common/functions/fnc_setWeaponLightLaserState.sqf @@ -0,0 +1,59 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Toggles the unit's current weapon's light & laser. + * API for persistent lasers. Doesn't work on AI, as they have their own logic. + * + * Arguments: + * 0: Unit + * 1: Weapon light/laser state (default: false) + * + * Return Value: + * None + * + * Example: + * [player, true] call ace_common_fnc_setWeaponLightLaserState + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]], ["_state", false, [false]]]; + +if (!local _unit || {!alive _unit} || {!(_unit call FUNC(isPlayer))}) exitWith {}; + +if !(_unit call CBA_fnc_canUseWeapon) exitWith {}; + +private _currentWeapon = currentWeapon _unit; + +// Exit if unit has no weapon selected +if (_currentWeapon == "") exitWith {}; + +private _weaponIndex = [_unit, _currentWeapon] call FUNC(getWeaponIndex); + +// Ignore binoculars +if (_weaponIndex == -1) exitWith {}; + +_unit setVariable [QGVAR(laserEnabled_) + str _weaponIndex, _state]; + +// Turn off light/laser (switching between weapons can leave previous weapon laser on) +action ["GunLightOff", _unit]; +action ["IRLaserOff", _unit]; + +// Light/laser is off, don't need to do anything more +if (!_state) exitWith {}; + +// Turn laser on next frame (if weapon hasn't changed) +[{ + params ["_unit", "_currentWeapon"]; + + private _weaponState = (weaponState _unit) select [0, 3]; + + if (_weaponState select 0 != _currentWeapon) exitWith {}; + + action ["GunLightOn", _unit]; + action ["IRLaserOn", _unit]; + + _unit selectWeapon _weaponState; +}, [_unit, _currentWeapon]] call CBA_fnc_execNextFrame; + +nil diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 5bb0153772..d74bed9cbd 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -6,8 +6,8 @@ * * Arguments: * 0: Source ID (default: "") - * 1: Show Hud Bool Array (8 to set, empty to remove) (default: []) - * - [hud, info, radar, compass, direction, menu, group, cursors] + * 1: Show Hud Bool Array (10 to set, empty to remove) (default: []) + * - [hud, info, radar, compass, direction, menu, group, cursors, panels, kills] * - hud: Boolean - show scripted HUD (same as normal showHUD true/false) * - info: Boolean - show vehicle + soldier info (hides weapon info from the HUD as well) * - radar: Boolean - show vehicle radar @@ -17,7 +17,8 @@ * - group: Boolean - show group info bar (hides squad leader info bar) * - cursors: Boolean - show HUD weapon cursors (connected with scripted HUD) * - panels: Boolean - show vehicle panels / GPS - * - ???: Boolean - Possibly related to changelog entry `Added: A new showKillConfirmations parameter for the showHud command` + * - kills: Boolean - show "x killed by y" systemChat messages + * - showIcon3D: is unsupported as it has inverted logic * * Return Value: * Resulting ShowHud Array diff --git a/addons/common/functions/fnc_switchAttachmentMode.sqf b/addons/common/functions/fnc_switchAttachmentMode.sqf new file mode 100644 index 0000000000..f721428a53 --- /dev/null +++ b/addons/common/functions/fnc_switchAttachmentMode.sqf @@ -0,0 +1,73 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Switch attachment from one mode to another - based on CBA_accessory_fnc_switchAttachment + * ToDo: Port this to CBA? + * + * Arguments: + * 0: Unit + * 1: Weapon (String or CBA-Weapon-Index (not ace's getWeaponIndex)) + * 2: From + * 3: To + * + * Return Value: + * None + * + * Example: + * [player, 0, "ACE_DBAL_A3_Green_VP", "ACE_DBAL_A3_Green"] call ace_common_fnc_switchAttachmentMode + * + * Public: No + */ + +params ["_unit", "_weapon", "_currItem", "_switchItem"]; +TRACE_4("switchAttachmentMode",_unit,_weapon,_currItem,_switchItem); + +if (_weapon isEqualTo "") exitWith {}; + +private _exit = _unit != ACE_player; +switch (_weapon) do { + case 0; + case (primaryWeapon _unit): { + private _currWeaponType = 0; + _unit removePrimaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addPrimaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case 1; + case (handgunWeapon _unit): { + private _currWeaponType = 1; + _unit removeHandgunItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addHandgunItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case 2; + case (secondaryWeapon _unit): { + private _currWeaponType = 2; + _unit removeSecondaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addSecondaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + default { + ERROR_1("bad weapon - %1",_this); + _exit = true; + }; +}; +if (_exit) exitWith {}; // Don't notify if the unit isn't the local player or if an invalid weapon was passed + +private _configSwitchItem = configfile >> "CfgWeapons" >> _switchItem; +private _switchItemHintText = getText (_configSwitchItem >> "MRT_SwitchItemHintText"); +private _switchItemHintImage = getText (_configSwitchItem >> "picture"); + +playSound "click"; +if (_switchItemHintText != "") then { + [[_switchItemHintImage, 2.0], [_switchItemHintText], true] call CBA_fnc_notify; +}; diff --git a/addons/common/functions/fnc_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf index a2b7b9c1a8..79c0e91f72 100644 --- a/addons/common/functions/fnc_switchPersistentLaser.sqf +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Dystopian + * Author: Dystopian, johnb43 * Controls persistent laser state. * * Arguments: @@ -17,51 +17,87 @@ params ["_enabled"]; +if (!hasInterface) exitwith {}; + +// Reset state +{ + ACE_player setVariable [QGVAR(laserEnabled_) + str _x, nil]; +} forEach [0, 1, 2]; + if (!_enabled) exitWith { if (isNil QGVAR(laserKeyDownEH)) exitWith {}; - ["KeyDown", GVAR(laserKeyDownEH)] call CBA_fnc_removeDisplayHandler; + + removeUserActionEventHandler ["headlights", "Activate", GVAR(laserKeyDownEH)]; + ["loadout", GVAR(laserLoadoutEH)] call CBA_fnc_removePlayerEventHandler; ["turret", GVAR(laserTurretEH)] call CBA_fnc_removePlayerEventHandler; ["vehicle", GVAR(laserVehicleEH)] call CBA_fnc_removePlayerEventHandler; ["weapon", GVAR(laserWeaponEH)] call CBA_fnc_removePlayerEventHandler; + + GVAR(laserKeyDownEH) = nil; + GVAR(laserLoadoutEH) = nil; + GVAR(laserTurretEH) = nil; + GVAR(laserVehicleEH) = nil; + GVAR(laserWeaponEH) = nil; }; -GVAR(laserKeyDownEH) = ["KeyDown", { - if !((_this select 1) in actionKeys "headlights") exitWith {false}; - private _weapon = currentWeapon ACE_player; - [ - { - params ["_weapon", "_laserWasEnabled"]; - private _laserEnabled = ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}; - if (_laserEnabled && {_laserWasEnabled} || {!_laserEnabled && {!_laserWasEnabled}}) exitWith {}; - private _weaponIndex = [ACE_player, _weapon] call FUNC(getWeaponIndex); - ACE_player setVariable [QGVAR(laserEnabled_) + str _weaponIndex, [nil, true] select _laserEnabled]; - }, - [_weapon, ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}] - ] call CBA_fnc_execNextFrame; - false -}] call CBA_fnc_addDisplayHandler; +private _fnc_getLightLaserState = { + private _currentWeapon = currentWeapon ACE_player; -private _laserEH = { - if (sunOrMoon == 1) exitWith {}; - params ["_player"]; - private _weaponIndex = [_player, currentWeapon _player] call FUNC(getWeaponIndex); - if ( - !(_player getVariable [QGVAR(laserEnabled_) + str _weaponIndex, false]) - || {_weaponIndex > 0 && {"" != primaryWeapon _player}} // Arma switches to primary weapon if exists - || {!(_player call CBA_fnc_canUseWeapon)} // ignore in vehicle except FFV - ) exitWith {}; - [ - // wait for weapon in "ready to fire" direction - {0.01 > getCameraViewDirection _this vectorDistance (_this weaponDirection currentWeapon _this)}, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]}, - _player, - 3, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]} - ] call CBA_fnc_waitUntilAndExecute; + if (_currentWeapon == "") exitWith {}; + + // Ignore in vehicle except FFV + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + private _weaponIndex = [ACE_player, _currentWeapon] call FUNC(getWeaponIndex); + + if (_weaponIndex == -1) exitWith {}; + + // Light/laser state only changes in the next frame + // However, as by default changing attachment modes is CTRL + L, the vanilla EH triggers when lights are bound to L (even despite CBA intercepting keystroke) + // Therefore, add an extra frame of delay, after which the previous laser state will have been restored + [{ + ACE_player setVariable [ + QGVAR(laserEnabled_) + str (_this select 1), + ACE_player isIRLaserOn (_this select 0) || {ACE_player isFlashlightOn (_this select 0)} + ]; + }, [_currentWeapon, _weaponIndex], 2] call CBA_fnc_execAfterNFrames; }; -GVAR(laserLoadoutEH) = ["loadout", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserTurretEH) = ["turret", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserVehicleEH) = ["vehicle", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserWeaponEH) = ["weapon", _laserEH] call CBA_fnc_addPlayerEventHandler; +// Get current weapon light/laser state +call _fnc_getLightLaserState; + +// Update state every time it's changed +GVAR(laserKeyDownEH) = addUserActionEventHandler ["headlights", "Activate", _fnc_getLightLaserState]; + +// Dropping weapons, as well as switching light/laser attachments turns off lights/lasers +GVAR(lastWeapons) = (getUnitLoadout ACE_player) select [0, 3]; + +// Monitor weapon addition/removal here +GVAR(laserLoadoutEH) = ["loadout", { + params ["_unit", "_loadout"]; + + private _weapons = _loadout select [0, 3]; + + if (_weapons isEqualTo GVAR(lastWeapons)) exitWith {}; + + GVAR(lastWeapons) = _weapons; + + [ + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); +}] call CBA_fnc_addPlayerEventHandler; + +private _fnc_switchPersistentLaserEH = { + params ["_unit"]; + + [ + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); +}; + +GVAR(laserTurretEH) = ["turret", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserVehicleEH) = ["vehicle", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserWeaponEH) = ["weapon", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 8c59d06516..4593805846 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -44,7 +44,7 @@ Avancé Fejlett Avanzato - アドバンスド + 高度な 고급 進階 进阶 diff --git a/addons/compat_aegis/$PBOPREFIX$ b/addons/compat_aegis/$PBOPREFIX$ new file mode 100644 index 0000000000..1fc8683847 --- /dev/null +++ b/addons/compat_aegis/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_aegis diff --git a/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp b/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp new file mode 100644 index 0000000000..19a1bef510 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp @@ -0,0 +1,21 @@ +class CfgVehicles { + class APC_Wheeled_01_base_v2_F; + class B_APC_Wheeled_01_cannon_v2_F: APC_Wheeled_01_base_v2_F { + displayName = ECSTRING(realisticnames,APC_Wheeled_01_cannon_Name); + }; + + class B_APC_Wheeled_01_base_F; + class B_APC_Wheeled_01_medical_F: B_APC_Wheeled_01_base_F { + displayName = SUBCSTRING(APC_Wheeled_01_medical_Name); + }; + + class APC_Tracked_02_medical_base_F; + class O_R_APC_Tracked_02_medical_F: APC_Tracked_02_medical_base_F { + displayName = SUBCSTRING(APC_Tracked_02_medical_Name); + }; + + class APC_Tracked_03_base_v2_F; + class B_A_APC_tracked_03_cannon_v2_F: APC_Tracked_03_base_v2_F { + displayName = ECSTRING(realisticnames,APC_tracked_03_cannon_Name); + }; +}; diff --git a/addons/compat_aegis/compat_aegis_realisticnames/config.cpp b/addons/compat_aegis/compat_aegis_realisticnames/config.cpp new file mode 100644 index 0000000000..add9f50a3a --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/config.cpp @@ -0,0 +1,26 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "A3_Aegis_Armor_F_Aegis_APC_Wheeled_01", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_02", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_03", + "ace_realisticnames" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp b/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp new file mode 100644 index 0000000000..b8d0682fa4 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT realisticnames +#define SUBCOMPONENT_BEAUTIFIED Realistic Names +#include "..\script_component.hpp" diff --git a/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml b/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml new file mode 100644 index 0000000000..6d7dfa47a1 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml @@ -0,0 +1,37 @@ + + + + + Badger IFV (Medical) + SPz Badger (Medizin) + Badger IFV (médico) + Badger IFV (sprzęt medyczny) + Badger IFV (zdravotnický) + Badger IFV (médical) + БМП Badger (медицинский) + Badger IFV (médico) + Badger IFV (medico) + バジャー IFV(医療) + 뱃져 보병전투차 (의료) + "蜜獾"步兵戰車(醫療用) + "蜜獾"(医疗) + Badger IFV (Sıhhiye) + + + BM-2T Stalker (Medical) + BM-2T Stalker (Medizin) + BM-2T Stalker (médico) + BM-2T Stalker (sprzęt medyczny) + BM-2T Stalker (zdravotnický) + BM-2T Stalker (médical) + БМ-2Т Сталкер (медицинский) + BM-2T Stalker (médico) + BM-2T Stalker (medico) + BM-2T ストーカー(医療) + BM-2T 스토커 (의료) + BM-2T"潛行者"步兵戰車(醫療用) + BM-2T "潜行者"(医疗) + BM-2T Stalker (Sıhhiye) + + + diff --git a/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp b/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp new file mode 100644 index 0000000000..5d0e86faaf --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp @@ -0,0 +1,95 @@ +class CfgVehicles { + class Tank; + class Tank_F: Tank { + class Turrets { + class MainTurret; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class APC_Tracked_03_base_v2_F: APC_Tracked_03_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"autocannon_40mm_CTWS", "ACE_LMG_coax_L94A1_mem3"}; // Aegis upgrades to a 40mm cannon, but we want realistic MG name + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + // Overwrite the changes Aegis makes for the .338 coax MG on the Slammer/Merkava + // The idea is: + // 1) keep it as realistic as possible + // 2) easier to overwrite something with skipWhenMissingDependencies than to not overwrite something if another mod is loaded + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; + + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F {}; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; +}; diff --git a/addons/compat_aegis/compat_aegis_vehicles/config.cpp b/addons/compat_aegis/compat_aegis_vehicles/config.cpp new file mode 100644 index 0000000000..fd16fa8686 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/config.cpp @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "A3_Aegis_Armor_F_Aegis_MBT_01", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_03", + "ace_vehicles" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp b/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp new file mode 100644 index 0000000000..17370c415f --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/compat_aegis/config.cpp b/addons/compat_aegis/config.cpp new file mode 100644 index 0000000000..2de723b9a4 --- /dev/null +++ b/addons/compat_aegis/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; diff --git a/addons/compat_aegis/script_component.hpp b/addons/compat_aegis/script_component.hpp new file mode 100644 index 0000000000..d6fb73bd46 --- /dev/null +++ b/addons/compat_aegis/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_aegis +#define COMPONENT_BEAUTIFIED Aegis Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp index b29f7e717d..0c8a8aa6fd 100644 --- a/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp +++ b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp @@ -1,15 +1,15 @@ class CfgMagazines { class US85_Magazine; class US85_ATMine_mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_ATMine_mag"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_ATMine_mag"; useAction = 0; }; class US85_M14Mine_mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_M14Mine"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_M14Mine"; useAction = 0; }; class US85_SatchelCharge_Mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_SatchelCharge_Mag"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_SatchelCharge_Mag"; useAction = 0; }; }; diff --git a/addons/compat_cup_vehicles/CfgVehicles.hpp b/addons/compat_cup_vehicles/CfgVehicles.hpp index 5334987fff..ce502abad5 100644 --- a/addons/compat_cup_vehicles/CfgVehicles.hpp +++ b/addons/compat_cup_vehicles/CfgVehicles.hpp @@ -1,4 +1,31 @@ class CfgVehicles { + class CUP_nHMMWV_Base; + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_backpacks { + positions[] = { + "(_target selectionPosition ['vhc_backpacks', 'ViewGeometry', 'AveragePoint']) vectorAdd [-1, 0, 0]", + "(_target selectionPosition ['vhc_backpacks', 'ViewGeometry', 'AveragePoint']) vectorAdd [1.3, 0, 0]" + }; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_USPack_Coyote", "CUP_B_AssaultPack_ACU", "CUP_B_AssaultPack_ACU", "CUP_B_AssaultPack_Coyote"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class Car_F; + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_deploy2 { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [-0.7, 0, 0]"}; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_AssaultPack_ACU"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class CUP_MTVR_Base; class CUP_MTVR_Reammo_Base: CUP_MTVR_Base { EGVAR(rearm,defaultSupply) = 1200; @@ -106,6 +133,17 @@ class CfgVehicles { class CUP_BTR90_HQ_Base: CUP_BTR90_Base { delete ace_viewports; }; // no cargo seats class Tank_F; + class CUP_AAV_Base: Tank_F { + class EGVAR(interaction,anims) { + class Hide_Bags_Deployment { + positions[] = {{1.7, -0.7, -0.3}, {1.7, -2.55, -0.3}}; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_USPack_Coyote"}; + name = "$STR_CUP_dn_USpack_coyote"; + text = "$STR_CUP_dn_USpack_coyote"; + }; + }; + }; + class CUP_M2Bradley_Base: Tank_F { ace_hunterkiller = 1; class ace_viewports { diff --git a/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..29a471f451 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp @@ -0,0 +1,196 @@ +class CfgVehicles { + class Car_F; + class CUP_Datsun_Base: Car_F { + class EGVAR(interaction,anims) { + class hideSpareTire { + positions[] = {{-0.23, -0.25, -0.8}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_Datsun_AA_Base: CUP_Datsun_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hideSpareTire: hideSpareTire { + enabled = 0; + }; + }; + }; + + class CUP_Tigr_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.55}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_Tigr_STS_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel {}; + }; + }; + class CUP_Tigr_233014_PK_Base: CUP_Tigr_STS_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.85}}; + }; + }; + }; + class CUP_Tigr_M_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel {}; + }; + }; + class CUP_Tigr_233114_PK_Base: CUP_Tigr_M_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.85}}; + }; + }; + }; + + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_wheelfront { + positions[] = {"_target selectionPosition ['selection_wheelfront', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class selection_wheels { + positions[] = { + "(_target selectionPosition ['selection_wheels', 'ViewGeometry', 'AveragePoint']) vectorAdd [-1.1, 0, 0]", + "(_target selectionPosition ['selection_wheels', 'ViewGeometry', 'AveragePoint']) vectorAdd [1.1, 0, 0]" + }; + items[] = {"ACE_Wheel", "ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_nHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['vhc_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + // Don't inherit, as it's easier for the main compat + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['vhc_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_RG31_BASE: Car_F { + class EGVAR(interaction,anims) { + class left_spare { + positions[] = {"_target selectionPosition ['left_spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class right_spare { + positions[] = {"_target selectionPosition ['right_spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_UAZ_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_UAZ_Armed_Base: CUP_UAZ_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel {}; + }; + }; + class CUP_UAZ_AA_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.8, 0.75}}; + }; + }; + }; + class CUP_UAZ_AGS30_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.75}}; + }; + }; + }; + class CUP_UAZ_MG_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.2}}; + }; + }; + }; + // Visual is bugged, but it works + class CUP_UAZ_METIS_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.65}}; + }; + }; + }; + class CUP_UAZ_SPG9_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 1.05}}; + }; + }; + }; + + class CUP_UAZ_Unarmed_Base: CUP_UAZ_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel {}; + }; + }; + class CUP_UAZ_Open_Base: CUP_UAZ_Unarmed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.135, -1.3, 0.7}}; + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_tire { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.05, -0.4, 0.2]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class hide_deploy1 { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.05, 0.5, 0.7]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_repair/config.cpp b/addons/compat_cup_vehicles/compat_cup_repair/config.cpp new file mode 100644 index 0000000000..9a2785e7ef --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp new file mode 100644 index 0000000000..9d9bc2d62e --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp @@ -0,0 +1,111 @@ +class CfgVehicles { + class Car_F; + class CUP_Tigr_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_tools { + positions[] = {{1.15, -1.5, -0.68}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class CUP_Tigr_STS_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools {}; + }; + }; + class CUP_Tigr_233014_PK_Base: CUP_Tigr_STS_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools { + positions[] = {{1.15, -1.5, -1}}; + }; + }; + }; + class CUP_Tigr_M_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools {}; + }; + }; + class CUP_Tigr_233114_PK_Base: CUP_Tigr_M_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools { + positions[] = {{1.15, -1.5, -1}}; + }; + }; + }; + + // Interaction added to both sides, as the whole vehicle is mirrored if in left/right side + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_tool { + positions[] = {{-0.53, 1.65, -0.2}, {0.53, 1.65, -0.2}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class CUP_LR_MG_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.6, 1.4, 1.4}, {0.45, 1.4, 1.4}}; + }; + }; + }; + class CUP_LR_SPG9_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool {}; + }; + }; + class CUP_LR_AA_Base: CUP_LR_SPG9_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.55, 1.77, -0.75}, {0.55, 1.77, -0.75}}; + }; + }; + }; + class CUP_LR_Ambulance_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.55, 2.1, -0.2}, {0.55, 2.1, -0.2}}; + }; + }; + }; + class CUP_LR_Special_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.6, 1.4, 1.4}, {0.45, 1.4, 1.4}}; + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_front_tool_rack { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.37, 4, 0.2]"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + class Tank_F; + class CUP_leopard_1A3_base: Tank_F { + class EGVAR(interaction,anims) { + class hide_Tools_L { + positions[] = {{-2.2, 0, 0.2}, {-2.2, -1.8, 0.2}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + class hide_Tools_R { + positions[] = {{0.9, -1.5, 0.23}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp b/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp new file mode 100644 index 0000000000..8f05885bd6 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp new file mode 100644 index 0000000000..10b90eb71e --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp index 1abe0de6ea..10eb5da69f 100644 --- a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { authors[] = {"Community Upgrade Project", "Mike"}; url = ECSTRING(main,URL); VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); }; }; diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp index 1042c0eacf..60a83030df 100644 --- a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp @@ -28,4 +28,90 @@ class CfgVehicles { EGVAR(refuel,hooks)[] = {{-1.09, -0.01, -0.5},{1, -0.01, -0.5}}; EGVAR(refuel,fuelCargo) = 10000; }; + + class Car_F; + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_jerry { + positions[] = {{-0.65, 2.7, -0.55}, {0.65, 2.7, -0.55}, {-1, -0.25, -0.75}, {1, -0.25, -0.75}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class CUP_LR_MG_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.55, 2.45, 1.05}, {0.55, 2.45, 1.05}, {-1, -0.53, 0.9}, {1, -0.53, 0.9}}; + }; + }; + }; + class CUP_LR_SPG9_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry {}; + }; + }; + class CUP_LR_AA_Base: CUP_LR_SPG9_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.65, 2.8, -1.1}, {0.65, 2.8, -1.1}, {-1, -0.15, -1.3}, {1, -0.15, -1.3}}; + }; + }; + }; + class CUP_LR_Ambulance_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.65, 3.1, -0.55}, {0.65, 3.1, -0.55}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class CUP_LR_Special_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.7, 2.45, 1.05}, {0.55, 2.45, 1.05}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + + class CUP_nHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition 'vhc_jerrycans') vectorAdd [0, 0, 0.15]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + // Don't inherit, as it's easier for the main compat + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition 'vhc_jerrycans') vectorAdd [0, 0, 0.15]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class hide_rear_rack_content { + positions[] = {"_target selectionPosition ['vhc_rear_rack_content', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [-0.85, -0.22, -0.1]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp index 3924ae0386..752745fb35 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp @@ -65,7 +65,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_DSHKM"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otocvez'"; disassembleWeapon = "CUP_DSHKM_carry"; disassembleTurret = "ace_csw_kordTripod"; desiredAmmo = 100; @@ -119,7 +119,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_MK19"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_MK19_carry"; disassembleTurret = "ace_csw_m3TripodLow"; desiredAmmo = 48; @@ -165,7 +165,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_SPG9"; - magazineLocation = "_target selectionPosition 'otochlaven'"; + magazineLocation = "_target selectionPosition 'handle'"; disassembleWeapon = "CUP_SPG9_carry"; disassembleTurret = "ace_csw_spg9Tripod"; desiredAmmo = 1; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml index ea16be2905..86e56ee3d9 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -9,6 +9,8 @@ [CSW] AGS30 Gurt [CSW] Cinta de AGS30 [CSW] Nastro AGS30 + [CSW] Cinto de AGS30 + [CSW] Ceinture AGS30 [CSW] MK19 Belt @@ -18,6 +20,8 @@ [CSW] MK19 Gurt [CSW] Cinta de MK19 [CSW] Nastro MK19 + [CSW] Cinto de MK19 + [CSW] Ceinture MK19 [CSW] TOW Tube @@ -27,6 +31,8 @@ [CSW] TOW Rohr [CSW] Tubo de TOW [CSW] Tubo TOW + [CSW] Tubo de TOW + [CSW] Tube TOW [CSW] TOW2 Tube @@ -36,6 +42,8 @@ [CSW] TOW2 Rohr [CSW] Tubo de TOW2 [CSW] Tubo TOW2 + [CSW] Tubo de TOW2 + [CSW] Tube TOW2 [CSW] PG-9 Round @@ -45,6 +53,8 @@ [CSW] PG-9 Rakete [CSW] Carga de PG-9 [CSW] Razzo PG-9 + [CSW] Cartucho PG-9 + [CSW] Projectile PG-9 [CSW] OG-9 Round @@ -54,6 +64,8 @@ [CSW] OG-9 Rakete [CSW] Carga de OG-9 [CSW] Razzo OG-9 + [CSW] Cartucho OG-9 + [CSW] Projectile OG-9. [CSW] M1 HE @@ -74,6 +86,7 @@ [CSW] M84 Rauch [CSW] Humo M84 [CSW] M84 Fumogeno + [CSW] M84 Fumígeno [CSW] M60A2 WP diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp index 1658715ddb..eeb7e6037f 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp @@ -4,18 +4,18 @@ class CfgAmmo { hit = 3000; indirectHit = 3000; indirectHitRange = 5; - ace_explosives_explodeOnDefuse = 0.02; + EGVAR(explosives,explodeOnDefuse) = 0.02; }; class CUP_PipeBomb_Ammo: PipeBombBase { hit = 3000; indirectHit = 3000; indirectHitRange = 5; - ace_explosives_explodeOnDefuse = 0.02; + EGVAR(explosives,explodeOnDefuse) = 0.02; }; class CUP_Mine_Ammo; class CUP_IED_V1_Ammo: CUP_Mine_Ammo { - ace_explosives_explodeOnDefuse = 0.06; + EGVAR(explosives,explodeOnDefuse) = 0.06; triggerWhenDestroyed = 1; }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp index 15df2f7333..51dc9d0d78 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp @@ -2,9 +2,9 @@ class CfgMagazines { class CA_Magazine; class CUP_TimeBomb_M: CA_Magazine { scope = 1; - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_PipeBomb_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_PipeBomb_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone"}; class Timer { @@ -16,9 +16,9 @@ class CfgMagazines { }; }; class CUP_Mine_M: CUP_TimeBomb_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_Mine_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_Mine_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -27,9 +27,9 @@ class CfgMagazines { }; }; class CUP_MineE_M: CUP_TimeBomb_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_MineE_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_MineE_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -39,20 +39,20 @@ class CfgMagazines { }; class CUP_IED_V1_M: CUP_Mine_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_IED_V1_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V1_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; }; }; class CUP_IED_V2_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V2_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V2_place_CUP"; }; class CUP_IED_V3_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V3_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V3_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Timer { @@ -77,7 +77,7 @@ class CfgMagazines { }; class CUP_IED_V4_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V4_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V4_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Timer { diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp index d10c315c3d..17a7c59848 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp @@ -1,32 +1,31 @@ class CfgVehicles { class ACE_Explosives_Place; class ACE_PipeBomb_place_CUP: ACE_Explosives_Place { - displayName = "Satchel Charge"; + displayName = "$STR_CUP_dn_PipeBomb"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_Satchel.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_Mine_place_CUP: ACE_Explosives_Place { - displayName = "AT-15 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_Mine"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_AT15.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_MineE_place_CUP: ACE_Explosives_Place { - displayName = "TM46 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_MineE"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_TM46.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V1_place_CUP: ACE_Explosives_Place { - displayName = "IED"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V1.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V2_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDUrbanBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V2.p3d"; }; class ACE_IED_V3_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V3.p3d"; }; class ACE_IED_V4_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V4.p3d"; }; }; diff --git a/addons/compat_gm/CfgVehicles.hpp b/addons/compat_gm/CfgVehicles.hpp index 6d03465cd7..d470e8a615 100644 --- a/addons/compat_gm/CfgVehicles.hpp +++ b/addons/compat_gm/CfgVehicles.hpp @@ -81,15 +81,242 @@ class CfgVehicles { class gm_brdm2_base: gm_wheeled_APC_base { EGVAR(refuel,fuelCapacity) = 290; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.1, -1.9, -0.5}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{-0.55, -0.35, -0.35}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.3, -1.85, -0.5}}; + }; + }; }; class gm_btr60_base: gm_wheeled_APC_base { EGVAR(refuel,fuelCapacity) = 290; EGVAR(cookoff,cookoffSelections)[] = {"commanderturret_hatch"}; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_04', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_05_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_05', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_06_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_06', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_07_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_07', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + + class gm_ural375d_base: gm_wheeled_truck_base { + EGVAR(refuel,fuelCapacity) = 360; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-0.55, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 3; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.55, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{-0.45, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 2, 0.5}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 2, 0.5}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 2, 0.5}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 2, 0.5}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 2, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 2, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 2, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 2, 0.7}}; + }; + }; }; class gm_ural4320_base: gm_wheeled_truck_base { EGVAR(refuel,fuelCapacity) = 360; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-0.55, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 3; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.55, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{-0.45, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + class gm_ural4320_repair_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 1.62, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 1.62, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 1.62, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 1.62, 0.7}}; + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 1.37, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 1.37, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 1.37, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 1.37, 0.7}}; + }; + }; }; class gm_ural4320_reammo_base: gm_ural4320_base { @@ -190,9 +417,103 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 460; EGVAR(cookoff,cookoffSelections)[] = {"mainturret_hatch","commanderturret_hatch"}; }; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-1.2, -2.52, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{-1.3, -2, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{-1.35, -1.43, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{1.2, -2.52, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_05_unhide { + phase = 0; + positions[] = {{1.3, -2, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_06_unhide { + phase = 0; + positions[] = {{1.35, -1.43, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_07_unhide { + phase = 0; + positions[] = {{-1.45, 0.1, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_08_unhide { + phase = 0; + positions[] = {{-1.45, 2, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_09_unhide { + phase = 0; + positions[] = {{1.45, 2, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + }; + }; class gm_pt76_base: gm_tracked_Tank_base { EGVAR(refuel,fuelCapacity) = 250; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{0.08, -1.75, -1}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0.08, -1.38, -1}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.08, -2.15, -1}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; }; class gm_t55_base: gm_tracked_Tank_base { @@ -204,6 +525,21 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 812; }; + class gm_tracked_Artillery_base; + class gm_2s1_base: gm_tracked_Artillery_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -1.3, 0] vectorAdd ([[0, -1.1, -0.35], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + // WEST class gm_Leopard1_base; class gm_Leopard1a0_base: gm_Leopard1_base { @@ -211,6 +547,27 @@ class CfgVehicles { EGVAR(cookoff,cookoffSelections)[] = {"mainturret_hatch_1","commanderturret_hatch"}; }; + class gm_Leopard1a1_base: gm_Leopard1a0_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.7, -2, -0.6], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[-0.3, -1.95, -0.6], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + class gm_Gepard_base: gm_Leopard1_base { EGVAR(refuel,fuelCapacity) = 985; }; @@ -257,42 +614,39 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 3700; EGVAR(fastroping,enabled) = 0; - // TODO: stringtables class UserActions { - class openDoor_L { - displayNameDefault = "Open left Door"; - displayName = "Open left Door"; - position = ""; - radius = 2.7; - onlyForPlayer = 1; - condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_1_source',1]"; - }; - - class openDoor_R: openDoor_L { - displayNameDefault = "Open right Door"; - displayName = "Open right Door"; - condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_2_source',1]"; - }; - - class closeDoor_L { - displayNameDefault = "Close left Door"; - displayName = "Close left Door"; - position = ""; - radius = 2.7; - onlyForPlayer = 1; - condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_1_source',0]"; - }; - - class closeDoor_R: closeDoor_L { - displayNameDefault = "Close right Door"; - displayName = "Close right Door"; - condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_2_source',0]"; - }; + class openDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_openldoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_openldoor0"; + position = ""; + radius = 2.7; + onlyForPlayer = 1; + condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_1_source',1]"; }; + class openDoor_R: openDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_openrdoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_openrdoor0"; + condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_2_source',1]"; + }; + + class closeDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_closeldoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_closeldoor0"; + position = ""; + radius = 2.7; + onlyForPlayer = 1; + condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_1_source',0]"; + }; + class closeDoor_R: closeDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_closerdoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_closerdoor0"; + condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_2_source',0]"; + }; + }; }; class gm_bo105p1m_vbh_base; class gm_bo105p1m_vbh_swooper_base: gm_bo105p1m_vbh_base { diff --git a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp index 17d51d3b45..f0afb3b90c 100644 --- a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp +++ b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp @@ -2,9 +2,8 @@ class CfgMagazines { // Explosives class gm_explosive_petn_charge_base; class gm_explosive_petn_charge: gm_explosive_petn_charge_base { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_petn); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_petn); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -21,9 +20,8 @@ class CfgMagazines { class gm_explosive_plnp_charge_base; class gm_explosive_plnp_charge: gm_explosive_plnp_charge_base { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_plnp); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_plnp); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -40,8 +38,8 @@ class CfgMagazines { class gm_mine_at_base; class gm_mine_at_tm46: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_mine_tm46); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_mine_tm46); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -51,8 +49,8 @@ class CfgMagazines { }; }; class gm_mine_at_dm21: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_dm21); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_dm21); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -62,8 +60,8 @@ class CfgMagazines { }; }; class gm_mine_at_mn111: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_m111); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_m111); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -74,8 +72,8 @@ class CfgMagazines { }; class gm_mine_ap_dm31: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_dm31); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_dm31); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; diff --git a/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp b/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp new file mode 100644 index 0000000000..aa51d46979 --- /dev/null +++ b/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp @@ -0,0 +1,336 @@ +class CfgVehicles { + class gm_typ2_base; + class gm_typ251_base: gm_typ2_base { + class EGVAR(interaction,anims) { + class canister_01_unhide { + phase = 0; + positions[] = {{-0.55, -0.17, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class canister_02_unhide { + phase = 0; + positions[] = {{-0.55, -0.65, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_typ253_base: gm_typ2_base { + class EGVAR(interaction,anims) { + class canister_01_unhide { + phase = 0; + positions[] = {{-0.55, -0.19, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class canister_02_unhide { + phase = 0; + positions[] = {{-0.55, -0.68, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_wheeled_truck_base; + class gm_ural375d_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class fuelcan_1_1_unhide { + phase = 0; + positions[] = {{-0.95, 3.15, -0.45}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class fuelcan_1_2_unhide { + phase = 0; + positions[] = {{0.9, 3.15, -0.45}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.95, 3.35, -0.55}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.35, -0.55}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.95, 3.35, -0.45}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.35, -0.45}}; + }; + }; + }; + + class gm_ural4320_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class fuelcan_1_1_unhide { + phase = 0; + positions[] = {{-0.9, 3.1, -0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class fuelcan_1_2_unhide { + phase = 0; + positions[] = {{0.9, 3.1, -0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_ural4320_repair_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.9, 3.25, -0.4}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.25, -0.4}}; + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.9, 3, -0.4}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3, -0.4}}; + }; + }; + }; + + class gm_wheeled_APC_base; + class gm_brdm2_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_01_unhide: FuelCanister_01_unhide { + positions[] = {{0.87, -3, -1.2}}; + }; + class FuelCanister_02_unhide: FuelCanister_02_unhide { + positions[] = {{-0.87, -3, -1.2}}; + }; + class FuelCanister_03_unhide: FuelCanister_03_unhide { + positions[] = {{-0.4, -1.85, -0.5}}; + }; + }; + }; + + class gm_btr60_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_04_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_04', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_05_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_05', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_06_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_06', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_btr60pa_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_05_unhide: FuelCanister_05_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_06_unhide: FuelCanister_06_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class gm_btr60pb_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_03_unhide: FuelCanister_03_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_04_unhide: FuelCanister_04_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class gm_btr60pu12_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_03_unhide: FuelCanister_03_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_04_unhide: FuelCanister_04_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + + class gm_bmp1_base; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {{-1.2, -2.52, -1.2}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {{1.2, -2.52, -1.2}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_zsu234_base; + class gm_zsu234v1_base: gm_zsu234_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[-0.85, -2.2, -0.9], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[0.7, -2.25, -0.85], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[0.92, -2.25, -0.85], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_tracked_Tank_base; + class gm_pt76_base: gm_tracked_Tank_base { + class EGVAR(interaction,anims) { + class FuelTank_01_unhide { + phase = 0; + positions[] = {{-1, -2.85, -1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelTank_02_unhide { + phase = 0; + positions[] = {{1, -2.85, -1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_Leopard1a0_base; + class gm_Leopard1a1_base: gm_Leopard1a0_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.25, -1.9, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + distance = 2.5; + }; + class FuelCanister_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[-0.8, -1.65, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.8, -1.8, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_refuel/config.cpp b/addons/compat_gm/compat_gm_refuel/config.cpp index 05688eff70..6becabe70a 100644 --- a/addons/compat_gm/compat_gm_refuel/config.cpp +++ b/addons/compat_gm/compat_gm_refuel/config.cpp @@ -21,3 +21,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp b/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..12f9253bba --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp @@ -0,0 +1,100 @@ +class CfgVehicles { + class gm_wheeled_car_base; + class gm_uaz469_base: gm_wheeled_car_base { + class EGVAR(interaction,anims) { + class spare_wheel_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class gm_wheeled_APC_base; + class gm_brdm2_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class SpareWheel_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 2.5; + }; + class SpareWheel_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class SpareWheel_01_unhide: SpareWheel_01_unhide { + positions[] = {{0.2, -0.7, -0.25}}; + distance = 2; + }; + class SpareWheel_02_unhide: SpareWheel_02_unhide { + positions[] = {{0, -1.6, -0.4}}; + }; + }; + }; + + class gm_btr60_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class SpareWheel_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 3; + }; + class SpareWheel_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class SpareWheel_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class gm_bmp1_base; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class spareTracks_1_1_unhide { + phase = 0; + positions[] = {"(_target selectionPosition ['door_1_1', 'FireGeometry', 'AveragePoint']) vectorAdd [0, 0, -0.15]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class spareTracks_1_2_unhide { + phase = 0; + positions[] = {"(_target selectionPosition ['door_1_2', 'FireGeometry', 'AveragePoint']) vectorAdd [0, 0, -0.15]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class spareTracks_2_1_unhide { + phase = 0; + positions[] = {{-1.1, -2.7, -1.3}, {1.1, -2.7, -1.3}}; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_repair/config.cpp b/addons/compat_gm/compat_gm_repair/config.cpp new file mode 100644 index 0000000000..6fae9858b4 --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "gm_core", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_repair/script_component.hpp b/addons/compat_gm/compat_gm_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp b/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp new file mode 100644 index 0000000000..b5c32d8be1 --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp @@ -0,0 +1,47 @@ +class CfgVehicles { + class gm_wheeled_truck_base; + class gm_ural375d_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class tools_unhide { + phase = 0; + positions[] = {{0.9, 3.15, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 3.35, -0.65}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 3.35, -0.5}}; + }; + }; + }; + + class gm_ural4320_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class tools_unhide { + phase = 0; + positions[] = {{0.93, 2.7, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 2.6, -0.5}}; + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_trenches/config.cpp b/addons/compat_gm/compat_gm_trenches/config.cpp new file mode 100644 index 0000000000..13c4dd0816 --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "gm_core", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_trenches/script_component.hpp b/addons/compat_gm/compat_gm_trenches/script_component.hpp new file mode 100644 index 0000000000..10b90eb71e --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index 03d5003a62..16a6e92789 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -7,6 +7,7 @@ 이오텍 MRDS (카키) EOTech MRDS (Khaki) EOTech MRDS (Cachi) + EOTech MRDS (Khaki) EOTech MRDS (Tan) @@ -14,6 +15,7 @@ 이오텍 MRDS (황갈) EOTech MRDS (Hellbraun) EOTech MRDS (Marroncino) + EOTech MRDS (Marron) C-More Railway (Green, Desert) @@ -21,6 +23,7 @@ 씨모어 레일웨이 (녹색, 사막) C-More Railway (Grün, Wüste) C-More Railway (Verde, Deserto) + C-More Railway (Vert, Désert) C-More Railway (Green, Woodland) @@ -28,6 +31,7 @@ 씨모어 레일웨이 (녹색, 수풀 위장) C-More Railway (Grün, Grünes Tarnmuster) C-More Railway (Verde, Boschivo) + C-More Railway (Vert, Woodland) C-More Railway (Red, Desert) @@ -35,6 +39,7 @@ 씨모어 레일웨이 (빨강, 사막) C-More Railway (Rot, Wüste) C-More Railway (Rosso, Desert) + C-More Railway (Rouge, Désert) C-More Railway (Red, Woodland) @@ -42,6 +47,7 @@ 씨모어 레일웨이 (빨강, 수풀) C-More Railway (Rot, Grünes Tarnmuster) C-More Railway (Rosso, Boschivo) + C-More Railway (Rouge, Woodland) Aimpoint Micro R-1 @@ -49,6 +55,7 @@ 에임포인트 마이크로 R-1 Aimpoint Micro R-1 Aimpoint Micro R-1 + Aimpoint Micro R-1 Vortex Spitfire Prism @@ -56,6 +63,7 @@ 버텍스 스핏파이어 프리즘 Vortex Spitfire Prism Vortex Spitfire Prism + Vortex Spitfire Prism Vortex Spitfire Prism (Tan) @@ -63,6 +71,7 @@ 버텍스 스핏파이어 프리즘 (황갈) Vortex Spitfire Prism (Hellbraun) Vortex Spitfire Prism (Marroncino) + Vortex Spitfire Prism (Marron) Vortex Spitfire Prism (Khaki) @@ -70,6 +79,7 @@ 버텍스 스핏파이어 프리즘 (카키) Vortex Spitfire Prism (Khaki) Vortex Spitfire Prism (Cachi) + Vortex Spitfire Prism (Khaki) Vortex Spitfire Prism (Pistol) @@ -77,6 +87,7 @@ 버텍스 스핏파이어 프리즘 (권총용) Vortex Spitfire Prism (Pistole) Vortex Spitfire Prism (Pistola) + Vortex Spitfire Prism (Pistol) Glock 19X @@ -84,6 +95,7 @@ 글록 19X Glock 19X Glock 19X + Glock 19X Glock 19X (Khaki) @@ -91,6 +103,7 @@ 글록 19X (카키) Glock 19X (Khaki) Glock 19X (Cachi) + Glock 19X (Khaki) Glock 19X (Tan) @@ -98,6 +111,7 @@ 글록 19X (황갈) Glock 19X (Hellbraun) Glock 19X (Marroncino) + Glock 19X (Marron) Glock 19X Auto @@ -105,6 +119,7 @@ 글록 19X 기관권총 Glock 19X Auto Glock 19X Auto + Glock 19X Auto Glock 19X Auto (Khaki) @@ -112,6 +127,7 @@ 글록 19X 기관권총 (카키) Glock 19X Auto (Khaki) Glock 19X Auto (Cachi) + Glock 19X Auto (Khaki) Glock 19X Auto (Tan) @@ -119,6 +135,7 @@ 글록 19X 기관권총 (황갈) Glock 19X Auto (Hellbraun) Glock 19X Auto (Marroncino) + Glock 19X Auto (Marron) Desert Eagle Mark XIX L5 @@ -126,6 +143,7 @@ 데저트 이글 마크 XIX L5 Desert Eagle Mark XIX L5 Desert Eagle Mark XIX L5 + Desert Eagle Mark XIX L5 Desert Eagle Mark XIX L5 (Classic) @@ -133,6 +151,7 @@ 데저트 이글 마크 XIX L5 (클래식) Desert Eagle Mark XIX L5 (Klassisch) Desert Eagle Mark XIX L5 (Classico) + Desert Eagle Mark XIX L5 (Classique) Desert Eagle Mark XIX L5 (Bronze) @@ -140,6 +159,7 @@ 데저트 이글 마크 XIX L5 (브론즈) Desert Eagle Mark XIX L5 (Bronze) Desert Eagle Mark XIX L5 (Bronzo) + Desert Eagle Mark XIX L5 (Bronze) Desert Eagle Mark XIX L5 (Copper) @@ -147,6 +167,7 @@ 데저트 이글 마크 XIX L5 (구리) Desert Eagle Mark XIX L5 (Kupfer) Desert Eagle Mark XIX L5 (Rame) + Desert Eagle Mark XIX L5 (Cuivre) Desert Eagle Mark XIX L5 (Gold) @@ -154,6 +175,7 @@ 데저트 이글 마크 XIX L5 (금색) Desert Eagle Mark XIX L5 (Gold) Desert Eagle Mark XIX L5 (Oro) + Desert Eagle Mark XIX L5 (Or) HERA H6 (Tan) @@ -161,6 +183,7 @@ 헤라 H6 (황갈) HERA H6 (Hellbraun) HERA H6 (Marroncino) + HERA H6 (Marron) HERA H6 (Olive) @@ -168,6 +191,7 @@ 헤라 H6 (올리브) HERA H6 (Olivgrün) HERA H6 (Oliva) + HERA H6 (Olive) HERA H6 (Black) @@ -175,6 +199,7 @@ 헤라 H6 (검정) HERA H6 (Schwarz) HERA H6 (Nero) + HERA H6 (Noir) HERA H6 (Digital) @@ -182,6 +207,7 @@ 헤라 H6 (AAF 디지털) HERA H6 (Digital) HERA H6 (Digitale) + HERA H6 (Digital) HERA H6 (Gold) @@ -189,6 +215,7 @@ 헤라 H6 (금색) HERA H6 (Gold) HERA H6 (Oro) + HERA H6 (Or) VS-121 (Black) @@ -196,6 +223,7 @@ VS-121 (검정) VS-121 (Schwarz) VS-121 (Nero) + VS-121 (Noir) VS-121 (Tan) @@ -203,6 +231,7 @@ VS-121 (황갈) VS-121 (Hellbraun) VS-121 (Marroncino) + VS-121 (Marron) Vector SMG (Black) @@ -210,6 +239,7 @@ 벡터 SMG (검정) Vector SMG (Schwarz) Vector SMG (Nero) + Vector SMG (Noir) ASh-12 (Black) @@ -217,6 +247,7 @@ ASh-12 (검정) ASh-12 (Schwarz) ASh-12 (Nero) + ASh-12 (Noir) ASh-12 (Desert) @@ -224,6 +255,7 @@ ASh-12 (사막) ASh-12 (Wüste) ASh-12 (Deserto) + ASh-12 (Désert ) ASh-12 (Urban) @@ -231,6 +263,7 @@ ASh-12 (도심) ASh-12 (Urban) ASh-12 (Urbano) + ASh-12 (Urbain) ASh-12 (Woodland) @@ -238,6 +271,7 @@ ASh-12 (수풀) ASh-12 (Grünes Tarnmuster) ASh-12 (Boschivo) + ASh-12 (Woodland) ASh-12 GL (Black) @@ -245,6 +279,7 @@ ASh-12 GL (검정) ASh-12 GL (Schwarz) ASh-12 GL (Nero) + ASh-12 GL (Noir) ASh-12 GL (Desert) @@ -252,6 +287,7 @@ ASh-12 GL (사막) ASh-12 GL (Wüste) ASh-12 GL (Deserto) + ASh-12 GL (Désert) ASh-12 GL (Urban) @@ -259,6 +295,7 @@ ASh-12 GL (도심) ASh-12 GL (Urban) ASh-12 GL (Urbano) + ASh-12 GL (Urbain) ASh-12 GL (Woodland) @@ -266,6 +303,7 @@ ASh-12 GL (수풀) ASh-12 GL (Grünes Tarnmuster) ASh-12 GL (Boschivo) + ASh-12 GL (Woodland) ASh-12 LR (Black) @@ -273,6 +311,7 @@ ASh-12 LR (검정) ASh-12 LR (Schwarz) ASh-12 LR (Nero) + ASh-12 LR (Noir) ASh-12 LR (Desert) @@ -280,6 +319,7 @@ ASh-12 LR (사막) ASh-12 LR (Wüste) ASh-12 LR (Deserto) + ASh-12 LR (Désert) ASh-12 LR (Urban) @@ -287,6 +327,7 @@ ASh-12 LR (도심) ASh-12 LR (Urban) ASh-12 LR (Urbano) + ASh-12 LR (Urbain) ASh-12 LR (Woodland) @@ -294,6 +335,7 @@ ASh-12 LR (수풀) ASh-12 LR (Grünes Tarnmuster) ASh-12 LR (Boschivo) + ASh-12 LR (Woodland) AW159 Wildcat ASW @@ -301,6 +343,7 @@ AW159 와일드캣 ASW AW159 Wildcat ASW AW159 Wildcat ASW + AW159 Wildcat ASW AW159 Wildcat ASW (Unarmed) @@ -308,6 +351,7 @@ AW159 와일드캣 ASW (비무장) AW159 Wildcat ASW (Unbewaffnet) AW159 Wildcat ASW (Disarmato) + AW159 Wildcat ASW (non armé) H225 Super Puma (Transport) @@ -315,6 +359,7 @@ H225 슈퍼 퓨마 (비무장) H225 Super Puma (Transport) H225 Super Puma (Trasporto) + H225 Super Puma (Transport ) H225 Super Puma (Civilian) @@ -322,6 +367,7 @@ H225 슈퍼 퓨마 (비무장) H225 Super Puma (Zivil) H225 Super Puma (Civile) + H225 Super Puma (Civil) H215 Super Puma (Transport) @@ -329,6 +375,7 @@ H215 슈퍼 퓨마 (비무장) H215 Super Puma (Transport) H215 Super Puma (Trasporto) + H215 Super Puma (Transport) H215 Super Puma (Civilian) @@ -336,6 +383,7 @@ H215 슈퍼 퓨마 (비무장) H215 Super Puma (Zivil) H215 Super Puma (Civile) + H215 Super Puma (Civil) H215 Super Puma (Unarmed) @@ -343,6 +391,7 @@ H215 슈퍼 퓨마 (비무장) H215 Super Puma (Unbewaffnet) H215 Super Puma (Disarmato) + H215 Super Puma (non armé) H225M Super Cougar SOCAT @@ -350,6 +399,7 @@ H225M 슈퍼 쿠거 SOCAT H225M Super Cougar SOCAT H225M Super Cougar SOCAT + H225M Super Cougar SOCAT H225M Super Cougar SOCAT @@ -357,6 +407,7 @@ H225M 슈퍼 쿠거 SOCAT H225M Super Cougar SOCAT H225M Super Cougar SOCAT + H225M Super Cougar SOCAT H225M Super Cougar @@ -364,6 +415,7 @@ H225M 슈퍼 쿠거 H225M Super Cougar H225M Super Cougar + H225M Super Cougar H225 Super Puma SAR @@ -371,6 +423,7 @@ H225 슈퍼 퓨마 SAR H225 Super Puma SAR H225 Super Puma SAR + H225 Super Puma SAR H225M Super Cougar (Unarmed) @@ -378,6 +431,7 @@ H225M Super Cougar (Unbewaffnet) H225M Super Cougar (Disarmato) H225M 슈퍼 쿠거 (비무장) + H225M Super Cougar (Non armé) HEMTT Fire Truck @@ -398,6 +452,7 @@ 타이푼 급수 Typhoon Water Typhoon Acqua + Typhoon Water Ram 1500 @@ -405,6 +460,7 @@ 램 1500 Ram 1500 Ram 1500 + Ram 1500 Ram 1500 (Fuel) @@ -412,6 +468,7 @@ 램 1500 (연료) Ram 1500 (Treibstoff) Ram 1500 (Carburante) + Ram 1500 (Carburant) Ram 1500 (Services) @@ -419,6 +476,7 @@ 램 1500 (서비스) Ram 1500 (Pannenhilfe) Ram 1500 (Servizi) + Ram 1500 (Dépannage) Ram 1500 (Repair) @@ -426,6 +484,7 @@ 램 1500 (정비) Ram 1500 (Instandsetzung) Ram 1500 (Riparazioni) + Ram 1500 (Réparation) Ram 1500 (Comms) @@ -433,6 +492,7 @@ 램 1500 (통신) Ram 1500 (Kommunikation) Ram 1500 (Comunicazioni) + Ram 1500 (Communication) Ram 1500 (HMG) @@ -440,6 +500,7 @@ 램 1500 (중기관총) Ram 1500 (HMG) Ram 1500 (HMG) + Ram 1500 (HMG) Ram 1500 (MMG) @@ -447,6 +508,7 @@ 램 1500 (중형기관총) Ram 1500 (MMG) Ram 1500 (MMG) + Ram 1500 (MMG) Ram 1500 (MRL) @@ -454,6 +516,7 @@ 램 1500 (다연장로켓) Ram 1500 (MRL) Ram 1500 (MRL) + Ram 1500 (MRL) Ram 1500 (AA) @@ -461,6 +524,7 @@ 램 1500 (대공) Ram 1500 (AA) Ram 1500 (AA) + Ram 1500 (AA) Ram 1500 (Covered) @@ -468,6 +532,7 @@ 램 1500 (커버) Ram 1500 (Abgedeckt) Ram 1500 (Coperto) + Ram 1500 (couvert) Ram 1500 (Water) @@ -475,6 +540,7 @@ 램 1500 (급수) Ram 1500 (Wasser) Ram 1500 (Acqua) + Ram 1500 (eau) RSG60 @@ -482,6 +548,7 @@ RSG60 RSG60 RSG60 + RSG60 AMOS Container @@ -489,6 +556,7 @@ AMOS 컨테이너 AMOS Container AMOS Container + AMOS Container Drone40 @@ -496,6 +564,7 @@ 드론40 Drone40 Drone40 + Drone40 Drone40 Scout @@ -503,6 +572,7 @@ 드론40 정찰 Drone40 Scout Drone40 Scout + Drone40 Scout Drone40 HE @@ -510,6 +580,7 @@ 드론40 고폭 Drone40 HE Drone40 HE + Drone40 HE Drone40 Smoke (White) @@ -517,6 +588,7 @@ 드론40 연막 (백색) Drone40 Smoke (Weiß) Drone40 Smoke (Bianco) + Drone40 Fumée (Blanc) Drone40 Smoke (Blue) @@ -524,6 +596,7 @@ 드론40 연막 (청색) Drone40 Smoke (Blau) Drone40 Smoke (Blu) + Drone40 Fumée (Bleu) Drone40 Smoke (Red) @@ -531,6 +604,7 @@ 드론40 연막 (적색) Drone40 Smoke (Rot) Drone40 Smoke (Rosso) + Drone40 Fumée (Rouge) Drone40 Smoke (Green) @@ -538,6 +612,7 @@ 드론40 연막 (녹색) Drone40 Smoke (Grün) Drone40 Smoke (Verde) + Drone40 Fumée (Vert) Drone40 Smoke (Orange) @@ -545,6 +620,7 @@ 드론40 연막 (주황색) Drone40 Smoke (Orange) Drone40 Smoke (Arancione) + Drone40 Fumée (Orange) diff --git a/addons/compat_rhs_afrf3/CfgVehicles.hpp b/addons/compat_rhs_afrf3/CfgVehicles.hpp index 1cf5029bc3..2ba6caf56f 100644 --- a/addons/compat_rhs_afrf3/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/CfgVehicles.hpp @@ -60,6 +60,8 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.7; EGVAR(vehicle_damage,engineFireProb) = 0.7; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims); }; class rhs_infantry_msv_base; @@ -156,68 +158,186 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.8; EGVAR(vehicle_damage,canHaveFireRing) = 1; - }; + }; class rhs_btr60_base: rhs_btr_base { EGVAR(refuel,fuelCapacity) = 290; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.1, 2, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.1, 1.05, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.1, -1.1, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.1, 1.93, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.1, 0.25, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.1, -1.1, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; }; class rhs_btr70_vmf: rhs_btr_base { EGVAR(refuel,fuelCapacity) = 350; + class ace_viewports { class view_0 { camLocation[] = {0.478394, -0.575, -0.145}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {-1.38184, -0.575, -0.145}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; + }; + }; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.7, 0.55, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.7, -0.95, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.7, -1.45, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l4_unhide { + positions[] = {{-1.7, -2.7, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{0.8, 1, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{0.8, 0.12, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{0.8, -0.7, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r4_unhide { + positions[] = {{0.8, -1.85, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; }; }; }; - class rhs_btr70_msv: rhs_btr70_vmf {}; class rhs_btr80_msv: rhs_btr70_msv { EGVAR(refuel,fuelCapacity) = 300; + class ace_viewports { class view_0 { camLocation[] = {0.534424, -0.336914, 0.636819}; camAttach = 45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {0.760254, -0.459473, 0.526328}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {0.770508, -1.21924, 0.526954}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.13, -1.2085, 0.490339}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_4 { camLocation[] = {-1.14124, -0.416992, 0.460611}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_5 { camLocation[] = {-0.932983, -0.326172, 0.647666}; camAttach = -45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; + }; + }; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0, 0.25}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -1.68, 0.15}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -2.87, 0.15}}; + }; + class crate_l4_unhide: crate_l4_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_r1_unhide { + positions[] = {{1.1, 0.97, 0.15}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.1, -1.5, 0.15}}; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + class crate_r4_unhide: crate_r4_unhide { + enabled = 0; }; }; }; @@ -226,38 +346,56 @@ class CfgVehicles { class view_0 { camLocation[] = {0.589844, -0.314941, 0.449678}; camAttach = 45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {0.809082, -0.442871, 0.276865}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {0.819092, -1.24414, 0.27857}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.1012, -1.22461, 0.341089}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_4 { camLocation[] = {-1.11597, -0.458984, 0.307256}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_5 { camLocation[] = {-0.869995, -0.304688, 0.461181}; camAttach = -45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; + }; + }; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0, 0}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -1.68, 0}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -2.87, 0}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.1, 0.97, 0}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.1, -1.5, 0}}; }; }; }; @@ -279,11 +417,289 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.5; EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.45, 0.6, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; }; + class rhs_bmd1_base: rhs_bmd_base {}; + class rhs_bmd1p: rhs_bmd1_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.8}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.8}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.8}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.8}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.8}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.8}}; + }; + }; + }; + class rhs_bmd2_base: rhs_bmd_base {}; + class rhs_bmd2: rhs_bmd2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.8}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.8}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.8}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.8}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.8}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.8}}; + }; + }; + }; + class rhs_bmd2m: rhs_bmd2 { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.7}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.7}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.7}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.7}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.7}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.7}}; + }; + }; + }; + class rhs_bmp1tank_base: Tank_F { EGVAR(map,vehicleLightColor)[] = {0,1,0,0.1}; EGVAR(refuel,fuelCapacity) = 460; }; + class rhs_bmp_base: rhs_bmp1tank_base { + EGVAR(vehicle_damage,hullDetonationProb) = 0; + EGVAR(vehicle_damage,turretDetonationProb) = 0.2; + EGVAR(vehicle_damage,engineDetonationProb) = 0; + EGVAR(vehicle_damage,hullFireProb) = 0.8; + EGVAR(vehicle_damage,turretFireProb) = 0.5; + EGVAR(vehicle_damage,engineFireProb) = 0.8; + EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.55, 1.1, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.55, 0.35, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.55, -0.6, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.55, 1.75, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.55, -0.25, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.55, -1, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; + }; + class rhs_bmp1_vdv: rhs_bmp_base {}; + class rhs_bmp1d_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.5, -1.2, -0.55}}; + }; + }; + }; + class rhs_prp3_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + enabled = 0; + }; + class crate_l2_unhide: crate_l2_unhide { + enabled = 0; + }; + class crate_l3_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r2_unhide: crate_r2_unhide { + enabled = 0; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + }; + }; + + class rhs_bmp2e_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.05, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.35, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.65, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.7, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.25, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -1.05, -0.55}}; + }; + }; + }; + class rhs_bmp2_vdv: rhs_bmp2e_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.2, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.5, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.5, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.85, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.1, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -0.9, -0.55}}; + }; + }; + }; + class rhs_bmp2e_msv: rhs_bmp2e_vdv {}; + class rhs_Ob_681_2: rhs_bmp2e_msv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.2, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.5, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.5, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.85, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.1, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -0.9, -0.55}}; + }; + }; + }; + + class rhs_brm1k_base: rhs_bmp2e_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + enabled = 0; + }; + class crate_l2_unhide: crate_l2_unhide { + enabled = 0; + }; + class crate_l3_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r2_unhide: crate_r2_unhide { + enabled = 0; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + }; + }; + class rhs_bmp3tank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 460; EGVAR(vehicle_damage,hullDetonationProb) = 0.2; @@ -293,37 +709,39 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.2; EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + class ace_viewports { class view_0 { camLocation[] = {1.02881, -0.923828, -0.647231}; screenLocation[] = {1.12881, -0.653828, -1.08223}; camAttach = 50; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {1.01709, -1.55664, -0.647231}; screenLocation[] = {1.10709, -1.42664, -1.14223}; camAttach = 82; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {-0.871094, -1.55762, -0.647231}; screenLocation[] = {-0.981094, -1.42762, -1.13223}; camAttach = 285; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.00879, -0.939941, -0.650259}; screenLocation[] = {-0.97879, -0.689941, -1.09526}; camAttach = 310; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; }; }; + class rhs_a3spruttank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 400; EGVAR(vehicle_damage,hullDetonationProb) = 0.2; @@ -334,6 +752,7 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; }; + class rhs_a3t72tank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 1200; EGVAR(vehicle_damage,hullDetonationProb) = 0.8; @@ -344,15 +763,6 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.5; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.2; }; - class rhs_bmp_base: rhs_bmp1tank_base { - EGVAR(vehicle_damage,hullDetonationProb) = 0; - EGVAR(vehicle_damage,turretDetonationProb) = 0.2; - EGVAR(vehicle_damage,engineDetonationProb) = 0; - EGVAR(vehicle_damage,hullFireProb) = 0.8; - EGVAR(vehicle_damage,turretFireProb) = 0.5; - EGVAR(vehicle_damage,engineFireProb) = 0.8; - EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; - }; class rhs_t72bd_tv: rhs_a3t72tank_base { EGVAR(vehicle_damage,eraHitpoints)[] = { "era_1_hitpoint", "era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", diff --git a/addons/compat_rhs_afrf3/CfgWeapons.hpp b/addons/compat_rhs_afrf3/CfgWeapons.hpp index a6def44c40..a25d1f7cd0 100644 --- a/addons/compat_rhs_afrf3/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/CfgWeapons.hpp @@ -108,19 +108,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 1.65; }; - class H_HelmetB; - class rhs_tsh4: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_6b47_bare; - class rhs_6b48: rhs_6b47_bare { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_zsh7a: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; + class rhs_zsh7a; class rhs_zsh7a_alt: rhs_zsh7a { ACE_Protection = 1; }; @@ -133,22 +121,6 @@ class CfgWeapons { ACE_Protection = 1; }; - class rhs_gssh18: H_HelmetB { - HEARING_PROTECTION_EARMUFF; - }; - - class rhs_6b47; - class rhs_6b47_6m2: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - class rhs_6b47_6m2_1: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - - class rhs_6m2: H_HelmetB { - HEARING_PROTECTION_PELTOR; - }; - class rhs_weap_d81; class rhs_weap_2a70: rhs_weap_d81 { // "Low pressure" 100mm cannon EGVAR(overpressure,range) = 15; diff --git a/addons/compat_rhs_afrf3/XEH_postInit.sqf b/addons/compat_rhs_afrf3/XEH_postInit.sqf index be180179a5..e740d0d8a6 100644 --- a/addons/compat_rhs_afrf3/XEH_postInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_postInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +if !(["ace_nametags"] call EFUNC(common,isModLoaded)) exitWith {}; + private _russianRankIcons = [ QPATHTOEF(nametags,UI\icons_russia\private_gs.paa), QPATHTOEF(nametags,UI\icons_russia\corporal_gs.paa), diff --git a/addons/compat_rhs_afrf3/XEH_preInit.sqf b/addons/compat_rhs_afrf3/XEH_preInit.sqf index b47cf6628d..2ca4338e90 100644 --- a/addons/compat_rhs_afrf3/XEH_preInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_preInit.sqf @@ -6,4 +6,12 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +// Disable RHS' wheel replacement mechanic +if (["ace_repair"] call EFUNC(common,isModLoaded)) then { + RHS_Retread_Enabled = false; + rhs_btr70_EnableRetread = false; + rhs_TypeTirePressure = 1; + RHS_BTR_Effects_Init = true; +}; + ADDON = true; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp index 4f8e808bd5..4ad71e5e24 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp @@ -2,7 +2,7 @@ class CfgMagazines { // ACE Explosives class ATMine_Range_Mag; class rhs_mine_tm62m_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_tm62m); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_tm62m); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -12,7 +12,7 @@ class CfgMagazines { }; class rhs_mine_pmn2_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_pmn2); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_pmn2); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -22,7 +22,7 @@ class CfgMagazines { }; class rhs_mag_mine_ptm1: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ptm1); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ptm1); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -32,7 +32,7 @@ class CfgMagazines { }; class rhs_mag_mine_pfm1: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_pfm1); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_pfm1); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -42,8 +42,7 @@ class CfgMagazines { }; class rhs_ec75_mag: ATMine_Range_Mag { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec75); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec75); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -59,27 +58,27 @@ class CfgMagazines { }; class rhs_ec75_sand_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec75_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec75_sand); }; class rhs_ec200_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec200); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec200); }; class rhs_ec200_sand_mag: rhs_ec200_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec200_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec200_sand); }; class rhs_ec400_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec400); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec400); }; class rhs_ec400_sand_mag: rhs_ec400_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec400_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec400_sand); }; class rhs_mine_msk40p_white_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_white); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_white); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -89,19 +88,19 @@ class CfgMagazines { }; class rhs_mine_msk40p_red_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_red); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_red); }; class rhs_mine_msk40p_green_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_green); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_green); }; class rhs_mine_msk40p_blue_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_blue); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_blue); }; class rhs_mine_sm320_white_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_white); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_white); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -111,15 +110,15 @@ class CfgMagazines { }; class rhs_mine_sm320_red_mag: rhs_mine_sm320_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_red); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_red); }; class rhs_mine_sm320_green_mag: rhs_mine_sm320_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_green); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_green); }; class rhs_mine_ozm72_a_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_a); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_a); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -129,12 +128,11 @@ class CfgMagazines { }; class rhs_mine_ozm72_b_mag: rhs_mine_ozm72_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_b); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_b); }; class rhs_mine_ozm72_c_mag: rhs_mine_ozm72_a_mag { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_c); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_c); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp new file mode 100644 index 0000000000..04edf4d754 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp @@ -0,0 +1,28 @@ +class CfgWeapons { + class H_HelmetB; + class rhs_tsh4: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_zsh7a: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_gssh18: H_HelmetB { + HEARING_PROTECTION_EARMUFF; + }; + class rhs_6m2: H_HelmetB { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47; + class rhs_6b47_6m2: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + class rhs_6b47_6m2_1: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47_bare; + class rhs_6b48: rhs_6b47_bare { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp new file mode 100644 index 0000000000..4a8056bf0c --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp new file mode 100644 index 0000000000..8edb825af3 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..48da0552b8 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp @@ -0,0 +1,145 @@ +class CfgVehicles { + class Wheeled_APC_F; + class rhs_btr_base: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class wheel_1_unhide { + positions[] = {{-0.8, -1.7, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class wheel_2_unhide { + positions[] = {{0.35, -2.9, -0.1}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhs_btr70_vmf: rhs_btr_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1.2, -2.6, 0.2}}; + }; + class wheel_2_unhide: wheel_2_unhide { + positions[] = {{-0.3, -3.8, 0}}; + }; + }; + }; + + class rhs_btr70_msv: rhs_btr70_vmf {}; + class rhs_btr80_msv: rhs_btr70_msv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1, -2.5, 0.6}}; + }; + class wheel_2_unhide: wheel_2_unhide { + enabled = 0; + }; + }; + }; + + class Truck_F; + class rhs_truck: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhs_gaz66_vmf: rhs_truck {}; + class rhs_gaz66_ammo_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + class rhs_gaz66_repair_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + class rhs_gaz66_ap2_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + + class RHS_Ural_BaseTurret: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_zil131_base: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_kraz255_base; + class rhs_kraz255b1_base: rhs_kraz255_base { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class O_Truck_02_covered_F; + class rhs_kamaz5350: O_Truck_02_covered_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class MRAP_02_base_F; + class rhs_tigr_base: MRAP_02_base_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class Offroad_01_base_f; + class RHS_UAZ_Base: Offroad_01_base_f { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp new file mode 100644 index 0000000000..d6d4fab107 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Dystopian", "johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_afrf3/config.cpp b/addons/compat_rhs_afrf3/config.cpp index 44fcd30fcb..8bf5668485 100644 --- a/addons/compat_rhs_afrf3/config.cpp +++ b/addons/compat_rhs_afrf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { @@ -7,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhs_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhs_main_loadorder"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "commy2", "Skengman2"}; url = ECSTRING(main,URL); diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp index 0808c7ff1d..458969b7c0 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp @@ -1,83 +1,83 @@ class CfgAmmo { class APERSMine_Range_Ammo; class rhs_mine_a200_bz_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.035}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.035}; }; class rhs_mine_a200_dz35_ammo: rhs_mine_a200_bz_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; class rhs_mine_glasmine43_hz_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.015}; }; class rhs_mine_glasmine43_bz_ammo: rhs_mine_glasmine43_hz_ammo { - ace_minedetector_detectable = 0; + EGVAR(minedetector,detectable) = 0; }; class rhs_mine_bounding_trigger_base; class rhs_mine_m2a3b_press_ammo: rhs_mine_bounding_trigger_base { - ace_explosives_defuseObjectPosition[] = {0, 0.046, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0.046, 0.02}; }; class rhs_mine_m2a3b_trip_ammo: rhs_mine_m2a3b_press_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0.046, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0.046, 0.055}; }; class rhs_mine_M3_pressure_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.015}; }; class rhs_mine_M3_tripwire_ammo: rhs_mine_M3_pressure_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.055}; }; class ATMine_Range_Ammo; class rhs_mine_TM43_ammo: ATMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.072}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.072}; }; class rhs_mine_M7A2_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.067}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.067}; }; class rhs_mine_Mk2_pressure_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; class rhs_mine_Mk2_tripwire_ammo: rhs_mine_Mk2_pressure_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.055}; }; class APERSBoundingMine_Range_Ammo; class rhs_mine_smine35_press_ammo: APERSBoundingMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.03}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.03}; }; class rhs_mine_smine35_trip_ammo: rhs_mine_bounding_trigger_base { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.04}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.04}; }; class rhs_mine_smine44_trip_ammo: rhs_mine_smine35_trip_ammo { - ace_explosives_defuseObjectPosition[] = {-0.03, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {-0.03, 0, 0.015}; }; class rhs_mine_smine44_press_ammo: APERSBoundingMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {-0.02, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {-0.02, 0, 0.02}; }; class APERSTripMine_Wire_Ammo; class rhs_mine_stockmine43_2m_ammo: APERSTripMine_Wire_Ammo { - ace_explosives_defuseObjectPosition[] = {-1, 0, 0.25}; + EGVAR(explosives,defuseObjectPosition)[] = {-1, 0, 0.25}; }; class rhs_mine_stockmine43_4m_ammo: rhs_mine_stockmine43_2m_ammo { - ace_explosives_defuseObjectPosition[] = {-2, 0, 0.25}; + EGVAR(explosives,defuseObjectPosition)[] = {-2, 0, 0.25}; }; class DemoCharge_Remote_Ammo; class rhs_charge_M2tet_x2_ammo: DemoCharge_Remote_Ammo { - ace_explosives_defuseObjectPosition[] = {0.095, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0.095, 0, 0.055}; }; }; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp index ce882e1825..d25a27bebd 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp @@ -1,7 +1,7 @@ class CfgMagazines { class APERSMine_Range_Mag; class rhs_mine_a200_bz_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_a200_bz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_a200_bz"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -11,7 +11,7 @@ class CfgMagazines { }; class rhs_mine_a200_dz35_mag: rhs_mine_a200_bz_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_a200_dz35"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_a200_dz35"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -21,7 +21,7 @@ class CfgMagazines { }; class rhs_mine_glasmine43_hz_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_glasmine43_hz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_glasmine43_hz"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -31,12 +31,12 @@ class CfgMagazines { }; class rhs_mine_glasmine43_bz_mag: rhs_mine_glasmine43_hz_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_glasmine43_bz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_glasmine43_bz"; }; class APERSBoundingMine_Range_Mag; class rhs_mine_m2a3b_press_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m2a3b_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m2a3b_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -46,7 +46,7 @@ class CfgMagazines { }; class rhs_mine_m2a3b_trip_mag: rhs_mine_m2a3b_press_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m2a3b_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m2a3b_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -56,7 +56,7 @@ class CfgMagazines { }; class rhs_mine_m3_pressure_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m3_pressure"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m3_pressure"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -67,7 +67,7 @@ class CfgMagazines { class APERSTripMine_Wire_Mag; class rhs_mine_M3_tripwire_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_M3_tripwire"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_M3_tripwire"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -78,7 +78,7 @@ class CfgMagazines { class ATMine_Range_Mag; class rhs_mine_TM43_mag: ATMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_TM43"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_TM43"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -88,7 +88,7 @@ class CfgMagazines { }; class rhs_mine_M7A2_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_M7A2"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_M7A2"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -98,7 +98,7 @@ class CfgMagazines { }; class rhs_mine_mk2_pressure_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_mk2_pressure"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_mk2_pressure"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -108,7 +108,7 @@ class CfgMagazines { }; class rhs_mine_Mk2_tripwire_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_Mk2_tripwire"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_Mk2_tripwire"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -118,7 +118,7 @@ class CfgMagazines { }; class rhs_mine_smine35_press_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine35_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine35_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -128,7 +128,7 @@ class CfgMagazines { }; class rhs_mine_smine35_trip_mag: rhs_mine_smine35_press_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine35_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine35_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -138,7 +138,7 @@ class CfgMagazines { }; class rhs_mine_smine44_trip_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine44_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine44_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -148,7 +148,7 @@ class CfgMagazines { }; class rhs_mine_smine44_press_mag: rhs_mine_smine44_trip_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine44_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine44_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -158,7 +158,7 @@ class CfgMagazines { }; class rhs_mine_stockmine43_2m_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_stockmine43_2m"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_stockmine43_2m"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -168,7 +168,7 @@ class CfgMagazines { }; class rhs_mine_stockmine43_4m_mag: rhs_mine_stockmine43_2m_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_stockmine43_4m"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_stockmine43_4m"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -179,7 +179,7 @@ class CfgMagazines { class DemoCharge_Remote_Mag; class rhs_charge_M2tet_x2_mag: DemoCharge_Remote_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_charge_M2tet_x2"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_charge_M2tet_x2"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; class Timer { diff --git a/addons/compat_rhs_gref3/config.cpp b/addons/compat_rhs_gref3/config.cpp index f2e7aeacde..84717435be 100644 --- a/addons/compat_rhs_gref3/config.cpp +++ b/addons/compat_rhs_gref3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsgref_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsgref_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"PabstMirror", "Ruthberg", "Anton"}; diff --git a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp index c004f58446..e7c00c95d2 100644 --- a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp @@ -3,22 +3,22 @@ class CfgMagazines { // ACE Explosives class ATMine_Range_Mag; class rhssaf_mine_mrud_a_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_a); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_a); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; }; }; class rhssaf_mine_mrud_b_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_b); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_b); }; class rhssaf_mine_mrud_c_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_c); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_c); }; class rhssaf_mine_mrud_d_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_d); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_d); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { @@ -29,7 +29,7 @@ class CfgMagazines { }; class rhssaf_mine_pma3_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_pma3); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_pma3); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -39,7 +39,7 @@ class CfgMagazines { }; class rhssaf_mine_tma4_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_tma4); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_tma4); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -51,9 +51,8 @@ class CfgMagazines { class CA_Magazine; class rhssaf_tm100_mag: CA_Magazine { useAction = 0; - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm100); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm100); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter"}; class Timer { @@ -67,10 +66,10 @@ class CfgMagazines { }; class rhssaf_tm200_mag: rhssaf_tm100_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm200); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm200); }; class rhssaf_tm500_mag: rhssaf_tm100_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm500); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm500); }; }; diff --git a/addons/compat_rhs_saf3/config.cpp b/addons/compat_rhs_saf3/config.cpp index 75ee4f5530..71340640ce 100644 --- a/addons/compat_rhs_saf3/config.cpp +++ b/addons/compat_rhs_saf3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhssaf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhssaf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {}; diff --git a/addons/compat_rhs_usf3/CfgVehicles.hpp b/addons/compat_rhs_usf3/CfgVehicles.hpp index 0593c5a868..3933e543ec 100644 --- a/addons/compat_rhs_usf3/CfgVehicles.hpp +++ b/addons/compat_rhs_usf3/CfgVehicles.hpp @@ -43,8 +43,7 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 302; }; - class Truck_F; - class Truck_01_base_F: Truck_F {}; + class Truck_01_base_F; class rhsusf_fmtv_base: Truck_01_base_F { EGVAR(refuel,fuelCapacity) = 219; }; @@ -55,8 +54,7 @@ class CfgVehicles { EGVAR(refuel,fuelCargo) = 900; // 45 jerrycans }; - class rhsusf_HEMTT_A4_base: Truck_01_base_F {}; - class rhsusf_M977A4_usarmy_wd: rhsusf_HEMTT_A4_base {}; + class rhsusf_M977A4_usarmy_wd; class rhsusf_M977A4_AMMO_usarmy_wd: rhsusf_M977A4_usarmy_wd { EGVAR(rearm,defaultSupply) = 1200; }; diff --git a/addons/compat_rhs_usf3/CfgWeapons.hpp b/addons/compat_rhs_usf3/CfgWeapons.hpp index 46ac7e56ba..50b09c760f 100644 --- a/addons/compat_rhs_usf3/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/CfgWeapons.hpp @@ -206,170 +206,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 0.9; }; - // Fast Helmets - class rhsusf_opscore_01; - class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_cover; - class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_01; - class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - - // ACH Helmets - class rhsusf_ach_helmet_ocp; - class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - - // ACVC Helmets - class rhsusf_cvc_helmet: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; - - // MICH Helmets - class rhsusf_mich_bare; - class rhsusf_mich_bare_alt: rhsusf_mich_bare { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos; - class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc; - class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_semi; - class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_semi; - class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { - HEARING_PROTECTION_OPEN; - }; - class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_tan; - class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_tan; - class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_tan; - class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { - HEARING_PROTECTION_PELTOR; - }; - - class rhsusf_hgu56p: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; + class rhsusf_hgu56p; class rhsusf_hgu56p_visor: rhsusf_hgu56p { ACE_Protection = 1; }; @@ -420,13 +257,9 @@ class CfgWeapons { class rhsusf_hgu56p_mask_black_skull: rhsusf_hgu56p_visor_mask_black_skull { ACE_Protection = 0; }; - class rhsusf_ihadss: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; class H_HelmetB; class RHS_jetpilot_usaf: H_HelmetB { ACE_Protection = 1; - HEARING_PROTECTION_VICCREW; }; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp index 332c2bf1f2..aa2485dcdc 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp @@ -1,7 +1,6 @@ class CfgMagazines { class CA_Magazine; class rhsusf_m112_mag: CA_Magazine { - EGVAR(explosives,delayTime) = 1; EGVAR(explosives,placeable) = 1; EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_m112); useAction = 0; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp new file mode 100644 index 0000000000..f0571e876f --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp @@ -0,0 +1,174 @@ +class CfgWeapons { + // Fast Helmets + class rhsusf_opscore_01; + class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_cover; + class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_01; + class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + + // ACH Helmets + class rhsusf_ach_helmet_ocp; + class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + + // ACVC Helmets + class rhsusf_cvc_helmet: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + // MICH Helmets + class rhsusf_mich_bare; + class rhsusf_mich_bare_alt: rhsusf_mich_bare { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos; + class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc; + class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_semi; + class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_semi; + class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { + HEARING_PROTECTION_OPEN; + }; + class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_tan; + class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_tan; + class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_tan; + class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { + HEARING_PROTECTION_PELTOR; + }; + + class rhsusf_hgu56p: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + class rhsusf_ihadss: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + class H_HelmetB; + class RHS_jetpilot_usaf: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp new file mode 100644 index 0000000000..e52454b184 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp new file mode 100644 index 0000000000..8edb825af3 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp new file mode 100644 index 0000000000..10607ab6b5 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp @@ -0,0 +1,52 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_FCans { + positions[] = {{-0.7, -3, -0.4}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.5, -3, -0.4}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-1, -4, -0.4}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.7, -3, -0.7}}; + }; + }; + }; + + class rhsusf_m1a2tank_base; + class rhsusf_m1a2sep2_base: rhsusf_m1a2tank_base { + class EGVAR(interaction,anims) { + class fuelcans_hide { + // Rotate interactions with turret rotation + positions[] = { + "[0.23, -0.6, 0] vectorAdd ([[1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0.23, -0.6, 0] vectorAdd ([[-1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp index bf600d5d5a..391e22d95e 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp @@ -21,3 +21,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..91bed1dc5a --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp @@ -0,0 +1,127 @@ +class CfgVehicles { + class Truck_01_base_F; + class rhsusf_fmtv_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {{1, 1.4, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhsusf_M1078A1P2_fmtv_usarmy: rhsusf_fmtv_base {}; + class rhsusf_M1078A1P2_B_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1078A1P2_B_M2_fmtv_usarmy: rhsusf_M1078A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1, -0.5}}; + }; + }; + }; + class rhsusf_M1083A1P2_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1084A1P2_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, 0}}; + }; + }; + }; + class rhsusf_M1084A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, -0.5}}; + }; + }; + }; + class rhsusf_M1085A1P2_B_Medical_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 6.1, 0}}; + }; + }; + }; + + class rhsusf_HEMTT_A4_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 2.5; + }; + }; + }; + + class MRAP_01_base_F; + class rhsusf_m1151_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + // Don't inherit, as it's easier for the trenches compat + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel_gmv', 'Geometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_rg33_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_M1239_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_MATV_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'Geometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp new file mode 100644 index 0000000000..b204f64166 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp new file mode 100644 index 0000000000..e914b24d60 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_PioKit { + positions[] = {{-1, -2.2, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-0.8, -2.2, -0.5}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1.3, -3.3, -0.5}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1, -2.2, -0.8}}; + }; + }; + }; + + class rhsusf_m1151_base; + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class tools_hide { + positions[] = {{0.365, 1.5, -0.4}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp new file mode 100644 index 0000000000..aea4c9daeb --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp new file mode 100644 index 0000000000..10b90eb71e --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/config.cpp b/addons/compat_rhs_usf3/config.cpp index 73b4723b2c..b28a08b22e 100644 --- a/addons/compat_rhs_usf3/config.cpp +++ b/addons/compat_rhs_usf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { @@ -7,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsusf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsusf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "Fyuran"}; diff --git a/addons/compat_sog/ACE_CSW_Groups.hpp b/addons/compat_sog/ACE_CSW_Groups.hpp index 2bc81dbb65..a891420439 100644 --- a/addons/compat_sog/ACE_CSW_Groups.hpp +++ b/addons/compat_sog/ACE_CSW_Groups.hpp @@ -2,7 +2,7 @@ class ACE_CSW_Groups { // --- Gun Turrets ------------------------------------------------------------- - class ace_csw_100Rnd_127x99_mag { + class EGVAR(csw,100Rnd_127x99_mag) { vn_m2_v_100_mag = 1; }; diff --git a/addons/compat_sog/CfgAmmo/explosives.hpp b/addons/compat_sog/CfgAmmo/explosives.hpp index 849f7e6948..6922962fb3 100644 --- a/addons/compat_sog/CfgAmmo/explosives.hpp +++ b/addons/compat_sog/CfgAmmo/explosives.hpp @@ -2,16 +2,10 @@ class DirectionalBombBase; class vn_mine_m18_ammo: DirectionalBombBase { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.15}; EGVAR(explosives,size) = 1; - EGVAR(explosives,explosive) = "vn_mine_m18_ammo_scripted"; }; class vn_mine_m18_x3_ammo: vn_mine_m18_ammo { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.1}; - EGVAR(explosives,explosive) = "vn_mine_m18_x3_ammo_scripted"; -}; - -class vn_mine_m18_wp_ammo: vn_mine_m18_ammo { - EGVAR(explosives,explosive) = "vn_mine_m18_wp_ammo_scripted"; }; class vn_mine_m16_base; @@ -99,13 +93,7 @@ class vn_mine_punji_05_ammo: vn_mine_punji_04_ammo { }; class APERSMine_Range_Ammo; -class vn_mine_bike_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_bike_ammo_scripted"; -}; - class vn_mine_cartridge_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_cartridge_ammo_scripted"; - // bump range and damage slightly, default values do not work well with ACE Medical indirectHit = QUOTE(getNumber (configFile >> 'CfgAmmo' >> 'vn_mine_cartridge_ammo' >> 'GVAR(indirectHit)')); GVAR(indirectHit) = QUOTE([ARR_2(2,1)] select isNull (configFile >> 'CfgPatches' >> 'ace_medical')); @@ -116,50 +104,8 @@ class vn_mine_cartridge_ammo: APERSMine_Range_Ammo { class vn_mine_lighter_ammo: APERSMine_Range_Ammo { ACE_damageType = QGVAR(explosive_incendiary); - - EGVAR(explosives,explosive) = "vn_mine_lighter_ammo_scripted"; }; class vn_mine_jerrycan_ammo: APERSMine_Range_Ammo { ACE_damageType = QGVAR(explosive_incendiary); - - EGVAR(explosives,explosive) = "vn_mine_jerrycan_ammo_scripted"; -}; - -class vn_mine_pot_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_pot_ammo_scripted"; -}; - -class vn_mine_mortar_range_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_mortar_range_ammo_scripted"; -}; - -class vn_mine_limpet_01_ammo: DemoCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_limpet_01_ammo_scripted"; -}; - -class vn_mine_limpet_02_ammo: vn_mine_limpet_01_ammo { - EGVAR(explosives,explosive) = "vn_mine_limpet_02_ammo_scripted"; -}; - -class vn_mine_chicom_no8_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_chicom_no8_ammo_scripted"; -}; - -class vn_mine_dh10_ammo: DirectionalBombBase { - EGVAR(explosives,explosive) = "vn_mine_dh10_ammo_scripted"; -}; - -class PipeBombBase; -class vn_mine_gboard_range_ammo: PipeBombBase { - EGVAR(explosives,explosive) = "vn_mine_gboard_range_ammo_scripted"; -}; - -class SatchelCharge_Remote_Ammo; -class vn_mine_satchelcharge_02_ammo: SatchelCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_satchelcharge_02_ammo_scripted"; -}; - -class vn_mine_bangalore_ammo: SatchelCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_bangalore_ammo_scripted"; }; diff --git a/addons/compat_sog/CfgMagazines/explosives.hpp b/addons/compat_sog/CfgMagazines/explosives.hpp index 7e25609fc8..a8d6ca76bd 100644 --- a/addons/compat_sog/CfgMagazines/explosives.hpp +++ b/addons/compat_sog/CfgMagazines/explosives.hpp @@ -6,8 +6,8 @@ class vn_mine_m18_mag: vn_magazine { displayNameShort = ""; // Every explosive inherits this and it breaks naming in the placing menu - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -42,7 +42,7 @@ class vn_mine_m18_fuze10_mag: vn_mine_m18_mag { // Claymore x3 (Remote) class vn_mine_m18_x3_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18_x3); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18_x3); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -65,7 +65,7 @@ class vn_mine_m18_x3_range_mag: vn_mine_m18_x3_mag { // WP Claymore (Remote) class vn_mine_m18_wp_mag: vn_mine_m18_fuze10_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18_wp); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18_wp); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -101,7 +101,7 @@ class vn_mine_m18_wp_fuze10_mag: vn_mine_m18_wp_mag { // Toe-Popper class vn_mine_m14_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m14); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m14); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -113,7 +113,7 @@ class vn_mine_m14_mag: vn_mine_m18_mag { // Bounding Mine class vn_mine_m16_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -125,7 +125,7 @@ class vn_mine_m16_mag: vn_mine_m18_mag { // Bounding Mine (Trip Wire 2m) class vn_mine_tripwire_m16_02_mag: vn_mine_m16_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16_tripwire_2m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16_tripwire_2m); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -136,7 +136,7 @@ class vn_mine_tripwire_m16_02_mag: vn_mine_m16_mag { }; // Bounding Mine (Trip Wire 4m) class vn_mine_tripwire_m16_04_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16_tripwire_4m); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -148,22 +148,22 @@ class vn_mine_tripwire_m16_04_mag: vn_mine_tripwire_m16_02_mag { // F1 (Trip Wire 2m) class vn_mine_tripwire_f1_02_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(f1_tripwire_2m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(f1_tripwire_2m); }; // F1 (Trip Wire 4m) class vn_mine_tripwire_f1_04_mag: vn_mine_tripwire_f1_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(f1_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(f1_tripwire_4m); }; // Arty Shell (Trip Wire 4m) class vn_mine_tripwire_arty_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(arty_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(arty_tripwire_4m); }; // Satchel Charge class vn_mine_satchel_remote_02_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(satchel_remote_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(satchel_remote_02); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -180,7 +180,7 @@ class vn_mine_satchel_remote_02_mag: vn_mine_m18_mag { // TM57 Anti-Tank Mine class vn_mine_tm57_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(tm57); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(tm57); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -190,7 +190,7 @@ class vn_mine_tm57_mag: vn_mine_m18_mag { // M15 Anti-Tank Mine class vn_mine_m15_mag: vn_mine_tm57_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m15); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m15); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -202,7 +202,7 @@ class vn_mine_m15_mag: vn_mine_tm57_mag { // M112 Breaching charge class vn_mine_m112_remote_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m112); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m112); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -221,7 +221,7 @@ class vn_mine_m112_remote_mag: vn_mine_m18_mag { // Spiked ammo box class vn_mine_ammobox_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(ammobox_range); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(ammobox_range); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -234,7 +234,7 @@ class vn_mine_ammobox_range_mag: vn_mine_m18_mag { // Punji large class vn_mine_punji_01_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_01); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_01); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -246,18 +246,18 @@ class vn_mine_punji_01_mag: vn_mine_m18_mag { // Punji small class vn_mine_punji_02_mag: vn_mine_punji_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_02); }; // Punji whip class vn_mine_punji_03_mag: vn_mine_punji_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_03); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_03); }; // Punji door-way class vn_mine_punji_04_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_04); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_04); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -270,7 +270,7 @@ class vn_mine_punji_04_mag: vn_mine_m18_mag { // Punji side whip class vn_mine_punji_05_mag: vn_mine_punji_04_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_05); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_05); class ACE_Triggers: ACE_Triggers { class PressurePlate: PressurePlate { @@ -281,7 +281,7 @@ class vn_mine_punji_05_mag: vn_mine_punji_04_mag { // Bike mine (Remote) class vn_mine_bike_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bike); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bike); class ACE_Triggers { SupportedTriggers[] = {QGVAR(Command), QGVAR(MK16_Transmitter)}; @@ -304,7 +304,7 @@ class vn_mine_bike_range_mag: vn_mine_bike_mag { // Cartridge mine class vn_mine_cartridge_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(cartridge); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(cartridge); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -316,7 +316,7 @@ class vn_mine_cartridge_mag: vn_mine_m18_mag { // Lighter mine (Proximity) class vn_mine_lighter_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(lighter); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(lighter); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -328,7 +328,7 @@ class vn_mine_lighter_mag: vn_mine_m18_mag { // Pot mine (Remote) class vn_mine_pot_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(pot); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(pot); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -351,7 +351,7 @@ class vn_mine_pot_range_mag: vn_mine_pot_mag { // Jerrycan mine (Remote) class vn_mine_jerrycan_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(jerrycan); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(jerrycan); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -374,7 +374,7 @@ class vn_mine_jerrycan_range_mag: vn_mine_jerrycan_mag { // Mortar shell on a stick (Proximity) class vn_mine_mortar_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(mortar_range); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(mortar_range); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -386,17 +386,17 @@ class vn_mine_mortar_range_mag: vn_mine_m18_mag { // Limpet mine USA (Remote) class vn_mine_limpet_01_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(limpet_01); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(limpet_01); }; // Limpet mine RUS (Remote) class vn_mine_limpet_02_mag: vn_mine_limpet_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(limpet_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(limpet_02); }; // Chicom NO8 mine class vn_mine_chicom_no8_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(chicom_no8); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(chicom_no8); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -408,7 +408,7 @@ class vn_mine_chicom_no8_mag: vn_mine_m18_mag { // DH10 mine (Remote) class vn_mine_dh10_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(dh10); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(dh10); }; // DH10 mine (Proximity) class vn_mine_dh10_range_mag: vn_mine_dh10_mag { @@ -422,7 +422,7 @@ class vn_mine_dh10_range_mag: vn_mine_dh10_mag { // Grenade board mine (Tripwire 4m) class vn_mine_gboard_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(gboard); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(gboard); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -434,10 +434,10 @@ class vn_mine_gboard_range_mag: vn_mine_m18_mag { // Satchel charge class vn_mine_satchelcharge_02_mag: vn_mine_satchel_remote_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(satchelcharge_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(satchelcharge_02); }; // Bangalore mine class vn_mine_bangalore_mag: vn_mine_satchel_remote_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bangalore); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bangalore); }; diff --git a/addons/compat_sog/CfgVehicles/tracked.hpp b/addons/compat_sog/CfgVehicles/tracked.hpp index e2832796a9..7adc0193c6 100644 --- a/addons/compat_sog/CfgVehicles/tracked.hpp +++ b/addons/compat_sog/CfgVehicles/tracked.hpp @@ -1,18 +1,55 @@ +// M113A1 https://man.fas.org/dod-101/sys/land/m113.htm +class Tank_F; +class APC_Tracked_01_base_F: Tank_F { + class ACE_Actions; +}; +class vn_armor_m113_base: APC_Tracked_01_base_F { + EGVAR(refuel,fuelCapacity) = 360; + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; +}; +class vn_armor_m577_base: vn_armor_m113_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0, 3.5, -1]"; + }; + }; +}; + // M41 class vn_armor_tank_base; class vn_armor_m41_base: vn_armor_tank_base { EGVAR(refuel,fuelCapacity) = 530; }; -// Type 63 -class vn_armor_type63_base: vn_armor_tank_base { - EGVAR(refuel,fuelCapacity) = 545; +// M48 +class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_backpacks { + // Rotate interactions with turret rotation + positions[] = { + "[[-1.3, -0.7, -0.4], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D", + "[[0.1, -2, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D" + }; + items[] = {"vn_b_pack_02_02", "vn_b_pack_04_02"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; }; -// M113A1 https://man.fas.org/dod-101/sys/land/m113.htm -class APC_Tracked_01_base_F; -class vn_armor_m113_base: APC_Tracked_01_base_F { - EGVAR(refuel,fuelCapacity) = 360; +// T-54 +class vn_armor_t54_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_backpacks { + // Rotate interactions with turret rotation + positions[] = {"[0, -0.2, 0] vectorAdd ([[-1.1, -0.85, -1.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"vn_o_pack_01", "vn_o_pack_02"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; }; // PT-76A https://en.wikipedia.org/wiki/PT-76 @@ -24,3 +61,8 @@ class vn_armor_pt76_base: vn_armor_tank_base { class vn_armor_pt76b_base: vn_armor_pt76_base { EGVAR(refuel,fuelCapacity) = 400; }; + +// Type 63 +class vn_armor_type63_base: vn_armor_tank_base { + EGVAR(refuel,fuelCapacity) = 545; +}; diff --git a/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp b/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp new file mode 100644 index 0000000000..c3dcfb719e --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp @@ -0,0 +1,163 @@ +class CfgVehicles { + // Vehicle animation interactions + // BTR-40 + class vn_wheeled_car_base; + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class refuel_can_hide { + positions[] = {{0.7, -2.35, -0.9}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class vn_wheeled_btr40_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.45}}; + }; + }; + }; + class vn_wheeled_btr40_ambulance_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.45}}; + }; + }; + }; + class vn_wheeled_btr40_mg_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.9}}; + }; + }; + }; + class vn_wheeled_btr40_mg_03_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.82, -2.35, -1.25}}; + }; + }; + }; + class vn_wheeled_btr40_mg_04_base: vn_wheeled_btr40_mg_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -1}}; + }; + }; + }; + class vn_wheeled_btr40_mg_05_base: vn_wheeled_btr40_mg_04_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.65, -2.25, -1}}; + }; + }; + }; + + // M151 + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_refuel_can_hide { + positions[] = {{-0.48, -1.5, -1.1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class vn_wheeled_m151_mg_03_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{-0.75, -1.5, -1}}; + }; + }; + }; + class vn_wheeled_m151_mg_05_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{0.9, -0.1, -1.1}}; + }; + }; + }; + class vn_wheeled_m151_mg_06_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{0.3, 0.1, -1.1}}; + }; + }; + }; + class vn_wheeled_m151_01_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{-0.4, -1.5, -0.7}}; + }; + }; + }; + + // M577 + class vn_armor_m113_base; + class vn_armor_m577_base: vn_armor_m113_base { + class EGVAR(interaction,anims) { + class hide_fuel_cans { + selections[] = {"hide_fuel_cans"}; + positions[] = {{1.07, 1.05, -1}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_jerrycan { + positions[] = {"_target selectionPosition ['hide_jerrycan', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_sog/compat_sog_refuel/config.cpp b/addons/compat_sog/compat_sog_refuel/config.cpp new file mode 100644 index 0000000000..793cf90fc4 --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"loadorder_f_vietnam", "ace_refuel"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_sog/compat_sog_refuel/script_component.hpp b/addons/compat_sog/compat_sog_refuel/script_component.hpp new file mode 100644 index 0000000000..af997fb8d4 --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT refuel +#define SUBCOMPONENT_BEAUTIFIED refuel +#include "..\script_component.hpp" diff --git a/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp b/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..de93243251 --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp @@ -0,0 +1,141 @@ +class CfgVehicles { + // Vehicle animation interactions + // M39 / M54 / M49 + class vn_wheeled_truck_base; + class vn_wheeled_m54_base: vn_wheeled_truck_base { + class EGVAR(interaction,anims) { + class user_sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class vn_wheeled_m54_mg_01_base: vn_wheeled_m54_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_sparewheel_hide: user_sparewheel_hide { + items[] = {"ACE_Wheel", "ACE_Wheel", "ACE_Wheel", "ACE_Wheel"}; + }; + }; + }; + + // M151 + class vn_wheeled_car_base; + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // Dirt Ranger + class vn_wheeled_lr2a_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class hide_sparewheel { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // BTR-40 + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_tracks { + // Rotate interactions with turret rotation + positions[] = { + "[[1.3, 0.2, -0.5], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D", + "[[-1.3, 0.2, -0.5], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D" + }; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + positions[] = {{1.35, 2.5, -0.5}}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + class vn_armor_btr50pk_01_base: vn_armor_btr50pk_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tracks: hide_tracks { + positions[] = {{1.35, 2.5, -0.8}}; + }; + }; + }; + + class vn_armor_btr50pk_02_base: vn_armor_btr50pk_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tracks: hide_tracks { + positions[] = {{1.35, 2.9, -0.8}}; + }; + }; + }; + + // T-54 + class vn_armor_t54_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + positions[] = {{1.4, 2.1, -1.7}}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + // Rotate interactions with turret rotation + positions[] = {"[0, 0.9, 0] vectorAdd ([[-0.6, -0.9, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + // Rotate interactions with turret rotation + positions[] = {"[0, 0.7, 0] vectorAdd ([[0.4, -1.1, -0.4], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_sog/compat_sog_repair/config.cpp b/addons/compat_sog/compat_sog_repair/config.cpp new file mode 100644 index 0000000000..b2cffd8a36 --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"loadorder_f_vietnam", "ace_repair"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_sog/compat_sog_repair/script_component.hpp b/addons/compat_sog/compat_sog_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp b/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp index bb222eaed1..bc67a39f78 100644 --- a/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp +++ b/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp @@ -60,4 +60,199 @@ class CfgVehicles { class EGVAR(compat_sog,spiderhole_03_nogeo): vn_o_vc_spiderhole_03 { scope = 1; }; + + // Vehicle animation interactions + // BTR-40 + class vn_wheeled_car_base; + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class shovel_hide { + positions[] = {{0.95, -1.5, -0.75}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_wheeled_btr40_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.3}}; + }; + }; + }; + class vn_wheeled_btr40_ambulance_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.3}}; + }; + }; + }; + class vn_wheeled_btr40_mg_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.8}}; + }; + }; + }; + class vn_wheeled_btr40_mg_03_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{1.05, -1.55, -1.1}}; + }; + }; + }; + class vn_wheeled_btr40_mg_04_base: vn_wheeled_btr40_mg_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.85}}; + }; + }; + }; + class vn_wheeled_btr40_mg_05_base: vn_wheeled_btr40_mg_04_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.9, -1.4, -0.85}}; + }; + }; + }; + + // Dirt Ranger + class vn_wheeled_lr2a_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // M151 + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_shovel_hide { + positions[] = {{0.65, 0.2, -1.4}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_wheeled_m151_mg_03_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + positions[] = {{0.35, 0.2, -1.27}}; + }; + }; + }; + class vn_wheeled_m151_mg_05_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + enabled = 0; + }; + }; + }; + class vn_wheeled_m151_mg_06_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + enabled = 0; + }; + }; + }; + class vn_wheeled_m151_01_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + positions[] = {{0.72, 0.2, -0.92}}; + }; + }; + }; + + // M113 + class APC_Tracked_01_base_F; + class vn_armor_m113_base: APC_Tracked_01_base_F { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {{0.2, 2.2, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_armor_m113_01_base: vn_armor_m113_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_shovel: hide_shovel {}; + }; + }; + class vn_armor_m132_base: vn_armor_m113_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_shovel: hide_shovel { + positions[] = {{0.2, 2.2, -0.35}}; + }; + }; + }; + + // Don't inherit, as it's easier for the refuel compat + // M577 + class vn_armor_m577_base: vn_armor_m113_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {{0.2, 5.05, -0.57}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_tools { + positions[] = {"_target selectionPosition ['hide_tools', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool", "ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; }; diff --git a/addons/compat_spe/CfgVehicles/wheeled.hpp b/addons/compat_spe/CfgVehicles/wheeled.hpp index 6ed68dfbdf..f645db29e6 100644 --- a/addons/compat_spe/CfgVehicles/wheeled.hpp +++ b/addons/compat_spe/CfgVehicles/wheeled.hpp @@ -56,8 +56,12 @@ class SPE_OpelBlitz_Ammo: SPE_OpelBlitz_base { EGVAR(rearm,defaultSupply) = 1200; }; -// WHEELED - ALLIED FORCES +class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { + EGVAR(refuel,hooks)[] = {{-0.23, -2.58, -0.59}}; + EGVAR(refuel,fuelCargo) = 2000; +}; +// WHEELED - ALLIED FORCES class SPE_US_M3_Halftrack_Ambulance: SPE_Halftrack_base { EGVAR(medical,medicClass) = 1; }; @@ -69,3 +73,69 @@ class SPE_US_M3_Halftrack_Repair: SPE_Halftrack_base { class SPE_US_M3_Halftrack_Ammo: SPE_Halftrack_base { EGVAR(rearm,defaultSupply) = 1200; }; + +class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { + EGVAR(refuel,hooks)[] = {{-0.23, -2.58, -0.59}}; + EGVAR(refuel,fuelCargo) = 2000; +}; + +class SPE_Car_base; +class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_musette_source { + positions[] = {{0.8, -0.97, -0.6}, {-0.8, -0.92, -0.6}}; + items[] = {"B_SPE_US_M36", "B_SPE_US_M36"}; + name = "$STR_CTH_B_SPE_US_M36"; + text = "$STR_CTH_B_SPE_US_M36"; + }; + }; +}; +class SPE_US_G503_MB_M1919_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M1919_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M1919_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_G503_MB_Ambulance_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp index 7c1945fcb8..810a5bc5bf 100644 --- a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp +++ b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp @@ -1,9 +1,8 @@ class CfgMagazines { class SPE_Mine_Magazine; class SPE_US_TNT_4pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(4LBTNT); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(4LBTNT); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -19,9 +18,8 @@ class CfgMagazines { }; class SPE_US_TNT_half_pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(halfLBTNT); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(halfLBTNT); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -37,9 +35,8 @@ class CfgMagazines { }; class SPE_US_Bangalore_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bangalore); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bangalore); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -55,9 +52,8 @@ class CfgMagazines { }; class SPE_Ladung_Small_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(smallLadung); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(smallLadung); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -73,9 +69,8 @@ class CfgMagazines { }; class SPE_Ladung_Big_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bigLadung); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bigLadung); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -91,8 +86,8 @@ class CfgMagazines { }; class SPE_US_M1A1_ATMINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M1A1at); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M1A1at); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -102,8 +97,8 @@ class CfgMagazines { }; }; class SPE_US_M3_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M3ap); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M3ap); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -113,8 +108,8 @@ class CfgMagazines { }; }; class SPE_US_M3_Pressure_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M3Pressure); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M3Pressure); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -125,8 +120,8 @@ class CfgMagazines { }; class SPE_Shg24x7_Improvised_Mine_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(Shg24x7); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(Shg24x7); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -137,8 +132,8 @@ class CfgMagazines { }; class SPE_TMI_42_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(TMI42); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(TMI42); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -149,8 +144,8 @@ class CfgMagazines { }; class SPE_SMI_35_1_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35_1); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35_1); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -161,8 +156,8 @@ class CfgMagazines { }; class SPE_SMI_35_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -173,8 +168,8 @@ class CfgMagazines { }; class SPE_SMI_35_Pressure_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35Pressure); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35Pressure); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -185,8 +180,8 @@ class CfgMagazines { }; class SPE_STMI_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(STMI); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(STMI); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -197,8 +192,8 @@ class CfgMagazines { }; class SPE_shumine_42_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(shumine42); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(shumine42); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; diff --git a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp index fc1ebc9b4e..8819f20559 100644 --- a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp @@ -1,12 +1,57 @@ class CfgVehicles { - class SPE_Halftrack_base; - class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { - EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; - EGVAR(refuel,fuelCargo) = 2000; + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_jerry_can_source { + positions[] = {"_target selectionPosition ['hide_jerry_can', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; }; - class SPE_OpelBlitz_base; - class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { - EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; - EGVAR(refuel,fuelCargo) = 2000; + + class SPE_Truck_base; + class SPE_CCKW_353_Base: SPE_Truck_base { + class EGVAR(interaction,anims) { + class spare_fuel_hide_source { + positions[] = {{0.8, 1.8, -1}, {-0.8, 1.8, -1}, {0.8, 3.5, -1}, {-0.8, 3.5, -1}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class SPE_CCKW_353_Ammo: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.8, -0.85}, {-0.8, 1.8, -0.85}, {0.8, 3.5, -0.85}, {-0.8, 3.5, -0.85}}; + }; + }; + }; + class SPE_CCKW_353_Repair: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.9, -0.85}, {-0.8, 1.9, -0.85}, {0.8, 3.6, -0.85}, {-0.8, 3.6, -0.85}}; + }; + }; + }; + class SPE_CCKW_353_Fuel: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.25, -0.8}, {-0.8, 1.25, -0.8}, {0.8, 2.95, -0.8}, {-0.8, 2.95, -0.8}, {0.8, -1, -0.3}, {-0.8, -1, -0.3}}; + items[] = { // 32x + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F" + }; + }; + }; }; }; diff --git a/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp b/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..2f20e427d8 --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp @@ -0,0 +1,120 @@ +class CfgVehicles { + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_spare_wheel_source { + positions[] = {"_target selectionPosition ['hide_spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class SPE_Truck_base; + class SPE_CCKW_353_Base: SPE_Truck_base { + class EGVAR(interaction,anims) { + class spare_wheel_hide_source { + positions[] = {{-0.9, 0.35, -0.95}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class SPE_CCKW_353_Ammo: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, 0.35, -0.8}}; + }; + }; + }; + class SPE_CCKW_353_Repair: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, 0.43, -0.75}}; + }; + }; + }; + class SPE_CCKW_353_Fuel: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, -0.2, -0.7}}; + }; + }; + }; + + class SPE_R200_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_spare_wheel_source { + positions[] = {"_target selectionPosition ['hide_sparetire', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class SPE_Tank_base; + class SPE_M18_Hellcat_Base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hull_armour_hide_source { + positions[] = {"_target selectionPosition ['spare_track_hull', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_PzKpfwV_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class spare_tracks_hide_source { + selections[] = {"spare_tracks"}; + positions[] = {"private _pos = _target selectionPosition 'spare_tracks'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_PzKpfwVI_H1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hull_armour_hide_source { + positions[] = {{-1.3, 1.7, -0.75}, {1.1, 1.7, -0.75}, {-0.05, 2.35, -1.5}}; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class turret_armour_hide_source { + // Rotate interactions with turret rotation + positions[] = { + "[0, -0.6, 0] vectorAdd ([[1.2, 0, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -0.6, 0] vectorAdd ([[-1.3, -0.3, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_Jagdpanther_G1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_spare_tracks_left_source { + positions[] = {"private _pos = _target selectionPosition ['hide_spare_tracks_right', 'FireGeometry', 'AveragePoint']; _pos set [0, -(_pos select 0)]; _pos vectorAdd [0, 0.335, 0]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class hide_spare_tracks_right_source { + positions[] = {"_target selectionPosition ['hide_spare_tracks_right', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_repair/config.cpp b/addons/compat_spe/compat_spe_repair/config.cpp new file mode 100644 index 0000000000..356ef6a6be --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "ww2_spe_assets_c_weapons_infantryweapons_c", + "ww2_spe_assets_c_vehicles_staticweapons_c", + "ww2_spe_assets_c_vehicles_weapons_c", + "ww2_spe_core_f_system_staticweapons_f", + "ww2_spe_core_c_core_c_eventhandlers", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_spe/compat_spe_repair/script_component.hpp b/addons/compat_spe/compat_spe_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp b/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp new file mode 100644 index 0000000000..bb4b78721d --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp @@ -0,0 +1,119 @@ +class CfgVehicles { + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_tools_source { + positions[] = {{-0.7, 0, -0.9}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class SPE_US_G503_MB_M1919_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M1919_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M1919_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_G503_MB_Ambulance_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + + class SPE_R200_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_shovel_source { + positions[] = {{0.5, 1.2, -1.05}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + class SPE_Tank_base; + class SPE_PzKpfwV_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class tools_hide_source { + positions[] = {{-1.45, 0.7, -0.4}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_PzKpfwVI_H1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class tools_hide_source { + positions[] = {{0, 1, -0.6}, {1.1, 0.1, -0.6}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_StuG_III_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_tools_left_source { + positions[] = {{-1.4, -1.4, -0.7}, {-1, -2.2, -0.65}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_Jagdpanther_G1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_tools_left_source { + positions[] = {{-1.4, 0.5, -0.7}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_trenches/config.cpp b/addons/compat_spe/compat_spe_trenches/config.cpp new file mode 100644 index 0000000000..1b742b5782 --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "ww2_spe_assets_c_weapons_infantryweapons_c", + "ww2_spe_assets_c_vehicles_staticweapons_c", + "ww2_spe_assets_c_vehicles_weapons_c", + "ww2_spe_core_f_system_staticweapons_f", + "ww2_spe_core_c_core_c_eventhandlers", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_spe/compat_spe_trenches/script_component.hpp b/addons/compat_spe/compat_spe_trenches/script_component.hpp new file mode 100644 index 0000000000..10b90eb71e --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_ws/CfgVehicles.hpp b/addons/compat_ws/CfgVehicles.hpp new file mode 100644 index 0000000000..98dc922d98 --- /dev/null +++ b/addons/compat_ws/CfgVehicles.hpp @@ -0,0 +1,27 @@ +class CfgVehicles { + // Vehicle animation interactions + // Easier to not inherit + class Offroad_01_base_lxWS; + class Offroad_01_armor_base_lxWS: Offroad_01_base_lxWS { + class EGVAR(interaction,anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.17, -0.66}, {1.05, -1.17, -0.66}, {1.05, -2.52, -0.66}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class Offroad_01_AT_lxWS; + class Offroad_01_armor_AT_lxWS: Offroad_01_AT_lxWS { + class EGVAR(interaction,anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.27, -0.66}, {1.05, -1.27, -0.66}, {1.05, -2.62, -0.66}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp index fe1aed7e17..5396b8f186 100644 --- a/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp @@ -57,4 +57,173 @@ class CfgVehicles { class B_ION_Heli_Light_02_unarmed_lxWS: O_Heli_Light_02_unarmed_F { displayName = SUBCSTRING(heli_light_02_unarmed_Name); }; + + #include "CfgVehiclesAttachments.hpp" + + // AA12 + class Weapon_Base_F; + class Weapon_sgun_aa40_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Name); + }; + class Weapon_sgun_aa40_tan_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Tan_Name); + }; + class Weapon_sgun_aa40_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Snake_Name); + }; + + // Galil ARM + class Weapon_arifle_Galat_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Galat_Name); + }; + class Weapon_arifle_Galat_worn_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Galat_Old_Name); + }; + + // GLX 160 + class Weapon_glaunch_GLX_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Name); + }; + class Weapon_glaunch_GLX_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Snake_Name); + }; + class Weapon_glaunch_GLX_hex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Hex_Name); + }; + class Weapon_glaunch_GLX_ghex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_GreenHex_Name); + }; + class Weapon_glaunch_GLX_camo_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Camo_Name); + }; + class Weapon_glaunch_GLX_tan_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Tan_Name); + }; + + // Mk14 Mod 1 EBR + class Weapon_srifle_EBR_blk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(EBR_Black_Name); + }; + class Weapon_srifle_EBR_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(EBR_Snake_Name); + }; + + // Vektor SS-77 + class Weapon_LMG_S77_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Name); + }; + class Weapon_LMG_S77_AAF_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_AAF_Name); + }; + class Weapon_LMG_S77_Hex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Hex_Name); + }; + class Weapon_LMG_S77_GHex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_GreenHex_Name); + }; + class Weapon_LMG_S77_Desert_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Desert_Name); + }; + + // Vektor SS-77 (Compact) + class Weapon_LMG_S77_Compact_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Compact_Name); + }; + class Weapon_LMG_S77_Compact_Snakeskin_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Compact_Snake_Name); + }; + + // FN FAL (Wood) - Closest match is the 50.00 + class Weapon_arifle_SLR_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Wood_Name); + }; + class Weapon_arifle_SLR_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_GL_Wood_Name); + }; + + // FN FAL + class Weapon_arifle_SLR_V_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Name); + }; + class Weapon_arifle_SLR_V_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_GL_Name); + }; + class Weapon_arifle_SLR_D_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Desert_Name); + }; + class Weapon_arifle_SLR_V_camo_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Camo_Name); + }; + class Weapon_arifle_SLR_Para_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Para_Name); + }; + class Weapon_arifle_SLR_Para_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Para_Snake_Name); + }; + + // Vektor R4/R5 + class Weapon_arifle_Velko_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R4_Name); + }; + class Weapon_arifle_VelkoR5_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_Name); + }; + class Weapon_arifle_VelkoR5_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_GL_Name); + }; + class Weapon_arifle_VelkoR5_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_Snake_Name); + }; + class Weapon_arifle_VelkoR5_GL_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_GL_Snake_Name); + }; + + // XMS has no realistic name as it's a make believe hybrid of the XM8/VHS-K2: XM8+VHS = XMS, this just removes the 5.56 mm from the name. + class Weapon_arifle_XMS_Base_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Name); + }; + class Weapon_arifle_XMS_Base_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Khaki_Name); + }; + class Weapon_arifle_XMS_Base_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Sand_Name); + }; + class Weapon_arifle_XMS_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Name); + }; + class Weapon_arifle_XMS_GL_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Khaki_Name); + }; + class Weapon_arifle_XMS_GL_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Sand_Name); + }; + class Weapon_arifle_XMS_Shot_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Name); + }; + class Weapon_arifle_XMS_Shot_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Khaki_Name); + }; + class Weapon_arifle_XMS_Shot_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Sand_Name); + }; + class Weapon_arifle_XMS_M_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SW_Name); + }; + class arifle_XMS_M_khk_lxWS: Weapon_Base_F { + diWeapon_splayName = SUBCSTRING(XMS_SW_Khaki_Name); + }; + class Weapon_arifle_XMS_M_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SW_Sand_Name); + }; + + // GM6 Lynx + class Weapon_srifle_GM6_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(gm6_snake_Name); + }; + + // RPG-32 + class Launcher_Base_F; + class Weapon_launch_RPG32_tan_lxWS: Launcher_Base_F { + displayName = SUBCSTRING(rpg32_tan_Name); + }; }; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp new file mode 100644 index 0000000000..5dbeab9bc4 --- /dev/null +++ b/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp @@ -0,0 +1,71 @@ +// Attachments +class Item_Base_F; +class Item_optic_arco_hex_lxWS: Item_Base_F { + displayName = SUBCSTRING(arco_hex_Name); +}; + +class Item_optic_Holosight_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(holosight_snake_Name); +}; + +class Item_optic_Holosight_smg_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(holosight_snake_smg_Name); +}; + +class Item_optic_Hamr_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_arid_Name); +}; +class Item_optic_Hamr_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_lush_Name); +}; +class Item_optic_Hamr_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_sand_Name); +}; +class Item_optic_Hamr_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_snake_Name); +}; + +class Item_optic_r1_high_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_black_Name); +}; +class Item_optic_r1_high_khaki_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_khaki_Name); +}; +class Item_optic_r1_high_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_sand_Name); +}; +class Item_optic_r1_high_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_snake_Name); +}; +class Item_optic_r1_high_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_arid_Name); +}; +class Item_optic_r1_high_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_lush_Name); +}; +class Item_optic_r1_high_black_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_black_sand_Name); +}; + +class Item_optic_r1_low_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_black_Name); +}; +class Item_optic_r1_low_khaki_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_khaki_Name); +}; +class Item_optic_r1_low_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_sand_Name); +}; +class Item_optic_r1_low_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_snake_Name); +}; +class Item_optic_r1_low_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_arid_Name); +}; +class Item_optic_r1_low_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_lush_Name); +}; + +class Item_optic_DMS_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(dms_snake_Name); +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp index e9cf3c6934..b1929a4904 100644 --- a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - #include "Attachments.hpp" + #include "CfgWeaponsAttachments.hpp" // AA12 class sgun_aa40_base_lxWS; diff --git a/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp similarity index 99% rename from addons/compat_ws/compat_ws_realisticnames/Attachments.hpp rename to addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp index 95801e04e9..a805e82edc 100644 --- a/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp @@ -1,3 +1,4 @@ +// Attachments class optic_Arco; class optic_arco_hex_lxWS: optic_Arco { displayName = SUBCSTRING(arco_hex_Name); diff --git a/addons/compat_ws/compat_ws_realisticnames/config.cpp b/addons/compat_ws/compat_ws_realisticnames/config.cpp index 0eb75926a8..167e83fa35 100644 --- a/addons/compat_ws/compat_ws_realisticnames/config.cpp +++ b/addons/compat_ws/compat_ws_realisticnames/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { authors[] = {"Mike"}; url = ECSTRING(main,URL); VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); }; }; diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 606bbb7932..66c1791f9c 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -29,6 +29,7 @@ AA12 (ヘビ柄迷彩) AA12 (Змея) AA12 (Serpiente) + AA12 (Sable) Galil ARM @@ -68,6 +69,7 @@ GLX 160 (ヘビ柄迷彩) GLX 160 (Змея) GLX 160 (Serpiente) + GLX 160 GLX 160 (Hex) @@ -127,6 +129,7 @@ Mk14 Mod 1 EBR (ヘビ柄迷彩) Mk14 Mod 1 EBR (Змея) Mk14 Mod 1 EBR (Serpiente) + Mk14 Mod 1 EBR (Serpent) Vektor SS-77 @@ -195,6 +198,7 @@ ヴェクター SS-77 コンパクト (ヘビ柄迷彩) Vektor SS-77 Compact (змея) Vektor SS-77 Compacta (Serpiente) + Vektor SS-77 Compacte (Serpent) FN FAL 50.00 (Wood) @@ -262,6 +266,7 @@ FN FAL OSW 파라 FN FAL OSW Fallschirmjäger FN FAL OSW Para + FN FAL OSW Para FN FAL OSW Para (Snake) @@ -269,6 +274,7 @@ FN FAL OSW 파라 (뱀 위장) FN FAL OSW Fallschirmjäger (Schlange) FN FAL OSW Para (Serpe) + FN FAL OSW Para (Serpent) Vektor R4 @@ -308,6 +314,7 @@ ヴェクター R5 カービン (ヘビ柄迷彩) Vektor R5 Carbine (Змея) Vektor R5 Carabina (Serpiente) + Vektor R5 Carbine (Serpent) Vektor R5 Carbine GL (Snake) @@ -317,6 +324,7 @@ ヴェクター R5 カービン GL (ヘビ柄迷彩) Vektor R5 Carbine GL (Змея) Vektor R5 Carabina GL (Serpiente) + Vektor R5 Carbine GL (Serpent) XMS @@ -468,6 +476,7 @@ GM6 링스 (뱀 위장) GM6 Lynx (Schlange) GM6 Lynx (Serpe) + GM6 Lynx (Serpent) RPG-32 (Sand) @@ -475,6 +484,7 @@ RPG-32 (모래) RPG-32 (Sand) RPG-32 (Sabbia) + RPG-32 (Sable) ELCAN SpecterOS (Hex) @@ -482,6 +492,7 @@ 엘칸 스펙터OS (육각) ELCAN SpecterOS (Hex) ELCAN SpecterOS (Hex) + ELCAN SpecterOS (Hex) EOTech XPS3 (Snake) @@ -489,6 +500,7 @@ 이오텍 XPS3 (뱀 위장) EOTech XPS3 (Schlange) EOTech XPS3 (Serpe) + EOTech XPS3 (Serpent) EOTech XPS3 SMG (Snake) @@ -496,6 +508,7 @@ 이오텍 XPS3 SMG (뱀 위장) EOTech XPS3 SMG (Schlange) EOTech XPS3 SMG (Serpe) + EOTech XPS3 SMG (Serpent) Leupold Mark 4 HAMR (Arid) @@ -503,6 +516,7 @@ 류폴드 마크 4 HAMR (건조) Leupold Mark 4 HAMR (Trocken) Leupold Mark 4 HAMR (Arido) + Leupold Mark 4 HAMR (Aride) Leupold Mark 4 HAMR (Lush) @@ -510,6 +524,7 @@ 류폴드 마크 4 HAMR (초목) Leupold Mark 4 HAMR (Grün) Leupold Mark 4 HAMR (Verdeggiante) + Leupold Mark 4 HAMR (Vert) Leupold Mark 4 HAMR (Sand) @@ -517,6 +532,7 @@ 류폴드 마크 4 HAMR (모래) Leupold Mark 4 HAMR (Sand) Leupold Mark 4 HAMR (Sabbia) + Leupold Mark 4 HAMR (Sable) Leupold Mark 4 HAMR (Snake) @@ -524,6 +540,7 @@ 류폴드 마크 4 HAMR (뱀 위장) Leupold Mark 4 HAMR (Schlange) Leupold Mark 4 HAMR (Serpe) + Leupold Mark 4 HAMR (Serpent) Aimpoint Micro R-1 (High, Black) @@ -531,6 +548,7 @@ 에임포인트 마이크로 R-1 (높음, 검정) Aimpoint Micro R-1 (Hoch, Schwarz) Aimpoint Micro R-1 (Alto, Nero) + Aimpoint Micro R-1 (Haut, Noir) Aimpoint Micro R-1 (High, Khaki) @@ -538,6 +556,7 @@ 에임포인트 마이크로 R-1 (높음, 카키) Aimpoint Micro R-1 (Hoch, Khaki) Aimpoint Micro R-1 (Alto, Cachi) + Aimpoint Micro R-1 (Haut, Kaki) Aimpoint Micro R-1 (High, Sand) @@ -545,6 +564,7 @@ 에임포인트 마이크로 R-1 (높음, 모래) Aimpoint Micro R-1 (Hoch, Sand) Aimpoint Micro R-1 (Alto, Sabbia) + Aimpoint Micro R-1 (Haut, Sable) Aimpoint Micro R-1 (High, Snake) @@ -552,6 +572,7 @@ 에임포인트 마이크로 R-1 (높음, 뱀 위장) Aimpoint Micro R-1 (Hoch, Schlange) Aimpoint Micro R-1 (Alto, Serpe) + Aimpoint Micro R-1 (Haut, Serpent) Aimpoint Micro R-1 (High, Arid) @@ -559,6 +580,7 @@ 에임포인트 마이크로 R-1 (높음, 건조) Aimpoint Micro R-1 (Hoch, Trocken) Aimpoint Micro R-1 (Alto, Arido) + Aimpoint Micro R-1 (Hoch, Arid Aimpoint Micro R-1 (High, Lush) @@ -566,6 +588,7 @@ 에임포인트 마이크로 R-1 (높음, 초목) Aimpoint Micro R-1 (Hoch, Grün) Aimpoint Micro R-1 (Alto, Verdeggiante) + Aimpoint Micro R-1 (Haute, Vert) Aimpoint Micro R-1 (High, Black/Sand) @@ -573,6 +596,7 @@ 에임포인트 마이크로 R-1 (높음, 검정/모래) Aimpoint Micro R-1 (Hoch, Schwarz/Sand) Aimpoint Micro R-1 (Alto, Nero/Sabbia) + Aimpoint Micro R-1 (Haut, Noir/Sable) Aimpoint Micro R-1 (Low, Black) @@ -580,6 +604,7 @@ 에임포인트 마이크로 R-1 (낮음, 검정) Aimpoint Micro R-1 (Tief, Schwarz) Aimpoint Micro R-1 (Basso, Nero) + Aimpoint Micro R-1 (Bas, Noir) Aimpoint Micro R-1 (Low, Khaki) @@ -587,6 +612,7 @@ 에임포인트 마이크로 R-1 (낮음, 카키) Aimpoint Micro R-1 (Tief, Khaki) Aimpoint Micro R-1 (Basso, Cachi) + Aimpoint Micro R-1 (Bas, Kaki) Aimpoint Micro R-1 (Low, Sand) @@ -594,6 +620,7 @@ 에임포인트 마이크로 R-1 (낮음, 모래) Aimpoint Micro R-1 (Tief, Sand) Aimpoint Micro R-1 (Basso, Sabbia) + Aimpoint Micro R-1 ( Bas, Sable ) Aimpoint Micro R-1 (Low, Snake) @@ -601,6 +628,7 @@ 에임포인트 마이크로 R-1 (낮음, 뱀 위장) Aimpoint Micro R-1 (Tief, Schlange) Aimpoint Micro R-1 (Basso, Serpe) + Aimpoint Micro R-1 (Bas, Serpent) Aimpoint Micro R-1 (Low, Arid) @@ -608,6 +636,7 @@ 에임포인트 마이크로 R-1 (낮음, 건조) Aimpoint Micro R-1 (Tief, Trocken) Aimpoint Micro R-1 (Basso, Arido) + Aimpoint Micro R-1 (Bas, Arid) Aimpoint Micro R-1 (Low, Lush) @@ -615,6 +644,7 @@ 에임포인트 마이크로 R-1 (낮음, 초목) Aimpoint Micro R-1 (Tief, Grün) Aimpoint Micro R-1 (Basso, Verdeggiante) + Aimpoint Micro R-1 (Bas, Vert) Burris XTR II (Snake) @@ -622,6 +652,7 @@ 버리스 XTR II (뱀 위장) Burris XTR II (Schlange) Burris XTR II (Serpe) + Burris XTR II (Serpent) Badger IFV (ATGM) @@ -629,6 +660,7 @@ 뱃져 보병전투차 (대전차미사일) Badger IFV (PzAbw) Badger IFV (ATGM) + Badger IFV (ATGM) Badger IFV (Command) @@ -636,6 +668,7 @@ 뱃져 보병전투차 (지휘) Badger IFV (Kommando) Badger IFV (Comando) + Badger IFV (Commandement) Badger IFV (Mortar) @@ -643,6 +676,7 @@ 뱃져 보병전투차 (자주박격포) Badger IFV (Mörser) Badger IFV (Mortaio) + Badger IFV (mortier) KamAZ (Zu-23-2) @@ -650,6 +684,7 @@ 카마즈 (ZU-23-2) KamAZ (Zu-23-2) KamAZ (Zu-23-2) + KamAZ (Zu-23-2) KamAZ Cargo @@ -657,6 +692,7 @@ 카마즈 화물 KamAZ Fracht KamAZ Carico + KamAZ Cargo KamAZ Repair @@ -664,6 +700,7 @@ 카마즈 정비 KamAZ Instandsetzung KamAZ Riparazione + KamAZ Réparation KamAZ Racing @@ -671,6 +708,7 @@ 카마즈 경주용 KamAZ Rennlaster KamAZ da corsa + KamAZ de course KamAZ Ammo @@ -678,6 +716,7 @@ 카마즈 탄약 KamAZ Munition KamAZ Munizioni + KamAZ Munitions KamAZ Flatbed @@ -685,6 +724,7 @@ 카마즈 플랫베드 KamAZ Flachbett KamAZ Pianale + KamAZ Flatbed AW101 Merlin @@ -692,6 +732,7 @@ AW101 멀린 AW101 Merlin AW101 Merlin + AW101 Merlin BM-2T Stalker (Bumerang-BM) @@ -699,6 +740,7 @@ BM-2T 스토커 (부메랑-BM) BM-2T Stalker (Bumerang-BM) BM-2T Stalker (Bumerang-BM) + BM-2T Stalker (Boomerang-BM) Otokar ARMA (HMG) @@ -706,6 +748,7 @@ 오토카르 아르마 APC (중기관총) Otokar ARMA (HMG) Otokar ARMA (HMG) + Otokar ARMA (HMG) Otokar ARMA (Unarmed) @@ -713,6 +756,7 @@ 오토카르 아르마 APC (비무장) Otokar ARMA (Unbewaffnet) Otokar ARMA (Disarmato) + Otokar ARMA (non armé) Ka-60 Kasatka (UP) @@ -720,6 +764,7 @@ Ka-60 카사트카 (UP) Ka-60 Kasatka (UP) Ka-60 Kasatka (UP) + Ka-60 Kasatka (UP) Ka-60 Kasatka (UP, Unarmed) @@ -727,6 +772,7 @@ Ka-60 카사트카 (UP, 비무장)) Ka-60 Kasatka (UP, Unbewaffnet) Ka-60 Kasatka (UP, Disarmato) + Ka-60 Kasatka (UP, non armé) diff --git a/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp b/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp new file mode 100644 index 0000000000..d7fcbc7cd9 --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp @@ -0,0 +1,34 @@ +class CfgVehicles { + // Vehicle animation interactions + class Truck_02_base_F; + class Truck_02_aa_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.93, -0.85}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class Truck_02_cargo_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.93, -0.35}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class Truck_02_box_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.7, -0.35}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_repair/config.cpp b/addons/compat_ws/compat_ws_repair/config.cpp new file mode 100644 index 0000000000..4f37c831cb --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"data_f_lxWS_Loadorder", "ace_repair"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_ws/compat_ws_repair/script_component.hpp b/addons/compat_ws/compat_ws_repair/script_component.hpp new file mode 100644 index 0000000000..1af928486c --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp b/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp new file mode 100644 index 0000000000..ffc69d6075 --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp @@ -0,0 +1,27 @@ +class CfgVehicles { + class Car_F; + class Wheeled_APC_F: Car_F { + class Turrets { + class MainTurret; + }; + }; + class APC_Wheeled_01_base_F: Wheeled_APC_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class APC_Wheeled_01_atgm_base_lxWS: APC_Wheeled_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"autocannon_40mm_CTWS", "ACE_LMG_coax_MAG58_mem3", "missiles_titan"}; // For realistic MG name + }; + }; + }; + class APC_Wheeled_01_command_base_lxWS: APC_Wheeled_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"HMG_127_lxWS", "ACE_LMG_coax_MAG58_mem3"}; // For realistic MG name + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_vehicles/config.cpp b/addons/compat_ws/compat_ws_vehicles/config.cpp new file mode 100644 index 0000000000..07d6c1f608 --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "data_f_lxWS_Loadorder", + "ace_vehicles" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_ws/compat_ws_vehicles/script_component.hpp b/addons/compat_ws/compat_ws_vehicles/script_component.hpp new file mode 100644 index 0000000000..17370c415f --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/compat_ws/config.cpp b/addons/compat_ws/config.cpp index 32a3f6f73c..54a6df99ee 100644 --- a/addons/compat_ws/config.cpp +++ b/addons/compat_ws/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"data_f_lxWS_Loadorder"}; + requiredAddons[] = {"data_f_lxWS_Loadorder", "ace_common"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"Mike"}; @@ -15,4 +15,5 @@ class CfgPatches { }; }; +#include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf index 7fdcedda51..946cb4f7d8 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf @@ -91,7 +91,7 @@ private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname; private _ammo = getText (_configMagazine >> "ammo"); private _configAmmo = configFile >> "CfgAmmo" >> _ammo; -private _simType = toLower getText (_configAmmo >> "simulation"); +private _simType = toLowerANSI getText (_configAmmo >> "simulation"); private _speed = linearConversion [0, 1, random 1, 1, 20, true]; private _effect2pos = _object selectionPosition "destructionEffect2"; @@ -100,7 +100,7 @@ private _fnc_spawnProjectile = { // If the magazines are inside of the cargo (inventory), don't let their projectiles escape the interior of the vehicle if (!_spawnProjectile) exitWith {}; - params ["_object", "_ammo", "_speed", "_flyAway"]; + params ["_flyAway"]; private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3]; @@ -117,7 +117,7 @@ private _fnc_spawnProjectile = { _projectile setVectorDir _vectorVelocity; _projectile setVelocity _vectorVelocity; } else { - _projectile setDamage 1; + triggerAmmo _projectile; }; }; @@ -126,14 +126,14 @@ switch (_simType) do { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.6) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotshell": { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.15) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotgrenade": { @@ -141,7 +141,7 @@ switch (_simType) do { _speed = 0; }; - [_object, _ammo, _speed, random 1 < 0.5] call _fnc_spawnProjectile; + (random 1 < 0.5) call _fnc_spawnProjectile; }; case "shotrocket"; case "shotmissile"; @@ -149,7 +149,7 @@ switch (_simType) do { if (random 1 < 0.1) then { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; } else { createVehicle ["ACE_ammoExplosionLarge", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; }; @@ -157,22 +157,13 @@ switch (_simType) do { case "shotdirectionalbomb"; case "shotmine": { if (random 1 < 0.5) then { - // Not all explosives detonate on destruction, some have scripted alternatives - if (getNumber (_configAmmo >> "triggerWhenDestroyed") != 1) then { - _ammo = getText (_configAmmo >> QEGVAR(explosives,explosive)); - }; - - // If a scripted alternative doesn't exist use generic explosion - if (_ammo != "") then { - [_object, _ammo, 0, false] call _fnc_spawnProjectile; - } else { - createVehicle ["SmallSecondary", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; - }; + // _speed should be 0, but as it doesn't fly away, no need to set _speed + false call _fnc_spawnProjectile; }; }; case "shotilluminating": { if (random 1 < 0.15) then { - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; }; }; }; diff --git a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf index df4385d30d..35ca6fae26 100644 --- a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -52,7 +52,7 @@ private _ammo = ""; _x params ["_magazine", "_count"]; if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then { - _ammoToDetonate pushBack [_magazine, _count, false]; + _ammoToDetonate pushBack [_magazine, _count, random 1 < 0.5]; _totalAmmo = _totalAmmo + _count; }; } forEach (magazinesAmmoCargo _object); diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 15d2d2adec..838b3490bb 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -23,6 +23,7 @@ 차량 유폭 화재를 활성화합니다 Abilita incendio dei veicoli Aktiviert Fahrzeug Munitionsbrand + Permettre l'incendie du véhicule Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. @@ -31,6 +32,7 @@ 차량 유폭 효과를 활성화합니다.\n여기엔 탄약 유폭이 포함되지 않습니다. Abilita effetti di incendio del veicolo dovuto all'esplosione delle munizioni.\nQuesto non include gli effetti di esplosione. Aktiviert Fahrzeug Brandeffekte durch Durchzündung.\nExplosionseffekte sind nicht mit einbegriffen. + Permet d'obtenir des effets de feu de véhicule à partir de munitions qui explosent.\nCela n'inclut pas les effets d'explosion. Vehicle cook-off fire duration multiplier @@ -39,6 +41,7 @@ 차량 유폭 화재 지속 시간 계수 Coefficiente di durata incendio dei veicoli Fahrzeugbrand Dauer-Multiplikator + Coefficient de durée d'incendie du véhicule Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. @@ -47,6 +50,7 @@ 차량 유폭 화재가 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량 쿸오프 화재가 비활성화됩니다. Coefficiente di durata degli incendi dei veicoli.\nImpostarlo su 0 disabilita incendi dei veicoli. Multiplikator der Fahrzeugbrand Dauer.\nIhn auf 0 zu setzen wird Munitionsbrände deaktivieren. + Coefficient de durée des feux de véhicules.\nLa valeur 0 désactive les feux de véhicules. Vehicle cook-off fire probability multiplier @@ -55,6 +59,7 @@ 차량 유폭 화재 확률 계수 Probabilità di incendio dei veicoli Fahrzeug Munitionsbrand Wahrscheinlichkeit-Multiplikator + Probabilité d'incendies de véhicules Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. @@ -63,6 +68,7 @@ 차량 유폭 화재 확률에 대한 계수입니다. 값이 높을 수록 유폭 확률이 높아집니다.\n0으로 설정하면 차량 유폭 화재가 비활성화됩니다. Coefficiente di probabilità degli incendi dei veicoli.\nValori maggiori aumentano la probabilità di incendi.\nImpostarlo su 0 disabilita incendi dei veicoli. Multiplikator der Fahrzeugbrand Wahrscheinlichkeit.\nHöhere Werte erhöhen die Wahrscheinlichkeit.\nEin Null-Wert wird Munitionsbrände deaktivieren. + Coefficient de probabilité des incendies de véhicules.\nLes valeurs élevées augmentent la probabilité des incendies.\nLa valeur 0 désactive les incendies de véhicules. Destroy vehicles after cook-off @@ -96,6 +102,7 @@ 차량 내 탄약 유폭 활성화 Abilita esplosioni delle munizioni dei veicoli Aktiviert Fahrzeug Munitionsdurchzündung + Permet l'explosion des munitions des véhicules Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. @@ -104,6 +111,7 @@ 차량 내 탄약 유폭을 활성화합니다. 차량에 탄약이 남아 있는 동안 탄약 발사체를 발사합니다.\n여기엔 화재 효과가 포함되지 않습니다. Abilita l'esplosione delle munizioni dei veicoli. Spara via pezzi di munizioni se il veicolo ha ancora munizioni rimanenti.\nNon include gli effetti di fuoco. Aktiviert Durchzündung von Fahrzeugmunition. Schleudert Munitionsfragmente umher wenn das Fahrzeug noch Munition an Bord hat.\nBrandeffekte sind nicht mit einbegriffen. + Permet l'explosion des munitions du véhicule. Tire des morceaux de munitions si le véhicule a encore des munitions restantes.\nIl n'y a pas d'effets de feu. Enable ammo box cook-off @@ -127,6 +135,7 @@ 탄약 상자 유폭을 활성화합니다.\n여기엔 화재 효과가 포함되지 않습니다. Abilita esplosioni delle casse di munizioni.\nNon include effetti di fuoco. Aktiviert Munitionskisten Durchzündung.\nBrandeffekte sind nicht mit einbegriffen. + Permet l'explosion des caisses de munitions.\nN'inclut pas les effets de feu. Ammo cook-off duration multiplier @@ -135,6 +144,7 @@ 탄약 유폭 시간 계수 Coefficiente di durata esplisioni di munizioni Fahrzeug Munitionsdurchzündung Dauer-Multiplikator + Coefficient de durée d'explosion des munitions Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. @@ -143,6 +153,7 @@ 차량과 탄약 상자 모두에 대해 탄약 유폭이 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량과 탄약 상자 모두에 대해 탄약 유폭이 비활성화됩니다. Coefficiente della durata di esplosioni delle munizioni, sia per veicoli che casse.\nImpostarlo su 0 disabilita esplosioni di veicoli e casse. Multiplikator der Munitionsdurchzündungs-Dauer, gilt für Fahrzeuge und Munitionskisten.\nIhn auf 0 zu setzen wird Durchzünden deaktivieren. + Coefficient de durée d'explosion des munitions pour les véhicules et les caisses.\nLa valeur 0 désactive les explosions des véhicules et des caisses. Enable ammo removal during cook-off diff --git a/addons/csw/CfgMagazines.hpp b/addons/csw/CfgMagazines.hpp index 86ad73c58f..2466bbe696 100644 --- a/addons/csw/CfgMagazines.hpp +++ b/addons/csw/CfgMagazines.hpp @@ -58,6 +58,7 @@ class CfgMagazines { class GVAR(20Rnd_20mm_G_belt): 40Rnd_20mm_G_belt { author = ECSTRING(common,ACETeam); displayName = CSTRING(GMGBelt_displayName); + descriptionShort = CSTRING(GMGBelt_descriptionShort); model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; picture = QPATHTOF(UI\ammoBox_50bmg_ca.paa); type = 256; diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 7d9917daa7..137dc95334 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -16,7 +16,7 @@ private _inherited = []; private _config = _x; private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1; if (_configEnabled) then { - private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1; + private _configExplicit = (count configProperties [_config, toString {configName _x == QUOTE(ADDON)}, false]) == 1; if (_configExplicit) then { _explicitBases pushBack (configName _config); _inherited pushBack []; @@ -43,8 +43,8 @@ private _inherited = []; INFO("------ Logging static magazines with no carry version -------"); private _hash = createHashMap; -// private _logAll = true; // logs all possible weapon magazines (even if not used in a static weapon) -private _logAll = false; +private _logAll = false; // logs all possible weapon magazines (even if not used in a static weapon) when set to true + { private _vehicleType = configName _x; private _turretConfig = [_vehicleType, [0]] call CBA_fnc_getTurret; diff --git a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf index 5230fccf52..f3a6bbde5f 100644 --- a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf +++ b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Helper function for ace_rearm; Gets magazines that should be loaded by csw + * Helper function for ace_rearm; Gets magazines that should be loaded by csw. * * Arguments: - * 0: Vehicle - * 1: Specific Turret or pass bool to check all turrets (default: true) + * 0: CSW + * 1: Specific Turret or pass bool to check all turrets (default: true) * * Return Value: * [0: compatible veh mags, 1: carry mags] diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index d92e517091..6f7a645257 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles AI Fired EH + * Handles AI Fired EH. * * Arguments: * Fired EH diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index f14a4ccbc7..14b4453f53 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Grim - * Handles AI GetIn on an empty weapon + * Author: LinkIsGrim + * Handles AI GetIn on an empty CSW. * * Arguments: * GetIn EH diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index 4d6234f94a..288d718a2f 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror, modified by Grim - * Handles AI reloading + * Author: PabstMirror, LinkIsGrim + * Handles AI reloading. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Gunner * 2: Weapon * 3: Magazine (default: "") @@ -15,7 +15,7 @@ * Public: No */ -params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]]; +params ["_vehicle", "_gunner", "_weapon", ["_magazine", ""]]; private _turretPath = [_gunner] call EFUNC(common,getTurretIndex); private _reloadSource = objNull; @@ -24,7 +24,7 @@ private _reloadNeededAmmo = -1; private _cfgMagGroups = configFile >> QGVAR(groups); -private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { +private _nearSupplies = [_gunner] + ((_vehicle nearSupplies 10) select { isNull (group _x) || {!([_x] call EFUNC(common,isPlayer)) && {[side group _gunner, side group _x] call BIS_fnc_sideIsFriendly}} }); @@ -49,7 +49,7 @@ private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { private _xWeaponMag = _x; { if ((getNumber (_cfgMagGroups >> _x >> _xWeaponMag)) == 1) then { - private _loadInfo = [_staticWeapon, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); + private _loadInfo = [_vehicle, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); if (_loadInfo select 0) then { _reloadMag = _x; _reloadSource = _xSource; @@ -81,16 +81,16 @@ if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; [_reloadSource, _reloadMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); private _timeToLoad = 1; -if (!isNull(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime")) then { - _timeToLoad = getNumber(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime"); +if (!isNull(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime")) then { + _timeToLoad = getNumber(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"); }; TRACE_1("Reloading in progress",_timeToLoad); [{ - params ["_staticWeapon", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; - if ((!alive _staticWeapon) || {!alive _gunner} || {(_staticWeapon distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; + params ["_vehicle", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; + if ((!alive _vehicle) || {!alive _gunner} || {(_vehicle distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; // Reload the static weapon - TRACE_5("calling addTurretMag event",_staticWeapon,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); + TRACE_5("calling addTurretMag event",_vehicle,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); [QGVAR(addTurretMag), _this] call CBA_fnc_globalEvent; -}, [_staticWeapon, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; +}, [_vehicle, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 65dd81cc41..6dd58fe4fb 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if you can deploy a weapon on the tripod + * Checks if you can deploy a weapon on the tripod. * * Arguments: - * 0: Target Tripod + * 0: Target * 1: Player * * Return Value: - * Wether or not you can deploy the weapon + * Whether or not you can deploy the weapon * * Example: * [cursorObject, player] call ace_csw_fnc_assemble_canDeployWeapon diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 0d508bfa89..3228373b40 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -1,23 +1,23 @@ #include "..\script_component.hpp" /* * Author: tcvm - * If the CSW is mounted or in use this will not allow you to dismount the weapon + * If the CSW is mounted or in use this will not allow you to dismount the weapon. * * Arguments: - * 0: Static Weapon + * 0: CSW * * Return Value: - * Can Dismount + * Can dismount weapon * * Example: - * [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon + * cursorObject call ace_csw_fnc_assemble_canPickupWeapon * * Public: No */ -params ["_staticWeapon"]; +params ["_vehicle"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] -private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); +private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); -_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return +_assemblyMode && {alive _vehicle} && {((crew _vehicle) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index 29cc4b5876..c69d618066 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the tripod + * Deploys the tripod. * * Arguments: * 0: Unit @@ -10,7 +10,7 @@ * None * * Example: - * [player] call ace_csw_fnc_assemble_deployTripod + * player call ace_csw_fnc_assemble_deployTripod * * Public: No */ @@ -34,7 +34,7 @@ _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); - private _tripodClassname = getText(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); + private _tripodClassname = getText (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); // Create a tripod private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; @@ -96,6 +96,6 @@ } forEach _secondaryWeaponInfo; }; - private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponInfo], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index 974bf03431..a0e0acdd28 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the current CSW + * Deploys the current CSW. * * Arguments: * 0: Target - * 1: Unit + * 1: Player * 2: Args * 3: Action Data * diff --git a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf index 85b1346415..f98978195d 100644 --- a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Modifies interaction for deploying weapon + * Modifies interaction for deploying weapon. * * Arguments: * 0: Target @@ -21,7 +21,7 @@ params ["_target", "_player", "", "_actionData"]; private _carryWeaponClassname = secondaryWeapon _player; -private _assembleTo = (getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))); +private _assembleTo = getText (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target); private _icon = getText (configFile >> "CfgVehicles" >> _assembleTo >> "picture"); TRACE_2("",_assembleTo,_icon); diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 0996c0f3d3..c09400a87f 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Picks up the tripod and adds it to the player launcher slot + * Picks up the tripod and adds it to the player launcher slot. * * Arguments: * 0: Tripod - * 1: Unit + * 1: Player * * Return Value: * None @@ -56,7 +56,7 @@ if (isNull _weaponHolder || {_tripodPos distance _weaponHolder > 2}) then { _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below }; _weaponHolder addWeaponCargoGlobal [_tripodClassname, 1]; diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 468f385efa..65dc5fa740 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Dismounts the weapon from the tripod and drops its backpack beside + * Dismounts the weapon from the tripod and drops its backpack beside. * * Arguments: - * 0: Static Weapon - * 1: Unit + * 0: CSW + * 1: Player * * Return Value: * None @@ -17,10 +17,10 @@ */ [{ - params ["_staticWeapon", "_player"]; - TRACE_2("assemble_pickupWeapon",_staticWeapon,_player); + params ["_vehicle", "_player"]; + TRACE_2("assemble_pickupWeapon",_vehicle,_player); - private _weaponConfig = configOf _staticWeapon >> QUOTE(ADDON); + private _weaponConfig = configOf _vehicle >> QUOTE(ADDON); private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { @@ -37,15 +37,15 @@ private _onDisassembleFunc = getText (_weaponConfig >> "disassembleFunc"); private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); - TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); + TRACE_4("",typeOf _vehicle,_carryWeaponClassname,_turretClassname,_pickupTime); private _onFinish = { params ["_args"]; - _args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; - TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname); + _args params ["_vehicle", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; + TRACE_4("disassemble finish",_vehicle,_player,_carryWeaponClassname,_turretClassname); - private _weaponPos = (getPosATL _staticWeapon) vectorAdd [0, 0, 0.1]; - private _weaponDir = getDir _staticWeapon; + private _weaponPos = (getPosATL _vehicle) vectorAdd [0, 0, 0.1]; + private _weaponDir = getDir _vehicle; private _carryWeaponMag = []; private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; @@ -64,7 +64,7 @@ TRACE_2("Removing ammo",_xMag,_carryMag); [_player, _carryMag, _xAmmo] call FUNC(reload_handleReturnAmmo); }; - } forEach (magazinesAllTurrets _staticWeapon); + } forEach (magazinesAllTurrets _vehicle); if (_turretClassname isNotEqualTo "") then { private _cswTripod = createVehicle [_turretClassname, [0, 0, 0], [], 0, "NONE"]; @@ -76,7 +76,7 @@ _cswTripod setVelocity [0, 0, -0.05]; _cswTripod setVectorUp (surfaceNormal _weaponPos); }, [_cswTripod, _weaponDir, _weaponPos]] call CBA_fnc_execNextFrame; - [_cswTripod, _staticWeapon] call (missionNamespace getVariable _onDisassembleFunc); + [_cswTripod, _vehicle] call (missionNamespace getVariable _onDisassembleFunc); }; [{ @@ -99,7 +99,7 @@ // Create a new weapon holder (don't try to get an existing one, as no guarantee where it could be) private _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", _carryWeaponMag, [], ""], 1]; }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag, _turretClassname]] call CBA_fnc_execNextFrame; @@ -108,23 +108,23 @@ // Eject dead units (all crew are dead or UAV at this point, otherwise condition would have failed), but ignore UAV units { if (unitIsUAV _x) then { - _staticWeapon deleteVehicleCrew _x; + _vehicle deleteVehicleCrew _x; } else { moveOut _x; }; - } forEach (crew _staticWeapon); + } forEach (crew _vehicle); - deleteVehicle _staticWeapon; + deleteVehicle _vehicle; LOG("end"); }; private _condition = { params ["_args"]; - _args params ["_staticWeapon"]; + _args params ["_vehicle"]; - _staticWeapon call FUNC(assemble_canPickupWeapon) + _vehicle call FUNC(assemble_canPickupWeapon) }; - [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_vehicle, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_canDeployTripod.sqf b/addons/csw/functions/fnc_canDeployTripod.sqf index 8969758e4d..9eb7f0a133 100644 --- a/addons/csw/functions/fnc_canDeployTripod.sqf +++ b/addons/csw/functions/fnc_canDeployTripod.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can deploy a tripod + * Checks if the player can deploy the tripod. * * Arguments: - * 0: Unit + * 0: Player * * Return Value: * Can deploy @@ -15,8 +15,8 @@ * Public: No */ -params ["_unit"]; +params ["_player"]; -private _secondaryWeapon = secondaryWeapon _unit; +private _secondaryWeapon = secondaryWeapon _player; _secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return diff --git a/addons/csw/functions/fnc_canGetIn.sqf b/addons/csw/functions/fnc_canGetIn.sqf index 16446c4fb2..9e017c16ef 100644 --- a/addons/csw/functions/fnc_canGetIn.sqf +++ b/addons/csw/functions/fnc_canGetIn.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if it's possible to get in the CSW + * Checks if it's possible to get in the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * * Return Value: * None diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf index 2ec3b065da..bf25b5a9e8 100644 --- a/addons/csw/functions/fnc_canPickupTripod.sqf +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -1,17 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can pickup the tripod + * Checks if the player can pickup the tripod. * * Arguments: * 0: Tripod - * 1: Unit (not used) * * Return Value: * Can pickup * * Example: - * [cursorObject, player] call ace_csw_fnc_canPickupTripod + * cursorObject call ace_csw_fnc_canPickupTripod * * Public: No */ diff --git a/addons/csw/functions/fnc_getCarryMagazine.sqf b/addons/csw/functions/fnc_getCarryMagazine.sqf index 81e07c6f10..3d94ca2fe1 100644 --- a/addons/csw/functions/fnc_getCarryMagazine.sqf +++ b/addons/csw/functions/fnc_getCarryMagazine.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, Dystopian - * Gets magazine that the player can carry, suitable to vehicle magazine + * Gets magazine that the player can carry, suitable to vehicle magazine. * * Arguments: * 0: Vehicle Magazine diff --git a/addons/csw/functions/fnc_getLoadActions.sqf b/addons/csw/functions/fnc_getLoadActions.sqf index e505c7f50f..59b368b368 100644 --- a/addons/csw/functions/fnc_getLoadActions.sqf +++ b/addons/csw/functions/fnc_getLoadActions.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets sub actions for what the unit can load into the CSW + * Gets sub actions for what the player can load into the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Unit * * Return Value: @@ -32,10 +32,11 @@ private _condition = { params ["_target", "_player", "_args"]; _args params ["_carryMag", "_turretPath", "", "_magSource"]; - ([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0 + [_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew) && + {([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0} }; -private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization +private _cfgMagazines = configFile >> "CfgMagazines"; // Micro-optimization private _actions = []; { _x params ["_carryMag", "", "_loadInfo"]; diff --git a/addons/csw/functions/fnc_getUnloadActions.sqf b/addons/csw/functions/fnc_getUnloadActions.sqf index dd119b0622..03f99cd65d 100644 --- a/addons/csw/functions/fnc_getUnloadActions.sqf +++ b/addons/csw/functions/fnc_getUnloadActions.sqf @@ -46,7 +46,9 @@ private _statement = { private _condition = { params ["_target", "_player", "_args"]; _args params ["_vehMag", "_turretPath", "_carryMag"]; - [_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine) + + [_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew) && + {[_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine)} }; private _actions = []; diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 2d7241029f..80ff071f10 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Initializes CSW systems on vehicle + * Initializes CSW systems on vehicle. * * Arguments: * 0: Vehicle @@ -78,7 +78,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; - private _childenCode = { + private _childrenCode = { BEGIN_COUNTER(getActions); // can remove for final release private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions)); END_COUNTER(getActions); @@ -86,10 +86,10 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { }; if (_configEnabled && {_magazineLocation != ""}) then { private _positionCode = compile _magazineLocation; - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); } else { - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index fedd1d412b..42773dc7ec 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles the use of proxy weapons to bypass engine reload times + * Handles the use of proxy weapons to fix engine-reload times. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Proxy weapon needed * 2: Weapon should be emptied diff --git a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf index 70c673299a..d4049706bd 100644 --- a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror &tcvm - * Tests if unit can load a magazine into a static weapon. + * Author: PabstMirror, tcvm + * Tests if unit can load a magazine into a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Carryable Magazine - * 3: Supplier + * 3: Supplier (default: objNull) * * Return Value: - * [CanLoad, LoadedMag, AmmoNeeded, IsBeltLinking] + * [Can Load , Loaded Mag , Ammo Needed , Is Belt Linking ] * * Example: * [cursorObject, [0], "ACE_csw_100Rnd_127x99_mag_red", player] call ace_csw_fnc_reload_canLoadMagazine @@ -28,7 +28,7 @@ if (!alive _vehicle) exitWith { _return }; // Verify holder has carry magazine if ( (!isNull _magSource) && - {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // hacky workaround for magazines within dropped backpacks + {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // Hacky workaround for magazines within dropped backpacks { ((_vehicle distance _magSource) > 10) || {((magazineCargo _magSource) findIf {_x == _carryMag}) == -1} @@ -42,7 +42,7 @@ private _cfgGroupsCarryMag = configFile >> QGVAR(groups) >> _carryMag; private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); if (_desiredAmmo == 0) then { _desiredAmmo = 100; }; -private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // assume it needs full carry mag +private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // Assume it needs full carry mag private _loadedMag = ""; private _isBeltLinking = false; @@ -62,7 +62,7 @@ scopeName "main"; }; private _maxMagazineAmmo = _desiredAmmo min getNumber (_cfgMagazines >> _xMag >> "count"); if (_xAmmo >= _maxMagazineAmmo) exitWith { - [false, _loadedMag, -6, false] breakOut "main"; // Already at capicity + [false, _loadedMag, -6, false] breakOut "main"; // Already at capacity }; _ammoNeeded = _maxMagazineAmmo - _xAmmo; _isBeltLinking = true; diff --git a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf index 4e03625a29..d7899e655a 100644 --- a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Tests if unit can unload a magazine from a static weapon. + * Tests if unit can unload a magazine from a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Player * 3: Carryable Magazine diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index 724ee4d09c..861f70350d 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets magazines that the player is carrying that can be loaded into the static weapon + * Gets nearby magazines that can be loaded into the CSW. * * Arguments: - * 0: Vehicle - * 1: Player + * 0: CSW + * 1: Unit * * Return Value: * Mags - * [Carry Magazine , Turret Path , Load Info , Magazine Source ] + * [Carry Magazine , Turret Path , Load Info , Magazine Source ] * * Example: * [cursorObject, player] call ace_csw_fnc_reload_getLoadableMagazines diff --git a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf index 6b5b77efee..3682651aac 100644 --- a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf +++ b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf @@ -4,7 +4,7 @@ * Finds the best vehicle magazines to create from a carryable magazine for a given weapon. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Magazine that is carryable * diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index d7af22d319..389ae699a4 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles adding ammo to a turret - * Called from a global event but only runs where turret is local + * Handles adding ammo to a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Source of magazine * 3: Vehicle Magazine * 4: Ammo in magazine - * 5: Unit or object to return ammo to + * 5: Unit or object to return ammo to (default: Source of magazine) * * Return Value: * None @@ -21,7 +21,8 @@ * Public: No */ -params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_returnTo", _magSource]]; +params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived"]; +private _returnTo = param [5, _magSource]; TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); TRACE_2("",local _vehicle,_vehicle turretLocal _turret); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 51036b525a..dccc9b16d4 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Handles removing ammo from a turret - * Called from a global event but only runs where turret is local + * Handles removing ammo from a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path - * 2: Magainze Unit Can Carry + * 2: Magazine Unit Can Carry * 3: Magazine To Remove From Static * 4: Unit or container to unload to * diff --git a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf index ca445400b0..009a39c0d1 100644 --- a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf +++ b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: tcvm and PabstMirror - * Handles returned ammo (either from unloading or leftovers from linking) + * Author: tcvm, PabstMirror + * Handles returned ammo (either from unloading or leftovers from linking). * * Arguments: * 0: Man or Vehicle @@ -18,13 +18,15 @@ */ params ["_unloadTo", "_carryMag", "_ammo"]; -TRACE_3("reload_handleReturnAmmo",_unloadTo,_carryMag,_ammo); +TRACE_4("reload_handleReturnAmmo",_unloadTo,typeOf _unloadTo,_carryMag,_ammo); private _carryMaxAmmo = getNumber (configFile >> "CfgMagazines" >> _carryMag >> "count"); private _fullMagazines = floor (_ammo / _carryMaxAmmo); private _bulletsRemaining = _ammo % _carryMaxAmmo; -if (_unloadTo isKindOf "CaManBase") then { +private _unloadToUnit = _unloadTo isKindOf "CAManBase"; + +if (_unloadToUnit) then { while {(_fullMagazines > 0) && {[_unloadTo, _carryMag] call CBA_fnc_canAddItem}} do { _unloadTo addMagazine [_carryMag, _carryMaxAmmo]; _fullMagazines = _fullMagazines - 1; @@ -37,19 +39,21 @@ if (_unloadTo isKindOf "CaManBase") then { if ((_fullMagazines == 0) && {_bulletsRemaining == 0}) exitWith {}; -// Try to use existing container -private _container = _unloadTo getVariable [QGVAR(container), objNull]; -if ((_container distance _unloadTo) > 10) then { _container = objNull; }; -if (isNull _container) then { - _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; +// Try to use object inventory or existing container +private _container = [_unloadTo, objNull] select _unloadToUnit; +if ((maxLoad _container) isEqualTo 0) then { + _container = _unloadTo getVariable [QGVAR(container), objNull]; + if ((_container distance _unloadTo) > 10) then { _container = objNull; }; + if (isNull _container) then { + _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; + }; }; - if (isNull _container) then { // Create ammo storage container private _weaponRelPos = _unloadTo getRelPos RELATIVE_DIRECTION(270); _weaponRelPos set [2, ((getPosATL _unloadTo) select 2) + 0.05]; - _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "NONE"]; + _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _unloadTo setVariable [QGVAR(container), _container, true]; _container setDir random [0, 180, 360]; _container setPosATL _weaponRelPos; @@ -59,7 +63,7 @@ if (isNull _container) then { TRACE_2("Creating NEW Container",_container,_weaponRelPos); }; -TRACE_3("adding to container",_container,_fullMagazines,_bulletsRemaining); +TRACE_4("adding to container",_container,typeOf _container,_fullMagazines,_bulletsRemaining); if (_fullMagazines > 0) then { _container addMagazineAmmoCargo [_carryMag, _fullMagazines, _carryMaxAmmo]; diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 50081a87a5..ac6e992fb8 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Loads a magazine into a static weapon from a magazine carried by or next to the player. + * Loads a magazine into a CSW from a magazine carried by or next to the player. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Unit Carried Magazine * 3: Magazine source @@ -52,8 +52,19 @@ private _onFinish = { [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); if (_bestAmmoToSend == 0) exitWith {}; - TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend,_unit); - [QGVAR(addTurretMag), [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend, _unit]] call CBA_fnc_globalEvent; + // Workaround for removeSpecificMagazine and WeaponHolders being deleted when empty, give back to the unit if the weapon holder was deleted + // TODO: Pass type and position of deleted object to create a new one + // TODO: Use '_magSource getEntityInfo 14' in 2.18 and the isSetForDeletion flag to execute in same frame + [{ + params ["_magSource", "_unit", "_args"]; + + if (isNull _magSource) then { + _args pushBack _unit; + }; + + TRACE_1("calling addTurretMag event",_args); + [QGVAR(addTurretMag), _args] call CBA_fnc_globalEvent; + }, [_magSource, _unit, [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend]]] call CBA_fnc_execNextFrame; }; diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 98200840a3..1c27a494d5 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -1,11 +1,12 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Dumps ammo to container + * Dumps ammo to container. * * Arguments: - * 0: Weapon + * 0: CSW * 1: Using advanced assembly + * 2: Empty weapon * * Return Value: * None @@ -16,11 +17,11 @@ * Public: No */ -params ["_staticWeapon", "_assemblyMode", "_emptyWeapon"]; -TRACE_3("staticWeaponInit_unloadExtraMags",_staticWeapon,_assemblyMode,_emptyWeapon); +params ["_vehicle", "_assemblyMode", "_emptyWeapon"]; +TRACE_3("staticWeaponInit_unloadExtraMags",_vehicle,_assemblyMode,_emptyWeapon); if (!_assemblyMode) exitWith {}; -private _desiredAmmo = getNumber (configOf _staticWeapon >> QUOTE(ADDON) >> "desiredAmmo"); +private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); private _storeExtraMagazines = GVAR(handleExtraMagazines); if (_emptyWeapon) then { _desiredAmmo = 0; @@ -56,41 +57,41 @@ private _containerMagazineCount = []; } else { if ((_xMag select [0,4]) != "fake") then { WARNING_1("Unable to unload [%1] - No matching carry mag",_xMag); }; }; -} forEach (magazinesAllTurrets _staticWeapon); +} forEach (magazinesAllTurrets _vehicle); TRACE_1("Remove all loaded magazines",_magsToRemove); { - _staticWeapon removeMagazinesTurret _x; + _vehicle removeMagazinesTurret _x; if ((_loadedMagazineInfo select [0,2]) isEqualTo _x) then { TRACE_1("Re-add the starting mag",_loadedMagazineInfo); - _staticWeapon addMagazineTurret _loadedMagazineInfo; + _vehicle addMagazineTurret _loadedMagazineInfo; }; } forEach _magsToRemove; -private _secondaryWeaponMagazines = _staticWeapon getVariable [QGVAR(secondaryWeaponMagazines), []]; +private _secondaryWeaponMagazines = _vehicle getVariable [QGVAR(secondaryWeaponMagazines), []]; if (_secondaryWeaponMagazines isNotEqualTo []) then { // Check if the static weapon can take magazines - private _turret = (allTurrets _staticWeapon) param [0, []]; - private _compatibleMagazinesTurret = flatten ((_staticWeapon weaponsTurret _turret) apply {compatibleMagazines _x}); + private _turret = (allTurrets _vehicle) param [0, []]; + private _compatibleMagazinesTurret = flatten ((_vehicle weaponsTurret _turret) apply {compatibleMagazines _x}); private _container = objNull; { - private _vehicleMag = [_staticWeapon, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); + private _vehicleMag = [_vehicle, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); TRACE_3("Re-add previous mag",_x select 0,_turret,_vehicleMag); // If the magazine can be added to the static weapon, do it now if (_vehicleMag in _compatibleMagazinesTurret) then { - _staticWeapon addMagazineTurret [_vehicleMag, _turret, _x select 1]; + _vehicle addMagazineTurret [_vehicleMag, _turret, _x select 1]; } else { // Find a suitable container to place items in if necessary if (isNull _container) then { - _container = (nearestObjects [_staticWeapon, ["GroundWeaponHolder"], 10]) param [0, objNull]; + _container = (nearestObjects [_vehicle, ["GroundWeaponHolder"], 10]) param [0, objNull]; // Create ammo storage container if (isNull _container) then { - _container = createVehicle ["GroundWeaponHolder", getPosATL _staticWeapon, [], 0, "NONE"]; + _container = createVehicle ["GroundWeaponHolder", getPosATL _vehicle, [], 0, "NONE"]; }; }; @@ -99,12 +100,12 @@ if (_secondaryWeaponMagazines isNotEqualTo []) then { }; } forEach _secondaryWeaponMagazines; - _staticWeapon setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; + _vehicle setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; }; if (_storeExtraMagazines) then { TRACE_1("saving extra mags to container",_containerMagazineCount); { - [_staticWeapon, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); + [_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); } forEach _containerMagazineClassnames; }; diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index da794376ab..5d11773490 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -672,6 +672,22 @@ [CSW] Лента 20-мм гранат для ст. гранатомёта [CSW] 20mm 고속유탄발사기 탄띠 + + Caliber: 20 mm<br/>Rounds: 20<br />Used in: Grenade Launcher + 口徑:20 mm<br/>個數:20<br />用於:榴彈發射器 + Calibre : 20 mm<br/>Munitions : 20<br />Application : lance-grenades + Calibre: 20 mm<br/>Cargas: 20<br />Se usa en: lanzagranadas + Calibro: 20 mm<br/>Munizioni: 20<br />Si usa in: lanciagranate + Kaliber: 20 mm<br/>Naboje: 20<br />Używane w: granatniku + Калибр: 20 мм<br/>Кол-во: 20<br />Применение: гранатомет + Kaliber: 20 mm<br/>Patronen: 20<br />Eingesetzt von: Granatenwerfer + Ráže: 20 mm<br/>Munice: 20<br />Použití: Granátomet + Calibre: 20 mm<br/>Balas: 20<br />Uso em: Lança-granadas + 구경: 20mm<br />탄 수: 20<br />사용 가능: 유탄발사기 + 口径:20 毫米<br/>容弹量:20<br />用于:枪榴弹发射器 + 口径:20 mm <br/>弾薬:20<br />使用:グレネードランチャー + Kalibre: 20 mm<br/>Mermi: 20<br />Kullanıldığı Yer: Bombaatar + M3 Tripod Trípode M3 diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 3251052002..621440ffba 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -59,7 +59,7 @@ Defense Advanced GPS Receiver Defense Advanced GPS Receiver Defense Advanced GPS Receiver - 国防のための高度なGPS受信機 (Defense Advanced GPS Receiver) + 国防のための高機能なGPS受信機 (Defense Advanced GPS Receiver) 국방 고급위성항법시스템 수신기 軍用高級防禦GPS接收器 军用高级防御 GPS 接收器 diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 3ced843f47..c072090a60 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -3,6 +3,18 @@ if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), { GVAR(dogtagsData) set _this; + + if (isNil "CBA_fnc_renameInventoryItem") exitWith {}; // requires https://github.com/CBATeam/CBA_A3/pull/1329 + params ["_item", "_dogTagData"]; + private _name = _dogtagData param [0, ""]; + + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _name = [LLSTRING(itemName), ": ", _name] joinString ""; + [_item, _name] call CBA_fnc_renameInventoryItem; }] call CBA_fnc_addEventHandler; if (isServer) then { diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index 6a01d8c36f..4f8cc94cc7 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -35,7 +35,7 @@ private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; // Dog tags have no mass, so no need to check if it can fit in container, but check if unit has an inventory at all [_player, _item, true] call CBA_fnc_addItem; -_name = _dogtagData param [0, ""]; +private _name = _dogtagData param [0, ""]; // If data doesn't exist or body has no name, set name as "unknown" if (_name == "") then { diff --git a/addons/dogtags/stringtable.xml b/addons/dogtags/stringtable.xml index 73d2d07e56..ff0af0db4e 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -13,7 +13,7 @@ Piastrina 兵籍牌 兵籍牌 - Dog Tag + Chapa de Identificação Placa de identidad Künye @@ -29,7 +29,7 @@ Controlla Piastrina 檢查兵籍牌 检查兵籍牌 - Verificar Dog Tag + Verificar chapa de identificação Verificar placa de identidad Künyeyi Kontrol Et @@ -77,7 +77,7 @@ Piastrina presa da %1... 從%1身上拿取兵籍牌... 从%1身上拿取兵籍牌... - Dogtag pego de %1... + Chapa de identificação pega de %1... Tomada placa de identidad de %1... Künye %1 kişisinden alındı @@ -93,7 +93,7 @@ Qualcun altro ha già preso la piastrina... 已經有人把他的兵籍牌拿走了... 已经有人把他的兵籍牌拿走了... - Alguém já pegou essa dogtag... + Alguém já pegou essa chapa de identificação... Alguien más ha tomado la placa de identidad Başka biri zaten künyeyi almış @@ -106,7 +106,7 @@ Indicatore su schermo per il controllo delle piastrine Wyświetlacz ekranowy dla sprawdzania nieśmiertelników Экран для проверки жетонов - Tela de Exibição para verificar dogtags + Tela de exibição para verificar chapas de identificação Visualización en pantalla de placa de identidad Affichage à l'écran pour le contrôle des plaques. Okno na obrazovce pro kontrolu známek diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index a6b38c4ea5..579e6a0ac3 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -66,10 +66,10 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index fcd0f05376..e0a58a26eb 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -73,8 +73,8 @@ if (_unit getHitPointDamage "HitLegs" >= 0.5) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject_carry); diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 6420ff56df..87272491da 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -79,10 +79,10 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 7c3a6be307..249f3866bb 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -51,8 +51,8 @@ if (_unit distance _target > 10 && {(CBA_missionTime - _startTime) >= 1}) exitWi _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index adfe72e67b..965e3b9efa 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -86,16 +86,16 @@ if (_unit getVariable ["ACE_isUnconscious", false]) then { [_unit, "unconscious", 2] call EFUNC(common,doAnimation); }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _target setVariable [QGVAR(isUAV), nil, true]; }; // Fixes not being able to move when in combat pace diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 2cc33be8e7..ba8cbd09f1 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -94,16 +94,16 @@ if !(_target isKindOf "CAManBase") then { [QEGVAR(common,fixFloating), _target, _target] call CBA_fnc_targetEvent; }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _target setVariable [QGVAR(isUAV), nil, true]; }; // Reset mass diff --git a/addons/dragon/CfgAmmo.hpp b/addons/dragon/CfgAmmo.hpp index f736e8451b..22630e03b0 100644 --- a/addons/dragon/CfgAmmo.hpp +++ b/addons/dragon/CfgAmmo.hpp @@ -38,9 +38,8 @@ class CfgAmmo { EGVAR(vehicle_damage,incendiary) = 1.0; class ace_missileguidance { - minDeflection = 0; - maxDeflection = 0; - incDeflection = 0; + pitchRate = 0; + yawRate = 0; canVanillaLock = 0; @@ -51,6 +50,9 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "LineOfSight"; + navigationTypes[] = { "LineOfSight" }; + seekLastTargetPos = 0; seekerAngle = 30; seekerAccuracy = 1; @@ -82,6 +84,9 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; + pitchRate = 0; + yawRate = 0; + // Guidance type for munitions defaultSeekerType = "SACLOS"; seekerTypes[] = { "SACLOS" }; diff --git a/addons/explosives/ACE_Arsenal_Stats.hpp b/addons/explosives/ACE_Arsenal_Stats.hpp index 821ac65bfd..c2c33b7f0a 100644 --- a/addons/explosives/ACE_Arsenal_Stats.hpp +++ b/addons/explosives/ACE_Arsenal_Stats.hpp @@ -7,7 +7,7 @@ class EGVAR(arsenal,stats) { displayName = CSTRING(statExploRange); showText = 1; textStatement = QUOTE(params [ARR_2('_stat','_config')]; private _exploRangeStat = getNumber (_config >> _stat select 0); format [ARR_3('%1m (%2ft)',_exploRangeStat,(_exploRangeStat / 0.3048) toFixed 1)]); - condition = QUOTE(params [ARR_2('','_config')]; (getNumber (_config >> QQGVAR(Detonator))) > 0); + condition = QUOTE(getNumber (_this select 1 >> QQGVAR(detonator)) > 0); tabs[] = {{}, {7}}; }; }; diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index 27d63a736d..a94ad95eaa 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -18,7 +18,7 @@ class ACE_Triggers { isAttachable = 1; displayName = CSTRING(clacker_displayName); picture = QPATHTOF(Data\UI\Clacker.paa); - onPlace = QUOTE(_this call FUNC(AddClacker);false); + onPlace = QUOTE(_this call FUNC(addClacker); false); requires[] = {"ACE_Clacker"}; }; class MK16_Transmitter: Command { @@ -37,7 +37,7 @@ class ACE_Triggers { isAttachable = 1; displayName = CSTRING(cellphone_displayName); picture = QPATHTOF(Data\UI\Cellphone_UI.paa); - onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); + onPlace = QUOTE(_this call FUNC(addCellphoneIED); false); requires[] = {"ACE_Cellphone"}; }; class PressurePlate { diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index c02885362e..cee1cf99c3 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -3,38 +3,19 @@ class CfgAmmo { class Default; class TimeBombCore: Default { - GVAR(DefuseTime) = 5; + GVAR(defuseTime) = 5; }; - /* - class BoundingMineCore: TimeBombCore; - class BoundingMineBase: BoundingMineCore; - class APERSBoundingMine_Range_Ammo: BoundingMineBase; - class MineCore: TimeBombCore; - class MineBase: MineCore; - class APERSMine_Range_Ammo: MineBase; - class ATMine_Range_Ammo: MineBase; - - class DirectionalBombCore: TimeBombCore; - class DirectionalBombBase: DirectionalBombCore; - - class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase; - - class PipeBombCore: TimeBombCore; - class PipeBombBase: PipeBombCore; - */ // GVAR(size) = 0; is small size // GVAR(size) = 1; is large size class DirectionalBombBase; class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; - GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; }; - // class ClaymoreDirectionalMine_Remote_Ammo_Scripted: ClaymoreDirectionalMine_Remote_Ammo {}; class APERSTripMine_Wire_Ammo: DirectionalBombBase { GVAR(defuseObjectPosition)[] = {-1.415, 0, 0.12}; @@ -43,7 +24,7 @@ class CfgAmmo { class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo { SoundSetExplosion[] = {}; - defaultMagazine = "ACE_FlareTripMine_Mag"; //Mag that gets dropped after defuse + defaultMagazine = "ACE_FlareTripMine_Mag"; // Mag that gets dropped after defuse hit = 0; indirectHit = 0; indirectHitRange = 0; @@ -92,7 +73,6 @@ class CfgAmmo { class PipeBombBase; class DemoCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "DemoCharge_Remote_Mag"; - GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; soundActivation[] = {"", 0, 0, 0}; @@ -103,14 +83,11 @@ class CfgAmmo { }; class SatchelCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "SatchelCharge_Remote_Mag"; - GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; }; - // class DemoCharge_Remote_Ammo_Scripted: DemoCharge_Remote_Ammo {}; - // class SatchelCharge_Remote_Ammo_Scripted: SatchelCharge_Remote_Ammo {}; class IEDUrbanBig_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; @@ -168,10 +145,9 @@ class CfgAmmo { mineTrigger = "RangeTriggerShort"; }; - // Orange DLC: + // Orange DLC class APERSMineDispenser_Ammo: PipeBombBase { GVAR(magazine) = "APERSMineDispenser_Mag"; - GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; }; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index ae0e5fe541..3b9e707728 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -9,6 +9,7 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); @@ -26,6 +27,7 @@ class Extended_Take_EventHandlers { GVAR(takeHandler) = QUOTE(call FUNC(onInventoryChanged)); }; }; + class Extended_Put_EventHandlers { class CAManBase { GVAR(takeHandler) = QUOTE([ARR_3(_this select 1,_this select 0,_this select 2)] call FUNC(onInventoryChanged)); diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 7bb2c6ff02..89591f2bd6 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -1,10 +1,9 @@ class CfgMagazines { class CA_Magazine; class ATMine_Range_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. - GVAR(DelayTime) = 2.5; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -13,7 +12,7 @@ class CfgMagazines { }; }; class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSBoundingMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSBoundingMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -22,7 +21,7 @@ class CfgMagazines { }; }; class APERSMine_Range_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -31,7 +30,7 @@ class CfgMagazines { }; }; class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSTripwireMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire; @@ -40,17 +39,16 @@ class CfgMagazines { class ACE_FlareTripMine_Mag: APERSTripMine_Wire_Mag { author = ECSTRING(common,aceteam); ammo = "ACE_FlareTripMine_Wire_Ammo"; - GVAR(SetupObject) = "ACE_Explosives_Place_APERSTripwireMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine"; displayName = CSTRING(TripFlare_Name); descriptionShort = CSTRING(TripFlare_Description); class Library {libTextDesc = CSTRING(TripFlare_Description);}; }; class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_Claymore"; - GVAR(DelayTime) = 1.5; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_Claymore"; class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { @@ -61,10 +59,9 @@ class CfgMagazines { }; class SatchelCharge_Remote_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_SatchelCharge"; - GVAR(DelayTime) = 1; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_SatchelCharge"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; class Timer { @@ -78,12 +75,12 @@ class CfgMagazines { }; }; class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_DemoCharge"; + GVAR(setupObject) = "ACE_Explosives_Place_DemoCharge"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; }; class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_SLAM"; + GVAR(setupObject) = "ACE_Explosives_Place_SLAM"; class ACE_Triggers { SupportedTriggers[] = {"IRSensor", "PressurePlate", "Timer", "Command", "MK16_Transmitter"}; class PressurePlate { @@ -107,7 +104,7 @@ class CfgMagazines { }; class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDUrbanBig"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDUrbanBig"; class ACE_Triggers { SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Command { @@ -125,7 +122,7 @@ class CfgMagazines { }; }; class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDLandBig"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDLandBig"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AT_CA.paa"; // Fix inconsistent picture class ACE_Triggers: ACE_Triggers { class Command: Command { @@ -139,7 +136,7 @@ class CfgMagazines { }; }; class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDUrbanSmall"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDUrbanSmall"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_bouncing_CA.paa"; // Fix inconsistent picture class ACE_Triggers { SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; @@ -158,7 +155,7 @@ class CfgMagazines { }; }; class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDLandSmall"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDLandSmall"; class ACE_Triggers: ACE_Triggers { class Command: Command { ammo = "ACE_IEDLandSmall_Command_Ammo"; @@ -174,7 +171,7 @@ class CfgMagazines { // Orange DLC: class APERSMineDispenser_Mag: SatchelCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSMineDispenser"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSMineDispenser"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter"}; class Timer { @@ -187,7 +184,7 @@ class CfgMagazines { }; }; class TrainingMine_Mag: APERSMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_TrainingMine"; + GVAR(setupObject) = "ACE_Explosives_Place_TrainingMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 91a708beb8..0a67a9a608 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -6,24 +6,24 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Explosives { displayName = CSTRING(Menu); - condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(PlantingExplosive),false)])); + condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(plantingExplosive),false)])); statement = ""; exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 1; icon = QPATHTOF(UI\Explosives_Menu_ca.paa); - insertChildren = QUOTE([_player] call FUNC(addTransmitterActions)); + insertChildren = QUOTE(_player call FUNC(addTransmitterActions)); class ACE_Place { displayName = CSTRING(Place); statement = ""; - condition = "true"; + condition = QUOTE(true); exceptions[] = {"isNotSwimming"}; icon = QPATHTOF(UI\Place_Explosive_ca.paa); insertChildren = QUOTE(_player call FUNC(addExplosiveActions)); }; class ACE_Cellphone { displayName = CSTRING(cellphone_displayName); - condition = "('ACE_Cellphone' in (items ace_player))"; - statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; + condition = QUOTE([ARR_2(_player,'ACE_Cellphone')] call EFUNC(common,hasItem)); + statement = QUOTE(closeDialog 0; createDialog 'Rsc_ACE_PhoneInterface'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 0; icon = QPATHTOF(Data\UI\Cellphone_UI.paa); @@ -87,7 +87,7 @@ class CfgVehicles { displayName = CSTRING(TriggerMenu); condition = "true"; statement = ""; - insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions)); + insertChildren = QUOTE([ARR_3(_target getVariable QQGVAR(class),_target,_player)] call FUNC(addTriggerActions)); showDisabled = 0; exceptions[] = {"isNotSwimming"}; icon = QPATHTOF(UI\Explosives_Menu_ca.paa); @@ -96,7 +96,7 @@ class CfgVehicles { selection = ""; displayName = CSTRING(Pickup); condition = "true"; - statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;); + statement = QUOTE([ARR_2(_player,_target getVariable QQGVAR(class))] call EFUNC(common,addToInventory); deleteVehicle _target); showDisabled = 0; exceptions[] = {"isNotSwimming"}; icon = "\A3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_takemine_ca.paa"; @@ -106,60 +106,60 @@ class CfgVehicles { }; class ACE_Explosives_Place_DemoCharge: ACE_Explosives_Place { - displayName = "Demo Charge"; + displayName = "$STR_A3_cfgMagazines_DemoCharge0"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[-0.07,0,0.055]"; + position = "[-0.07, 0, 0.055]"; }; }; }; class ACE_Explosives_Place_APERSBoundingMine: ACE_Explosives_Place { - displayName = "APERS Bounding Mine"; + displayName = "$STR_A3_cfgMagazines_BouncingMineRangeMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_bouncing"; }; class ACE_Explosives_Place_APERSMine: ACE_Explosives_Place { - displayName = "APERS Mine"; + displayName = "$STR_A3_cfgMagazines_ClassicMineRangeMagazine0"; model = "\A3\Weapons_F\explosives\mine_ap"; }; class ACE_Explosives_Place_APERSTripwireMine: ACE_Explosives_Place { - displayName = "APERS Tripwire Mine"; + displayName = "$STR_A3_cfgMagazines_ClassicMineWireMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[1.415,0,0.12]"; + position = "[1.415, 0, 0.12]"; }; }; }; class ACE_Explosives_Place_ATMine: ACE_Explosives_Place { - displayName = "AT Mine"; + displayName = "$STR_A3_CfgMagazines_Mine0"; model = "\A3\Weapons_f\Explosives\mine_at"; }; class ACE_Explosives_Place_Claymore: ACE_Explosives_Place { - displayName = "Claymore"; + displayName = "$STR_A3_cfgMagazines_DirectionalMineRemoteMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[0,0,0.038]"; + position = "[0, 0, 0.038]"; }; }; }; class ACE_Explosives_Place_SatchelCharge: ACE_Explosives_Place { - displayName = "Satchel Charge"; + displayName = "$STR_A3_cfgMagazines_PipeBomb0"; model = "\A3\Weapons_F\Explosives\satchel"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[-0.1,-0.1,0.05]"; + position = "[-0.1, -0.1, 0.05]"; }; }; }; // Orange DLC: class ACE_Explosives_Place_APERSMineDispenser: ACE_Explosives_Place { - displayName = "APERSMineDispenser"; + displayName = "$STR_A3_CfgMagazines_APERSMineDispenser_Mag0"; model = "\A3\Weapons_F_Orange\Explosives\APERSmineDispenser"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -168,7 +168,7 @@ class CfgVehicles { }; }; class ACE_Explosives_Place_TrainingMine: ACE_Explosives_Place { - displayName = "TrainingMine"; + displayName = "$STR_A3_CfgMagazines_TrainingMine_Mag0"; model = "\A3\Weapons_F_Orange\Explosives\TrainingMine_F"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -179,28 +179,28 @@ class CfgVehicles { class ACE_Explosives_Place_SLAM: ACE_Explosives_Place { - displayName = "SLAM"; + displayName = "$STR_A3_cfgMagazines_DirectionalMineRangeMagazine0"; model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; }; // IEDs class ACE_Explosives_Place_IEDUrbanBig: ACE_Explosives_Place { - displayName = "IED Urban Big"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanBig_F"; model = "\A3\Weapons_F\Explosives\IED_urban_big"; }; class ACE_Explosives_Place_IEDLandBig: ACE_Explosives_Place { - displayName = "IED Land Big"; + displayName = "$STR_A3_CfgVehicles_IEDLandBig_F"; model = "\A3\Weapons_F\Explosives\IED_land_big"; }; class ACE_Explosives_Place_IEDUrbanSmall: ACE_Explosives_Place { - displayName = "IED Urban Small"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanSmall_F"; model = "\A3\Weapons_F\Explosives\IED_urban_small"; }; class ACE_Explosives_Place_IEDLandSmall: ACE_Explosives_Place { - displayName = "IED Land Small"; + displayName = "$STR_A3_CfgVehicles_IEDLandSmall_F"; model = "\A3\Weapons_F\Explosives\IED_land_small"; }; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index 30e1fb95cb..5c81cb9aec 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -12,8 +12,7 @@ class CfgWeapons { class CBA_MiscItem_ItemInfo; class ACE_ExplosiveItem: CBA_MiscItem_ItemInfo { - allowedSlots[] = {TYPE_UNIFORM,TYPE_VEST,TYPE_BACKPACK}; - //type = 201; + allowedSlots[] = {TYPE_UNIFORM, TYPE_VEST, TYPE_BACKPACK}; }; class ACE_Clacker: ACE_ItemCore { @@ -23,8 +22,8 @@ class CfgWeapons { descriptionShort = CSTRING(clacker_description); picture = QPATHTOF(Data\UI\Clacker.paa); model = QPATHTOF(data\ace_m57.p3d); - GVAR(Range) = 250; - GVAR(Detonator) = 1; + GVAR(range) = 250; + GVAR(detonator) = 1; GVAR(triggerType) = "Command"; ACE_isTool = 1; @@ -37,7 +36,7 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); displayName = CSTRING(M152_Clacker_displayName); picture = QPATHTOF(Data\UI\MK26_Transmitter_ca.paa); - GVAR(Range) = 5000; + GVAR(range) = 5000; GVAR(triggerType) = "MK16_Transmitter"; }; class ACE_DefusalKit: ACE_ItemCore { @@ -47,8 +46,8 @@ class CfgWeapons { descriptionShort = CSTRING(DefusalKit_description); picture = QPATHTOF(Data\UI\Pliers.paa); model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; - ACE_isTool = 1; GVAR(defusalKit) = 1; + ACE_isTool = 1; class ItemInfo: ACE_ExplosiveItem { mass = 5; @@ -62,8 +61,8 @@ class CfgWeapons { descriptionShort = CSTRING(DeadManSwitch_description); picture = QPATHTOF(Data\UI\DeadmanSwitch.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; - GVAR(Range) = 100; - GVAR(Detonator) = 1; + GVAR(range) = 100; + GVAR(detonator) = 1; GVAR(triggerType) = "DeadManSwitch"; ACE_isTool = 1; @@ -79,8 +78,8 @@ class CfgWeapons { descriptionShort = CSTRING(cellphone_description); picture = QPATHTOF(Data\UI\Cellphone_UI.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; - GVAR(Range) = 15000; - GVAR(Detonator) = 1; + GVAR(range) = 15000; + GVAR(detonator) = 1; GVAR(triggerType) = "Cellphone"; ACE_isTool = 1; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 81ab1b5406..f47dbbe5bd 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -42,7 +42,7 @@ if (isServer) then { params ["_explosive"]; TRACE_1("exploding",_explosive); if (!isNull _explosive) then { - _explosive setDamage 1; + [QEGVAR(common,triggerAmmo), _explosive, _explosive] call CBA_fnc_targetEvent; }; }, _explosive, _delay] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addEventHandler; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index b60186ab68..db2e48fa8d 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -32,6 +32,7 @@ class RscEdit; class RscPicture; class RscButton; class ctrlXSliderH; + #include "ExplosivesUI.hpp" #include "TimerDialog.hpp" #include "GUI_VirtualAmmo.hpp" diff --git a/addons/explosives/dev/test_magazines.sqf b/addons/explosives/dev/test_magazines.sqf index ca9744f08d..afd091b24c 100644 --- a/addons/explosives/dev/test_magazines.sqf +++ b/addons/explosives/dev/test_magazines.sqf @@ -5,20 +5,24 @@ INFO("--- Checking Explosive Mags ---"); private _explosivesMags = compatibleMagazines "Put"; private _setupHash = createHashMap; + { private _mag = _x; private _cfg = configFile >> "CfgMagazines" >> _mag; private _scope = getNumber (_cfg >> "scope"); - private _setupObject = getText (_cfg >> QGVAR(SetupObject)); + private _setupObject = getText (_cfg >> QGVAR(setupObject)); + if (_setupObject == "") then { WARNING_2("[%1](scope %2) has no setupObject",_mag,_scope); - continue + continue; }; + if (!isClass (configFile >> "CfgVehicles" >> _setupObject)) then { ERROR_2("[%1](scope %2) has invalid setup object",_mag,_scope); }; - if ((((_setupHash getOrDefault [_setupObject, [], true]) pushBack _mag) > 0)) then { + + if (((_setupHash getOrDefault [_setupObject, [], true]) pushBack _mag) > 0) then { INFO_2("[%1] setupObject has multiple mags %2",_setupObject,_setupHash get _setupObject); }; } forEach _explosivesMags; diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index d950278c35..0001edffcb 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -92,19 +92,6 @@ if (_detonator != "ACE_DeadManSwitch") then { ]; }; } else { - //Add action to detonate all explosives (including the inventory explosive): - _children pushBack [ - [ - "Explosive_All_Deadman", - LLSTRING(DetonateAll), - getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), - {[_player] call FUNC(onIncapacitated)}, - {true} - ] call EFUNC(interact_menu,createAction), - [], - _unit - ]; - //Adds actions for the explosives you can connect to the deadman switch. private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; if ((_connectedInventoryExplosive != "") && {!(_connectedInventoryExplosive in (magazines _unit))}) then { @@ -113,14 +100,26 @@ if (_detonator != "ACE_DeadManSwitch") then { }; _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; + + //Add action to detonate all explosives (including the inventory explosive): + if (_connectedInventoryExplosive != "" || {count _explosivesList > 1}) then { + _children pushBack [ + [ + "Explosive_All_Deadman", + LLSTRING(DetonateAll), + getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), + {[_player] call FUNC(onIncapacitated)}, + {true} + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + if (_connectedInventoryExplosive != "") then { //Add the disconnect action private _magConfig = configFile >> "CfgMagazines" >> _connectedInventoryExplosive; - private _name = if ((getText (_magConfig >> "displayNameShort")) != "") then { - getText (_magConfig >> "displayNameShort") - } else { - getText(_magConfig >> "displayName") - }; + private _name = getText (_magConfig >> "displayName"); private _picture = getText (_magConfig >> "picture"); _children pushBack [ @@ -149,11 +148,7 @@ if (_detonator != "ACE_DeadManSwitch") then { private _magConfig = configFile >> "CfgMagazines" >> _mag; private _supportedTriggers = getArray (_magConfig >> "ACE_Triggers" >> "SupportedTriggers"); if (({_x == "DeadmanSwitch"} count _supportedTriggers) == 1) then { //case insensitive search - private _name = if ((getText (_magConfig >> "displayNameShort")) != "") then { - getText (_magConfig >> "displayNameShort") - } else { - getText(_magConfig >> "displayName") - }; + private _name = getText (_magConfig >> "displayName"); private _picture = getText (_magConfig >> "picture"); _children pushBack [ diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 480ecd2701..6276e48afe 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -27,11 +27,8 @@ { private _config = _cfgMagazines >> _x; if (getNumber (_config >> QGVAR(Placeable)) == 1) then { - private _name = getText (_config >> "displayNameShort"); + private _name = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - if (_name isEqualTo "") then { - _name = getText (_config >> "displayName"); - }; private _action = [_x, format ["%1 (%2)", _name, _totalCount - count (_magazines - [_x])], _picture, {[{_this call FUNC(setupExplosive)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, _x] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _player]; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 5e276745b5..e9ad9856fb 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -31,25 +31,9 @@ private _result = true; if !([_unit, _range, _item select 0, _item select 1, _triggerClassname] call FUNC(checkDetonateHandlers)) exitWith {false}; -if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then { - private _previousExp = _item select 0; - private _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive)); - if (_exp != "") then { - _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; - _exp setDir (getDir _previousExp); - _item set [0, _exp]; - private _pos = getPosASL _previousExp; - deleteVehicle _previousExp; - _exp setPosASL _pos; - }; -}; - if (isNull (_item select 0)) then { WARNING_1("Explosive is null [%1]",_this); }; -if ((getNumber (configFile >> "CfgAmmo" >> (typeOf (_item select 0)) >> "triggerWhenDestroyed")) != 1) then { - WARNING_1("Explosive is not triggerWhenDestroyed [%1]",typeOf (_item select 0)); -}; [QGVAR(detonate), [_unit, _item select 0, _item select 1]] call CBA_fnc_serverEvent; diff --git a/addons/explosives/functions/fnc_openTimerUI.sqf b/addons/explosives/functions/fnc_openTimerUI.sqf index 0a490a096d..c8d3707ed1 100644 --- a/addons/explosives/functions/fnc_openTimerUI.sqf +++ b/addons/explosives/functions/fnc_openTimerUI.sqf @@ -66,7 +66,7 @@ _display displayAddEventHandler ["MouseZChanged", { // Make sure explosive still exists and is near player if ((!isNull _display) && {!alive ACE_player} || {!alive GVAR(explosive)} || {(ACE_player distance GVAR(explosive)) > 5}) exitWith { - INFO_2("explosive became invalid",ACE_player,GVAR(explosive)); + INFO_2("%1's explosive %2 became invalid",ACE_player,GVAR(explosive)); closeDialog 0; _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 918bbb0c33..d25e5d3276 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -29,8 +29,8 @@ if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game! -[_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); //Show mouse buttons: [localize LSTRING(PlaceAction), localize LSTRING(CancelAction), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); @@ -149,8 +149,8 @@ GVAR(TweakedAngle) = 0; [_pfID] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_running) = false; - [_unit, "forceWalk", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); [_unit, "zoomtemp", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); diff --git a/addons/explosives/initSettings.inc.sqf b/addons/explosives/initSettings.inc.sqf index bdbd488550..baa38f0d8f 100644 --- a/addons/explosives/initSettings.inc.sqf +++ b/addons/explosives/initSettings.inc.sqf @@ -6,7 +6,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(RequireSpecialist_DisplayName),LLSTRING(RequireSpecialist_Description)], _categoryStr, false, - true + 1 ] call CBA_fnc_addSetting; [ @@ -15,7 +15,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(PunishNonSpecialists_DisplayName),LLSTRING(PunishNonSpecialists_Description)], _categoryStr, true, - true + 1 ] call CBA_fnc_addSetting; [ @@ -24,7 +24,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(ExplodeOnDefuse_DisplayName),LLSTRING(ExplodeOnDefuse_Description)], _categoryStr, true, - true + 1 ] call CBA_fnc_addSetting; // Variable names to preserve https://github.com/acemod/ACE3/pull/6882 @@ -34,7 +34,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(TimerMin_DisplayName), LLSTRING(TimerMin_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], [0, 5999, TIMER_VALUE_MIN], - true + 1 ] call CBA_fnc_addSetting; [ @@ -43,7 +43,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(TimerMax_DisplayName), LLSTRING(TimerMax_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], [0, 5999, TIMER_VALUE_MAX], - true + 1 ] call CBA_fnc_addSetting; [ @@ -51,6 +51,5 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; "TIME", [LLSTRING(TimerDefault_DisplayName), LLSTRING(TimerDefault_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], - [0, 5999, TIMER_VALUE_DEFAULT], - false + [0, 5999, TIMER_VALUE_DEFAULT] ] call CBA_fnc_addSetting; diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 10ea50a7c5..89418c0f99 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -134,7 +134,7 @@ Equipa el helicoptero seleccionado con un Sistema de Inserción/Extracción Rápida por Cuerda Equipaggia l'elicottero selezionato con il Fast Rope Insertion Extraction System Vybavit vybraný vrtulník systémem Fast Rope Insertion Extraction (FRIES) - Equipa um helicóptero selecionado com um sistema de Fast Rope Insertion Extraction System + Equipa o helicóptero selecionado com um Sistema de Inserção/Extração Rápida por Corda Снаряжает выбранный вертолет оборудованием для спуска десанта по канатам 選択されたヘリコプターで Fast Rope Insertion Extraction System を使えるようにします。 선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템을 장착합니다. @@ -298,6 +298,7 @@ Schnelles-Abseilen Fast Rope 패스트로프 + Descida rápida pela corda Require rope item to deploy diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 88e803d0ca..433f17ac8b 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -27,13 +27,6 @@ class CfgPatches { #include "CfgOptics.hpp" -class ACE_Extensions { - class ace_fcs { - windows = 1; - client = 1; - }; -}; - class ACE_Tests { fcs = QPATHTOF(dev\test_debugConfigs.sqf); }; diff --git a/addons/fcs/dev/test_debugConfigs.sqf b/addons/fcs/dev/test_debugConfigs.sqf index c373912363..dacf8624f3 100644 --- a/addons/fcs/dev/test_debugConfigs.sqf +++ b/addons/fcs/dev/test_debugConfigs.sqf @@ -71,13 +71,13 @@ private _problemUIs = []; _problemUIs pushBackUnique format ["%1: ACE_FCS, but missing ACE_CA_DIST", _turretInfo]; }; if (_aceFCS && {(198 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: ACE_FCS, but NEW Lazr CA_DIST", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: ACE_FCS, but NEW Lazr CA_DIST", _turretInfo, _vehicleType]; }; if ((!_aceFCS) && {(1713151 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: Not ACE but has ACE_CA_DIST", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: Not ACE but has ACE_CA_DIST", _turretInfo, _vehicleType]; }; if (_vanillaFCS && {!(198 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: vanillaFCS but missing NEW Lazr CA_DIST [just a warning]", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: vanillaFCS but missing NEW Lazr CA_DIST [just a warning]", _turretInfo, _vehicleType]; }; }; }; diff --git a/addons/fcs/functions/fnc_calculateSolution.sqf b/addons/fcs/functions/fnc_calculateSolution.sqf index b0cb2ea1c4..de9462848d 100644 --- a/addons/fcs/functions/fnc_calculateSolution.sqf +++ b/addons/fcs/functions/fnc_calculateSolution.sqf @@ -63,7 +63,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret }; } forEach (_vehicle weaponsTurret _turret); - private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; + private _offset = ("ace" callExtension ["fcs", [_initSpeed, _airFriction, _angleTarget, _distance]]) # 0; _offset = parseNumber _offset; _FCSInitSpeed pushBack _initSpeed; diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index e99416593a..d4e79e8461 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -41,7 +41,7 @@ if (_zeroDistance > 0) then { private _weaponCombo = [_weapon, _magazine, _ammo, _zeroDistance]; if (_weaponCombo isNotEqualTo (_gunner getVariable [QGVAR(lastWeaponCombo), []])) then { private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); - private _antiOffset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, 0, _zeroDistance]; + private _antiOffset = ("ace" callExtension ["fcs", [_initSpeed, _airFriction, 0, _zeroDistance]]) # 0; _antiOffset = parseNumber _antiOffset; _gunner setVariable [QGVAR(lastWeaponCombo), _weaponCombo]; diff --git a/addons/field_rations/initSettings.inc.sqf b/addons/field_rations/initSettings.inc.sqf index 86bf04aed2..16e2d4eb2d 100644 --- a/addons/field_rations/initSettings.inc.sqf +++ b/addons/field_rations/initSettings.inc.sqf @@ -4,9 +4,9 @@ [ELSTRING(common,Enabled), LSTRING(Enabled_Description)], LSTRING(DisplayName), false, - true, - {}, - true // Needs restart + 1, + {[QXGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/field_rations/stringtable.xml b/addons/field_rations/stringtable.xml index 2b443ccc3c..1cb3816449 100644 --- a/addons/field_rations/stringtable.xml +++ b/addons/field_rations/stringtable.xml @@ -302,7 +302,7 @@ Influenza la Fatica Avanzata 與進階疲勞聯動 与进阶疲劳联动 - アドバンスド疲労への影響 + 高度な疲労への影響 Влияние на продвинутую усталость Wpływ na zaawansowane zmęczenie Gelişmiş Yorgunluk @@ -317,7 +317,7 @@ Determina se fame e sete influenzano la Fatica Avanzata ACE. 是否讓飲食影響到ACE的進階疲勞。 是否让饮食影响到 ACE 的进阶疲劳。 - 喉の渇きと空腹度が ACE アドバンスド疲労へ与える影響を定義します。 + 喉の渇きと空腹度が ACE 高度な疲労へ与える影響を定義します。 Определяет, будет ли жажда и голод влиять на продвинутую усталость ACE. Kontroluje czy pragnienie i głód mają wpływ na zaawansowane zmęczenie ACE. Acıkınca veya susayınca kişinin yorulup yorulmayacağını belirler. diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index 12e34d0e34..af748b91eb 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -624,7 +624,7 @@ Zaawansowany DAGR DAGR Avanzato 고급형 DAGR입니다 - より高度なDAGR + 高機能なDAGR Продвинутый DAGR DAGR avancé DAGR Avanzado @@ -634,7 +634,7 @@ %3MicroDAGR GPS%4 jest zaawansowaną wersją %3DAGR%4. Dostarcza dane oparte o pozycję, nawigację, i czas (PNT): <br/>%2Kompas i kierunek<br/>%2Datę i godzinę zsynchronizowaną z misją<br/>%2Elewację (relatywną do poziomu morza)<br/>%2Obecną prędkość<br/>%2GPS z widokiem topograficznym i satelitarnym<br/>%2Tworzenie, nazywanie oraz usuwanie waypointów<br/>%2Identyfikację sojuszników (Wymaga ACE BLUFOR Tracker)<br/>Połączenie do dalmierza Vector-21 w celu importu danych (waypointy i współrzędne zmierzonego celu)<br/><br/>%3Użycie: %4<br/>%2Po instrukcję użycia odwiedź %3MicroDAGR%4 wiki. Il %3GPS MicroDAGR%4 è una versione avanzata del %3DAGR%4. Esso mostra dati su posizione, navigazione e tempismo (PNT), includendo:<br/>%2Bussola e azimut<br/>%2Data e ora sincronizzate con la missione<br/>%2Elevazione (dal livello del mare)<br/>%2Velocità attuale<br/>%2GPS con visuale topografica e satellitare<br/>%2Creazione, rinomina e rimozione di waypoint<br/>%2Identificazione di alleati (Richiede Impostazioni ACE BLUFOR Tracker)<br/>Connessione al Telemetro Vector-21 per importazione di dati (creazione waypoint e indicazione di griglia su bersagli puntati)<br/><br/>%3Utilizzo:%4<br/>%2Per informazioni sull'utilizzo sei pregato di visitare la pagina wiki dedicata al %3MicroDAGR%4. %3마이크로DAGR GPS%4는 %3DAGR%4의 고급 버전입니다. 다음과 같이 위치, 내비게이션 및 타이밍(PNT) 데이터를 제공합니다:<br/>%2나침반 및 방향<br/>%2임무와 동기화된 날짜 및 시간<br/>%2고도 (해수면 기준)<br/>%2현재 속도<br/>%2지형 및 위성 시점 기능이 있는 GPS<br/>%2웨이포인트 생성, 작명 및 삭제<br/>%2아군 식별 (ACE의 GPS 피아식별기 켜기 체크 필요)<br/>%2데이터를 가져오기 위한 벡터-21 거리계에 연결(원거리 대상의 웨이포인트 생성 및 좌표 참조)<br/><br/>%3사용 방법:%4<br/>%2사용 방법을 보려면 전용 %3마이크로DAGR%4의 위키를 방문하십시오. - %3MicroDAGR GPS%4は%3DAGR%4のより高度なバージョンです。測位、航法、計時(PNT)データが提供されます。これには以下の情報を含みます:<br/>%2コンパスと方位<br/>%2ミッションに同期された日付と時間<br/>%2標高 (海面に対する相対値)<br/>%2現在の速度<br/>%2地形図と衛星ビューを備えたGPS<br/>%2ウェイポイントの作成、名前付け、および削除<br/>%2友軍の識別 (ACE ブルーフォーストラッキング設定が必要)<br/>ベクター21レンジファインダーへの接続とデータのインポート (ウェイポイントの作成と遠距離ターゲットのグリッド参照)<br/><br/>%3使用方法:%4<br/>%2使用手順については、専用の %3MicroDAGR%4 wiki を参照してください。 + %3MicroDAGR GPS%4は%3DAGR%4のより高機能なバージョンです。測位、航法、計時(PNT)データが提供されます。これには以下の情報を含みます:<br/>%2コンパスと方位<br/>%2ミッションに同期された日付と時間<br/>%2標高 (海面に対する相対値)<br/>%2現在の速度<br/>%2地形図と衛星ビューを備えたGPS<br/>%2ウェイポイントの作成、名前付け、および削除<br/>%2友軍の識別 (ACE ブルーフォーストラッキング設定が必要)<br/>ベクター21レンジファインダーへの接続とデータのインポート (ウェイポイントの作成と遠距離ターゲットのグリッド参照)<br/><br/>%3使用方法:%4<br/>%2使用手順については、専用の %3MicroDAGR%4 wiki を参照してください。 El %3GPS MicroDAGR%4 es una versión avanzada del %3DAGR%4. Provee de posicionamiento, navegación y datos de temporización (PNT) que incluye:<br/>%2Brújula y dirección<br/>%2Fecha y hora sincronizada con la misión<br/>%2Elevación (relativa al nivel del mar)<br/>%2Velocidad actual<br/>%2GPS con vista topográfica y satelital<br/>%2Creación, nombrado y borrado de puntos de ruta<br/>%2Identificación de aliados (Requiere la opción de ACE BLUFOR Tracker)<br/>Conexión con el telémetro Vector-21 para importación de datos (creación de puntos de ruta y referenciado en eje de coordenada para objetivos a distancia)<br/><br/>%3Uso:%4<br/>%2Para instrucciones de uso, por favor visita la Wiki dedicada de %3MicroDAGR%4. diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index bdb0c835b6..66c97c70da 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -62,7 +62,7 @@ Distancia máxima de señalado Maximální dosah pro ukazování směru Raggio massimo puntamento - 指差しの最大範囲 + 指差しの最大距離 가리키기 최대 범위 指向标记最大显示距离 指向指示器最大顯示距離 @@ -79,7 +79,7 @@ Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] Maximální vzdálenost mezi hráči pro ukázání směru [výchozí: 4 metry] Distanza massima tra giocatori per mostrare l'indicatore di puntamento [Predefinito: 4 metri] - 指差しのマーカー表示が他のプレイヤーに表示される最大範囲 [デフォルト: 4メートル] + 指差しのマーカー表示が他のプレイヤーに表示される最大距離 [デフォルト: 4メートル] 플레이어 사이에서 가리키기 표시를 보이게 하는 최대거리를 설정합니다[기본설정: 4 미터] 设定指向标记最大显示距离。[预设:4米] 設定指向指示器最大顯示距離。[預設: 4公尺] diff --git a/addons/fire/addon.toml b/addons/fire/addon.toml deleted file mode 100644 index bf39213892..0000000000 --- a/addons/fire/addon.toml +++ /dev/null @@ -1,3 +0,0 @@ -[tools] -pboProject_noBinConfig = true -sqfvm_skipConfigChecks = true diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index ac98de5dda..e061d1ce91 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -149,7 +149,9 @@ params ["_unit", "_instigator"]; }; // Keep pain around unconsciousness limit to allow for more fun interactions - private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + private _painPercieved = (0 max ((_unit getVariable [QEGVAR(medical,pain), 0]) - (_unit getVariable [QEGVAR(medical,painSuppress), 0])) min 1); + private _painUnconscious = missionNamespace getVariable [QEGVAR(medical,painUnconsciousThreshold), 0]; + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); if (GETEGVAR(medical,enabled,false)) then { if (!isNull _instigator) then { diff --git a/addons/fire/script_component.hpp b/addons/fire/script_component.hpp index d79ca0d490..f4b636286b 100644 --- a/addons/fire/script_component.hpp +++ b/addons/fire/script_component.hpp @@ -17,14 +17,6 @@ #include "\z\ace\addons\main\script_macros.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\medical_engine\script_macros_medical.hpp") -#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" -#else -#define GET_PAIN_PERCEIVED(var) 0 -#define PAIN_UNCONSCIOUS 1 -#endif - #define FIRE_MANAGER_PFH_DELAY 0.25 #define FLARE_SIZE_MODIFIER 5 #define PRONE_ROLLING_ANIMS [\ diff --git a/addons/fortify/config.cpp b/addons/fortify/config.cpp index ab12338982..2808b56cba 100644 --- a/addons/fortify/config.cpp +++ b/addons/fortify/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {QXGVAR(setupModule), QXGVAR(buildLocationModule)}; weapons[] = {"ACE_Fortify"}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/fortify/functions/fnc_getPlaceableSet.sqf b/addons/fortify/functions/fnc_getPlaceableSet.sqf index 9643d54190..d5e610d047 100644 --- a/addons/fortify/functions/fnc_getPlaceableSet.sqf +++ b/addons/fortify/functions/fnc_getPlaceableSet.sqf @@ -37,11 +37,11 @@ _objects = _objects select { if (isClass (configFile >> "CfgVehicles" >> _classname)) then { true } else { - ERROR_2("Preset [%1] - Classname does not exist",_preset,_classname); + ERROR_2("Preset [%1] - Classname [%2] does not exist",_preset,_classname); false }; } else { - ERROR_2("Preset [%1] - Bad data in objects array %2",_preset,_x); + ERROR_2("Preset [%1] - Bad data [%2] in objects array %2",_preset,_x); false }; }; diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index b0630e3a43..1a6243464f 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -110,6 +110,7 @@ 이 수류탄은 굴릴 수 없습니다. %1(으)로 전환되었습니다. Granate kann nicht rollen, zu %1 gewechselt Granata non può rotolare, cambiato a %1 + Grenade ne peut pas rouler, passé à %1 M84 Stun Grenade diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index 0efbe26365..920470c335 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -74,13 +74,9 @@ private _numTransferredHC1 = 0; private _numTransferredHC2 = 0; private _numTransferredHC3 = 0; -private _units = []; -private _transfer = false; -private _previousOwner = -1; - // Transfer AI groups { - _units = units _x; + private _units = units _x; // No transfer if empty group or if group is blacklisted if (_units isEqualTo [] || {_x getVariable [QXGVAR(blacklist), false]}) then { @@ -92,6 +88,8 @@ private _previousOwner = -1; continue; }; + private _transfer = true; + { // No transfer if already transferred if (!_force && {(owner _x) in [_idHC1, _idHC2, _idHC3]}) exitWith { @@ -126,7 +124,7 @@ private _previousOwner = -1; }; // Round robin between HCs if load balance enabled, else pass all to one HC - _previousOwner = groupOwner _x; + private _previousOwner = groupOwner _x; switch (_currentHC) do { case 1: { @@ -145,11 +143,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC1 if (_previousOwner == _idHC1) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], _idHC1] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC1; - [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], _idHC1] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC1 = _numTransferredHC1 + 1; @@ -171,11 +171,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC2 if (_previousOwner == _idHC2) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], _idHC2] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC2; - [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], _idHC2] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC2 = _numTransferredHC2 + 1; @@ -197,11 +199,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC3 if (_previousOwner == _idHC3) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], _idHC3] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC2; - [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], _idHC3] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC3 = _numTransferredHC3 + 1; diff --git a/addons/hearing/XEH_PREP.hpp b/addons/hearing/XEH_PREP.hpp index a2bcbb708a..64161300d3 100644 --- a/addons/hearing/XEH_PREP.hpp +++ b/addons/hearing/XEH_PREP.hpp @@ -1,6 +1,6 @@ PREP(addEarPlugs); PREP(earRinging); -PREP(explosionNear); +PREP(explosion); PREP(firedNear); PREP(getAmmoLoudness); PREP(handleRespawn); diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 4261933bd9..93a86f7349 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -11,6 +11,23 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; }; +["CBA_settingsInitialized", { + TRACE_1("settingInit - common",GVAR(enableCombatDeafness)); + // Only install event handler if combat deafness is enabled + if (!GVAR(enableCombatDeafness)) exitWith {}; + + addMissionEventHandler ["ProjectileCreated", { + params ["_projectile"]; + + if (!local _projectile) exitWith {}; + + // Rockets only explode on local clients + _projectile addEventHandler ["Explode", { + [QGVAR(explosion), _this] call CBA_fnc_globalEvent; + }]; + }]; +}] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; #include "initKeybinds.inc.sqf" @@ -27,7 +44,7 @@ GVAR(volumeAttenuation) = 1; GVAR(lastPlayerVehicle) = objNull; ["CBA_settingsInitialized", { - TRACE_1("settingInit",GVAR(enableCombatDeafness)); + TRACE_1("settingInit - client",GVAR(enableCombatDeafness)); // Only run PFEH and install event handlers if combat deafness is enabled if (!GVAR(enableCombatDeafness)) exitWith {}; @@ -35,6 +52,7 @@ GVAR(lastPlayerVehicle) = objNull; // Spawn volume updating process [LINKFUNC(updateVolume), 1, false] call CBA_fnc_addPerFrameHandler; + [QGVAR(explosion), LINKFUNC(explosion)] call CBA_fnc_addEventHandler; [QGVAR(updateVolume), LINKFUNC(updateVolume)] call CBA_fnc_addEventHandler; // Update veh attunation when player veh changes @@ -71,12 +89,7 @@ GVAR(lastPlayerVehicle) = objNull; private _firedEH = _oldPlayer getVariable [QGVAR(firedEH), -1]; _oldPlayer removeEventHandler ["FiredNear", _firedEH]; _oldPlayer setVariable [QGVAR(firedEH), nil]; - - private _explosionEH = _oldPlayer getVariable [QGVAR(explosionEH), -1]; - _oldPlayer removeEventHandler ["Explosion", _explosionEH]; - _oldPlayer setVariable [QGVAR(explosionEH), nil]; - - TRACE_3("removed unit eh",_oldPlayer,_firedEH,_explosionEH); + TRACE_2("removed unit eh",_oldPlayer,_firedEH); }; // Don't add a new EH if the unit respawned if ((_player getVariable [QGVAR(firedEH), -1]) == -1) then { @@ -86,11 +99,7 @@ GVAR(lastPlayerVehicle) = objNull; private _firedEH = _player addEventHandler ["FiredNear", {call FUNC(firedNear)}]; _player setVariable [QGVAR(firedEH), _firedEH]; - - private _explosionEH = _player addEventHandler ["Explosion", {call FUNC(explosionNear)}]; - _player setVariable [QGVAR(explosionEH), _explosionEH]; - - TRACE_3("added unit eh",_player,_firedEH,_explosionEH); + TRACE_2("added unit eh",_player,_firedEH); }; GVAR(deafnessDV) = 0; diff --git a/addons/hearing/functions/fnc_explosion.sqf b/addons/hearing/functions/fnc_explosion.sqf new file mode 100644 index 0000000000..159f666011 --- /dev/null +++ b/addons/hearing/functions/fnc_explosion.sqf @@ -0,0 +1,55 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Handles deafness due to explosions going off near the player. + * + * Arguments: + * 0: Projectile + * 1: Explosion position ASL + * 2: Velocity (unused) + * + * Return Value: + * None + * + * Example: + * [_projectile, [0, 0, 0], [0, 0, 0]] call ace_hearing_fnc_explosion + * + * Public: No + */ + +// Ignore spectators, curators and alike +if ((getNumber (configOf ACE_player >> "isPlayableLogic")) == 1) exitWith {}; + +params ["_projectile", "_pos"]; + +// Don't allow for distances under 1 +private _distance = ((eyePos ACE_player) vectorDistance _pos) max 1; + +// Fast exit if explosion far away +if (_distance > 100) exitWith { + TRACE_1("too far away",_distance); +}; + +private _ammoConfig = configOf _projectile; +private _explosive = getNumber (_ammoConfig >> "explosive"); + +private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player}); + +TRACE_5("",typeOf _projectile,_distance,_explosive,_audibleFire,_vehAttenuation); + +(if (isArray (_ammoConfig >> "soundHit1")) then { + getArray (_ammoConfig >> "soundHit1") +} else { + getArray (_ammoConfig >> "soundHit") +}) params ["", ["_volume", 1], "", ["_maxDistance", 1500]]; + +if (_distance > _maxDistance) exitWith { + TRACE_2("too far away",_distance,_maxDistance); +}; + +private _strength = _vehAttenuation * _explosive * _volume * _maxDistance / _distance^2; + +TRACE_2("strength",_volume,_strength); + +// Call immediately, as it will get picked up later by the update thread anyway +_strength call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf deleted file mode 100644 index 583c55749e..0000000000 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: KoffeinFlummi, commy2, Ruthberg - * Handles deafness due to explosions going off near the player. - * - * Arguments: - * 0: Unit - * 1: Damage inflicted to the unit - * - * Return Value: - * None - * - * Example: - * [clientExplosionEvent] call ace_hearing_fnc_explosionNear - * - * Public: No - */ - -params ["_unit", "_damage"]; - -TRACE_2("explosion near player",_unit,_damage); - -private _strength = (0 max _damage) * 30; - -// Call immediately, as it will get picked up later by the update thread anyway -_strength call FUNC(earRinging); diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 9aba1ab56b..08419d4e42 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -372,6 +372,7 @@ Mettre/enlever les bouchons Ohrstöpsel einsetzen/herausnehmen Poner/quitar tapones + Colocar/retirar protetores auriculares Only units with heavy weapons @@ -382,6 +383,7 @@ Sólo unidades con armas pesadas Solo a unità con armi pesanti 중화기를 가진 유닛만 해당 + Apenas unidades com armas pesadas diff --git a/addons/hellfire/CfgAmmo.hpp b/addons/hellfire/CfgAmmo.hpp index 5eef9ad47e..02346deac3 100644 --- a/addons/hellfire/CfgAmmo.hpp +++ b/addons/hellfire/CfgAmmo.hpp @@ -26,9 +26,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.01; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 30; // degrees per second + yawRate = 30; canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -39,6 +38,9 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 70; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -49,6 +51,19 @@ class CfgAmmo { // Attack profile type selection defaultAttackProfile = "hellfire"; attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = QFUNC(midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; class ACE_Hellfire_AGM114N: ACE_Hellfire_AGM114K { @@ -75,8 +90,8 @@ class CfgAmmo { canVanillaLock = 1; enabled = 1; // Missile Guidance must be explicitly enabled seekLastTargetPos = 0; - defaultSeekerType = "ARH"; - seekerTypes[] = { "ARH" }; + defaultSeekerType = "MillimeterWaveRadar"; + seekerTypes[] = { "MillimeterWaveRadar" }; defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; diff --git a/addons/hellfire/XEH_PREP.hpp b/addons/hellfire/XEH_PREP.hpp index f30cf0bffd..011810aa04 100644 --- a/addons/hellfire/XEH_PREP.hpp +++ b/addons/hellfire/XEH_PREP.hpp @@ -2,3 +2,4 @@ LOG("prep"); PREP(attackProfile); PREP(getAttackProfileSettings); PREP(setupVehicle); +PREP(midCourseTransition); diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index 26bc3f1ff0..221d99e7ae 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -18,80 +18,99 @@ */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH", "_launchParams", "", "", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "", "_stateParams"]; _stateParams params ["", "_seekerStateParams"]; _launchParams params ["","_targetLaunchParams","_seekerType"]; -_targetLaunchParams params ["", "", "_launchPos"]; +_targetLaunchParams params ["", "", "_launchPos", "_launchDir"]; _firedEH params ["","","","","","","_projectile"]; // Get state params: if (_attackProfileStateParams isEqualTo []) then { _this call FUNC(getAttackProfileSettings); }; -_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear"]; - +_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear", "_missileStateData"]; private _projectilePos = getPosASL _projectile; private _distanceFromLaunch2d = _launchPos distance2d _projectilePos; private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2); // Add height depending on distance for compensate -private _returnTargetPos = nil; +private _returnTargetPos = _seekerTargetPos; +if (_returnTargetPos isEqualTo [0, 0, 0]) then { + private _initialDistanceToTarget = 8000; + _returnTargetPos = _launchPos vectorAdd (_launchDir vectorMultiply _initialDistanceToTarget); +}; + +private _closingRate = vectorMagnitude velocity _projectile; +// subtract 500 meters to account for the fact that we don't want to be at the perfect pitch exactly when we cross the target +// 500 seemed good in testing +private _timeToGo = ((_projectilePos distance2d _seekerTargetPos) - 500) / _closingRate; + +// we could do stuff like desired attack angle, but I'm not going that far today +private _los = _projectilePos vectorFromTo _seekerTargetPos; + +_flightParams params ["_pitchRate", "_yawRate"]; + +private _angleToTarget = acos ((vectorDir _projectile) vectorCos _los); +private _atMinRotationAngle = _angleToTarget >= (_pitchRate * _timeToGo); switch (_attackStage) do { case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask - _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; - _returnTargetPos set [2, (_projectilePos select 2) + 36.4]; // 100 and 36.4 gives a 20 deg angle + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 20)]; // 100 and 36.4 gives a 20 deg angle if (_heightAboveLaunch > _configLaunchHeightClear) then { _attackProfileStateParams set [0, STAGE_SEEK_CRUISE]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch); }; + + if (_atMinRotationAngle) then { + _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; + TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); + }; }; case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + // Before 4000 cruise at 5.7 degrees up, then level out - private _cruiseHeight = linearConversion [3000, 5000, _distanceFromLaunch2d, 10, 0, true]; - - _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; - _returnTargetPos set [2, (_projectilePos select 2) + _cruiseHeight]; - + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 5.7)]; + if (_seekerTargetPos isNotEqualTo [0,0,0]) then { _attackProfileStateParams set [0, STAGE_ATTACK_CRUISE]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d); }; }; case STAGE_ATTACK_CRUISE: { + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2); private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; - private _distToGoRatio = _distanceToTarget2d / (_launchPos distance2d _seekerTargetPos); - // arcing up at 7 degrees to start until 50% left, then smooth curve to a downward attack - private _gainSlope = linearConversion [0.5, 0.1, _distToGoRatio, 7, -7, true]; - _returnTargetPos = +_seekerTargetPos; - _returnTargetPos set [2, ((_projectilePos select 2) + (_distanceToTarget2d * sin _gainSlope)) max (_seekerTargetPos select 2)]; + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 7)]; - if ((_distanceToTarget2d < 500) || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle + // if we are at the rotation limit, rotate to target + if (_atMinRotationAngle || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); }; }; case STAGE_ATTACK_TERMINAL: { - private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; - _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget2d * 0.02]; }; }; -// Special radar case. Adjust target position such that we are leading it -if (_attackStage >= 3 && { _seekerType isEqualTo "ARH" }) then { - _seekerStateParams params ["", "", "", "", "", "", "", "_lastKnownVelocity"]; - private _projectileVelocity = velocity _projectile; - if (_projectileVelocity#2 < 0) then { - private _projectileSpeed = vectorMagnitude _projectileVelocity; // this gives a precise impact time versus using speed _projectile. Dont change - private _timeUntilImpact = (_seekerTargetPos distance _projectilePos) / _projectileSpeed; - _returnTargetPos = _returnTargetPos vectorAdd (_lastKnownVelocity vectorMultiply _timeUntilImpact); - }; -}; +// missile guidance defines this variable in doAttackProfile +//IGNORE_PRIVATE_WARNING ["_attackProfileName"]; +_attackProfileName = ["na", "hellfire - LAUNCH", "hellfire - SEEK CRUISE", "hellfire - ATTACK CRUISE", "hellfire - TERMINAL"] select _attackStage; -// TRACE_1("Adjusted target position",_returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf index 14d89f82e3..b032c44d23 100644 --- a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -27,6 +27,8 @@ private _attackConfig = configFile >> QEGVAR(missileguidance,AttackProfiles) >> // Launch (clearing terrain mask for LO/HI): private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeightClear)); +private _projectilePos = getPosASL _projectile; + // Get starting stage private _startingStage = if (_configLaunchHeightClear > 0) then { STAGE_LAUNCH; // LOAL-HI / LO @@ -40,5 +42,9 @@ private _startingStage = if (_configLaunchHeightClear > 0) then { // Set data in param array _attackProfileStateParams set [0, _startingStage]; _attackProfileStateParams set [1, _configLaunchHeightClear]; +_attackProfileStateParams set [2, [ + _projectilePos select 2, + _seekerTargetPos distance2d _projectilePos +]]; TRACE_1("new shot settings",_attackProfileStateParams); diff --git a/addons/hellfire/functions/fnc_midCourseTransition.sqf b/addons/hellfire/functions/fnc_midCourseTransition.sqf new file mode 100644 index 0000000000..ee56773410 --- /dev/null +++ b/addons/hellfire/functions/fnc_midCourseTransition.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Condition to switch to next navigation profile + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_hellfire_fnc_midCourseTransition + * + * Public: No + */ + +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +_attackProfileStateParams params ["_state"]; +_state isEqualTo STAGE_ATTACK_TERMINAL; + diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index ff541ad6a3..e60be5b353 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -24,6 +24,8 @@ 플레이어가 무기를 떨굴 확률 (팔 피격) Spieler Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) Probabilità dei giocatori di far cadere l'arma (colpo al braccio) + Probabilité de lâcher l'arme (coup au bras) + Probabilidade do jogador de largar a arma após tiro no braço AI Weapon Drop Chance (Arm Hit) @@ -32,6 +34,8 @@ 인공지능이 무기를 떨굴 확률 (팔 피격) KI-Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) Probabilità dell'IA di far cadere l'arma (colpo al braccio) + Probabilité de l'IA de lâcher l'arme (coup au bras) + Probabilidade da IA de largar a arma após tiro no braço diff --git a/addons/hot/CfgAmmo.hpp b/addons/hot/CfgAmmo.hpp index 1be8c6067f..c5978b6d92 100644 --- a/addons/hot/CfgAmmo.hpp +++ b/addons/hot/CfgAmmo.hpp @@ -58,12 +58,13 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0030; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + showTrail = 1; + // Guidance type for munitions defaultSeekerType = "SACLOS"; seekerTypes[] = { "SACLOS" }; @@ -71,6 +72,14 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 7; + lineGainD = 6; + + initialPitch = 2; + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 30; // Angle from the shooter's view that can track the missile seekerAccuracy = 1; // seeker accuracy multiplier @@ -78,7 +87,6 @@ class CfgAmmo { seekerMinRange = 75; seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - correctionDistance = 8; // distance from center of crosshair where missile slows down offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair. // Attack profile type selection diff --git a/addons/hot/CfgVehicles.hpp b/addons/hot/CfgVehicles.hpp index db5b8b5262..46ac7d5136 100644 --- a/addons/hot/CfgVehicles.hpp +++ b/addons/hot/CfgVehicles.hpp @@ -4,11 +4,22 @@ class CfgVehicles { class Turrets; }; class LT_01_base_F: Tank_F { + class AnimationSources; class Turrets: Turrets { class MainTurret; }; }; class LT_01_AT_base_F: LT_01_base_F { + class AnimationSources: AnimationSources { + class Missiles_revolving { + source = "revolving"; + weapon = QGVAR(generic_launcher); + }; + class Missiles_reloadMagazine { + source = "reloadMagazine"; + weapon = QGVAR(generic_launcher); + }; + }; class Turrets: Turrets { class MainTurret: MainTurret { weapons[] = {"SmokeLauncher","HMG_127",QGVAR(generic_launcher)}; diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 411dbfe30e..65542c66e8 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -70,6 +70,7 @@ GVAR(no_cams) sort true; //Close monitor if we no longer have the item: if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; @@ -113,6 +114,7 @@ GVAR(no_cams) sort true; if (player != ACE_player) then { player remoteControl ACE_player; }; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; switch (GVAR(ZOOM)) do { diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 60b7a1fc14..efb9e139d1 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -18,16 +18,19 @@ #define __TYPE_WRITER_DELAY 0.05 -if ((ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand") then { +if (missionNamespace getVariable [QGVAR(animatePlayer), true] && {(ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand"}) then { ACE_player playMove "AmovPercMstpSrasWrflDnon_diary"; }; HUNTIR_BACKGROUND_LAYER_ID cutText ["", "BLACK", 0]; createDialog QGVAR(cam_dialog_off); +[QGVAR(monitorOpened), [ACE_player]] call CBA_fnc_localEvent; + [{ if (!dialog) exitWith { HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN", 0]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; closeDialog 0; createDialog QGVAR(cam_dialog_inactive); @@ -40,10 +43,12 @@ createDialog QGVAR(cam_dialog_off); GVAR(message) = []; GVAR(messageSearching) = toArray "Searching....."; GVAR(messageConnecting) = toArray "Connecting....."; + [QGVAR(monitorStarted), [ACE_player]] call CBA_fnc_localEvent; [{ //Close monitor if we no longer have item: if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; private _elapsedTime = CBA_missionTime - GVAR(startTime); @@ -55,6 +60,7 @@ createDialog QGVAR(cam_dialog_off); GVAR(done) = false; GVAR(message) = []; GVAR(connectionDelay) = 5; + [QGVAR(monitorDisconnected), [ACE_player]] call CBA_fnc_localEvent; }; if ((!dialog) || GVAR(done)) exitWith { @@ -64,6 +70,7 @@ createDialog QGVAR(cam_dialog_off); [_nearestHuntIRs select 0] call FUNC(cam); } else { HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; }; switch (GVAR(state)) do { @@ -75,9 +82,11 @@ createDialog QGVAR(cam_dialog_off); GVAR(message) = []; if (_elapsedTime > 10) then { GVAR(state) = "noGDS"; + [QGVAR(monitorNoGDS), [ACE_player]] call CBA_fnc_localEvent; }; if (_elapsedTime > 5 && {{_x getHitPointDamage "HitCamera" < 0.25} count _nearestHuntIRs > 0}) then { GVAR(state) = "connecting"; + [QGVAR(monitorConnecting), [ACE_player]] call CBA_fnc_localEvent; }; }; }; @@ -91,6 +100,7 @@ createDialog QGVAR(cam_dialog_off); if (GVAR(connectionDelay) <= 0) then { GVAR(done) = true; GVAR(state) = "connected"; + [QGVAR(monitorConnected), [ACE_player, _nearestHuntIRs select 0]] call CBA_fnc_localEvent; }; }; }; @@ -100,6 +110,7 @@ createDialog QGVAR(cam_dialog_off); GVAR(done) = true; closedialog 0; HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }, [], 3, 0] call CBA_fnc_waitAndExecute; }; }; diff --git a/addons/intelitems/CfgWeapons.hpp b/addons/intelitems/CfgWeapons.hpp new file mode 100644 index 0000000000..727b163de2 --- /dev/null +++ b/addons/intelitems/CfgWeapons.hpp @@ -0,0 +1,17 @@ +class CfgWeapons { + class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; + + // Since base game doesn't support misc. items, this is needed to filling inventories in the editor + class GVAR(notepad_Item): ACE_ItemCore { + displayName = CSTRING(Notepad_DisplayName); + author = ECSTRING(common,ACETeam); + scope = 2; + scopeArsenal = 0; + descriptionShort = CSTRING(Notepad_Description); + picture = QPATHTOF(ui\notepad_ca.paa); + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.1; + }; + }; +}; diff --git a/addons/intelitems/XEH_postInit.sqf b/addons/intelitems/XEH_postInit.sqf index f416b3667e..f79ae9f636 100644 --- a/addons/intelitems/XEH_postInit.sqf +++ b/addons/intelitems/XEH_postInit.sqf @@ -1,5 +1,8 @@ #include "script_component.hpp" +// Notepad item to magazine +[QGVAR(notepad_Item), QXGVAR(notepad)] call EFUNC(common,registerItemReplacement); + // Only handle loadout change when on map or have open controls ["loadout", { if (!visibleMap && {GVAR(controlsGroups) isEqualTo []}) exitWith {}; diff --git a/addons/intelitems/config.cpp b/addons/intelitems/config.cpp index 3b9b37b5b6..1eafb3fe86 100644 --- a/addons/intelitems/config.cpp +++ b/addons/intelitems/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { QXGVAR(document), QXGVAR(photo) }; - weapons[] = {}; + weapons[] = {QGVAR(notepad_Item)}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interact_menu", "ace_zeus"}; author = ECSTRING(common,ACETeam); @@ -23,5 +23,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgEditorSubcategories.hpp" #include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "gui.hpp" diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 88269bcc04..a62996df68 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -88,8 +88,8 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesAll) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_objectType", "_typeNum", "_parentPath", "_action"]; - if (_object isKindOf _objectType) then { + _x params ["_objectType", "_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; } forEach GVAR(inheritedActionsAll); @@ -102,8 +102,10 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesMan) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_typeNum", "_parentPath", "_action"]; - [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + _x params ["_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; } forEach GVAR(inheritedActionsMan); END_COUNTER(InitPost); }, true, ["VirtualMan_F"]] call CBA_fnc_addClassEventHandler; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 756e8775ab..d29a9fb687 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -21,10 +21,3 @@ class CfgPatches { #include "CursorMenus.hpp" #include "ACE_Settings.hpp" - -class ACE_Extensions { - class ace_break_line { - windows = 1; - client = 1; - }; -}; diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index ccea8c4654..91197d02d9 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Insert an ACE action to a class, under a certain path + * Inserts an ACE action to a class, under a certain path. * Note: This function is NOT global. * * Arguments: @@ -10,12 +10,13 @@ * 2: Parent path of the new action * 3: Action * 4: Use Inheritance (default: false) + * 5: Classes excluded from inheritance (children included) (default: []) * * Return Value: * The entry full path, which can be used to remove the entry, or add children entries . * * Example: - * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"], VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; * * Public: Yes */ @@ -25,22 +26,30 @@ if (!params [["_objectType", "", [""]], ["_typeNum", 0, [0]], ["_parentPath", [] ERROR("Bad Params"); [] }; -TRACE_4("addActionToClass",_objectType,_typeNum,_parentPath,_action); +private _useInheritance = _this param [4, false, [false]]; +private _excludedClasses = _this param [5, [], [[]]]; +TRACE_6("addActionToClass",_objectType,_typeNum,_parentPath,_action,_useInheritance,_excludedClasses); -if (param [4, false, [false]]) exitwith { +if (_useInheritance) exitwith { BEGIN_COUNTER(addAction); + private _cfgVehicles = configFile >> "CfgVehicles"; // store this so we don't resolve for every element + _excludedClasses = (_excludedClasses apply {configName (_cfgVehicles >> _x)}) - [""]; // ends up being faster than toLower'ing everything else if (_objectType == "CAManBase") then { - GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action]; + GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action, _excludedClasses]; { - [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); - } forEach GVAR(inheritedClassesMan); - } else { - GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action]; - { - if (_x isKindOf _objectType) then { + private _type = _x; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; - } forEach GVAR(inheritedClassesAll); + } forEach (GVAR(inheritedClassesMan) - _excludedClasses); + } else { + GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action, _excludedClasses]; + { + private _type = _x; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; + } forEach (GVAR(inheritedClassesAll) - _excludedClasses); }; END_COUNTER(addAction); diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 8f19dfabbe..c2230efc4f 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -119,7 +119,7 @@ private _actions = [ // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)}, {}, {}, "Spine3", diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 9cb638bcea..2ae39bff26 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -36,7 +36,7 @@ if (_isTextEditing) then { if ( _isTextEditing || {(isNull curatorCamera) && { - !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) } }) exitWith {false}; diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 7585616ef6..87cc8609cc 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -1,29 +1,63 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Removes an action from a class + * Removes an action from a class. * * Arguments: * 0: TypeOf of the class * 1: Type of action, 0 for actions, 1 for self-actions * 2: Full path of the new action + * 3: Remove action from child classes (default: false) * * Return Value: * None * * Example: - * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight", "VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; * * Public: No */ -params ["_objectType", "_typeNum", "_fullPath"]; +params ["_objectType", "_typeNum", "_fullPath", ["_useInheritance", false, [false]]]; _objectType = _objectType call EFUNC(common,getConfigName); private _res = _fullPath call FUNC(splitPath); _res params ["_parentPath", "_actionName"]; +if (_useInheritance) exitWith { + // Only need to run for classes that have already been initialized + { + [_x, _typeNum, _fullPath] call FUNC(removeActionFromClass); + } forEach (GVAR(inheritedClassesAll) select {_x isKindOf _objectType}); + + // Find same path and actionName, and check if it's a parent class, needs to be checked for all classes + private _index = GVAR(inheritedActionsAll) findIf { + _x params ["_currentType", "", "_currentParentPath", "_currentAction"]; + + [_objectType isKindOf _currentType, _currentParentPath, _currentAction select 0] isEqualTo [true, _parentPath, _actionName] + }; + + // Add to exclude classes + if (_index != -1) then { + (GVAR(inheritedActionsAll) select _index select 4) pushBackUnique _objectType; + }; + + // Children of CAManBase need special treatment because of inheritedActionsMan array + if (_objectType isKindOf "CAManBase") then { + private _index = GVAR(inheritedActionsMan) findIf { + _x params ["", "_currentParentPath", "_currentAction"]; + + [_currentParentPath, _currentAction select 0] isEqualTo [_parentPath, _actionName] + }; + + // Different index because array doesn't include _objectType + if (_index != -1) then { + (GVAR(inheritedActionsMan) select _index select 3) pushBackUnique _objectType; + }; + }; +}; + private _namespace = [GVAR(ActNamespace), GVAR(ActSelfNamespace)] select _typeNum; private _actionTrees = _namespace getOrDefault [_objectType, []]; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index fffa5e91a7..78b709472a 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -41,7 +41,7 @@ if (_iconFile isEqualTo "") then { _text = if ([GVAR(useListMenu), GVAR(useListMenuSelf)] select GVAR(keyDownSelfAction)) then { format ["%4", _iconFile, _iconColor, _textSettings, _text] } else { - format ["
%4", _iconFile, _iconColor, _textSettings, "ace_break_line" callExtension _text]; + format ["
%4", _iconFile, _iconColor, _textSettings, ("ace" callExtension ["break_line", [_text]]) select 0]; }; [_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached); diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 6ae0d4a982..128e79c9f5 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -316,6 +316,12 @@ class CfgVehicles { statement = QUOTE(_player call FUNC(renameGroupUI)); showDisabled =1; }; + class ACE_groupDropDistantUnits { + displayName = CSTRING(groupDropDistantUnits); + condition = QUOTE(call FUNC(canGroupDropDistantUnits)); + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; + statement = QUOTE(call FUNC(groupDropDistantUnits)); + }; }; class ACE_Equipment { @@ -372,6 +378,39 @@ class CfgVehicles { }; class Car_F: Car {}; + class Offroad_01_base_F: Car_F { + class GVAR(anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.15, -0.2}, {1.05, -1.15, -0.2}, {1.05, -2.5, -0.2}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class Offroad_01_military_base_F: Offroad_01_base_F {}; + class Offroad_01_armed_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1.03, -0.8}, {1.05, -1.03, -0.8}, {1.05, -2.38, -0.8}}; + }; + }; + }; + class Offroad_01_AT_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1.25, -0.2}, {1.05, -1.25, -0.2}, {1.05, -2.6, -0.2}}; + }; + }; + }; + class Offroad_01_military_covered_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1, -0.27}, {1.05, -1, -0.27}, {1.05, -2.35, -0.27}}; + }; + }; + }; + class Quadbike_01_base_F: Car_F { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -405,6 +444,45 @@ class CfgVehicles { }; }; + class Wheeled_APC_F; + class APC_Wheeled_01_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + distance = 3; + }; + }; + }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class GVAR(anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class Tank: LandVehicle { class ACE_Actions { class ACE_MainActions { @@ -432,6 +510,82 @@ class CfgVehicles { }; }; }; + class Tank_F; + class LT_01_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + class showBags2: showBags { + positions[] = {"_target selectionPosition ['vhc_bags2', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + + class APC_Tracked_01_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + positions[] = {"private _pos = _target selectionPosition 'vhc_bags'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags: showBags { + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + }; + }; + }; + + class APC_Tracked_02_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class GVAR(anims); + }; + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; class Motorcycle: LandVehicle { class ACE_Actions { diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index 554f903704..2369570278 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -36,6 +36,8 @@ PREP(pullOutBody); PREP(canRenameGroup); PREP(renameGroupUI); PREP(renameGroup); +PREP(canGroupDropDistantUnits); +PREP(groupDropDistantUnits); // Weapon Attachments PREP(getWeaponAttachmentsActions); @@ -54,4 +56,5 @@ PREP(push); // misc PREP(canFlip); +PREP(initAnimActions); PREP(replaceTerrainObject); diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index f461e2a770..dc1c167d7c 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -149,11 +149,20 @@ GVAR(isOpeningDoor) = false; ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); ["CBA_settingsInitialized", { + TRACE_2("settingsInitialized",GVAR(disableNegativeRating),GVAR(enableAnimActions)); + if (GVAR(disableNegativeRating)) then { player addEventHandler ["HandleRating", { (_this select 1) max 0 }]; }; + + if (!GVAR(enableAnimActions)) exitWith {}; + + // Don't add inherited anim actions (but actions are added to child classes) + { + [_x, "InitPost", LINKFUNC(initAnimActions), true, [], true] call CBA_fnc_addClassEventHandler; + } forEach (keys (uiNamespace getVariable QGVAR(animActionsClasses))); }] call CBA_fnc_addEventHandler; { @@ -162,7 +171,6 @@ GVAR(isOpeningDoor) = false; }] call CBA_fnc_addPlayerEventHandler; } forEach ["loadout", "weapon"]; - // add "Take _weapon_" action to dropped weapons private _action = [ // action display name will be overwritten in modifier function diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index c5873bcfc9..ec73b62b1b 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -16,6 +16,7 @@ DFUNC(repair_Statement) = { // moved from config because of build problems }; if (hasInterface) then { + GVAR(initializedAnimClasses) = []; GVAR(replaceTerrainModels) = createHashMapFromArray call (uiNamespace getVariable QGVAR(cacheReplaceTerrainModels)); }; diff --git a/addons/interaction/XEH_preStart.sqf b/addons/interaction/XEH_preStart.sqf index 331b5c6d36..39da54b3b5 100644 --- a/addons/interaction/XEH_preStart.sqf +++ b/addons/interaction/XEH_preStart.sqf @@ -23,3 +23,13 @@ private _cacheReplaceTerrainModels = createHashMap; } forEach _replaceTerrainClasses; uiNamespace setVariable [QGVAR(cacheReplaceTerrainModels), compileFinal str _cacheReplaceTerrainModels]; + + +// Cache classes with anim actions +private _animActionsClasses = (QUOTE(isClass (_x >> QQGVAR(anims)) && {!isClass (inheritsFrom _x >> QQGVAR(anims))}) configClasses (configFile >> "CfgVehicles")); +_animActionsClasses = _animActionsClasses apply { configName _x }; +_animActionsClasses = _animActionsClasses select { + private _class = _x; + (_animActionsClasses findIf {(_class != _x) && {_class isKindOf _x}}) == -1 // filter classes that already have a parent in the list +}; +uiNamespace setVariable [QGVAR(animActionsClasses), compileFinal (_animActionsClasses createHashMapFromArray [])]; diff --git a/addons/interaction/functions/fnc_canGroupDropDistantUnits.sqf b/addons/interaction/functions/fnc_canGroupDropDistantUnits.sqf new file mode 100644 index 0000000000..b13abc1039 --- /dev/null +++ b/addons/interaction/functions/fnc_canGroupDropDistantUnits.sqf @@ -0,0 +1,20 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Checks if the unit can drop distant units from their group + * + * Arguments: + * 0: Unit + * + * Return Value: + * Unit can drop distant units + * + * Example: + * [player] call ace_interaction_fnc_canGroupDropDistantUnits + * + * Public: No + */ + +params ["_unit"]; + +(_unit == leader _unit) && {missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100] > 0} diff --git a/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf b/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf index a314a8b601..e8b7e47d75 100644 --- a/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf +++ b/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf @@ -11,13 +11,16 @@ * Unit can interact with vehicle crew * * Example: - * [cursorObject, player] call ace_interaction_fnc_canInteractWithVehicleCrew + * [player, cursorObject] call ace_interaction_fnc_canInteractWithVehicleCrew * * Public: No */ params ["_player", "_vehicle"]; +if (GVAR(interactWithEnemyCrew) == 2) exitWith { true }; +if ((GVAR(interactWithEnemyCrew) == 1) && {_vehicle isKindOf "StaticWeapon"}) exitWith { true }; + private _crew = crew _vehicle; // If vehicle is empty, quit diff --git a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf index c771589904..e91a027068 100644 --- a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf +++ b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: mharis001, Dystopian + * Author: mharis001, Dystopian, PabstMirror, johnb43 * Returns children actions for weapon attachment switching. * * Arguments: @@ -21,48 +21,115 @@ params ["_unit"]; params ["_unit"]; private _currentWeapon = currentWeapon _unit; - if (_currentWeapon isEqualTo "") exitWith {[]}; - private _weaponItems = _unit weaponAccessories _currentWeapon; + + if (_currentWeapon == "") exitWith {[]}; + private _cfgWeapons = configFile >> "CfgWeapons"; - private _actions = []; + private _weaponItems = _unit weaponAccessories _currentWeapon; - // "attach" actions - private _items = _unit call EFUNC(common,uniqueItems); - private _compatibleItems = _currentWeapon call CBA_fnc_compatibleItems; - { + // Get current weapon attachments, as well as compatible attachments in inventory + private _allAttachments = (+_weaponItems) - [""]; + _allAttachments append ((_unit call EFUNC(common,uniqueItems)) arrayIntersect (compatibleItems _currentWeapon)); + + (_allAttachments arrayIntersect _allAttachments) apply { private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsAttach), getText (_config >> "displayName")]; - private _picture = getText (_config >> "picture"); - private _type = getNumber (_config >> "itemInfo" >> "type"); - private _oldAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); - - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, _x, _oldAttachment] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach ((_items arrayIntersect _compatibleItems) - _weaponItems); - - // "detach" actions - { - if (_x isEqualTo "") then {continue}; - - private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsDetach), getText (_config >> "displayName")]; + private _name = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, "", _x] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach _weaponItems; + [ + [ + _x, + _name, + _picture, + {}, + {true}, + { + params ["", "_unit", "_args"]; + _args params ["_attachment", "_name", "_picture", "_weaponItems", "_currentWeapon"]; - _actions + private _cfgWeapons = configFile >> "CfgWeapons"; + private _attachmentNotOnGun = !(_attachment in _weaponItems); + private _actions = []; + + // "attach" action + if (_attachmentNotOnGun && {[_unit, _attachment] call EFUNC(common,hasItem)}) then { + private _type = getNumber (_cfgWeapons >> _attachment >> "itemInfo" >> "type"); + private _currentAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); + + _actions pushBack [ + [ + QGVAR(attach_) + _attachment, + LLSTRING(weaponAttachmentsAttach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, _attachment, _currentAttachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + + // Don't show interaction with attachments that aren't on the current weapon + if (_attachmentNotOnGun) exitWith {_actions}; + + // "detach" action + _actions pushBack [ + [ + QGVAR(detach_) + _attachment, + LLSTRING(weaponAttachmentsDetach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, "", _attachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + + private _CBA_PIPItems = configFile >> "CBA_PIPItems"; + + // "switch" action + { + // Ignore 2D scopes when using a PIP scope (e.g. CUP uses this) + if (getText (_CBA_PIPItems >> _x) == _attachment) then { + continue; + }; + + private _config = _cfgWeapons >> _x; + private _modeName = getText (_config >> "MRT_SwitchItemHintText"); + + if (_modeName == "") then { + _modeName = getText (_config >> "displayName"); + }; + + _actions pushBack [ + [ + QGVAR(switch_) + _x, + format ["%1: %2", localize "str_sensortype_switch", _modeName], + getText (_config >> "picture"), + { + params ["", "_unit", "_actionParams"]; + _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; + [_unit, _weapon, _oldAttachment, _newAttachment] call EFUNC(common,switchAttachmentMode); + }, + {true}, + {}, + [_currentWeapon, _x, _attachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + } forEach ((_attachment call CBA_fnc_switchableAttachments) - [_attachment]); // Don't allow switching to current mode + + _actions + }, + [_x, _name, _picture, _weaponItems, _currentWeapon] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ] + } // return }, _unit, QGVAR(weaponAttachmentsActions), 5, QGVAR(clearWeaponAttachmentsActionsCache)] call EFUNC(common,cachedCall); diff --git a/addons/interaction/functions/fnc_groupDropDistantUnits.sqf b/addons/interaction/functions/fnc_groupDropDistantUnits.sqf new file mode 100644 index 0000000000..40875b8580 --- /dev/null +++ b/addons/interaction/functions/fnc_groupDropDistantUnits.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Drops distant units from their group + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_interaction_fnc_groupDropDistantUnits + * + * Public: No + */ + +params ["_unit"]; + +{ + if ((_x distance _unit) > (missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100])) then { + TRACE_1("drop",_x); + [_x] joinSilent grpNull; + }; +} forEach (units group _unit); diff --git a/addons/interaction/functions/fnc_initAnimActions.sqf b/addons/interaction/functions/fnc_initAnimActions.sqf new file mode 100644 index 0000000000..7f3cde8d9e --- /dev/null +++ b/addons/interaction/functions/fnc_initAnimActions.sqf @@ -0,0 +1,202 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Initializes object interactions based on animations. + * + * Arguments: + * 0: Target + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_interaction_fnc_initAnimActions + * + * Public: No + */ + +params ["_object"]; + +private _class = typeOf _object; + +if (_class in GVAR(initializedAnimClasses)) exitWith {}; + +GVAR(initializedAnimClasses) pushBack _class; + +private _statement = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase", "_duration", "_text"]; + TRACE_5("statement",_target,_player,_anim,_phase,_duration); + + [ + _duration, + [_target, _player, _anim, _phase], + { + (_this select 0) params ["_target", "_player", "_anim", "_phase"]; + + private _items = _target getVariable [ + format [QGVAR(animsItems_%1), _anim], + getArray (configOf _target >> QGVAR(anims) >> _anim >> "items") + ]; + + // If 1 object was spawned in, consider it a success + private _success = false; + + if (_items isNotEqualTo []) then { + if (_items isEqualType "") then { + _items = [_items]; + }; + + private _weaponHolder = objNull; + + { + private _type = (_x call EFUNC(common,getItemType)) select 0; + + if (_type == "") then { + private _emptyPosAGL = []; + + // This covers testing vehicle stability and finding a safe position + for "_i" from 1 to 3 do { + _emptyPosAGL = [_target, _x, _player] call EFUNC(common,findUnloadPosition); + + if (_emptyPosAGL isNotEqualTo []) exitWith {}; + }; + + // If still no valid position, try the next item + if (_emptyPosAGL isEqualTo []) then { + [LELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured); + + continue; + }; + + private _object = createVehicle [_x, _emptyPosAGL, [], 0, "CAN_COLLIDE"]; + + if (!isNull _object) then { + // Prevent items from taking damage when unloaded + [_object, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [EFUNC(common,statusEffect_set), [_object, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; + + _success = true; + } else { + WARNING_1("Failed to create object of type '%1'",_x); + }; + + continue; + }; + + // Functions/code below are guaranteed to spawn in objects + _success = true; + + // getItemType considers backpacks as weapons, so handle them first + if (getNumber (configFile >> "CfgVehicles" >> _x >> "isBackpack") == 1) then { + if (backpack _player == "") then { + _player addBackpackGlobal _x; + } else { + if (isNull _weaponHolder) then { + _weaponHolder = nearestObject [_player, "WeaponHolder"]; + + if (isNull _weaponHolder || {_player distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "NONE"]; + _weaponHolder setPosASL getPosASL _player; + }; + }; + + _weaponHolder addBackpackCargoGlobal [_x, 1]; + }; + + continue; + }; + + switch (_type) do { + case "weapon": { + [_player, _x, true] call CBA_fnc_addWeapon; + }; + case "item": { + [_player, _x, true] call CBA_fnc_addItem; + }; + case "magazine": { + [_player, _x, -1, true] call CBA_fnc_addMagazine; + }; + }; + } forEach _items; + } else { + [LELSTRING(common,disabled)] call EFUNC(common,displayTextStructured); + }; + + if (!_success) exitWith {}; + + _target animateSource [_anim, _phase, true]; + }, + {}, + _text, + { + (_this select 0) params ["_target", "", "_anim", "_phase"]; + + _target animationPhase _anim != _phase + }, + ["isNotSwimming"] + ] call EFUNC(common,progressBar); +}; + +private _condition = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase"]; + + _target animationPhase _anim != _phase + && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} +}; + +private _config = configOf _object; + +{ + private _animConfig = _x; + private _anim = configName _animConfig; + + private _animationSourcesConfig = _config >> "AnimationSources" >> _anim; + + if !( + isClass _animationSourcesConfig // anim exist + && {0 != [_animationSourcesConfig >> "scope", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim not hidden + && {isNumber (_animationSourcesConfig >> "initPhase")} // anim correct (some CUP anims are inherited and cleared) + && {0 != [_animConfig >> "enabled", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim enabled + ) then {continue}; + + private _positions = []; + { + if (_x isEqualType "") then { + _positions pushBack compile _x; + } else { + _positions pushBack _x; + }; + } forEach getArray (_animConfig >> "positions"); + + _positions append getArray (_animConfig >> "selections"); + + if (_positions isEqualTo []) then { + ERROR_2("No action position for _class %1 anim %2",_class,_anim); + continue; + }; + + private _phase = [_animConfig >> "phase", "NUMBER", 1] call CBA_fnc_getConfigEntry; + private _name = [_animConfig >> "name", "TEXT", localize "str_a3_cfgactions_unmountitem0"] call CBA_fnc_getConfigEntry; + private _icon = [_animConfig >> "icon", "TEXT", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa"] call CBA_fnc_getConfigEntry; + private _duration = [_animConfig >> "duration", "NUMBER", 10] call CBA_fnc_getConfigEntry; + private _text = getText (_animConfig >> "text"); + private _distance = [_animConfig >> "distance", "NUMBER", 2] call CBA_fnc_getConfigEntry; + + { + private _action = [ + format [QGVAR(anim_%1_%2), _anim, _forEachIndex], + _name, + _icon, + _statement, + _condition, + {}, + [_anim, _phase, _duration, _text], + _x, + _distance + ] call EFUNC(interact_menu,createAction); + [_class, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + TRACE_3("add anim",_class,_anim,_x); + } forEach _positions; +} forEach configProperties [_config >> QGVAR(anims), "isClass _x"]; diff --git a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf index aaefb3315e..6fede34962 100644 --- a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf +++ b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf @@ -4,9 +4,12 @@ * Switches weapon attachment. * * Arguments: - * 0: Target - * 1: Player (not used) + * 0: Target (not used) + * 1: Player * 2: Action params + * - 0: Weapon + * - 1: New Attachment + * - 2: Old Attachment * * Return Value: * None @@ -17,11 +20,13 @@ * Public: No */ -params ["_unit", "", "_actionParams"]; +params ["", "_unit", "_actionParams"]; _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; TRACE_3("Switching attachment",_weapon,_newAttachment,_oldAttachment); -[_unit, "Gear"] call EFUNC(common,doGesture); +private _currWeaponType = [_unit, _weapon] call EFUNC(common,getWeaponIndex); + +if (_currWeaponType == -1) exitWith {}; private _addNew = _newAttachment isNotEqualTo ""; private _removeOld = _oldAttachment isNotEqualTo ""; @@ -38,22 +43,33 @@ if (_removeOld && {!([_unit, _oldAttachment] call CBA_fnc_canAddItem)}) exitWith }; }; +[_unit, "Gear"] call EFUNC(common,doGesture); + if (_removeOld) then { [{ - params ["_unit", "_weapon", "_oldAttachment"]; - switch (_weapon) do { - case (primaryWeapon _unit): {_unit removePrimaryWeaponItem _oldAttachment;}; - case (handgunWeapon _unit): {_unit removeHandgunItem _oldAttachment;}; - default {_unit removeSecondaryWeaponItem _oldAttachment;}; + params ["_unit", "_currWeaponType", "_oldAttachment"]; + + switch (_currWeaponType) do { + case 0: {_unit removePrimaryWeaponItem _oldAttachment}; + case 1: {_unit removeSecondaryWeaponItem _oldAttachment}; + case 2: {_unit removeHandgunItem _oldAttachment}; + default {}; }; + _unit addItem _oldAttachment; - }, [_unit, _weapon, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; + }, [_unit, _currWeaponType, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; }; if (!_addNew) exitWith {}; [{ params ["_unit", "_weapon", "_newAttachment"]; + _unit addWeaponItem [_weapon, _newAttachment]; + + if (_unit != ACE_player) exitWith {}; + [[getText (configFile >> "CfgWeapons" >> _newAttachment >> "picture"), 4], true] call CBA_fnc_notify; + + playSound "click"; }, [_unit, _weapon, _newAttachment], 1] call CBA_fnc_waitAndExecute; diff --git a/addons/interaction/initSettings.inc.sqf b/addons/interaction/initSettings.inc.sqf index 2cefb162a7..bba27769c0 100644 --- a/addons/interaction/initSettings.inc.sqf +++ b/addons/interaction/initSettings.inc.sqf @@ -38,6 +38,16 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(enableAnimActions), "CHECKBOX", + LSTRING(SettingAnimActionsName), + format ["ACE %1", LLSTRING(DisplayName)], + true, + true, + {[QGVAR(enableAnimActions), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart +] call CBA_fnc_addSetting; + [ QGVAR(interactWithTerrainObjects), "CHECKBOX", ["str_a3_modules_moduleomquest_defend_f_attributes_useterrainobject0", LSTRING(interactWithTerrainObjects_Description)], @@ -45,3 +55,11 @@ false, true ] call CBA_fnc_addSetting; + +[ + QGVAR(interactWithEnemyCrew), "LIST", + [LSTRING(interactWithEnemyCrew_DisplayName), LSTRING(interactWithEnemyCrew_Description)], + format ["ACE %1", LLSTRING(DisplayName)], + [[0, 1, 2], [ELSTRING(common,Never), LSTRING(interactWithEnemyCrew_allowCSW), ELSTRING(common,Always)], 0], + true +] call CBA_fnc_addSetting; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 38c86f5f99..4b0a74cc75 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -582,6 +582,9 @@ 小隊管理 Takım Yönetimi + + Drop Distant Members + Red Rot @@ -1247,30 +1250,30 @@ 전면유리 부수기 - Attach %1 - Установить %1 - %1 を取り付け - Acoplar %1 - Fixer %1 - Przyczep %1 - Befestige %1 - Attacca %1 - 附加 %1 - %1 붙이기 - Fixar %1 + Attach + Установить + を取り付け + Acoplar + Fixer + Przyczep + Befestige + Attacca + 附加 + 붙이기 + Fixar - Detach %1 - Снять %1 - %1 を外す - Desacoplar %1 - Retirer %1 - Odczep %1 - Löse %1 - Stacca %1 - 拆卸 %1 - %1 떼내기 - Desfixar %1 + Detach + Снять + を外す + Desacoplar + Retirer + Odczep + Löse + Stacca + 拆卸 + 떼내기 + Desfixar Enables attach/detach weapon attachment actions for current weapon. @@ -1324,5 +1327,23 @@ Advertencia: puede provocar que algunos objetos choquen con otros. Aviso: pode causar que alguns objetos colidam com outros. + + Interaction with animations + Взаимодействие с анимациями + Interaction avec les animations + 車両アニメーションベースのインタラクション + + + Interact With Enemy Crew + 敵乗員がいる状態でのインタラクト + + + Limit some interactions on vehicles crewed by enemy factions. + 敵性力の乗員が乗っている車両へのインタラクションを一部制限します。 + + + Allow for Static Weapons + 固定火器への許可 + diff --git a/addons/irlight/XEH_PREP.hpp b/addons/irlight/XEH_PREP.hpp index db1a29d22e..83c619aab8 100644 --- a/addons/irlight/XEH_PREP.hpp +++ b/addons/irlight/XEH_PREP.hpp @@ -1,3 +1 @@ -PREP(getGlowOffset); PREP(initItemContextMenu); -PREP(onLightToggled); diff --git a/addons/irlight/XEH_postInit.sqf b/addons/irlight/XEH_postInit.sqf index d95186f07b..77b98936c1 100644 --- a/addons/irlight/XEH_postInit.sqf +++ b/addons/irlight/XEH_postInit.sqf @@ -1,30 +1,27 @@ #include "script_component.hpp" -[] call FUNC(initItemContextMenu); - -addUserActionEventHandler ["headlights", "Deactivate", LINKFUNC(onLightToggled)]; +call FUNC(initItemContextMenu); ["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - [] call FUNC(onLightToggled); + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; + + action ["GunLightOn", ACE_player]; + action ["IRLaserOn", ACE_player]; + + ACE_player selectWeapon _weaponState; + true }, { - ACE_player action ["GunLightOff", ACE_player]; - ACE_player action ["IRLaserOff", ACE_player]; - [] call FUNC(onLightToggled); - true + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; + + action ["GunLightOff", ACE_player]; + action ["IRLaserOff", ACE_player]; + + ACE_player selectWeapon _weaponState; }] call CBA_fnc_addKeybind; - -["CBA_attachmentSwitched", { - params ["", "", "_item"]; - - private _substr = _item select [0, 8]; - if ( - ACE_player getVariable [QGVAR(isTurnedOn), false] - && {_substr == "ACE_SPIR" || {_substr == "ACE_DBAL"}} - ) then { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - }; -}] call CBA_fnc_addEventHandler; diff --git a/addons/irlight/functions/fnc_getGlowOffset.sqf b/addons/irlight/functions/fnc_getGlowOffset.sqf deleted file mode 100644 index 613e551111..0000000000 --- a/addons/irlight/functions/fnc_getGlowOffset.sqf +++ /dev/null @@ -1,41 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Gets the player model offset of the IR laser origin. - * Currently unused, see onLightToggled. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_getGlowOffset - * - * Public: No - */ - -if (isNil QGVAR(offsetCache)) then { - GVAR(offsetCache) = createHashMap; -}; - -private _weapon = currentWeapon ACE_player; -private _laser = ((weaponsItems ACE_player) select {_x#0 == _weapon})#0#2; - -GVAR(offsetCache) getOrDefaultCall [[_weapon, _laser], { - private _model = getText (configFile >> "CfgWeapons" >> _weapon >> "model"); - private _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _proxyOffset = _dummy selectionPosition ["\a3\data_f\proxies\weapon_slots\SIDE.001", 1]; - _proxyOffset = [_proxyOffset#1, _proxyOffset#0 * -1, _proxyOffset#2]; - deleteVehicle _dummy; - - _model = getText (configFile >> "CfgWeapons" >> _laser >> "model"); - _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _selection = getText (configFile >> "CfgWeapons" >> _laser >> "ItemInfo" >> "Pointer" >> "irLaserPos"); - private _laserOffset = _dummy selectionPosition [_selection, "Memory"]; - _laserOffset = [_laserOffset#1, _laserOffset#0 * -1, _laserOffset#2 * -1]; - deleteVehicle _dummy; - - _proxyOffset vectorAdd _laserOffset -}, true]; diff --git a/addons/irlight/functions/fnc_initItemContextMenu.sqf b/addons/irlight/functions/fnc_initItemContextMenu.sqf index fa75eba77b..75a9508b18 100644 --- a/addons/irlight/functions/fnc_initItemContextMenu.sqf +++ b/addons/irlight/functions/fnc_initItemContextMenu.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_irlight_fnc_initItemContextMenu + * call ace_irlight_fnc_initItemContextMenu * * Public: No */ @@ -19,30 +19,34 @@ _x params ["_variant", "_displayName"]; [ - "ACE_DBAL_A3_Red", "POINTER", _displayName, [], "", { + "ACE_DBAL_A3_Red", + "POINTER", + _displayName, + [], + "", + { params ["", "", "_item", "", "_variant"]; private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); _item != _baseClass + _variant }, { - params ["", "", "_item", "", "_variant"]; + params ["_unit", "", "_item", "_slot", "_variant"]; + + private _weapon = switch (_slot) do { + case "RIFLE_POINTER": {primaryWeapon _unit}; + case "LAUNCHER_POINTER": {secondaryWeapon _unit}; + case "PISTOL_POINTER": {handgunWeapon _unit}; + default {""}; + }; + + if (_weapon == "") exitWith {}; private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); - ACE_player removePrimaryWeaponItem _item; - ACE_player addPrimaryWeaponItem (_baseClass + _variant); - playSound "click"; - - if (_turnedOn) then { - // Force update of flashlight - ACE_player action ["GunLightOff", ACE_player]; - - { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - } call CBA_fnc_execNextFrame; - }; - }, false, _variant + [_unit, _weapon, _item, _baseClass + _variant] call EFUNC(common,switchAttachmentMode); + }, + false, + _variant ] call CBA_fnc_addItemContextMenuOption; } forEach [ ["", LSTRING(Mode_IRDual)], diff --git a/addons/irlight/functions/fnc_onLightToggled.sqf b/addons/irlight/functions/fnc_onLightToggled.sqf deleted file mode 100644 index b3592f28f6..0000000000 --- a/addons/irlight/functions/fnc_onLightToggled.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Handles toggling flashlights on and off. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_onLightToggled - * - * Public: No - */ - -private _isTurnedOn = ACE_player isFlashlightOn primaryWeapon ACE_player - || ACE_player isIRLaserOn primaryWeapon ACE_player; -ACE_player setVariable [QGVAR(isTurnedOn), _isTurnedOn]; - -// This is a surprise tool that will help us later -// Requires: https://feedback.bistudio.com/T170774 -/* -deleteVehicle (ACE_player getVariable [QGVAR(glow), objNull]); - -if (ACE_player isIRLaserOn currentWeapon ACE_player) then { - private _offset = [] call FUNC(getGlowOffset); - private _glow = createSimpleObject [QPATHTOF(data\irglow.p3d), [0, 0, 0]]; - _glow attachTo [ACE_player, _offset, "proxy:\a3\characters_f\proxies\weapon.001", true]; - _glow setObjectTexture [0, "#(rgb,8,8,3)color(0.35,0,0.38,0.1)"]; - _glow setObjectScale 0.1; - - ACE_player setVariable [QGVAR(glow), _glow]; -}; -*/ diff --git a/addons/kestrel4500/config.cpp b/addons/kestrel4500/config.cpp index 5ea15f07ff..fc339ccf6b 100644 --- a/addons/kestrel4500/config.cpp +++ b/addons/kestrel4500/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_Kestrel4500"}; weapons[] = {"ACE_Kestrel4500"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {ECSTRING(common,ACETeam), "Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index 9ecbca180c..756a5418a4 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -15,7 +15,7 @@ * Public: No */ -private _playerDir = getDir ACE_player; +private _playerDir = (ACE_player call CBA_fnc_headDir) select 0; private _windSpeed = vectorMagnitude wind; private _windDir = (wind select 0) atan2 (wind select 1); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 64b9ee764d..9ab1423f1f 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -126,6 +126,7 @@ Mostra uccisioni del veicolo a membri dell'equipaggio 車両でのキルを乗員全員に表示する 다른 승무원에게 차량 처치 표시 + Montrer les véhicules tués aux membres de l'équipage Show kills from a vehicle to driver, gunner and commander @@ -134,6 +135,7 @@ Mostra uccisioni del veicolo al pilota, artigliere e comandante 車両でのキルを操縦手、砲手、車長で共有して表示する 차량 처치를 운전수, 사수, 지휘관에게 보여줍니다 + Montrer les véhicules tués au pilote, à l'artilleur et au commandant. diff --git a/addons/laser/functions/fnc_addLaserTarget.sqf b/addons/laser/functions/fnc_addLaserTarget.sqf index 3fc02b2189..f0414fd3ad 100644 --- a/addons/laser/functions/fnc_addLaserTarget.sqf +++ b/addons/laser/functions/fnc_addLaserTarget.sqf @@ -20,9 +20,9 @@ params ["_targetObject", "_vehicle"]; TRACE_2("params",_targetObject,_vehicle); // Get the designator variables, or use defaults -private _waveLength = _vehicle getVariable [QEGVAR(laser,waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; -private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; -private _beamSpread = _vehicle getVariable [QEGVAR(laser,beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; +private _waveLength = _vehicle getVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; +private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; +private _beamSpread = _vehicle getVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; TRACE_3("codes",_waveLength,_laserCode,_beamSpread); // Laser method is the method ACE_Laser will use to determine from where to where it should project the designator cone diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index bd42a3e5a5..f7db74793f 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -58,7 +58,7 @@ TRACE_1("params",_this); }; }; if (!_foundSource) then { - WARNING_1("Laser target doesn't have owner",_targetObject); + WARNING_1("Laser target %1 doesn't have owner",_targetObject); }; }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 0b19b4d1c3..af2098a6f8 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -29,7 +29,7 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { TRACE_1("Laser off:",_laserUuid); false } else { - private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _newCode = _owner getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; if (_laserCode != _newCode) then { TRACE_2("code change",_newCode,_laserCode); [QGVAR(updateCode), [_laserUuid, _newCode]] call CBA_fnc_globalEvent; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 4ceb15d814..a14b3a8b18 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -72,7 +72,7 @@ private _finalOwner = objNull; TRACE_1("",_laser); //Handle Weird Data Return - skips over this laser in the for loop - if ((_laser isEqualTo []) || {_laser isEqualTo [-1, -1]}) exitWith {WARNING_1("Bad Laser Return",_laser);}; + if ((_laser isEqualTo []) || {_laser isEqualTo [-1, -1]}) exitWith {WARNING_1("Bad Laser Return %1",_laser);}; _laser params [["_laserPos", [], [[]], 3], ["_laserDir", [], [[]], 3]]; if (GVAR(dispersionCount) > 0) then { diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 778df61a6c..35120a294d 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -91,7 +91,7 @@ GVAR(pfID) = [{ // Do Laser Scan: private _ammo = getText (configFile >> "CfgMagazines" >> _vehicle currentMagazineTurret _turretPath >> "ammo"); private _laserSource = _vehicle modelToWorldWorld (_vehicle selectionPosition _seekerSource); - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _seekerAngle = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerAngle"); private _seekerMaxRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerMaxRange"); private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot); diff --git a/addons/laser/functions/fnc_toggleLST.sqf b/addons/laser/functions/fnc_toggleLST.sqf index 59969d014e..eae4ad68ef 100644 --- a/addons/laser/functions/fnc_toggleLST.sqf +++ b/addons/laser/functions/fnc_toggleLST.sqf @@ -39,7 +39,7 @@ if (_enabled) exitWith {}; [_pfhID] call CBA_fnc_removePerFrameHandler; }; - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _angle = 25; private _pos = _vehicle modelToWorldVisualWorld [0,0,0]; diff --git a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf index d6d8f3b827..2c32ec5727 100644 --- a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf @@ -18,6 +18,9 @@ params ["_unit", "_magazine"]; +// Exit if repack is disabled for this magazine. +if (getNumber (configFile >> "CfgMagazines" >> _magazine >> "ace_disableRepacking") == 1) exitWith {false}; + private _maxAmmoCount = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); { diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index b4cf8b16ef..09d6974fef 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, commy2, esteldunedain, Ruthberg - * Gets magazine children for interaciton menu. + * Gets magazine children for interaction menu. * * Arguments: * 0: Target @@ -18,16 +18,20 @@ params ["_target", "_player"]; +private _cfgMagazines = configFile >> "CfgMagazines"; + // get all mags and ammo count private _unitMagazines = []; private _unitMagCounts = []; { _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; - private _xFullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _xClassname >> "count"); + private _configMagazine = _cfgMagazines >> _xClassname; + private _xFullMagazineCount = getNumber (_configMagazine >> "count"); + private _isRepackDisabled = getNumber (_configMagazine >> "ace_disableRepacking") == 1; //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {GVAR(repackLoadedMagazines) && {[_player, _xClassname] call CBA_fnc_canAddItem}}}) then { + if ((!_isRepackDisabled) && {_xCount < _xFullMagazineCount} && {_xCount > 0} && {(!_xLoaded) || {GVAR(repackLoadedMagazines) && {[_player, _xClassname] call CBA_fnc_canAddItem}}}) then { private _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index af95ce3d6d..8a2dcbf245 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -22,4 +22,4 @@ params ["_logic"]; [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_ShowPlayerNames), "ShowPlayerNames"] call EFUNC(common,readSettingFromModule); -INFO_3("Blue Force Tracking Module Initialized:",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); +INFO_3("Blue Force Tracking Module Initialized:%1-%2-%3",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index cff2d15f4f..94c6d05ef1 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -75,7 +75,7 @@ Maximale Reichweite zwischen Spielern um Kartenzeichen anzuzeigen Máxima distancia a la cual pueden verse el indicador de gestos Définit le rayon au-delà duquel un joueur ne verra plus l'indicateur de pointage des autres joueurs. - マップ ジェスチャのインジケータを表示可能なプレーヤー間の最大距離 + マップ ジェスチャのインジケータを表示可能なプレーヤー間の最大範囲距離 플레이어간에 지도 신호 표시거리를 설정합니다. 设定地图指示显示的最大范围距离 設定地圖指示器顯示的最大範圍距離 diff --git a/addons/maverick/ACE_GuidanceConfig.hpp b/addons/maverick/ACE_GuidanceConfig.hpp index 948404b7cc..4360bd4a87 100644 --- a/addons/maverick/ACE_GuidanceConfig.hpp +++ b/addons/maverick/ACE_GuidanceConfig.hpp @@ -2,6 +2,6 @@ class EGVAR(missileguidance,AttackProfiles) { class maverick { name = "LOAL-DIR"; nameLocked = "LOBL-DIR"; - functionName = QEFUNC(missileguidance,attackProfile_DIR); + functionName = QEFUNC(missileguidance,attackProfile_LIN); }; }; diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp index 654c1fbe80..7e66e2edee 100644 --- a/addons/maverick/CfgAmmo.hpp +++ b/addons/maverick/CfgAmmo.hpp @@ -5,6 +5,45 @@ class CfgAmmo { }; class Missile_AGM_02_F: MissileBase {}; + class GVAR(D): Missile_AGM_02_F { + author = "Dani (TCVM)"; + missileLockMaxDistance = 14000; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 15; + yawRate = 15; + + canVanillaLock = 1; + + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 14000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; + + class GVAR(G): GVAR(D) { + class ace_missileguidance: ace_missileguidance { + enabled = 1; + }; + }; + class GVAR(L): Missile_AGM_02_F { author = "xrufix"; autoSeekTarget = 0; @@ -16,9 +55,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0; - maxDeflection = 0.002; - incDeflection = 0.001; + pitchRate = 15; + yawRate = 15; canVanillaLock = 0; @@ -28,6 +66,9 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = {"LOAL","LOBL"}; + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + seekLastTargetPos = 1; seekerAngle = 60; seekerAccuracy = 1; @@ -49,9 +90,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0; - maxDeflection = 0.002; - incDeflection = 0.001; + pitchRate = 20; + yawRate = 20; canVanillaLock = 0; @@ -61,6 +101,9 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = {"LOAL"}; + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + seekLastTargetPos = 1; seekerAngle = 40; seekerAccuracy = 1; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp index 705d52010d..1e51ede8b0 100644 --- a/addons/maverick/CfgMagazines.hpp +++ b/addons/maverick/CfgMagazines.hpp @@ -12,7 +12,71 @@ class CfgMagazines { class PylonRack_Missile_AGM_02_x1: magazine_Missile_AGM_02_x1 {}; class PylonRack_Missile_AGM_02_x2: magazine_Missile_AGM_02_x1 {}; + + // Optical Mavericks + class GVAR(D_magazine): 6Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x1); + }; + class GVAR(D_pylonRack_1Rnd): PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x1); + pylonWeapon = QGVAR(D_Launcher); + }; + class GVAR(D_pylonRack_3Rnd): PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x3); + pylonWeapon = QGVAR(D_Launcher); + }; + class GVAR(G_magazine_x1): magazine_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + }; + class GVAR(G_pylonmissile_x1): PylonMissile_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_pylonmissile_x2): PylonMissile_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x2); + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_pylonRack_1Rnd): PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_3Rnd): PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x3); + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_PylonRack_x1): PylonRack_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_x2): PylonRack_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x2); + pylonWeapon = QGVAR(G_Launcher); + }; + + // Laser Mavericks class GVAR(L_magazine_x1): magazine_Missile_AGM_02_x1 { ammo = QGVAR(L); author = "xrufix"; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp index 1c0ae744ef..a60681a3cf 100644 --- a/addons/maverick/CfgWeapons.hpp +++ b/addons/maverick/CfgWeapons.hpp @@ -6,6 +6,22 @@ class CfgWeapons { class MissileLauncher: LauncherCore {}; class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher {}; + class GVAR(D_Launcher): Missile_AGM_02_Plane_CAS_01_F { + author = "Dani (TCVM)"; + displayname = CSTRING(D); + magazines[] = {QGVAR(D_magazine), QGVAR(D_pylonRack_1Rnd), QGVAR(D_pylonRack_3Rnd)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + + class GVAR(G_Launcher): weapon_AGM_65Launcher { + author = "Dani (TCVM)"; + displayname = CSTRING(G); + magazines[] = {QGVAR(G_magazine_x1), QGVAR(G_pylonmissile_x1), QGVAR(G_pylonmissile_x2), QGVAR(G_pylonRack_1Rnd), QGVAR(G_PylonRack_3Rnd), QGVAR(G_PylonRack_x1), QGVAR(G_PylonRack_x2)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + class GVAR(L_Launcher): weapon_AGM_65Launcher { author = "xrufix"; displayname = CSTRING(L); diff --git a/addons/maverick/stringtable.xml b/addons/maverick/stringtable.xml index 6bf1d80e04..60af8c830f 100644 --- a/addons/maverick/stringtable.xml +++ b/addons/maverick/stringtable.xml @@ -111,6 +111,27 @@ 1x Kh-25ML [ACE] 1x Kh-25ML [ACE] + + AGM-65 Maverick D + + + AGM-65 Maverick G + + + AGM-65 Maverick D [ACE] + + + 3x AGM-65 Maverick D [ACE] + + + AGM-65 Maverick G [ACE] + + + 2x AGM-65 Maverick G [ACE] + + + 3x AGM-65 Maverick G [ACE] + diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf index 7bdeb189c2..ff1c3a95b7 100644 --- a/addons/medical/dev/test_hitpointConfigs.sqf +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -10,7 +10,11 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _cfgVehicles = configFile >> "CfgVehicles"; private _uniforms = "getNumber (_x >> 'scope') == 2 && {configName _x isKindOf ['Uniform_Base', _cfgWeapons]}" configClasses _cfgWeapons; -private _units = _uniforms apply {_cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass")}; +private _units = _uniforms apply { + private _unitCfg = _cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass"); + if (isNull _unitCfg) then { WARNING_2("%1 has invalid uniformClass %2",configName _x,getText (_x >> "ItemInfo" >> "uniformClass")) }; + _unitCfg +}; if (param [0, false]) then { // Check all units (if naked) INFO("checking ALL units"); _units append ((configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'scope')) == 2} && {configName _x isKindOf 'CAManBase'}", true])); @@ -21,6 +25,7 @@ INFO_1("Checking uniforms for correct medical hitpoints [%1 units]",count _units private _testPass = true; { private _typeOf = configName _x; + if (_typeOf == "") then { continue }; private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {toLowerANSI configName _x}; private _expectedHitPoints = ["hitleftarm","hitrightarm","hitleftleg","hitrightleg","hithead","hitbody"]; private _missingHitPoints = _expectedHitPoints select {!(_x in _hitpoints)}; diff --git a/addons/medical_ai/XEH_PREP.hpp b/addons/medical_ai/XEH_PREP.hpp index de4ac3c38a..3cf2b3e244 100644 --- a/addons/medical_ai/XEH_PREP.hpp +++ b/addons/medical_ai/XEH_PREP.hpp @@ -1,3 +1,4 @@ +PREP(addHealingCommandActions); PREP(canRequestMedic); PREP(healingLogic); PREP(healSelf); diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 0b225c7f0b..9ddd8273fd 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -2,6 +2,7 @@ ["CBA_settingsInitialized", { TRACE_1("settingsInitialized",GVAR(enabledFor)); + if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients @@ -19,6 +20,19 @@ _unit setVariable [QGVAR(lastSuppressed), CBA_missionTime]; }] call CBA_fnc_addClassEventHandler; - #include "stateMachine.inc.sqf" + // Add command actions to command AI medics to treat other units + call FUNC(addHealingCommandActions); + if (GVAR(requireItems) == 2) then { + ["CAManBase", "InitPost", { + [{ + params ["_unit"]; + if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; + TRACE_2("replacing medical items on AI",_unit,typeOf _unit); + [_unit] call EFUNC(common,replaceRegisteredItems); + }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack + }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; + }; + + #include "stateMachine.inc.sqf" }] call CBA_fnc_addEventHandler; diff --git a/addons/medical_ai/XEH_preInit.sqf b/addons/medical_ai/XEH_preInit.sqf index 5725d1e119..8cdc2ee6ad 100644 --- a/addons/medical_ai/XEH_preInit.sqf +++ b/addons/medical_ai/XEH_preInit.sqf @@ -13,6 +13,6 @@ if (isNil QGVAR(timeSafe_shoot)) then { GVAR(timeSafe_shoot) = 30; }; if (isNil QGVAR(timeSafe_hit)) then { GVAR(timeSafe_hit) = 30; }; if (isNil QGVAR(timeSafe_suppressed)) then { GVAR(timeSafe_suppressed) = 30; }; -GVAR(itemHash) = uinamespace getVariable QGVAR(itemHash); +GVAR(itemHash) = uiNamespace getVariable QGVAR(itemHash); ADDON = true; diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index b4d795cbbf..ccb92538b7 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -20,6 +20,7 @@ private _itemHash = createHashMap; } forEach [ ["@bandage", ["FieldDressing", "PackingBandage", "ElasticBandage", "QuikClot"]], ["@iv", ["SalineIV", "SalineIV_500", "SalineIV_250", "BloodIV", "BloodIV_500", "BloodIV_250", "PlasmaIV", "PlasmaIV_500", "PlasmaIV_250"]], + ["tourniquet", ["ApplyTourniquet"]], ["splint", ["splint"]], ["morphine", ["morphine"]], ["epinephrine", ["epinephrine"]] diff --git a/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf new file mode 100644 index 0000000000..cc91ca7eb3 --- /dev/null +++ b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf @@ -0,0 +1,88 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Adds ACE actions for the player to command medics to heal injured units. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_medical_ai_fnc_addHealingCommandActions + * + * Public: No + */ + +if (!hasInterface) exitWith {}; + +private _action = [ + QGVAR(heal), + localize "STR_A3_Task180_name", + "", + {}, + {_player == leader _player}, + { + private _units = units _player; + + (_units select {_x call EFUNC(common,isAwake) && {_x call EFUNC(medical_treatment,isMedic)} && {!(_x call EFUNC(common,isPlayer))}}) apply { + [ + [ + QGVAR(medicHeal_) + str _x, + format ["%1: (%2)", [_x, false, true] call EFUNC(common,getName), groupID _x], + "", + {}, + {true}, + { + (_this select 2) params ["_healer", "_units"]; + + (_units select {_x call FUNC(isInjured)}) apply { + [ + [ + QGVAR(healUnit_) + str _x, + format [localize "str_action_heal_soldier", ([_x, false, true] call EFUNC(common,getName)) + " (" + str groupID _x + ")"], + "", + { + (_this select 2) params ["_healer", "_target"]; + + private _assignedMedic = _target getVariable [QGVAR(assignedMedic), objNull]; + + // Remove from previous medic's queue + if (!isNull _assignedMedic && {_healer != _assignedMedic}) then { + private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + }; + + _target setVariable [QGVAR(assignedMedic), _healer]; + + // Add to new medic + private _healQueue = _healer getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + _healQueue insert [0, [_target]]; + + _healer setVariable [QGVAR(healQueue), _healQueue]; + }, + {true}, + {}, + [_healer, _x] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + }, + [_x, _units] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + } +] call EFUNC(interact_menu,createAction); + +["CAManBase", 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 685bd57f54..5064e1a732 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -4,13 +4,13 @@ * Checks if there is a medic available in the unit's group. * * Arguments: - * None + * Unit * * Return Value: * Can request medic * * Example: - * player call ACE_medical_ai_fnc_canRequestMedic + * player call ace_medical_ai_fnc_canRequestMedic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healSelf.sqf b/addons/medical_ai/functions/fnc_healSelf.sqf index 5747637995..60f2b83712 100644 --- a/addons/medical_ai/functions/fnc_healSelf.sqf +++ b/addons/medical_ai/functions/fnc_healSelf.sqf @@ -4,13 +4,13 @@ * Makes the unit heal itself. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healSelf + * cursorObject call ace_medical_ai_fnc_healSelf * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index ad867d2570..6d94749d1f 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -4,16 +4,17 @@ * Makes a medic heal the next unit that needs treatment. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healUnit + * cursorObject call ace_medical_ai_fnc_healUnit * * Public: No */ + // Player will have to do this manually of course if ([_this] call EFUNC(common,isPlayer)) exitWith {}; // Can't heal other units when unconscious @@ -23,10 +24,16 @@ if IS_UNCONSCIOUS(_this) exitWith { // Find next unit to treat private _healQueue = _this getVariable [QGVAR(healQueue), []]; -private _target = _healQueue select 0; +private _target = _healQueue param [0, objNull]; // If unit died or was healed, be lazy and wait for the next tick -if (isNull _target || {!alive _target} || {!(_target call FUNC(isInjured))}) exitWith { +// If the unit can't be healed, go to the next unit to be healed +if (!alive _target || {!(_target call FUNC(isInjured))} || { + private _treatmentEvent = (_this getVariable [QGVAR(currentTreatment), []]) param [2, ""]; + + // Target still needs healing, but the healer doesn't have the required items (only happens if GVAR(requireItems) != 0) or needs to wait + (_treatmentEvent select [0, 6]) == "#needs" +}) exitWith { _this forceSpeed -1; _target forceSpeed -1; _healQueue deleteAt 0; @@ -46,6 +53,10 @@ if (_this distance _target > 2.5) exitWith { _this setVariable [QGVAR(currentTreatment), nil]; if (CBA_missionTime >= (_this getVariable [QGVAR(nextMoveOrder), CBA_missionTime])) then { _this setVariable [QGVAR(nextMoveOrder), CBA_missionTime + 10]; + + // Medic, when doing a lot of treatment, moves away from injured over time (because of animations) + // Need to allow the medic to move back to the injured again + _this forceSpeed -1; _this doMove getPosATL _target; #ifdef DEBUG_MODE_FULL systemChat format ["%1 moving to %2", _this, _target]; diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index fa35b49284..9c7ce1c847 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -1,7 +1,9 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut, PabstMirror - * Applies healing to target + * Author: BaerMitUmlaut, PabstMirror, johnb43 + * Applies healing to target. + * States that contain "needs" are states in which the medic is blocked, either temporairly (HR too high/low) or until resupplied, from treating. + * States that contain "wait" are states where the medic waits temporairly before continuing treatment. * * Arguments: * 0: Healer @@ -11,7 +13,7 @@ * Nothing * * Example: - * [a, b] call ACE_medical_ai_fnc_healingLogic + * [cursorObject, cursorObject] call ace_medical_ai_fnc_healingLogic * * Public: No */ @@ -24,14 +26,58 @@ if (_finishTime > 0) exitWith { if (CBA_missionTime >= _finishTime) then { TRACE_5("treatment finished",_finishTime,_treatmentTarget,_treatmentEvent,_treatmentArgs,_treatmentItem); _healer setVariable [QGVAR(currentTreatment), nil]; + + private _usedItem = ""; + if ((GVAR(requireItems) > 0) && {_treatmentItem != ""}) then { ([_healer, _treatmentItem] call FUNC(itemCheck)) params ["_itemOk", "_itemClassname", "_treatmentClass"]; - if (!_itemOk) exitWith { _treatmentEvent = "#fail"; }; // no item after delay + // No item after treatment done + if (!_itemOk) exitWith { + _treatmentEvent = "#fail"; + }; + _healer removeItem _itemClassname; - if (_treatmentClass != "") then { _treatmentArgs set [2, _treatmentClass]; }; + _usedItem = _itemClassname; + + if (_treatmentClass != "") then { + _treatmentArgs set [2, _treatmentClass]; + }; }; if ((_treatmentTarget == _target) && {(_treatmentEvent select [0, 1]) != "#"}) then { + // There is no event for tourniquet removal, so handle calling function directly + if (_treatmentEvent == QGVAR(tourniquetRemove)) exitWith { + _treatmentArgs call EFUNC(medical_treatment,tourniquetRemove); + }; + [_treatmentEvent, _treatmentArgs, _target] call CBA_fnc_targetEvent; + + // Splints are already logged on their own + switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,bandageLocal): { + [_target, "activity", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,ivBagLocal): { + if (_usedItem == "") then { + _usedItem = "ACE_salineIV"; + }; + + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_gaveIV), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,medicationLocal): { + if (_usedItem == "") then { + _usedItem = ["ACE_epinephrine", "ACE_morphine"] select (_treatmentArgs select 2 == "Morphine"); + }; + + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_usedItem), [[_healer, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,tourniquetLocal): { + [_target, "ACE_tourniquet"] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_appliedTourniquet), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + }; + #ifdef DEBUG_MODE_FULL INFO_4("%1->%2: %3 - %4",_healer,_target,_treatmentEvent,_treatmentArgs); systemChat format ["Applying [%1->%2]: %3", _healer, _treatmentTarget, _treatmentEvent]; @@ -40,38 +86,164 @@ if (_finishTime > 0) exitWith { }; }; -private _isMedic = [_healer] call EFUNC(medical_treatment,isMedic); -private _heartRate = GET_HEART_RATE(_target); -private _fractures = GET_FRACTURES(_target); +// Bandage a limb up, then remove the tourniquet on it +private _fnc_removeTourniquet = { + params [["_removeAllTourniquets", false]]; + + // Ignore head & torso if not removing all tourniquets (= administering drugs/IVs) + private _offset = [2, 0] select _removeAllTourniquets; + + // Bandage the least bleeding body part + private _bodyPartBleeding = []; + _bodyPartBleeding resize [[4, 6] select _removeAllTourniquets, -1]; + + { + // Ignore head and torso, if only looking for place to administer drugs/IVs + private _partIndex = (ALL_BODY_PARTS find _x) - _offset; + + if (_partIndex >= 0 && {_tourniquets select _partIndex != 0}) then { + { + _x params ["", "_amountOf", "_bleeding"]; + + // max 0, to set the baseline to 0, as body parts with no wounds are marked with -1 + _bodyPartBleeding set [_partIndex, ((_bodyPartBleeding select _partIndex) max 0) + (_amountOf * _bleeding)]; + } forEach _y; + }; + } forEach GET_OPEN_WOUNDS(_target); + + // If there are no open wounds, check if there are tourniquets on limbs with no open wounds (stitched or fully healed), + // as we know there have to be tourniquets at this point + if (_bodyPartBleeding findIf {_x != -1} == -1) then { + _bodyPartBleeding set [_tourniquets findIf {_x != 0}, 0]; + }; + + // Ignore body parts that don't have open wounds (-1) + private _minBodyPartBleeding = selectMin (_bodyPartBleeding select {_x != -1}); + private _selection = ALL_BODY_PARTS select ((_bodyPartBleeding find _minBodyPartBleeding) + _offset); + + // If not bleeding anymore, remove the tourniquet + if (_minBodyPartBleeding == 0) exitWith { + _treatmentEvent = QGVAR(tourniquetRemove); + _treatmentTime = 7; + _treatmentArgs = [_healer, _target, _selection]; + }; + + // If no bandages available, wait + // If check is done at the start of the scope, it will miss the edge case where the unit ran out of bandages just as they finished bandaging tourniqueted body part + if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { + _treatmentEvent = "#needsBandage"; + }; + + // Otherwise keep bandaging + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); + _treatmentTime = 5; + _treatmentArgs = [_target, _selection, "FieldDressing"]; + _treatmentItem = "@bandage"; +}; + +// Find a suitable limb (no tourniquets) for adminstering drugs/IVs +private _fnc_findNoTourniquet = { + private _bodyPart = ""; + + // If all limbs have tourniquets, find the least damaged limb and try to bandage it + if ((_tourniquets select [2]) find 0 == -1) then { + call _fnc_removeTourniquet; + } else { + // Select a random non-tourniqueted limb otherwise + private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; + + while {_bodyParts isNotEqualTo []} do { + _bodyPart = selectRandom _bodyParts; + + // If no tourniquet on, use that body part + if (_tourniquets select (ALL_BODY_PARTS find _bodyPart) == 0) exitWith {}; + + _bodyParts deleteAt (_bodyParts find _bodyPart); + }; + }; + + _bodyPart // return +}; + +private _tourniquets = GET_TOURNIQUETS(_target); private _treatmentEvent = "#none"; private _treatmentArgs = []; private _treatmentTime = 6; private _treatmentItem = ""; -switch (true) do { - case ((GET_WOUND_BLEEDING(_target) > 0) - && {([_healer, "@bandage"] call FUNC(itemCheck)) # 0}): { - // Select first bleeding wound and bandage it - private _selection = "?"; + +if (true) then { + if (IS_BLEEDING(_target)) exitWith { + private _hasBandage = ([_healer, "@bandage"] call FUNC(itemCheck)) # 0; + private _hasTourniquet = ([_healer, "tourniquet"] call FUNC(itemCheck)) # 0; + + // Patient is not worth treating if bloodloss can't be stopped + if !(_hasBandage || _hasTourniquet) exitWith { + _treatmentEvent = "#needsBandageOrTourniquet"; + }; + + // Bandage the heaviest bleeding body part + private _bodyPartBleeding = [0, 0, 0, 0, 0, 0]; + { - private _foundBleeding = _y findIf { - _x params ["", "_amount", "_percentage"]; - (_amount * _percentage) > 0 + private _partIndex = ALL_BODY_PARTS find _x; + + // Ignore tourniqueted limbs + if (_tourniquets select _partIndex == 0) then { + { + _x params ["", "_amountOf", "_bleeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeding)]; + } forEach _y; }; - if (_foundBleeding != -1) exitWith { _selection = _x; }; } forEach GET_OPEN_WOUNDS(_target); + + private _maxBodyPartBleeding = selectMax _bodyPartBleeding; + private _bodyPartIndex = _bodyPartBleeding find _maxBodyPartBleeding; + private _selection = ALL_BODY_PARTS select _bodyPartIndex; + + // Apply tourniquet if moderate bleeding or no bandage is available, and if not head and torso + if (_hasTourniquet && {_bodyPartIndex > HITPOINT_INDEX_BODY} && {!_hasBandage || {_maxBodyPartBleeding > 0.3}}) exitWith { + _treatmentEvent = QEGVAR(medical_treatment,tourniquetLocal); + _treatmentTime = 7; + _treatmentArgs = [_target, _selection]; + _treatmentItem = "tourniquet"; + }; + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); _treatmentTime = 5; _treatmentArgs = [_target, _selection, "FieldDressing"]; _treatmentItem = "@bandage"; }; - case (IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}): { + + private _bloodVolume = GET_BLOOD_VOLUME(_target); + private _needsIV = _bloodVolume < MINIMUM_BLOOD_FOR_STABLE_VITALS; + private _canGiveIV = _needsIV && + {_healer call EFUNC(medical_treatment,isMedic)} && + {([_healer, "@iv"] call FUNC(itemCheck)) # 0}; // Has IVs + private _doCPR = IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}; + + // If in cardiac arrest, first add some blood to injured if necessary, then do CPR (doing CPR when not enough blood is suboptimal if you have IVs) + // If healer has no IVs, allow AI to do CPR to keep injured alive + if ( + _doCPR && + {!_canGiveIV || {_bloodVolume >= BLOOD_VOLUME_CLASS_3_HEMORRHAGE}} + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,cprLocal); _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; - case (_isMedic && {GET_BLOOD_VOLUME(_target) < MINIMUM_BLOOD_FOR_STABLE_VITALS} - && {([_healer, "@iv"] call FUNC(itemCheck)) # 0}): { + + private _bodypart = ""; + + if ( + _canGiveIV && { + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + _bodyPart == "" + } + ) exitWith {}; + + if (_canGiveIV) then { // Check if patient's blood volume + remaining IV volume is enough to allow the patient to wake up private _totalIvVolume = 0; //in ml { @@ -79,57 +251,132 @@ switch (true) do { _totalIvVolume = _totalIvVolume + _volumeRemaining; } forEach (_target getVariable [QEGVAR(medical,ivBags), []]); - if (GET_BLOOD_VOLUME(_target) + (_totalIvVolume / 1000) > MINIMUM_BLOOD_FOR_STABLE_VITALS) exitWith { - _treatmentEvent = "#waitForBlood"; + // Check if the medic has to wait, which allows for a little multitasking + if (_bloodVolume + (_totalIvVolume / 1000) >= MINIMUM_BLOOD_FOR_STABLE_VITALS) then { + _treatmentEvent = "#waitForIV"; + _needsIV = false; + _canGiveIV = false; }; + }; + + if (_canGiveIV) exitWith { _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); _treatmentTime = 5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "SalineIV"]; + _treatmentArgs = [_target, _bodyPart, "SalineIV"]; _treatmentItem = "@iv"; }; - case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): { - _treatmentEvent = "#tooManyMeds"; - }; - case (((_fractures select 4) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { + + // Leg fractures + private _index = (GET_FRACTURES(_target) select [4, 2]) find 1; + + if ( + _index != -1 && { + // In case the unit doesn't have a splint, set state here + _treatmentEvent = "#needsSplint"; + + ([_healer, "splint"] call FUNC(itemCheck)) # 0 + } + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "leftleg"]; + _treatmentArgs = [_healer, _target, ALL_BODY_PARTS select (_index + 4)]; _treatmentItem = "splint"; }; - case (((_fractures select 5) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { - _treatmentEvent = QEGVAR(medical_treatment,splintLocal); - _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "rightleg"]; - _treatmentItem = "splint"; + + // Wait until the injured has enough blood before administering drugs + // (_needsIV && !_canGiveIV), but _canGiveIV is false here, otherwise IV would be given + if (_needsIV || {_doCPR && {_treatmentEvent == "#waitForIV"}}) exitWith { + // If injured is in cardiac arrest and the healer is doing nothing else, start CPR + if (_doCPR) exitWith { + // Medic remains in this loop until injured is given enough IVs or dies + _treatmentEvent = QEGVAR(medical_treatment,cprLocal); + _treatmentArgs = [_healer, _target]; + _treatmentTime = 15; + }; + + // If the injured needs IVs, but healer can't give it to them, have healder wait + if (_needsIV) exitWith { + _treatmentEvent = "#needsIV"; + }; }; - case ((IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) - && {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}): { - if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { + + // These checks are not exitWith, so that the medic can try to bandage up tourniqueted body parts + if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) then { + _treatmentEvent = "#needsFewerMeds"; + }; + + private _heartRate = GET_HEART_RATE(_target); + private _canGiveEpinephrine = !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && + {IS_UNCONSCIOUS(_target) || {_heartRate <= 50}} && + { + // In case the unit doesn't have a epinephrine injector, set state here + _treatmentEvent = "#needsEpinephrine"; + + ([_healer, "epinephrine"] call FUNC(itemCheck)) # 0 + }; + + // This allows for some multitasking + if (_canGiveEpinephrine) then { + if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) then { _treatmentEvent = "#waitForEpinephrineToTakeEffect"; + _canGiveEpinephrine = false; }; - if (_heartRate > 180) exitWith { - _treatmentEvent = "#waitForSlowerHeart"; + + if (_heartRate > 180) then { + _treatmentEvent = "#needsSlowerHeart"; + _canGiveEpinephrine = false; }; + }; + + if (_canGiveEpinephrine) exitWith { + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextEpinephrine), CBA_missionTime + 10]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Epinephrine"]; + _treatmentArgs = [_target, _bodyPart, "Epinephrine"]; _treatmentItem = "epinephrine"; }; - case (((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) - && {([_healer, "morphine"] call FUNC(itemCheck)) # 0}): { + + // Remove all remaining tourniquets by bandaging all body parts + if (_tourniquets isNotEqualTo DEFAULT_TOURNIQUET_VALUES) then { + true call _fnc_removeTourniquet; + }; + + // If the healer can bandage or remove tourniquets, do that + if (_treatmentEvent in [QEGVAR(medical_treatment,bandageLocal), QGVAR(tourniquetRemove)]) exitWith {}; + + // Otherwise, if the healer is either done or out of bandages, continue + if ( + !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && + {(GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}} && + { + // In case the unit doesn't have a morphine injector, set state here + _treatmentEvent = "#needsMorphine"; + + ([_healer, "morphine"] call FUNC(itemCheck)) # 0 + } + ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { _treatmentEvent = "#waitForMorphineToTakeEffect"; }; + if (_heartRate < 60) exitWith { - _treatmentEvent = "#waitForFasterHeart"; + _treatmentEvent = "#needsFasterHeart"; }; + + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextMorphine), CBA_missionTime + 30]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Morphine"]; + _treatmentArgs = [_target, _bodyPart, "Morphine"]; _treatmentItem = "morphine"; }; }; @@ -137,10 +384,16 @@ switch (true) do { _healer setVariable [QGVAR(currentTreatment), [CBA_missionTime + _treatmentTime, _target, _treatmentEvent, _treatmentArgs, _treatmentItem]]; // Play animation -if ((_treatmentEvent select [0,1]) != "#") then { - private _treatmentClassname = _treatmentArgs select 2; - if (_treatmentEvent == QEGVAR(medical_treatment,splintLocal)) then { _treatmentClassname = "Splint" }; - [_healer, _treatmentClassname, (_healer == _target)] call FUNC(playTreatmentAnim); +if ((_treatmentEvent select [0, 1]) != "#") then { + private _treatmentClassname = switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,splintLocal): {"Splint"}; + case QEGVAR(medical_treatment,cprLocal): {"CPR"}; + case QEGVAR(medical_treatment,tourniquetLocal): {"ApplyTourniquet"}; + case QGVAR(tourniquetRemove): {"RemoveTourniquet"}; + default {_treatmentArgs select 2}; + }; + + [_healer, _treatmentClassname, _healer == _target] call FUNC(playTreatmentAnim); }; #ifdef DEBUG_MODE_FULL diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index a163a4c808..2a4b689514 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -10,7 +10,7 @@ * Does unit need treatment * * Example: - * player call ACE_medical_ai_fnc_isInjured + * cursorObject call ace_medical_ai_fnc_isInjured * * Public: No */ @@ -24,3 +24,4 @@ if !(alive _this) exitWith {false}; private _fractures = GET_FRACTURES(_this); ((_fractures select 4) == 1) || {(_fractures select 5) == 1} } +|| { GET_TOURNIQUETS(_this) isNotEqualTo DEFAULT_TOURNIQUET_VALUES } diff --git a/addons/medical_ai/functions/fnc_isSafe.sqf b/addons/medical_ai/functions/fnc_isSafe.sqf index 04da058ce0..21d59a15d6 100644 --- a/addons/medical_ai/functions/fnc_isSafe.sqf +++ b/addons/medical_ai/functions/fnc_isSafe.sqf @@ -10,7 +10,7 @@ * Is unit safe enough * * Example: - * call ACE_medical_ai_fnc_isSafe + * cursorObject call ace_medical_ai_fnc_isSafe * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_itemCheck.sqf b/addons/medical_ai/functions/fnc_itemCheck.sqf index 6d91594ce4..320ae62410 100644 --- a/addons/medical_ai/functions/fnc_itemCheck.sqf +++ b/addons/medical_ai/functions/fnc_itemCheck.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Checks if AI healer has items + * Checks if AI healer has items. * * Arguments: * 0: Healer @@ -13,7 +13,7 @@ * 2: Treatment (Optional) * * Example: - * [cursorObject, "@bandage"] call ACE_medical_ai_fnc_itemCheck + * [cursorObject, "@bandage"] call ace_medical_ai_fnc_itemCheck * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index b8e77aab43..9b663f65b2 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -12,10 +12,11 @@ * None * * Example: - * [bob, true, true] call ACE_medical_ai_fnc_playTreatmentAnim + * [cursorObject, "Splint", true] call ace_medical_ai_fnc_playTreatmentAnim * * Public: No */ + params ["_unit", "_actionName", "_isSelfTreatment"]; TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment); diff --git a/addons/medical_ai/functions/fnc_requestMedic.sqf b/addons/medical_ai/functions/fnc_requestMedic.sqf index 9e59181204..758fa80a1f 100644 --- a/addons/medical_ai/functions/fnc_requestMedic.sqf +++ b/addons/medical_ai/functions/fnc_requestMedic.sqf @@ -4,21 +4,24 @@ * Sends a request to the units assigned medic to heal it. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_requestMedic + * cursorObject call ace_medical_ai_fnc_requestMedic * * Public: No */ private _assignedMedic = _this getVariable QGVAR(assignedMedic); private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; -_healQueue pushBack _this; -_assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + +// Only update if it was actually changed +if (_healQueue pushBackUnique _this != -1) then { + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; +}; #ifdef DEBUG_MODE_FULL systemChat format ["%1 requested %2 for medical treatment", _this, _assignedMedic]; diff --git a/addons/medical_ai/functions/fnc_wasRequested.sqf b/addons/medical_ai/functions/fnc_wasRequested.sqf index 3b6c1cf059..ffb9aa3780 100644 --- a/addons/medical_ai/functions/fnc_wasRequested.sqf +++ b/addons/medical_ai/functions/fnc_wasRequested.sqf @@ -4,13 +4,13 @@ * Checks if the unit was requested to treat another unit. * * Arguments: - * None + * Unit * * Return Value: * Was requested * * Example: - * call ACE_medical_ai_fnc_wasRequested + * cursorObject call ace_medical_ai_fnc_wasRequested * * Public: No */ diff --git a/addons/medical_ai/initSettings.inc.sqf b/addons/medical_ai/initSettings.inc.sqf index a2b06519a4..b8ff7e6134 100644 --- a/addons/medical_ai/initSettings.inc.sqf +++ b/addons/medical_ai/initSettings.inc.sqf @@ -1,7 +1,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; [ - QGVAR(enabledFor), "LIST", + QGVAR(enabledFor), + "LIST", [LLSTRING(enableFor_title), LLSTRING(enableFor_desc)], _categoryArray, [ @@ -15,7 +16,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; ] call CBA_fnc_addSetting; [ - QGVAR(requireItems), "LIST", + QGVAR(requireItems), + "LIST", [LSTRING(requireItems_title), LSTRING(requireItems_desc)], _categoryArray, [ @@ -24,16 +26,6 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; 0 ], true, // isGlobal - { - if (GVAR(requireItems) != 2) exitWith {}; - ["CAManBase", "initPost", { - [{ - params ["_unit"]; - if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; - TRACE_2("replacing medical items on AI",_unit,typeOf _unit); - [_unit] call EFUNC(common,replaceRegisteredItems); - }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack - }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; - }, + {[QGVAR(requireItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/medical_ai/stateMachine.inc.sqf b/addons/medical_ai/stateMachine.inc.sqf index 03483f4981..73b82f98a9 100644 --- a/addons/medical_ai/stateMachine.inc.sqf +++ b/addons/medical_ai/stateMachine.inc.sqf @@ -17,13 +17,8 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema #endif }, {}, {}, "Safe"] call CBA_statemachine_fnc_addState; -[GVAR(stateMachine), LINKFUNC(healSelf), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealSelf"] call CBA_statemachine_fnc_addState; - -[GVAR(stateMachine), LINKFUNC(healUnit), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealUnit"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healSelf), {}, {}, "HealSelf"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healUnit), {}, {}, "HealUnit"] call CBA_statemachine_fnc_addState; // Add Transistions [statemachine, originalState, targetState, condition, onTransition, name] [GVAR(stateMachine), "Initial", "Injured", LINKFUNC(isInjured), {}, "Injured"] call CBA_statemachine_fnc_addTransition; diff --git a/addons/medical_damage/CfgEventHandlers.hpp b/addons/medical_damage/CfgEventHandlers.hpp index 865276cfba..f6503c2479 100644 --- a/addons/medical_damage/CfgEventHandlers.hpp +++ b/addons/medical_damage/CfgEventHandlers.hpp @@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/medical_damage/XEH_postInit.sqf b/addons/medical_damage/XEH_postInit.sqf new file mode 100644 index 0000000000..39b1c9301e --- /dev/null +++ b/addons/medical_damage/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +// Reload configs (handle functions being compiled after medical_damage's preInit) +call FUNC(parseConfigForInjuries); diff --git a/addons/medical_damage/XEH_preInit.sqf b/addons/medical_damage/XEH_preInit.sqf index 344b9c81ee..b389a0eaa0 100644 --- a/addons/medical_damage/XEH_preInit.sqf +++ b/addons/medical_damage/XEH_preInit.sqf @@ -10,11 +10,13 @@ PREP_RECOMPILE_END; call FUNC(parseConfigForInjuries); +/* addMissionEventHandler ["Loaded",{ INFO("Mission Loaded - Reloading medical configs for extension"); // Reload configs into extension (handle full game restart) call FUNC(parseConfigForInjuries); }]; +*/ [QEGVAR(medical,woundReceived), LINKFUNC(woundReceived)] call CBA_fnc_addEventHandler; diff --git a/addons/medical_damage/config.cpp b/addons/medical_damage/config.cpp index 4df519a648..89ac295525 100644 --- a/addons/medical_damage/config.cpp +++ b/addons/medical_damage/config.cpp @@ -27,13 +27,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgAmmo.hpp" #include "CfgEden.hpp" - -/* -class ACE_Extensions { - class ace_medical { - // Not yet used - }; -}; - */ - #endif diff --git a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf index 0dad747c68..010f02b7f5 100644 --- a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf +++ b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Pterolatypus - * Read a list of wound handler entries from config, accounting for inheritance + * Read a list of wound handler entries from config, accounting for inheritance. * * Arguments: * 0: The config class containing the entries @@ -10,24 +10,43 @@ * None * * Example: - * [configFile >> "ace_medical_injuries" >> "damageTypes"] call ace_medical_damage_fnc_parseWoundHandlersCfg + * [configFile >> "ace_medical_injuries" >> "damageTypes" >> "woundHandlers"] call ace_medical_damage_fnc_parseWoundHandlersCfg * * Public: No */ + params ["_config"]; -// read all valid entries from config and store +// Read all valid entries from config and store private _entries = []; + { - private _entryResult = call compile getText _x; - if !(isNil "_entryResult") then { - _entries pushBack _entryResult; - } + private _entryResult = getText _x; + + if (_entryResult != "") then { + if (ADDON) then { + // Runs in postInit + _entryResult = call compile _entryResult; + + if (!isNil "_entryResult") then { + if (_entryResult isEqualType {}) then { + _entries pushBack _entryResult; + } else { + ERROR_2("Wound handler '%1' needs to be a function, but is of type %2.",configName _x,toLowerANSI typeName _entryResult); + }; + }; + } else { + // Runs in preInit + // In case function doesn't exist yet, wrap in extra layer + _entries pushBack (compile format ["call %1", _entryResult]); + }; + }; } forEach configProperties [_config, "isText _x", false]; private _parent = inheritsFrom _config; + if (isNull _parent) exitWith {_entries}; -// recursive call for parent -// can't use configProperties for inheritance since it returns entries in the wrong order -([_parent] call FUNC(parseWoundHandlersCfg)) + _entries; +// Recursive call for parent +// Can't use configProperties for inheritance since it returns entries in the wrong order +([_parent] call FUNC(parseWoundHandlersCfg)) + _entries // return diff --git a/addons/medical_damage/functions/fnc_woundReceived.sqf b/addons/medical_damage/functions/fnc_woundReceived.sqf index a7e3861dee..c31cf5b378 100644 --- a/addons/medical_damage/functions/fnc_woundReceived.sqf +++ b/addons/medical_damage/functions/fnc_woundReceived.sqf @@ -17,18 +17,23 @@ * * Public: No */ + params ["_unit", "_allDamages", "_shooter", "_ammo"]; private _typeOfDamage = _ammo call FUNC(getTypeOfDamage); + if (_typeOfDamage in GVAR(damageTypeDetails)) then { (GVAR(damageTypeDetails) get _typeOfDamage) params ["", "", "_woundHandlers"]; private _damageData = [_unit, _allDamages, _typeOfDamage]; + { _damageData = _damageData call _x; TRACE_1("Wound handler returned",_damageData); - if !(_damageData isEqualType [] && {(count _damageData) >= 3}) exitWith { - TRACE_1("Return invalid, terminating wound handling",_damageData); + + // If invalid return, exit + if (isNil "_damageData" || {!(_damageData isEqualType [])} || {(count _damageData) < 3}) exitWith { + TRACE_1("Return invalid, skipping wound handling",_damageData); }; } forEach _woundHandlers; }; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf index fb82f383b6..92effda9bd 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf @@ -22,7 +22,7 @@ TRACE_3("woundsHandlerBase",_unit,_allDamages,_typeOfDamage); if !(_typeOfDamage in GVAR(damageTypeDetails)) then { - WARNING_1("damage type not found",_typeOfDamage); + WARNING_1("damage type %1 not found",_typeOfDamage); _typeOfDamage = "unknown"; }; @@ -80,7 +80,7 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra // Select the injury we are going to add selectRandomWeighted _weightedWoundTypes params ["_woundTypeToAdd", "", "_dmgMultiplier", "_bleedMultiplier", "_sizeMultiplier", "_painMultiplier", "_fractureMultiplier"]; if (isNil "_woundTypeToAdd") then { - WARNING_4("No valid wound types",_damage,_dmgPerWound,_typeOfDamage,_bodyPart); + WARNING_4("No valid wound types %1-%2-%3-%4",_damage,_dmgPerWound,_typeOfDamage,_bodyPart); continue }; GVAR(woundDetails) get _woundTypeToAdd params ["","_injuryBleedingRate","_injuryPain","_causeLimping","_causeFracture"]; diff --git a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf index cc29e75cc1..8441df4ad8 100644 --- a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf +++ b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf @@ -11,7 +11,6 @@ * * Public: No */ -if (missionNamespace getVariable [QGVAR(disableSeatLocking), false]) exitWith {}; params ["_unit"]; private _vehicle = objectParent _unit; @@ -20,6 +19,13 @@ TRACE_3("lockUnconsciousSeat",_unit,_vehicle,lifeState _unit); if (isNull _vehicle) exitWith {}; if (alive _unit && {lifeState _unit != "INCAPACITATED"}) exitWith {}; +private _disable = missionNamespace getVariable [QGVAR(disableSeatLocking), false]; +if (_disable isEqualTo true || { + _disable isEqualType [] && { + (_disable findIf {_vehicle isKindOf _x}) != -1 + } +}) exitWith {}; + switch (true) do { case (_unit isEqualTo (driver _vehicle)): { _vehicle lockDriver true; diff --git a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf index c278e6e08a..b33b533e25 100644 --- a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf +++ b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf @@ -6,8 +6,11 @@ * * Arguments: * 0: Unit - * 1: Type (optional) ["hit" (default) or "moan"] - * 2: Severity (optional) [0 (default), 1, 2] + * 1: Type ["hit", "moan"] (default: "hit") + * 2: Severity [0, 1, 2] (default: 0) + * 3: Hit sound distances (default: [50, 60, 70]) + * 4: Moan sound distances (default: [10, 15, 20]) + * 5: Allow unconscious units (default: false) * * Return Value: * None @@ -20,18 +23,18 @@ #define TIME_OUT_HIT 1 #define TIME_OUT_MOAN [12, 7.5, 5] -params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]]; +params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]], ["_hitDistances", [50, 60, 70], [[]], [3]], ["_moanDistances", [10, 15, 20], [[]], [3]], ["_allowUnconscious", false, [true]]]; // TRACE_3("",_unit,_type,_severity); if (!local _unit) exitWith { ERROR_2("playInjuredSound: Unit not local or null [%1:%2]",_unit,typeOf _unit); }; -if !(_unit call EFUNC(common,isAwake)) exitWith {}; +if (!_allowUnconscious && {!(_unit call EFUNC(common,isAwake))}) exitWith {}; // Limit network traffic by only sending the event to players who can potentially hear it private _distance = if (_type == "hit") then { - [50, 60, 70] select _severity; + _hitDistances select _severity } else { - [10, 15, 20] select _severity; + _moanDistances select _severity }; private _targets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, _distance, _distance, 0, false, _distance]; if (_targets isEqualTo []) exitWith {}; diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 2b7fb8ce52..6d18696b0e 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -2,6 +2,8 @@ if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + GVAR(target) = objNull; GVAR(previousTarget) = objNull; GVAR(selectedBodyPart) = 0; @@ -35,64 +37,6 @@ GVAR(selfInteractionActions) = []; }; }] call CBA_fnc_addEventHandler; -["ACE3 Common", QGVAR(openMedicalMenuKey), localize LSTRING(OpenMedicalMenu), { - // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player - TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); - private _target = cursorTarget; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - _target = cursorObject; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - private _start = AGLToASL positionCameraToWorld [0, 0, 0]; - private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; - private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; - { - _x params ["", "", "_intersectObject"]; - // Only look "through" player and player's vehicle - if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; - if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { - _target =_intersectObject - }; - } forEach _intersections; - if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { - _target = ACE_player; - }; - }; - }; - - // Check conditions: canInteract and canOpenMenu - if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; - - // Statement - [_target] call FUNC(openMenu); - false -}, { - // Close menu if enough time passed from opening - if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { - [objNull] call FUNC(openMenu); - }; - false -}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; - -["ACE3 Common", QGVAR(peekMedicalInfoKey), localize LSTRING(PeekMedicalInfo), -{ - // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - - // Statement - [ACE_player, -1] call FUNC(displayPatientInformation); - false -}, { - if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { - [{ - CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) - }, {QGVAR(RscPatientInfo) cutFadeOut 0.3}] call CBA_fnc_waitUntilAndExecute; - }; - GVAR(peekLastOpenedOn) = CBA_missionTime; - false -}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; - - // Close patient information display when interaction menu is closed ["ace_interactMenuClosed", { QGVAR(RscPatientInfo) cutFadeOut 0.3; diff --git a/addons/medical_gui/initKeybinds.inc.sqf b/addons/medical_gui/initKeybinds.inc.sqf new file mode 100644 index 0000000000..53c577084e --- /dev/null +++ b/addons/medical_gui/initKeybinds.inc.sqf @@ -0,0 +1,55 @@ +["ACE3 Common", QGVAR(openMedicalMenuKey), LLSTRING(OpenMedicalMenu), { + // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player + TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); + private _target = cursorTarget; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + _target = cursorObject; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + private _start = AGLToASL positionCameraToWorld [0, 0, 0]; + private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; + private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; + { + _x params ["", "", "_intersectObject"]; + // Only look "through" player and player's vehicle + if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; + if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { + _target = _intersectObject; + }; + } forEach _intersections; + if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { + _target = ACE_player; + }; + }; + }; + + // Check conditions: canInteract and canOpenMenu + if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; + + // Statement + [_target] call FUNC(openMenu); + false +}, { + // Close menu if enough time passed from opening + if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { + [objNull] call FUNC(openMenu); + }; +}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; + +["ACE3 Common", QGVAR(peekMedicalInfoKey), LLSTRING(PeekMedicalInfo), { + // Conditions: canInteract + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + + // Statement + [ACE_player, -1] call FUNC(displayPatientInformation); + false +}, { + if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { + [{ + CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) + }, { + QGVAR(RscPatientInfo) cutFadeOut 0.3; + }] call CBA_fnc_waitUntilAndExecute; + }; + GVAR(peekLastOpenedOn) = CBA_missionTime; +}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 3f816aa39b..6dfc16f9b9 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -222,6 +222,7 @@ Zeige Triage-Einstufung im Interaktionsmenü 在交互式菜单中显示分诊级别 상호작용 메뉴에서 부상자 카드 보기 + Mostrar Nível de Triagem no Menu de Interação Shows the patient's triage level by changing the color of the main and medical menu actions. @@ -234,6 +235,7 @@ Zeigt die Triage-Einstufung des Patienten durch Ändern der Farbe der Aktionen des Hauptmenüs und des medizinischen Menüs an. 通过改变主菜单和医疗菜单动作的颜色来显示伤员的分诊级别。 환자의 부상자 카드를 상호작용에서 볼 수 있게 합니다. + Mostra o nível de triagem do paciente alterando a cor das ações do menu principal e do menu médico. Medical @@ -294,6 +296,7 @@ 医療情報一時表示 Просмотр медицинской информации Ojear Información Médica + Visualização rápida das informações médicas Medical Peek Duration @@ -305,6 +308,7 @@ 医療情報一時表示の表示時間 Продолжительность медицинского осмотра Duración del Ojear Información Médica + Duração da visualização geral das informações médicas How long the medical info peek remains open after releasing the key. @@ -316,6 +320,7 @@ 医療情報一時表示キーを放してからどれだけ長く情報表示するか。 Как долго окно просмотра медицинской информации остается открытым после отпускания клавиши. Durante cuánto tiempo la información médica ojeada permanece abierta una ves se deje de apretar la tecla. + Quanto tempo a visualização rápida das informações médicas permanece aberta após soltar a tecla. Load Patient @@ -570,6 +575,7 @@ 自分に切り替え Переключиться на себя Cambiar a uno mismo + Trocar para si mesmo Switch to target @@ -581,6 +587,7 @@ 相手に切り替え Переключиться на цель Cambiar al objetivo + Trocar para paciente Head @@ -1008,6 +1015,7 @@ 出血はしていない Кровотечения нет Sin sangrado + Sem sangramento Slow bleeding @@ -1019,6 +1027,7 @@ 出血は穏やか Медленное кровотечение Sangrado lento + Sangramento lento Moderate bleeding @@ -1030,6 +1039,7 @@ 出血はそこそこ速い Умеренное кровотечение Sangrado moderado + Sangramento moderado Severe bleeding @@ -1041,6 +1051,7 @@ 出血は激しい Сильное кровотечение Sangrado severo + Sangramento grave Massive bleeding @@ -1052,6 +1063,7 @@ 出血は酷く多い Огромное кровотечение Sangrado masivo + Sangramento massivo in Pain @@ -1127,6 +1139,7 @@ 失血なし Потери крови нет Sin pérdida de sangre + Sem perda de sangue @@ -1271,6 +1284,7 @@ Información de paciente Patienteninformation 환자 정보 + Informações do paciente Blood Loss Colors @@ -1283,6 +1297,7 @@ 失血颜色 출혈 색상 Colores de pérdida de sangre + Cores de perda de sangue Defines the 10 color gradient used to indicate blood loss in Medical GUIs. @@ -1295,6 +1310,7 @@ 失血颜色,用于医学图形用户界面。10种渐变颜色。 출혈로 인한 의료 GUI의 색상을 변경합니다. 총 10가지 색상이 있습니다. Define los 10 gradientes de color utilizados para indicar la pérdida de sangre en la interfaz gráfica del sistema Médico. + Define os 10 gradientes de cores utilizados para indicar perda de sangue nas interfaces médicas. Blood Loss Color %1 @@ -1307,6 +1323,7 @@ 失血颜色 %1 출혈 색상 %1 Color de pérdida de sangre %1 + Cor de perda de sangue %1 Damage Colors @@ -1319,6 +1336,7 @@ 负伤颜色 피해 색상 Colores de daño + Cores de dano Defines the 10 color gradient used to indicate damage in Medical GUIs. @@ -1331,6 +1349,7 @@ 负伤颜色,用于医学图形用户界面。10种渐变颜色。 의료 GUI에 쓰이는 피해 색상입니다. 총 10가지 색상이 있습니다. Define los 10 gradientes de color utilizados para indicar el daño en la interfaz gráfiica del sistema Médico. + Define os 10 gradientes de cor utilizados para indicar dano nas interfaces médicas. Damage Color %1 @@ -1343,6 +1362,7 @@ 负伤颜色 %1 피해 색상 %1 Color de daño %1 + Cor de dano %1 Show Blood Loss @@ -1355,6 +1375,7 @@ Показывать кровопотерю Mostrar pérdida de sangre Afficher les pertes de sang + Mostrar perda de sangue Show qualitative blood loss in the injury list. @@ -1367,6 +1388,7 @@ Показывать тяжесть кровопотери в списке ранений. Mostrar la pérdida de sangre cualitativa en la lista de heridas. Afficher la quantité de sang perdue + Mostrar perda de sangue qualitativa na lista de feridas. Show Bleeding State @@ -1412,6 +1434,7 @@ 被弾時の医療情報一時表示 Показать медицинскую информацию о попадании Ojear Información Médica en Impacto + Visualização rápida das informações médicas durante uma lesão Temporarily show medical info when injured. @@ -1424,6 +1447,7 @@ 被弾時に医療情報を一時的に表示します。 Временно показывать медицинскую информацию при травме. Temporalmente muestra la información médica cuando es herido. + Mostrar informações médicas temporariamente durante uma lesão. Medical Peek Duration on Hit @@ -1436,6 +1460,7 @@ 被弾時の医療情報一時表示の表示時間 Продолжительность медицинского осмотра при попадании Duración de Ojear la Información Médica cuando hay Impacto + Duração da visualização rápida de informações médicas durante uma lesão How long the medical info peek remains open after being injured. @@ -1448,6 +1473,7 @@ 被弾時の医療情報の一時表示をどれだけ長く表示するか。 Как долго окно просмотра медицинской информации остается открытым после получения травмы. Durante cuánto tiempo la información médica ojeada permanece abierta una tras haber sido herido. + Quanto tempo a visualização rápida de informações médicas permanece aberta após ser ferido. Show Trauma Sustained @@ -1486,6 +1512,7 @@ 身体部位の輪郭表示の色 Цвет контура части тела Color de Contorno de las Partes del Cuerpo + Cor do contorno da parte do corpo Color of outline around selected body part. @@ -1498,6 +1525,7 @@ 選択した身体部位の輪郭表示の色。 Цвет контура вокруг выбранной части тела. Color del contorno alrededor de la parte del cuerpo seleccionada. + Cor do contorno em volta da parte do corpo selecionada. Minor Trauma @@ -1562,6 +1590,7 @@ Лево I + E R @@ -1574,6 +1603,7 @@ Право D + D in your inventory @@ -1586,6 +1616,7 @@ 個あなたが保有 в вашем инвентаре en tu inventario + em seu inventário in patient's inventory @@ -1598,6 +1629,7 @@ 個患者が保有 в инвентаре пациента en el inventario del paciente + no inventário do paciente in vehicle's inventory @@ -1610,6 +1642,7 @@ 個車両内に保有 в инвентаре транспорта en el inventario del vehículo + no inventário do veículo No effect until tourniquet removed @@ -1621,6 +1654,7 @@ 止血帯を外すまで効果を発揮しません Никакого эффекта до тех пор, пока жгут не будет снят Sin efecto hasta que se quita el torniquete + Sem efeito até o torniquete ser removido Show Tourniquet Warning @@ -1632,6 +1666,7 @@ 止血帯の警告を表示 Показать предупреждение о наложении жгута Mostrar Advertencia de Torniquete + Mostrar aviso de torniquete Show a warning tooltip when a tourniquet will interfere with a medical action. @@ -1643,6 +1678,7 @@ 止血帯が医療行為を妨げる場合には、警告ツールチップを表示します。 Показать всплывающую подсказку с предупреждением, когда жгут помешает медицинскому вмешательству. Muestra un mensaje de advertencia cuando un torniquete interfiera con una acción médica. + Mostra uma dica de aviso quando um torniquete interfere com uma ação médica. diff --git a/addons/medical_statemachine/stringtable.xml b/addons/medical_statemachine/stringtable.xml index 2b828d506e..9c1d807bd0 100644 --- a/addons/medical_statemachine/stringtable.xml +++ b/addons/medical_statemachine/stringtable.xml @@ -173,6 +173,7 @@ Wykrwawienie podczas zatrzymanej akcji serca 心脏骤停期间失血情况 심정지 중 출혈 + Sangramento durante parada cardíaca Controls whether a person can die in cardiac arrest by blood loss before the cardiac arrest time runs out. @@ -185,6 +186,7 @@ Kontroluje czy śmierć osoby może nastąpić poprzez wykrwawienie zanim wyczerpię się Czas Zatrzymania Akcji Serca. 控制单位是否会在心脏骤停时间耗完之前因失血过多而死亡。 지정한 심정지 시간이 다 되기 전에 출혈로 인해 사망할 수 있는 지를 결정합니다. + Controla se uma pessoa pode morrer em parada cardíaca por perda de sangue antes que o tempo de parada cardíaca acabe. diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index c2a6604679..5193ccbb0b 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -21,9 +21,10 @@ private _woundBleeding = GET_WOUND_BLEEDING(_unit); if (_woundBleeding == 0) exitWith {0}; private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); +private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES]; // can use value directly since this is sum of default and adjustments // even if heart stops blood will still flow slowly (gravity) -private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient)); +private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * (DEFAULT_PERIPH_RES / _resistance) * EGVAR(medical,bleedingCoefficient)); private _eventArgs = [_unit, _bloodLoss]; // Pass by reference diff --git a/addons/medical_status/stringtable.xml b/addons/medical_status/stringtable.xml index ea3f77429b..cefc85ff42 100644 --- a/addons/medical_status/stringtable.xml +++ b/addons/medical_status/stringtable.xml @@ -127,6 +127,7 @@ 武器を落とす確率 Шанс выпадения оружия Probabilidad de Soltar Arma + Probabilidade de largar a arma Chance for a player to drop their weapon when going unconscious.\nHas no effect on AI. @@ -138,6 +139,7 @@ プレーヤーが意識を失ったときに武器を落とす可能性。\nAI には影響しません。 Шанс для игрока выронить свое оружие, когда он теряет сознание.\nНе влияет на ИИ Probabilidad del jugador de soltar su arma cuando quedan inconscientes.\nNo tiene efecto sobre la IA. + Chance de um jogador largar sua arma quando ficar inconsciente.\nNão tem efeito sobre a IA. diff --git a/addons/medical_treatment/CfgWeapons.hpp b/addons/medical_treatment/CfgWeapons.hpp index 7b31e10bee..aae3fbb69c 100644 --- a/addons/medical_treatment/CfgWeapons.hpp +++ b/addons/medical_treatment/CfgWeapons.hpp @@ -310,4 +310,17 @@ class CfgWeapons { hiddenSelectionsTextures[] = {QPATHTOF(data\bodybagItem_white_co.paa)}; GVAR(bodyBagObject) = "ACE_bodyBagObject_white"; }; + + // Since base game doesn't support misc. items, this is needed to filling inventories in the editor + class ACE_painkillers_Item: ACE_ItemCore { + displayName = CSTRING(painkillers_Display); + author = ECSTRING(common,ACETeam); + scope = 2; + scopeArsenal = 0; + descriptionShort = CSTRING(painkillers_Desc_Short); + picture = QPATHTOF(ui\painkillers_ca.paa); + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; }; diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 4c7a780fc3..0752e67ddf 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -1,5 +1,8 @@ #include "script_component.hpp" +// Pain killers item to magazine +["ACE_painkillers_Item", "ACE_painkillers"] call EFUNC(common,registerItemReplacement); + [QEGVAR(medical_status,initialized), { params ["_unit"]; diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 3782645019..7b340d0109 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -12,7 +12,7 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_painkillersItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; - weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; + weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white","ACE_painkillers_Item"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical_status", "ace_medical_damage", "ace_apl"}; author = ECSTRING(common,ACETeam); diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 8a6be10bb4..97680353e4 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -26,7 +26,9 @@ private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); if (_tourniquets select _partIndex == 0) exitWith { - [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + if (_medic == ACE_player) then { + [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + }; }; _tourniquets set [_partIndex, 0]; @@ -39,8 +41,15 @@ TRACE_1("clearConditionCaches: tourniquetRemove",_nearPlayers); [QEGVAR(interact_menu,clearConditionCaches), [], _nearPlayers] call CBA_fnc_targetEvent; // Add tourniquet item to medic or patient -private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); -[_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +if (_medic call EFUNC(common,isPlayer)) then { + private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); + [_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +} else { + // If the medic is AI, only return tourniquet if enabled + if (missionNamespace getVariable [QEGVAR(medical_ai,requireItems), 0] > 0) then { + [_medic, "ACE_tourniquet"] call EFUNC(common,addToInventory); + }; +}; // Handle occluded medications that were blocked due to tourniquet private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index d080965eb9..7f0fc06764 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -86,7 +86,9 @@ [LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)], [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], [[0, 1, 2], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly), ELSTRING(common,Disabled)], 0], - true + 1, + {[QGVAR(convertItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 383048626a..cbe76041a0 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -75,6 +75,7 @@ 已启用 & 可以诊断死亡/心搏骤停 활성화 및 사망/심정지 진찰 가능 Habilitado y poder diagnosticar Muerte/Parada cardíaca + Habilitado e permite diagnosticar morte/parada cardíaca Abilitato e può diagnosticare Morte/Arresto Cardiaco @@ -84,6 +85,7 @@ 활성화 및 사망/심정지 진찰 가능 [직접] Aktiviert & kann Tod/Herzstillstand diagnostizieren [Direkt] Abilitato e può diagnosticare Morte/Arresto Cardiaco [Esplicito] + Activé & peut diagnostiquer la mort/l'arrêt cardiaque [Direct]. Advanced Medication @@ -161,6 +163,7 @@ Attivi e possono riaprirsi 已启用 & 可以伤口开裂 활성화 및 붕대 풀림 구현 + Habilitado e pode reabrir Wound Reopening Coefficient @@ -175,6 +178,7 @@ Coeficiente de reapertura de heridas 伤口开裂系数 붕대 풀림 계수 + Coeficiente de reabertura de feridas Coefficient for controlling the wound reopening chance. The final reopening chance is determined by multiplying this value with the specific reopening chance for the wound type and bandage used. @@ -189,6 +193,7 @@ Coeficiente que controla la probabilidad de reapertura de heridas. La probabilidad final de reapertura de heridas queda determinada multiplicando este valor por la probabilidad específica del tipo de herida y venda usada. 用于控制伤口开裂概率的系数。最终的重开放概率=该值x伤口类型x所使用的绷带的具体开裂概率。 붕대가 풀리는 확률 계수를 정합니다. 최종 붕대 풀림 계수는 상처의 종류와 쓰인 붕대의 합의 결과에 계수를 곱한 결과입니다. + Coeficiente para controlar a chance de reabertura da ferida. A chance final de reabertura é determinada multiplicando este valor com a chance específica de reabertura para o tipo de ferida e bandagem usada. Clear Trauma @@ -201,6 +206,7 @@ 清理创伤 상처 제거 Despejar trauma + Remover trauma Controls when hitpoint damage from wounds is healed. @@ -213,6 +219,7 @@ 控制伤口治疗后确定受伤部位的受伤情况。 상처가 언제 제거되는 지를 결정합니다. Controla cuando los puntos de daño de las heridas son curados. + Controla quando o dano de pontos de vida de feridas é curado. After Bandage @@ -225,6 +232,7 @@ 包扎后 붕대 묶은 후 Después de vendado + Após fechamento com bandagens After Stitch @@ -237,6 +245,7 @@ 缝合后 상처 봉합 후 Después de sutura + Após sutura Boost medical training when in medical vehicles or facilities. Untrained becomes medic, medic becomes doctor. @@ -329,6 +338,7 @@ Tempo di utilizzo dell'autoiniettore 自动注射器治疗时间 주사기 사용 시간 + Tempo de tratamento de auto-injetores Time, in seconds, required to administer medication using an autoinjector. @@ -341,6 +351,7 @@ Tempo in secondi richiesto per ricevere medicina da un autoiniettore. 使用自动注射器给药所需的时间(秒) 초 단위로 주사기를 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para administrar medicações usando o auto-injetor. Tourniquet Treatment Time @@ -353,6 +364,7 @@ Czas aplikacji stazy 止血带治疗时间 지혈대 사용 시간 + Tempo de tratamento de torniquetes Time, in seconds, required to apply/remove a tourniquet. @@ -365,6 +377,7 @@ Czas w sekundach potrzebny do założenia/zdjęcia stazy. 使用/移除止血带所需的时间(秒) 초 단위로 지혈대를 사용/제거하는 데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para aplicar/remover um torniquete. IV Bag Treatment Time @@ -377,6 +390,7 @@ Czas aplikacji IV 静脉输液袋治疗时间 수액용기 사용 시간 + Tempo de tratamento de bolsas de IV Time, in seconds, required to administer an IV bag. @@ -389,6 +403,7 @@ Czas w sekundach potrzebny na aplikację transfuzji IV. 使用静脉输液所需的时间(秒) 초 단위로 수액용기를 사용하는 데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para administrar uma bolsa de IV. Splint Treatment Time @@ -401,6 +416,7 @@ Czas aplikacji szyny 夹板治疗时间 부목 사용 시간 + Tempo de tratamento de talas Time, in seconds, required to apply a splint. @@ -413,6 +429,7 @@ Czas w sekundach potrzebny na aplikację szyny. 使用夹板所需的时间(秒) 초 단위로 부목을 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para aplicar uma talas. Body Bag Use Time @@ -425,6 +442,7 @@ Czas użycia worka na ciało 尸袋使用时间 시체 운반용 부대 사용 시간 + Tempo de uso de sacos de cadáver Time, in seconds, required to put a patient in a body bag. @@ -437,6 +455,7 @@ Czas w sekundach potrzebny na spakowanie ciała do worka na ciało. 装入裹尸袋时间 초 단위로 시체 운반용 부대를 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para colocar um paciente em um saco de cadáver. Grave Digging Time @@ -448,6 +467,7 @@ 墓掘りの所要時間 Время рытья могилы Tiempo de Cavado de Tumba + Tempo de escavação de cova Time, in seconds, required to dig a grave for a body. @@ -459,6 +479,7 @@ 遺体の墓を掘るのに掛かる時間。 (秒単位) Время в секундах, необходимое для того, чтобы выкопать могилу для тела. Tiempo, en segundos, requerido para cavar una tumba para un cuerpo. + Tempo, em segundos, necessário para cavar uma cova para um corpo. Allow Epinephrine @@ -636,6 +657,7 @@ Kendi PAK Kullanımı Usar EPA sobre uno mismo 개인응급키트 자가 사용 + Auto-tratamento com KPS Enables the use of PAKs to heal oneself. @@ -651,6 +673,7 @@ Kendini iyileştirmek için PAK'ların kullanılmasını sağlar. Habilita el uso de EPA para curarse a uno mismo. 개인응급키트를 사용자 본인에게 쓸 수 있는 지를 정합니다. + Permite o uso de KPS para se tratar. Time Coefficient PAK @@ -815,6 +838,7 @@ Tempo di suturazione ferita. 伤口缝合时间 상처 봉합 시간 + Tempo de sutura de feridas Time, in seconds, required to stitch a single wound. @@ -827,6 +851,7 @@ Tempo in secondi richiesto per suturare una singola ferita. 缝合一个伤口所需的时间(秒) 초 단위로, 한 상처를 봉합하는데 걸리는 시간을 설정합니다. + Tempo, em segundos, necessário para suturar uma única ferida. Self IV Transfusion @@ -869,6 +894,7 @@ Permetti di insaccare un paziente svenuto 允许昏迷者装入尸袋 기절 인원 시체 운반용 부대에 옮기기 + Permitir inconscientes em sacos de cadáver Enables placing an unconscious patient in a body bag. @@ -881,6 +907,7 @@ Permette l'uso della sacca per morti anche su pazienti che sono solo svenuti (causa la morte del paziente) 能够将昏迷的伤员装入尸袋中。 기절 상태의 인원을 시체 운반용 부대에 옮겨 담을 수 있는 지를 정합니다. + Permite colocar um paciente inconsciente em um saco de cadáver. Allow Grave Digging @@ -892,6 +919,7 @@ Autoriser le creusement de tombes 墓掘りを許可 Рытье могил + Permitir escavamento de cova Enables digging graves to dispose of corpses. @@ -903,6 +931,7 @@ Active la possibilité de creuser des tombes pour enterrer les cadavres. 墓を掘って死体を処理できるようになります。 Позволяет рыть могилы для захоронения трупов. + Permite escavar covas para se livrar de cadáveres. Only if dead @@ -914,6 +943,7 @@ Uniquement s'il est mort 死体のみ Только если мертв + Apenas se estiver morto Create Grave Markers @@ -925,6 +955,7 @@ Créer des pierres tombales 墓標を作成 Надгробные знаки + Criar marcadores de covas Enables the creation of grave markers when digging graves. @@ -936,6 +967,7 @@ Active la création de pierres tombales lors de l'enterrement de cadavres. 墓を掘った際、墓標を作成できるようにします。 Позволяет создавать надгробные знаки при рытье могил. + Permite a criação de marcadores de covas ao escavá-las. Allow IV Transfusion @@ -950,6 +982,7 @@ Доступ к внутривенному переливанию Permitir transfusión de IV 수액용기 사용 허가 + Permitir transfusão IV Training level required to transfuse IVs. @@ -964,6 +997,7 @@ Уровень навыка, требуемый для осуществления внутривенного переливания. Nivel de capacitación requerido para transfusiones de IV. 수액용기를 사용하는데 필요한 등급을 정합니다. + Nível de treinamento necessário para transfusões IV. Locations IV Transfusion @@ -976,6 +1010,7 @@ Luoghi Fleboclisi EV 静脉输液地点 수액용기 사용 장소 + Locais para transfusão IV Controls where IV transfusions can be performed. @@ -988,6 +1023,7 @@ Luoghi in cui è possibile applicare Fleboclisi Endovenose. 控制何地可以静脉输液 수액용기를 사용할 수 있는 장소를 정합니다. + Controla onde as transfusões IV podem ser realizadas. Convert Vanilla Items @@ -1220,6 +1256,7 @@ 心肺复苏的最低成功率 최소 심폐소생술 성공 가능성 RCP posibilidad mínima de resultado satisfactorio + Probabilidade mínima de sucesso de RCP CPR Success Chance Maximum @@ -1232,6 +1269,7 @@ 心肺复苏的最高成功率 최대 심폐소생술 성공 가능성 RCP posibilidad máxima de resultado satisfactorio + Probabilidade máxima de sucesso de RCP Minimum probability that performing CPR will restore heart rhythm.\nThis minimum value is used when the patient has at least "Lost a fatal amount of blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds. @@ -1244,6 +1282,7 @@ 实施心肺复苏恢复心律的最小可能性。\n当伤员至少有"致命失血量"时,就取该最小值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。 심폐소생술 시 제일 낮은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "심각한 양의 혈액을 잃음"일 때 사용됩니다. Probabilidad mínima de que realizar RCP restaure el ritmo cardíaco.\n Este valor mínimo es utilizado cuando el paciente tiene al menos "Pérdida fatal de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo. + Probabilidade mínima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam uma quantidade fatal de sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima. Maximum probability that performing CPR will restore heart rhythm.\nThis maximum value is used when the patient has at most "Lost some blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds. @@ -1256,6 +1295,7 @@ 实施心肺复苏恢复心律的最大可能性。\n当伤员最多“失血一些”时,就取该最大值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。 심폐소생술 시 제일 높은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "혈액을 조금 잃음"일 때 사용됩니다. Probabilidad máxima de que realizar RCP restaure el ritmo cardíaco.\n Este valor máximo es utilizado cuando el paciente tiene como mucho "Pérdida de un poco de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo. + Probabilidade máxima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam pouco sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima. CPR Treatment Time @@ -1268,6 +1308,7 @@ HLW Behandlungsdauer 心肺复苏时间 심폐소생술 시행 시간 + Duração do RCP Time, in seconds, required to perform CPR on a patient. @@ -1280,6 +1321,7 @@ Zeit in Sekunden, die benötigt wird, um eine HLW durzuführen. 对伤员实施心肺复苏所需的时间(秒) 초 단위로, 심폐소생술을 진행하는 시간을 결정합니다. + Tempo, em segundos, necessário para realizar RCP em um paciente. Holster Required @@ -1294,6 +1336,7 @@ Необходимость убирать оружие Requiere enfundar 무장여부 + Necessário guardar armas Controls whether weapons must be holstered / lowered in order to perform medical actions.\nExcept Exam options allow examination actions (checking pulse, blood pressure, response) at all times regardless of this setting. @@ -1308,6 +1351,7 @@ Нужно ли убирать оружие для проведения медицинских действий.\nОпция «Проверка разрешена» разрешает проверять пульс, кровяное давление или реакцию независимо от этого параметра. Controla si las armas deben estar enfundadas / bajadas para realizar acciones médicas. \n Excepto Las opciones de examen permiten acciones de examen (control del pulso, presión arterial, respuesta) en todo momento, independientemente de esta configuración. 치료하기에 앞서 손에서 무기를 집어넣을 지/내릴지를 결정합니다.\n검사제외 옵션의 경우 맥박 확인, 혈압 확인, 반응 확인은 앞선 옵션에 구애받지 않고 사용할 수 있습니다. + Controla se as armas devem ser guardadas/abaixadas para realizar ações médicas.\n"Exceto exame" faz com que ações de verificação de pulso, pressão arterial e resposta sejam permitidas a qualquer momento. Lowered or Holstered @@ -1322,6 +1366,7 @@ Опущено или убрано Bajada o enfundada 내리거나 집어넣기 + Abaixada ou guardada Lowered or Holstered (Except Exam) @@ -1336,6 +1381,7 @@ Опущено или убрано (Проверка разрешена) Bajada o enfundada (excepto examen) 내리거나 집어넣기(검사 제외) + Abaixada ou guardada (exceto exame) Holstered Only @@ -1350,6 +1396,7 @@ Только убрано Solo enfundada 집어넣기 + Guardada apenas Holstered Only (Except Exam) @@ -1364,6 +1411,7 @@ Только убрано (Проверка разрешена) Solo enfundada (excepto examen) 집어넣기(검사 제외) + Guardada apenas (exceto exame) [ACE] Medical Supply Crate (Basic) @@ -1376,7 +1424,7 @@ [ACE] Caisse médicale (basique) [ACE] Orvosi láda (Alap) [ACE] Cassa Rifornimenti Medici (Basici) - [ACE] 医療物資箱 (ベーシック) + [ACE] 医療物資箱 (基本) [ACE] 의료 물자 (기본) [ACE] 医疗补给箱(基础) [ACE] 醫療補給箱(基本) @@ -1393,7 +1441,7 @@ [ACE] Caisse médicale (avancée) [ACE] Orvosi láda (Fejlett) [ACE] Cassa Rifornimenti Medici (Avanzati) - [ACE] 医療物資箱 (アドバンスド) + [ACE] 医療物資箱 (高度) [ACE] 의료 물자 (고급) [ACE] 医疗补给箱(高级) [ACE] 醫療補給箱(進階) @@ -1827,7 +1875,7 @@ Auto-morfin Morfium autoinjektor Autoiniettore di Morfina - Auto-injetor de morfina + Autoinjetor de Morfina モルヒネ自動注射器 자동주사기 (모르핀) 吗啡自动注射器 @@ -1874,7 +1922,7 @@ Auto-injecteur d'adénosine Autoiniettore di Adenosina Auto-adenosine - Auto-injetor de Adenosina + Autoinjetor de Adenosina Аденозин в пневмошприце アデノシン自動注射器 자동주사기 (아데노신) @@ -1922,7 +1970,7 @@ Auto-atropine Atropin autoinjektor Autoiniettore di Atropina - Auto-injetor de Atropina + Autoinjetor de Atropina アトロピン自動注射器 자동주사기 (아트로핀) 阿托品自动注射器 @@ -1971,7 +2019,7 @@ Auto-adrenalin Epinefrin autoinjektor Autoiniettore di Epinefrina - Auto-injetor de epinefrina + Autoinjetor de Epinefrina アドレナリン自動注射器 자동주사기 (에피네프린) 肾上腺素自动注射器 @@ -2385,7 +2433,7 @@ Operationsset Sebészeti készlet Kit chirurgico - Kit Cirurgico + Kit Cirúrgico Chirurgická sada 手術キット 봉합 키트 @@ -2402,7 +2450,7 @@ Operationsset für fortgeschrittene medizinische Feldversorgung Sebészeti készlet komplex orvosi feladatok terepen való ellátására Kit chirurgico per trattamenti avanzati sul campo. - Kit Cirurgico para uso de tratamento médico avançado em campo + Kit Cirúrgico para uso de tratamento médico avançado em campo Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 手術キットは戦場で高度な処置をする為に用いる 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 @@ -2419,7 +2467,7 @@ Trousse chirurgicale pour le traitement avancé sur le terrain. Sebészeti készlet komplex orvosi feladatok terepen való ellátására Kit chirurgico per trattamenti avanzati sul campo. - Kit Cirurgico para uso de tratamento médico avançado em campo. + Kit Cirúrgico para uso de tratamento médico avançado em campo. Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 手術キットは戦場で高度な処置をする為に用いる 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 @@ -2454,6 +2502,7 @@ 봉합술 Suture Нить + Sutura Surgical Suture for stitching injuries. @@ -2465,6 +2514,7 @@ 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. Хирургическая нить для зашивания травм. + Sutura cirúrgica para fechar feridas. Surgical Suture for stitching injuries. @@ -2476,6 +2526,7 @@ 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. Хирургическая нить для зашивания травм. + Sutura cirúrgica para fechar feridas. Bodybag @@ -4147,7 +4198,7 @@ %1 is not responsive %1 не реагирует на раздражители - %1 est inconscient. + %1 ne répond pas aux stimuli %1 no reacciona %1 jest nieprzytomny %1 ist nicht ansprechbar @@ -4168,6 +4219,7 @@ %1은(는) 의식불명입니다 %1 ist bewusstlos %1 è privo di sensi + %1 est inconscient %1 is not responsive, taking shallow gasps and convulsing @@ -4180,6 +4232,7 @@ %1 은 반응이 없고, 얕은 헐떡임과 경련증세를 보입니다 %1 не реагирует на раздражители, поверхностно дышит, в конвульсиях %1 no responde, dando pequeñas bocanadas y convulsionando + %1 está inconsciente, com respiração curta e convulsionando %1 is in cardiac arrest @@ -4188,6 +4241,7 @@ %1은(는) 심정지 상태입니다 %1 ist im Herzstillstand %1 è in arresto cardiaco + %1 est en arrêt cardiaque %1 is not responsive, motionless and cold @@ -4200,6 +4254,7 @@ %1 은 반응이 없고, 움직임이 없으며 차갑습니다 %1 не реагирует на раздражители, не шевелится и холодный %1 no responde, sin movimiento y frío + %1 está inconsciente, sem movimento e frio %1 is dead @@ -4208,6 +4263,7 @@ %1은(는) 사망했습니다 %1 ist tod %1 è morto + %1 est mort You checked %1 @@ -4694,6 +4750,7 @@ 墓を掘る Выкопать могилу для тела Cavar tumba para cuerpo + Escavar cova para cadáver Digging grave for body... @@ -4705,6 +4762,7 @@ 墓を掘っています Рытьё могилы для тела... Cavando tumba para cuerpo... + Escavando cova para cadáver... %1 has bandaged patient @@ -4947,6 +5005,7 @@ Der Körper zuckte und kann nicht tot sein! 身体抽搐了一下,可能还没死! 꿈틀대는걸 보니 죽은 것 같지는 않습니다! + O corpo se retorceu e pode não estar morto! Check name on headstone @@ -4958,6 +5017,7 @@ 墓石の名前を確認 Проверьте имя на надгробии Comprobar nombre en la lápida + Checar nome na lápide Bandage Rollover @@ -4969,6 +5029,7 @@ 包帯の繰り越し Перевязка множественных ран Vendaje múltiple + Bandagem de Múltiplas Feridas If enabled, bandages can close different types of wounds on the same body part.\nBandaging multiple injuries will scale bandaging time accordingly. @@ -4980,6 +5041,7 @@ 有効にすると、体の同じ部分にある別の種類の傷を一つの包帯で閉じることができます。\n複数の傷に包帯を巻くと、それに応じて包帯時間が変動します。 Если эта функция включена, бинты могут закрывать различные типы ран на одной и той же части тела.\nПри перевязке нескольких повреждений время перевязки будет увеличено соответствующим образом. Si se habilita, las vendas pueden cerrar diferentes tipos de heridas en la misma parte del cuerpo.n\Vendar múltiples heridas escala el tiempo de vendado acorde. + Se habilitado, bandagens podem fechar diferentes tipos de ferimento na mesma parte do corpo.\nO fechamento de múltiplas feridas modificará o tempo de aplicação proporcionalmente. Bandage Effectiveness Coefficient @@ -4991,6 +5053,7 @@ 包帯有効性係数 Коэф. эффективности повязки Coeficiente de Efectividad de Vendado + Coeficiente de Eficácia da Bandagem Determines how effective bandages are at closing wounds. @@ -5002,6 +5065,7 @@ 包帯が傷をふさぐのにどれだけ効果的かを定義します。 Определяет, насколько эффективны бинты при закрытии ран. Determina como de efectivos son los vendajes cerrando heridas. + Determina o quão efetivas as bandagens são em fechar ferimentos. Medical Items @@ -5016,6 +5080,7 @@ Medizinisches Material 医療品 Objetos médicos + Objetos médicos Zeus Treatment Time Coefficient diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index c284b00701..77aec7fd62 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -85,17 +85,17 @@ if (_adjustments isNotEqualTo []) then { private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; - _adjustments set [_forEachIndex, objNull]; + _adjustments deleteAt _forEachIndex; } else { private _effectRatio = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; if (_hrAdjust != 0) then { _hrTargetAdjustment = _hrTargetAdjustment + _hrAdjust * _effectRatio; }; if (_painAdjust != 0) then { _painSupressAdjustment = _painSupressAdjustment + _painAdjust * _effectRatio; }; if (_flowAdjust != 0) then { _peripheralResistanceAdjustment = _peripheralResistanceAdjustment + _flowAdjust * _effectRatio; }; }; - } forEach _adjustments; + } forEachReversed _adjustments; if (_deleted) then { - _unit setVariable [VAR_MEDICATIONS, _adjustments - [objNull], true]; + _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; _syncValues = true; }; }; diff --git a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf index 30f8038d80..05056fa0a3 100644 --- a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf +++ b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf @@ -20,4 +20,4 @@ params ["_unit", "_peripheralResistanceAdjustment", "_deltaT", "_syncValue"]; -_unit setVariable [VAR_PERIPH_RES, 0 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; +_unit setVariable [VAR_PERIPH_RES, 1 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; diff --git a/addons/medical_vitals/stringtable.xml b/addons/medical_vitals/stringtable.xml index 2fe7336dc0..25b278732e 100644 --- a/addons/medical_vitals/stringtable.xml +++ b/addons/medical_vitals/stringtable.xml @@ -21,6 +21,7 @@ Activer la simulation de la SpO2 SpO2-Simulation aktivieren Habilitar Simulación SpO2 + Habilitar simulação de SpO2 Enables oxygen saturation simulation, providing variable heart rate and oxygen demand based on physical activity and altitude. Required for Airway Management. @@ -31,6 +32,7 @@ Permet de simuler la saturation en oxygène, de modifier la fréquence cardiaque et la consommation d'oxygène en fonction de l'activité physique et de l'altitude. Nécessaire pour la gestion des voies respiratoires. Aktiviert die Simulation der Sauerstoffsättigung und bietet variable Herzfrequenz und Sauerstoffbedarf basierend auf körperlicher Aktivität und Geländehöhe. Erforderlich für das Atemwegsmanagement. Habilita la saturación de oxígeno, utilizando la demanda de oxígeno y ritmo cardíaco basado en la actividad física y la altitud. Requerido para el Manejo de las Vías Aéreas. + Habilita a saturação de oxigênio, tornando variáveis o batimento cardíaco e demanda de oxigênio baseados em atividade física e altitude. Necessário para o gerenciamento de vias aéreas. diff --git a/addons/metis/CfgAmmo.hpp b/addons/metis/CfgAmmo.hpp index 1f613a36b1..c070343253 100644 --- a/addons/metis/CfgAmmo.hpp +++ b/addons/metis/CfgAmmo.hpp @@ -10,12 +10,14 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0027; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + initialPitch = 2; canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + showTrail = 1; + // Guidance type for munitions defaultSeekerType = "SACLOS"; seekerTypes[] = { "SACLOS" }; @@ -23,6 +25,12 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 10; + lineGainD = 9; + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 15; // Angle from the shooter's view that can track the missile seekerAccuracy = 1; // seeker accuracy multiplier @@ -30,7 +38,6 @@ class CfgAmmo { seekerMinRange = 80; seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - correctionDistance = 3; // distance from center of crosshair where missile slows down offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. // Attack profile type selection @@ -50,9 +57,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0027; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -63,6 +69,12 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 21; + lineGainD = 18; + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 15; // Angle from the shooter's view that can track the missile seekerAccuracy = 1; // seeker accuracy multiplier @@ -70,7 +82,7 @@ class CfgAmmo { seekerMinRange = 80; seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - correctionDistance = 3; // distance from center of crosshair where missile slows down + correctionDistance = 1; // distance from center of crosshair where missile slows down offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. // Attack profile type selection diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index c9bd546afc..79b66e18eb 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -29,7 +29,7 @@ MicroDAGR fejlett GPS vevőegység Ricevitore GPS avanzato MicroDAGR Receptor GPS avançado MicroDAGR - MicroDAGRは改良された高度なGPS受信機です + MicroDAGRは高機能なGPS受信機です 마이크로DAGR 고급 위성항법 수신기 微型军用高级防御 GPS 接收器 微型軍用高級防禦GPS接收器 @@ -605,6 +605,7 @@ MicroDAGR - Poprzedni Tryb 微型 GPS 接收器—上一个模式 마이크로DAGR - 이전 모드 + MicroDAGR - Modo Anterior MicroDAGR - Next Mode @@ -617,6 +618,7 @@ MicroDAGR - Kolejny Tryb 微型 GPS 接收器—下一个模式 마이크로DAGR - 다음 모드 + MicroDAGR - Modo Seguinte diff --git a/addons/missileguidance/ACE_GuidanceConfig.hpp b/addons/missileguidance/ACE_GuidanceConfig.hpp index 3628c9eec0..131beee339 100644 --- a/addons/missileguidance/ACE_GuidanceConfig.hpp +++ b/addons/missileguidance/ACE_GuidanceConfig.hpp @@ -6,6 +6,11 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_LIN); }; + // empty classes for backwards compat + class MID: LIN { + }; + class HI: LIN { + }; class DIR { name = ""; visualName = ""; @@ -13,21 +18,14 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_DIR); }; - class MID { + class LOFT { name = ""; visualName = ""; description = ""; - functionName = QFUNC(attackProfile_MID); + functionName = QFUNC(attackProfile_LOFT); }; - class HI { - name = ""; - visualName = ""; - description = ""; - - functionName = QFUNC(attackProfile_HI); - }; - class JAV_DIR { + class JAV_DIR { name = ""; visualName = ""; description = ""; @@ -82,12 +80,39 @@ class GVAR(SeekerTypes) { functionName = QFUNC(seekerType_SACLOS); onFired = QFUNC(SACLOS_onFired); }; - class ARH { + class MillimeterWaveRadar { name = ""; visualName = ""; description = ""; - functionName = QFUNC(seekerType_ARH); - onFired = QFUNC(ahr_onFired); + functionName = QFUNC(seekerType_MWR); + onFired = QFUNC(mwr_onFired); + }; +}; + +class GVAR(NavigationTypes) { + class Direct { + functionName = QFUNC(navigationType_direct); + onFired = ""; + }; + class Line { + functionName = QFUNC(navigationType_line); + onFired = QFUNC(line_onFired); + }; + class LineOfSight { + functionName = QFUNC(navigationType_lineOfSight); + onFired = QFUNC(proNav_onFired); + }; + class ProportionalNavigation { + functionName = QFUNC(navigationType_proNav); + onFired = QFUNC(proNav_onFired); + }; + class AugmentedProportionalNavigation { + functionName = QFUNC(navigationType_augmentedProNav); + onFired = QFUNC(proNav_onFired); + }; + class ZeroEffortMiss { + functionName = QFUNC(navigationType_zeroEffortMiss); + onFired = QFUNC(proNav_onFired); }; }; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index a2b07b7fff..d9813fdf77 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -20,19 +20,21 @@ class CfgAmmo { class ADDON { enabled = 1; - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.0025; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 40; // degrees per second + yawRate = 40; canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode // Guidance type for munitions defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + seekerTypes[] = { "SALH" }; defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + seekerAngle = 90; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -69,9 +71,10 @@ class CfgAmmo { class ADDON { enabled = 1; - minDeflection = 0.00005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.00005; // The incrmeent in which deflection adjusts. + pitchRate = 100; // degrees per second + yawRate = 100; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; canVanillaLock = 0; @@ -82,6 +85,11 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -94,6 +102,19 @@ class CfgAmmo { defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QFUNC(javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 { diff --git a/addons/missileguidance/CfgMagazines.hpp b/addons/missileguidance/CfgMagazines.hpp index 74d75e8d4a..c7ef48004c 100644 --- a/addons/missileguidance/CfgMagazines.hpp +++ b/addons/missileguidance/CfgMagazines.hpp @@ -4,24 +4,40 @@ class CfgMagazines { class 6Rnd_ACE_Hydra70_DAGR: 12Rnd_PG_missiles { ammo = "ACE_Hydra70_DAGR"; count = 12; - displayName = "6 Round DAGR"; - displayNameShort = "6 Round DAGR"; - descriptionShort = "6 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_6x); weight = 36; }; class 12Rnd_ACE_Hydra70_DAGR: 6Rnd_ACE_Hydra70_DAGR { count = 12; - displayName = "16 Round DAGR"; - displayNameShort = "16 Round DAGR"; - descriptionShort = "16 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_12x); weight = 72; }; class 24Rnd_ACE_Hydra70_DAGR: 6Rnd_ACE_Hydra70_DAGR { count = 24; - displayName = "24 Round DAGR"; - displayNameShort = "24 Round DAGR"; - descriptionShort = "24 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_24x); weight = 72; }; + + class PylonRack_12Rnd_PG_missiles; + class PylonRack_6Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_6x); + count = 6; + pylonWeapon = QGVAR(dagr); + }; + + class PylonRack_12Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_12x); + count = 12; + pylonWeapon = QGVAR(dagr); + }; + + class PylonRack_24Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_24x); + count = 24; + pylonWeapon = QGVAR(dagr); + }; }; diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index b03628e777..d88cf27b53 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -2,8 +2,13 @@ class CfgWeapons { class missiles_DAGR; class GVAR(dagr): missiles_DAGR { + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + magazines[] = {"6Rnd_ACE_Hydra70_DAGR","12Rnd_ACE_Hydra70_DAGR","24Rnd_ACE_Hydra70_DAGR","PylonRack_6Rnd_ACE_DAGR","PylonRack_12Rnd_ACE_DAGR","PylonRack_24Rnd_ACE_DAGR"}; + + autoFire = 0; canLock = 0; - magazines[] = {"6Rnd_ACE_Hydra70_DAGR","12Rnd_ACE_Hydra70_DAGR","24Rnd_ACE_Hydra70_DAGR"}; + weaponLockSystem = 0; lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index 075f2f03c5..daff5b502b 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -6,6 +6,8 @@ PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); +PREP(dev_ProjectileCamera); + PREP(onFired); PREP(onIncomingMissile); @@ -16,28 +18,45 @@ PREP(doSeekerSearch); PREP(doHandoff); PREP(handleHandoff); +//re-enable after feature merge - PREP(shouldFilterRadarHit); + // Attack Profiles PREP(attackProfile_AIR); PREP(attackProfile_DIR); -PREP(attackProfile_HI); PREP(attackProfile_LIN); -PREP(attackProfile_MID); +PREP(attackProfile_LOFT); PREP(attackProfile_WIRE); PREP(attackProfile_BEAM); +//re-enable after feature merge - PREP(attackProfile_JDAM); // Javelin profiles PREP(attackProfile_JAV_DIR); PREP(attackProfile_JAV_TOP); +PREP(javelin_midCourseTransition); + +// Navigation Profiles +PREP(navigationType_zeroEffortMiss); +PREP(navigationType_augmentedProNav); +PREP(navigationType_proNav); +PREP(navigationType_lineOfSight); +PREP(navigationType_line); +PREP(navigationType_direct); // Seeker search functions PREP(seekerType_SALH); PREP(seekerType_Optic); PREP(seekerType_SACLOS); -PREP(seekerType_ARH); +//re-enable after feature merge - PREP(seekerType_Doppler); +PREP(seekerType_MWR); // Attack Profiles OnFired PREP(wire_onFired); // Seeker OnFired PREP(SACLOS_onFired); -PREP(ahr_onFired); +PREP(mwr_onFired); + +// Navigation OnFired +PREP(proNav_onFired); +PREP(line_onFired); + diff --git a/addons/missileguidance/XEH_postInit.sqf b/addons/missileguidance/XEH_postInit.sqf index eb0fb60abf..e0fc98ba1b 100644 --- a/addons/missileguidance/XEH_postInit.sqf +++ b/addons/missileguidance/XEH_postInit.sqf @@ -2,12 +2,10 @@ [QGVAR(handoff), LINKFUNC(handleHandoff)] call CBA_fnc_addEventHandler; -["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), -{ +["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), { [] call FUNC(cycleAttackProfileKeyDown); false -}, -{ +}, { false }, [15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key diff --git a/addons/missileguidance/XEH_preInit.sqf b/addons/missileguidance/XEH_preInit.sqf index 0798fed2e4..9b1a85e37c 100644 --- a/addons/missileguidance/XEH_preInit.sqf +++ b/addons/missileguidance/XEH_preInit.sqf @@ -11,4 +11,15 @@ PREP_RECOMPILE_END; // As weapons take config changes, there is little point in being able to disable guidance if (isNil QGVAR(enabled)) then { GVAR(enabled) = 2; }; +GVAR(debug_enableMissileCamera) = false; +GVAR(debug_drawGuidanceInfo) = false; + +#ifdef DRAW_GUIDANCE_INFO +GVAR(debug_drawGuidanceInfo) = true; +#endif + +#ifdef ENABLE_PROJECTILE_CAMERA +GVAR(debug_enableMissileCamera) = true; +#endif + ADDON = true; diff --git a/addons/missileguidance/dev/getAmmoProperties.sqf b/addons/missileguidance/dev/getAmmoProperties.sqf new file mode 100644 index 0000000000..9c416c228f --- /dev/null +++ b/addons/missileguidance/dev/getAmmoProperties.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" + +private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))})]; + +private _seekerTypes = createHashMap; +private _navigationTypes = createHashMap; +private _attackProfiles = createHashMap; +{ + private _seekerType = getText (_x >> QUOTE(ADDON) >> "defaultSeekerType"); + private _navigationType = getText (_x >> QUOTE(ADDON) >> "defaultNavigationType"); + private _attackProfile = getText (_x >> QUOTE(ADDON) >> "defaultAttackProfile"); + + private _seekers = _seekerTypes getOrDefault [_seekerType, []]; + private _navigations = _navigationTypes getOrDefault [_navigationType, []]; + private _attacks = _attackProfiles getOrDefault [_attackProfile, []]; + + _seekers pushBack configName _x; + _navigations pushBack configName _x; + _attacks pushBack configName _x; + + _seekerTypes set [_seekerType, _seekers]; + _navigationTypes set [_navigationType, _navigations]; + _attackProfiles set [_attackProfile, _attacks]; +} forEach _configs; + +[_seekerTypes, _navigationTypes, _attackProfiles] diff --git a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf index 299ec6f236..f48b4a9571 100644 --- a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf +++ b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf @@ -32,4 +32,3 @@ _seekerStateParams set [2, _animationSourceGun]; _seekerStateParams set [3, _usePilotCamera || { (_shooter isKindOf "Plane") && hasPilotCamera _shooter }]; if ((_shooter isKindOf "Plane") && !hasPilotCamera _shooter) then { WARNING("SACLOS fired from planes without pilot camera unsupported!"); }; - diff --git a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf index 5aaff9d7f8..fd86b57104 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf @@ -17,31 +17,26 @@ * Public: No */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "", "", "", "", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; -_attackProfileStateParams params["_maxCorrectableDistance", "_wireCut", "_randomVector", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; +_attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_lastInput", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; private _projectilePos = getPosASL _projectile; private _shooterPos = getPosASL _shooter; -private _shooterDir = vectorNormalized(_seekerTargetPos vectorDiff _shooterPos); private _distanceToProjectile = _shooterPos vectorDistanceSqr _projectilePos; -if (_distanceToProjectile > _seekerMaxRangeSqr || { _seekerTargetPos isEqualTo [0, 0, 0] } || { _distanceToProjectile < _seekerMinRangeSqr }) exitWith { - // return position 50m infront of projectile - _projectilePos vectorAdd (_projectile vectorModelToWorld [0, 50, 0]) +if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { + // wire snap, random direction + if !(_wireCut) then { + _attackProfileStateParams set [1, true]; + }; + _lastInput }; -private _relativeCorrection = _projectile vectorWorldToModel (_projectilePos vectorDiff _seekerTargetPos); -_relativeCorrection = _relativeCorrection vectorDiff _crosshairOffset; +private _final = _seekerTargetPos vectorAdd _crosshairOffset; +_attackProfileStateParams set [2, _final]; -private _magnitude = vectorMagnitude [_relativeCorrection select 0, 0, _relativeCorrection select 2]; -private _fovImpulse = 1 min (_magnitude / _maxCorrectableDistance); // the simulated impulse for the missile being close to the center of the crosshair +_targetData set [0, _projectilePos vectorFromTo _final]; -// Adjust the impulse due to near-zero values creating wobbly missiles? -private _correction = _fovImpulse; - - -_relativeCorrection = (vectorNormalized _relativeCorrection) vectorMultiply _correction; -private _returnPos = _projectilePos vectorDiff (_projectile vectorModelToWorld _relativeCorrection); -_returnPos vectorAdd (_shooterDir vectorMultiply _distanceAheadOfMissile) +_final diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf index 80499a85da..d2a2c0616c 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -1,8 +1,8 @@ #include "..\script_component.hpp" /* - * Author: jaynus / nou + * Author: tcvm * Attack profile: DIR - * TODO: falls back to Linear + * Returns target position with no modifications * * Arguments: * 0: Seeker Target PosASL @@ -18,4 +18,5 @@ * Public: No */ -_this call FUNC(attackProfile_LIN); +params ["_seekerTargetPos"]; +_seekerTargetPos diff --git a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf deleted file mode 100644 index 92413f59d0..0000000000 --- a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus / nou - * Attack profile: HI - * TODO: falls back to Linear - * - * Arguments: - * 0: Seeker Target PosASL - * 1: Guidance Arg Array - * 2: Attack Profile State - * - * Return Value: - * Missile Aim PosASL - * - * Example: - * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_HI; - * - * Public: No - */ - -_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index b690ab2075..6b06c0dd91 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -47,7 +47,7 @@ private _returnTargetPos = _seekerTargetPos; switch (_attackProfileStateParams select 0) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if (_distanceToShooter < 10) then { + if (_distanceToShooter < 6) then { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; @@ -55,7 +55,8 @@ switch (_attackProfileStateParams select 0) do { }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - private _cruisAlt = 60 * (_distanceShooterToTarget/2000); + // 65 is min range + private _cruisAlt = 60 * ((0 max (_distanceShooterToTarget - 65))/2000); if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index f1f360e403..347d144914 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -57,7 +57,7 @@ switch( (_attackProfileStateParams select 0) ) do { TRACE_1("STAGE_CLIMB",""); private _cruisAlt = 140; if (_distanceShooterToTarget < 1250) then { - _cruisAlt = 140 * (_distanceShooterToTarget/1250); + _cruisAlt = 140 * ((0 max (_distanceShooterToTarget - 150))/1250); TRACE_1("_cruisAlt",_cruisAlt); }; if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index e346b16eb6..5462a80a75 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -18,8 +18,10 @@ */ params ["_seekerTargetPos", "_args"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "_launchParams"]; _firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams"]; +_targetLaunchParams params ["", "", "_launchPos"]; if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; @@ -30,27 +32,29 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; +private _ttgo = _distanceToTarget / (vectorMagnitude velocity _projectile); + TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _addHeight = [0,0,0]; -// Always climb an arc on initial launch if we are close to the round -if ((((ASLtoAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; - TRACE_1("climb - near shooter",_addHeight); -} else { - // If we are below the target, increase the climbing arc - if (((_projectilePos select 2) < (_seekerTargetPos select 2)) && {_distanceToTarget > 100}) then { - _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; - TRACE_1("climb - below target and far",_addHeight); - }; -}; +private _2dDistance = (800 + (_projectilePos distance2D _launchPos)) / (_projectilePos distance2D _seekerTargetPos); -// Projectile above target -if ((_projectilePos select 2) > (_seekerTargetPos select 2)) then { - TRACE_1("above - far",_addHeight); - _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget / 50]; +if (_2dDistance <= 1) then { + _addHeight = [0, 0, (_projectilePos#2) + 8]; +} else { + // Always climb an arc on initial launch if we are close to the round + if ((((ASLtoAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { + _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; + TRACE_1("climb - near shooter",_addHeight); + } else { + // If we are below the target, increase the climbing arc + if (((_projectilePos select 2) < (_seekerTargetPos select 2)) && {_distanceToTarget > 100}) then { + _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; + TRACE_1("climb - below target and far",_addHeight); + }; + }; }; private _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf new file mode 100644 index 0000000000..1fff2ef8c5 --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf @@ -0,0 +1,53 @@ +#include "..\script_component.hpp" +/* + * Author: jaynus / nou + * Attack profile: AIR + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_AIR; + * + * Public: No + */ + +params ["_seekerTargetPos", "_args"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; + +if (_seekerTargetPos isEqualTo [0, 0, 0]) exitWith { + _seekerTargetPos +}; + +private _projectilePos = getPosASLVisual _projectile; +private _distanceToTarget2d = _projectilePos distance2d _seekerTargetPos; + +private _closingRate = vectorMagnitude velocity _projectile; +private _timeToGo = (_projectilePos distance _seekerTargetPos) / _closingRate; + +// we could do stuff like desired attack angle, but I'm not going that far today +private _los = vectorNormalized (_seekerTargetPos vectorDiff _projectilePos); + +private _angleToTarget = acos ((vectorDir _projectile) vectorCos _los); +private _atMinRotationAngle = _angleToTarget >= (0.5 * _pitchRate * _timeToGo); + +private _returnTargetPos = _seekerTargetPos; + +if (!_atMinRotationAngle && _distanceToTarget2d >= 500 && _timeToGo >= 10) then { + // 10 degree pitch up + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, (_projectilePos distance _seekerTargetPos) * sin 10]; +}; + +_returnTargetPos diff --git a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf deleted file mode 100644 index 2ca9eef77f..0000000000 --- a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus / nou - * Attack profile: MID - * TODO: falls back to Linear - * - * Arguments: - * 0: Seeker Target PosASL - * 1: Guidance Arg Array - * 2: Attack Profile State - * - * Return Value: - * Missile Aim PosASL - * - * Example: - * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_MID; - * - * Public: No - */ - -_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf index 443fe1bb97..361b0d8fcf 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf @@ -17,47 +17,27 @@ * Public: No */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "", "", "", "", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; -_attackProfileStateParams params["_maxCorrectableDistance", "_wireCut", "_randomVector", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; +_attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_lastInput", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; private _projectilePos = getPosASL _projectile; private _shooterPos = getPosASL _shooter; -private _shooterDir = vectorNormalized(_seekerTargetPos vectorDiff _shooterPos); private _distanceToProjectile = _shooterPos vectorDistanceSqr _projectilePos; if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { // wire snap, random direction - if (_randomVector isEqualTo [0, 0, 0]) then { - _randomVector = RANDOM_VECTOR_3D vectorMultiply 300; + if !(_wireCut) then { _attackProfileStateParams set [1, true]; - _attackProfileStateParams set [2, _randomVector]; - playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLtoASL (_shooter modelToWorld _wireCutSource), 5, 1, 150]; }; - _projectilePos vectorAdd _randomVector + _lastInput }; -if (_seekerTargetPos isEqualTo [0, 0, 0] || { _distanceToProjectile < _seekerMinRangeSqr }) exitWith { - // cut wire if its caught on terrain - /*if (lineIntersectsSurfaces [getPosASL _shooter, _projectilePos, _shooter] isNotEqualTo []) then { - _attackProfileStateParams set [1, true]; - };*/ - // return position 50m infront of projectile - _projectilePos vectorAdd (_projectile vectorModelToWorld [0, 50, 0]) -}; +private _final = _seekerTargetPos vectorAdd _crosshairOffset; +_attackProfileStateParams set [2, _final]; -private _relativeCorrection = _projectile vectorWorldToModel (_projectilePos vectorDiff _seekerTargetPos); -_relativeCorrection = _relativeCorrection vectorDiff _crosshairOffset; +_targetData set [0, _projectilePos vectorFromTo _final]; -private _magnitude = vectorMagnitude [_relativeCorrection select 0, 0, _relativeCorrection select 2]; -private _fovImpulse = 1 min (_magnitude / _maxCorrectableDistance); // the simulated impulse for the missile being close to the center of the crosshair - -// Adjust the impulse due to near-zero values creating wobbly missiles? -private _correction = _fovImpulse; - - -_relativeCorrection = (vectorNormalized _relativeCorrection) vectorMultiply _correction; -private _returnPos = _projectilePos vectorDiff (_projectile vectorModelToWorld _relativeCorrection); -_returnPos vectorAdd (_shooterDir vectorMultiply _distanceAheadOfMissile) +_final diff --git a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf index 21884c1693..77858401ba 100644 --- a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf +++ b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf @@ -2,6 +2,7 @@ /* * Author: jaynus / nou * Change a projectile's direction, maintaing speed + * No longer used in guidancePFH, kept for backwards compatibility * * Arguments: * 0: Projectile @@ -16,10 +17,9 @@ * Public: No */ -params ["_projectile", "_v"]; +params ["_projectile", "_pitch", "_yaw", "_roll"]; -private _l = sqrt ((_v select 0) ^ 2 + (_v select 1) ^ 2); -private _r = -(_v select 2) / _l; +private _dir = [sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch]; +private _up = [[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D; -_projectile setVectorDirAndUp [ _v, [(_v select 0) * _r,(_v select 1) * _r, _l] ]; -_projectile setVelocity (_v vectorMultiply (vectorMagnitude (velocity _projectile))); +_projectile setVectorDirAndUp [_dir, _up]; diff --git a/addons/missileguidance/functions/fnc_checkLos.sqf b/addons/missileguidance/functions/fnc_checkLos.sqf index 1fadc5510e..242b595ab8 100644 --- a/addons/missileguidance/functions/fnc_checkLos.sqf +++ b/addons/missileguidance/functions/fnc_checkLos.sqf @@ -25,7 +25,7 @@ if (_checkVisibilityTest) exitWith { _visibility > 0.001 }; if ((isNil "_seeker") || {isNil "_target"}) exitWith { - ERROR_2("nil",_seeker,_target); + ERROR_2("nil [%1]->[%2]",_seeker,_target); false }; @@ -43,4 +43,3 @@ if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_s }; _return - diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index 2263716724..f8494e474c 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -76,7 +76,7 @@ private _nextFireMode = _attackProfiles select _index; TRACE_4("",_currentFireMode,_nextFireMode,_index,_attackProfiles); -private _currentFireMode = if (_useModeForAttackProfile) then { +if (_useModeForAttackProfile) then { TRACE_2("setting fire mode",_weaponStateToken,_nextFireMode); { _x params ["_xIndex", "", "_xWeapon", "", "_xMode"]; diff --git a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf new file mode 100644 index 0000000000..5073709a27 --- /dev/null +++ b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf @@ -0,0 +1,61 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * tracks a projectile until it explodes + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +params ["_projectile"]; + +private _camera = "camera" camCreate getPosATL _projectile; +_camera camPrepareFOV 0.7; +_camera cameraEffect ["internal", "back"]; + +_camera camCommitPrepared 0; + +GVAR(debug_camera_close) = false; +private _displayEH = (findDisplay 46) displayAddEventHandler ["KeyDown", { + params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"]; + GVAR(debug_camera_close) = (_key == 1); + true +}]; + +[{ + params ["_args", "_pfh"]; + _args params ["_projectile", "_camera", "_projectilePos", "_displayEH"]; + if (!alive _projectile || GVAR(debug_camera_close)) exitWith { + private _delay = 1.5; + if (GVAR(debug_camera_close)) then { + _delay = 0; + }; + + (findDisplay 46) displayRemoveEventHandler ["KeyDown", _displayEH]; + + [{ + params ["_camera"]; + + _camera cameraEffect ["terminate", "back"]; + _camera camCommitPrepared 0; + camDestroy _camera; + }, [_camera], _delay] call CBA_fnc_waitAndExecute; + + _camera camPrepareTarget _projectilePos; + _camera camCommitPrepared 0; + + [_pfh] call CBA_fnc_removePerFrameHandler; + }; + + private _currentProjectilePos = getPosATLVisual _projectile; + + _camera camPrepareTarget _projectile; + _camera camPrepareRelPos [0, -5, 1]; + _camera camCommitPrepared 0; + + _args set [2, getPosATL _projectile]; +}, 0, [_projectile, _camera, getPosATL _projectile, _displayEH]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index cafbadf69c..3c74ab87c6 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -22,18 +22,17 @@ _args params ["", "_launchParams"]; _launchParams params ["", "", "", "_attackProfileName"]; private _attackProfileFunction = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfileName >> "functionName"); - private _attackProfilePos = _this call (missionNamespace getVariable _attackProfileFunction); if ((isNil "_attackProfilePos") || {_attackProfilePos isEqualTo [0,0,0]}) exitWith { - ERROR_1("attack profile returned bad pos",_attackProfilePos); + ERROR_2("attack profile [%1] returned bad pos %2",_attackProfileName,_attackProfilePos); [0,0,0] }; -#ifdef DRAW_GUIDANCE_INFO -drawLine3D [(ASLtoAGL _attackProfilePos), (ASLtoAGL _seekerTargetPos), [0,1,1,1]]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLtoAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; -#endif +if (GVAR(debug_drawGuidanceInfo)) then { + drawLine3D [(ASLtoAGL _attackProfilePos), (ASLtoAGL _seekerTargetPos), [0,1,1,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLtoAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; +}; TRACE_2("return",_attackProfilePos,_attackProfileName); _attackProfilePos; diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index 6008725b4c..b6fd158ce0 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -30,9 +30,9 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / if (_seekLastTargetPos && {_lastKnownPos isNotEqualTo [0,0,0]}) then { // if enabled for the ammo, use last known position if we have one stored TRACE_2("seeker returned bad pos - using last known",_seekLastTargetPos,_lastKnownPos); _seekerTargetPos = _lastKnownPos; - #ifdef DRAW_GUIDANCE_INFO - drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLtoAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; - #endif + if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLtoAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; + }; } else { TRACE_1("seeker returned no pos",_seekerTargetPos); _seekerTargetPos = [0,0,0]; @@ -44,9 +44,9 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / }; }; -#ifdef DRAW_GUIDANCE_INFO -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; -#endif +if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; +}; TRACE_2("return",_seekerTargetPos,_seekerTypeName); _seekerTargetPos; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 0620e9e3c0..28f677bbdd 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -15,100 +15,192 @@ * * Public: No */ +#define TRAIL_COLOUR(multiplier) [1 * multiplier, 1 * multiplier, 0.3 * multiplier, 0.7 * multiplier] BEGIN_COUNTER(guidancePFH); -#define TIMESTEP_FACTOR 0.01 - params ["_args", "_pfID"]; -_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateParams"]; _firedEH params ["_shooter","","","","_ammo","","_projectile"]; -_launchParams params ["","_targetLaunchParams"]; -_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +_launchParams params ["","_targetLaunchParams","","","","","_navigationType"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParameters", "_guidanceParameters"]; +_navigationStateParams params ["_currentState", "_navigationStateData"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance", "_stabilityCoefficient", "_showTrail"]; if (!alive _projectile || isNull _projectile || isNull _shooter) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; END_COUNTER(guidancePFH); }; -private _runtimeDelta = diag_tickTime - _lastRunTime; -private _adjustTime = 1; - -if (accTime > 0) then { - _adjustTime = 1/accTime; - _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); - TRACE_4("Adjust timing",1/accTime,_adjustTime,_runtimeDelta,(_runtimeDelta / TIMESTEP_FACTOR)); -} else { - _adjustTime = 0; +if (_showTrail) then { + drop ["\a3\data_f\kouleSvetlo", "", "Billboard", 100, 0.03, _projectile modelToWorld [0, 0, 0], + [0, 0, 0], 0, 1.25, 1, 0.05, [0.5], [TRAIL_COLOUR(1)], [0], 0, 0, "", "", "", 0, false, -1, [TRAIL_COLOUR(10000)]]; }; -private _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; -private _maxDeflection = (_flightParams select 1) * _adjustTime; -// private _incDeflection = _flightParams select 2; // todo - -private _projectilePos = getPosASL _projectile; +private _timestep = diag_deltaTime * accTime; // Run seeker function: -private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState] call FUNC(doSeekerSearch); - +private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState, _timestep] call FUNC(doSeekerSearch); // Run attack profile function: -private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile); +_seekerTargetPos = AGLtoASL ASLToAGL _seekerTargetPos; +private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams, _timestep] call FUNC(doAttackProfile); + +private _projectilePos = getPosASLVisual _projectile; +_targetData set [1, _projectilePos vectorFromTo _profileAdjustedTargetPos]; // If we have no seeker target, then do not change anything // If there is no deflection on the missile, this cannot change and therefore is redundant. Avoid calculations for missiles without any deflection -if ((_minDeflection != 0 || {_maxDeflection != 0}) && {_profileAdjustedTargetPos isNotEqualTo [0,0,0]}) then { - - private _targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; - private _adjustVector = _targetVector vectorDiff (vectorDir _projectile); - _adjustVector params ["_adjustVectorX", "_adjustVectorY", "_adjustVectorZ"]; - - private _yaw = 0; - private _pitch = 0; - private _roll = 0; - - if (_adjustVectorX < 0) then { - _yaw = - ( (_minDeflection max ((abs _adjustVectorX) min _maxDeflection) ) ); - } else { - if (_adjustVectorX > 0) then { - _yaw = ( (_minDeflection max (_adjustVectorX min _maxDeflection) ) ); +if ((_pitchRate != 0 || {_yawRate != 0})) then { + private _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName"); + if (_navigationStateData isNotEqualTo []) then { + (_navigationStateData select _currentState) params ["_transitionCondition"]; + private _transition = (_args call (missionNamespace getVariable [_transitionCondition, { false }])); + if (_transition) then { + _currentState = _currentState + 1; + _navigationStateParams set [0, _currentState]; }; - }; - if (_adjustVectorY < 0) then { - _roll = - ( (_minDeflection max ((abs _adjustVectorY) min _maxDeflection) ) ); - } else { - if (_adjustVectorY > 0) then { - _roll = ( (_minDeflection max (_adjustVectorY min _maxDeflection) ) ); - }; - }; - if (_adjustVectorZ < 0) then { - _pitch = - ( (_minDeflection max ((abs _adjustVectorZ) min _maxDeflection) ) ); - } else { - if (_adjustVectorZ > 0) then { - _pitch = ( (_minDeflection max (_adjustVectorZ min _maxDeflection) ) ); - }; - }; - private _finalAdjustVector = [_yaw, _roll, _pitch]; - TRACE_3("",_pitch,_yaw,_roll); - TRACE_3("",_targetVector,_adjustVector,_finalAdjustVector); + _navigationType = (_navigationStateData select _currentState) select 1; + _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName"); - if (accTime > 0) then { - private _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; - TRACE_2("",_projectile,_changeVector); - [_projectile, _changeVector] call FUNC(changeMissileDirection); + _navigationParameters = (_navigationStateData select _currentState) select 2; + _stateParams set [4, _navigationParameters]; }; + private _commandedAcceleration = [_args, _timestep, _seekerTargetPos, _profileAdjustedTargetPos, _targetData, _navigationParameters] call (missionNamespace getVariable _navigationFunction); + + if (isNil "_commandedAcceleration") exitWith { + systemChat format ["Error in %1 Missile Type %2 Seeker Pos %3", _navigationFunction, typeOf _projectile, _seekerTargetPos]; + ERROR_MSG_3("_commandedAcceleration is nil! Guidance cancelled [%1 %2 %3]",_navigationFunction,typeOf _projectile,_seekerTargetPos); + }; + + if (GVAR(debug_drawGuidanceInfo)) then { + private _projectilePosAGL = ASLToAGL _projectilePos; + private _cmdAccelLocal = _projectile vectorWorldToModelVisual _commandedAcceleration; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _projectilePosAGL vectorAdd [0, 0, 1], 0.75, 0.75, 0, format ["cmdPitch: %1 cmdYaw %2", _cmdAccelLocal#2, _cmdAccelLocal#0], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], _projectilePosAGL vectorAdd [0, 0, 2], 0.75, 0.75, 0, _navigationType, 1, 0.025, "TahomaB"]; + drawLine3D [_projectilePosAGL, _projectilePosAGL vectorAdd _commandedAcceleration, [1, 0, 1, 1]]; + }; + + // activate missile servos and change direction + if (!isGamePaused && accTime > 0) then { + _guidanceParameters params ["_yaw", "_roll", "_pitch"]; + + _commandedAcceleration = _projectile vectorWorldToModelVisual _commandedAcceleration; + _commandedAcceleration params ["_yawChange", "", "_pitchChange"]; + + if (isNil "_yawChange") then { + _yawChange = 0; + }; + if (isNil "_pitchChange") then { + _pitchChange = 0; + }; + + private _clampedPitch = (_pitchChange min _pitchRate) max -_pitchRate; + private _clampedYaw = (_yawChange min _yawRate) max -_yawRate; + + // controls are either on or off, no proportional + if (_isBangBangGuidance) then { + private _pitchSign = if (_clampedPitch == 0) then { + 0 + } else { + _clampedPitch / abs _clampedPitch + }; + private _yawSign = if (_clampedYaw == 0) then { + 0 + } else { + _clampedYaw / abs _clampedYaw + }; + _clampedPitch = _pitchSign * _pitchRate; + _clampedYaw = _yawSign * _yawRate; + }; + + TRACE_9("pitch/yaw/roll",_pitch,_yaw,_roll,_yawChange,_pitchChange,_pitchRate,_yawRate,_clampedPitch,_clampedYaw); + // directional stability + private _localVelocity = _projectile vectorWorldToModelVisual (velocity _projectile); + + private _velocityAngleYaw = (_localVelocity#0) atan2 (_localVelocity#1); + private _velocityAnglePitch = (_localVelocity#2) atan2 (_localVelocity#1); + + // bastardized version of direction stability https://en.wikipedia.org/wiki/Directional_stability#Steering_forces + private _forceYaw = _stabilityCoefficient * _velocityAngleYaw + _clampedYaw; + private _forcePitch = _stabilityCoefficient * _velocityAnglePitch + _clampedPitch; + + _pitch = _pitch + _forcePitch * _timestep; + _yaw = _yaw + _forceYaw * _timestep; + + TRACE_3("new pitch/yaw/roll",_pitch,_yaw,_roll); + + private _multiplyQuat = { + params ["_qLHS", "_qRHS"]; + _qLHS params ["_lhsX", "_lhsY", "_lhsZ", "_lhsW"]; + _qRHS params ["_rhsX", "_rhsY", "_rhsZ", "_rhsW"]; + + private _lhsImaginary = [_lhsX, _lhsY, _lhsZ]; + private _rhsImaginary = [_rhsX, _rhsY, _rhsZ]; + + private _scalar = _lhsW * _rhsW - (_lhsImaginary vectorDotProduct _rhsImaginary); + private _imginary = (_rhsImaginary vectorMultiply _lhsW) vectorAdd (_lhsImaginary vectorMultiply _rhsW) vectorAdd (_lhsImaginary vectorCrossProduct _rhsImaginary); + + _imginary + [_scalar] + }; + + private _multiplyVector = { + params ["_quaternion", "_vector"]; + + private _real = _quaternion#3; + private _imaginary = [ + _quaternion#0, + _quaternion#1, + _quaternion#2 + ]; + + private _vectorReturn = _vector vectorAdd (( + _imaginary vectorCrossProduct ( + (_imaginary vectorCrossProduct _vector) vectorAdd ( + _vector vectorMultiply _real + ) + ) + ) vectorMultiply 2); + + _vectorReturn + }; + + private _quaternion = [0, 0, 0, 1]; + + private _temp = [0, 0, sin (-_yaw / 2), cos (-_yaw / 2)]; + _quaternion = [_quaternion, _temp] call _multiplyQuat; + + _temp = [sin (_pitch / 2), 0, 0, cos (_pitch / 2)]; + _quaternion = [_quaternion, _temp] call _multiplyQuat; + + private _dir = [_quaternion, [0, 1, 0]] call _multiplyVector; + private _up = [_quaternion, [0, 0, 1]] call _multiplyVector; + + _projectile setVectorDirAndUp [_dir, _up]; + + _guidanceParameters set [0, _yaw]; + _guidanceParameters set [2, _pitch]; + + _stateParams set [5, _guidanceParameters]; + }; + + _stateParams set [4, _navigationParameters]; + _args set [4, _stateParams]; }; -#ifdef DRAW_GUIDANCE_INFO -TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; +if (GVAR(debug_drawGuidanceInfo)) then { + TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; -private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); -_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; -_PS setDropInterval 3.0; -#endif + if (!isGamePaused && accTime > 0) then { + private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); + _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; + _PS setDropInterval 1.0; + }; + + drawLine3D [ASLtoAGL _projectilePos, (ASLtoAGL _projectilePos) vectorAdd velocity _projectile, [1, 1, 1, 1]]; +}; _stateParams set [0, diag_tickTime]; END_COUNTER(guidancePFH); - diff --git a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf new file mode 100644 index 0000000000..ad0eca65cb --- /dev/null +++ b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf @@ -0,0 +1,33 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Condition to switch to next navigation profile + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_javelin_midCourseTransition + * + * Public: No + */ +#define STAGE_LAUNCH 1 +#define STAGE_CLIMB 2 +#define STAGE_COAST 3 +#define STAGE_TERMINAL 4 + +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +_attackProfileStateParams params ["_state"]; +_state isEqualTo STAGE_TERMINAL + diff --git a/addons/missileguidance/functions/fnc_line_onFired.sqf b/addons/missileguidance/functions/fnc_line_onFired.sqf new file mode 100644 index 0000000000..6093dc2738 --- /dev/null +++ b/addons/missileguidance/functions/fnc_line_onFired.sqf @@ -0,0 +1,35 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets up line state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_line_onFired + * + * Public: No + */ +params ["_firedEH", "", "", "", "_stateParams"]; +_firedEH params ["","","","","","","_projectile"]; + +private _ammoConfig = configOf _projectile; +private _p = getNumber (_ammoConfig >> QUOTE(ADDON) >> "lineGainP"); +private _d = getNumber (_ammoConfig >> QUOTE(ADDON) >> "lineGainD"); +private _correctionDistance = getNumber (_ammoConfig >> QUOTE(ADDON) >> "correctionDistance"); + +if (_correctionDistance == 0) then { + _correctionDistance = 1; +}; + +private _navigationParams = [ + _p, 0, _d, + 0, + 0, + _correctionDistance +]; +_navigationParams diff --git a/addons/missileguidance/functions/fnc_ahr_onFired.sqf b/addons/missileguidance/functions/fnc_mwr_onFired.sqf similarity index 92% rename from addons/missileguidance/functions/fnc_ahr_onFired.sqf rename to addons/missileguidance/functions/fnc_mwr_onFired.sqf index 0618c046ad..845b81cda6 100644 --- a/addons/missileguidance/functions/fnc_ahr_onFired.sqf +++ b/addons/missileguidance/functions/fnc_mwr_onFired.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_missileguidance_fnc_ahr_onFired + * [] call ace_missileguidance_fnc_mwr_onFired * * Public: No */ @@ -38,6 +38,8 @@ private _activeRadarDistance = [_config >> "activeRadarEngageDistance", "NUMBER" private _projectileThrust = [_projectileConfig >> "thrust", "NUMBER", 0] call CBA_fnc_getConfigEntry; private _projectileThrustTime = [_projectileConfig >> "thrustTime", "NUMBER", 0] call CBA_fnc_getConfigEntry; +private _lockTypes = [_config >> "lockableTypes", "ARRAY", ["Air", "LandVehicle", "Ship"]] call CBA_fnc_getConfigEntry; + private _velocityAtImpact = _projectileThrust * _projectileThrustTime; private _timeToActive = 0; if (!isNil "_target" && _velocityAtImpact > 0) then { @@ -70,4 +72,4 @@ _seekerStateParams set [6, false]; _seekerStateParams set [7, [0, 0, 0]]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, isNull _target]; - +_seekerStateParams set [10, _lockTypes]; diff --git a/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf b/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf new file mode 100644 index 0000000000..f8f1e6c0f4 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf @@ -0,0 +1,50 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to proportional navigation, takes target acceleration into account + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_augmentedProNav + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_lastMissileFrame", "_navigationGain"]; +_lastMissileFrame params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", "_targetAcceleration"]; + +// Proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; + +private _targetAccelerationProjected = _attackProfileDirection vectorMultiply (_targetAcceleration vectorDotProduct _attackProfileDirection); +_targetAcceleration = _targetAcceleration vectorDiff _targetAccelerationProjected; + +private _losDelta = (vectorNormalized _attackProfileDirection) vectorDiff (vectorNormalized _lastLineOfSight); +private _losRate = if (_timestep == 0) then { + 0 +} else { + 1 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _lateralAcceleration = _navigationGain * _losRate; +private _commandedAcceleration = _closingVelocity vectorMultiply _lateralAcceleration; +_commandedAcceleration = _commandedAcceleration vectorAdd (_losDelta vectorMultiply (0.5 * _navigationGain * vectorMagnitude _targetAcceleration)); + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_seekerTargetPos, _targetVelocity, _attackProfileDirection]]; +}; + +_commandedAcceleration vectorMultiply _timestep diff --git a/addons/missileguidance/functions/fnc_navigationType_direct.sqf b/addons/missileguidance/functions/fnc_navigationType_direct.sqf new file mode 100644 index 0000000000..7b4763b44e --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_direct.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Points directly toward attack profile positon + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_direct + * + * Public: No + */ +params ["_args", "", "", "_profileAdjustedTargetPos"]; +_args params ["_firedEH"]; +_firedEH params ["","","","","","","_projectile"]; + +_profileAdjustedTargetPos vectorDiff getPosASLVisual _projectile diff --git a/addons/missileguidance/functions/fnc_navigationType_line.sqf b/addons/missileguidance/functions/fnc_navigationType_line.sqf new file mode 100644 index 0000000000..c9a3870c58 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_line.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Assumes targetDir is pointing toward line we want to stay on + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_line + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos", "_targetData", "_navigationParams"]; +_args params ["", "", "_flightParams"]; +_targetData params ["", "_targetDir", "_distance"]; +_flightParams params ["_pitchRate", "_yawRate"]; + +_navigationParams params ["_proportionalGain", "", "_derivativeGain", "_lastErrorX", "_lastErrorY", "_correctionDistance"]; +private _relativeTargetDirection = [0, (velocityModelSpace _projectile) select 1, 0] vectorAdd (_projectile vectorWorldToModelVisual (_targetDir vectorMultiply _distance)); + +private _angleX = ((_relativeTargetDirection select 0) atan2 (_relativeTargetDirection select 1)); +private _angleY = ((_relativeTargetDirection select 2) atan2 (_relativeTargetDirection select 1)); + +private _pX = _proportionalGain * _angleX; +private _dX = 0; +if (_timestep > 0) then { + _dX = _derivativeGain * (_angleX - _lastErrorX) / _timestep; +}; + +private _pY = _proportionalGain * _angleY; +private _dY = 0; +if (_timestep > 0) then { + _dY = _derivativeGain * (_angleY - _lastErrorY) / _timestep; +}; + +private _accelerationX = _pX + _dX; +private _accelerationY = _pY + _dY; + +private _commandedAcceleration = [ + _accelerationX, + 0, + _accelerationY +]; + +_navigationParams set [3, _angleX]; +_navigationParams set [4, _angleY]; + +_projectile vectorModelToWorldVisual _commandedAcceleration; diff --git a/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf new file mode 100644 index 0000000000..5056d83722 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Accelerates toward LOS + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_lineOfSight + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_onLaunch"]; +_onLaunch params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", ""]; + +// Semi-proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel + +// the los rate is tiny, so we multiply by a constant of a power of ten to get more aggressive acceleration +// this is just due to how we measure our LOS delta, the vectors involved are _tiny_ +private _losDelta = _attackProfileDirection vectorDiff _lastLineOfSight; +private _losRate = if (_timestep == 0) then { + 0 +} else { + 10 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _closingVelocity = _targetVelocity vectorDiff (velocity _projectile); + +private _commandedAcceleration = _closingVelocity vectorMultiply _losRate; + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_attackProfileDirection]]; +}; + +_targetDirection diff --git a/addons/missileguidance/functions/fnc_navigationType_proNav.sqf b/addons/missileguidance/functions/fnc_navigationType_proNav.sqf new file mode 100644 index 0000000000..45052689b0 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_proNav.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to proportional navigation + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_proNav + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_lastMissileFrame", "_navigationGain"]; +_lastMissileFrame params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", ""]; + +// Proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; + +private _losDelta = (vectorNormalized _attackProfileDirection) vectorDiff (vectorNormalized _lastLineOfSight); +private _losRate = if (_timestep == 0) then { + 0 +} else { + 1 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _lateralAcceleration = _navigationGain * _losRate; +private _commandedAcceleration = _closingVelocity vectorMultiply _lateralAcceleration; + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_seekerTargetPos, _targetVelocity, _attackProfileDirection]]; +}; + +_commandedAcceleration vectorMultiply _timestep diff --git a/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf new file mode 100644 index 0000000000..293bede8bf --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf @@ -0,0 +1,38 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to zero-effort miss pro-nav, takes target acceleration into account. Super deadly + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_zeroEffortMiss + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["", "_navigationGain"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +private _vectorToTarget = _attackProfileDirection vectorMultiply _targetRange; +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; +private _timeToGo = _targetRange / vectorMagnitude _closingVelocity; + +if (_timeToGo == 0) then { + _timeToGo = 0.001; +}; + +private _zeroEffortMiss = _vectorToTarget vectorAdd (_closingVelocity vectorMultiply _timeToGo); +private _zeroEffortMissProjectiled = _attackProfileDirection vectorMultiply (_zeroEffortMiss vectorDotProduct _attackProfileDirection); +private _zeroEffortMissNormal = _zeroEffortMiss vectorDiff _zeroEffortMissProjectiled; + +private _commandedAcceleration = _zeroEffortMissNormal vectorMultiply (_navigationGain / (_timeToGo * _timeToGo)); + +_commandedAcceleration diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 1d63d120a9..9cc91f300a 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -19,9 +19,6 @@ params ["_shooter","_weapon","","_mode","_ammo","","_projectile"]; -// Bail on not missile -if !(_ammo isKindOf "MissileBase") exitWith {}; - // Bail if guidance is disabled for this ammo if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {}; @@ -44,6 +41,7 @@ private _target = _shooter getVariable [QGVAR(target), nil]; private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; +private _navigationType = _shooter getVariable [QGVAR(navigationType), nil]; if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) then { _attackProfile = getText (configFile >> "CfgWeapons" >> _weapon >> _mode >> QGVAR(attackProfile)) }; @@ -52,7 +50,7 @@ private _lockMode = _shooter getVariable [QGVAR(lockMode), nil]; private _laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; private _laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH]; -TRACE_6("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode); +TRACE_7("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode,_navigationType); private _launchPos = getPosASL (vehicle _shooter); @@ -65,6 +63,14 @@ if (isNil "_attackProfile" || {!(_attackProfile in (getArray (_config >> "attack if (isNil "_lockMode" || {!(_lockMode in (getArray (_config >> "seekerLockModes")))}) then { _lockMode = getText (_config >> "defaultSeekerLockMode"); }; +if (isNil "_navigationType" || {!(_navigationType in (getArray (_config >> "navigationTypes")))}) then { + _navigationType = getText (_config >> "defaultNavigationType"); +}; + +if (isNil "_navigationType" || _navigationType isEqualTo "") then { + // most missiles use ProNav by default + _navigationType = "ProportionalNavigation"; +}; // If we didn't get a target, try to fall back on tab locking if (isNil "_target") then { @@ -76,7 +82,7 @@ if (isNil "_target") then { private _canUseLock = getNumber (_config >> "canVanillaLock"); // @TODO: Get vanilla target if (_canUseLock > 0 || difficulty < 1) then { - private _vanillaTarget = cursorTarget; + private _vanillaTarget = missileTarget _projectile; TRACE_1("Using Vanilla Locking",_vanillaTarget); if (!isNil "_vanillaTarget") then { @@ -85,6 +91,7 @@ if (isNil "_target") then { }; }; }; +_targetPos = getPosASLVisual _target; // Array for seek last target position private _seekLastTargetPos = (getNumber ( _config >> "seekLastTargetPos")) == 1; @@ -95,19 +102,66 @@ if (_seekLastTargetPos && {!isNil "_target"}) then { _lastKnownPosState set [1, [0,0,0]]; }; -TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); +private _navigationParameters = [ + // set up in navigation type onFired function +]; + +// default config values to make sure there is backwards compat +private _pitchRate = 30; +private _yawRate = 30; +private _bangBang = false; +if (isNumber (_config >> "pitchRate")) then { + _pitchRate = getNumber ( _config >> "pitchRate" ); + _yawRate = getNumber ( _config >> "yawRate" ); + _bangBang = (1 == getNumber (_config >> "bangBangGuidance")); +}; + +// How much this projectile likes to stay toward current velocity +private _stabilityCoefficient = getNumber (_config >> "stabilityCoefficient"); + +// show a light trail in flight +private _showTrail = (1 == getNumber (_config >> "showTrail")); + +private _navigationStateSubclass = _config >> "navigationStates"; +private _states = getArray (_navigationStateSubclass >> "states"); + +private _navigationStateData = []; +private _initialState = ""; + +if (_states isNotEqualTo []) then { + _initialState = _states select 0; + { + private _stateClass = _navigationStateSubclass >> _x; + _navigationStateData pushBack [ + getText (_stateClass >> "transitionCondition"), + getText (_stateClass >> "navigationType"), + [] + ]; + } forEach _states; +}; + +private _initialRoll = getNumber (_config >> "initialRoll"); +private _initialYaw = getNumber (_config >> "initialYaw"); +private _initialPitch = getNumber (_config >> "initialPitch"); + +private _yawRollPitch = (vectorDir _projectile) call CBA_fnc_vect2Polar; + +TRACE_5("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile,_navigationType); private _args = [_this, [ _shooter, - [_target, _targetPos, _launchPos], + [_target, _targetPos, _launchPos, vectorDirVisual vehicle _shooter, CBA_missionTime], _seekerType, _attackProfile, _lockMode, - _laserInfo + _laserInfo, + _navigationType ], [ - getNumber ( _config >> "minDeflection" ), - getNumber ( _config >> "maxDeflection" ), - getNumber ( _config >> "incDeflection" ) + _pitchRate, + _yawRate, + _bangBang, + _stabilityCoefficient, + _showTrail ], [ getNumber ( _config >> "seekerAngle" ), @@ -115,37 +169,70 @@ private _args = [_this, getNumber ( _config >> "seekerMaxRange" ), getNumber ( _config >> "seekerMinRange" ) ], - [ diag_tickTime, [], [], _lastKnownPosState] + [ diag_tickTime, [], [], _lastKnownPosState, _navigationParameters, [_initialYaw + (_yawRollPitch select 1), _initialRoll, _initialPitch + (_yawRollPitch select 2)]], + [ + // target data from missile. Must be filled by seeker for navigation to work + [0, 0, 0], // direction to target + [0, 0, 0], // direction to attack profile + 0, // range to target + [0, 0, 0], // target velocity + [0, 0, 0] // target acceleration + ], + [0, _navigationStateData] ]; private _onFiredFunc = getText (configFile >> QGVAR(SeekerTypes) >> _seekerType >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("seeker on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; _onFiredFunc = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfile >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("attack on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; +if (_states isEqualTo []) then { + _onFiredFunc = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "onFired"); + TRACE_1("navigation on fired",_onFiredFunc); + if (_onFiredFunc != "") then { + private _navState = (_args call (missionNamespace getVariable _onFiredFunc)); + (_args select 4) set [4, _navState]; + }; +} else { + { + _onFiredFunc = getText (configFile >> QGVAR(NavigationTypes) >> _x >> "onFired"); + TRACE_1("navigation on fired",_onFiredFunc); + if (_onFiredFunc != "") then { + private _navState = (_args call (missionNamespace getVariable _onFiredFunc)); + (_navigationStateData select _forEachIndex) set [2, _navState]; + }; + } forEach getArray (_config >> "navigationTypes"); +}; + // Run the "onFired" function passing the full guidance args array _onFiredFunc = getText (_config >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("general on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; // Reverse: -// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; // _firedEH params ["_shooter","","","","_ammo","","_projectile"]; -// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo"]; -// _targetLaunchParams params ["_target", "_targetPos", "_launchPos"]; -// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +// _targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +// _flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParams", "_guidanceParameters"]; // _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +// _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; -[LINKFUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(guidancePFH),0, _args ] call CBA_fnc_addPerFrameHandler; + +if (GVAR(debug_enableMissileCamera)) then { + [_projectile] call FUNC(dev_ProjectileCamera); +}; /* Clears locking settings diff --git a/addons/missileguidance/functions/fnc_proNav_onFired.sqf b/addons/missileguidance/functions/fnc_proNav_onFired.sqf new file mode 100644 index 0000000000..c297d3ce59 --- /dev/null +++ b/addons/missileguidance/functions/fnc_proNav_onFired.sqf @@ -0,0 +1,36 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets up proportional navigation state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_proNav_onFired + * + * Public: No + */ +params ["_firedEH", "", "", "", "_stateParams"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; + +private _ammoConfig = configOf _projectile; +private _navigationGain = getNumber (_ammoConfig >> QUOTE(ADDON) >> "navigationGain"); +if (_navigationGain == 0) then { + _navigationGain = 3; +}; + +private _navigationParams = [ + [ // Last Missile Frame + [0, 0, 0] // Last line of sight + ], + _navigationGain // navigation gain of missile. Set in the navigation onFired function +]; +_navigationParams diff --git a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf similarity index 82% rename from addons/missileguidance/functions/fnc_seekerType_ARH.sqf rename to addons/missileguidance/functions/fnc_seekerType_MWR.sqf index 54e487a9a0..df51acdd8c 100644 --- a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf @@ -11,16 +11,16 @@ * Seeker Pos * * Example: - * [] call call ace_missileguidance_fnc_seekerType_ARH; + * [] call call ace_missileguidance_fnc_seekerType_MWR; * * Public: No */ -params ["", "_args", "_seekerStateParams"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +params ["", "_args", "_seekerStateParams", "", "_timestep"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; _launchParams params ["_target","","","",""]; _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; -_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget"]; +_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget", "_lockTypes"]; if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { if !(_isActive) then { @@ -60,8 +60,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _seekerBaseRadiusAdjusted = _seekerBaseRadiusAtGround; }; // Look in front of seeker for any targets - private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, ["Air", "LandVehicle", "Ship"], _seekerBaseRadiusAdjusted, false]; - + private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, _lockTypes, _seekerBaseRadiusAdjusted, false]; _nearestObjects = _nearestObjects apply { // I check both Line of Sight versions to make sure that a single bush doesnt make the target lock dissapear but at the same time ensure that this can see through smoke. Should work 80% of the time if ([_projectile, getPosASL _x, _seekerAngle] call FUNC(checkSeekerAngle) && { ([_projectile, _x, true] call FUNC(checkLOS)) || { ([_projectile, _x, false] call FUNC(checkLOS)) } }) then { @@ -74,6 +73,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { // Select closest object to the expected position to be the current radar target if (_nearestObjects isEqualTo []) exitWith { _projectile setMissileTarget objNull; + _seekerStateParams set [3, _searchPos]; _searchPos }; private _closestDistance = _seekerBaseRadiusAtGround; @@ -89,9 +89,9 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _projectile setMissileTarget _target; } else { - #ifdef DRAW_GUIDANCE_INFO - _seekerTypeName = "AHR - EXT"; - #endif + if (GVAR(debug_drawGuidanceInfo)) then { + _seekerTypeName = "MWR - EXT"; + }; // External radar homing // if the target is in the remote targets for the side, whoever the donor is will "datalink" the target for the hellfire. private _remoteTargets = listRemoteTargets side _shooter; @@ -104,16 +104,30 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { }; }; +if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _expectedTargetPos, 0.75, 0.75, 0, "expected target pos", 1, 0.025, "TahomaB"]; +}; + if !(isNull _target) then { private _centerOfObject = getCenterOfMass _target; - private _targetAdjustedPos = _target modelToWorldWorld _centerOfObject; + private _targetAdjustedPos = _target modelToWorldVisualWorld _centerOfObject; _expectedTargetPos = _targetAdjustedPos; - _seekerStateParams set [3, _expectedTargetPos]; _seekerStateParams set [7, velocity _target]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, false]; + + _targetData set [2, _projectile distance _target]; + _targetData set [3, velocity _target]; + + if (_timestep != 0) then { + private _acceleration = ((velocity _target) vectorDiff _lastKnownVelocity) vectorMultiply (1 / _timestep); + _targetData set [4, _acceleration]; + }; }; +_targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos]; + +_seekerStateParams set [3, _expectedTargetPos]; _launchParams set [0, _target]; _expectedTargetPos diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index bac01d05b4..0507bc2c11 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -17,7 +17,7 @@ */ params ["", "_args"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["", "_targetParams"]; _targetParams params ["_target"]; @@ -25,7 +25,7 @@ _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; if (isNil "_target") exitWith {[0,0,0]}; -private _foundTargetPos = aimPos _target; +private _foundTargetPos = _target modelToWorldVisualWorld getCenterOfMass _target; // @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual private _angleOkay = [_projectile, _foundTargetPos, _seekerAngle] call FUNC(checkSeekerAngle); @@ -40,14 +40,11 @@ TRACE_2("",_angleOkay,_losOkay); if (!_angleOkay || !_losOkay) exitWith {[0,0,0]}; TRACE_2("",_target,_foundTargetPos); -// @TODO: Configurable lead for seekers -private _projectileSpeed = (vectorMagnitude velocity _projectile); private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; -private _eta = _distanceToTarget / _projectileSpeed; -private _adjustDistance = (velocity _target) vectorMultiply _eta; -TRACE_3("leading target",_distanceToTarget,_eta,_adjustDistance); -_foundTargetPos = _foundTargetPos vectorAdd _adjustDistance; +_targetData set [0, (getPosASL _projectile) vectorFromTo _foundTargetPos]; +_targetData set [2, _distanceToTarget]; +_targetData set [3, velocity _target]; TRACE_2("return",_foundTargetPos,(aimPos _target) distance _foundTargetPos); _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf index da9549c3ae..1641ff4a7d 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf @@ -16,13 +16,13 @@ * Public: No */ params ["", "_args"]; -_args params ["_firedEH", "", "", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["_shooter","_weapon","","","","","_projectile"]; _seekerParams params ["_seekerAngle"]; _stateParams params ["", "_seekerStateParams"]; _seekerStateParams params ["_memoryPointGunnerOptics", "_animationSourceBody", "_animationSourceGun", "_usePilotCamera"]; -private _shooterPos = AGLToASL (_shooter modelToWorld(_shooter selectionPosition _memoryPointGunnerOptics)); +private _shooterPos = AGLToASL (_shooter modelToWorldVisual (_shooter selectionPosition _memoryPointGunnerOptics)); private _projPos = getPosASL _projectile; private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindOf "StaticWeapon"}) then { @@ -37,8 +37,9 @@ private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindO _shooter vectorModelToWorldVisual getPilotCameraDirection _shooter; }; } else { - private _gBody = -deg(_shooter animationPhase _animationSourceBody); - private _gGun = deg(_shooter animationPhase _animationSourceGun); + // use animationSourcePhase + private _gBody = -deg(_shooter animationSourcePhase _animationSourceBody); + private _gGun = deg(_shooter animationSourcePhase _animationSourceGun); _shooter vectorModelToWorldVisual ([1, _gBody, _gGun] call CBA_fnc_polar2vect); }; _finalLookDirection @@ -58,5 +59,9 @@ if ((_testDotProduct < (cos _seekerAngle)) || {_testIntersections isNotEqualTo [ [0, 0, 0] }; -_shooterPos vectorAdd (_lookDirection vectorMultiply _distanceToProj); +private _returnPos = _shooterPos vectorAdd (_lookDirection vectorMultiply _distanceToProj); +_targetData set [0, _projPos vectorFromTo _returnPos]; +_targetData set [2, _returnPos vectorDistance getPosASLVisual _projectile]; + +_returnPos diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index a16c58ce5f..8772d73178 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -16,17 +16,58 @@ * * Public: No */ +#define MAX_AVERAGES 15 +#define MINIMUM_DISTANCE_UNTIL_NEW_POS 1 -params ["", "_args"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams"]; +params ["", "_args", "", "", "_timestep"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "", "_targetData"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["","","","","","_laserParams"]; -_seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; +_seekerParams params ["_seekerAngle", "", "_seekerMaxRange", "", ["_lastPositions", []], ["_lastPositionIndex", 0], ["_lastPositionSum", [0, 0, 0]]]; _laserParams params ["_code", "_wavelengthMin", "_wavelengthMax"]; - private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, _seekerMaxRange, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); private _foundTargetPos = _laserResult select 0; TRACE_1("Search",_laserResult); -_foundTargetPos; +if (isNil "_foundTargetPos") exitWith { + [0, 0, 0] +}; + +// average out any error from laser jump +private _positionSum = [0, 0, 0]; +{ + _positionSum = _positionSum vectorAdd _x; +} forEach _lastPositions; + +if (_foundTargetPos isNotEqualTo [0, 0, 0]) then { + _lastPositions set [_lastPositionIndex % MAX_AVERAGES, _foundTargetPos]; + _seekerParams set [4, _lastPositions]; + _seekerParams set [5, _lastPositionIndex + 1]; +}; + +private _aproximateVelocity = [0, 0, 0]; +_positionSum = _positionSum vectorAdd _foundTargetPos; +if (MAX_AVERAGES == count _lastPositions) then { + _positionSum = _positionSum vectorMultiply (1 / (1 + count _lastPositions)); + + // if we are within a meter of the previous average, just use the previous average + if (_positionSum distanceSqr _lastPositionSum < MINIMUM_DISTANCE_UNTIL_NEW_POS * MINIMUM_DISTANCE_UNTIL_NEW_POS) then { + _positionSum = _lastPositionSum; + }; + + if (_timestep != 0) then { + _aproximateVelocity = (_positionSum vectorDiff _lastPositionSum) vectorMultiply (1 / _timestep); + }; +} else { + _positionSum = _positionSum vectorMultiply (1 / count _lastPositions); +}; + +_seekerParams set [6, _positionSum]; + +_targetData set [0, (getPosASL _projectile) vectorFromTo _positionSum]; +_targetData set [3, _aproximateVelocity]; + +TRACE_3("laser target found",_foundTargetPos,_positionSum,count _lastPositions); + +_positionSum diff --git a/addons/missileguidance/functions/fnc_wire_onFired.sqf b/addons/missileguidance/functions/fnc_wire_onFired.sqf index 0cfa90ff99..870754c509 100644 --- a/addons/missileguidance/functions/fnc_wire_onFired.sqf +++ b/addons/missileguidance/functions/fnc_wire_onFired.sqf @@ -45,4 +45,3 @@ _attackProfileStateParams set [4, _maxDistanceSqr]; // max distance squared used _attackProfileStateParams set [5, _minDistanceSqr]; _attackProfileStateParams set [6, _wireCutSource]; _attackProfileStateParams set [7, _distanceAheadOfMissile]; - diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index 2b43be42f3..47f0e83e03 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -3,6 +3,7 @@ #include "\z\ace\addons\main\script_mod.hpp" // #define DRAW_GUIDANCE_INFO +// #define ENABLE_PROJECTILE_CAMERA // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -28,4 +29,3 @@ #define DEFAULT_LEAD_DISTANCE 5 #define ACTIVE_RADAR_POLL_FREQUENCY (1 / 7) #define ACTIVE_RADAR_MINIMUM_SCAN_AREA 30 - diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index aacdd472d6..0f224f2e04 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -12,7 +12,7 @@ Orientação avançada de Míssil Fejlett rakétairányító Продвинутое наведение ракет - アドバンスドミサイル誘導 + 高度なミサイル誘導 고급 미사일 유도 进阶导弹制导 進階飛彈制導 @@ -29,7 +29,7 @@ A fejlett rakétairányító (vagy AMG) többféle módosítást tartalmaz a rakéták célkövetéséhez és tüzeléséhez. Ez egy szükséges keresztrendszer a rakéta-alapú fegyverekhez. Orientação avançada de mísseis ou OAM, fornece vários aprimoramentos para travamento de mísseis e disparos. Também é um sistema requerido para disparar armas que utilizem mísseis. Pokočilé navádění raket (AMG) poskytuje několik vylepšení pro lepší zaměření a následnou střelbu. Je to prvek vyžadovaný u typu zbraní jako jsou rakety. - アドバンスドミサイル誘導 (AMG) は、ミサイルの捕捉と発射に複数の機能強化を提供します。 これは、ミサイル兵器の種類に必要なフレームワークでもあります。 + 高度なミサイル誘導 (AMG) は、ミサイルの捕捉と発射に複数の機能強化を提供します。 これは、ミサイル兵器の種類に必要なフレームワークでもあります。 고급 미사일 유도 혹은 AMG는 표적 획득 및 발사를 위한 여러 기능을 제공합니다. 미사일 종류에 따라 체계가 필요합니다. 进阶导弹制导增强了多种导弹锁定和射击的能力。此系统适用于所有导弹类型的武器。 進階飛彈制導增強了多種導彈鎖定和射擊的能力。此系統適用於所有飛彈類型的武器 @@ -205,5 +205,14 @@ 循環切換開火模式 Ateşleme Modunu Değiştir + + 6x DAGR [ACE] + + + 12x DAGR [ACE] + + + 24x DAGR [ACE] + diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 9f410c6a75..1aed143b18 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -29,7 +29,7 @@ Ez a modul lehetővé teszi a névcímkék beállításainak testreszabását. Этот модуль позволяет настроить опции и дистанцию отображения имен игроков. Questo modulo ti consente di personalizzare le impostazioni ed la distanza visibile delle Etichette Nomi - このモジュールを使用すると、ネーム タグの設定と範囲を調整できます。 + このモジュールを使用すると、ネーム タグの範囲と設定を調整できます。 이 모듈은 당신이 이름표의 범위를 임의로 수정할 수 있게 해줍니다. 这个模块允许您设定名字和显示范围等设定 這個模塊允許您設定名稱和顯示範圍等設定 diff --git a/addons/nightvision/XEH_postInit.sqf b/addons/nightvision/XEH_postInit.sqf index 5a1aa19b82..2933877771 100644 --- a/addons/nightvision/XEH_postInit.sqf +++ b/addons/nightvision/XEH_postInit.sqf @@ -21,6 +21,9 @@ GVAR(ppeffectRadialBlur) = -1; GVAR(ppeffectColorCorrect) = -1; GVAR(ppeffectBlur) = -1; +if (isNil QGVAR(const_MaxBrightness)) then { GVAR(const_MaxBrightness) = 0; }; +if (isNil QGVAR(const_MinBrightness)) then { GVAR(const_MinBrightness) = -6; }; + GVAR(isUsingMagnification) = false; ["CBA_settingsInitialized", { diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 1697fa907e..d0b210fe29 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -23,7 +23,7 @@ private _effectsEnabled = GVAR(effectScaling) != 0; private _defaultBrightness = [-3, 0] select _effectsEnabled; private _brightness = _player getVariable [QGVAR(NVGBrightness), _defaultBrightness]; -_brightness = ((_brightness + _changeInBrightness) min 0) max -6; +_brightness = ((_brightness + _changeInBrightness) min GVAR(const_MaxBrightness)) max GVAR(const_MinBrightness); _player setVariable [QGVAR(NVGBrightness), _brightness, false]; // Display default setting as 0 diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 1c1cd61ba7..1911681dd6 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -28,6 +28,7 @@ 夜视仪(一代,棕色) 아투경 (1세대, 갈색) Gafas de visión nocturna (Gen1, Marrón) + Óculos de Visão Noturna (Gen1, Marrom) NV Goggles (Gen1, Black) @@ -40,6 +41,7 @@ 夜视仪(一代,黑色) 아투경 (1세대, 검정) Gafas de visión nocturna (Gen1, Negro) + Óculos de Visão Noturna (Gen1, Preto) NV Goggles (Gen1, Green) @@ -52,6 +54,7 @@ 夜视仪(一代,绿色) 아투경 (1세대, 녹색) Gafas de visión nocturna (Gen1, Verde) + Óculos de Visão Noturna (Gen1, Verde) NV Goggles (Gen2, Brown) @@ -64,6 +67,7 @@ 夜视仪(二代,棕色) 아투경 (2세대, 갈색) Gafas de visión nocturna (Gen2, Marrón) + Óculos de Visão Noturna (Gen2, Marrom) NV Goggles (Gen2, Black) @@ -76,6 +80,7 @@ 夜视仪(二代,黑色) 아투경 (2세대, 검정) Gafas de visión nocturna (Gen2, Negro) + Óculos de Visão Noturna (Gen2, Preto) NV Goggles (Gen2, Green) @@ -88,6 +93,7 @@ 夜视仪(二代,绿色) 아투경 (2세대, 녹색) Gafas de visión nocturna (Gen2, Verde) + Óculos de Visão Noturna (Gen2, Verde) NV Goggles (Gen3) @@ -96,7 +102,7 @@ NS-Brille (3. Gen.) Visore Notturno (Gen3) Gogle noktowizyjne (Gen3) - Óculos de visão noturna (Gen3) + Óculos de Visão Noturna (Gen3) ПНВ (Gen3) Gafas de visión nocturna (Gen3) Éjjellátó szemüveg (3. Gen.) @@ -113,7 +119,7 @@ NS-Brille (3. Gen., braun) Visore Notturno (Gen3, Marrone) Gogle noktowizyjne (Gen3, Brązowe) - Óculos de visão noturna (Gen3, marrons) + Óculos de Visão Noturna (Gen3, Marrom) ПНВ (Gen3, Коричневый) Gafas de visión nocturna (Gen3, Marrón) Éjjellátó szemüveg (3. Gen., barna) @@ -133,6 +139,7 @@ JVN (Gen3, marron, WP) ПНВ (Gen3, Коричневый, БФ) Gafas de visión nocturna (Gen3, Marrón, FB) + Óculos de Visão Noturna (Gen3, Marrom, FB) Night Vision Goggles, White Phosphor @@ -144,6 +151,7 @@ Jumelles Vision Nocturne, Phosphore blanc Очки ночного видения, белый фосфор Gafas de Visión Nocturna, Fósforo Blanco + Óculos de Visão Nortuna, Fósforo Branco NV Goggles (Gen3, Green) @@ -152,7 +160,7 @@ NS-Brille (3. Gen., grün) Visore Notturno (Gen3, Verde) Gogle noktowizyjne (Gen3, Zielone) - Óculos de visão noturna (Gen3, verdes) + Óculos de Visão Noturna (Gen3, verdes) ПНВ (Gen3, Зелёный) Gafas de visión nocturna (Gen3, Verde) Éjjellátó szemüveg (3. Gen., zöld) @@ -172,6 +180,7 @@ JVN (Gen3, vertes, WP) ПНВ (Gen3, Зелёный, БФ) Gafas de visión nocturna (Gen3, Verde, FB) + Óculos de Visão Noturna (Gen3, Verde, FB) NV Goggles (Gen3, Black) @@ -180,7 +189,7 @@ NS-Brille (3. Gen., schwarz) Visore Notturno (Gen3, Nero) Gogle noktowizyjne (Gen3, Czarne) - Óculos de visão noturna (Gen3, pretos) + Óculos de Visão Noturna (Gen3, Preto) ПНВ (Gen3, Чёрный) Gafas de visión nocturna (Gen3, Negro) Éjjellátó szemüveg (3. Gen., fekete) @@ -200,6 +209,7 @@ JVN (Gen3, noires, WP) ПНВ (Gen3, Чёрный, БФ) Gafas de visión nocturna (Gen3, Negro, FB) + Óculos de Visão Noturna (Gen3, Preto, FB) NV Goggles (Gen4, Brown) @@ -212,6 +222,7 @@ 夜视仪(四代,棕色) 야투경 (4세대, 갈색) Gafas de visión nocturna (Gen4, Marrón) + Óculos de Visão Noturna (Gen4, Marrom) NV Goggles (Gen4, Brown, WP) @@ -223,6 +234,7 @@ JVN (Gen4, marron, WP) ПНВ (Gen4, Коричневый, БФ) Gafas de visión nocturna (Gen4, Marrón, FB) + Óculos de Visão Noturna (Gen4, Marrom, FB) NV Goggles (Gen4, Black) @@ -235,6 +247,7 @@ 夜视仪(四代,黑色) 야투경 (4세대, 검정) Gafas de visión nocturna (Gen4, Negro) + Óculos de Visão Noturna (Gen4, Preto) NV Goggles (Gen4, Black, WP) @@ -246,6 +259,7 @@ JVN (Gen4, noires, WP) ПНВ (Gen4, Чёрный, БФ) Gafas de visión nocturna (Gen4, Negro, FB) + Óculos de Visão Noturna (Gen4, Preto, FB) NV Goggles (Gen4, Green) @@ -258,6 +272,7 @@ 夜视仪(四代,绿色) 야투경 (4세대, 녹색) Gafas de visión nocturna (Gen4, Verde) + Óculos de Visão Noturna (Gen4, Verde) NV Goggles (Gen4, Green, WP) @@ -269,6 +284,7 @@ JVN (Gen4, vertes, WP) ПНВ (Gen4, Зелёный, БФ) Gafas de visión nocturna (Gen4, Verde, FB) + Óculos de Visão Noturna (Gen4, Verde, FB) NV Goggles (Wide, Brown) @@ -281,6 +297,7 @@ 夜视仪(宽,棕色) 야투경 (넓음, 갈색) Gafas de visión nocturna (Panorámicas, Marrón) + Óculos de Visão Noturna (Panorâmico, Marrom) NV Goggles (Wide, Brown, WP) @@ -292,6 +309,7 @@ JVN (Large, marron, WP) ПНВ (Широкий, Коричневый, БФ) Gafas de visión nocturna (Panorámicas, Marrón, FB) + Óculos de Visão Noturna (Panorâmico, Marrom, FB) NV Goggles (Wide, Black) @@ -304,6 +322,7 @@ 夜视仪(宽,黑色) 야투경 (넓음, 검정) Gafas de visión nocturna (Panorámicas, Negro) + Óculos de Visão Noturna (Panorâmico, Preto) NV Goggles (Wide, Black, WP) @@ -315,6 +334,7 @@ JVN (Large, noires, WP) ПНВ (Широкий, Чёрный, БФ) Gafas de visión nocturna (Panorámicas, Negro, FB) + Óculos de Visão Noturna (Panorâmico, Preto, FB) NV Goggles (Wide, Green) @@ -327,6 +347,7 @@ 夜视仪(宽,绿色) 야투경 (넓음, 녹색) Gafas de visión nocturna (Panorámicas, Verde) + Óculos de Visão Noturna (Panorâmico, Verde) NV Goggles (Wide, Green, WP) @@ -338,6 +359,7 @@ JVN (Large, vertes, WP) ПНВ (Широкий, Зелёный, БФ) Gafas de visión nocturna (Panorámicas, Verde, FB) + Óculos de Visão Noturna (Panorâmico, Verde, FB) Brightness: %1 @@ -365,7 +387,7 @@ Augmenter la luminosité des JVN Увеличить яркость ПНВ Éjjellátó fényerejének növelése - Aumentar Luminosidade do EVN + Aumentar Luminosidade do OVN Aumenta la luminosità dell'NVG 暗視装置の明度を上げる 야투경 밝기 높이기 @@ -382,7 +404,7 @@ Abaisser la luminosité des JVN Уменьшить яркость ПНВ Éjjellátó fényerejének csökkentése - Diminuir Luminosidade do EVN + Diminuir Luminosidade do OVN Riduci la luminosità dell'NVG 暗視装置の明度を下げる 야투경 밝기 줄이기 @@ -598,6 +620,7 @@ Génération de jumelles de vision nocturne Генерация ночного видения Generación de Visión Nocturna + Geração de Visão Noturna Gen %1 @@ -609,6 +632,7 @@ Gen %1 Генерация %1 Gen %1 + Gen %1 diff --git a/addons/nlaw/ACE_GuidanceConfig.hpp b/addons/nlaw/ACE_GuidanceConfig.hpp index e04753d681..6003586fe8 100644 --- a/addons/nlaw/ACE_GuidanceConfig.hpp +++ b/addons/nlaw/ACE_GuidanceConfig.hpp @@ -12,3 +12,9 @@ class EGVAR(missileguidance,SeekerTypes) { functionName = QFUNC(seeker); }; }; +class EGVAR(missileguidance,NavigationTypes) { + class GVAR(PLOS) { + functionName = QFUNC(navigation); + onFired = QFUNC(navigation_onFired); + }; +}; diff --git a/addons/nlaw/CfgAmmo.hpp b/addons/nlaw/CfgAmmo.hpp index b579ebeb06..f572678d20 100644 --- a/addons/nlaw/CfgAmmo.hpp +++ b/addons/nlaw/CfgAmmo.hpp @@ -6,9 +6,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.01; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + pitchRate = 5; // Minium flap deflection for guidance + yawRate = 10; // Maximum flap deflection for guidance canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -19,6 +18,9 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = {"LOBL"}; + defaultNavigationType = QGVAR(PLOS); + navigationTypes[] = { QGVAR(PLOS) }; + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 45; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier diff --git a/addons/nlaw/XEH_PREP.hpp b/addons/nlaw/XEH_PREP.hpp index aad1e57efb..1cd8dbc3c5 100644 --- a/addons/nlaw/XEH_PREP.hpp +++ b/addons/nlaw/XEH_PREP.hpp @@ -4,3 +4,5 @@ PREP(attackProfile); PREP(keyDown); PREP(onFired); PREP(seeker); +PREP(navigation); +PREP(navigation_onFired); diff --git a/addons/nlaw/XEH_postInit.sqf b/addons/nlaw/XEH_postInit.sqf index 885e2d5e2f..16be48ce26 100644 --- a/addons/nlaw/XEH_postInit.sqf +++ b/addons/nlaw/XEH_postInit.sqf @@ -22,7 +22,11 @@ GVAR(pitchChange) = 0; // Visual debuging, idealy used with a moving vehicle called "testTarget" #ifdef DRAW_NLAW_INFO +GVAR(debug_firedPrediction) = []; addMissionEventHandler ["Draw3d", { + // BLACK - On fired path prediction + { drawIcon3D _x; } forEach GVAR(debug_firedPrediction); + // GREEN - Draw an object called "testTarget"'s aim pos and 1 sec aimpos predicted by velocity if ((!isNil "testTarget") && {!isNull testTarget}) then { { diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf index 9628974800..f527780835 100644 --- a/addons/nlaw/functions/fnc_attackProfile.sqf +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -18,14 +18,13 @@ */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; + +#ifdef DRAW_NLAW_INFO _args params ["_firedEH", "_launchParams"]; _launchParams params ["","_targetLaunchParams", "", "_attackProfile"]; _targetLaunchParams params ["", "", "_launchPos"]; _firedEH params ["","","","","","","_projectile"]; -// Use seeker (if terminal) -if (_seekerTargetPos isNotEqualTo [0,0,0]) exitWith {_seekerTargetPos}; - _attackProfileStateParams params ["_startTime", "_startLOS", "_yawChange", "_pitchChange"]; (_startLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; @@ -36,14 +35,6 @@ private _flightTime = CBA_missionTime - _startTime; private _realYaw = _yaw + _yawChange * _flightTime; private _realPitch = _pitch + _pitchChange * _flightTime; -private _returnTargetPos = _launchPos vectorAdd ([_distanceFromLaunch, _realYaw, _realPitch] call CBA_fnc_polar2vect); - -if (_attackProfile == QGVAR(overflyTopAttack)) then { // Add 2m height in OTA attack mode - _returnTargetPos = _returnTargetPos vectorAdd [0,0,2]; -}; - - -#ifdef DRAW_NLAW_INFO drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; @@ -56,5 +47,4 @@ if ((count _test) > 0) then { }; #endif -// TRACE_1("Adjusted target position",_returnTargetPos); -_returnTargetPos; +[0, 0, 1] diff --git a/addons/nlaw/functions/fnc_keyDown.sqf b/addons/nlaw/functions/fnc_keyDown.sqf index 5b75c72140..aee9739474 100644 --- a/addons/nlaw/functions/fnc_keyDown.sqf +++ b/addons/nlaw/functions/fnc_keyDown.sqf @@ -74,7 +74,7 @@ playSound "ACE_Sound_Click"; _args set [1, _yaw]; _args set [2, _pitch]; - #ifdef DEBUG_MODE_FULL + #ifdef DRAW_NLAW_INFO hintSilent format ["Instantaneous\nYaw: %1\n Pitch: %2\nGVAR\nYaw: %3\nPitch: %4", _yawChange, _pitchChange, GVAR(yawChange), GVAR(pitchChange)]; #endif }, .25, [CBA_missionTime, _yaw, _pitch, true]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nlaw/functions/fnc_navigation.sqf b/addons/nlaw/functions/fnc_navigation.sqf new file mode 100644 index 0000000000..1cfd8f91d5 --- /dev/null +++ b/addons/nlaw/functions/fnc_navigation.sqf @@ -0,0 +1,78 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Attempts to hold angle as fed to by seeker. Does so with a simple proportional controller + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Commanded acceleration normal to LOS in world space + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_line + * + * Public: No + */ +// arbitrary constant +#define PROPORTIONALITY_CONSTANT 20 +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos", "_targetData", "_navigationParams"]; +_args params ["_firedEH"]; +_firedEH params ["","","","","","","_projectile"]; + +_navigationParams params ["_yawChange", "_pitchChange", "_lastPitch", "_lastYaw", "_initialPitch", "_pitchUp", "_lastYawRateDifference"]; + +// for some reason we need to multiply this. I don't know why, but it just works +_pitchChange = _pitchChange * 1.5; +_yawChange = _yawChange * 1.5; + +((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"]; + +private _pitchRate = if (_timestep == 0) then { + 0 +} else { + (_currentPitch - _lastPitch) / _timestep +}; +_navigationParams set [2, _currentPitch]; + +private _pitchModifier = if (_pitchChange == 0) then { + 1 +} else { + abs (_pitchRate / _pitchChange) +}; +private _desiredPitchChange = (_pitchChange - _pitchRate) * PROPORTIONALITY_CONSTANT * _pitchModifier; +_desiredPitchChange = _desiredPitchChange + _pitchUp * (_initialPitch - _currentPitch) * PROPORTIONALITY_CONSTANT * _pitchModifier; + +private _yawRate = if (_timestep == 0) then { + 0 +} else { + (_currentYaw - _lastYaw) / _timestep +}; +_navigationParams set [3, _currentYaw]; + +private _yawModifier = if (_yawChange == 0) then { + 1 +} else { + abs (_yawRate / _yawChange) +}; + +private _yawRateDifference = _yawChange - _yawRate; +private _yawChangeDerivative = if (_timestep == 0) then { + 0 +} else { + (_yawRateDifference - _lastYawRateDifference) / _timestep +}; +_navigationParams set [6, _yawRateDifference]; + +private _desiredYawChange = _yawRateDifference * PROPORTIONALITY_CONSTANT + _yawRateDifference * 2; + +#ifdef DRAW_NLAW_INFO +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLtoAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"]; +#endif + +TRACE_4("nlaw pitch/yaw info",_currentPitch,_lastPitch,_currentYaw,_lastYaw); +TRACE_6("nlaw navigation",_yawChange,_desiredYawChange,_pitchChange,_desiredPitchChange,_yawRate,_pitchRate); + +_projectile vectorModelToWorldVisual [_yawChange + _desiredYawChange, 0, _pitchChange + _desiredPitchChange] + diff --git a/addons/nlaw/functions/fnc_navigation_onFired.sqf b/addons/nlaw/functions/fnc_navigation_onFired.sqf new file mode 100644 index 0000000000..895d5ff78b --- /dev/null +++ b/addons/nlaw/functions/fnc_navigation_onFired.sqf @@ -0,0 +1,70 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Sets up missile guidance state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * Navigation Parameters + * + * Example: + * [] call ace_nlaw_fnc_onFired + * + * Public: No + */ + +params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams","","_attackProfile"]; +_targetLaunchParams params ["_target"]; +_stateParams params ["", "", "", "", "_navigationParams"]; + +// Reset _launchPos origin as projectile's height instead of player's foot +_targetLaunchParams set [2, getPosASL _projectile]; + +// Get state params: +TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); + +private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _yawChange = 0; +private _pitchChange = 0; + +if (_shooter == ACE_player) then { + TRACE_2("isPlayer",GVAR(yawChange),GVAR(pitchChange)); + _yawChange = GVAR(yawChange); + _pitchChange = GVAR(pitchChange); + TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); +} else { + if ((!isNil "_target") && {!isNull _target}) then { + _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); + (((eyePos _shooter) vectorFromTo (aimPos _target)) call CBA_fnc_vect2Polar) params ["", "_startYaw", "_startPitch"]; + // Add some random error to AI's velocity prediction: + private _random = random [(_shooter skillFinal "aimingAccuracy") min 0.9, 1, 2-((_shooter skillFinal "aimingAccuracy") min 0.9)]; + (((eyePos _shooter) vectorFromTo ((aimPos _target) vectorAdd ((velocity _target) vectorMultiply (_random)))) call CBA_fnc_vect2Polar) params ["", "_predictedYaw", "_predictedPitch"]; + _yawChange = ([_predictedYaw - _startYaw] call CBA_fnc_simplifyAngle180); + _pitchChange = ([_predictedPitch - _startPitch] call CBA_fnc_simplifyAngle180); + TRACE_1("AI",_target); + } else { + TRACE_1("AI - no target",_target); + }; +}; + +// Limit Max Deflection +//_yawChange = -10 max _yawChange min 10; +//_pitchChange = -10 max _pitchChange min 10; + +((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"]; +((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +TRACE_5("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange,_currentPitch,_currentYaw); +_navigationParams set [0, _yawChange]; +_navigationParams set [1, _pitchChange]; +_navigationParams set [2, _currentPitch]; // last pitch +_navigationParams set [3, _currentYaw]; // last yaw +_navigationParams set [4, _pitch]; // initial pitch +_navigationParams set [5, 0]; // whether or not to zero out the pitch +_navigationParams set [6, 0]; +_navigationParams + diff --git a/addons/nlaw/functions/fnc_onFired.sqf b/addons/nlaw/functions/fnc_onFired.sqf index 11b38a1da0..e8332b8caf 100644 --- a/addons/nlaw/functions/fnc_onFired.sqf +++ b/addons/nlaw/functions/fnc_onFired.sqf @@ -19,7 +19,7 @@ params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_statePa _firedEH params ["_shooter","","","","","","_projectile"]; _launchParams params ["","_targetLaunchParams","","_attackProfile"]; _targetLaunchParams params ["_target"]; -_stateParams params ["", "", "_attackProfileStateParams"]; +_stateParams params ["", "_seekerStateParams", "_attackProfileStateParams"]; // Reset _launchPos origin as projectile's height instead of player's foot _targetLaunchParams set [2, getPosASL _projectile]; @@ -27,7 +27,7 @@ _targetLaunchParams set [2, getPosASL _projectile]; // Get state params: TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); -private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _firedLOS = vectorDir _projectile; private _yawChange = 0; private _pitchChange = 0; @@ -36,6 +36,23 @@ if (_shooter == ACE_player) then { _yawChange = GVAR(yawChange); _pitchChange = GVAR(pitchChange); TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); + + #ifdef DRAW_NLAW_INFO + systemChat format ["YAW [%1]", _yawChange]; + systemChat format ["PITCH [%1]", _pitchChange]; + GVAR(debug_firedPrediction) = []; + private _debugPos = getPosASL _projectile; + ((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_debugYaw", "_debugPitch"]; + private _distance = 0; + for "_x" from 0 to 6 step 0.1 do { + private _debugAproxVel = linearConversion [0, 1, 5, 40, 170, true]; + _distance = _distance + _debugAproxVel * 0.1; + private _debugYaw = _debugYaw + _yawChange * _x; + private _debugPitch = _debugPitch + _pitchChange * _x; + private _debugPos = _debugPos vectorAdd ([_distance, _debugYaw, _debugPitch] call CBA_fnc_polar2vect); + GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], ASLtoAGL _debugPos, 0.5, 0.5, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + }; + #endif } else { if ((!isNil "_target") && {!isNull _target}) then { _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); @@ -55,6 +72,10 @@ if (_shooter == ACE_player) then { _yawChange = -10 max _yawChange min 10; _pitchChange = -10 max _pitchChange min 10; +_seekerStateParams set [2, _yawChange]; +_seekerStateParams set [3, _pitchChange]; +_seekerStateParams set [4, CBA_missionTime]; + TRACE_3("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange); _attackProfileStateParams set [0, CBA_missionTime]; _attackProfileStateParams set [1, _firedLOS]; diff --git a/addons/nlaw/functions/fnc_seeker.sqf b/addons/nlaw/functions/fnc_seeker.sqf index e5de6d320c..a3a60e94a1 100644 --- a/addons/nlaw/functions/fnc_seeker.sqf +++ b/addons/nlaw/functions/fnc_seeker.sqf @@ -16,14 +16,27 @@ * * Public: No */ +#define PITCH_UP_TIME 1 -params ["", "_args", "_seekerStateParams"]; +params ["", "_args", "_seekerStateParams", "", "", "_targetData"]; _args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["", "_targetLaunchParams", "", "_attackProfile"]; _targetLaunchParams params ["", "", "_launchPos"]; +_stateParams params ["", "", "", "", "_navigationParams"]; -if (_attackProfile == QGVAR(directAttack)) exitWith {[0,0,0]}; +if (_attackProfile == QGVAR(directAttack)) exitWith { + _navigationParams set [5, 1]; + [0,0,0] +}; + +_seekerStateParams params ["", "", "", "_originalPitchRate", "_startTime"]; +_navigationParams params ["", "_pitchRate"]; + +// pitch up for the first second of flight to begin an over-fly trajectory +private _pitchChange = linearConversion [0, PITCH_UP_TIME, CBA_missionTime - _startTime, 2, 0, true]; +_navigationParams set [1, _originalPitchRate + _pitchChange]; +_navigationParams set [5, ((CBA_missionTime - _startTime) min PITCH_UP_TIME) / PITCH_UP_TIME]; private _projPos = getPosASL _projectile; diff --git a/addons/noradio/stringtable.xml b/addons/noradio/stringtable.xml index d1cf51f0e6..d41827ebfa 100644 --- a/addons/noradio/stringtable.xml +++ b/addons/noradio/stringtable.xml @@ -12,6 +12,7 @@ Нет рации No Radio Pas de radio + Sem Rádio Mute Player diff --git a/addons/novehicleclanlogo/stringtable.xml b/addons/novehicleclanlogo/stringtable.xml index 96d463f582..1e07c85ce8 100644 --- a/addons/novehicleclanlogo/stringtable.xml +++ b/addons/novehicleclanlogo/stringtable.xml @@ -11,6 +11,7 @@ Clan-Logo von Fahrzeugen entfernen Rimuovi Icone Clan dai veicoli Retirer les logos de clan des véhicules + Remover logo do clã de veículos Prevents clan logo from being displayed on vehicles controlled by players. @@ -22,6 +23,7 @@ Verhindert, dass das Clan-Logo auf von Spielern kontrollierten Fahrzeugen angezeigt wird. Impedisce la visualizzazione di icone clan sui veicoli controllati da giocatori. Empêche les logos de clan d'être affichés sur les véhicules contrôlés par des joueurs. + Previne o logo do clã de ser mostrado em veículos controlados por jogadores. diff --git a/addons/optics/CfgEventHandlers.hpp b/addons/optics/CfgEventHandlers.hpp deleted file mode 100644 index f6503c2479..0000000000 --- a/addons/optics/CfgEventHandlers.hpp +++ /dev/null @@ -1,17 +0,0 @@ -class Extended_PreStart_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); - }; -}; - -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); - }; -}; - -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); - }; -}; diff --git a/addons/optics/CfgOpticsEffect.hpp b/addons/optics/CfgOpticsEffect.hpp deleted file mode 100644 index 30c372fdac..0000000000 --- a/addons/optics/CfgOpticsEffect.hpp +++ /dev/null @@ -1,7 +0,0 @@ -class CfgOpticsEffect { - class ACE_OpticsRadBlur1 { - type = "radialblur"; - params[] = {0.015, 0, 0.14, 0.2}; - priority = 950; - }; -}; diff --git a/addons/optics/CfgPreloadTextures.hpp b/addons/optics/CfgPreloadTextures.hpp index 1354f91e18..b4bf27f76f 100644 --- a/addons/optics/CfgPreloadTextures.hpp +++ b/addons/optics/CfgPreloadTextures.hpp @@ -1,49 +1,38 @@ -#define MACRO_PRELOAD \ - GVAR(BodyDay) = "*"; \ - GVAR(BodyNight) = "*"; \ - GVAR(ReticleDay) = "*"; \ - GVAR(ReticleNight) = "*" - class PreloadTextures { class CfgWeapons { class ACE_optic_Hamr_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_Hamr_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_Arco_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_Arco_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_MRCO_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_MRCO_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_SOS_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_SOS_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_LRPS_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_LRPS_PIP { - MACRO_PRELOAD; + PRELOAD; }; }; }; diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp deleted file mode 100644 index bb01281a22..0000000000 --- a/addons/optics/CfgRscTitles.hpp +++ /dev/null @@ -1,204 +0,0 @@ -class RscOpticsValue; -class RscMapControl; -class RscText; - -class RscInGameUI { - class RscUnitInfo; - class RscWeaponZeroing: RscUnitInfo { - class CA_Zeroing; - }; - - class ACE_RscWeaponZeroing: RscWeaponZeroing { - controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ACE_ScriptedReticle"}; - - class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used - idc = 154; - style = 2; - colorText[] = {0, 0, 0, 0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; - - class ACE_DrawReticleHelper: RscMapControl { - onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope)); - idc = -1; - w = 0; - h = 0; - }; - - class ACE_ScriptedReticle: RscText { - idc = 1713154; - style = 48; - size = 1; - sizeEx = 0; - text = QPATHTOF(reticles\ace_shortdot_reticle_1.paa); - w = 0; - h = 0; - }; - }; - - class ACE_RscWeapon_base: RscWeaponZeroing { - controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ReticleDay", "ReticleNight", "BodyNight", "BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // Don't change this order - - class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used - idc = 154; - style = 2; - colorText[] = {0, 0, 0, 0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; - - class ACE_DrawReticleHelper: RscMapControl { - onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope2D)); - idc = -1; - w = 0; - h = 0; - }; - - #define SIZEX 0.75/(getResolution select 5) - class ReticleDay: RscText { - idc = 1713001; - style = 48; - size = 0; - sizeEx = 1; - text = ""; - colorText[] = {1, 1, 1, 0}; - colorBackground[] = {0, 0, 0, 0}; - x = QUOTE(safezoneX + 0.5 * safezoneW - 0.5 * SIZEX); - y = QUOTE(safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3)); - w = QUOTE(SIZEX); - h = QUOTE(SIZEX * (4 / 3)); - }; - - class ReticleNight: ReticleDay { - idc = 1713002; - text = ""; - }; - - #undef SIZEX - #define SIZEX 2*0.75/(getResolution select 5) - class BodyDay: ReticleDay { - idc = 1713005; - text = ""; - x = QUOTE(safezoneX + 0.5 * safezoneW - 0.5 * SIZEX); - y = QUOTE(safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3)); - w = QUOTE(SIZEX); - h = QUOTE(SIZEX * (4 / 3)); - }; - - class BodyNight: BodyDay { - idc = 1713006; - text = ""; - }; - - // These are just black side panels to cover the areas that the optics p3d doesn't cover - // It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else - // Reference PR #1156: - class trippleHeadLeft: RscText { - idc = 1713010; - x = "safeZoneXAbs"; - Y = "safezoneY"; - W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4) / (16 / 3))"; - H = "safeZoneH"; - colorBackground[] = {0, 0, 0, 1}; - }; - class trippleHeadRight: trippleHeadLeft { - idc = 1713011; - x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4) / (16 / 3))"; - colorBackground[] = {0, 0, 0, 1}; - }; - }; - - class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\hamr-reticle65_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\hamr-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\hamr-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_Arco: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\arco-reticle65_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\arco-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\arco-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_MRCO: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\mrco-reticle556_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\mrco-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\mrco-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_SOS: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\sos-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\sos-bodyNight_ca.paa); - }; - }; -}; - -/* - -_ctrl = (D displayCtrl 1713006); - -_sizeX = 1.54 / (getResolution select 5); -_sizeY = _sizeX * safezoneW / safezoneH; - -_ctrl ctrlSetPosition [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; -_ctrl ctrlCommit 0 - - */ diff --git a/addons/optics/CfgVehicles.hpp b/addons/optics/CfgVehicles.hpp index eda9a3d930..41e2d8ab03 100644 --- a/addons/optics/CfgVehicles.hpp +++ b/addons/optics/CfgVehicles.hpp @@ -3,16 +3,10 @@ class CfgVehicles { class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_optic_Hamr_2D,2); - MACRO_ADDITEM(ACE_optic_Hamr_PIP,2); MACRO_ADDITEM(ACE_optic_Arco_2D,2); - MACRO_ADDITEM(ACE_optic_Arco_PIP,2); MACRO_ADDITEM(ACE_optic_MRCO_2D,2); - //MACRO_ADDITEM(ACE_optic_MRCO_PIP,2); MACRO_ADDITEM(ACE_optic_SOS_2D,2); - MACRO_ADDITEM(ACE_optic_SOS_PIP,2); MACRO_ADDITEM(ACE_optic_LRPS_2D,2); - MACRO_ADDITEM(ACE_optic_LRPS_PIP,2); - //MACRO_ADDITEM(ACE_optic_DMS,2); }; }; }; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 8088a5fcd3..90cccb3286 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -1,110 +1,62 @@ class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; - class Default; - class Binocular: Default { - forceOptics = 0; // Allow using compass with Binocular - opticsZoomMin = 0.056889; // 5.25x power - opticsZoomMax = 0.056889; // 9 px/mil - modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view - visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes - // Fix AI using Binocs on short range - #18737 - // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) - minRange = 500; //500 = seem almost never use it..? - minRangeProbab = 0.001; - midRange = 1000; - midRangeProbab = 0.01; - maxRange = 5000; - maxRangeProbab = 0.01; - }; - - // zooming reticle scopes - class optic_DMS: ItemCore { - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip; - class Iron; - }; - }; - }; - - /*class ACE_optic_DMS: optic_DMS { - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_DMS"; - scope = 1; - displayName = "LOCALIZE ACE DMS"; - //descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1"; - weaponInfoType = "ACE_RscWeaponZeroing"; - - class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_shortdot_optics.p3d); - - class OpticsModes: OpticsModes { - class Snip: Snip { - opticsZoomMin = 0.05; - opticsZoomMax = 0.3; - opticsZoomInit = 0.3; - discretefov[] = {}; - modelOptics[] = {}; - }; - - class Iron: Iron {}; - }; - }; - };*/ - - // PIP scopes + // HAMR class optic_Hamr: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { - class Hamr2Collimator; class Hamr2Scope; + class Hamr2Collimator; }; }; }; class ACE_optic_Hamr_2D: optic_Hamr { - GVAR(BodyDay) = QPATHTOF(reticles\hamr-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\hamr-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\hamr-reticle65_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Hamr_2D"; + scope = 2; displayName = CSTRING(hamr); - weaponInfoType = "ACE_RscWeapon_Hamr"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\hamr-reticle65_ca.paa); + reticleTextureNight = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); + reticleTextureSize = 6 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6 + + bodyTexture = QPATHTOF(reticles\hamr-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\hamr-bodyNight_ca.paa); + bodyTextureSize = 2.2; + + hideMagnification = 1; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class Hamr2Collimator: Hamr2Collimator {}; - class Hamr2Scope: Hamr2Scope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal", "NVG"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class Hamr2Collimator: Hamr2Collimator {}; }; }; }; - class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Hamr_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(hamr_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // ARCO class optic_Arco: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -115,95 +67,104 @@ class CfgWeapons { }; class ACE_optic_Arco_2D: optic_Arco { - GVAR(BodyDay) = QPATHTOF(reticles\arco-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\arco-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\arco-reticle65_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Arco_2D"; + scope = 2; displayName = CSTRING(arco); - weaponInfoType = "ACE_RscWeapon_Arco"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\arco-reticle65_ca.paa); + reticleTextureNight = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); + reticleTextureSize = 6.4 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6.4 + + bodyTexture = QPATHTOF(reticles\arco-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\arco-bodyNight_ca.paa); + bodyTextureSize = 2.2; + + hideMagnification = 1; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class ARCO2collimator: ARCO2collimator {}; class ARCO2scope: ARCO2scope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class ARCO2collimator: ARCO2collimator {}; }; }; }; - class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Arco_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(arco_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // MRCO class optic_MRCO: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { - class MRCOcq; class MRCOscope; + class MRCOcq; }; }; }; class ACE_optic_MRCO_2D: optic_MRCO { - GVAR(BodyDay) = QPATHTOF(reticles\mrco-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\mrco-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\mrco-reticle556_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_MRCO_2D"; - displayName = CSTRING(valdada); - weaponInfoType = "ACE_RscWeapon_MRCO"; + scope = 2; + displayName = CSTRING(mrco); + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\mrco-reticle556_ca.paa); + reticleTextureNight = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); + reticleTextureSize = 6.4 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6.4 + + bodyTexture = QPATHTOF(reticles\mrco-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\mrco-bodyNight_ca.paa); + bodyTextureSize = 2.2; + + hideMagnification = 1; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class MRCOcq: MRCOcq {}; class MRCOscope: MRCOscope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class MRCOcq: MRCOcq {}; }; }; }; - class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; - //scopeArsenal = 1; - displayName = CSTRING(valdada_pip); + displayName = CSTRING(mrco_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // SOS class optic_SOS: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -214,49 +175,53 @@ class CfgWeapons { }; class ACE_optic_SOS_2D: optic_SOS { - GVAR(BodyDay) = QPATHTOF(reticles\sos-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\sos-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_SOS_2D"; + scope = 2; displayName = CSTRING(sos); - weaponInfoType = "ACE_RscWeapon_SOS"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\sos-reticleMLR_ca.paa); + reticleTextureNight = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); + reticleTextureSize = 0.76; // At 22x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 0.76 + + bodyTexture = QPATHTOF(reticles\sos-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\sos-bodyNight_ca.paa); + bodyTextureSize = 1.55; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; + opticsZoomMin = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomMax = "2.75 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomInit = "2.75 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + discreteFov[] = {}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_90.p3d"}; useModelOptics = 1; - opticsZoomInit = 0.0116; - opticsZoomMax = 0.0464; - opticsZoomMin = 0.0116; - discreteFOV[] = {0.0464, 0.0116}; - opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; }; class Iron: Iron {}; }; }; }; - class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_SOS_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(sos_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_pip.p3d"}; }; class Iron: Iron {}; }; }; }; + // LRPS class optic_LRPS: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -266,44 +231,64 @@ class CfgWeapons { }; class ACE_optic_LRPS_2D: optic_LRPS { - GVAR(BodyDay) = QPATHTOF(reticles\sos-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\sos-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_LRPS_2D"; + scope = 2; displayName = CSTRING(lrps); - weaponInfoType = "ACE_RscWeapon_SOS"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\sos-reticleMLR_ca.paa); + reticleTextureNight = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); + reticleTextureSize = 0.76; // At 22x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 0.76 + + bodyTexture = QPATHTOF(reticles\sos-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\sos-bodyNight_ca.paa); + bodyTextureSize = 1.55; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; + opticsZoomMin = "22 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomMax = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomInit = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + discreteFov[] = {}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_90.p3d"}; useModelOptics = 1; - opticsZoomInit = 0.0116; - opticsZoomMax = 0.0464; - opticsZoomMin = 0.0116; - discreteFOV[] = {}; - opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; }; }; }; }; - class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_LRPS_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(lrps_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_pip.p3d"}; }; }; }; }; + + // Binocular + class Default; + class Binocular: Default { + opticsZoomInit = 0.056889; // 7x power IRL + opticsZoomMin = 0.056889; // but in order to make the stadiametric rangefinder useful, ~4.4x magnification has been set + opticsZoomMax = 0.056889; // 9 px/mil + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view (Steiner M22) + // Fix AI using Binocs on short range - #18737 + // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) + minRange = 500; // 500 = seem almost never use it..? + minRangeProbab = 0.001; + midRange = 1000; + midRangeProbab = 0.01; + maxRange = 5000; + maxRangeProbab = 0.01; + }; }; diff --git a/addons/optics/XEH_PREP.hpp b/addons/optics/XEH_PREP.hpp deleted file mode 100644 index 8eb8eb1eb5..0000000000 --- a/addons/optics/XEH_PREP.hpp +++ /dev/null @@ -1,3 +0,0 @@ -PREP(handleFired); -PREP(onDrawScope); -PREP(onDrawScope2D); diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf deleted file mode 100644 index 1641ee2174..0000000000 --- a/addons/optics/XEH_postInit.sqf +++ /dev/null @@ -1,31 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -GVAR(camera) = objNull; - -// save control for fired EH -["ace_infoDisplayChanged", { - TRACE_1("ace_infoDisplayChanged",_this); - if (!isNull ((_this select 0) displayCtrl 1713001)) then { - uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; - }; -}] call CBA_fnc_addEventHandler; - -// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent.. -["featureCamera", { - params ["_player", "_featureCamera"]; - TRACE_1("featureCamera",_featureCamera); - if (_featureCamera isEqualTo "") then { - // Destroy the camera, and it will be re-created in the onDrawScope2d helper - if (!isNull GVAR(camera)) then { - GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; - camDestroy GVAR(camera); - TRACE_1("destroying pip camera for restart",GVAR(camera)); - }; - }; -}] call CBA_fnc_addPlayerEventHandler; - -// Register fire event handler -["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf deleted file mode 100644 index b47cf6628d..0000000000 --- a/addons/optics/XEH_preInit.sqf +++ /dev/null @@ -1,9 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -PREP_RECOMPILE_START; -#include "XEH_PREP.hpp" -PREP_RECOMPILE_END; - -ADDON = true; diff --git a/addons/optics/XEH_preStart.sqf b/addons/optics/XEH_preStart.sqf deleted file mode 100644 index 022888575e..0000000000 --- a/addons/optics/XEH_preStart.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -#include "XEH_PREP.hpp" diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index c1524320c7..8b61425c67 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -10,12 +10,11 @@ class CfgPatches { "ACE_optic_Arco_2D", "ACE_optic_Arco_PIP", "ACE_optic_MRCO_2D", - //"ACE_optic_MRCO_PIP", + "ACE_optic_MRCO_PIP", "ACE_optic_SOS_2D", "ACE_optic_SOS_PIP", "ACE_optic_LRPS_2D", "ACE_optic_LRPS_PIP" - //"ACE_optic_DMS" }; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; @@ -26,12 +25,15 @@ class CfgPatches { }; }; -#include "CfgEventHandlers.hpp" - -#include "CfgOpticsEffect.hpp" -#include "CfgRscTitles.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" -#include "CfgJointRails.hpp" - #include "CfgPreloadTextures.hpp" +#include "CfgJointRails.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" + +class CBA_PIPItems { + ACE_optic_Hamr_2D = "ACE_optic_Hamr_PIP"; + ACE_optic_Arco_2D = "ACE_optic_Arco_PIP"; + ACE_optic_MRCO_2D = "ACE_optic_MRCO_PIP"; + ACE_optic_SOS_2D = "ACE_optic_SOS_PIP"; + ACE_optic_LRPS_2D = "ACE_optic_LRPS_PIP"; +}; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf deleted file mode 100644 index f36f04d881..0000000000 --- a/addons/optics/functions/fnc_handleFired.sqf +++ /dev/null @@ -1,104 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Taosenai - * Adapted By: KoffeinFlummi, commy2 - * - * Animates the scope when firing. Called from the unified fired EH only for the local player. - * - * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) - * - * Return Value: - * None - * - * Example: - * call ace_optics_fnc_handleFired - * - * Public: No - */ - -// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); - -disableSerialization; - -// Check if compatible scope is used -private _display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull]; - -if (isNull _display) exitWith {}; - -// Reduce the reticle movement as the player drops into lower, supported stances. -private _recoilCoef = switch (true) do { - case (isWeaponDeployed _unit): {0.1}; - case (isWeaponRested _unit): {0.4}; - default {1}; -}; - -// Constants which determine how the scope recoils - -private _recoilScope = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_RECOIL_MIN, SCOPE_RECOIL_MAX, false]; - -private _reticleShiftX = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_X_MIN, RETICLE_SHIFT_X_MAX, false]; -private _reticleShiftY = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_Y_MIN, RETICLE_SHIFT_Y_MAX, false]; - -private _scopeShiftX = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_X_MIN, SCOPE_SHIFT_X_MAX, false]; -private _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN, SCOPE_SHIFT_Y_MAX, false]; - -// Create and commit recoil effect - -private _sizeX = (0.75 + _recoilScope) / (getResolution select 5); -private _sizeY = _sizeX * (4 / 3); - -private _positionReticle = [ - safezoneX + 0.5 * safezoneW - 0.5 * (_sizeX + _reticleShiftX), - safezoneY + 0.5 * safezoneH - 0.5 * (_sizeY + _reticleShiftY), - _sizeX, - _sizeY -]; - -(_display displayCtrl 1713001) ctrlSetPosition _positionReticle; -(_display displayCtrl 1713002) ctrlSetPosition _positionReticle; - -private _positionBody = [ - safezoneX + 0.5 * safezoneW - 0.5 * (2 * _sizeX + _scopeShiftX), - safezoneY + 0.5 * safezoneH - 0.5 * (2 * _sizeY + _scopeShiftY), - 2 * _sizeX, - 2 * _sizeY -]; - -(_display displayCtrl 1713005) ctrlSetPosition _positionBody; -(_display displayCtrl 1713006) ctrlSetPosition _positionBody; - -(_display displayCtrl 1713001) ctrlCommit 0; -(_display displayCtrl 1713002) ctrlCommit 0; -(_display displayCtrl 1713005) ctrlCommit 0; -(_display displayCtrl 1713006) ctrlCommit 0; - -// Bring them all back -_sizeX = 0.75 / (getResolution select 5); -_sizeY = _sizeX * (4 / 3); - -_positionReticle = [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; - -(_display displayCtrl 1713001) ctrlSetPosition _positionReticle; -(_display displayCtrl 1713002) ctrlSetPosition _positionReticle; - -_positionBody = [ - safezoneX + 0.5 * safezoneW - 0.5 * 2 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * 2 * _sizeY, - 2 * _sizeX, - 2 * _sizeY -]; - -(_display displayCtrl 1713005) ctrlSetPosition _positionBody; -(_display displayCtrl 1713006) ctrlSetPosition _positionBody; - -(_display displayCtrl 1713001) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713002) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713005) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713006) ctrlCommit RECENTER_TIME; diff --git a/addons/optics/functions/fnc_onDrawScope.sqf b/addons/optics/functions/fnc_onDrawScope.sqf deleted file mode 100644 index 4b1b9e321d..0000000000 --- a/addons/optics/functions/fnc_onDrawScope.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: commy2 - * - * - * Arguments: - * 0: Display - * - * Return Value: - * None - * - * Example: - * [DISPLAY] call ace_optics_fnc_onDrawScope - * - * Public: No - */ - -disableSerialization; - -params ["_display"]; - -private _control = _display displayCtrl 1713154; - -if (!ctrlShown (_display displayCtrl 154)) exitWith { - _control ctrlShow false; -}; - -private _sizeX = (call EFUNC(common,getZoom)) / 4; -private _sizeY = _sizeX * safezoneW / safezoneH; - -_control ctrlSetPosition [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; - -_control ctrlCommit 0; -_control ctrlShow true; diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf deleted file mode 100644 index c7fb19c9c1..0000000000 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ /dev/null @@ -1,103 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: commy2 - * Helper function for updating the 2d and 3d scope controls - * Called from a dummy map controls onDraw. - * - * Arguments: - * 0: Display (RscInGameUI for a weapon) - * - * Return Value: - * None - * - * Example: - * [ACE_RscWeapon_Arco's Display] call ace_optics_fnc_onDrawScope2D - * - * Public: No - */ - -disableSerialization; - -params ["_display"]; - -// @todo, all weapon types -private _optic = (primaryWeaponItems ACE_player) select 2; -private _isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QPATHTOF(models\ace_optics_pip.p3d); - -if (_isPIP) then { - GVAR(pipLastFrame) = diag_frameno; - if (isNull GVAR(camera)) then { - if ((({_x != GVAR(camera)} count allMissionObjects "camera") > 0) || {!isNull curatorCamera}) exitWith { - TRACE_1("waiting for feature camera to end",GVAR(camera)); - }; - - // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positionCameraToWorld [0, 0, 0]; - GVAR(camera) camSetFov 0.7; - GVAR(camera) camSetTarget ACE_player; - GVAR(camera) camCommit 1; - - QGVAR(rendertarget0) setPiPEffect [0]; - GVAR(camera) cameraEffect ["INTERNAL", "BACK", QGVAR(rendertarget0)]; - - TRACE_2("created new pip camera",GVAR(camera),isNull GVAR(camera)); - - // Start a waitUntil to handle destruction after GVAR(pipLastFrame) is no longer updated - [{ - (abs (diag_frameno - GVAR(pipLastFrame))) > 1 - }, { - GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; - camDestroy GVAR(camera); - TRACE_2("destroyed pip camera",GVAR(camera),isNull GVAR(camera)); - }, []] call CBA_fnc_waitUntilAndExecute; - }; -}; - -//If we are not zoomed into the actual scope (not collimator) -if (!ctrlShown (_display displayCtrl 154)) exitWith { - (_display displayCtrl 1713001) ctrlShow false; - (_display displayCtrl 1713002) ctrlShow false; - (_display displayCtrl 1713005) ctrlShow false; - (_display displayCtrl 1713006) ctrlShow false; - (_display displayCtrl 1713010) ctrlShow false; - (_display displayCtrl 1713011) ctrlShow false; -}; - -if (_isPIP) then { - GVAR(camera) setPosATL positionCameraToWorld [0, 0, 0.4]; - GVAR(camera) camPrepareTarget positionCameraToWorld [0, 0, 50]; - GVAR(camera) camCommitPrepared 0; - - // @todo, check if that needs to be done at all - if (cameraView == "GUNNER") then { - GVAR(camera) camsetFOV 0.7; - GVAR(camera) camcommit 0; - } else { - GVAR(camera) camsetFOV 0.01; - GVAR(camera) camcommit 0; - }; -}; - -// Calculate lighting -private _dayOpacity = call EFUNC(common,ambientBrightness); -private _nightOpacity = parseNumber (_dayOpacity == 1); - -// Apply lighting and make layers visible -(_display displayCtrl 1713001) ctrlSetTextColor [1, 1, 1, 1]; -(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, parseNumber (_dayOpacity < 0.5)]; -(_display displayCtrl 1713005) ctrlSetTextColor [1, 1, 1, _dayOpacity]; -(_display displayCtrl 1713006) ctrlSetTextColor [1, 1, 1, _nightOpacity]; - -/* -(_display displayCtrl 1713001) ctrlCommit 0; -(_display displayCtrl 1713002) ctrlCommit 0; -(_display displayCtrl 1713005) ctrlCommit 0; -(_display displayCtrl 1713006) ctrlCommit 0; - */ - -(_display displayCtrl 1713001) ctrlShow true; -(_display displayCtrl 1713002) ctrlShow true; -(_display displayCtrl 1713005) ctrlShow true; -(_display displayCtrl 1713006) ctrlShow true; -(_display displayCtrl 1713010) ctrlShow _isPIP; -(_display displayCtrl 1713011) ctrlShow _isPIP; diff --git a/addons/optics/models/ace_optics_empty.p3d b/addons/optics/models/ace_optics_empty.p3d deleted file mode 100644 index 89a29d7d8c..0000000000 Binary files a/addons/optics/models/ace_optics_empty.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_pip.p3d b/addons/optics/models/ace_optics_pip.p3d deleted file mode 100644 index 9ec6765294..0000000000 Binary files a/addons/optics/models/ace_optics_pip.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle100.p3d b/addons/optics/models/ace_optics_reticle100.p3d deleted file mode 100644 index b5f58cfd1c..0000000000 Binary files a/addons/optics/models/ace_optics_reticle100.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle70.p3d b/addons/optics/models/ace_optics_reticle70.p3d deleted file mode 100644 index 5aa9e8613a..0000000000 Binary files a/addons/optics/models/ace_optics_reticle70.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle80.p3d b/addons/optics/models/ace_optics_reticle80.p3d deleted file mode 100644 index 55cf233032..0000000000 Binary files a/addons/optics/models/ace_optics_reticle80.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle90.p3d b/addons/optics/models/ace_optics_reticle90.p3d deleted file mode 100644 index 30dc511df9..0000000000 Binary files a/addons/optics/models/ace_optics_reticle90.p3d and /dev/null differ diff --git a/addons/optics/models/ace_shortdot_optics.p3d b/addons/optics/models/ace_shortdot_optics.p3d deleted file mode 100644 index 47b82be4b7..0000000000 Binary files a/addons/optics/models/ace_shortdot_optics.p3d and /dev/null differ diff --git a/addons/optics/reticles/ace_shortdot_reticle_1.paa b/addons/optics/reticles/ace_shortdot_reticle_1.paa deleted file mode 100644 index 6c3d23668a..0000000000 Binary files a/addons/optics/reticles/ace_shortdot_reticle_1.paa and /dev/null differ diff --git a/addons/optics/reticles/ace_shortdot_reticle_2.paa b/addons/optics/reticles/ace_shortdot_reticle_2.paa deleted file mode 100644 index beb7a651c9..0000000000 Binary files a/addons/optics/reticles/ace_shortdot_reticle_2.paa and /dev/null differ diff --git a/addons/optics/reticles/black.rvmat b/addons/optics/reticles/black.rvmat deleted file mode 100644 index 431d76689f..0000000000 --- a/addons/optics/reticles/black.rvmat +++ /dev/null @@ -1,8 +0,0 @@ -ambient[]={0,0,0,0.89999998}; -diffuse[]={0,0,0,0.89999998}; -forcedDiffuse[]={0,0,0,1}; -emmisive[]={0,0,0,1}; -specular[]={0,0,0,0}; -specularPower=1; -PixelShaderID="Normal"; -VertexShaderID="Basic"; diff --git a/addons/optics/reticles/em.rvmat b/addons/optics/reticles/em.rvmat deleted file mode 100644 index a491df4b9a..0000000000 --- a/addons/optics/reticles/em.rvmat +++ /dev/null @@ -1,20 +0,0 @@ -ambient[]={1,1,1,1}; -diffuse[]={1,1,1,1}; -forcedDiffuse[]={0,0,0,0}; -emmisive[]={1,1,1,1}; -specular[]={1,0.99956858,1,1}; -specularPower=1; -PixelShaderID="Normal"; -VertexShaderID="Basic"; -class Stage1 -{ - texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; diff --git a/addons/optics/reticles/scopeblack-100_ca.paa b/addons/optics/reticles/scopeblack-100_ca.paa deleted file mode 100644 index d0232dc0cc..0000000000 Binary files a/addons/optics/reticles/scopeblack-100_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-70_ca.paa b/addons/optics/reticles/scopeblack-70_ca.paa deleted file mode 100644 index 62b06d7f84..0000000000 Binary files a/addons/optics/reticles/scopeblack-70_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-80_ca.paa b/addons/optics/reticles/scopeblack-80_ca.paa deleted file mode 100644 index f74e3e41f1..0000000000 Binary files a/addons/optics/reticles/scopeblack-80_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-90_ca.paa b/addons/optics/reticles/scopeblack-90_ca.paa deleted file mode 100644 index 2240dcc5fe..0000000000 Binary files a/addons/optics/reticles/scopeblack-90_ca.paa and /dev/null differ diff --git a/addons/optics/script_component.hpp b/addons/optics/script_component.hpp index 6cc168aea0..e57cd984b0 100644 --- a/addons/optics/script_component.hpp +++ b/addons/optics/script_component.hpp @@ -16,17 +16,10 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define SCOPE_RECOIL_MIN 0.03 -#define SCOPE_RECOIL_MAX 0.032 - -#define SCOPE_SHIFT_X_MIN 0.04 -#define SCOPE_SHIFT_X_MAX 0.05 -#define SCOPE_SHIFT_Y_MIN -0.02 -#define SCOPE_SHIFT_Y_MAX -0.03 - -#define RETICLE_SHIFT_X_MIN 0.006 -#define RETICLE_SHIFT_X_MAX 0.011 -#define RETICLE_SHIFT_Y_MIN -0.009 -#define RETICLE_SHIFT_Y_MAX -0.014 - -#define RECENTER_TIME 0.09 +#define PRELOAD \ +class CBA_ScriptedOptic {\ + reticleTexture = "*";\ + reticleTextureNight = "*";\ + bodyTexture = "*";\ + bodyTextureNight = "*";\ +} diff --git a/addons/optics/stringtable.xml b/addons/optics/stringtable.xml index 85620ac37c..5433f80509 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -69,7 +69,7 @@ 先進步槍戰鬥光學瞄準鏡(擬真版) ARCO (PIP) - + MRCO (2D) MRCO (2D) MRCO (2D) @@ -86,7 +86,7 @@ 多距離戰鬥瞄準鏡(2D) MRCO (2D) - + MRCO (PIP) MRCO (PIP) MRCO (PIP) diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 811b1eecec..0d9977be7a 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -29,13 +29,6 @@ class CfgAddons { #include "gui\mainMenu.hpp" #include "gui\pauseMenu.hpp" -class ACE_Extensions { - class ace_clipboard { - windows = 1; - client = 1; - }; -}; - class CfgCommands { allowedHTMLLoadURIs[] += { "https://ace3.acemod.org/version.html" diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index 07205dc195..74d18a66d9 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -19,8 +19,7 @@ private _outputText = { diag_log text (_this select 0); - "ace_clipboard" callExtension ((_this select 0) + " -"); + "ace" callExtension ["clipboard:append", [(_this select 0) + endl]]; }; private _text = format ["~~~~~~~~~ACE Debug~~~~~~~~~ @@ -94,4 +93,4 @@ _text = format [" } forEach (allVariables _unit); } forEach allUnits; -"ace_clipboard" callExtension "--COMPLETE--"; +"ace" callExtension ["clipboard:complete", []]; diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index 9232fa3249..0b8087cc13 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -97,17 +97,19 @@ class CfgWeapons { GVAR(closedBolt) = 1; GVAR(jamTypesAllowed)[] = {"Fire", "Dud"}; }; + class ACE_ItemCore; class CBA_MiscItem_ItemInfo; - // Deprecated, 3.16.0 Arsenal supports showing magazines as misc items + // Deprecated, 3.16.0 Arsenal supports showing magazines as misc. items + // However, since base game doesn't support misc. items, it's still needed to filling inventories in the editor class ACE_SpareBarrel_Item: ACE_ItemCore { displayName = CSTRING(SpareBarrelName); author = ECSTRING(common,ACETeam); - scope = 1; + scope = 2; scopeArsenal = 0; - descriptionshort = CSTRING(SpareBarrelDescription); - picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); + descriptionShort = CSTRING(SpareBarrelDescription); + picture = QPATHTOF(UI\spare_barrel_ca.paa); class ItemInfo: CBA_MiscItem_ItemInfo { mass = 25; }; diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 9a5b8b1049..afe6d15e97 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -80,9 +80,11 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private _condition = { private _unit = _this select 1; - [_unit] call CBA_fnc_canUseWeapon - && {currentMuzzle _unit in (_unit getVariable [QGVAR(jammedWeapons), []])} - && {!(currentMuzzle _unit in (_unit getVariable [QEGVAR(safemode,safedWeapons), []]))} + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + _unit call CBA_fnc_canUseWeapon + && {_currentMuzzle in (_unit getVariable [QGVAR(jammedWeapons), []])} + && {!(["ace_safemode"] call EFUNC(common,isModLoaded)) || {!([_unit, _currentWeapon, _currentMuzzle] call EFUNC(safemode,getWeaponSafety))}} }; private _statement = { diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index d5e8ad7ca8..0d3f0dd96e 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -58,6 +58,7 @@ 过热系数 과열 계수 Coeficiente de calentamiento + Coeficiente de aquecimento Coefficient for the amount of heat a weapon generates per shot.\nHigher value increases heat. @@ -70,6 +71,7 @@ 武器每次射击产生的热量系数。\n数值越高,热量越高。 매 발사마다 만들어지는 열에 계수를 적용합니다.\n높은 계수는 더 많은 열을 발생시킵니다. Coeficiente para la cantidad de calor que genera un arma por disparo.\nValores más altos incrementan el calor + Coeficiente da quantidade de calor que um armamento gera por disparo.\nValores mais altos potencializam o aquecimento. Cooling Coefficient @@ -82,6 +84,7 @@ Коэф. остывания Coeficiente de enfriado Coefficient de refroidissement + Coeficiente de resfriamento Coefficient for how quickly a weapon cools down.\nHigher value increases cooling speed. @@ -94,6 +97,7 @@ Коэффициент скорости остывания орудия.\nЧем больше значение, тем быстрее остывает. Coeficiente para cómo de rápido se enfría un arma.\nValores más altos incrementan la velocidad de enfriamiento. Coefficient de rapidité de refroidissement de l'arme.\nUne valeur élevée augmente la vitesse de refroidissement. + Coeficiente que determina o quão rápido a arma resfria.\nValores mais altos potencializam o resfriamento. Suppressor Coefficient @@ -106,6 +110,7 @@ Коэф. глушителя Coeficiente del silenciador Coefficient de suppresion + Coeficiente de supressão Coefficient for how much additional heat is added from having a suppressor attached.\nHigher value increases heat, 0 means no additional heat from the suppressor. diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index 2ce7615ad4..c8a0aa895d 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -52,6 +52,7 @@ Coefficiente distanza di svampata 後方噴射の距離係数 후폭풍 거리 계수 + Multiplicateur de distance de réflexion Scales the backblast effect @@ -60,6 +61,7 @@ Scala l'effetto delle svampate dei lanciarazzi 無反動砲による後方噴射の影響範囲の大きさ 후폭풍 효과의 스케일을 조정합니다 + Multiplicateur de distance de réflexion Backblast range @@ -72,7 +74,7 @@ Дальность реактивной струи Alcance do Sopro de Disparo Utóhatás távolsága - Portée du backblast + Portée du souffle Dosah zpětné tlakové vlny (backblast) Alcance del cono de fuego 후폭풍 거리 @@ -88,7 +90,7 @@ Угол реактивной струи Ângulo do Sopro de Disparo Utóhatás aránya - Angle du backblast + Angle du souffle Úhel zpětné tlakové vlny (backblast) Ángulo del cono de fuego 후폭풍 각도 diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index db48a6109c..b13483dca5 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -146,6 +146,7 @@ 开伞失败率 낙하산 펼치기 실패 확률 Probabilidad de fallo de paracaidas + Probabilidade de falha do paraquedas diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf index 6dbd38742b..30f655edd8 100644 --- a/addons/quickmount/XEH_postInitClient.sqf +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -4,6 +4,6 @@ if (!hasInterface) exitWith {}; ["ACE3 Movement", QGVAR(mount), [LLSTRING(KeybindName), LLSTRING(KeybindDescription)], "", { if (!dialog) then { - call FUNC(getInNearest); + [] call FUNC(getInNearest); }; }] call CBA_fnc_addKeybind; diff --git a/addons/quickmount/config.cpp b/addons/quickmount/config.cpp index d74d99c050..846e5f0543 100644 --- a/addons/quickmount/config.cpp +++ b/addons/quickmount/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/rangecard/config.cpp b/addons/rangecard/config.cpp index f300fb1a30..56ebec629d 100644 --- a/addons/rangecard/config.cpp +++ b/addons/rangecard/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_RangeCard"}; weapons[] = {"ACE_RangeCard"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics","ace_scopes"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_scopes"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index d2347b8494..0663fcfd53 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -65,7 +65,7 @@ private _n = 0; private _range = 0; if (_useABConfig) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]]) select 0); }; private _airFrictionCoef = 1; @@ -99,7 +99,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (_useABConfig) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); + private _drag = parseNumber (("ace" callExtension ["ballistics:retard", [_dragModel, _bc, _trueSpeed, _temperature]]) select 0); _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef); diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index c2c8673844..ba44d7e41c 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -161,11 +161,9 @@ if (_isABenabled) then { private _cacheEntry = missionNamespace getVariable format [QGVAR(%1_%2_%3_%4_%5_%6_%7), _zeroRange, _boreHeight, _ammoClass, _weaponClass, _isABenabled, _useBarrelLengthInfluence, _useAmmoTemperatureInfluence]; if (isNil "_cacheEntry") then { private _scopeBaseAngle = if (!_isABenabled) then { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_zeroRange, _muzzleVelocity, _airFriction, _boreHeight]]) select 0) } else { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_advanced", [_zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]]) select 0) }; if (_useAmmoTemperatureInfluence) then { { diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index be7ce2b2a5..dc5beec603 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -390,12 +390,6 @@ class CfgMagazines { class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { displayName = CSTRING(DemoCharge_Name); }; - class ACE_SatchelCharge_Remote_Mag_Throwable: CA_Magazine { - displayName = CSTRING(SatchelChargeThrowable_Name); - }; - class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable { - displayName = CSTRING(DemoChargeThrowable_Name); - }; // hand grenades class HandGrenade: CA_Magazine { diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 29ac412957..ba95cf147d 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -1,6 +1,5 @@ - class CfgVehicles { - // static weapons + // Static weapons class StaticMGWeapon; class HMG_01_base_F: StaticMGWeapon { displayName = CSTRING(HMG_01_Name); @@ -61,7 +60,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_01_hmg_Name); }; - // punisher + // Punisher class MRAP_02_base_F; class O_MRAP_02_F: MRAP_02_base_F { displayName = CSTRING(MRAP_02_Name); @@ -86,7 +85,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_02_gmg_Name); }; - // strider + // Strider class MRAP_03_base_F; class I_MRAP_03_F: MRAP_03_base_F { displayName = CSTRING(MRAP_03_Name); @@ -102,7 +101,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_03_gmg_Name); }; - // merkava derivates + // Merkava derivates class MBT_01_base_F; class B_MBT_01_base_F: MBT_01_base_F {}; @@ -124,7 +123,7 @@ class CfgVehicles { class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = CSTRING(MBT_01_mlrs_Name); // Fictional name, (probably wrong) hebrew translation of storm. + displayName = CSTRING(MBT_01_mlrs_Name); // Fictional name, (probably wrong) hebrew translation of storm }; // T100 derivates @@ -142,20 +141,20 @@ class CfgVehicles { displayName = CSTRING(MBT_02_arty_Name); }; - // leopard sg + // Leopard 2 SG class I_MBT_03_base_F; class I_MBT_03_cannon_F: I_MBT_03_base_F { displayName = CSTRING(MBT_03_cannon_Name); }; - // tracked apcs + // Tracked apcs class B_APC_Tracked_01_base_F; class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { displayName = CSTRING(APC_Tracked_01_rcws_Name); }; class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = CSTRING(APC_Tracked_01_AA_Name); // Fictional name, (probably wrong) hebrew translation of cheetah. + displayName = CSTRING(APC_Tracked_01_AA_Name); // Fictional name, (probably wrong) hebrew translation of cheetah }; class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { @@ -176,7 +175,7 @@ class CfgVehicles { displayName = CSTRING(APC_tracked_03_cannon_Name); }; - // wheeled apcs + // Wheeled apcs class B_APC_Wheeled_01_base_F; class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { displayName = CSTRING(APC_Wheeled_01_cannon_Name); @@ -199,7 +198,7 @@ class CfgVehicles { displayName = CSTRING(APC_Wheeled_03_cannon_Name); }; - // trucks + // Trucks class Truck_01_base_F; class B_Truck_01_transport_F: Truck_01_base_F { displayName = CSTRING(Truck_01_transport_Name); @@ -317,7 +316,7 @@ class CfgVehicles { displayName = CSTRING(Truck_03_medical_Name); }; - // helicopters + // Helicopters class Heli_Attack_01_base_F; class B_Heli_Attack_01_F: Heli_Attack_01_base_F { displayName = CSTRING(Heli_Attack_01_Name); @@ -398,7 +397,7 @@ class CfgVehicles { displayName = CSTRING(Heli_Transport_02_Name); }; - // planes + // Planes class Plane_CAS_01_base_F; class B_Plane_CAS_01_F: Plane_CAS_01_base_F { displayName = CSTRING(Plane_CAS_01_Name); @@ -438,7 +437,7 @@ class CfgVehicles { displayName = CSTRING(Plane_Fighter_04_Name); }; - // uavs + // UAVs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { displayName = CSTRING(UAV_02_Name); @@ -472,7 +471,177 @@ class CfgVehicles { displayName = CSTRING(UAV_02_Name); }; - // pistols + #include "CfgVehiclesAttachments.hpp" + + // Assault rifles + + // MX + class Weapon_Base_F; + class Weapon_arifle_MX_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_Name); + }; + class Weapon_arifle_MX_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_Black_Name); + }; + class Weapon_arifle_MX_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_Khaki_Name); + }; + + class Weapon_arifle_MXC_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXC_Name); + }; + class Weapon_arifle_MXC_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXC_Black_Name); + }; + class Weapon_arifle_MXC_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXC_Khaki_Name); + }; + + class Weapon_arifle_MX_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_GL_Name); + }; + class Weapon_arifle_MX_GL_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_GL_Black_Name); + }; + class Weapon_arifle_MX_GL_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_GL_Khaki_Name); + }; + + class Weapon_arifle_MX_SW_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_SW_Name); + }; + class Weapon_arifle_MX_SW_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_SW_Black_Name); + }; + class Weapon_arifle_MX_SW_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_SW_Khaki_Name); + }; + + class Weapon_arifle_MXM_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXM_Name); + }; + class Weapon_arifle_MXM_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXM_Black_Name); + }; + class Weapon_arifle_MXM_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXM_Khaki_Name); + }; + + // Katiba + class Weapon_arifle_Katiba_F: Weapon_Base_F { + displayName = CSTRING(arifle_Katiba_Name); + }; + class Weapon_arifle_Katiba_C_F: Weapon_Base_F { + displayName = CSTRING(arifle_Katiba_C_Name); + }; + class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_Katiba_GL_Name); + }; + + // SDAR + class Weapon_arifle_SDAR_F: Weapon_Base_F { + displayName = CSTRING(arifle_SDAR_Name); + }; + + // TAR-21 + class Weapon_arifle_TRG21_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG21_Name); + }; + class Weapon_arifle_TRG20_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG20_Name); + }; + class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG21_GL_Name); + }; + + // F2000 + class Weapon_arifle_Mk20_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20_Name); + }; + class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20_plain_Name); + }; + + class Weapon_arifle_Mk20C_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20C_Name); + }; + class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20C_plain_Name); + }; + + class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20_GL_Name); + }; + class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { + displayName = CSTRING(arifle_Mk20_GL_plain_Name); + }; + + // P90 (1.86) + class Weapon_SMG_03_TR_black: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Black_Name); + }; + class Weapon_SMG_03_TR_khaki: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Khaki_Name); + }; + class Weapon_SMG_03_TR_camo: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Camo_Name); + }; + class Weapon_SMG_03_TR_hex: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Hex_Name); + }; + class Weapon_SMG_03_black: Weapon_Base_F { + displayName = CSTRING(PS90_Black_Name); + }; + class Weapon_SMG_03_khaki: Weapon_Base_F { + displayName = CSTRING(PS90_Khaki_Name); + }; + class Weapon_SMG_03_camo: Weapon_Base_F { + displayName = CSTRING(PS90_Camo_Name); + }; + class Weapon_SMG_03_hex: Weapon_Base_F { + displayName = CSTRING(PS90_Hex_Name); + }; + class Weapon_SMG_03C_TR_black: Weapon_Base_F { + displayName = CSTRING(P90_TR_Black_Name); + }; + class Weapon_SMG_03C_TR_khaki: Weapon_Base_F { + displayName = CSTRING(P90_TR_Khaki_Name); + }; + class Weapon_SMG_03C_TR_camo: Weapon_Base_F { + displayName = CSTRING(P90_TR_Camo_Name); + }; + class Weapon_SMG_03C_TR_hex: Weapon_Base_F { + displayName = CSTRING(P90_TR_Hex_Name); + }; + class Weapon_SMG_03C_black: Weapon_Base_F { + displayName = CSTRING(P90_Black_Name); + }; + class Weapon_SMG_03C_khaki: Weapon_Base_F { + displayName = CSTRING(P90_Khaki_Name); + }; + class Weapon_SMG_03C_camo: Weapon_Base_F { + displayName = CSTRING(P90_Camo_Name); + }; + class Weapon_SMG_03C_hex: Weapon_Base_F { + displayName = CSTRING(P90_Hex_Name); + }; + + // Vector + class Weapon_SMG_01_F: Weapon_Base_F { + displayName = CSTRING(SMG_01_Name); + }; + + // Scorpion + class Weapon_SMG_02_F: Weapon_Base_F { + displayName = CSTRING(SMG_02_Name); + }; + + // CPW + class Weapon_hgun_PDW2000_F: Weapon_Base_F { + displayName = CSTRING(hgun_PDW2000_Name); + }; + + // Pistols class Pistol_Base_F; class Weapon_hgun_P07_F: Pistol_Base_F { displayName = CSTRING(hgun_P07_Name); @@ -498,16 +667,48 @@ class CfgVehicles { displayName = CSTRING(hgun_Pistol_Signal_Name); }; - // rocket launchers - class Launcher_Base_F; - class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = CSTRING(launch_NLAW_Name); + // Machine guns + class Weapon_LMG_Mk200_F: Weapon_Base_F { + displayName = CSTRING(LMG_Mk200_Name); }; + class Weapon_LMG_Zafir_F: Weapon_Base_F { + displayName = CSTRING(LMG_Zafir_Name); + }; + + // Sniper rifles + class Weapon_srifle_EBR_F: Weapon_Base_F { + displayName = CSTRING(srifle_EBR_Name); + }; + + class Weapon_srifle_LRR_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_Name); + }; + class Weapon_srifle_LRR_camo_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_camo_Name); + }; + + class Weapon_srifle_GM6_F: Weapon_Base_F { + displayName = CSTRING(srifle_GM6_Name); + }; + class Weapon_srifle_GM6_camo_F: Weapon_Base_F { + displayName = CSTRING(srifle_GM6_camo_Name); + }; + + class Weapon_srifle_DMR_01_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_01_Name); + }; + + // Rocket launchers + class Launcher_Base_F; class Weapon_launch_RPG32_F: Launcher_Base_F { displayName = CSTRING(launch_RPG32_Name); }; + class Weapon_launch_NLAW_F: Launcher_Base_F { + displayName = CSTRING(launch_NLAW_Name); + }; + /*class Weapon_launch_Titan_F: Launcher_Base_F { displayName = CSTRING(launch_Titan_Name); }; @@ -528,145 +729,20 @@ class CfgVehicles { //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - // rifles - - // MX - class Weapon_Base_F; - class Weapon_arifle_MX_F: Weapon_Base_F { - displayName = CSTRING(arifle_MX_Name); + class Weapon_launch_O_Vorona_brown_F: Launcher_Base_F { + displayName = CSTRING(launch_Vorona_brown); + }; + class Weapon_launch_O_Vorona_green_F: Launcher_Base_F { + displayName = CSTRING(launch_Vorona_green); }; - class Weapon_arifle_MXC_F: Weapon_Base_F { - displayName = CSTRING(arifle_MXC_Name); - }; - - class Weapon_arifle_MX_GL_F: Weapon_Base_F { - displayName = CSTRING(arifle_MX_GL_Name); - }; - - class Weapon_arifle_MX_SW_F: Weapon_Base_F { - displayName = CSTRING(arifle_MX_SW_Name); - }; - - class Weapon_arifle_MXM_F: Weapon_Base_F { - displayName = CSTRING(arifle_MXM_Name); - }; - - // Katiba - class Weapon_arifle_Katiba_F: Weapon_Base_F { - displayName = CSTRING(arifle_Katiba_Name); - }; - - class Weapon_arifle_Katiba_C_F: Weapon_Base_F { - displayName = CSTRING(arifle_Katiba_C_Name); - }; - - class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { - displayName = CSTRING(arifle_Katiba_GL_Name); - }; - - // F2000 - class Weapon_arifle_Mk20_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20_Name); - }; - - class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20_plain_Name); - }; - - class Weapon_arifle_Mk20C_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20C_Name); - }; - - class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20C_plain_Name); - }; - - class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20_GL_Name); - }; - - class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { - displayName = CSTRING(arifle_Mk20_GL_plain_Name); - }; - - // TAR-21 - class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG21_Name); - }; - - class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG20_Name); - }; - - class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG21_GL_Name); - }; - - // sub machine guns - class Weapon_SMG_01_F: Weapon_Base_F { - displayName = CSTRING(SMG_01_Name); - }; - - class Weapon_SMG_02_F: Weapon_Base_F { - displayName = CSTRING(SMG_02_Name); - }; - - class Weapon_SMG_05_F: Weapon_Base_F { - displayName = CSTRING(SMG_05); - }; - - class Weapon_hgun_PDW2000_F: Weapon_Base_F { - displayName = CSTRING(hgun_PDW2000_Name); - }; - - class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = CSTRING(arifle_SDAR_Name); - }; - - // machine guns - class Weapon_LMG_Mk200_F: Weapon_Base_F { - displayName = CSTRING(LMG_Mk200_Name); - }; - - class Weapon_LMG_Zafir_F: Weapon_Base_F { - displayName = CSTRING(LMG_Zafir_Name); - }; - - // sniper rifles - class Weapon_srifle_EBR_F: Weapon_Base_F { - displayName = CSTRING(srifle_EBR_Name); - }; - - class Weapon_srifle_GM6_F: Weapon_Base_F { - displayName = CSTRING(srifle_GM6_Name); - }; - - class Weapon_srifle_GM6_camo_F: Weapon_Base_F { - displayName = CSTRING(srifle_GM6_camo_Name); - }; - - class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = CSTRING(srifle_LRR_Name); - }; - - class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = CSTRING(srifle_LRR_camo_Name); - }; - - class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = CSTRING(srifle_DMR_01_Name); - }; - - // marksmen - /*class Weapon_srifle_DMR_02_F: Weapon_Base_F { + // Marksmen marksman + class Weapon_srifle_DMR_02_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_02); }; - class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_02_camo); }; - class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_02_sniper); }; @@ -674,19 +750,15 @@ class CfgVehicles { class Weapon_srifle_DMR_03_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03); }; - class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_khaki); }; - class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_tan); }; - class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_multicam); }; - class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_woodland); }; @@ -694,7 +766,6 @@ class CfgVehicles { class Weapon_srifle_DMR_04_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_04); }; - class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_04_Tan); }; @@ -702,11 +773,9 @@ class CfgVehicles { class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_blk); }; - class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_hex); }; - class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_tan); }; @@ -714,11 +783,11 @@ class CfgVehicles { class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_06_camo); }; - class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_06_olive); }; + // Marksmen MGs class Weapon_MMG_01_hex_F: Weapon_Base_F { displayName = CSTRING(MMG_01_hex); }; @@ -737,14 +806,58 @@ class CfgVehicles { class Weapon_MMG_02_sand_F: Weapon_Base_F { displayName = CSTRING(MMG_02_sand); - };*/ + }; - //attachments + // Tanks DLC - class Item_Base_F; + // Rooikat 120 (Rhino MGS) + class AFV_Wheeled_01_base_F; + class B_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { + displayName = CSTRING(afv_wheeled_01); + }; + class B_T_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { + displayName = CSTRING(afv_wheeled_01); + }; + class AFV_Wheeled_01_up_base_F; + class B_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { + displayName = CSTRING(afv_wheeled_01_up); + }; + class B_T_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { + displayName = CSTRING(afv_wheeled_01_up); + }; - class Item_acc_flashlight: Item_Base_F { - displayName="UTG Defender 126"; + // T-14 Armata (T-140 Angara) + class MBT_04_cannon_base_F; + class O_MBT_04_cannon_F: MBT_04_cannon_base_F { + displayName = CSTRING(MBT_04_cannon); + }; + class O_T_MBT_04_cannon_F: MBT_04_cannon_base_F { + displayName = CSTRING(MBT_04_cannon); + }; + class MBT_04_command_base_F; // Keep "K" designation for command variant. + class O_MBT_04_command_F: MBT_04_command_base_F { + displayName = CSTRING(MBT_04_command); + }; + class O_T_MBT_04_command_F: MBT_04_command_base_F { + displayName = CSTRING(MBT_04_command); + }; + + // Wiesel 2 (AWC 302 Nyx) + class LT_01_AA_base_F; + class I_LT_01_AA_F: LT_01_AA_base_F { + displayName = CSTRING(LT_01_AA); + }; + class LT_01_AT_base_F; + class I_LT_01_AT_F: LT_01_AT_base_F { + displayName = CSTRING(LT_01_AT); + }; + class LT_01_cannon_base_F; + class I_LT_01_cannon_F: LT_01_cannon_base_F { + displayName = CSTRING(LT_01_cannon); + }; + class LT_01_scout_base_F; + class I_LT_01_scout_F: LT_01_scout_base_F { + displayName = CSTRING(LT_01_scout); }; // APEX/Tanoa @@ -815,54 +928,266 @@ class CfgVehicles { displayName = CSTRING(lsv_02_at); }; - // Rooikat 120 (Rhino MGS) - class AFV_Wheeled_01_base_F; - class B_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { - displayName = CSTRING(afv_wheeled_01); + // Type 115 + class Weapon_arifle_ARX_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_blk_Name); }; - class B_T_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { - displayName = CSTRING(afv_wheeled_01); + class Weapon_arifle_ARX_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_ghex_Name); }; - class AFV_Wheeled_01_up_base_F; - class B_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { - displayName = CSTRING(afv_wheeled_01_up); - }; - class B_T_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { - displayName = CSTRING(afv_wheeled_01_up); + class Weapon_arifle_ARX_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_hex_Name); }; - // T-14 Armata (T-140 Angara) - class MBT_04_cannon_base_F; - class O_MBT_04_cannon_F: MBT_04_cannon_base_F { - displayName = CSTRING(MBT_04_cannon); + // QBZ-95 and variants + class Weapon_arifle_CTAR_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_blk); }; - class O_T_MBT_04_cannon_F: MBT_04_cannon_base_F { - displayName = CSTRING(MBT_04_cannon); + class Weapon_arifle_CTAR_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_ghex); }; - class MBT_04_command_base_F; // Keep "K" designation for command variant. - class O_MBT_04_command_F: MBT_04_command_base_F { - displayName = CSTRING(MBT_04_command); - }; - class O_T_MBT_04_command_F: MBT_04_command_base_F { - displayName = CSTRING(MBT_04_command); + class Weapon_arifle_CTAR_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_hex); }; - // Wiesel 2 (AWC 302 Nyx) - class LT_01_AA_base_F; - class I_LT_01_AA_F: LT_01_AA_base_F { - displayName = CSTRING(LT_01_AA); + class Weapon_arifle_CTAR_GL_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_blk); }; - class LT_01_AT_base_F; - class I_LT_01_AT_F: LT_01_AT_base_F { - displayName = CSTRING(LT_01_AT); + class Weapon_arifle_CTAR_GL_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_ghex); }; - class LT_01_cannon_base_F; - class I_LT_01_cannon_F: LT_01_cannon_base_F { - displayName = CSTRING(LT_01_cannon); - }; - class LT_01_scout_base_F; - class I_LT_01_scout_F: LT_01_scout_base_F { - displayName = CSTRING(LT_01_scout); + class Weapon_arifle_CTAR_GL_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_hex); }; + class Weapon_arifle_CTARS_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_blk); + }; + class Weapon_arifle_CTARS_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_ghex); + }; + class Weapon_arifle_CTARS_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_hex); + }; + + // QBU-88 + class Weapon_srifle_DMR_07_blk_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_blk); + }; + class Weapon_srifle_DMR_07_ghex_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_ghex); + }; + class Weapon_srifle_DMR_07_hex_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_hex); + }; + + // GM6 + class Weapon_srifle_GM6_ghex_F: Weapon_Base_F { + displayName = CSTRING(srifle_GM6_ghex); + }; + + // M249 + class Weapon_LMG_03_F: Weapon_Base_F { + displayName = CSTRING(LMG_03); + }; + + // Intervention + class Weapon_srifle_LRR_tna_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_tna); + }; + + // MP5 + class Weapon_SMG_05_F: Weapon_Base_F { + displayName = CSTRING(SMG_05); + }; + + // HK416 and variants + class Weapon_arifle_SPAR_01_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_blk); + }; + class Weapon_arifle_SPAR_01_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_khk); + }; + class Weapon_arifle_SPAR_01_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_snd); + }; + + class Weapon_arifle_SPAR_01_GL_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_blk); + }; + class Weapon_arifle_SPAR_01_GL_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_khk); + }; + class Weapon_arifle_SPAR_01_GL_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_snd); + }; + + class Weapon_arifle_SPAR_02_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_blk); + }; + class Weapon_arifle_SPAR_02_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_khk); + }; + class Weapon_arifle_SPAR_02_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_snd); + }; + + class Weapon_arifle_SPAR_03_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_blk); + }; + class Weapon_arifle_SPAR_03_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_khk); + }; + class Weapon_arifle_SPAR_03_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_snd); + }; + + // RPG-32 + class Weapon_launch_RPG32_ghex_F: Launcher_Base_F { + displayName = CSTRING(launch_RPG32_ghex); + }; + + // P99 + class Weapon_hgun_P07_khk_F: Pistol_Base_F { + displayName = CSTRING(hgun_P07_khk); + }; + class Weapon_hgun_P07_blk_F: Pistol_Base_F { + displayName = CSTRING(hgun_P07_blk); + }; + + // Makarov + class Weapon_hgun_Pistol_01_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_01); + }; + + // AKM + class Weapon_arifle_AKM_F: Weapon_Base_F { + displayName = CSTRING(arifle_AKM); + }; + + // AKSU + class Weapon_arifle_AKS_F: Weapon_Base_F { + displayName = CSTRING(arifle_AKS); + }; + + // Contact/Livonia + + // CZ 581 Shotgun + class Weapon_sgun_HunterShotgun_01_F: Weapon_Base_F { + displayName = CSTRING(sgun_huntershotgun_01_Name); + }; + class Weapon_sgun_HunterShotgun_01_sawedoff_F: Weapon_Base_F { + displayName = CSTRING(sgun_huntershotgun_sawedoff_01_Name); + }; + + // FNX-45 (Green) + class Weapon_hgun_Pistol_heavy_01_green_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_heavy_01_green_Name); + }; + + // RPG-32 (Green) + class Weapon_launch_RPG32_green_F: Launcher_Base_F { + displayName = CSTRING(launch_RPG32_green_Name); + }; + + // AK15 variants + class Weapon_arifle_AK12_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12); + }; + class Weapon_arifle_AK12_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_lush); + }; + class Weapon_arifle_AK12_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_arid); + }; + + class Weapon_arifle_AK12_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL); + }; + class Weapon_arifle_AK12_GL_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL_lush); + }; + class Weapon_arifle_AK12_GL_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL_arid); + }; + + class Weapon_arifle_AK12U_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U); + }; + class Weapon_arifle_AK12U_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U_lush); + }; + class Weapon_arifle_AK12U_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U_arid); + }; + + class Weapon_arifle_RPK12_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12); + }; + class Weapon_arifle_RPK12_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12_lush); + }; + class Weapon_arifle_RPK12_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12_arid); + }; + + // M14 (Classic) + class Weapon_srifle_DMR_06_hunter_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_06_hunter); + }; + + // Stoner 99 LMG (Black) + class Weapon_LMG_Mk200_black_F: Weapon_Base_F { + displayName = CSTRING(LMG_Mk200_black); + }; + + // MSBS Grot variants + class Weapon_arifle_MSBS65_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65); + }; + class Weapon_arifle_MSBS65_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_black); + }; + class Weapon_arifle_MSBS65_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_camo); + }; + class Weapon_arifle_MSBS65_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_sand); + }; + class Weapon_arifle_MSBS65_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL); + }; + class Weapon_arifle_MSBS65_GL_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_black); + }; + class Weapon_arifle_MSBS65_GL_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_camo); + }; + class Weapon_arifle_MSBS65_GL_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_sand); + }; + class Weapon_arifle_MSBS65_Mark_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark); + }; + class Weapon_arifle_MSBS65_Mark_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_black); + }; + class Weapon_arifle_MSBS65_Mark_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_camo); + }; + class Weapon_arifle_MSBS65_Mark_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_sand); + }; + class Weapon_arifle_MSBS65_UBS_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS); + }; + class Weapon_arifle_MSBS65_UBS_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_black); + }; + class Weapon_arifle_MSBS65_UBS_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_camo); + }; + class Weapon_arifle_MSBS65_UBS_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_sand); + }; }; diff --git a/addons/realisticnames/CfgVehiclesAttachments.hpp b/addons/realisticnames/CfgVehiclesAttachments.hpp new file mode 100644 index 0000000000..54e6206fe3 --- /dev/null +++ b/addons/realisticnames/CfgVehiclesAttachments.hpp @@ -0,0 +1,146 @@ +// Attachments +class Item_Base_F; +class Item_acc_flashlight: Item_Base_F { + displayName = CSTRING(flashlight_Name); +}; + +class Item_optic_MRD: Item_Base_F { + displayName = CSTRING(optic_mrd_Name); +}; +class Item_optic_MRD_black: Item_Base_F { + displayName = CSTRING(optic_mrd_black_Name); +}; + +class Item_optic_Hamr: Item_Base_F { + displayName = CSTRING(optic_hamr); +}; +class Item_optic_Hamr_khk_F: Item_Base_F { + displayName = CSTRING(optic_hamr_khk); +}; + +class Item_optic_Arco: Item_Base_F { + displayName = CSTRING(optic_arco); +}; +class Item_optic_Arco_blk_F: Item_Base_F { + displayName = CSTRING(optic_arco_blk); +}; +class Item_optic_Arco_ghex_F: Item_Base_F { + displayName = CSTRING(optic_arco_ghex); +}; +class Item_optic_Arco_lush_F: Item_Base_F { + displayName = CSTRING(optic_arco_lush); +}; +class Item_optic_Arco_arid_F: Item_Base_F { + displayName = CSTRING(optic_arco_arid); +}; +class Item_optic_Arco_AK_blk_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_blk); +}; +class Item_optic_Arco_AK_lush_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_lush); +}; +class Item_optic_Arco_AK_arid_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_arid); +}; + +class Item_optic_ERCO_blk_f: Item_Base_F { + displayName = CSTRING(optic_erco_blk); +}; +class Item_optic_ERCO_khk_f: Item_Base_F { + displayName = CSTRING(optic_erco_khk); +}; +class Item_optic_ERCO_snd_f: Item_Base_F { + displayName = CSTRING(optic_erco_snd); +}; + +class Item_optic_LRPS: Item_Base_F { + displayName = CSTRING(optic_lrps); +}; +class Item_optic_LRPS_ghex_F: Item_Base_F { + displayName = CSTRING(optic_lrps_ghex); +}; +class Item_optic_LRPS_tna_F: Item_Base_F { + displayName = CSTRING(optic_lrps_tna); +}; + +class Item_optic_AMS: Item_Base_F { + displayName = CSTRING(optic_ams); +}; +class Item_optic_AMS_khk: Item_Base_F { + displayName = CSTRING(optic_ams_khk); +}; +class Item_optic_AMS_snd: Item_Base_F { + displayName = CSTRING(optic_ams_snd); +}; + +class Item_optic_KHS_blk: Item_Base_F { + displayName = CSTRING(optic_khs_blk); +}; +class Item_optic_KHS_hex: Item_Base_F { + displayName = CSTRING(optic_khs_hex); +}; +class Item_optic_KHS_old: Item_Base_F { + displayName = CSTRING(optic_khs_old); +}; +class Item_optic_KHS_tan: Item_Base_F { + displayName = CSTRING(optic_khs_tan); +}; + +class Item_optic_DMS: Item_Base_F { + displayName = CSTRING(optic_dms); +}; +class Item_optic_DMS_ghex_F: Item_Base_F { + displayName = CSTRING(optic_dms_ghex); +}; +class Item_optic_DMS_weathered_F: Item_Base_F { + displayName = CSTRING(optic_dms_weathered); +}; +class Item_optic_DMS_weathered_Kir_F: Item_Base_F { + displayName = CSTRING(optic_dms_weathered_kir); +}; + +class Item_optic_holosight: Item_Base_F { + displayName = CSTRING(optic_holosight); +}; +class Item_optic_Holosight_blk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_blk); +}; +class Item_optic_Holosight_khk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_khk); +}; +class Item_optic_Holosight_lush_F: Item_Base_F { + displayName = CSTRING(optic_holosight_lush); +}; +class Item_optic_Holosight_arid_F: Item_Base_F { + displayName = CSTRING(optic_holosight_arid); +}; +class Item_optic_Holosight_smg: Item_Base_F { + displayName = CSTRING(optic_holosight_smg); +}; +class Item_optic_Holosight_smg_blk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_smg_blk); +}; +class Item_optic_Holosight_smg_khk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_smg_khk); +}; + +class Item_optic_MRCO: Item_Base_F { + displayName = CSTRING(optic_MRCO); +}; + +class Item_optic_Yorris: Item_Base_F { + displayName = CSTRING(optic_Yorris); +}; + +class Item_optic_ACO: Item_Base_F { + displayName = CSTRING(optic_ACO); +}; +class Item_optic_ACO_grn: Item_Base_F { + displayName = CSTRING(optic_ACO_grn); +}; +class Item_optic_ACO_smg: Item_Base_F { + displayName = CSTRING(optic_ACO_smg); +}; +class Item_optic_ACO_grn_smg: Item_Base_F { + displayName = CSTRING(optic_ACO_grn_smg); +}; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 5b0e33e98c..c515cf08fc 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -2,8 +2,9 @@ class Mode_SemiAuto; class Mode_FullAuto; class CfgWeapons { - #include "Attachments.hpp" - // assault rifles + #include "CfgWeaponsAttachments.hpp" + + // Assault rifles // MX class arifle_MX_Base_F; @@ -176,13 +177,13 @@ class CfgWeapons { displayName = CSTRING(SMG_02_Name); }; - // PDW 2000 + // CPW class pdw2000_base_F; class hgun_pdw2000_F: pdw2000_base_F { displayName = CSTRING(hgun_PDW2000_Name); }; - // pistols + // Pistols class Pistol_Base_F; class hgun_P07_F: Pistol_Base_F { displayName = CSTRING(hgun_P07_Name); @@ -208,7 +209,7 @@ class CfgWeapons { displayName = CSTRING(hgun_Pistol_Signal_Name); }; - // machine guns + // Machine guns class Rifle_Long_Base_F; class LMG_Mk200_F: Rifle_Long_Base_F { displayName = CSTRING(LMG_Mk200_Name); @@ -218,7 +219,7 @@ class CfgWeapons { displayName = CSTRING(LMG_Zafir_Name); }; - // sniper rifles + // Sniper rifles class EBR_base_F; class srifle_EBR_F: EBR_base_F { displayName = CSTRING(srifle_EBR_Name); @@ -245,7 +246,7 @@ class CfgWeapons { displayName = CSTRING(srifle_DMR_01_Name); }; - // launchers + // Launchers class Launcher_Base_F; class launch_RPG32_F: Launcher_Base_F { displayName = CSTRING(launch_RPG32_Name); @@ -270,42 +271,35 @@ class CfgWeapons { displayName = CSTRING(launch_Vorona_green); }; - // marksmen marksman + // Marksmen marksman class DMR_02_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_02); //MAR-10 .338; }; - class srifle_DMR_02_F: DMR_02_base_F { displayName = CSTRING(srifle_DMR_02); //MAR-10 .338 (Black); }; - class srifle_DMR_02_camo_F: srifle_DMR_02_F { displayName = CSTRING(srifle_DMR_02_camo); //MAR-10 .338 (Camo); }; - class srifle_DMR_02_sniper_F: srifle_DMR_02_F { displayName = CSTRING(srifle_DMR_02_sniper); //MAR-10 .338 (Sand); }; + class DMR_03_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_03); //Mk-I EMR 7.62 mm; }; - class srifle_DMR_03_F: DMR_03_base_F { displayName = CSTRING(srifle_DMR_03); //Mk-I EMR 7.62 mm (Black); }; - class srifle_DMR_03_khaki_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_khaki); //Mk-I EMR 7.62 mm (Khaki); }; - class srifle_DMR_03_tan_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_tan); //Mk-I EMR 7.62 mm (Sand); }; - class srifle_DMR_03_multicam_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_multicam); //Mk-I EMR 7.62 mm (Camo); }; - class srifle_DMR_03_woodland_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_woodland); //Mk-I EMR 7.62 mm (Woodland); }; @@ -313,11 +307,9 @@ class CfgWeapons { class DMR_04_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_04); //ASP-1 Kir 12.7 mm; }; - class srifle_DMR_04_F: DMR_04_base_F { displayName = CSTRING(srifle_DMR_04); //ASP-1 Kir 12.7 mm (Black); }; - class srifle_DMR_04_Tan_F: srifle_DMR_04_F { displayName = CSTRING(srifle_DMR_04_Tan); //ASP-1 Kir 12.7 mm (Tan); }; @@ -325,31 +317,27 @@ class CfgWeapons { class DMR_05_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_05); //Cyrus 9.3 mm; }; - class srifle_DMR_05_blk_F: DMR_05_base_F { displayName = CSTRING(srifle_DMR_05_blk); //Cyrus 9.3 mm (Black) }; - class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F { displayName = CSTRING(srifle_DMR_05_hex); //Cyrus 9.3 mm (Hex); }; - class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { displayName = CSTRING(srifle_DMR_05_tan); //Cyrus 9.3 mm (Tan); }; + class DMR_06_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_06); //Mk14 7.62 mm; }; - class srifle_DMR_06_camo_F: DMR_06_base_F { displayName = CSTRING(srifle_DMR_06_camo); //Mk14 7.62 mm (Camo) }; - class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F { displayName = CSTRING(srifle_DMR_06_olive); //Mk14 7.62 mm (Olive); }; - // marksmen mgs + // Marksmen MGs class MMG_01_base_F: Rifle_Long_Base_F { displayName = CSTRING(MMG_01); //Navid 9.3 mm; }; @@ -377,15 +365,12 @@ class CfgWeapons { displayName = CSTRING(MMG_02_sand); //SPMG .338 (Sand); }; - // vehicle weapons + // Vehicle weapons - // gatlings + // Gatlings class CannonCore; class gatling_20mm: CannonCore { - //displayName = ""; - class manual: CannonCore { - //displayName = ""; - }; + class manual; }; class Twin_Cannon_20mm: gatling_20mm { displayName = "Plamen PL-20"; @@ -415,7 +400,7 @@ class CfgWeapons { }; }; - // missiles + // Missiles class RocketPods; class Missile_AA_04_Plane_CAS_01_F: RocketPods { displayName = "AIM-9 Sidewinder"; @@ -438,7 +423,7 @@ class CfgWeapons { displayName = CSTRING(missiles_vorona); }; - // rockets + // Rockets class Rocket_04_HE_Plane_CAS_01_F: RocketPods { displayName = "Hydra 70"; class Burst: RocketPods { @@ -469,7 +454,7 @@ class CfgWeapons { }; }; - // more missiles + // More missiles class missiles_DAR: RocketPods { displayName = "Hydra 70"; class Burst: RocketPods { @@ -492,17 +477,17 @@ class CfgWeapons { displayName = "AIM-120A AMRAAM"; }; - class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on + class missiles_SCALPEL: RocketPods { // According to zGuba, this is what it's based on displayName = "9K121 Vikhr"; }; - // bomb + // Bomb class Bomb_04_Plane_CAS_01_F; class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { displayName = "FAB-250M-54"; }; - // machine guns + // Machine guns class MGunCore; class M134_minigun: MGunCore { displayName = "2x M134 Minigun"; @@ -532,11 +517,6 @@ class CfgWeapons { }; }; - class HMG_127_APC: HMG_127 {}; - class ACE_HMG_127_KORD: HMG_127_APC { - displayName = "6P49 Kord"; - }; - class HMG_01: HMG_127 { displayName = "XM312"; }; @@ -551,7 +531,7 @@ class CfgWeapons { }; }; - // grenade launchers + // Grenade launchers class GMG_F; class GMG_20mm: GMG_F { displayName = "XM307"; @@ -567,7 +547,7 @@ class CfgWeapons { }; }; - // autocannons + // Autocannons class autocannon_35mm: CannonCore { displayName = "GDF-001"; class manual: CannonCore { @@ -575,7 +555,7 @@ class CfgWeapons { }; }; - // aa missiles + // AA missiles class missiles_titan: MissileLauncher { displayName = "Mini-Spike"; }; @@ -584,17 +564,17 @@ class CfgWeapons { displayName = "FIM-92F"; }; - // mortar + // Nortar class mortar_155mm_AMOS: CannonCore { displayName = "L/52"; }; - // artillery rockets + // Artillery rockets class rockets_230mm_GAT: RocketPods { displayName = "M269"; }; - // tank guns + // Tank guns class cannon_120mm: CannonCore { class player; displayName = "MG251"; @@ -605,10 +585,6 @@ class CfgWeapons { class player: player {}; }; - class ACE_cannon_120mm_GT12: cannon_120mm { - displayName = "GT12"; - }; - class cannon_105mm: CannonCore { displayName = "M68"; class player: Mode_SemiAuto { @@ -624,28 +600,12 @@ class CfgWeapons { displayName = "2A82-1M"; }; - // coax machine guns + // Coax machine guns class LMG_coax: LMG_RCWS { displayName = "PKT"; }; - class LMG_coax_ext: LMG_coax {}; - class ACE_LMG_coax_ext_MAG58: LMG_coax_ext { - displayName = "MAG 58M"; - }; - class ACE_LMG_coax_MAG58_mem3: LMG_coax { - displayName = "MAG 58M"; - }; - class ACE_LMG_coax_L94A1_mem3: LMG_coax { - displayName = "L94A1"; - }; - class ACE_LMG_coax_ext_MG3: LMG_coax_ext { - displayName = "Rheinmetall MG3"; - }; - class ACE_LMG_coax_DenelMG4: LMG_coax { - displayName = "Denel MG4"; - }; - // more autocannons + // More autocannons class autocannon_Base_F; class autocannon_40mm_CTWS: autocannon_Base_F { displayName = "Mk44 Bushmaster II"; @@ -694,20 +654,6 @@ class CfgWeapons { displayName = "2A42"; }; - class cannon_20mm: autocannon_Base_F { - class AP: autocannon_Base_F {}; - class HE: autocannon_Base_F {}; - }; - class ACE_cannon_20mm_Rh202: cannon_20mm { - displayName = "MK20 Rh 202"; - class AP: AP { - displayName = "MK20 Rh 202"; - }; - class HE: HE { - displayName = "MK20 Rh 202"; - }; - }; - // APEX/Tanoa // Type 115 diff --git a/addons/realisticnames/Attachments.hpp b/addons/realisticnames/CfgWeaponsAttachments.hpp similarity index 84% rename from addons/realisticnames/Attachments.hpp rename to addons/realisticnames/CfgWeaponsAttachments.hpp index a861bb4a04..c23559b702 100644 --- a/addons/realisticnames/Attachments.hpp +++ b/addons/realisticnames/CfgWeaponsAttachments.hpp @@ -1,7 +1,5 @@ -//attachments - +// Attachments class ItemCore; - class acc_flashlight: ItemCore { displayName = CSTRING(flashlight_Name); }; @@ -19,12 +17,6 @@ class optic_Hamr: ItemCore { class optic_Hamr_khk_F: optic_Hamr { displayName = CSTRING(optic_hamr_khk); }; -class ACE_optic_Hamr_2D: optic_Hamr { - displayName = CSTRING(optic_hamr_2d); -}; -class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { - displayName = CSTRING(optic_hamr_pip); -}; class optic_Arco: ItemCore { displayName = CSTRING(optic_arco); @@ -35,12 +27,6 @@ class optic_Arco_blk_F: optic_Arco { class optic_Arco_ghex_F: optic_Arco { displayName = CSTRING(optic_arco_ghex); }; -class ACE_optic_Arco_2D: optic_Arco { - displayName = CSTRING(optic_arco_2d); -}; -class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { - displayName = CSTRING(optic_arco_pip); -}; class optic_Arco_lush_F: optic_Arco { displayName = CSTRING(optic_arco_lush); }; @@ -76,12 +62,6 @@ class optic_LRPS_ghex_F: optic_LRPS { class optic_LRPS_tna_F: optic_LRPS { displayName = CSTRING(optic_lrps_tna); }; -class ACE_optic_LRPS_2D: optic_LRPS { - displayName = CSTRING(optic_lrps_2d); -}; -class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { - displayName = CSTRING(optic_lrps_pip); -}; class optic_AMS_base; class optic_AMS: optic_AMS_base { @@ -149,12 +129,6 @@ class optic_Holosight_smg_khk_F: optic_Holosight_smg { class optic_MRCO: ItemCore { displayName = CSTRING(optic_MRCO); }; -class ACE_optic_MRCO_2D: optic_MRCO { - displayName = CSTRING(optic_MRCO_2d); -}; -class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { - displayName = CSTRING(optic_MRCO_pip); -}; class optic_Yorris: ItemCore { displayName = CSTRING(optic_Yorris); diff --git a/addons/realisticnames/compat_explosives/CfgMagazines.hpp b/addons/realisticnames/compat_explosives/CfgMagazines.hpp new file mode 100644 index 0000000000..41a19345db --- /dev/null +++ b/addons/realisticnames/compat_explosives/CfgMagazines.hpp @@ -0,0 +1,9 @@ +class CfgMagazines { + class CA_Magazine; + class ACE_SatchelCharge_Remote_Mag_Throwable: CA_Magazine { + displayName = CSTRING(SatchelChargeThrowable_Name); + }; + class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable { + displayName = CSTRING(DemoChargeThrowable_Name); + }; +}; diff --git a/addons/realisticnames/compat_explosives/CfgVehicles.hpp b/addons/realisticnames/compat_explosives/CfgVehicles.hpp new file mode 100644 index 0000000000..e22068161a --- /dev/null +++ b/addons/realisticnames/compat_explosives/CfgVehicles.hpp @@ -0,0 +1,29 @@ +class CfgVehicles { + class ACE_Explosives_Place; + class ACE_Explosives_Place_DemoCharge: ACE_Explosives_Place { + displayName = CSTRING(DemoCharge_Name); + }; + class ACE_Explosives_Place_APERSBoundingMine: ACE_Explosives_Place { + displayName = CSTRING(APERSBoundingMine_Name); + }; + class ACE_Explosives_Place_APERSMine: ACE_Explosives_Place { + displayName = CSTRING(APERSMine_Name); + }; + class ACE_Explosives_Place_APERSTripwireMine: ACE_Explosives_Place { + displayName = CSTRING(APERSTripwireMine_Name); + }; + class ACE_Explosives_Place_ATMine: ACE_Explosives_Place { + displayName = CSTRING(ATMine_Name); + }; + class ACE_Explosives_Place_Claymore: ACE_Explosives_Place { + displayName = CSTRING(Claymore_Name); + }; + class ACE_Explosives_Place_SatchelCharge: ACE_Explosives_Place { + displayName = CSTRING(SatchelCharge_Name); + }; + + // Orange DLC + class ACE_Explosives_Place_SLAM: ACE_Explosives_Place { + displayName = CSTRING(SLAM_Name); + }; +}; diff --git a/addons/realisticnames/compat_explosives/config.cpp b/addons/realisticnames/compat_explosives/config.cpp new file mode 100644 index 0000000000..208bc7e791 --- /dev/null +++ b/addons/realisticnames/compat_explosives/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_explosives"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/realisticnames/compat_explosives/script_component.hpp b/addons/realisticnames/compat_explosives/script_component.hpp new file mode 100644 index 0000000000..a697aad7f3 --- /dev/null +++ b/addons/realisticnames/compat_explosives/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT explosives +#define SUBCOMPONENT_BEAUTIFIED Explosives +#include "..\script_component.hpp" diff --git a/addons/realisticnames/compat_optics/CfgWeapons.hpp b/addons/realisticnames/compat_optics/CfgWeapons.hpp new file mode 100644 index 0000000000..6ffd6484b2 --- /dev/null +++ b/addons/realisticnames/compat_optics/CfgWeapons.hpp @@ -0,0 +1,33 @@ +class CfgWeapons { + class optic_Hamr; + class ACE_optic_Hamr_2D: optic_Hamr { + displayName = CSTRING(optic_hamr_2d); + }; + class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { + displayName = CSTRING(optic_hamr_pip); + }; + + class optic_Arco; + class ACE_optic_Arco_2D: optic_Arco { + displayName = CSTRING(optic_arco_2d); + }; + class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { + displayName = CSTRING(optic_arco_pip); + }; + + class optic_LRPS; + class ACE_optic_LRPS_2D: optic_LRPS { + displayName = CSTRING(optic_lrps_2d); + }; + class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { + displayName = CSTRING(optic_lrps_pip); + }; + + class optic_MRCO; + class ACE_optic_MRCO_2D: optic_MRCO { + displayName = CSTRING(optic_MRCO_2d); + }; + class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { + displayName = CSTRING(optic_MRCO_pip); + }; +}; diff --git a/addons/realisticnames/compat_optics/config.cpp b/addons/realisticnames/compat_optics/config.cpp new file mode 100644 index 0000000000..32d2795dd9 --- /dev/null +++ b/addons/realisticnames/compat_optics/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_optics"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/realisticnames/compat_optics/script_component.hpp b/addons/realisticnames/compat_optics/script_component.hpp new file mode 100644 index 0000000000..b90538fc4e --- /dev/null +++ b/addons/realisticnames/compat_optics/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT optics +#define SUBCOMPONENT_BEAUTIFIED Optics +#include "..\script_component.hpp" diff --git a/addons/realisticnames/compat_vehicles/CfgWeapons.hpp b/addons/realisticnames/compat_vehicles/CfgWeapons.hpp new file mode 100644 index 0000000000..c49ae26bcb --- /dev/null +++ b/addons/realisticnames/compat_vehicles/CfgWeapons.hpp @@ -0,0 +1,45 @@ +class CfgWeapons { + class HMG_127_APC; + class ACE_HMG_127_KORD: HMG_127_APC { + displayName = "6P49 Kord"; + }; + + class cannon_120mm; + class ACE_cannon_120mm_GT12: cannon_120mm { + displayName = "GT12"; + }; + + class LMG_coax_ext; + class ACE_LMG_coax_ext_MG3: LMG_coax_ext { + displayName = "Rheinmetall MG3"; + }; + class ACE_LMG_coax_ext_MAG58: LMG_coax_ext { + displayName = "MAG 58M"; + }; + + class LMG_coax; + class ACE_LMG_coax_MAG58_mem3: LMG_coax { + displayName = "MAG 58M"; + }; + class ACE_LMG_coax_L94A1_mem3: LMG_coax { + displayName = "L94A1"; + }; + class ACE_LMG_coax_DenelMG4: LMG_coax { + displayName = "Denel MG4"; + }; + + class autocannon_Base_F; + class cannon_20mm: autocannon_Base_F { + class AP: autocannon_Base_F {}; + class HE: autocannon_Base_F {}; + }; + class ACE_cannon_20mm_Rh202: cannon_20mm { + displayName = "MK20 Rh 202"; + class AP: AP { + displayName = "MK20 Rh 202"; + }; + class HE: HE { + displayName = "MK20 Rh 202"; + }; + }; +}; diff --git a/addons/realisticnames/compat_vehicles/config.cpp b/addons/realisticnames/compat_vehicles/config.cpp new file mode 100644 index 0000000000..846c92a0ee --- /dev/null +++ b/addons/realisticnames/compat_vehicles/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_vehicles"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/realisticnames/compat_vehicles/script_component.hpp b/addons/realisticnames/compat_vehicles/script_component.hpp new file mode 100644 index 0000000000..17370c415f --- /dev/null +++ b/addons/realisticnames/compat_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/realisticnames/dev_dumpPylon.sqf b/addons/realisticnames/dev_dumpPylon.sqf index df0d7ea4a5..4bb10a84fb 100644 --- a/addons/realisticnames/dev_dumpPylon.sqf +++ b/addons/realisticnames/dev_dumpPylon.sqf @@ -22,7 +22,7 @@ private _magazines = configProperties [configFile >> "CfgMagazines", "isClass _x diag_log text format ['class %1;', configName inheritsFrom _x]; diag_log text format ['class %1: %2 {', configName _x, configName inheritsFrom _x]; diag_log text format ['displayName = "%1"; [vanilla: %2 - %3]', _weaponName, _pylonMagName, _pylonWeapon]; - diag_log text format ['};', configName _x, configName inheritsFrom _x, _weaponName, _pylonMagName]; + diag_log text format ['};']; }; }; }; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index af864f64df..bf5110de7a 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -706,6 +706,7 @@ 카마즈 급수 KamAS Wasser KamAZ Acqua + KamAZ Eau KamAZ MRL @@ -1324,7 +1325,7 @@ Demoliční nálož M183 M183 Charge de démolition M183 комплектный подрывной заряд - M183 Sacola de Demolição + M183 Conjunto de Carga de Demolição M183 romboló töltet M183 Carica da Demolizioni M183 梱包爆薬 @@ -1345,6 +1346,7 @@ M183 Geballte Sprengladung (Werfbar) M183 炸药包(可投掷) M183 폭파 장약 (투척) + M183 Carga de Demolição (Arremessável) M112 Demolition Block @@ -1375,6 +1377,7 @@ M112 Sprengladung (Werfbar) M112 塑性炸药(可投掷) M112 폭파 장약 (투척) + M112 Carga de Demolição (Arremessável) M67 Fragmentation Grenade @@ -1672,6 +1675,7 @@ CZ 581 CZ 581 CZ 581 + CZ 581 CZ 581 (Sawed-Off) @@ -1681,6 +1685,7 @@ CZ 581 (소드오프) CZ 581 (Abgesägt) CZ 581 (Canne mozze) + CZ 581 (canon scié) FNX-45 Tactical (Green) @@ -2731,7 +2736,7 @@ ASP-1 Kir (Tan) ASP-1 Kir (Žlutohnědá) - ASP-1 Kir (Tan) + ASP-1 Kir (Marron) ASP-1 Kir (Tan) ASP-1 Kir (пустынный) ASP-1 Kir (Hellbraun) @@ -3091,6 +3096,7 @@ 115식 보총 (검정) Type 115 (Schwarz) Type 115 (Nero) + Type 115 (Noir) Type 115 (Green Hex) @@ -3100,6 +3106,7 @@ 115식 보총 (초록육각) Type 115 (Hex Grün) Type 115 (Hex Verde) + Type 115 (Hew Vert) Type 115 (Hex) @@ -3109,6 +3116,7 @@ 115식 보총 (육각) Type 115 (Hex) Type 115 (Hex) + Type 115 (Hex) QBZ-95-1 (Black) @@ -3902,6 +3910,7 @@ UTG 디펜더 126 UTG Defender 126 UTG Defender 126 + UTG Defender 126 EOTech MRDS @@ -3911,6 +3920,7 @@ 이오텍 MRDS EOTech MRDS EOTech MRDS + EOTech MRDS EOTech MRDS (Black) @@ -3920,6 +3930,7 @@ 이오텍 MRDS (검정) EOTech MRDS (Schwarz) EOTech MRDS (Nero) + EOTech MRDS (Noir) Leupold Mark 4 HAMR @@ -4076,6 +4087,7 @@ 엘칸 스펙터OS (초목) ELCAN SpecterOS (обильная растительность) ELCAN SpecterOS (Exuberante) + ELCAN SpecterOS (Exuberante) ELCAN SpecterOS (Arid) @@ -4088,6 +4100,7 @@ 엘칸 스펙터OS (건조) ELCAN SpecterOS (сухая местность) ELCAN SpecterOS (Árido) + ELCAN SpecterOS (Árido) ELCAN SpecterOS 7.62 (Black) @@ -4100,6 +4113,7 @@ 엘칸 스펙터OS 7.62 (검정) ELCAN SpecterOS 7.62 (чёрный) ELCAN SpecterOS 7.62 (Negro) + ELCAN SpecterOS 7.62 (Preto) ELCAN SpecterOS 7.62 (Lush) @@ -4112,6 +4126,7 @@ 엘칸 스펙터OS 7.62 (초목) ELCAN SpecterOS 7.62 (обильная растительность) ELCAN SpecterOS 7.62 (Exuberante) + ELCAN SpecterOS 7.62 (Exuberante) ELCAN SpecterOS 7.62 (Arid) @@ -4124,6 +4139,7 @@ 엘칸 스펙터OS 7.62 (건조) ELCAN SpecterOS 7.62 (сухая местность) ELCAN SpecterOS 7.62 (Árido) + ELCAN SpecterOS 7.62 (Árido) SIG BRAVO4 / ROMEO3 (Black) @@ -4408,6 +4424,7 @@ 버리스 XTR II (낡음) Burris XTR II (старый) Burris XTR II (Viejo) + Burris XTR II (Velho) Burris XTR II (ASP-1 Kir) @@ -4420,6 +4437,7 @@ 버리스 XTR II (ASP-1 키르용) Burris XTR II (ASP-1 Kir) Burris XTR II (ASP-1 Kir) + Burris XTR II (ASP-1 Kir) EOTech XPS3 (Tan) @@ -4480,6 +4498,7 @@ 이오텍 XPS3 (초목) EOTech XPS3 (обильная растительность) EOTech XPS3 (Exuberante) + EOTech XPS3 (Exuberante) EOTech XPS3 (Arid) @@ -4492,6 +4511,7 @@ 이오텍 XPS3 (건조) EOTech XPS3 (сухая местность) EOTech XPS3 (Árido) + EOTech XPS3 (Árido) EOTech XPS3 SMG (Tan) diff --git a/addons/realisticweights/config.cpp b/addons/realisticweights/config.cpp index 91c1ea00aa..ebd919fc49 100644 --- a/addons/realisticweights/config.cpp +++ b/addons/realisticweights/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/realisticweights/script_component.hpp b/addons/realisticweights/script_component.hpp index fcdb345068..bf7173a3e7 100644 --- a/addons/realisticweights/script_component.hpp +++ b/addons/realisticweights/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT realisticweights +#define COMPONENT_BEAUTIFIED Realistic Weights #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL diff --git a/addons/rearm/functions/fnc_dropAmmo.sqf b/addons/rearm/functions/fnc_dropAmmo.sqf index af4b74ee77..ba89c9cd91 100644 --- a/addons/rearm/functions/fnc_dropAmmo.sqf +++ b/addons/rearm/functions/fnc_dropAmmo.sqf @@ -38,8 +38,8 @@ if (_actionID != -1) then { _unit removeAction _actionID; _unit setVariable [QGVAR(ReleaseActionID), nil]; }; -[_unit, "forceWalk", "ACE_rearm", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); if (_unholster) then { REARM_UNHOLSTER_WEAPON diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index d355485309..b8c53371d8 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -19,8 +19,8 @@ params ["_dummy", "_unit"]; REARM_HOLSTER_WEAPON; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [ TIME_PROGRESSBAR(5), diff --git a/addons/rearm/functions/fnc_rearm.sqf b/addons/rearm/functions/fnc_rearm.sqf index 81f467a5ca..8ef09c8f76 100644 --- a/addons/rearm/functions/fnc_rearm.sqf +++ b/addons/rearm/functions/fnc_rearm.sqf @@ -20,9 +20,9 @@ params ["_target", "_unit"]; TRACE_2("rearm",_target,_unit); private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _attachedDummy) exitwith {ERROR_1("attachedDummy null",_attachedDummy);}; +if (isNull _attachedDummy) exitwith {ERROR_1("attachedDummy null %1",_attachedDummy);}; private _magazineClass = _attachedDummy getVariable QGVAR(magazineClass); -if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil",_attachedDummy);}; +if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil %1",_attachedDummy);}; ([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 717d549b86..1d112f2645 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -36,8 +36,8 @@ if (_vehicle == _unit) exitWith { [_unit, _magazineClass, _rounds] call EFUNC(csw,reload_handleReturnAmmo); }; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); private _dummy = [_unit, _magazineClass] call FUNC(createDummy); [_dummy, _unit] call FUNC(pickUpAmmo); diff --git a/addons/recoil/$PBOPREFIX$ b/addons/recoil/$PBOPREFIX$ index 1ab9ffa5e1..efd38b75ed 100644 --- a/addons/recoil/$PBOPREFIX$ +++ b/addons/recoil/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\recoil \ No newline at end of file +z\ace\addons\recoil diff --git a/addons/recoil/CfgEventHandlers.hpp b/addons/recoil/CfgEventHandlers.hpp index 6c29240403..f6503c2479 100644 --- a/addons/recoil/CfgEventHandlers.hpp +++ b/addons/recoil/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/recoil/CfgMoves.hpp b/addons/recoil/CfgMoves.hpp index 29bca9c81a..aca9d93f3c 100644 --- a/addons/recoil/CfgMoves.hpp +++ b/addons/recoil/CfgMoves.hpp @@ -1,4 +1,3 @@ - // Completely disable BI's camshake on fire. #define ACE_CAMSHAKEFIRE_BASE 0 #define ACE_CAMSHAKEFIRE_LESS 0 diff --git a/addons/recoil/CfgRecoils.hpp b/addons/recoil/CfgRecoils.hpp index c6482937ae..b8d181e566 100644 --- a/addons/recoil/CfgRecoils.hpp +++ b/addons/recoil/CfgRecoils.hpp @@ -1,4 +1,3 @@ - #define KICKBACK 1.4 #define MUZZLETEMP 1.2 @@ -15,28 +14,28 @@ class CfgRecoils { // doc: http://forums.bistudio.com/showthread.php?188999-Recoil-Overhaul-Feedback&s=dba8590ec07adb5ffa87f72d38dde6fc&p=2886744&viewfull=1#post2886744 // {horizontal axis position, vertical axis position, horizontal magnitude, vertical magnitude} muzzleOuter[] = { - QUOTE(0*MUZZLERIGHT_POS), - QUOTE(0.4*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0*MUZZLERIGHT_POS, + 0.4*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; // restricted area inside the outer ellipse where the recoil cannot end muzzleInner[] = {0,0.05,0.2,0.2}; // minimum and maximum interval for backward force kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_default: Default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; muzzleInner[] = {0, 0, @@ -44,528 +43,529 @@ class CfgRecoils { 0.1 }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20c: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg21: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mx: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mxc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_sw: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mxm: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktb: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktbc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.02*KICKBACK) + 0.01*KICKBACK, + 0.02*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pdw: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_sdar: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pistol_p07: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.03*MUZZLETEMP); + temporary = 0.03*MUZZLETEMP; }; class recoil_pistol_rook40: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_pistol_acpc2: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.04*MUZZLETEMP); + temporary = 0.04*MUZZLETEMP; }; class recoil_pistol_4five: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.06*MUZZLETEMP); + temporary = 0.06*MUZZLETEMP; }; class recoil_pistol_zubr: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_pistol_signal: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_rpg: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.0*MUZZLERIGHT_POS, + 0.1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.0*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.1*MUZZLETEMP); + permanent = 1.0*MUZZLEPERM; + temporary = 0.05*MUZZLETEMP; }; class recoil_nlaw: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_titan_long: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.15*MUZZLETEMP); + temporary = 0.15*MUZZLETEMP; }; class recoil_titan_short: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.12*MUZZLETEMP); + temporary = 0.12*MUZZLETEMP; }; class recoil_mk200: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_zafir: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_m320: recoil_default { muzzleOuter[] = { - QUOTE(1*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 1*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_gm6: recoil_default { muzzleOuter[] = { - QUOTE(1.4*MUZZLERIGHT_POS), - QUOTE(3.5*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.8*MUZZLECLIMB_MAG) + 1.4*MUZZLERIGHT_POS, + 3.5*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.8*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.025*MUZZLETEMP); + temporary = 0.025*MUZZLETEMP; }; class recoil_ebr: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.07*KICKBACK) + 0.04*KICKBACK, + 0.07*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_01: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.03*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_03: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.005*MUZZLETEMP); + temporary = 0.005*MUZZLETEMP; }; class recoil_dmr_04: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_05: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_06: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mmg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.6*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.6*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mmg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; }; diff --git a/addons/recoil/XEH_PREP.hpp b/addons/recoil/XEH_PREP.hpp index 9e34c47492..90c7c9cccf 100644 --- a/addons/recoil/XEH_PREP.hpp +++ b/addons/recoil/XEH_PREP.hpp @@ -1,2 +1 @@ - PREP(camshake); diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf index ffd1bfc414..1566a79fd4 100644 --- a/addons/recoil/XEH_preInit.sqf +++ b/addons/recoil/XEH_preInit.sqf @@ -7,4 +7,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +GVAR(recoilCache) = createHashMap; + ADDON = true; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index d68da81db7..9c6e78608f 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* - * Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2 + * Author: Original by Ryan Schultz, edited by KoffeinFlummi, commy2 * Adds camera shake when firing. Called from the unified fired EH only for the local player. * From TMR: Small Arms * * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) + * Parameters inherited from EFUNC(common,firedEH) * * Return Value: * None * * Example: - * [player, (currentWeapon player), (currentMuzzle player)] call ace_recoil_fnc_camshake; + * [player, currentWeapon player, currentMuzzle player] call ace_recoil_fnc_camshake * * Public: No */ @@ -28,20 +28,19 @@ if (toLowerANSI _weapon in ["throw", "put"]) exitWith {}; private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); -// to get camshake read kickback -private _recoil = missionNamespace getVariable format [QGVAR(%1-%2), _weapon, _muzzle]; - -if (isNil "_recoil") then { +// Get camshake read kickback +private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, { private _config = configFile >> "CfgWeapons" >> _weapon; - if (_muzzle == _weapon) then { - _recoil = getText (_config >> "recoil") + private _recoil = if (_muzzle == _weapon) then { + getText (_config >> "recoil") } else { - _recoil = getText (_config >> _muzzle >> "recoil") + getText (_config >> _muzzle >> "recoil") }; if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); + if (count _recoil < 2) then { _recoil = [0, 0]; }; @@ -51,17 +50,20 @@ if (isNil "_recoil") then { TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil); - // parse numbers - _recoil set [0, call compile format ["%1", _recoil select 0]]; - _recoil set [1, call compile format ["%1", _recoil select 1]]; + // Ensure format is correct + _recoil resize [2, 0]; - missionNamespace setVariable [format [QGVAR(%1-%2), _weapon, _muzzle], _recoil]; -}; + // Parse numbers + _recoil apply { if (_x isEqualType 0) then { _x } else { call compile format ["%1", _x] } } // return +}, true]; private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; +if (_weapon isEqualTo secondaryWeapon _unit) then { + _powerCoef = _powerCoef + 25.0; +}; private _camshake = [ _powerCoef * (BASE_POWER + _powerMod) max 0, diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 44575a141d..dbbcaf04d1 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -238,6 +238,20 @@ class CfgVehicles { // Patria = LAV GVAR(fuelCapacity) = 269; }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + positions[] = {{-1.188, -3.87, -0.769}, {1.638, -3.87, -0.769}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; + }; class Truck_F: Car_F { GVAR(fuelCapacity) = 400; @@ -308,12 +322,14 @@ class CfgVehicles { class MBT_01_base_F: Tank_F { // Merkava IV GVAR(fuelCapacity) = 1400; + class EGVAR(interaction,anims); }; class MBT_02_base_F: Tank_F { // T100 Black Eagle // Assuming T80 GVAR(fuelCapacity) = 1100; + class EGVAR(interaction,anims); }; class MBT_03_base_F: Tank_F { @@ -324,11 +340,37 @@ class CfgVehicles { class MBT_01_arty_base_F: MBT_01_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = { + "[0, -2.5, 0] vectorAdd ([[1.6, -2.4, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[-1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class MBT_02_arty_base_F: MBT_02_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -2.1, 0] vectorAdd ([[1.6, -2.65, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class Heli_Light_02_base_F: Helicopter_Base_H { diff --git a/addons/refuel/functions/fnc_handleDisconnect.sqf b/addons/refuel/functions/fnc_handleDisconnect.sqf index cf4b37cce9..3aa1831a18 100644 --- a/addons/refuel/functions/fnc_handleDisconnect.sqf +++ b/addons/refuel/functions/fnc_handleDisconnect.sqf @@ -24,4 +24,4 @@ private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; if (isNull _nozzle) exitWith {}; [_unit, _nozzle] call FUNC(dropNozzle); -[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index ea84f6a518..eba836ed8a 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -43,12 +43,12 @@ if (isNull _nozzle || {_source != _nozzle getVariable QGVAR(source)}) exitWith { deleteVehicle _helper; }; deleteVehicle _nozzle; - + // Restore ability to drag and carry this object _source setVariable [QEGVAR(dragging,canCarry), _source getVariable [QGVAR(canCarryLast), false], true]; _source setVariable [QEGVAR(dragging,canDrag), _source getVariable [QGVAR(canDragLast), false], true]; - [_source, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }, "", localize LSTRING(ReturnAction), diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index 611fa85e90..3e4dc23afb 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -23,8 +23,8 @@ #define END_PFH \ _unit setVariable [QGVAR(hint), nil]; \ call EFUNC(interaction,hideMouseHint); \ - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ - [_unit, "blockThrow", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ [_idPFH] call CBA_fnc_removePerFrameHandler; params ["_unit", "_nozzle"]; diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index cd8f8b4eb4..51db8789e5 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -80,7 +80,7 @@ params [ _nozzle setVariable [QGVAR(attachPos), _attachPos, true]; _nozzle setVariable [QGVAR(source), _source, true]; - [_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); _source setVariable [QGVAR(isConnected), true, true]; _source setVariable [QGVAR(ownedNozzle), _nozzle, true]; @@ -100,8 +100,8 @@ params [ _unit call EFUNC(common,fixLoweredRifleAnimation); _unit action ["SwitchWeapon", _unit, _unit, 299]; - [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_refuel", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [_unit, _nozzle] call FUNC(startNozzleInHandsPFH); }, diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 96b9f88d50..829e57e256 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -4,23 +4,24 @@ * Check if a unit can check the ammo of the target. * * Arguments: - * 0: Unit equipped with the weapon + * 0: Unit equipped with the weapon/CSW to check + * 1: Unit checking ammo * * Return Value: * Can check ammo * * Example: - * [cursorObject] call ace_reload_fnc_canCheckAmmo + * [cursorObject, player] call ace_reload_fnc_canCheckAmmo * * Public: No */ -params ["_target"]; +params ["_target", "_player"]; // Static weapons if (_target isKindOf "StaticWeapon") exitWith { // No check ammo action on destroyed static weapons - if (!alive _target) exitWith {false}; + if (!alive _target || {!([_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew))}) exitWith {false}; if (currentMagazine _target != "") exitWith {true}; diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 2f0c6c60c1..ec860ff46a 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -107,7 +107,7 @@ Gurt anhängen Töltényheveder összekötése Combina nastro - Ligar cintos de munição + Conectar cintos de munição ベルトを繋げる 탄띠 연결 连接弹链 @@ -123,7 +123,7 @@ Gurt anhängen... Töltényheveder összekötése folyamatban... Combinando nastro... - Ligando cintos... + Conectando cintos... ベルトを繋げています・・・ 탄띠 연결 중... 正在连接弹链... @@ -139,6 +139,7 @@ 탄띠가 연결되었습니다 Ремень был пристегнут Cinta enganchada + Cinto conectado Belt could not be linked @@ -150,6 +151,7 @@ 탄띠를 연결할 수 없습니다 Ремень не удалось пристегнуть La cinta no ha podido ser enganchada + Cinto não pôde ser conectado diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index b55ccde170..6324a97b55 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -11,6 +11,7 @@ Affichage de notifications lors d'une rechargement par un ami Отображает уведомления о загрузке помощника Mostrar notificaciones para recarga de compañero + Mostrar notificações para Carregamento de Companheiro Displays notifications when an assistant loads a gunner's launcher. @@ -22,6 +23,7 @@ Affiche une notofication lorsqu'un assistant recharge l'arme du tireur. Отображает уведомления, когда помощник загружает пусковую установку стрелка. Mostrar notificaciones cuando un asistente recarga el lanzador del tirador. + Notifica quando um assistente carrega o lançador do atirador Load launcher @@ -50,6 +52,7 @@ %1이(가) 당신의 발사기를 장전했습니다. %1 загружает Вашу установку %1 está cargando tu lanzador + %1 está carregando seu lançador %1 stopped loading your launcher @@ -61,6 +64,7 @@ %1이(가) 당신의 발사기 장전을 멈췄습니다. %1 прекратил загружать Вашу установку %1 paró de cargar tu lanzador + %1 parou de carregar seu lançador Loading launcher... @@ -123,6 +127,7 @@ 발사기를 장전할 수 없습니다. Не удалось загрузить пусковую установку El lanzador no ha podido ser cargado + O lançador não pôde ser carregado Buddy Loading @@ -134,6 +139,7 @@ バディローディング Перезарядка помощником Cargado de Compañero + Carregamento de Companheiro diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index ce74737b76..89d3cd8313 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -429,9 +429,34 @@ class CfgVehicles { GVAR(hitpointPositions)[] = {{"HitTurret", {0,-2,0}}}; }; + class Tank_F; + class APC_Tracked_02_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTracks { + phase = 0; + selections[] = {"vhc_tracks"}; + positions[] = {"private _pos = _target selectionPosition 'vhc_tracks'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = CSTRING(RemoveTrack); + text = CSTRING(RemovingTrack); + }; + }; + }; + class Car_F: Car { class HitPoints; }; + class Offroad_02_base_F: Car_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {"_target selectionPosition ['spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; + class Truck_F: Car_F { class HitPoints: HitPoints { class HitLBWheel; @@ -449,10 +474,45 @@ class CfgVehicles { }; }; + class Truck_01_viv_base_F; + class Truck_01_cargo_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + positions[] = {"_target selectionPosition ['tyre1_hide', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + distance = 2.5; + }; + }; + }; + class Truck_01_flatbed_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + positions[] = {"_target selectionPosition ['tyre1_hide', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + distance = 2.5; + }; + }; + }; + class Quadbike_01_base_F: Car_F { GVAR(hitpointPositions)[] = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; }; class Hatchback_01_base_F: Car_F { GVAR(hitpointPositions)[] = {{"HitBody", {0, 0.7, -0.5}}, {"HitFuel", {0, -1.75, -0.75}}}; }; + + class Van_02_base_F: Truck_F { + class EGVAR(interaction,anims) { + class spare_tyre_hide { + positions[] = {"_target selectionPosition ['spare_tyre', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; }; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index 519a3f78d6..fcd71b59c9 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track",_claimedObjects); + ERROR_1("Bad Track %1",_claimedObjects); }; // can't use a destroyed track diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index a512089c89..899532d96a 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track",_claimedObjects); + ERROR_1("Bad Track %1",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 7ec617127c..368fe04970 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_wheel", objNull]]; if ((isNull _wheel) || {!([_unit, _wheel, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - WARNING_1("Bad Claimed Wheel",_claimedObjects); + WARNING_1("Bad Claimed Wheel %1",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp index 6c29240403..f6503c2479 100644 --- a/addons/safemode/CfgEventHandlers.hpp +++ b/addons/safemode/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/safemode/XEH_PREP.hpp b/addons/safemode/XEH_PREP.hpp index 2f23aa02c9..499ae80867 100644 --- a/addons/safemode/XEH_PREP.hpp +++ b/addons/safemode/XEH_PREP.hpp @@ -1,6 +1,6 @@ - +PREP(getWeaponSafety); PREP(lockSafety); PREP(playChangeFiremodeSound); PREP(setSafeModeVisual); -PREP(unlockSafety); PREP(setWeaponSafety); +PREP(unlockSafety); diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index db922f9b35..79064789d5 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -4,18 +4,26 @@ if (!hasInterface) exitWith {}; -["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { +["ACE3 Weapons", QGVAR(safeMode), LLSTRING(SafeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player} && {currentWeapon ACE_player != ""}) exitWith {false}; - // Statement - [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + + // Conditions: specific + if !(ACE_player call CBA_fnc_canUseWeapon && {_currentWeapon != ""} && {_currentWeapon != binocular ACE_player}) exitWith {false}; + + // Statement: Toggle weapon safety + [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(lockSafety); + true }, {false}, [DIK_GRAVE, [false, true, false]], false] call CBA_fnc_addKeybind; ["unit", { - private _weaponSafe = currentWeapon ACE_player in (ACE_player getVariable [QGVAR(safedWeapons), []]); - [!_weaponSafe] call FUNC(setSafeModeVisual); + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + + private _weaponSafe = [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(getWeaponSafety); + + // Player HUD + !_weaponSafe call FUNC(setSafeModeVisual); }] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/safemode/functions/fnc_getWeaponSafety.sqf b/addons/safemode/functions/fnc_getWeaponSafety.sqf new file mode 100644 index 0000000000..b171d974e4 --- /dev/null +++ b/addons/safemode/functions/fnc_getWeaponSafety.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Getter for weapon safety state. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: Muzzle (default: current muzzle of weapon) + * + * Return Value: + * Safety status + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_getWeaponSafety + * + * Public: Yes + */ + +params [ + ["_unit", objNull, [objNull]], + ["_weapon", "", [""]], + ["_muzzle", nil, [""]] +]; + +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {false}; + +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {false}; + +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); + + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] +}; + +// Weapon is not available +if (_muzzle == "") exitWith {false}; + +_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]) // return diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 6c617c1898..28adb42df9 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Put weapon on safety, or take it off safety if safety is already put on. + * Author: commy2, johnb43 + * Puts weapon on safety, or take it off safety if safety is already put on. * * Arguments: * 0: Unit * 1: Weapon * 2: Muzzle - * 3: Show hint + * 3: Show hint (default: true) * * Return Value: * None @@ -18,67 +18,74 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _safedWeapons = _unit getVariable QGVAR(safedWeapons); -if (_weapon in _safedWeapons) exitWith { - _this call FUNC(unlockSafety); +if (isNil "_safedWeapons") then { + _safedWeapons = createHashMap; + + _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; }; -_safedWeapons pushBack _weapon; +// See if the current weapon has locked muzzles +private _safedWeaponMuzzles = _safedWeapons getOrDefault [_weapon, createHashMap, true]; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// If muzzle is locked, unlock it (toggle) +if (_muzzle in _safedWeaponMuzzles) exitWith { + [_unit, _weapon, _muzzle, _hint] call FUNC(unlockSafety); +}; -if (_unit getVariable [QGVAR(actionID), -1] == -1) then { +private _firemode = (_unit weaponState _muzzle) select 2; + +// This syntax of selectWeapon doesn't mess with gun lights and lasers +_unit selectWeapon [_weapon, _muzzle, _firemode]; + +// Store new muzzle & firemode +_safedWeaponMuzzles set [_muzzle, _firemode]; + +// Lock muzzle +if (isNil {_unit getVariable QGVAR(actionID)}) then { _unit setVariable [QGVAR(actionID), [ _unit, "DefaultAction", { + params ["", "_unit"]; + if ( - [_this select 1] call CBA_fnc_canUseWeapon - && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + _unit call CBA_fnc_canUseWeapon && { + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + // Block firing the muzzle in safe mode + if (_currentMuzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_currentWeapon, createHashMap])) then { + if (inputAction "nextWeapon" > 0 || {inputAction "prevWeapon" > 0}) exitWith { + [_unit, _currentWeapon, _currentMuzzle] call FUNC(unlockSafety); + false }; + true - } else {false} + } else { + false + } } ) then { - // player hud - [false] call FUNC(setSafeModeVisual); + // Player HUD + false call FUNC(setSafeModeVisual); + true } else { - // player hud - [true] call FUNC(setSafeModeVisual); + // Player HUD + true call FUNC(setSafeModeVisual); + false }; }, {} ] call EFUNC(common,addActionEventHandler)]; }; -if (_muzzle isEqualType "") then { - private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; - - _unit selectWeapon _muzzle; - - if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } - ) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; - }; -}; - -// play fire mode selector sound +// Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(PutOnSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; - diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 257e5864f6..1edc236334 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Play weapon firemode change sound. + * Plays weapon firemode change sound. * * Arguments: * 0: Unit @@ -21,21 +21,23 @@ params ["_unit", "_weapon"]; private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (_sound isEqualTo []) exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// get position where to play the sound (position of the weapon) -private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); - -_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; +_sound params [["_filename", ""], ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; if (_filename == "") exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// add file extension .wss as default +// Add file extension .wss as default if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { _filename = format ["%1.wss", _filename]; }; -playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; +// Get position where to play the sound (position of the weapon) +private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); + +playSound3D [_filename, objNull, insideBuilding _unit >= 0.5, _position, _volume, _soundPitch, _distance]; + +nil // return diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index d62a542b9d..12b7f864ef 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Show firemode indicator, representing safety lock + * Shows firemode indicator, representing safety lock. * * Arguments: * 0: Show firemode @@ -10,7 +10,7 @@ * None * * Example: - * [true] call ace_safemode_fnc_setSafeModeVisual + * true call ace_safemode_fnc_setSafeModeVisual * * Public: No */ @@ -27,8 +27,8 @@ if (_show) then { private _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - _control ctrlCommit 0; } else { _control ctrlSetPosition [0, 0, 0, 0]; - _control ctrlCommit 0; }; + +_control ctrlCommit 0; diff --git a/addons/safemode/functions/fnc_setWeaponSafety.sqf b/addons/safemode/functions/fnc_setWeaponSafety.sqf index d80e1d8c38..3db0033bf8 100644 --- a/addons/safemode/functions/fnc_setWeaponSafety.sqf +++ b/addons/safemode/functions/fnc_setWeaponSafety.sqf @@ -1,13 +1,14 @@ #include "..\script_component.hpp" /* - * Author: Brostrom.A - * Safe or unsafe the given weapon based on weapon state; locked or unlocked. + * Author: Brostrom.A, johnb43 + * Lock or unlock the given weapon based on weapon state. * * Arguments: * 0: Unit * 1: Weapon * 2: State * 3: Show hint (default: true) + * 4: Muzzle (default: current muzzle of weapon) * * Return Value: * None @@ -22,17 +23,31 @@ params [ ["_unit", objNull, [objNull]], ["_weapon", "", [""]], ["_state", true, [true]], - ["_hint", true, [true]] + ["_hint", true, [true]], + ["_muzzle", nil, [""]] ]; -if (_weapon == "") exitWith {}; +// Don't allow to set weapon safety if unit doesn't have one (but allow removing safety, in case unit doesn't have weapon anymore) +if (_weapon == "" || {_state && {!(_unit hasWeapon _weapon)}}) exitWith {}; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {}; -_weapon = configName (configFile >> "CfgWeapons" >> _weapon); +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); -private _muzzle = currentMuzzle _unit; - -if (_state isNotEqualTo (_weapon in _safedWeapons)) then { - [_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] }; + +// Weapon is not available +if (_muzzle == "") exitWith {}; + +// If the weapon is already in the desired state, don't do anything +if (_state == (_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]))) exitWith {}; + +[_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 10372f1a2e..97716025dc 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Take weapon of safety lock. + * Author: commy2, johnb43 + * Takes the weapon safety lock off. * * Arguments: * 0: Unit * 1: Weapon * 2: Muzzle - * 3: Show hint + * 3: Show hint (default: true) * * Return Value: * None @@ -18,67 +18,37 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; -_safedWeapons deleteAt (_safedWeapons find _weapon); +private _safedWeaponMuzzles = (_unit getVariable QGVAR(safedWeapons)) get _weapon; +private _firemode = _safedWeaponMuzzles deleteAt _muzzle; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// Remove action if all weapons have removed their safeties +if (_safedWeaponMuzzles isEqualTo createHashMap) then { + (_unit getVariable QGVAR(safedWeapons)) deleteAt _weapon; -// remove action if all weapons have put their safety on -if (_safedWeapons isEqualTo []) then { - [_unit, "DefaultAction", _unit getVariable [QGVAR(actionID), -1]] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; -}; + private _ehID = _unit getVariable QGVAR(actionID); -private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; + if (!isNil "_ehID" && {(_unit getVariable QGVAR(safedWeapons)) isEqualTo createHashMap}) then { + [_unit, "DefaultAction", _ehID] call EFUNC(common,removeActionEventHandler); -_unit selectWeapon _muzzle; - -if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } -) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; -}; - -if (inputAction "nextWeapon" > 0) then { - // switch to the last mode to roll over to first after the default nextWeapon action - // get weapon modes - private _modes = []; - { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - if (_x == "this") then { - _modes pushBack _weapon; - }; - } forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); - - // select last mode - private _mode = _modes select (count _modes - 1); - - // switch to last mode - private _index = 0; - while { - _index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; + _unit setVariable [QGVAR(actionID), nil]; }; -} else { - // play fire mode selector sound +}; + +// Let engine handle switching to next firemode/muzzle +if (inputAction "nextWeapon" == 0 && {inputAction "prevWeapon" == 0}) then { + // This syntax of selectWeapon doesn't mess with gun lights and lasers + _unit selectWeapon [_weapon, _muzzle, _firemode]; + + // Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); }; -// player hud -[true] call FUNC(setSafeModeVisual); +// Player HUD +true call FUNC(setSafeModeVisual); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(TookOffSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1ef8485112..3181890748 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the sandbag private _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index aa2c2419a3..bccae637e5 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(sandBag); diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 20b821b3b5..ef2aafd97c 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove sandbag from inventory _unit removeItem "ACE_Sandbag_empty"; diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf index ab84db7cde..ed1222e3bb 100644 --- a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -36,25 +36,23 @@ if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * (-1 * _initSpeedCoef); }; -private _zeroAngle = "ace_advanced_ballistics" callExtension format ["replicateVanillaZero:%1:%2:%3", _oldZeroRange, _initSpeed, _airFriction]; -private _vanillaZero = parseNumber _zeroAngle; +private _vanillaZero = parseNumber (("ace" callExtension ["ballistics:replicate_vanilla_zero", [_oldZeroRange, _initSpeed, _airFriction]]) select 0); #ifdef DISABLE_DISPERSION _vanillaZero = 0; #endif private _trueZero = if (!_advancedBallistics) then { - _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_newZeroRange, _initSpeed, _airFriction, _boreHeight]]) select 0) } else { // Get Weapon and Ammo Configurations private _AmmoCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _ammo]; if (isNil "_AmmoCacheEntry") then { - _AmmoCacheEntry = _ammo call EFUNC(advanced_ballistics,readAmmoDataFromConfig); + _AmmoCacheEntry = _ammo call EFUNC(advanced_ballistics,readAmmoDataFromConfig); }; private _WeaponCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _weapon]; if (isNil "_WeaponCacheEntry") then { - _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); + _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); }; _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; @@ -70,8 +68,19 @@ private _trueZero = if (!_advancedBallistics) then { _initSpeed = _initSpeed + _ammoTemperatureVelocityShift; }; - _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _newZeroRange, _initSpeed, _boreHeight, GVAR(zeroReferenceTemperature), GVAR(zeroReferenceBarometricPressure), GVAR(zeroReferenceHumidity), _ballisticCoefficients select 0, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber ( + ("ace" callExtension ["ballistics:zero_advanced", [ + _newZeroRange, + _initSpeed, + _boreHeight, + GVAR(zeroReferenceTemperature), + GVAR(zeroReferenceBarometricPressure), + GVAR(zeroReferenceHumidity), + _ballisticCoefficients select 0, + _dragModel, + _atmosphereModel + ]]) select 0 + ) }; private _zeroAngleCorrection = _trueZero - _vanillaZero; diff --git a/addons/smallarms/stringtable.xml b/addons/smallarms/stringtable.xml index 0b89a38b0d..ebb387113a 100644 --- a/addons/smallarms/stringtable.xml +++ b/addons/smallarms/stringtable.xml @@ -30,6 +30,7 @@ .45 ACP 25Rnd マガジン .45 ACP 25发 弹匣 .45 ACP 25발 탄창 + Carregador 25Mun. .45 ACP .45 ACP 25Rnd Tracers (Green) Mag @@ -44,6 +45,7 @@ .45 ACP 25Rnd トレーサー (緑) マガジン .45 ACP 25发 弹匣(曳光,绿) .45 ACP 25발 예광탄 (초록) 탄창 + Carregador 25Mun. .45 ACP Traçante (Verde) .45 ACP 25Rnd Tracers (Red) Mag @@ -58,6 +60,7 @@ .45 ACP 25Rnd トレーサー (赤) マガジン .45 ACP 25发 弹匣(曳光,红) .45 ACP 25발 예광탄 (빨강) 탄창 + Carregador 25Mun. .45 ACP Traçante (Vermelha) .45 ACP 25Rnd Tracers (Yellow) Mag @@ -72,6 +75,7 @@ .45 ACP 25Rnd トレーサー (黄) マガジン .45 ACP 25发 弹匣(曳光,黄) .45 ACP 25발 예광탄 (노랑) 탄창 + Carregador 25Mun. .45 ACP Traçante (Amarela) .45 ACP 8Rnd Mag @@ -86,6 +90,7 @@ .45 ACP 8Rnd マガジン .45 ACP 8发 弹匣 .45 ACP 8발 탄창 + Carregador 8Mun. .45 ACP .45 ACP 15Rnd Mag @@ -100,6 +105,7 @@ .45 ACP 15Rnd マガジン .45 ACP 15发 弹匣 .45 ACP 15발 탄창 + Carregador 15Mun. .45 ACP diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index ffc0f7ad63..ba9c3f77b3 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -36,7 +36,7 @@ if (vehicle _playerUnit == _playerUnit) then { removeAllContainers _playerUnit; _playerUnit linkItem "ItemMap"; - [_playerUnit, "forceWalk", "ACE_SwitchUnits", true] call EFUNC(common,statusEffect_set); + [_playerUnit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [] call FUNC(addMapFunction); }; diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 7c05cbbe63..24013f02d7 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -23,8 +23,8 @@ params ["_unit", "_key"]; if (_key != 1 || {isNull GVAR(ladder)}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); detach GVAR(ladder); diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 9fe13e4e65..8211dc5f9d 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -19,8 +19,8 @@ params ["_unit", "_ladder"]; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); private _pos1 = getPosASL _ladder; private _pos2 = _ladder modelToWorldWorld (_ladder selectionPosition "check2"); diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 6d6f78f1a3..e9168d75a1 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -21,8 +21,8 @@ params ["_unit", "_ladder"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); { _ladder animate [_x, 0]; diff --git a/addons/towing/stringtable.xml b/addons/towing/stringtable.xml index 949d36dd48..7549fb3c8a 100644 --- a/addons/towing/stringtable.xml +++ b/addons/towing/stringtable.xml @@ -12,6 +12,7 @@ 牵引 견인 Remolcado + Rebocando Attach Tow Rope @@ -24,6 +25,7 @@ 系上牵引绳 견인줄 부착 Sujetar cuerda de remolcado + Fixar corda de reboque Attaching Cancelled @@ -36,6 +38,7 @@ 取消系上绳索 견인 취소됨 Sujección cancelada + Reboque cancelado Attach Tow Rope (3.2m) @@ -48,6 +51,7 @@ 系上牵引绳(3.2米) 견인줄 부착(3.2M) Sujetar cuerda de remolcado (3.2m) + Fixar corda de reboque (3,2m) Attach Tow Rope (6.2m) @@ -60,6 +64,7 @@ 系上牵引绳(6.2米) 견인줄 부착(6.2M) Sujetar cuerda de remolcado (6.2m) + Fixar corda de reboque (6,2m) Attach Tow Rope (12.2m) @@ -72,6 +77,7 @@ 系上牵引绳(12.2米) 견인줄 부착(12.2M) Sujetar cuerda de remolcado (12.2m) + Fixar corda de reboque (12,2m) Attach Tow Rope (15.2m) @@ -84,6 +90,7 @@ 系上牵引绳(15.2米) 견인줄 부착(15.2M) Sujetar cuerda de remolcado (15.2m) + Fixar corda de reboque (15,2m) Attach Tow Rope (18.3m) @@ -96,6 +103,7 @@ 系上牵引绳(18.3米) 견인줄 부착(18.2M) Sujetar cuerda de remolcado (18.3m) + Fixar corda de reboque (18,3m) Attach Tow Rope (27.4m) @@ -108,6 +116,7 @@ 系上牵引绳(27.4米) 견인줄 부착(27.4M) Sujetar cuerda de remolcado (27.4m) + Fixar corda de reboque (27,4m) Attach Tow Rope (36.6m) @@ -120,6 +129,7 @@ 系上牵引绳(36.6米) 견인줄 부착(36.6M) Sujetar cuerda de remolcado (36.6m) + Fixar corda de reboque (36,6m) Detach Tow Rope @@ -132,6 +142,7 @@ 解开牵引绳 견인줄 분리 Desmontar cuerda de remolcado + Soltar corda de reboque Add Tow Rope to Vehicle Inventory @@ -143,6 +154,7 @@ 車両のインベントリに牽引ロープを追加する Abschleppseil zum Fahrzeuginventar hinzufügen Ajouter une corde à l'inventaire des véhicules + Adicionar corda de reboque ao inventário do veículo diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index bec66e2e64..554a75149b 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -106,4 +106,44 @@ class CfgVehicles { MACRO_ADDITEM(ACE_EntrenchingTool,50); }; }; + + class Wheeled_APC_F; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-1.108, -1.47, -0.769}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-0.9, -3, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + + class Tank_F; + class LT_01_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{0.6, 0, -0.3}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; }; diff --git a/addons/trenches/functions/fnc_placeCancel.sqf b/addons/trenches/functions/fnc_placeCancel.sqf index a06ecff459..f3cd20c0be 100644 --- a/addons/trenches/functions/fnc_placeCancel.sqf +++ b/addons/trenches/functions/fnc_placeCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(digPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(trench); diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 03d4791e02..9a49df86e7 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove dig pfh [GVAR(digPFH)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index f49aef4a38..e6e03e0b57 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -27,8 +27,8 @@ GVAR(trenchPlacementData) = getArray (configFile >> "CfgVehicles" >> _trenchClas TRACE_1("",GVAR(trenchPlacementData)); // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the trench private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 4b47ee6a14..5242603bc2 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -237,6 +237,7 @@ Camuffa la trincea 塹壕を偽装 Graben tarnen + Camuflar trincheira Removing Trench @@ -265,6 +266,7 @@ ACE Trincee ACE 战壕 ACE 참호 + ACE Trincheiras Small Trench Dig Duration @@ -277,6 +279,7 @@ Trincea piccola - Durata di scavo 小型战壕挖掘时间 소형참호 건설 시간 + Duração de Escavamento de Trincheira Pequena Time, in seconds, required to dig a small trench. @@ -289,6 +292,7 @@ Tempo in secondi per scavare una trincea piccola. 挖一条小型战壕所需的时间(秒)。 소형 참호를 팔 때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para cavar uma trincheira pequena. Small Trench Remove Duration @@ -301,6 +305,7 @@ Trincea piccola - Durata di rimozione 小型战壕回填时间 소형참호 제거 시간 + Duração de Remoção de Trincheira Pequena Time, in seconds, required to remove a small trench. @@ -313,6 +318,7 @@ Tempo in secondi per rimuovere una trincea piccola. 回填一条小型战壕所需的时间(秒)。 소형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para remover uma trincheira pequena. Big Trench Dig Duration @@ -325,6 +331,7 @@ Trincea grande - Durata di scavo 大型战壕挖掘时间 대형참호 건설 시간 + Duração de Escavamento de Trincheira Grande Time, in seconds, required to dig a big trench. @@ -337,6 +344,7 @@ Tempo in secondi per scavare una trincea grande. 挖一条大型战壕所需的时间(秒)。 대형 참호를 팔때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para cavar uma trincheira grande. Big Trench Remove Duration @@ -349,6 +357,7 @@ Trincea grande - Durata di rimozione 大型战壕回填时间 대형참호 제거 시간 + Duração de Remoção de Trincheira Grande Time, in seconds, required to remove a big trench. @@ -361,6 +370,7 @@ Tempo in secondi per rimuovere una trincea grande. 回填一条大型战壕所需的时间(秒)。 대형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para remover uma trincheira grande. diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d9d3fa5717..5bf28bc58d 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" // Exit on Headless if (!hasInterface) exitWith {}; @@ -48,3 +49,24 @@ GVAR(elementsSet) = createHashMap; }] call CBA_fnc_addEventHandler; [QUOTE(ADDON), "AnimChanged", LINKFUNC(onAnimChanged), true] call EFUNC(common,addPlayerEH); + + +["ACE3 Common", QGVAR(hideHud), localize LSTRING(hideHud), { + GVAR(hideHud) = !(missionNamespace getVariable [QGVAR(hideHud), false]); + [QGVAR(hideHud), [GVAR(hideHud)]] call CBA_fnc_localEvent; + + private _mask = []; + if (GVAR(hideHud)) then { _mask resize [10, false] }; + [QGVAR(hideHud), _mask] call EFUNC(common,showHud); + + if (missionNamespace getVariable [QGVAR(hideHud_hideChat), true]) then { + showChat !GVAR(hideHud); + }; + + if (!isNil "diwako_dui_main_toggled_off") then { + diwako_dui_main_toggled_off = GVAR(hideHud); // ref https://github.com/diwako/diwako_dui/wiki/Hiding-DUI-for-cutscenes + }; + true +}, +{false}, +[DIK_F12, [false, true, false]], false] call CBA_fnc_addKeybind; // ctrl+f12 diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 2578f58c6d..b50bdd5340 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -168,6 +168,7 @@ Filigrana per versione in fase di sviluppo 开发建设水印 개발용 빌드 워터마크 + Marca d'agua de versão de desenvolvimento Weapon Name @@ -680,6 +681,7 @@ 启用移动速度指示器 이동 속도 표시기 활성화 Habilitar indicador de velocidad de movimiento + Habilitar indicador de velocidade de movimento Enables movement speed indicator for player character. @@ -692,6 +694,7 @@ 为玩家角色启用移动速度指示器。 플레이어 캐릭터를 위한 이동속도 표시기를 활성화합니다. Habilita el indicador de velocidad de movimiento para el personaje del jugador. + Habilita o indicador de velocidade de movimento do personagem do jogador. Hide Default Action Icon @@ -704,6 +707,7 @@ Standardaktionssymbol ausblenden Masquer l'icône d'action par défaut Nascondi Icona dell'Interazione Standard + Esconder ícone padrão de ação Hides the icon shown automatically when something is in front of the cursor. Requires a game restart.\nWarning: Does not remove the action itself! It is advisable to unbind 'Use default action' key to prevent unwanted interactions. @@ -716,6 +720,11 @@ Blendet das Symbol aus, das automatisch angezeigt wird, wenn sich etwas vor dem Cursor befindet. Erfordert einen Neustart des Spiels.\nWarnung: Die Aktion selbst wird nicht entfernt! Es empfiehlt sich, die Belegung der Taste 'Standardaktion verwenden' aufzuheben, um unerwünschte Interaktionen zu verhindern. Cache l'icône qui s'affiche automatiquement lorsque quelque chose est devant le curseur. Nécessite un redémarrage du jeu.\nAvertissement : l'action n'est pas supprimée ! Il est recommandé d'annuler l'affectation du bouton 'Utiliser l'action par défaut' afin d'éviter des interactions indésirables. Nasconde l'icona mostrata in automatico quando qualcosa è davanti al cursore. La modifica richiede un riavvio del gioco.\nAttenzione: Non rimuovere l'azione stessa! È consigliato rimuovere solo il tasto dall'assegnazione 'Usa Azione Standard' per impedire interazioni non volute. + Esconde o ícone mostrado automaticamente quando algo está a frente do cursor. É preciso reiniciar o jogo.\nAviso: Não remove a ação em si! É recomendado desvincular a tecla de "Usar ação padrão" para previnir interações indesejadas. + + + Hide all UI + 全てのUIを隠す diff --git a/addons/vehicle_damage/CfgAmmo.hpp b/addons/vehicle_damage/CfgAmmo.hpp index 408c3e7b15..ad84fbc53c 100644 --- a/addons/vehicle_damage/CfgAmmo.hpp +++ b/addons/vehicle_damage/CfgAmmo.hpp @@ -21,9 +21,6 @@ class CfgAmmo { class M_Vorona_HEAT; class M_SPG9_HEAT; class R_MRAAWS_HEAT_F; - class B_338_Ball; - - class ACE_G_40mm_HE; CREATE_INCENDIARY_AMMO(BulletBase, BulletCore, 0.1); CREATE_INCENDIARY_AMMO(ShellBase, ShellCore, 1.0); diff --git a/addons/vehicle_damage/CfgEventHandlers.hpp b/addons/vehicle_damage/CfgEventHandlers.hpp index 74ffec132e..f6503c2479 100644 --- a/addons/vehicle_damage/CfgEventHandlers.hpp +++ b/addons/vehicle_damage/CfgEventHandlers.hpp @@ -1,19 +1,17 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); - }; -}; - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/vehicle_damage/CfgVehicles.hpp b/addons/vehicle_damage/CfgVehicles.hpp index 9ea47711ea..96a6e956e6 100644 --- a/addons/vehicle_damage/CfgVehicles.hpp +++ b/addons/vehicle_damage/CfgVehicles.hpp @@ -28,6 +28,7 @@ class CfgVehicles { GVAR(engineFireProb) = 0.5; GVAR(detonationDuringFireProb) = 0.2; GVAR(canHaveFireRing) = 0; + EGVAR(cookoff,canHaveFireJet) = 1; }; class Wheeled_APC_F: Car_F { GVAR(hullDetonationProb) = 0.2; @@ -38,6 +39,7 @@ class CfgVehicles { GVAR(engineFireProb) = 0.5; GVAR(detonationDuringFireProb) = 0.2; GVAR(canHaveFireRing) = 0; + EGVAR(cookoff,canHaveFireJet) = 1; }; class APC_Tracked_01_base_F: Tank_F {}; class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; @@ -288,4 +290,3 @@ class CfgVehicles { GVAR(canHaveFireRing) = 1; }; }; - diff --git a/addons/vehicle_damage/XEH_PREP.hpp b/addons/vehicle_damage/XEH_PREP.hpp index a7eb519881..20075cbd4a 100644 --- a/addons/vehicle_damage/XEH_PREP.hpp +++ b/addons/vehicle_damage/XEH_PREP.hpp @@ -1,14 +1,13 @@ PREP(abandon); PREP(addEventHandler); -PREP(handleBail); -PREP(handleVehicleDamage); -PREP(handleCookoff); -PREP(detonate); -PREP(processHit); -PREP(handleDetonation); -PREP(handleDamage); -PREP(knockOut); -PREP(addDamage); -PREP(handleDamageEjectIfDestroyed); PREP(blowOffTurret); +PREP(handleBail); +PREP(handleCookoff); +PREP(handleDamage); +PREP(handleDamageEjectIfDestroyed); +PREP(handleDetonation); +PREP(handleVehicleDamage); +PREP(knockOut); PREP(medicalDamage); +PREP(processHit); +PREP(setDamage); diff --git a/addons/vehicle_damage/XEH_postInit.sqf b/addons/vehicle_damage/XEH_postInit.sqf index 9784d335ed..5e15599735 100644 --- a/addons/vehicle_damage/XEH_postInit.sqf +++ b/addons/vehicle_damage/XEH_postInit.sqf @@ -1,53 +1,65 @@ #include "script_component.hpp" -["ace_settingsInitialized", { +// Init eject from destroyed vehicles +// See https://github.com/acemod/ACE3/pull/6330 +// Still valid for Arma 2.16 +{ + [_x, "Init", { + params ["_vehicle"]; + + if (!alive _vehicle) exitWith {}; + + TRACE_2("ejectIfDestroyed init",_vehicle,typeOf _vehicle); + + _vehicle addEventHandler ["HandleDamage", {call FUNC(handleDamageEjectIfDestroyed)}]; + }, true, [], true] call CBA_fnc_addClassEventHandler; +} forEach EJECT_IF_DESTROYED_VEHICLES; + +["CBA_settingsInitialized", { TRACE_1("settings init",GVAR(enabled)); - if (GVAR(enabled)) then { - [QGVAR(medicalDamage), LINKFUNC(medicalDamage)] call CBA_fnc_addEventHandler; - [QGVAR(bailOut), { - params ["_center", "_crewman", "_vehicle"]; - TRACE_3("bailOut",_center,_crewman,_vehicle); + if (!GVAR(enabled)) exitWith {}; - if (isPlayer _crewman) exitWith {}; - if (!alive _crewman || {!([_crewman] call EFUNC(common,isAwake))}) exitWith {}; + [QGVAR(medicalDamage), LINKFUNC(medicalDamage)] call CBA_fnc_addEventHandler; - unassignVehicle _crewman; - _crewman leaveVehicle _vehicle; - doGetOut _crewman; - - private _angle = floor (random 360); - private _dist = (30 + (random 10)); - private _escape = _center getPos [_dist, _angle]; - - _crewman doMove _escape; - _crewman setSpeedMode "FULL"; - }] call CBA_fnc_addEventHandler; - - ["Tank", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; - ["Wheeled_APC_F", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; - - if (GVAR(enableCarDamage)) then { - ["Car", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; - }; - - // Blow off turret effect - // TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion) - // The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that? - ["Tank", "Killed", { - if (_this select 3 && random 1 < 0.15) then { - (_this select 0) call FUNC(blowOffTurret); - }; - }, true, [], true] call CBA_fnc_addClassEventHandler; + if (isServer) then { + // To set source and instigator, setDamage must be executed on the server + [QGVAR(setDamage), {(_this select 0) setDamage (_this select 1)}] call CBA_fnc_addEventHandler; }; - // init eject from destroyed vehicle - { - [_x, "init", { - params ["_vehicle"]; - if (!alive _vehicle) exitWith {}; - TRACE_2("ejectIfDestroyed init",_vehicle,typeOf _vehicle); - _vehicle addEventHandler ["HandleDamage", {call FUNC(handleDamageEjectIfDestroyed)}]; - }, true, [], true] call CBA_fnc_addClassEventHandler; - } forEach EJECT_IF_DESTROYED_VEHICLES; + [QGVAR(bailOut), { + params ["_vehicle", "_unit"]; + + TRACE_2("bailOut",_vehicle,_unit); + + // Ignore players and the dead + if (_unit call EFUNC(common,isPlayer) || {!(_unit call EFUNC(common,isAwake))}) exitWith {}; + + unassignVehicle _unit; + _unit leaveVehicle _vehicle; + doGetOut _unit; + + private _angle = floor (random 360); + private _dist = 30 + (random 10); + private _escape = _vehicle getPos [_dist, _angle]; + + _unit doMove _escape; + _unit setSpeedMode "FULL"; + }] call CBA_fnc_addEventHandler; + + GVAR(vehicleClassesHitPointHash) = createHashMap; + + ["Tank", "Init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; + + // Wheeled_APC_F inherits from Car + [["Wheeled_Apc_F", "Car"] select GVAR(enableCarDamage), "Init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; + + // Blow off turret effect + // TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion) + // The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that? + ["Tank", "Killed", { + if (_this select 3 && random 1 < 0.15) then { + (_this select 0) call FUNC(blowOffTurret); + }; + }] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/vehicle_damage/config.cpp b/addons/vehicle_damage/config.cpp index 6b4f7cf685..24b2abda5b 100644 --- a/addons/vehicle_damage/config.cpp +++ b/addons/vehicle_damage/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; // ammo/vehicle config defines touch all of these - requiredAddons[] = { "ace_common", "ace_cookoff" }; + requiredAddons[] = {"ace_common", "ace_cookoff"}; author = ECSTRING(common,ACETeam); authors[] = {"tcvm"}; url = ECSTRING(main,URL); diff --git a/addons/vehicle_damage/functions/fnc_abandon.sqf b/addons/vehicle_damage/functions/fnc_abandon.sqf index 83b06a80df..3539e21a97 100644 --- a/addons/vehicle_damage/functions/fnc_abandon.sqf +++ b/addons/vehicle_damage/functions/fnc_abandon.sqf @@ -4,29 +4,34 @@ * Forces the AI currently in a vehicle to bail out. * * Arguments: - * 0: The vehicle in which to bail out + * 0: Vehicle * * Return Value: * None * * Example: - * [tank2] call ace_vehicle_damage_fnc_abandon; + * cursorObject call ace_vehicle_damage_fnc_abandon * * Public: No */ params ["_vehicle"]; -TRACE_2("abandon",_vehicle,(crew _vehicle) select {alive _x}); -if (_vehicle getVariable [QGVAR(allowCrewInImmobile), false]) exitWith {}; // check for API +// Check for API +if (_vehicle getVariable [QGVAR(allowCrewInImmobile), false]) exitWith { + TRACE_1("API prevented crew from dismounting",_vehicle); +}; + +TRACE_1("abandon",_vehicle); [{ params ["_vehicle"]; + _vehicle allowCrewInImmobile false; - private _center = getPosASL _vehicle; - TRACE_2("bailing out crew after delay",_vehicle,_center); + TRACE_2("bailing out crew after delay",_vehicle,crew _vehicle); + { - [QGVAR(bailOut), [_center, _x, _vehicle], _x] call CBA_fnc_targetEvent; - } forEach crew _vehicle; -}, _this, random MAX_CREW_BAILOUT_TIME] call CBA_fnc_waitAndExecute; + [QGVAR(bailOut), [_vehicle, _x], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); +}, _vehicle, random MAX_CREW_BAILOUT_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/vehicle_damage/functions/fnc_addDamage.sqf b/addons/vehicle_damage/functions/fnc_addDamage.sqf deleted file mode 100644 index 35475bd36c..0000000000 --- a/addons/vehicle_damage/functions/fnc_addDamage.sqf +++ /dev/null @@ -1,42 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name. - * - * Arguments: - * 0: The vehicle - * 1: Hit Index - * 2: Hit Point - * 3: Damage - * 4: Whether or not to cap the damage to maximum part damage (default: True) - * - * Return Value: - * None - * - * Example: - * [vehicle player, 234, "HitHull"] call ace_vehicle_damage_fnc_addDamage - * - * Public: No - */ - -params ["_vehicle", "_hitIndex", "_hitPoint", "_damage", ["_capDamageAtCurret", true]]; - -private _currentDamage = _vehicle getHitPointDamage _hitPoint; -if (_capDamageAtCurret && { _damage < _currentDamage }) exitWith { - TRACE_4("capping damage at current",_capDamageAtCurret,_damage,_currentDamage,_hitPoint); -}; - -TRACE_4("adding damage to vehicle",_vehicle,_hitIndex,_hitPoint,_damage); -if (_hitPoint isEqualTo "#structural") then { - _hitPoint = "hithull"; - _hitIndex = -1; -}; -if (_hitIndex >= 0) then { - _vehicle setHitIndex [_hitIndex, _damage, true]; -} else { - _vehicle setHitPointDamage [_hitPoint, _damage, true]; -}; - -if (_hitPoint == "hitengine" && {_damage > 0.9}) then { - [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; -}; diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index a7e59c75a1..3fdbf9ec20 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -1,110 +1,137 @@ #include "..\script_component.hpp" /* - * Author: tcvm + * Author: tcvm, johnb43 * Adds the event handler to a vehicle. * * Arguments: - * 0: The vehicle in which to add the event handler to + * 0: Vehicle * * Return Value: * None * * Example: - * [tank2] call ace_vehicle_damage_fnc_addEventHandler; + * cursorObject call ace_vehicle_damage_fnc_addEventHandler * * Public: No */ -params["_vehicle"]; +params ["_vehicle"]; TRACE_2("addEventHandler",_vehicle,GVAR(enabled)); -if !(GVAR(enabled)) exitWith { +if (!GVAR(enabled)) exitWith { #ifdef DEBUG_MODE_FULL - [{ ["Warning: Vehicle Damage not enabled...", 2] call CBA_fnc_notify; }, [], 5] call CBA_fnc_waitAndExecute; + [CBA_fnc_notify, ["Warning: Vehicle Damage not enabled", 2], 5] call CBA_fnc_waitAndExecute; #endif }; -private _hitpointHash = [[], nil] call CBA_fnc_hashCreate; +if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; + +_vehicle allowCrewInImmobile true; + +// No clue why, but for some reason this needs to be exec'd next frame or else it isn't the last event handler in the system. +// Maybe its overridden somewhere else, but this makes sure it is the last one +[{ + params ["_vehicle"]; + + if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; + + TRACE_1("added eh",_vehicle); + + _vehicle setVariable [QGVAR(hitHash), createHashMap]; + _vehicle setVariable [QGVAR(handleDamage), _vehicle addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]]; +}, _vehicle] call CBA_fnc_execNextFrame; + +private _typeOf = typeOf _vehicle; + +if (_typeOf in GVAR(vehicleClassesHitPointHash)) exitWith {}; + +private _hitPointHash = createHashMap; private _vehicleConfig = configOf _vehicle; -private _hitpointsConfig = _vehicleConfig >> "HitPoints"; -private _turretConfig = _vehicleConfig >> "Turrets"; -private _eraHitpoints = [_vehicleConfig >> QGVAR(eraHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; -private _slatHitpoints = [_vehicleConfig >> QGVAR(slatHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; +private _hitPointsConfig = _vehicleConfig >> "HitPoints"; // Add hitpoint names to config for quick lookup { - _x params ["_hitpoints", "_type"]; + _x params ["_hitPoints", "_hitArea"]; + { - [_hitpointHash, toLowerANSI _x, [_type, _hitpointsConfig >> _x, toLowerANSI _x]] call CBA_fnc_hashSet; - } forEach _hitpoints; + _hitPointHash set [toLowerANSI _x, [_hitArea, abs getNumber (_hitPointsConfig >> _x >> "minimalHit")]]; + } forEach _hitPoints; } forEach ALL_HITPOINTS; -_vehicle setVariable [QGVAR(hitpointHash), _hitpointHash]; - -// gun and turret hitpoints arent hardcoded anymore - dig through config to find correct names -private _iterateThroughConfig = { - params ["_vehicle", "_config", "_iterateThroughConfig", "_hitpointAliases"]; +// Gun and turret hitpoints aren't hardcoded anymore - dig through config to find correct names +private _fnc_iterateThroughConfig = { + params ["_config"]; TRACE_1("checking config",_config); + private _configName = toLowerANSI configName _config; - private _isGun = ([_config >> "isGun", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; - private _isTurret = ([_config >> "isTurret", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; + private _isGun = getNumber (_config >> "isGun") == 1; + private _isTurret = getNumber (_config >> "isTurret") == 1; private _isEra = _configName in _eraHitpoints; private _isSlat = _configName in _slatHitpoints; private _isMisc = false; - // prevent incompatibilites with old mods - if (_configName isEqualTo "hitturret") then { + // Prevent incompatibilites with old mods + if (_configName == "hitturret") then { _isTurret = true; }; - if (_configName isEqualTo "hitgun") then { + + if (_configName == "hitgun") then { _isGun = true; }; - private _hash = _vehicle getVariable QGVAR(hitpointHash); { - _x params ["_hitType", "_hitPoints"]; + _x params ["_hitArea", "_hitPoints"]; + if (_configName in _hitPoints) then { - [_hash, _configName, [_hitType, _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, [_hitArea, abs getNumber (_config >> "minimalHit")]]; _isMisc = true; }; - } forEach _hitpointAliases; + } forEach _hitPointAliases; if (_isGun || _isTurret || _isEra || _isSlat || _isMisc) then { - TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); if (_isGun) then { - [_hash, _configName, ["gun", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["gun", abs getNumber (_config >> "minimalHit")]]; }; if (_isTurret) then { - [_hash, _configName, ["turret", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["turret", abs getNumber (_config >> "minimalHit")]]; }; if (_isEra) then { - [_hash, _configName, ["era", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["era", abs getNumber (_config >> "minimalHit")]]; }; if (_isSlat) then { - [_hash, _configName, ["slat", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["slat", abs getNumber (_config >> "minimalHit")]]; }; - _vehicle setVariable [QGVAR(hitpointHash), _hash]; + + TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); } else { { - [_vehicle, _x, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; + _x call _fnc_iterateThroughConfig; } forEach configProperties [_config, "isClass _x", true]; }; }; -private _hitpointAliases = [_vehicleConfig >> QGVAR(hitpointAlias), "ARRAY", []] call CBA_fnc_getConfigEntry; -TRACE_1("hitpoint alias",_hitpointAliases); -[_vehicle, _hitpointsConfig, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; -[_vehicle, _turretConfig, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; +private _turretConfig = _vehicleConfig >> "Turrets"; +private _eraHitpoints = (getArray (_vehicleConfig >> QGVAR(eraHitpoints))) apply {toLowerANSI _x}; +private _slatHitpoints = (getArray (_vehicleConfig >> QGVAR(slatHitpoints))) apply {toLowerANSI _x}; -_vehicle allowCrewInImmobile true; -private _eh = _vehicle getVariable [QGVAR(handleDamage), nil]; -if (isNil "_eh") then { - // no clue why, but for some reason this needs to exec'd next frame or else it isnt the last event handler in the system. - // Maybe its overridden somewhere else, but this makes sure it is the last one - [{ - params ["_vehicle"]; - TRACE_1("EH not added yet - added eh now",_vehicle); - private _hd = _vehicle addEventHandler ["HandleDamage", { _this call FUNC(handleDamage) }]; - _vehicle setVariable [QGVAR(handleDamage), _hd]; - }, [_vehicle]] call CBA_fnc_execNextFrame; +private _fnc_toLowerCase = { + _this apply { + if (_x isEqualType []) then { + _x call _fnc_toLowerCase + } else { + toLowerANSI _x + }; + }; }; + +// Convert areas to lower case +private _hitPointAliases = (getArray (_vehicleConfig >> QGVAR(hitpointAlias))) call _fnc_toLowerCase; + +TRACE_1("hitpoint alias",_hitPointAliases); + +_hitPointsConfig call _fnc_iterateThroughConfig; +_turretConfig call _fnc_iterateThroughConfig; + +GVAR(vehicleClassesHitPointHash) set [_typeOf, _hitPointHash]; + +nil diff --git a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf index 818fe6f6ef..9c9e5036da 100644 --- a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf +++ b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf @@ -10,7 +10,7 @@ * None * * Example: - * (vehicle player) call ace_vehicle_damage_fnc_blowOffTurret + * cursorObject call ace_vehicle_damage_fnc_blowOffTurret * * Public: No */ @@ -19,6 +19,7 @@ // The sudden change in the model would cause nearby PhysX objects to get stuck [{ params ["_vehicle"]; + TRACE_1("blowOffTurret",_vehicle); (getArray (configOf _vehicle >> QGVAR(turret))) params [["_model", "", [""]], ["_offset", [0, 0, 0], [[]], 3]]; diff --git a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf b/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf deleted file mode 100644 index 4e847c2d36..0000000000 --- a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf +++ /dev/null @@ -1,118 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Calculates whether or not hit penetrated given armour or not. Only enabled with advanced penetration simulation turned on. - * - * Arguments: - * 0: Source of damage - * 1: The vehicle - * 2: Projectile that hit - * 3: Hitpoint damaged - * - * Return Value: - * None - * - * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_calculatePenetrationInfo; - * - * Public: No - */ - -params ["_source", "_vehicle", "_projectileData", "_hitpointConfig"]; -_projectileData params ["_projectileType", "_projectileConfig"]; -/* - http://www.longrods.ch/peneq.php - https://www.scribd.com/doc/267210898/57-mm-APFSDS-2-000-m#download - Perforation Calculation of APFSDS: - Tungsten/Depleted Uranium: Rods - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) * cos^m (theta) * sqrt (Pp / Pt) * e^((-(c0 + c1 * BHNT) * BHNT) / (Pp * Vt^2)) - - Steel Rods - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) * cos^m (theta) * sqrt (Pp / Pt) * e^((-c * BHNT^k * BHNP^n) / (Pp * Vt^2)) - - Penetration Calculation of Tungsten APFSDS (Used for all penetrators): - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) sqrt (Pp / Pt) * e^((-(c0 + c1 * BHNT) * BHNT) / (Pp * Vt^2)) - - where: - Penetrator: - D = Diameter of penetrator rod (always 22mm) - L = Total length of penetrator in millimeters (always 950mm) - Lw = Working length of rod in millimeters - Vt = impact velocity in Kilometers/Second - theta = NATO Obliquity angle of Penetration - Pp = Penetrator Density in kg/m^3 - BHNP = Brinell hardness number of penetrator - - Target: - Pt = target density in kg/m^3 (always 7840kg/m^3) - d = plate thickness in millimeters - BHNT = Brinell hardness number of target (always 350) - - Material Data: - Tungsten: - Pp = 19300 - BHNP = N/A - - a = 0.994 - c0 = 134.5 - c1 = -0.148 - - Depleted Uranium: - Pp = 18600 - BHNP = N/A - - a = 0.825 - c0 = 90.0 - c1 = -0.0849 - - Steel: - Pp = 7850 - BHNP = 500 - - a = 1.104 - c = 9874 - k = 0.3598 - n = -0.2342 - - Cofficients: - m = -0.224 - b0 = 0.283 - b1 = 0.0656 -*/ - -private _enabled = ([_hitpointConfig >> QGVAR(enabled), "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; -#define MATERIAL_ARRAY ([[0, 0, 0, 0, 0, 0], "steel", [7850, 500, 1.104, 9874, 0.3598, -0.2342], "tungsten", [19300, 0, 0.994, 134.5, -0.148], "depleted_uranium", [18600, 0, 0.825, 90, -0.0849]]) -private _rodMaterialStr = [_projectileConfig >> QGVAR(material), "STRING", "tungsten"] call CBA_fnc_getConfigEntry; -private _rodMaterialParams = MATERIAL_ARRAY select (1 + MATERIAL_ARRAY find toLowerANSI _rodMaterial); - -if !(_enabled) exitWith { [false, 0, 0, 0, 0] }; -if (_rodMaterialParams isEqualTo [0, 0, 0, 0, 0, 0]) exitWith { [] }; - -private _tanX = 2 * (0.283 * 0.0656 * (1)); -private _tanh = 1 / (((exp _tanX) - 1) / ((exp _tanX) + 1)); -private _cosm = (cos 0) ^ -0.224; -private _lw = 950; // technically this would be something else depending on armour slant but this is a good enough aproximation - -private _aproximateVelocity = 0; - -private _perf_pLw = 0; -private _pen_pLw = 0; -if (_rodMaterialStr isEqualTo "steel") then { - _rodMaterialParams params ["_Pp", "_BHNP", "_a", "_c", "_k", "_n"]; - private _exp = (-_c * 350^_k * _BHNP^_n) / (_Pp * _aproximateVelocity * _aproximateVelocity); - _pen_pLw = _a * _tanh * sqrt (_Pp / 7840) * exp _exp; - _perf_pLw = _pen_pLw * _cosm; -} else { - _rodMaterialParams params ["_Pp", "_BHNP", "_a", "_c0", "_c1"]; - private _exp = (-(_c0 + _c1 * 350) * 350) / (_Pp * _aproximateVelocity * _aproximateVelocity); - _pen_pLw = _a * _tanh * _cosm * sqrt (_Pp / 7840) * exp _exp; - _perf_pLw = _pen_pLw * _cosm; -}; - -private _perforationDistance = _lw * _perf_pLw; -private _penetrationDistance = _lw * _pen_pLw; -private _hitpointEffectiveArmour = [_hitpointConfig >> QGVAR(thickness), "NUMBER", 0] call CBA_fnc_getConfigEntry; -private _hitpointEffectiveSlope = [_hitpointConfig >> QGVAR(slope), "NUMBER", 0] call CBA_fnc_getConfigEntry; -_penetrationDistance = _penetrationDistance * cos (_hitpointEffectiveSlope); - -[_penetrationDistance > _hitpointEffectiveArmour, _penetrationDistance - _hitpointEffectiveArmour, _penetrationDistance, _perforationDistance, _hitpointEffectiveArmour] diff --git a/addons/vehicle_damage/functions/fnc_detonate.sqf b/addons/vehicle_damage/functions/fnc_detonate.sqf deleted file mode 100644 index 7f0dce28c9..0000000000 --- a/addons/vehicle_damage/functions/fnc_detonate.sqf +++ /dev/null @@ -1,27 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Detonates vehicle ammo and heavily wounds all inside. - * - * Arguments: - * 0: The vehicle - * 1: Person who caused detonation (default: objNull) - * - * Return Value: - * None - * - * Example: - * [tank2] call ace_vehicle_damage_fnc_detonate; - * - * Public: No - */ - -params ["_vehicle", ["_injurer", objNull]]; - -if (((_vehicle call EFUNC(cookoff,getVehicleAmmo)) select 1) > 0) then { - { - [QGVAR(medicalDamage), [_x, _injurer, _injurer], _x] call CBA_fnc_targetEvent; - } forEach (crew _vehicle); -}; - -[QEGVAR(cookoff,detonateAmmunitionServer), [_vehicle, false, _injurer, _injurer]] call CBA_fnc_serverEvent; diff --git a/addons/vehicle_damage/functions/fnc_handleBail.sqf b/addons/vehicle_damage/functions/fnc_handleBail.sqf index 97aad2cd32..6c9f23c82b 100644 --- a/addons/vehicle_damage/functions/fnc_handleBail.sqf +++ b/addons/vehicle_damage/functions/fnc_handleBail.sqf @@ -4,64 +4,66 @@ * Handles whether or not the crew should bail. * * Arguments: - * 0: The vehicle - * 1: Can the vehicle move? - * 2: Can the vehicle shoot? + * 0: Vehicle * * Return Value: * None * * Example: - * [tank1, false, true] call ace_vehicle_damage_fnc_handleBail + * cursorObject call ace_vehicle_damage_fnc_handleBail * * Public: No */ -params ["_vehicle", "_canMove", "_canShoot"]; -private _isCar = (_vehicle isKindOf "Car" && { !(_vehicle isKindOf "Wheeled_APC_F") }); +params ["_vehicle"]; +TRACE_1("handleBail",_vehicle); -if (_canMove) then { - _canMove = alive driver _vehicle; -}; +private _isCar = _vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}; -if (_canShoot) then { - _canShoot = alive gunner _vehicle; -}; +// canFire command is broken, hence the variable +private _canMove = (_vehicle getVariable [QGVAR(canMove), true]) && {alive driver _vehicle}; +private _canShoot = (_vehicle getVariable [QGVAR(canShoot), true]) && {alive gunner _vehicle}; -_vehicle setVariable[QGVAR(canMove), _canMove]; -_vehicle setVariable[QGVAR(canShoot), _canShoot]; +_vehicle setVariable [QGVAR(canMove), _canMove]; +_vehicle setVariable [QGVAR(canShoot), _canShoot]; private _rand = random 1; if (_isCar) then { - if !(_canMove) then { - [_vehicle] spawn FUNC(abandon); - LOG_3("[%1] can't move and is bailing and is a car [%2 | %3]",_vehicle,_canMove,_isCar); + if (!_canMove) then { + _vehicle call FUNC(abandon); + + TRACE_3("car immobile - bailing",_vehicle,_canMove,_isCar); }; } else { - if (!_canMove && !_canShoot ) exitWith { // If you can't move and you can't shoot, you better GTFO - [_vehicle] spawn FUNC(abandon); - LOG_3("[%1] is a sitting duck and is bailing [%2 | %3]",_vehicle,_canMove,_canShoot); + // If you can't move and you can't shoot, you better GTFO + if (!_canMove && !_canShoot) exitWith { + _vehicle call FUNC(abandon); + + TRACE_3("immobile and can't shoot - bailing",_vehicle,_canMove,_canShoot); }; - if (!_canShoot && !_isCar) then { - if (BAILOUT_CHANCE_SHOOT > _rand) then { // 50% chance of bailing out if turret/gun is destroyed - [_vehicle] spawn FUNC(abandon); - LOG_4("[%1] Cannot shoot and is bailing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + if (!_canShoot) then { + // 50% chance of bailing out if turret/gun is disabled + if (BAILOUT_CHANCE_SHOOT > _rand) then { + _vehicle call FUNC(abandon); + + TRACE_4("can't shoot - bailing",_vehicle,_rand,_canMove,_canShoot); } else { _vehicle allowFleeing 1; - LOG_4("[%1] Cannot shoot and is fleeing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + + TRACE_4("fleeing",_vehicle,_rand,_canMove,_canShoot); }; }; - if !(_canMove) then { - if (BAILOUT_CHANCE_MOVE > _rand) then { // 80% Chance of bailing out if engine is destroyed - [_vehicle] spawn FUNC(abandon); - LOG_4("[%1] Cannot move and is bailing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + if (!_canMove) then { + // 80% Chance of bailing out if engine is disabled + if (BAILOUT_CHANCE_MOVE > _rand) then { + _vehicle call FUNC(abandon); + + TRACE_4("immobile - bailing",_vehicle,_rand,_canMove,_canShoot); } else { - LOG_4("[%1] Cannot move and is bunkering with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + TRACE_4("immobile - bunkering",_vehicle,_rand,_canMove,_canShoot); }; }; }; - - diff --git a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf index 3e7b83ebb6..4558359695 100644 --- a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf +++ b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf @@ -1,59 +1,71 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks hitpoint damage and determines if a vehicle should cookoff. + * Checks hitpoint damage and determines if a vehicle should cook off. * * Arguments: - * 0: The vehicle + * 0: Vehicle * 1: Chance of fire * 2: Intensity of cookoff - * 3: Person who instigated cookoff (default: objNull) - * 4: Part of vehicle which got hit (default: "") - * 5: Whether or not the vehicle can spawn ring-fire effect (default: false) - * 6: Can Jet (default: true) + * 3: Source of damage + * 4: Person who caused damage + * 5: Part of vehicle which got hit (default: "") + * 6: Whether or not the vehicle can spawn ring-fire effect (default: false) + * 7: Whether or not the vehicle can spawn jet-fire effect (default: true) * * Return Value: - * If cooked off + * If vehicle started or already cooking off * * Example: - * [tank2, 0.1, 5] call ace_vehicle_damage_fnc_handleCookoff; + * [cursorObject, 0.1, 5, player, player] call ace_vehicle_damage_fnc_handleCookoff * * Public: No */ -params ["_vehicle", "_chanceOfFire", "_intensity", ["_injurer", objNull], ["_hitPart", ""], ["_canRing", false], ["_canJet", true]]; +params ["_vehicle", "_chanceOfFire", "_intensity", "_source", "_instigator", ["_hitPart", ""], ["_canRing", true], ["_canJet", true]]; +TRACE_8("handleCookoff",_vehicle,_chanceOfFire,_intensity,_source,_instigator,_hitPart,_canRing,_canJet); // Ignore if the vehicle is already cooking off -if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith {true}; +if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith { + TRACE_3("already cooking off",_vehicle,_chanceOfFire,_intensity); + + true // return +}; _chanceOfFire = _chanceOfFire * EGVAR(cookoff,probabilityCoef); -if (_chanceOfFire >= random 1) exitWith { - private _configOf = configOf _vehicle; - private _fireDetonateChance = [_configOf >> QGVAR(detonationDuringFireProb), "number", 0] call CBA_fnc_getConfigEntry; - if (_canRing) then { - _canRing = ([_configOf >> QGVAR(canHaveFireRing), "number", 0] call CBA_fnc_getConfigEntry) == 1; - }; +// Failure to cook off +if (_chanceOfFire == 0 || {_chanceOfFire < random 1}) exitWith { + TRACE_3("no cook-off",_vehicle,_chanceOfFire,_intensity); - if (_canJet) then { - _canJet = ([_configOf >> QEGVAR(cookoff,canHaveFireJet), "number", 1] call CBA_fnc_getConfigEntry) == 1; - }; - - private _delayWithSmoke = _chanceOfFire < random 1; - private _detonateAfterCookoff = (_fireDetonateChance / 4) > random 1; - - private _source = ""; - if (_hitPart == "engine") then { - _source = ["hit_engine_point", "HitPoints"]; - }; - - [QEGVAR(cookOff,cookOffServer), [_vehicle, _intensity, _injurer, _injurer, _delayWithSmoke, _fireDetonateChance, _detonateAfterCookoff, _source, _canRing, _canJet]] call CBA_fnc_serverEvent; - LOG_4("Cooking-off [%1] with a chance-of-fire [%2] - Delayed Smoke | Detonate after cookoff [%3 | %4]",_vehicle,_chanceOfFire,_delayWithSmoke,_detonateAfterCookoff); - [_vehicle] spawn FUNC(abandon); - LOG_1("[%1] is on fire is bailing",_vehicle); - - true + false // return }; -LOG_2("[%1] No Cook-off - Chance of fire [%2]",_vehicle,_chanceOfFire); -false +// Vehicle will cook off +private _configOf = configOf _vehicle; +private _fireDetonateChance = getNumber (_configOf >> QGVAR(detonationDuringFireProb)); + +if (_canRing) then { + _canRing = getNumber (_configOf >> QGVAR(canHaveFireRing)) == 1; +}; + +if (_canJet) then { + _canJet = getNumber (_configOf >> QEGVAR(cookoff,canHaveFireJet)) == 1; +}; + +private _delaySmoke = _chanceOfFire < random 1; +private _detonateAfterCookoff = (_fireDetonateChance / 4) > random 1; + +private _source = ""; + +if (_hitPart == "engine") then { + _source = ["hit_engine_point", "HitPoints"]; +}; + +[QEGVAR(cookOff,cookOffServer), [_vehicle, _intensity, _injurer, _injurer, _delayWithSmoke, _fireDetonateChance, _detonateAfterCookoff, _source, _canRing, _canJet]] call CBA_fnc_serverEvent; +TRACE_4("cooking-off",_vehicle,_chanceOfFire,_delaySmoke,_detonateAfterCookoff); + +// Abandon vehicle +_vehicle call FUNC(abandon); + +true // return diff --git a/addons/vehicle_damage/functions/fnc_handleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleDamage.sqf index 51bf1be97d..733d4f2321 100644 --- a/addons/vehicle_damage/functions/fnc_handleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDamage.sqf @@ -4,91 +4,88 @@ * Called by "HandleDamage" event handler. Sets up hit array for this frame's damage. * * Arguments: - * 0: The vehicle - * 1: Name of selection where unit was damaged (unused) - * 2: Damage taken - * 3: Source unit of damage (unused) + * 0: Vehicle + * 1: Selection + * 2: New level of damage + * 3: Source of damage * 4: Projectile that caused damage - * 5: Hit part index of hit point - * 6: Instigator of damage (unused) - * 7: Hit point config name + * 5: Hit index + * 6: Person who caused damage + * 7: Hit point * * Return Value: - * Current or maximum damage of part + * Current or maximum damage of part * * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_handleDamage; + * [cursorObject, "hit_engine_point", 0.5, player, projectile, 1, player, "HitEngine"] call ace_vehicle_damage_fnc_handleDamage * * Public: No */ -params ["_vehicle", "_hitSelection", "_damage", "", "_projectile", "_hitIndex", "", "_hitPoint"]; -TRACE_6("HandleDamage event inputs",_vehicle,_hitSelection,_damage,_projectile,_hitIndex,_hitPoint); +params ["_vehicle", "_selection", "_newDamage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; +TRACE_8("handleDamage",_vehicle,_selection,_newDamage,_source,_projectile,_hitIndex,_instigator,_hitPoint); -private _returnHit = if (_hitSelection isNotEqualTo "") then { +if (!local _vehicle) exitWith {}; + +private _currentDamage = if (_selection != "") then { _vehicle getHitIndex _hitIndex } else { damage _vehicle }; if !(_projectile in ["ace_ammoExplosion", "ACE_ammoExplosionLarge"]) then { - if (local _vehicle) then { - // set up hit array so we can execute all damage next frame. Always in order of hit done. - private _hitHash = _vehicle getVariable [QGVAR(hitHash), nil]; - if (isNil "_hitHash") then { - _hitHash = [[], nil] call CBA_fnc_hashCreate; - }; - private _currentFrameArray = [_hitHash, diag_frameNo] call CBA_fnc_hashGet; - if (isNil "_currentFrameArray") then { - _currentFrameArray = []; - }; - // if a valid hit, process it - if !((_hitPoint find "#light") >= 0 || { _damage <= 0 }) then { - if (_currentFrameArray isEqualTo []) then { - [{ - params ["_vehicle", "_processingFrame"]; - private _frameHash = _vehicle getVariable [QGVAR(hitHash), nil]; - private _hitArray = [_frameHash, _processingFrame] call CBA_fnc_hashGet; - if (_hitArray isEqualTo []) exitWith {}; + // If an invalid hit, don't process it + if (_newDamage <= 0 || {"#light" in _hitPoint}) exitWith {}; - reverse _hitArray; - TRACE_3("processing data from old frame",diag_frameNo,_processingFrame,_hitArray); - { - _x params ["_vehicle", "_selection", "_damage", "_injurer", "_projectile", "_hitIndex", "", "_hitPoint"]; + // Set up hit array so we can execute all damage next frame. Always in order of hit done. + private _hitHash = _vehicle getVariable QGVAR(hitHash); + private _currentFrameArray = _hitHash getOrDefault [diag_frameNo, [], true]; - private _returnHit = if (_selection isNotEqualTo "") then { - _vehicle getHitIndex _hitIndex - } else { - damage _vehicle - }; + if (_currentFrameArray isEqualTo []) then { + [{ + params ["_vehicle", "_processingFrame"]; - private _newDamage = _damage - _returnHit; - if !([_vehicle, _hitPoint, _hitIndex, _injurer, _returnHit, _newDamage, _projectile, _selection] call FUNC(handleVehicleDamage)) exitWith { - LOG_2("cancelling rest of vehicle damage queue ( [%1] items left out of [%2] )",(count (_hitArray#1)) - _forEachIndex,count (_hitArray#1)) - }; - } forEach _hitArray; + private _hitHash = _vehicle getVariable QGVAR(hitHash); + private _hitArray = _hitHash deleteAt _processingFrame; - [_frameHash, _processingFrame] call CBA_fnc_hashRem; + if (_hitArray isEqualTo []) exitWith {}; - }, [_vehicle, diag_frameNo]] call CBA_fnc_execNextFrame; - }; - _currentFrameArray pushBack _this; - }; + TRACE_3("processing data from old frame",diag_frameNo,_processingFrame,_hitArray); - [_hitHash, diag_frameNo, _currentFrameArray] call CBA_fnc_hashSet; - _vehicle setVariable [QGVAR(hitHash), _hitHash]; + // Start from newest damage and work backwards + { + _x params ["_vehicle", "_selection", "_newDamage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; + + private _currentDamage = if (_selection != "") then { + _vehicle getHitIndex _hitIndex + } else { + damage _vehicle + }; + + private _addedDamage = _newDamage - _currentDamage; + + TRACE_1("handleDamage",_currentDamage); + + if !([_vehicle, _hitPoint, _hitIndex, _selection, _addedDamage, _projectile, _source, _instigator] call FUNC(handleVehicleDamage)) exitWith { + TRACE_2("cancelling rest of vehicle damage queue",(count (_hitArray#1)) - _forEachIndex,count (_hitArray#1)) + }; + } forEachReversed _hitArray; + }, [_vehicle, diag_frameNo]] call CBA_fnc_execNextFrame; }; + + _currentFrameArray pushBack _this; }; -// damage is never to be handled in-engine. Always handle out of engine with this event handler -// don't return 0 or else old parts will be reset in damage -private _criticalDamageIndex = (CRITICAL_HITPOINTS findIf { _x isEqualTo _hitPoint }) + 1; -if (_criticalDamageIndex > 0) then { - _returnHit = (_returnHit min (CRITICAL_HITPOINTS select _criticalDamageIndex)); +// Damage is never to be handled in-engine. Always handle out of engine with this event handler +// Don't return 0 or else old parts will be reset in damage +private _criticalDamageIndex = CRITICAL_HITPOINTS findIf {_x == _hitPoint}; + +if (_criticalDamageIndex != -1) then { + _currentDamage = _currentDamage min (CRITICAL_HITPOINTS_THRESHOLDS select _criticalDamageIndex); }; -if (_hitPoint isEqualTo "" && _hitIndex < 0) then { - _returnHit = _returnHit min 0.89; +if (_hitPoint == "" && {_hitIndex < 0}) then { + _currentDamage = _currentDamage min 0.89; }; -_returnHit +_currentDamage diff --git a/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf b/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf index fdf6f9c6d3..10485d5ce9 100644 --- a/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf @@ -20,7 +20,7 @@ params ["_vehicle", "", "", "", "_ammo"]; if (alive _vehicle) exitWith {}; -TRACE_2("ejectIfDestroyed HDEH",typeOf _vehicle,_this); +TRACE_2("handleDamageEjectIfDestroyed",typeOf _vehicle,_this); if (!IS_EXPLOSIVE_AMMO(_ammo)) then { { diff --git a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf index 8f317323fa..9fdaa3b0c2 100644 --- a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf @@ -1,37 +1,59 @@ #include "..\script_component.hpp" /* - * Author: tcvm - * Checks hitpoint damage and determines if a vehicle should cookoff. + * Author: tcvm, johnb43 + * Checks hitpoint damage and determines if a vehicle should detonate its ammo. * * Arguments: - * 0: The vehicle + * 0: Vehicle * 1: Chance of detonation - * 2: Vehicle ammo array - * 3: How much explosive ammo is inside vehicle - * 4: How much non-explosive ammo inside vehicle - * 5: Person who instigated damage (default: objNull) + * 2: If the vehicle should be knocked out + * 3: If the crew should be injured + * 4: Source of damage + * 5: Person who caused damage * * Return Value: - * Detonated + * None * * Example: - * [tank2, 0.5] call ace_vehicle_damage_fnc_handleDetonation; + * [cursorObject, 0.5, true, player, player] call ace_vehicle_damage_fnc_handleDetonation * * Public: No */ -params ["_vehicle", "_chanceOfDetonate", "_vehicleAmmo", "_explosiveAmmoCount", "_nonExplosiveAmmoCount", ["_injurer", objNull]]; - -private _isKnockedOut = _explosiveAmmoCount > 0; +params ["_vehicle", "_chanceToDetonate", "_knockOut", "_injureCrew", "_source", "_instigator"]; // Ignore if the vehicle is already detonating ammo -if (_vehicle getVariable [QEGVAR(cookoff,isAmmoDetonating), false]) exitWith {_isKnockedOut}; +if (_vehicle getVariable [QEGVAR(cookoff,isAmmoDetonating), false]) exitWith { + TRACE_2("already detonating",_vehicle,_chanceToDetonate); -if (_chanceOfDetonate >= random 1) exitWith { - [_vehicle, _injurer, _vehicleAmmo] call FUNC(detonate); - LOG_2("Detonating [%1] with a chance-to-detonate [%2]",_vehicle,_chanceOfDetonate); - _isKnockedOut + if (_knockOut) then { + [_vehicle, _source, _instigator] call FUNC(knockOut); + }; + + _knockOut // return }; -LOG_2("[%1] No Detonation - Chance of detonation [%2]",_vehicle,_chanceOfDetonate); -false +// Failure to detonate +if (_chanceToDetonate == 0 || {_chanceToDetonate < random 1}) exitWith { + TRACE_2("no detonation",_vehicle,_chanceToDetonate); + + false // return +}; + +// Vehicle will be detonated +if (_injureCrew) then { + { + [QGVAR(medicalDamage), [_x, _source, _instigator], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); +}; + +TRACE_2("detonation",_vehicle,_chanceToDetonate); + +// Detonate the vehicle +[QEGVAR(cookoff,detonateAmmunitionServer), [_vehicle, false, _source, _instigator]] call CBA_fnc_serverEvent; + +if (_knockOut) then { + [_vehicle, _source, _instigator] call FUNC(knockOut); +}; + +_knockOut // return diff --git a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf index 02033b83be..4654b616d0 100644 --- a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf @@ -4,96 +4,101 @@ * Process vehicle hit. * * Arguments: - * 0: The vehicle - * 1: The hitpoint which got hit - * 2: The index of what got hit - * 3: The damage that the new part took - * 4: Person who hit vehicle - * 5: Damage before hit - * 6: Damage after hit - * 7: Projectile - * 8: Selection that got hit + * 0: Vehicle + * 1: Hit point + * 2: Hit index + * 3: Selection + * 4: Added damage to part + * 5: Projectile + * 6: Source of damage + * 7: Person who caused damage * * Return Value: - * Whether or not to continue handling last frame's damage + * Whether or not to continue handling last frame's damage * * Example: - * [ace_vehicle_damage_fnc_handleVehicleDamage, tank1, "Hit_Engine", 12]] call CBA_fnc_execNextFrame + * [ace_vehicle_damage_fnc_handleVehicleDamage, [cursorObject, "HitEngine", 12, "hit_engine_point", 0.25, projectile, player, player]] call CBA_fnc_execNextFrame * * Public: No */ -params["_vehicle", "_hitPoint", "_hitIndex", "_injurer", "_oldDamage", "_newDamage", "_projectile", "_selection"]; -TRACE_6("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_injurer,_oldDamage,_newDamage); -if !(alive _vehicle) exitWith { - private _eventHandler = _vehicle getVariable[QGVAR(handleDamage), nil]; - if !(isNil "_eventHandler") then { - _vehicle removeEventHandler ["HandleDamage", _eventHandler]; +params ["_vehicle", "_hitPoint", "_hitIndex", "_selection", "_addedDamage", "_projectile", "_source", "_instigator"]; +TRACE_8("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_selection,_addedDamage,_projectile,_source,_instigator); + +if (!alive _vehicle) exitWith { + private _handleDamageEH = _vehicle getVariable [QGVAR(handleDamage), nil]; + + if (!isNil "_handleDamageEH") then { + _vehicle removeEventHandler ["HandleDamage", _handleDamageEH]; }; - LOG_1("Vehicle [%1] no longer alive",_vehicle); - true + + TRACE_1("vehicle no longer alive",_vehicle); + + false }; _hitPoint = toLowerANSI _hitPoint; -private _hitpointHash = _vehicle getVariable [QGVAR(hitpointHash), []]; -private _type = if (_hitpointHash isEqualTo []) then { - "exit" -} else { - ([_hitpointHash, _hitPoint] call CBA_fnc_hashGet) select 0 -}; +private _hitPointHash = GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]; +private _type = (_hitPointHash getOrDefault [_hitPoint, []]) select 0; -if (isNil "_type") then { - _type = "exit"; -}; - -// generic structural damage will be transfered into hull damage for simulation's sake +// Generic structural damage will be transfered into hull damage for simulation's sake private _structural = false; -if (_selection isEqualTo "") then { + +if (_selection == "") then { _type = "hull"; _hitPoint = "hithull"; _structural = true; + TRACE_1("structural damage",_selection); - _newDamage = abs _newDamage; + + _addedDamage = abs _addedDamage; }; -if (_type isEqualTo "exit") exitWith { LOG_1("No relevant hitpoints hit [%1]. Exiting",_hitPoint); true }; +if (isNil "_type") exitWith { + TRACE_1("no relevant hitpoints hit, exiting",_hitPoint); + + true +}; // Ignore multiple hits at the same time private _ignoreHit = false; private _ignoreBailCheck = false; private _multHit = _vehicle getVariable [QGVAR(hitTime), nil]; + if (isNil "_multHit") then { - _vehicle setVariable[QGVAR(hitTime), [CBA_missionTime, _injurer, [_hitPoint]]]; + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; } else { private _hitPointInOldArray = _hitPoint in (_multHit select 2); - private _withinTime = (CBA_missionTime <= (_multHit select 0) + CONST_TIME) && { _injurer == (_multHit select 1) }; + private _withinTime = (CBA_missionTime <= (_multHit select 0) + CONST_TIME) && {_source == (_multHit select 1)}; + if (_hitPointInOldArray && _withinTime) then { _ignoreHit = true; } else { // If the hitpoint isnt in the old array then that means that the time expired and a new array should be generated - if !(_hitPointInOldArray) then { + if (!_hitPointInOldArray) then { private _oldHitPoints = _multHit select 2; _oldHitPoints pushBack _hitPoint; - _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _injurer, _oldHitPoints]]; + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, _oldHitPoints]]; + _ignoreBailCheck = true; } else { - _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _injurer, [_hitPoint]]]; + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; }; }; }; + if (_ignoreHit && !_structural) exitWith { - LOG_3("Ignoring multiple hits done to vehicle [%1] by [%2] -- hitpoint [%3].",_vehicle,_injurer,_hitPoint); + TRACE_3("ignoring multiple hits done to vehicle",_vehicle,_source,_hitPoint); + true }; -LOG_3("Processing hit done to vehicle [%1] by [%2] at time [%3].",_vehicle,_injurer,CBA_missionTime); -if !([_vehicle, _projectile, _hitIndex, _newDamage, [_hitpointHash, _hitPoint] call CBA_fnc_hashGet, _injurer] call FUNC(processHit)) exitWith { false }; +TRACE_3("processing hit done to vehicle",_vehicle,_source,CBA_missionTime); -private _canMove = _vehicle getVariable[QGVAR(canMove), true]; -private _canShoot = _vehicle getVariable[QGVAR(canShoot), true]; +if !([_vehicle, _hitPoint, _hitIndex, _addedDamage, _projectile, _source, _instigator] call FUNC(processHit)) exitWith {false}; -if !(_ignoreBailCheck) then { - [_vehicle, _canMove, _canShoot] call FUNC(handleBail); +if (!_ignoreBailCheck) then { + _vehicle call FUNC(handleBail); }; true diff --git a/addons/vehicle_damage/functions/fnc_knockOut.sqf b/addons/vehicle_damage/functions/fnc_knockOut.sqf index 5c8d1697a6..753255c99f 100644 --- a/addons/vehicle_damage/functions/fnc_knockOut.sqf +++ b/addons/vehicle_damage/functions/fnc_knockOut.sqf @@ -1,37 +1,37 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Knock out vehicle from battle. Destroy all internal hitpoints. + * Knock out a vehicle from battle by destroying all internal hitpoints. * * Arguments: - * 0: The vehicle + * 0: Vehicle + * 1: Source of damage + * 2: Person who caused damage * * Return Value: * None * * Example: - * [vehicle player] call ace_vehicle_damage_fnc_knockOut + * [cursorObject, player, player] call ace_vehicle_damage_fnc_knockOut * * Public: No */ -params ["_vehicle"]; -private _hash = _vehicle getVariable [QGVAR(hitpointHash), nil]; -if (isNil "_hash") exitWith {}; +params ["_vehicle", "_source", "_instigator"]; +TRACE_3("knockOut",_vehicle,_source,_instigator); -[_hash, { - private _hitpointAlias = _value#0; - if (_hitpointAlias isEqualTo "hull") then { - [_vehicle, -1, _key, 0.89] call FUNC(addDamage); +{ + private _hitArea = _y select 0; + + if (_hitArea == "hull") then { + [_vehicle, _x, -1, 0.89, _source, _instigator] call FUNC(setDamage); } else { - if (_hitpointAlias in ["fuel", "turret", "gun", "engine"]) then { - if ((0.3 > random 1) || { _hitpointAlias isEqualTo "engine" }) then { - [_vehicle, -1, _key, 1] call FUNC(addDamage); + if (_hitArea in ["fuel", "turret", "gun", "engine"]) then { + if ((0.3 > random 1) || {_hitArea == "engine"}) then { + [_vehicle, _x, -1, 1, _source, _instigator] call FUNC(setDamage); } else { - private _currentDamage = _vehicle getHitpointDamage _key; - [_vehicle, -1, _key, (_currentDamage + (0.3 max random 1)) min 1] call FUNC(addDamage); + [_vehicle, _x, -1, ((_vehicle getHitPointDamage _x) + (0.3 max random 1)) min 1, _source, _instigator] call FUNC(setDamage); }; }; }; -}] call CBA_fnc_hashEachPair; - +} forEach (GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]); diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 2402df7fc2..9c87c4b037 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -1,133 +1,132 @@ #include "..\script_component.hpp" /* - * Author: tcvm + * Author: tcvm, johnb43 * Process hit by projectile against vehicle and apply appropiate damage to part. * * Arguments: - * 0: The vehicle - * 1: Projectile that hit - * 2: Hit index of potentially damaged part - * 3: New damage done to part - * 4: Information about hitpoint - * 5: Person who caused damage + * 0: Vehicle + * 1: Hit point + * 2: Hit index + * 3: Added damage to part + * 4: Projectile + * 5: Source of damage + * 6: Person who caused damage * * Return Value: - * None + * Whether or not to continue handling last frame's damage * * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_processHit; + * [cursorObject, "HitEngine", 1, 0.25, projectile, player, player] call ace_vehicle_damage_fnc_processHit * * Public: No */ -params ["_vehicle", "_projectile", "_hitIndex", "_newDamage", "_hitpointData", "_injurer"]; -_hitpointData params ["_hitArea", "_hitpointConfig", "_hitpointName"]; +params ["_vehicle", "_hitPoint", "_hitIndex", "_addedDamage", "_projectile", "_source", "_instigator"]; +TRACE_7("processHit",_vehicle,_hitPoint,_hitIndex,_addedDamage,_projectile,_source,_instigator); -private _return = true; - -if (_newDamage < 0) then { - _newDamage = -_newDamage; -}; +_addedDamage = abs _addedDamage; private _currentPartDamage = _vehicle getHitIndex _hitIndex; -private _nextPartDamage = _currentPartDamage + _newDamage; +private _newPartDamage = _currentPartDamage + _addedDamage; + +// Damage is high enough for immediate destruction +if (_addedDamage >= 15) exitWith { + TRACE_2("immediate destruction - high damage",_addedDamage,_currentPartDamage); -// damage is high enough for immediate destruction -if (_newDamage >= 15) exitWith { - TRACE_2("immediate destruction - high damage",_newDamage,_currentPartDamage); - [_vehicle] call FUNC(knockOut); - [_vehicle, 1] call FUNC(handleDetonation); // Kill everyone inside for very insane damage { - [QGVAR(medicalDamage), [_x, _injurer, _injurer, true], _x] call CBA_fnc_targetEvent; + [QGVAR(medicalDamage), [_x, _source, _instigator, true], _x] call CBA_fnc_targetEvent; } forEach (crew _vehicle); - _vehicle setDamage 1; - _return = false; - _return + + // setDamage triggers "Killed" EH in cookoff, which starts ammo cook-off + [QGVAR(setDamage), [_vehicle, [1, true, _source, _instigator]]] call CBA_fnc_serverEvent; + + false }; private _projectileConfig = _projectile call CBA_fnc_getObjectConfig; -private _warheadTypeStr = getText (_projectileConfig >> "warheadName"); -private _incendiary = [_projectileConfig >> QGVAR(incendiary), "NUMBER", -1] call CBA_fnc_getConfigEntry; -private _warheadType = ["HE", "AP", "HEAT", "TandemHEAT"] find _warheadTypeStr; // numerical index for warhead type for quicker checks. Numbers defined in script_macros.hpp -if (_warheadType < 0) then { - _warheadType = WARHEAD_TYPE_NONE; -}; -if (_incendiary < 0) then { - _incendiary = [0.3, 0.1, 1, 1, 0] select _warheadType; -}; +private _warheadTypeStr = toLowerANSI getText (_projectileConfig >> "warheadName"); +private _warheadType = ["he", "ap", "heat", "tandemheat"] find _warheadTypeStr; // numerical index for warhead type for quicker checks. Numbers defined in script_macros.hpp -private _minDamage = [_hitpointConfig >> "minimalHit", "NUMBER", 0] call CBA_fnc_getConfigEntry; -if (_minDamage < 0) then { - _minDamage = -_minDamage; -}; +private _incendiary = [_projectileConfig >> QGVAR(incendiary), "NUMBER", [0.3, 0.1, 1, 1, 0] select _warheadType] call CBA_fnc_getConfigEntry; -private _ammoEffectiveness = 0; -private _projectileExplosive = [_projectileConfig >> "explosive", "NUMBER", 0] call CBA_fnc_getConfigEntry; -private _indirectHit = [_projectileConfig >> "indirectHit", "NUMBER", 0] call CBA_fnc_getConfigEntry; +private _hitPointHash = GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]; +(_hitPointHash getOrDefault [_hitPoint, []]) params ["_hitArea", "_minDamage"]; -if (_warheadType isEqualTo WARHEAD_TYPE_AP) then { - // change damage based on projectile speed (doesn't do this in vanilla ARMA believe it or not) - if !(isNull _injurer) then { - private _airFriction = [_projectileConfig >> "airFriction", "NUMBER", 0] call CBA_fnc_getConfigEntry; - private _distance = _injurer distance _vehicle; - _newDamage = (1 - _projectileExplosive) * _newDamage * exp(_airFriction * _distance); +private _projectileExplosive = getNumber (_projectileConfig >> "explosive"); +private _indirectHit = getNumber (_projectileConfig >> "indirectHit"); + +if (_warheadType == WARHEAD_TYPE_AP) then { + // Change damage based on projectile speed (doesn't do this in vanilla Arma believe it or not) + if (!isNull _source) then { + private _airFriction = getNumber (_projectileConfig >> "airFriction"); + private _distance = _source distance _vehicle; + _addedDamage = (1 - _projectileExplosive) * _addedDamage * exp (_airFriction * _distance); }; }; private _penChance = 1; -if (_newDamage < _minDamage) then { - _penChance = _newDamage / _minDamage; - TRACE_5("minimum damage modifying hit",_newDamage,_penChance,abs _minDamage,_warheadTypeStr,_hitArea); + +// Added damage can't be 0, so don't need to worry about 0 division here +if (_addedDamage < _minDamage) then { + _penChance = _addedDamage / _minDamage; + + TRACE_5("minimum damage modifying hit",_addedDamage,_penChance,_minDamage,_warheadTypeStr,_hitArea); }; if (_penChance < random 1) exitWith { TRACE_1("didn't penetrate",_penChance); - _return + + true }; if (_minDamage == 0) then { _minDamage = 1; }; -if (_warheadType isEqualTo WARHEAD_TYPE_HE) then { +if (_warheadType == WARHEAD_TYPE_HE) then { private _modifiedIndirectHit = _indirectHit / 100; - if (_newDamage > _modifiedIndirectHit) then { - _newDamage = _newDamage / 2; + + if (_addedDamage > _modifiedIndirectHit) then { + _addedDamage = _addedDamage / 2; }; - _newDamage = (_newDamage * (_newDamage / _modifiedIndirectHit)) min _newDamage; + + _addedDamage = (_addedDamage * (_addedDamage / _modifiedIndirectHit)) min _addedDamage; }; -_ammoEffectiveness = if (_warheadType isEqualTo WARHEAD_TYPE_AP) then { - 0.15 max _newDamage +private _ammoEffectiveness = if (_warheadType == WARHEAD_TYPE_AP) then { + 0.15 max _addedDamage } else { - if (_warheadType isEqualTo WARHEAD_TYPE_HE) then { - (_newDamage / (_minDamage + (_indirectHit / 100)) * 0.2) + if (_warheadType == WARHEAD_TYPE_HE) then { + (_addedDamage / (_minDamage + (_indirectHit / 100)) * 0.2) } else { - ((_newDamage / _minDamage) * 0.4) min 1 + ((_addedDamage / _minDamage) * 0.4) min 1 }; }; -TRACE_4("ammo effectiveness",_ammoEffectiveness,_newDamage,_minDamage,_warheadTypeStr); + +TRACE_4("ammo effectiveness",_ammoEffectiveness,_addedDamage,_minDamage,_warheadTypeStr); _incendiary = _incendiary * _ammoEffectiveness; -private _isCar = (_vehicle isKindOf "Car" && { !(_vehicle isKindOf "Wheeled_APC_F") }); +private _isCar = _vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}; + if (_isCar) then { - _ammoEffectiveness = (_ammoEffectiveness + (_ammoEffectiveness * 0.5)) min 1; + _ammoEffectiveness = (_ammoEffectiveness * 1.5) min 1; }; -private _currentVehicleAmmo = _vehicle call EFUNC(cookoff,getVehicleAmmo); +(_vehicle call EFUNC(cookoff,getVehicleAmmo)) params ["_magazines", "_totalAmmo"]; private _chanceOfDetonation = 0; private _explosiveAmmoCount = 0; -private _nonExplosiveAmmoCount = 0; -if ((_currentVehicleAmmo select 0) isNotEqualTo []) then { +if (_magazines isNotEqualTo []) then { private _magConfig = configFile >> "CfgMagazines"; private _ammoConfig = configFile >> "CfgAmmo"; private _countOfExplodableAmmo = 0; + { _x params ["_magazineClassname", "_currentAmmoCount"]; + private _initialAmmoCount = getNumber (_magConfig >> _magazineClassname >> "count"); _chanceOfDetonation = _chanceOfDetonation + (_currentAmmoCount / _initialAmmoCount); _countOfExplodableAmmo = _countOfExplodableAmmo + 1; @@ -135,215 +134,241 @@ if ((_currentVehicleAmmo select 0) isNotEqualTo []) then { private _ammoClassname = getText (_magConfig >> _magazineClassname >> "ammo"); private _explosive = getNumber (_ammoConfig >> _ammoClassname >> "explosive"); private _hit = getNumber (_ammoConfig >> _ammoClassname >> "hit"); - if (_explosive > 0.5 || _hit > 50) then { + + if (_explosive > 0.5 || {_hit > 50}) then { _explosiveAmmoCount = _explosiveAmmoCount + 1; - } else { - _nonExplosiveAmmoCount = _nonExplosiveAmmoCount + 1; }; - } forEach (_currentVehicleAmmo select 0); + } forEach _magazines; + if (_countOfExplodableAmmo != 0) then { _chanceOfDetonation = _chanceOfDetonation / _countOfExplodableAmmo; }; }; -private _chanceToDetonate = 0; -private _chanceOfFire = 0; -private _currentFuel = fuel _vehicle; -private _vehicleConfig = _vehicle call CBA_fnc_getObjectConfig; + +private _return = true; + switch (_hitArea) do { case "engine": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(engineDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _currentFuel * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(engineFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _currentFuel * _penChance; + private _vehicleConfig = configOf _vehicle; + private _currentFuel = fuel _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(engineDetonationProb)) * _incendiary * _currentFuel * _penChance; - private _cookoffIntensity = 4 * _currentFuel; - TRACE_6("hit engine",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_4("hit engine",_chanceToDetonate,_incendiary,_chanceOfDetonation,_currentFuel); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars + // Knock out and detonate vehicle if necessary + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith {}; + + // Cap damage at 0.9 to avoid hard coded blow up + _newPartDamage = 0.9 min _newPartDamage; + + // Fatal engine/drive system damage (engine and tracks stop working at 0.9) + if (0.8 * _ammoEffectiveness > random 1) then { + _newPartDamage = 0.9; }; - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle] call FUNC(knockOut); - }; - - // cap damage at 0.9 to avoid hard coded blow up - _nextPartDamage = (0.9 min _nextPartDamage); - - // fatal engine/drive system damage - if (_nextPartDamage == 0.9 || { 0.8 * _ammoEffectiveness > random 1 }) then { - [_vehicle, _hitIndex, _hitpointName, 0.9 * _penChance] call FUNC(addDamage); + if (_newPartDamage == 0.9) then { _vehicle setVariable [QGVAR(canMove), false]; - } else { - [_vehicle, _hitIndex, _hitpointName, _nextPartDamage * _penChance] call FUNC(addDamage); }; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, _hitArea, false] call FUNC(handleCookoff); + [_vehicle, _hitPoint, _hitIndex, _newPartDamage * _penChance, _source, _instigator] call FUNC(setDamage); + + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(engineFireProb)) * _incendiary * _currentFuel * _penChance; + private _cookoffIntensity = 4 * _currentFuel; + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator, "engine", false, false] call FUNC(handleCookoff); }; case "hull": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(hullDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(hullFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; + private _vehicleConfig = configOf _vehicle; + private _currentFuel = fuel _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(hullDetonationProb)) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; - private _cookoffIntensity = 1.5 + (_explosiveAmmoCount * _chanceOfFire); - TRACE_6("hit hull",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_4("hit hull",_chanceToDetonate,_incendiary,_chanceOfDetonation,_currentFuel); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars + // Knock out and detonate vehicle if necessary + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith { + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); }; - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - [_vehicle] call FUNC(knockOut); - }; - - private _hash = _vehicle getVariable [QGVAR(hitpointHash), []]; - private _hashKeys = [_hash] call CBA_fnc_hashKeys; - // 25% chance of jamming turret - 25% of mobility kill - 25% of both - 75% chance of critical hull damage private _rand = random 1; + TRACE_2("rolling hull damage",_ammoEffectiveness,_rand); + private _partKill = []; + if (_ammoEffectiveness > _rand) then { _rand = random 1; + TRACE_2("damaged hull part",_ammoEffectiveness,_rand); + switch (true) do { case (_rand < 0.25): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - // iterate through all keys and find appropriate turret - [_hash, { - if (_value#0 isEqualTo "turret") then { - _partKill pushBack _key; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + // Iterate through all keys and find appropriate turret + { + if ((_y select 0) == "turret") then { + _partKill pushBack _x; }; - }] call CBA_fnc_hashEachPair; + } forEach _hitPointHash; + _vehicle setVariable [QGVAR(canShoot), false]; }; case (_rand < 0.5): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - _partKill = _partKill + ENGINE_HITPOINTS#0; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + _partKill append (ENGINE_HITPOINTS select 0); + if !(_vehicle isKindOf "Wheeled_APC_F") then { - _partKill = _partKill + TRACK_HITPOINTS#0; + _partKill append (TRACK_HITPOINTS select 0); }; _vehicle setVariable [QGVAR(canMove), false]; }; case (_rand < 0.75): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - _partKill = _partKill + ENGINE_HITPOINTS#0; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + _partKill append (ENGINE_HITPOINTS select 0); + if !(_vehicle isKindOf "Wheeled_APC_F") then { - _partKill = _partKill + TRACK_HITPOINTS#0; + _partKill append (TRACK_HITPOINTS select 0); }; - // iterate through all keys and find appropriate turret - [_hash, { - if (_value#0 isEqualTo "turret") then { - _partKill pushBack _key; + // Iterate through all keys and find appropriate turret + { + if ((_y select 0) == "turret") then { + _partKill pushBack _x; }; - }] call CBA_fnc_hashEachPair; + } forEach _hitPointHash; _vehicle setVariable [QGVAR(canMove), false]; _vehicle setVariable [QGVAR(canShoot), false]; }; - default{}; }; }; { + [_vehicle, _x, -1, _penChance, _source, _instigator] call FUNC(setDamage); + TRACE_1("doing damage to hitpoint",_x); - [_vehicle, -1, _x, 1 * _penChance] call FUNC(addDamage); } forEach _partKill; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", true] call FUNC(handleCookoff); + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(hullFireProb)) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; + private _cookoffIntensity = 1.5 + (_explosiveAmmoCount * _chanceOfFire); + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator] call FUNC(handleCookoff); }; case "turret": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(turretDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _chanceOfDetonation * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(turretFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _chanceOfDetonation * _penChance; + private _vehicleConfig = configOf _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(turretDetonationProb)) * _incendiary * _chanceOfDetonation * _penChance; - private _cookoffIntensity = _explosiveAmmoCount * _chanceOfFire; - TRACE_6("hit turret",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_3("hit turret",_chanceToDetonate,_incendiary,_chanceOfDetonation); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars - }; - - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle] call FUNC(knockOut); - }; + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith {}; if (0.8 * _ammoEffectiveness > random 1) then { TRACE_1("damaged turret",_ammoEffectiveness * 0.8); - [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); + + [_vehicle, _hitPoint, _hitIndex, _penChance, _source, _instigator] call FUNC(setDamage); + _vehicle setVariable [QGVAR(canShoot), false]; }; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", true] call FUNC(handleCookoff); + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(turretFireProb)) * _incendiary * _chanceOfDetonation * _penChance; + private _cookoffIntensity = _explosiveAmmoCount * _chanceOfFire; + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator] call FUNC(handleCookoff); }; case "gun": { - TRACE_5("hit gun",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel); + TRACE_2("hit gun",_addedDamage,_minDamage); + if (0.8 * _ammoEffectiveness > random 1) then { TRACE_1("damaged gun",_ammoEffectiveness * 0.8); - [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); + + [_vehicle, _hitPoint, _hitIndex, _penChance, _source, _instigator] call FUNC(setDamage); + _vehicle setVariable [QGVAR(canShoot), false]; }; }; case "track": { - private _damage = (0.1 max (0.1 * _newDamage / _minDamage)) min 1; - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _damage) * _penChance] call FUNC(addDamage); - TRACE_3("damaged track",_damage,_newDamage,_minDamage); + private _damage = (0.1 max (0.1 * _addedDamage / _minDamage)) min 1; + + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance] call FUNC(setDamage); + + TRACE_3("damaged track",_damage,_addedDamage,_minDamage); if ((_vehicle getHitIndex _hitIndex) >= 1) then { _vehicle setVariable [QGVAR(canMove), false]; }; }; case "wheel": { - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _newDamage) * _penChance] call FUNC(addDamage); - TRACE_1("damaged wheel",_newDamage); + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _addedDamage) * _penChance, _source, _instigator] call FUNC(setDamage); + + TRACE_1("damaged wheel",_addedDamage); }; case "fuel": { - _chanceOfFire = (_incendiary * _currentFuel * _penChance) / 2; + private _damage = (0.1 max (0.1 * _addedDamage / _minDamage)) min 1; + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance, _source, _instigator] call FUNC(setDamage); + + // No cookoff for cars + if (_isCar) exitWith {}; + + private _currentFuel = fuel _vehicle; + private _chanceOfFire = (_incendiary * _currentFuel * _penChance) / 2; private _cookoffIntensity = _currentFuel * 5; - TRACE_2("damaged fuel",_chanceOfFire,_cookoffIntensity); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars - }; + TRACE_4("damaged fuel",_chanceOfFire,_incendiary,_cookoffIntensity,_currentFuel); - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", false] call FUNC(handleCookoff); - - private _damage = (0.1 max (0.1 * _newDamage / _minDamage)) min 1; - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _damage) * _penChance] call FUNC(addDamage); + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator, "", false, false] call FUNC(handleCookoff); }; case "slat": { TRACE_2("hit slat",_warheadType,_warheadTypeStr); - // incredibly small chance of AP destroying SLAT - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { _warheadType isEqualTo WARHEAD_TYPE_HE } || { 0.01 > random 1 }) then { + + // Incredibly small chance of AP destroying SLAT + if (_warheadType in [WARHEAD_TYPE_HE, WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || {0.01 > random 1}) then { private _currentDamage = _vehicle getHitIndex _hitIndex; + TRACE_3("damaged slat",_warheadType,_warheadTypeStr,_currentDamage); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM }) then { - [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); + if (_warheadType in [WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM, WARHEAD_TYPE_AP]) then { + [_vehicle, _hitPoint, _hitIndex, 1, _source, _instigator] call FUNC(setDamage); } else { - [_vehicle, _hitIndex, _hitpointName, _currentDamage + (0.5 max random 1)] call FUNC(addDamage); + [_vehicle, _hitPoint, _hitIndex, _currentDamage + (0.5 max random 1), _source, _instigator] call FUNC(setDamage); }; - if (_currentDamage < 1 && _warheadType isEqualTo WARHEAD_TYPE_HEAT) then { + if (_currentDamage < 1 && {_warheadType == WARHEAD_TYPE_HEAT}) then { _return = false; }; }; }; case "era": { TRACE_2("hit era",_warheadType,_warheadTypeStr); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { 0.05 > random 1 }) then { - private _currentDamage = _vehicle getHitIndex _hitIndex; - TRACE_3("damaged era",_warheadType,_warheadTypeStr,_currentDamage); - [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); - // dont process anymore damage if this is HEAT - shouldnt happen anyway but ARMA says it does so you know - if (_currentDamage < 1 && _warheadType isEqualTo WARHEAD_TYPE_HEAT) then { + if (_warheadType in [WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || {0.05 > random 1}) then { + private _currentDamage = _vehicle getHitIndex _hitIndex; + + TRACE_3("damaged era",_warheadType,_warheadTypeStr,_currentDamage); + + [_vehicle, _hitPoint, _hitIndex, 1, _source, _instigator] call FUNC(setDamage); + + // Don't process anymore damage if this is HEAT - shouldn't happen anyway but Arma says it does so you know + if (_currentDamage < 1 && {_warheadType == WARHEAD_TYPE_HEAT}) then { _return = false; }; }; }; default { TRACE_1("hit unknown hitpoint??",_hitArea); - } + }; }; _return diff --git a/addons/vehicle_damage/functions/fnc_setDamage.sqf b/addons/vehicle_damage/functions/fnc_setDamage.sqf new file mode 100644 index 0000000000..8b75bff1f7 --- /dev/null +++ b/addons/vehicle_damage/functions/fnc_setDamage.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name. + * + * Arguments: + * 0: Vehicle + * 1: Hit point + * 2: Hit index + * 3: Damage + * 4: Source of damage + * 5: Person who caused damage + * + * Return Value: + * None + * + * Example: + * [cursorObject, "HitEngine", 1, 0.25, player, player] call ace_vehicle_damage_fnc_setDamage + * + * Public: No + */ + +params ["_vehicle", "_hitPoint", "_hitIndex", "_damage", "_source", "_instigator"]; +TRACE_6("setDamage",_vehicle,_hitPoint,_hitIndex,_damage,_source,_instigator); + +private _currentDamage = _vehicle getHitPointDamage _hitPoint; + +if (_damage < _currentDamage) exitWith { + TRACE_3("capping damage at current",_damage,_currentDamage,_hitPoint); +}; + +if (_hitPoint == "#structural") then { + _hitPoint = "hithull"; + _hitIndex = -1; +}; + +if (_hitIndex >= 0) then { + _vehicle setHitIndex [_hitIndex, _damage, true, _source, _instigator]; +} else { + _vehicle setHitPointDamage [_hitPoint, _damage, true, _source, _instigator]; +}; + +if (_hitPoint == "HitEngine" && {_damage >= 0.9}) then { + [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; +}; diff --git a/addons/vehicle_damage/initSettings.inc.sqf b/addons/vehicle_damage/initSettings.inc.sqf index 0d3f324af2..3a1bcf568a 100644 --- a/addons/vehicle_damage/initSettings.inc.sqf +++ b/addons/vehicle_damage/initSettings.inc.sqf @@ -1,19 +1,21 @@ [ - QGVAR(enabled), "CHECKBOX", + QGVAR(enabled), + "CHECKBOX", [ELSTRING(common,Enabled), LSTRING(setting_description)], LSTRING(category_displayName), - false, // default value - true, // isGlobal + false, + 1, {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart -] call CBA_settings_fnc_init; +] call CBA_fnc_addSetting; [ - QGVAR(enableCarDamage), "CHECKBOX", + QGVAR(enableCarDamage), + "CHECKBOX", [LSTRING(carDamage_setting_enable), LSTRING(carDamage_setting_description)], LSTRING(category_displayName), - false, // default value - true, // isGlobal + false, + 1, {[QGVAR(enableCarDamage), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart -] call CBA_settings_fnc_init; +] call CBA_fnc_addSetting; diff --git a/addons/vehicle_damage/script_macros.hpp b/addons/vehicle_damage/script_macros.hpp index 84f3120ac1..43bac7e2f8 100644 --- a/addons/vehicle_damage/script_macros.hpp +++ b/addons/vehicle_damage/script_macros.hpp @@ -7,21 +7,23 @@ #define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5) #define ENGINE_HITPOINTS [["hitengine"], "engine"] -#define HULL_HITPOINTS [["hithull", "hitbody", "#structural"],"hull"] +#define HULL_HITPOINTS [["hithull", "hitbody", "#structural"], "hull"] #define TRACK_HITPOINTS [["hitltrack", "hitrtrack"], "track"] #define WHEEL_HITPOINTS [["hitlbwheel", "hitlmwheel", "hitlfwheel", "hitlf2wheel", "hitrbwheel", "hitrmwheel", "hitrlwheel", "hitrfwheel", "hitrf2wheel"], "wheel"] #define FUEL_HITPOINTS [["hitfuel"], "fuel"] #define ALL_HITPOINTS [ENGINE_HITPOINTS, HULL_HITPOINTS, TRACK_HITPOINTS, WHEEL_HITPOINTS, FUEL_HITPOINTS] -#define CRITICAL_HITPOINTS ["hithull", 0.89, "hitbody", 0.89, "#structural", 0.89, "hitengine", 0.9] +#define CRITICAL_HITPOINTS ["hithull", "hitbody", "#structural", "hitengine"] +#define CRITICAL_HITPOINTS_THRESHOLDS [0.89, 0.89, 0.89, 0.9] #define WARHEAD_TYPE_HE 0 #define WARHEAD_TYPE_AP 1 #define WARHEAD_TYPE_HEAT 2 #define WARHEAD_TYPE_TANDEM 3 -#define WARHEAD_TYPE_NONE 4 #define EJECT_IF_DESTROYED_VEHICLES ["Boat_Transport_02_base_F", "Rubber_duck_base_F"] - -#define CREATE_INCENDIARY_AMMO(ammo,base,inc) class ammo: base { GVAR(incendiary) = inc; } +#define CREATE_INCENDIARY_AMMO(ammo,base,inc)\ +class ammo: base {\ + GVAR(incendiary) = inc;\ +} diff --git a/addons/vehicle_damage/stringtable.xml b/addons/vehicle_damage/stringtable.xml index 4a8fdb4264..7053cc6d3c 100644 --- a/addons/vehicle_damage/stringtable.xml +++ b/addons/vehicle_damage/stringtable.xml @@ -3,7 +3,7 @@ ACE Advanced Vehicle Damage - ACE アドバンスドビークルダメージ + ACE 高度な乗り物ダメージ ACE Dégâts de véhicule avancés ACE Erweiterter Fahrzeugsschaden ACE Danni Veicolo Avanzati @@ -12,42 +12,39 @@ ACE 고급 차량 피해 ACE Продвинутое повреждение техники ACE Daño avanzado de vehículos + ACE Dano avançãdo de veículos - Enable/Disable advanced vehicle damage - アドバンスドビークルダメージを有効/無効にする + Enable advanced vehicle damage Active les dégâts de véhicule avancés. - Aktiviert/Deaktiviert den Erweiterten Fahrzeugsschaden + Aktiviert den Erweiterten Fahrzeugsschaden Abilità danni avanzati ai veicoli - Włącz/Wyłącz zaawansowane uszkodzenia pojazdów - 启用/禁用高级载具损坏 - 고급 차량 피해 활성화/비활성화 - Включить/выключить продвинутое повреждение техники - Habilitar/Deshabilitar el daño avanzado de vehículos - - - Enable/Disable advanced car damage (Experimental) - アドバンスド車ダメージを有効/無効にする (試験的) - Active les dégâts avancés sur les voitures (expérimental). - Aktiviert/Deaktiviert den Erweiterten Fahrzeugsschaden (Experimentell) - Abilita danni avanzati ai veicoli (sperimentale) - Włącz/Wyłącz zaawansowane uszkodzenia w samochodach (eksperymentalne) - 启用/禁用高级车辆损坏(实验性) - 고급 차량 피해(실험용) 활성화/비활성화 - Включить/выключить продвинутое повреждение машин (экспериментальное) - Habilita/Deshabilita el daño avanzado de coche (Experimental) + Włącz zaawansowane uszkodzenia pojazdów + Включить продвинутое повреждение техники + Habilitar el daño avanzado de vehículos + Ativar dano avançado de veículo + 乗り物(Vehicle)に対しての高度なダメージ計算を有効化します - Enable/Disable advanced car damage - アドバンスド車ダメージを有効/無効にする + Enable advanced car damage Dégâts de voiture avancés - Aktiviert/Deaktiviert erweiterten Autoschaden + Aktiviert erweiterten Autoschaden Abilita danni avanzati alle macchine - Włącz/Wyłącz zaawansowane uszkodzenia w samochodach - 启用/禁用高级车辆损坏 - 고급 차량 피해 활성화/비활성화 - Продвинутое повреждение машин - Habilitar/Deshabilitar daño avanzado de coche (Experimental) + Włącz zaawansowane uszkodzenia w samochodach + Habilitar daño avanzado de coche + Habilitar dano avançado para carros + 高度な車ダメージを有効化 + + + Enable advanced car damage (Experimental) + Active les dégâts avancés sur les voitures (expérimental). + Aktiviert den Erweiterten Fahrzeugsschaden (Experimentell) + Abilita danni avanzati ai veicoli (sperimentale) + Włącz zaawansowane uszkodzenia w samochodach (eksperymentalne) + Включить продвинутое повреждение машин (экспериментальное) + Habilitar daño avanzado de coche (Experimental) + Habilitar dano avançado para carros (Experimental) + 車(Car)に対しての高度なダメージ計算を有効化します (試験的機能) Wreck (Turret) diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index b247967fe1..7f89ec4950 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -288,6 +288,7 @@ Unklaren Sperrzustand entfernen 移除不明确的上锁状态 불분명한 잠금상태 제거 + Remover estado de bloqueio ambíguo As Is diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 2fbe4e5246..0c2eb0e4de 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -13,8 +13,7 @@ class CfgWeapons { class ACE_LMG_coax_DenelMG4: LMG_coax {}; class LMG_Minigun: LMG_RCWS { - // Add the following: "2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt" - magazines[] = {"PylonWeapon_2000Rnd_65x39_belt", "1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt","500Rnd_65x39_Belt","500Rnd_65x39_Belt_Tracer_Red_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Yellow_Splash"}; + magazines[] += {"2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"}; }; class HMG_127: LMG_RCWS { diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 741901d75c..6148bcdd25 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -29,6 +29,7 @@ Круиз-контроль включён Control de crucero encendido Régulateur de vitesse activé + Controle de cruzeiro ativado Speed Limiter off @@ -58,6 +59,7 @@ Круиз-контроль выключен Control de crucero apagado Régulateur de vitesse désactivé + Controle de cruzeiro desativado Speed Limit diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index eb7ed94838..2c2e92d24e 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -129,6 +129,7 @@ Значение 0 будет использовать настройки видео по умолчанию Establecer a 0 utiliza las opciones de video por defecto La valeur 0 permet d'utiliser les paramètres vidéo par défaut + Estabelecer em 0 utilizará as configurações padrão de vídeo Client View Distance (On Foot) diff --git a/addons/viewports/stringtable.xml b/addons/viewports/stringtable.xml index be78cdc995..22f7d77813 100644 --- a/addons/viewports/stringtable.xml +++ b/addons/viewports/stringtable.xml @@ -12,6 +12,7 @@ Periscopios Sichtfenster Périscopes + Periscópios Allows crew to look through periscopes @@ -24,6 +25,7 @@ Permite a la tripulación asomarse a través de los periscopios Ermöglicht der Besatzung den Blick durch Periskope Permet à l'équipage de regarder à travers des périscopes. + Permite que a tripulação olhe através de periscópios diff --git a/addons/viewrestriction/stringtable.xml b/addons/viewrestriction/stringtable.xml index fee4a9bf33..7356e6412f 100644 --- a/addons/viewrestriction/stringtable.xml +++ b/addons/viewrestriction/stringtable.xml @@ -15,6 +15,7 @@ Ограничение обзора Görüntüyü Kısıtla Reestricción de Vista + Restrição do Modo de Visão View restriction settings to limit the usage of 1st or 3rd person views globally or per vehicle type. @@ -29,6 +30,7 @@ Настройки ограничения обзора при виде от 1-го или 3-го лица. Общие для всех, или Выборочные, в зависимости от техники. 1. veya 3. kişi görünümlerinin kullanımını genel olarak veya araç türüne göre sınırlamak için kısıtlama ayarlarını görüntüleyin. Opciones de Reestricción de Vista para limitar el uso de 1º o 3º persona globalmente o según el tipo de vehículo. + A restrição do modo de visão limita o uso de 1ª ou 3ª pessoa globalmente ou por tipo de veículo. Mode @@ -44,6 +46,7 @@ Режим установок Mod Modo + Modo Sets global mode. Default: Disabled @@ -59,6 +62,7 @@ Общие установки для всех. По умолчанию: Отключено. Global modu ayarlar. Varsayılan: Devre Dışı Establece el modo global. Defecto: Deshabilitado + Define o modo global. Padrão: Desabilitado (Selective) Foot @@ -74,6 +78,7 @@ (Выборочные) Пешком (Seçilebilir) Ayakta (Selectivo) Pie + (Seletivo) A pé Selective mode on Foot. Default: Disabled (Requires Mode: Selective) @@ -89,6 +94,7 @@ Выборочные установки без техники. По умолчанию: Отключено (требуется режим: Выборочные) Ayakta iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo a pie. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo a pé. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Land Vehicles @@ -104,6 +110,7 @@ (Выборочные) Наземная техника (Seçilebilir) Kara Araçları (Selectivo) Vehículos de tierra + (Seletivo) Veículos terrestres Selective mode in Land Vehicles. Default: Disabled (Requires Mode: Selective) @@ -119,6 +126,7 @@ Выборочные установки для наземной техники. По умолчанию: Отключено (требуется режим: Выборочные) Kara araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos de tierra.Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em veículos terrestres. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Air Vehicles @@ -134,6 +142,7 @@ (Выборочные) Авиатехника (Seçilebilir) Hava Araçları (Selectivo) Vehículos aéreos + (Seletivo) Aeronaves Selective mode in Air Vehicles. Default: Disabled (Requires Mode: Selective) @@ -149,6 +158,7 @@ Выборочные установки для авиатехники. По умолчанию: Отключено (требуется режим: Выборочные) Hava araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos aéreos. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em aeronaves. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Sea Vehicles @@ -164,6 +174,7 @@ (Выборочные) Водный транспорт (Seçilebilir) Deniz Araçları (Selectivo) Vehículos marítimos + (Seletivo) Veículos aquáticos Selective mode in Sea Vehicles. Default: Disabled (Requires Mode: Selective) @@ -179,6 +190,7 @@ Выборочные установки для водного транспорта. По умолчанию: Отключено (требуется режим: Выборочные) Deniz araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos marítimos. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em veículos aquáticos. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) UAVs @@ -194,6 +206,7 @@ (Выборочные) Беспиплотники (Seçilebilir) IHA'lar (Selectivo) VANTs + (Seletivo) VANTs Selective mode in UAVs. Default: Disabled (Requires Mode: Selective) @@ -209,6 +222,7 @@ Выборочные установки для беспилотников. По умолчанию: Отключено (требуется режим: Выборочные) IHA araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en VANTs. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em VANTs. Padrão: Desabilitado (Modo necessário: Seletivo) Disabled @@ -224,6 +238,7 @@ Отключено Devre Dışı Deshabilitado + Desabilitado Forced 1st Person @@ -238,6 +253,7 @@ От 1-го лица (принудительно) 1. Kişi Görüşüne Zorla Forzada 1º persona + Forçada 1ª pessoa Forced 3rd Person @@ -252,6 +268,7 @@ От 3-го лица (принудительно) 3. Kişi Görüşüne Zorla Forzada 3º persona + Forçada 3ª pessoa Selective @@ -267,6 +284,7 @@ Выборочный Seçilebilinir Selectivo + Seletivo Preserve view for vehicle types @@ -281,6 +299,7 @@ 차량 타입에 따른 시야 정보 저장 Preservar vista para los tipos de vehículos Conserver la vue pour les types de véhicules + Mantém o modo de visão por tipo de veículo Switch view on vehicle change to last used in this vehicle type (Requires Mode: Disabled) @@ -295,6 +314,7 @@ 해당 차량 타입에서 마지막으로 사용했던 시야로 설정하여 봅니다 (모드 - 사용 안함 필요) Cambiar vista en el cambio de vehículo hacia la última usada en ese tipo de vehículo (Requiere Modo: Deshabilitado) Lors d'un changement de véhicule, change la vue pour la dernière utilisée dans ce type de véhicule (Mod requis : désactivé). + Ao trocar de veículo, troca o modo de visão para aquele usado anteriormente no mesmo tipo de veículo (Modo necessário: Desabilitado) diff --git a/addons/volume/stringtable.xml b/addons/volume/stringtable.xml index feecb28b10..08aae728a1 100644 --- a/addons/volume/stringtable.xml +++ b/addons/volume/stringtable.xml @@ -14,6 +14,7 @@ Głosność Ses Volumen + Volume Toggle Volume @@ -28,6 +29,7 @@ Przełącz Głosność Sesi Aç/Kapat Activar control de volumen + Alternar volume Toggle volume reduction. @@ -42,6 +44,7 @@ Przełącz redukcje głosności Ses azaltmayı aç / kapat. Activar reducción de volumen. + Alternar redução de volume Lowered volume @@ -56,6 +59,7 @@ Zmniejszona głosność Azaltılmış ses Volumen reducido + Volume reduzido Restored volume @@ -69,6 +73,7 @@ Громкость восстановлена Przywrócona głosność Volumen restaurado + Volume restaurado Reduction @@ -82,6 +87,7 @@ Уменьшение Redukcja Reducción + Redução Reduce volume by this percentage. @@ -95,6 +101,7 @@ Уменьшает громкость Zmniejsz głosność o tyle procent Reducir el volumen este porcentaje. + Reduzir o volume por esta porcentagem. Lower in vehicles @@ -109,6 +116,7 @@ Zmniejsz w pojazdach Araçlarda Daha Düşük Reducir en vehículos + Reduzir em veículos Automatically lower volume when inside vehicles. @@ -123,6 +131,7 @@ Automatycznie zmniejsz głosność będąc w pojeździe Araçlara binince sesi azalt. Reduce automáticamente el volumen dentro de vehículos. + Reduz automaticamente o volume dentro de veículos. Show notification @@ -137,6 +146,7 @@ Pokaż powiadomienie Bildirim Göster Mostrar notificación + Mostrar notificação Show notification when lowering/restoring volume. @@ -151,6 +161,7 @@ Pokaż powiadomienie zmniejszając/odnawiając głosność Ses azaltıldığın da bildirim göster. Mostrar notificación cuando se disminuye/restaura el volumen. + Mostrar notificação quando o volume for reduzido/restaurado Fade delay @@ -164,6 +175,7 @@ Задержка затухания Opoznienie wyciszenia Retardo en disminución gradual + Atraso de alteração gradual de volume Time it takes (in seconds) for the sound to fade in/out. @@ -177,6 +189,7 @@ Время (сек.) для затухания/восстановления звука. Ilość czasu (w sekundach) ile zajmuje wyciszenie/zgłośnienie dźwięku Tiempo que tarda (en segundos) para que se active o desactive la disminuación gradual del volumen + Tempo de atraso (em segundos) para que o volume do som sofra alteração gradual Reminder if lowered @@ -191,6 +204,7 @@ Przypomnij o zmniejszonej głosności dźwięku Eğer Düşükse Hatırlat Recordatorio s reducido + Lembrete de redução sonora Reminds you every minute if your volume is lowered. @@ -205,6 +219,7 @@ Przypomina co minuten o zmniejszonej głosności dźwięku Eğer ses düşükse her dakika hatırlatır. Te recuerda cada minuto si el volumen está siendo reducido. + Te notifica a cada minuto se o volume sonoro estiver reduzido. Volume still lowered @@ -219,6 +234,7 @@ Dźwięk jest nadal zmniejszony Ses hala düşük Volumen todavía reducido + Volume ainda está reduzido diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index fd22bd4462..3a63e1097f 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -28,8 +28,8 @@ if (currentWeapon _unit != _weapon) exitWith { }; // Unlock safety -if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { - [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); +if ((["ace_safemode"] call EFUNC(common,isModLoaded)) && {[_unit, _weapon] call EFUNC(safemode,getWeaponSafety)}) exitWith { + [_unit, _weapon, false] call EFUNC(safemode,setWeaponSafety); }; private _modes = _weapon call EFUNC(common,getWeaponModes); diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 4ebea1f507..6f54dfbba1 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -25,7 +25,6 @@ _args set [0, CBA_missionTime]; private _isWind = (vectorMagnitude wind > 0); - private _deleted = false; { _x params ["_bullet", "_airFriction"]; @@ -33,8 +32,7 @@ private _bulletSpeedSqr = vectorMagnitudeSqr _bulletVelocity; if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeedSqr < 10000}}) then { - GVAR(trackedBullets) set [_forEachIndex, objNull]; - _deleted = true; + GVAR(trackedBullets) deleteAt _forEachIndex; } else { if (_isWind) then { private _trueVelocity = _bulletVelocity vectorDiff wind; @@ -50,11 +48,7 @@ }; _bullet setVelocity _bulletVelocity; }; - } forEach GVAR(trackedBullets); - - if (_deleted) then { - GVAR(trackedBullets) = GVAR(trackedBullets) - [objNull]; - }; + } forEachReversed GVAR(trackedBullets); // END_COUNTER(pfeh); }, GVAR(simulationInterval), [CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/xm157/functions/fnc_ballistics_calculator.sqf b/addons/xm157/functions/fnc_ballistics_calculator.sqf index a39b09a705..1bf6fb86ad 100644 --- a/addons/xm157/functions/fnc_ballistics_calculator.sqf +++ b/addons/xm157/functions/fnc_ballistics_calculator.sqf @@ -48,7 +48,7 @@ private _gravity = [-sin (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -G private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; if (_useAB) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]]) select 0); }; private _deltaT = 1 / 60; @@ -58,7 +58,7 @@ while {(_TOF < 5) && {(_bulletPos # 1) < _targetRange}} do { private _trueSpeed = vectorMagnitude _trueVelocity; private _bulletAccel = if (_useAB) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); + private _drag = parseNumber (("ace" callExtension ["ballistics:retard", [_dragModel, _bc, _trueSpeed, _temperature]]) select 0); (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _trueVelocity vectorMultiply (_trueSpeed * _airFriction); diff --git a/addons/xm157/functions/fnc_ballistics_getData.sqf b/addons/xm157/functions/fnc_ballistics_getData.sqf index 828db8e4ae..f366216e49 100644 --- a/addons/xm157/functions/fnc_ballistics_getData.sqf +++ b/addons/xm157/functions/fnc_ballistics_getData.sqf @@ -56,8 +56,7 @@ if ((_weaponInfo isEqualTo []) && {_magazineClass != ""}) then { }; // Scope Base Angle - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - private _scopeBaseAngle = parseNumber _zeroAngle; + private _scopeBaseAngle = parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_zeroRange, _muzzleVelocity, _airFriction, _boreHeight]]) select 0); _weaponInfo = [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,_bc,_dragModel,_atmosphereModel,_barrelTwist,_twistDirection,_caliber,_bulletLength,_bulletMass]; GVAR(data) set [_key, _weaponInfo]; diff --git a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf index 6570648499..cc6f9f0a01 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf @@ -22,8 +22,8 @@ TRACE_2("moduleCargoParadropWaypoint",_vehicleGroup,_wpPos); private _vehicle = vehicle leader _vehicleGroup; private _commander = driver _vehicle; private _cargo = _vehicle getVariable [QEGVAR(cargo,loaded), []]; -if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true}; -if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo",_cargo); true}; +if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle %1",typeOf _vehicle); true}; +if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo %1",_cargo); true}; private _previousSpeedMode = speedMode _vehicleGroup; private _nextMoveUpdate = -1; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index a6eaaac158..7a285f2d6a 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2016,6 +2016,7 @@ 플레이어가 Esc 키로 관전자 인터페이스를 닫지 못하도록 강제로 관전자 인터페이스를 설정합니다. Erzwingt die Zuschauer-Ansicht und verhindert dass der Spieler sie mit der Esc-Taste schließen kann Forza l'interfaccia di spettatore, impedendo al giocatore di chiuderla con il tasto Esc + Force le mode spectateur en empêchant le joueur de la fermer avec la touche Echap. Hide player @@ -2024,6 +2025,7 @@ 플레이어 숨기기 Spieler ausblenden Nascondi giocatore + Cacher le joueur Hides the player by making them invisible, invulnerable, muted, and removing them from their group @@ -2032,6 +2034,7 @@ 플레이어를 투명, 무적, 음소거화하고 그룹에서 제거하여 숨깁니다. Blendet den Spieler aus, macht ihn unsichtbar, unverwundbar, stumm und entfernt ihn von seiner Gruppe Nasconde il giocatore, rendendolo invisibile, invulnerabile, muto e lo rimuove dal proprio gruppo + Cache le joueur en le rendant invisible, invulnérable, muet et en le retirant de son groupe. Sets the sides that are available to spectate @@ -2040,6 +2043,7 @@ 관전 가능한 진영을 설정합니다. Bestimmt die Seiten denen man zuschauen kann Imposta le fazioni che lo spettatore può osservare + Définit les côtés disponibles pour le mode spectateur White Hot @@ -2048,6 +2052,7 @@ 백색 열원 Weiß-Schwarz Bianco-caldo + Blanc-noir Black Hot @@ -2056,6 +2061,7 @@ 흑색 열원 Schwarz-Weiß Nero-caldo + Noir et blanc Toggle All @@ -2064,6 +2070,7 @@ 전부 토글 Alle wechseln Cambia tutti + Tout afficher diff --git a/docs/Gemfile b/docs/Gemfile index 053c27dc35..486c7aac0f 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,2 +1,4 @@ source 'https://rubygems.org' gem 'github-pages' +gem 'tzinfo-data' +gem 'webrick' diff --git a/docs/tools/document_functions.py b/docs/tools/document_functions.py index dab567d208..7ed20eade3 100644 --- a/docs/tools/document_functions.py +++ b/docs/tools/document_functions.py @@ -339,6 +339,8 @@ def document_functions(addons_dir, components): return errors +def getFunctionPath(func): + return func.path.casefold() def crawl_dir(addons_dir, directory, debug=False, lint_private=False): components = {} @@ -360,7 +362,11 @@ def crawl_dir(addons_dir, directory, debug=False, lint_private=False): if function.is_public() and not debug: # Add functions to component key (initalise key if necessary) component = os.path.basename(os.path.dirname(root)) - components.setdefault(component, []).append(function) + + # Sort functions alphabetically + functions = components.setdefault(component, []) + functions.append(function) + functions.sort(key=getFunctionPath) function.feedback("Publicly documented") else: diff --git a/docs/wiki/development/ace3-config-entries.md b/docs/wiki/development/ace3-config-entries.md index 9e656ad48c..8ff22438a1 100644 --- a/docs/wiki/development/ace3-config-entries.md +++ b/docs/wiki/development/ace3-config-entries.md @@ -13,29 +13,78 @@ Entries found in the `CfgVehicles.hpp` files ```cpp -ace_nightvision_grain -ace_nightvision_blur -ace_recoil_enablecamshake -ace_dragging_cancarry -ace_dragging_carryposition -ace_dragging_carrydirection -ace_dragging_candrag -ace_dragging_dragposition -ace_dragging_dragdirection +ace_artillerytables_showGunLaying +ace_cargo_canLoad +ace_cargo_hasCargo +ace_cargo_loadmasterTurrets +ace_cargo_noRename +ace_cargo_size +ace_cargo_space +ace_casings_model +ace_cookoff_canHaveFireJet +ace_cookoff_cookoffSelections +ace_dragging_canCarry +ace_dragging_canDrag +ace_dragging_carryPosition +ace_dragging_carryDirection +ace_dragging_dragPosition +ace_dragging_dragDirection ace_fastroping_enabled -ace_fastroping_friesType ace_fastroping_friesAttachmentPoint +ace_fastroping_friesType ace_fastroping_onCut ace_fastroping_onPrepare ace_fastroping_ropeOrigins -ace_gforcecoef -ace_offset -ace_hasReserveParachute -ace_reserveParachute +ace_fcs_distanceInterval +ace_fcs_enabled +ace_fcs_maxDistance +ace_fcs_minDistance +ace_hunterkiller +ace_intelitems_magazine +ace_interaction_canPush +ace_interaction_bodyLength +ace_interaction_bodyWidth +ace_interaction_replaceTerrainObject +ace_logitics_wirecutter_isFence +ace_medical_treatment_patientSeats +ace_minedetector_detectable +ace_parachute_failureDelay +ace_rearm_defaultSupply +ace_refuel_canReceive ace_refuel_flowRate ace_refuel_fuelCapacity ace_refuel_fuelCargo ace_refuel_hooks +ace_repair_hitpointPositions +ace_tagging_canTag +ace_trenches_diggingDuration +ace_trenches_grassCuttingPoints +ace_trenches_noGeoClass +ace_trenches_placementData +ace_trenches_removalDuration +ace_vehicle_damage_canHaveFireRing +ace_vehicle_damage_detonationDuringFireProb +ace_vehicle_damage_engineDetonationProb +ace_vehicle_damage_engineFireProb +ace_vehicle_damage_eraHitpoints +ace_vehicle_damage_hullDetonationProb +ace_vehicle_damage_hullFireProb +ace_vehicle_damage_slatHitpoints +ace_vehicle_damage_turretDetonationProb +ace_vehicle_damage_turretFireProb +ace_vehicles_engineStartDelay + +acex_field_rations_offset +acex_field_rations_waterSupply +acex_sitting_canSit +acex_sitting_interactPosition +acex_sitting_sitDirection +acex_sitting_sitPosition + +ACE_Attachable +ACE_GForceCoef +ace_hasReserveParachute +ace_reserveParachute ``` @@ -140,7 +189,6 @@ ace_isbelt ace_attachable ace_placeable ace_setupobject -ace_delaytime ace_triggers ace_magazines_forcemagazinemuzzlevelocity ``` diff --git a/docs/wiki/development/arma-3-issues.md b/docs/wiki/development/arma-3-issues.md index 506bfde222..379fb7d5bb 100644 --- a/docs/wiki/development/arma-3-issues.md +++ b/docs/wiki/development/arma-3-issues.md @@ -14,7 +14,6 @@ Keeping track of Arma 3 issues that need to be fixed. - [bux578: T79355: MineDetector equipable in Launcher slot](https://feedback.bistudio.com/T79355) - [bux578: T79534: Zeus / Curator Add Remote Controlled Event](https://feedback.bistudio.com/T79534) -- [bux578: T79827: Add script commands "addPrimaryWeaponMagazine" and "addSecondaryWeaponMagazine"](https://feedback.bistudio.com/T79827) - [bux578: T80358: Add/Alter script command to add perfectly configured weapons to cargo](https://feedback.bistudio.com/T80358) - [commy2: T79801: Unexpected behavior of += array in configs](https://feedback.bistudio.com/T79801) - [commy2: T81029: setVariable is not always JIP persistent](https://feedback.bistudio.com/T81029) @@ -23,11 +22,12 @@ Keeping track of Arma 3 issues that need to be fixed. - [Jaynus: T82046: Display event handler return values for mouse buttons should be respected](https://feedback.bistudio.com/T82046) - [Heisenberg: T82108: Switching between optic modes of a sniper scope (AMS, DMS, MOS) will result in a blurred vision](https://feedback.bistudio.com/T82108) - [BaerMitUmlaut: T120030: Particles do not render properly since 1.62](https://feedback.bistudio.com/T120030) -- [Killzone_Kid: T79689: magazineTurretAmmo and setMagazineTurretAmmo do not function as expected if there are multiple magazines of the same type](https://feedback.bistudio.com/T79689) -- [nekoarrow: T122981: setMagazineTurretAmmo locality issue](https://feedback.bistudio.com/T122981) **Resolved:** - [Nou: T79119: Memory points rfemur, lfemur, and other leg memory points returned incorrectly with SQF command selectionPosition](https://feedback.bistudio.com/T79119) - [commy2: T81503: isLightOn doesn't recognize destroyed light bulbs for streetlamps](https://feedback.bistudio.com/T81503) - [commy2: T83771: splitString scripting command causes game crash](https://feedback.bistudio.com/T83771) +- [bux578: T79827: Add script commands "addPrimaryWeaponMagazine" and "addSecondaryWeaponMagazine"](https://feedback.bistudio.com/T79827) +- [Killzone_Kid: T79689: magazineTurretAmmo and setMagazineTurretAmmo do not function as expected if there are multiple magazines of the same type](https://feedback.bistudio.com/T79689) +- [nekoarrow: T122981: setMagazineTurretAmmo locality issue?](https://feedback.bistudio.com/T122981) diff --git a/docs/wiki/development/dependencies.md b/docs/wiki/development/dependencies.md index b43371034c..c6d0f87d63 100644 --- a/docs/wiki/development/dependencies.md +++ b/docs/wiki/development/dependencies.md @@ -21,16 +21,18 @@ Because `ace_zeus` is being removed you must also remove any components that req ## 2. Dependencies -{% assign pages_by_title = site.pages | sort: "title" %} +{% assign pages_by_title = site.pages | sort_natural: "title" %} {% for page in pages_by_title %} {%- if page.group == 'feature' and page.component -%} - ### {{ page.title }} + {%- unless page.version.removed -%} + ### {{ page.title }} + + {% capture component %}{{ page.component }}{% endcapture %} + {% include dependencies_list.md component=component %} - {% capture component %}{{ page.component }}{% endcapture %} - {% include dependencies_list.md component=component %} - - {%- if page.core_component -%} - _Note: This module is required by nearly all other modules. Do NOT remove it!_ - {% endif %} + {%- if page.core_component -%} + _Note: This module is required by nearly all other modules. Do NOT remove it!_ + {% endif %} + {% endunless %} {% endif %} {% endfor %} diff --git a/docs/wiki/development/extension-guidelines.md b/docs/wiki/development/extension-guidelines.md index d7f4fe08a6..36178d86f5 100644 --- a/docs/wiki/development/extension-guidelines.md +++ b/docs/wiki/development/extension-guidelines.md @@ -7,87 +7,59 @@ parent: wiki order: 9 --- -## 1. Basics +## 1. Setup ### 1.1 Requirements -- A compiler (VS/GCC/Clang) - - If starting with Visual Studio, you need to make sure to use the Visual studio command prompt -- cmake 3.0 or later in your path +- [Rust](https://rustup.rs/) +- [cargo-make](https://crates.io/crates/cargo-make) +`cargo install --no-default-features --force cargo-make` -### 1.2 Cross-Platform Guidelines +### 1.2 Recomendations -### 1.3 C++ basic style and naming guide +- [VSCode](https://code.visualstudio.com/) +- [Rust Analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) +- [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) -### 1.4 ace_common cpp library +### 1.3 Rust Resources + +- [Learn Rust](https://www.rust-lang.org/learn) --- -## 2 Building Extensions on Windows +## 2 Development -### 2.1 Compiling +### 2.1 Code Standards -#### 2.1.1 Windows - Creating a Visual Studio Project -1. Open your compiling command prompt (which has cmake and your compiler) -2. From this directory, you need to use cmake to build the appropriate build files. Change the -G property appropriately. run cmake --help to get a list of the options. +1. [Rust API Guidelines for naming](https://rust-lang.github.io/api-guidelines/naming.html) should be followed +2. All code should be formatted with `cargo fmt` +3. All code should be free from errors and warnings +4. Tests should be written where applicable -``` -cd extensions\build -cmake .. -G "Visual Studio 15 2017 Win64" +### 2.2 Local Development + +Running `cargo make debug` will compile the project for x32 and x64 and move the built libraries to `ace.dll` and `ace_x64.dll`. + +The library can be debugged with the following `.vscode/launch.json` file. Replace all sections in `{}` with the appropriate path. + +```json +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug", + "program": "{Path to Arma}\\arma3_x64.exe", + "args": ["-mod=\"{Path to CBA};{Path to ACE development folder}\""], + "cwd": "{Path to Arma}" + } + ] +} ``` -A Visual studio project file will now be generated in your build directory. +Use the `Run and Debug` tab in VSCode to launch Arma, or Press `F5`. -#### 2.1.2 Windows - Visual Studio - Compile only (nmake) -1. Open your compiling command prompt (which has cmake and your compiler) -2. From this directory, you need to use cmake to build the appropriate build files. Change the -G property appropriately. run cmake --help to get a list of the options. +### 2.3 Release -``` -cd extensions\build -cmake .. -G "NMake Makefiles" -nmake -``` - -The extensions will not be built in its appropriate project folder, for example: - -``` -extensions\ - build\ - fcs\ace_fcs.dll - somethingElse\ace_somethingElse.dll -``` - -### 2.2 Creating a new Extension - -#### 2.2.1 Arma Config - -ACE3 loads extensions defined in `ACE_Extensions` root config class and supports the following entries: - -```cpp -// Platform -windows = 1; // Load on Windows -linux = 1; // Load on Linux - -// Type -client = 1; // Load on Client -server = 1; // Load on Server -``` - -```cpp -class ACE_Extensions { - // Windows Client only extension - class tag_extension { - windows = 1; - client = 1; - }; - - // Any platform Server extension - class tag_extension2 { - windows = 1; - linux = 1; - server = 1; - }; -}; -``` - -Combining platform and client/server values is possible to get all combinations currently supported by the game and more. +Release versions can be built using `cargo make release`. diff --git a/docs/wiki/development/setting-up-the-development-environment.md b/docs/wiki/development/setting-up-the-development-environment.md index e2c9443039..822da19fa4 100644 --- a/docs/wiki/development/setting-up-the-development-environment.md +++ b/docs/wiki/development/setting-up-the-development-environment.md @@ -139,7 +139,7 @@ Different `make.py` command line options include: - `increment_patch` - increments _patch_ version number (ignored with `increment_minor` or `increment_major`) - `increment_minor` - increments _minor_ version number and resets _patch_ version number to `0` (ignored with `increment_major`) - `increment_major` - increments _major_ version number and resets _minor_ and _patch_ version numbers to `0` -- `force` - force rebuild all PBOs, even those already present in the `release` directory (combined with `compile` it will also rebuild all extensions) +- `force` - force rebuild all PBOs, even those already present in the `release` directory - `checkexternal` - check external references (incompatible only with ` ` and `force `) - `release` - create release packages/archives - ` ` - build only specified component(s) (incompatible with `release`) diff --git a/docs/wiki/feature/artillerytables.md b/docs/wiki/feature/artillerytables.md new file mode 100644 index 0000000000..4bdfb5c5d5 --- /dev/null +++ b/docs/wiki/feature/artillerytables.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Artillery Tables +component: artillerytables +description: Adds universal rangetables for artillery. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds a rangetable to accurately take out your target without the artillery computer. +- Shows accurate elevation and azimuth. +- Optionally adds wind deflection and air friction for shells. +- Optionally disables artillery computers. + +## 2. Usage + +### 2.1 Opening a rangetable +- Enter a piece of artillery. +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select `Equipment`. +- Select the rangetable of the piece of artillery you are in. diff --git a/docs/wiki/feature/cargo.md b/docs/wiki/feature/cargo.md new file mode 100644 index 0000000000..304ba70944 --- /dev/null +++ b/docs/wiki/feature/cargo.md @@ -0,0 +1,41 @@ +--- +layout: wiki +title: Cargo +component: cargo +description: Adds the ability to transport cargo using vehicles. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 3 + patch: 0 +--- + +## 1. Overview +Adds the ability to load and unload cargo from vehicles. Unloading can happen via two methods: Regular unloading and deploying, where you can preplace the item before it's unloaded. + +## 2. Usage + +### 2.1 Loading an object +- Interact with the object to be loaded ⊞ win. +- Select the `Load` option. +- Select which vehicle you want to load the object in. +- Wait for the progress bar to finish. To cancel loading, press Escape. + +### 2.2 Checking a vehicle's cargo +- Interact with the vehicle whose cargo is to b e checked ⊞ win. +- Select the `Cargo` option. + +### 2.3 Unloading an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Unload`. +- Wait for the progress bar to finish. To cancel unloading, press Escape. + +### 2.4 Deploying an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Deploy`. +- Use the mouse to fine tune the placement of the object. +- When ready to place, press left click to start deploying the object. +- Wait for the progress bar to finish. To cancel deploying, press Escape. diff --git a/docs/wiki/feature/casings.md b/docs/wiki/feature/casings.md new file mode 100644 index 0000000000..8bcf24a696 --- /dev/null +++ b/docs/wiki/feature/casings.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Casings +component: casings +description: Adds infantry bullet casings on the ground when weapons are fired. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 15 + patch: 0 +--- + +## 1. Overview +Spits out casings from infantry weapons when fired. diff --git a/docs/wiki/feature/cookoff.md b/docs/wiki/feature/cookoff.md new file mode 100644 index 0000000000..19a3289388 --- /dev/null +++ b/docs/wiki/feature/cookoff.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Cook-off +component: cookoff +description: Adds cook-off effects to vehicles and ammunition boxes that have had their ammunition detonated or that have been destroyed. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds engine fires when a vehicle's engine is damaged heavily. +- Optionally adds fire if a vehicle suffers ammunition detonations (requires `Vehicle Damage` to be enabled). +- Optionally adds ammunition detonation if a vehicle is destroyed. +- Optionally adds ammunition detonation if an ammunition box is destroyed or hit with explosive, incendiary or tracer ammunition. diff --git a/docs/wiki/feature/dogtags.md b/docs/wiki/feature/dogtags.md new file mode 100644 index 0000000000..9f1d27e371 --- /dev/null +++ b/docs/wiki/feature/dogtags.md @@ -0,0 +1,40 @@ +--- +layout: wiki +title: Dog Tags +component: dogtags +description: Adds dog tags to units. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview +Provides dog tags to units, which include name, social security number and blood type as information. + +## 2. Usage + +### 2.1 Checking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked ⊞ win. +- Select the `Dog Tag` option. +- Select the `Check` option. + +### 2.2 Taking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked ⊞ win. +- Select the `Dog Tag` option. +- Select the `Take` option. +- If the one of the two dog tags has already been taken, it will inform you and not give you the 2nd dog tag + +### 2.3 Checking what dog tags you have via self-interaction +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Equipment` option. +- Select the `Check Dog Tag` option. + +### 2.4 Checking what dog tags you have via context menu +- Open your inventory and find the dog tag you want to inspect. +- Double click the item. +- Click `Check Dog Tag`. diff --git a/docs/wiki/feature/field-rations.md b/docs/wiki/feature/field-rations.md new file mode 100644 index 0000000000..63daad9963 --- /dev/null +++ b/docs/wiki/feature/field-rations.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Field Rations +component: field_rations +description: Adds a thirst and hunger system, along with food to replenish those. +group: feature +category: realism +parent: wiki +mod: acex +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Simulates hunger and thirst which need to be replenished. This system is affected by other modules, such as weather and medical, and can in turn affect fatigue. + +## 2. Usage + +### 2.1 Satiate hunger/Quench thirst via self-interaction +- Pick up a drink. +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Survival` option. +- Choose an item to consume. + +### 2.2 Satiate hunger/Quench thirst via context menu +- Open your inventory and find the item you want to consume. +- Double click the item. +- Click `Eat/Drink`. diff --git a/docs/wiki/feature/fieldmanual.md b/docs/wiki/feature/fieldmanual.md new file mode 100644 index 0000000000..bf6af86fe2 --- /dev/null +++ b/docs/wiki/feature/fieldmanual.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Field Manual +component: fieldmanual +description: Adds ACE3 content to the field manual. +group: feature +category: general +parent: wiki +mod: ace +version: + major: 3 + minor: 16 + patch: 0 +--- + +## 1. Overview +Provides information on items and mechanics that ACE3 adds. + +## 2. Usage + +### 2.1 Opening the field manual +- Press Escape. +- Press `Field Manual`. diff --git a/docs/wiki/feature/gestures.md b/docs/wiki/feature/gestures.md new file mode 100644 index 0000000000..30be084be3 --- /dev/null +++ b/docs/wiki/feature/gestures.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gestures +component: gestures +description: Adds gestures that can be used for communication. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Adds the ability to use 14 gestures for communication. + +## 2. Usage + +### 2.1 Using gestures via self-interaction + +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Gestures` option. + +### 2.2 Rebinding keybinds for gestures + +- Press Escape. +- Select `Options`. +- Select `Controls`. +- Select `Configure Addons`. +- Select `ACE Gestures`. diff --git a/docs/wiki/feature/gunbag.md b/docs/wiki/feature/gunbag.md new file mode 100644 index 0000000000..35e2dd5e59 --- /dev/null +++ b/docs/wiki/feature/gunbag.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gun Bag +component: gunbag +description: Adds a gun bag that can be used to store a weapon. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 6 + patch: 0 +--- + +## 1. Overview +Adds easy handling and storage of an additional weapon in a backpack. + +## 2. Usage + +### 2.1 Interacting with your gun bag via self-interaction +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Equipment` option. +- Select the `Gunbag` option. + +### 2.2 Interacting with your gun bag via the ACE arsenal +- Open an ACE arsenal. +- Get yourself a gun bag if you don't have one already. +- Select the primary weapon or backpack tab to interact with weapon. + +### 2.3 Interacting with another unit's gun bag +- Interact with the unit ⊞ win. diff --git a/docs/wiki/feature/index.md b/docs/wiki/feature/index.md index 41fd0fdeea..1c7039dfd2 100644 --- a/docs/wiki/feature/index.md +++ b/docs/wiki/feature/index.md @@ -19,7 +19,7 @@ redirect_from: "/wiki/featurex"

General