├── .editorconfig ├── .gibot.yml ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── enhancement-request.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── release-drafter.yml ├── stale.yml └── workflows │ ├── arma.yml │ ├── documentation.yml │ └── release-drafter.yml ├── .gitignore ├── AUTHORS.txt ├── Arma3_workshop_addon.jpg ├── LICENSE ├── README.md ├── addons ├── field_rations │ ├── $PBOPREFIX$ │ ├── Cfg3DEN.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgMoves.hpp │ ├── CfgSounds.hpp │ ├── CfgUIGrids.hpp │ ├── CfgVehicles.hpp │ ├── CfgWeapons.hpp │ ├── README.md │ ├── RscTitles.hpp │ ├── XEH_PREP.hpp │ ├── XEH_postInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── anim │ │ ├── drink_crouch.rtm │ │ ├── drink_crouch_can.rtm │ │ ├── drink_prone.rtm │ │ ├── drink_prone_can.rtm │ │ ├── drink_source.rtm │ │ ├── drink_source_high.rtm │ │ ├── drink_source_low.rtm │ │ ├── drink_source_squat.rtm │ │ ├── drink_source_squat_high.rtm │ │ ├── drink_source_squat_low.rtm │ │ ├── drink_stand.rtm │ │ ├── drink_stand_can.rtm │ │ └── model.cfg │ ├── config.cpp │ ├── data │ │ ├── mre.rvmat │ │ ├── mre_human.p3d │ │ ├── mre_human_co.paa │ │ ├── mre_nohq.paa │ │ ├── mre_smdi.paa │ │ ├── mre_type1.p3d │ │ ├── mre_type1_co.paa │ │ ├── mre_type2.p3d │ │ ├── mre_type3.p3d │ │ ├── mre_type3_co.paa │ │ ├── mre_type4.p3d │ │ ├── mre_type4_co.paa │ │ ├── mre_type5.p3d │ │ ├── mre_type6.p3d │ │ └── mre_type6_co.paa │ ├── functions │ │ ├── fnc_addStatusModifier.sqf │ │ ├── fnc_addWaterSourceInteractions.sqf │ │ ├── fnc_canDrinkFromSource.sqf │ │ ├── fnc_canRefillItem.sqf │ │ ├── fnc_checkWater.sqf │ │ ├── fnc_consumeItem.sqf │ │ ├── fnc_drinkFromSource.sqf │ │ ├── fnc_getActionOffset.sqf │ │ ├── fnc_getConsumableChildren.sqf │ │ ├── fnc_getDrinkAnimation.sqf │ │ ├── fnc_getRefillChildren.sqf │ │ ├── fnc_getRemainingWater.sqf │ │ ├── fnc_handleEffects.sqf │ │ ├── fnc_handleHUD.sqf │ │ ├── fnc_handleRespawn.sqf │ │ ├── fnc_refillItem.sqf │ │ ├── fnc_setRemainingWater.sqf │ │ ├── fnc_update.sqf │ │ └── script_component.hpp │ ├── initSettings.sqf │ ├── script_component.hpp │ ├── sounds │ │ ├── drink1.ogg │ │ ├── drink2.ogg │ │ ├── drink_can1.ogg │ │ └── drink_can2.ogg │ ├── stringtable.xml │ └── ui │ │ ├── icon_can_franta_ca.paa │ │ ├── icon_can_redgull_ca.paa │ │ ├── icon_can_spirit_ca.paa │ │ ├── icon_hud_hungerstatus.paa │ │ ├── icon_hud_thirststatus.paa │ │ ├── icon_survival.paa │ │ ├── icon_water_tap.paa │ │ ├── igui_preview.paa │ │ ├── item_canteen_co.paa │ │ ├── item_mre_human_co.paa │ │ ├── item_mre_type1_co.paa │ │ ├── item_mre_type2_co.paa │ │ ├── item_mre_type3_co.paa │ │ ├── item_mre_type4_co.paa │ │ ├── item_mre_type5_co.paa │ │ ├── item_mre_type6_co.paa │ │ ├── item_waterbottle_empty_co.paa │ │ └── item_waterbottle_full_co.paa ├── fortify │ ├── $PBOPREFIX$ │ ├── ACEX_Fortify_Presets.hpp │ ├── Cfg3DEN.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgVehicles.hpp │ ├── CfgWeapons.hpp │ ├── README.md │ ├── UI │ │ └── hammer_ca.paa │ ├── XEH_PREP.hpp │ ├── XEH_missionDisplayLoad.sqf │ ├── XEH_postInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ │ ├── fnc_addActions.sqf │ │ ├── fnc_addDeployHandler.sqf │ │ ├── fnc_axisLengths.sqf │ │ ├── fnc_buildLocationModule.sqf │ │ ├── fnc_canFortify.sqf │ │ ├── fnc_deployConfirm.sqf │ │ ├── fnc_deployObject.sqf │ │ ├── fnc_getBudget.sqf │ │ ├── fnc_getCost.sqf │ │ ├── fnc_getPlaceableSet.sqf │ │ ├── fnc_handleChatCommand.sqf │ │ ├── fnc_handleScrollWheel.sqf │ │ ├── fnc_modifyAction.sqf │ │ ├── fnc_parseSide.sqf │ │ ├── fnc_registerObjects.sqf │ │ ├── fnc_setupModule.sqf │ │ ├── fnc_updateBudget.sqf │ │ └── script_component.hpp │ ├── initSettings.sqf │ ├── script_component.hpp │ └── stringtable.xml ├── headless │ ├── $PBOPREFIX$ │ ├── ACE_Settings.hpp │ ├── CfgEden.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgVehicles.hpp │ ├── README.md │ ├── UI │ │ └── Icon_Module_Headless_ca.paa │ ├── XEH_PREP.hpp │ ├── XEH_postInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ │ ├── fnc_endMissionNoPlayers.sqf │ │ ├── fnc_handleConnectHC.sqf │ │ ├── fnc_handleDisconnect.sqf │ │ ├── fnc_handleSpawn.sqf │ │ ├── fnc_moduleInit.sqf │ │ ├── fnc_rebalance.sqf │ │ ├── fnc_transferGroups.sqf │ │ └── script_component.hpp │ ├── initSettings.sqf │ ├── script_component.hpp │ └── stringtable.xml ├── intelitems │ ├── $PBOPREFIX$ │ ├── CfgEditorSubcategories.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgMagazines.hpp │ ├── CfgVehicles.hpp │ ├── README.md │ ├── XEH_PREP.hpp │ ├── XEH_postInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ │ ├── fnc_addActions.sqf │ │ ├── fnc_addIntel.sqf │ │ ├── fnc_attributeFocus.sqf │ │ ├── fnc_canPickup.sqf │ │ ├── fnc_createControl.sqf │ │ ├── fnc_deleteControl.sqf │ │ ├── fnc_handleLoadout.sqf │ │ ├── fnc_handleMagIndex.sqf │ │ ├── fnc_onMouseButtonDown.sqf │ │ ├── fnc_onMouseButtonUp.sqf │ │ ├── fnc_onMouseMoving.sqf │ │ ├── fnc_pickup.sqf │ │ ├── fnc_setObjectData.sqf │ │ └── script_component.hpp │ ├── gui.hpp │ ├── script_component.hpp │ ├── stringtable.xml │ └── ui │ │ ├── document_ca.paa │ │ ├── notepad_ca.paa │ │ └── photo_ca.paa ├── killtracker │ ├── $PBOPREFIX$ │ ├── CfgEventHandlers.hpp │ ├── README.md │ ├── XEH_postInit.sqf │ ├── config.cpp │ ├── script_component.hpp │ └── stringtable.xml ├── main │ ├── $PBOPREFIX$ │ ├── CfgModuleCategories.hpp │ ├── CfgSettings.hpp │ ├── README.md │ ├── config.cpp │ ├── script_component.hpp │ ├── script_macros.hpp │ ├── script_mod.hpp │ └── script_version.hpp ├── sitting │ ├── $PBOPREFIX$ │ ├── ACE_Settings.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgMoves.hpp │ ├── CfgVehicles.hpp │ ├── README.md │ ├── UI │ │ ├── Icon_Module_Sitting_ca.paa │ │ ├── sit_ca.paa │ │ └── stand_ca.paa │ ├── XEH_PREP.hpp │ ├── XEH_clientInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ │ ├── fnc_addSitActions.sqf │ │ ├── fnc_canSit.sqf │ │ ├── fnc_canStand.sqf │ │ ├── fnc_getRandomAnimation.sqf │ │ ├── fnc_handleInterrupt.sqf │ │ ├── fnc_moduleInit.sqf │ │ ├── fnc_sit.sqf │ │ ├── fnc_stand.sqf │ │ └── script_component.hpp │ ├── script_component.hpp │ └── stringtable.xml ├── viewrestriction │ ├── $PBOPREFIX$ │ ├── ACE_Settings.hpp │ ├── CfgEventHandlers.hpp │ ├── CfgVehicles.hpp │ ├── README.md │ ├── UI │ │ └── Icon_Module_ViewRestriction_ca.paa │ ├── XEH_PREP.hpp │ ├── XEH_clientInit.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ │ ├── fnc_canChangeCamera.sqf │ │ ├── fnc_changeCamera.sqf │ │ ├── fnc_moduleInit.sqf │ │ ├── fnc_selectiveChangeCamera.sqf │ │ ├── fnc_switchPreserveView.sqf │ │ └── script_component.hpp │ ├── initSettings.sqf │ ├── script_component.hpp │ └── stringtable.xml └── volume │ ├── $PBOPREFIX$ │ ├── ACE_Settings.hpp │ ├── CfgEventHandlers.hpp │ ├── XEH_PREP.hpp │ ├── XEH_postInitClient.sqf │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ ├── fnc_lowerVolume.sqf │ ├── fnc_remind.sqf │ ├── fnc_restoreVolume.sqf │ └── script_component.hpp │ ├── script_component.hpp │ └── stringtable.xml ├── extras ├── assets │ └── logo │ │ ├── black │ │ ├── ACEX-Logo.eps │ │ ├── ACEX-Logo.jpg │ │ └── ACEX-Logo.png │ │ └── white │ │ ├── ACEX-Logo.eps │ │ ├── ACEX-Logo.jpg │ │ └── ACEX-Logo.png └── blank │ ├── $PBOPREFIX$ │ ├── CfgEventHandlers.hpp │ ├── XEH_PREP.hpp │ ├── XEH_preInit.sqf │ ├── XEH_preStart.sqf │ ├── config.cpp │ ├── functions │ ├── fnc_empty.sqf │ └── script_component.hpp │ └── script_component.hpp ├── hemtt.toml ├── include ├── a3 │ └── ui_f │ │ ├── $PBOPREFIX$ │ │ └── hpp │ │ ├── defineCommonColors.inc │ │ ├── defineCommonGrids.inc │ │ ├── defineDIKCodes.inc │ │ ├── defineResincl.inc │ │ └── defineResinclDesign.inc ├── x │ └── cba │ │ └── addons │ │ ├── main │ │ ├── $PBOPREFIX$ │ │ └── script_macros_common.hpp │ │ └── xeh │ │ ├── $PBOPREFIX$ │ │ └── script_xeh.hpp └── z │ └── ace │ └── addons │ └── main │ ├── $PBOPREFIX$ │ ├── script_debug.hpp │ └── script_macros.hpp ├── logo_acex_ca.paa ├── meta.cpp ├── mod.cpp └── tools ├── build.py ├── check_strings.py ├── config_style_checker.py ├── deploy.py ├── make.cfg ├── make.py ├── setup.py ├── sqf_validator.py ├── stringtable_validator.py ├── stringtablediag.py └── stringtableduplicates.py /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gibot.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | mark_for_closing: 3 | days: 30 4 | labels: 5 | - need more info 6 | - invalid 7 | - can't reproduce 8 | - wontfix 9 | - information required 10 | exclude: 11 | - marked for cleanup 12 | comment: 13 | - 'Hello @{author}! There has been no activity on this ticket for over a period of {days} days. I am automatically replying to let you know we will close this ticket within 1 week due to inactivity and consider this resolved.' 14 | - 'If you believe this in error, please reply with the requested information.' 15 | - 'Thank you. :robot:' 16 | action: 17 | close: false 18 | comment: true 19 | assign_label: 20 | - marked for cleanup 21 | clean_up: 22 | days: 7 23 | labels: 24 | - marked for cleanup 25 | comment: 26 | - 'Hello @{author}! We have detected no activity for {days} days on this ticket. We therefore assume that the original reporter has lost interest or the issue has been resolved.' 27 | - 'Since we have marked this ticket for deletion, we will be closing it.' 28 | - 'If this has been closed in error, please create a comment below and we can reopen this issue. Note that you may need to provide additional information that was requested.' 29 | - 'Thank you. :robot:' 30 | action: 31 | close: true 32 | comment: true 33 | assign_label: 34 | - closed by bot 35 | remove_label: 36 | - marked for cleanup 37 | remind_about_old_ticket: 38 | days: 130 39 | labels: 40 | - bug 41 | - critical bug 42 | exclude: 43 | - need more info 44 | - invalid 45 | - can't reproduce 46 | - wontfix 47 | - information required 48 | - marked for cleanup 49 | - inactive 50 | comment: 51 | - 'Hello @acemod/maintainers. This ticket has been open for over {days} days without any activity.' 52 | action: 53 | comment: true 54 | assign_label: 55 | - inactive 56 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.png binary 3 | *.jpg binary 4 | *.paa binary 5 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Reporting an issue 2 | 3 | ## Before reporting 4 | 5 | If you have found an issue with ACEX please make sure that ACEX really is the cause of the problem. To do this try to reproduce the issue with using only `@CBA_A3`, `@ace` and `@acex` on a newly created mission. 6 | 7 | Indicate if the issue appears on stable or development version. In case it is the development version, please also include the commit SHA-1 hash. 8 | 9 | **Please note:** 10 | - It's not a valid to simply remove @acex from the mod list to confirm that ACEX is the culprit. 11 | - If the error happens when using a third-party mod contact the author of the appropriate mod and report the issue there. 12 | 13 | ## Reporting the issue 14 | 15 | Head over to the [ACEX GitHub issue tracker](https://github.com/acemod/ACEX/issues) and press the [New issue](https://github.com/acemod/ACEX/issues/new) button in the top right corner. Add a descriptive title and complete the issue template. 16 | 17 | A video of the issue might be helpful in resolving it faster. 18 | 19 | # Feature Requests 20 | 21 | ## Background 22 | ACE2, AGM and CSE had a lot of features implemented or planned. All of them are or have been evaluated for inclusion in ACE3 or ACEX itself, and we'd like to port the majority of them eventually. However, due to time constraints, we have managed to finish only a fraction of the job so far. 23 | 24 | Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite. 25 | 26 | ## Requesting a feature 27 | In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for [ACE3 Feature requests](https://github.com/acemod/ACE3/issues/3594). Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. 28 | 29 | Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Mods (complete and add to the following information):** 11 | - **Arma 3:** `x.xx` [e.g. 1.00 stable, rc, dev] 12 | - **CBA:** `3.x.x` [e.g. 3.0.0 stable, commit hash] 13 | - **ACE3:** `3.x.x` [eg. 3.0.0 stable, commit hash] 14 | - **ACEX:** `3.x.x` [eg. 3.0.0 stable, commit hash] 15 | _Make sure to reproduce the issue with only CBA, ACE3 and ACEX on a newly created mission!_ 16 | 17 | **Description:** 18 | A clear and concise description of what the bug is. 19 | 20 | **Steps to reproduce:** 21 | - Go to ... 22 | - Click ... 23 | - See ... 24 | 25 | **Expected behavior:** 26 | A clear and concise description of what you expected to happen. 27 | 28 | **Where did the issue occur?** 29 | - Dedicated / Self-Hosted Multiplayer / Singleplayer / Editor (Singleplayer) / Editor (Multiplayer) / Virtual Arsenal 30 | 31 | **Log Files:** 32 | - Link to ([gist](https://gist.github.com) or [pastebin](http://pastebin.com)) to the client and/or server RPT file. An instruction to find your RPT files can be found [here](https://community.bistudio.com/wiki/Crash_Files#Arma_3). 33 | 34 | **Additional context:** 35 | Add any other context about the problem here. 36 | 37 | **Screenshots:** 38 | If applicable, add screenshots to help explain your problem. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement request 3 | about: Suggest an improvement for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your enhancement related to a problem?** 11 | A clear and concise description of what the enhancement entails. Ex. [...] would improve user experience. 12 | 13 | **Solution you'd like:** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Alternatives you've considered:** 17 | A clear and concise description of any alternative solutions or ideas you've considered. 18 | 19 | **Additional context:** 20 | Add any other context or screenshots about the enhancement here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature request, invalid 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Do not post feature requests here! 11 | 12 | Learn how to make a feature request [here](https://ace3mod.com/wiki/user/how-to-make-a-feature-request.html). 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **When merged this pull request will:** 2 | - Describe what this pull request will do 3 | - Each change in a separate line 4 | - Respect the [Development Guidelines](http://ace3mod.com/wiki/development/) 5 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | - master 3 | - release-drafter # for testing edits to this configuration 4 | 5 | name-template: 'Version $NEXT_PATCH_VERSION' 6 | tag-template: 'v$NEXT_PATCH_VERSION' 7 | 8 | categories: 9 | - title: '**ADDED:**' 10 | labels: 11 | - 'feature request' 12 | - 'added feature' 13 | - title: '**FIXED:**' 14 | labels: 15 | - 'bug fix' 16 | - title: '**IMPROVED:**' 17 | labels: 18 | - 'enhancement' 19 | - 'optimization' 20 | - title: '**CHANGED:**' 21 | labels: 22 | - 'cleanup' 23 | - title: '**TRANSLATIONS:**' 24 | labels: 25 | - 'translation' 26 | 27 | exclude-labels: 28 | - 'ignore changelog' 29 | 30 | change-template: '- $TITLE (#$NUMBER)' 31 | template: | 32 | _Requires ACE3 version X.Y.Z or later._ 33 | 34 | ## Change Log Summary 35 | 36 | $CHANGES 37 | 38 | replacers: 39 | # Category titles 40 | - search: '/\#\# (\*\*(ADDED|FIXED|IMPROVED|CHANGED|TRANSLATIONS):\*\*)/g' 41 | replace: '$1' 42 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 180 3 | 4 | # Number of days of inactivity before a stale issue is closed 5 | daysUntilClose: 14 6 | 7 | # Issues with these labels will never be considered stale 8 | exemptLabels: 9 | - pinned 10 | - critical bug 11 | - bug 12 | - feature request 13 | - sticky 14 | - help wanted 15 | 16 | # Label to use when marking an issue as stale 17 | staleLabel: stale 18 | 19 | # Comment to post when marking an issue as stale. Set to `false` to disable 20 | markComment: > 21 | This issue has been automatically marked as stale because it has not had 22 | recent activity. It will be closed if no further activity occurs. Thank you 23 | for your contributions. 24 | 25 | # Comment to post when closing a stale issue. Set to `false` to disable 26 | closeComment: > 27 | This issue has been automatically closed due to inactivity. 28 | 29 | If this is still an issue, please feel free to re-open this. If necessary, provide any additional details to help us solve this issue. 30 | 31 | If you wish to assist us resolving this issue, 32 | please re-open or create a new issue stating you wish to help us out. 33 | 34 | Thank you for your contributions. 35 | 36 | # Limit the number of actions per hour, from 1-30. Default is 30 37 | limitPerRun: 30 38 | 39 | # Limit to only `issues` or `pulls` 40 | only: issues 41 | 42 | # Set to true to ignore issues in a project (defaults to false) 43 | exemptProjects: true 44 | 45 | # Set to true to ignore issues in a milestone (defaults to false) 46 | exemptMilestones: true 47 | -------------------------------------------------------------------------------- /.github/workflows/arma.yml: -------------------------------------------------------------------------------- 1 | name: Arma 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | 9 | jobs: 10 | validate: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout the source code 14 | uses: actions/checkout@master 15 | - name: Validate SQF 16 | run: python3 tools/sqf_validator.py 17 | - name: Validate Config 18 | run: python3 tools/config_style_checker.py 19 | - name: Validate Stringtables 20 | run: python3 tools/stringtable_validator.py 21 | - name: Check Strings 22 | run: python3 tools/check_strings.py 23 | - name: Check for BOM 24 | uses: arma-actions/bom-check@v1 25 | 26 | lint: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout the source code 30 | uses: actions/checkout@master 31 | - name: Lint (sqflint) 32 | uses: arma-actions/sqflint@master 33 | continue-on-error: true # No failure due to many false-positives 34 | 35 | build: 36 | runs-on: ubuntu-latest 37 | steps: 38 | - name: Checkout the source code 39 | uses: actions/checkout@master 40 | - name: Build using HEMTT 41 | uses: arma-actions/hemtt@master 42 | with: 43 | command: build --release --ci 44 | # https://github.com/actions/upload-artifact/issues/3#issuecomment-524442814 45 | # - name: Upload Artifact 46 | # uses: actions/upload-artifact@master 47 | # with: 48 | # name: ace3-${{ github.sha }}-nobin 49 | # path: '@ace' 50 | -------------------------------------------------------------------------------- /.github/workflows/documentation.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | update: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout the source code 13 | uses: actions/checkout@master 14 | - name: Install Python packages 15 | run: | 16 | pip3 install wheel 17 | pip3 install setuptools 18 | pip3 install pygithub 19 | pip3 install pygithub3 20 | - name: Deploy 21 | if: github.repository == 'acemod/ACEX' && ! contains(github.event.head_commit.message, '[ci skip]') 22 | env: 23 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | run: python3 tools/deploy.py 25 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | draft: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Release Drafter 13 | if: github.repository == 'acemod/ACEX' 14 | uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | release/* 2 | releases/* 3 | keys/* 4 | *.cache 5 | *.pbo 6 | texHeaders.bin 7 | *.swp 8 | *.swo 9 | *.biprivatekey 10 | Thumbs.db 11 | .hemtt/local 12 | hemtt.exe 13 | -------------------------------------------------------------------------------- /Arma3_workshop_addon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/Arma3_workshop_addon.jpg -------------------------------------------------------------------------------- /addons/field_rations/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\field_rations 2 | -------------------------------------------------------------------------------- /addons/field_rations/Cfg3DEN.hpp: -------------------------------------------------------------------------------- 1 | #define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) 2 | #define DEFAULT_WATER_SUPPLY GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(waterSupply),REFILL_WATER_DISABLED) 3 | 4 | class Cfg3DEN { 5 | class Object { 6 | class AttributeCategories { 7 | class ace_attributes { 8 | class Attributes { 9 | class GVAR(waterSupply) { 10 | displayName = CSTRING(WaterSupply_3DEN_DisplayName); 11 | tooltip = CSTRING(WaterSupply_3DEN_Description); 12 | property = QGVAR(waterSupply); 13 | control = "EditShort"; 14 | expression = QUOTE(if (_value != DEFAULT_WATER_SUPPLY) then {_this setVariable [ARR_3(QQGVAR(currentWaterSupply),_value,true)]}); 15 | defaultValue = QUOTE(DEFAULT_WATER_SUPPLY); 16 | validate = "NUMBER"; 17 | condition = "(1 - objectBrain) * (1 - objectAgent)"; 18 | typeName = "NUMBER"; 19 | }; 20 | }; 21 | }; 22 | }; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /addons/field_rations/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | 13 | class Extended_PostInit_EventHandlers { 14 | class ADDON { 15 | init = QUOTE(call COMPILE_FILE(XEH_postInit)); 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /addons/field_rations/CfgMoves.hpp: -------------------------------------------------------------------------------- 1 | class CfgMovesBasic; 2 | class CfgMovesMaleSdr: CfgMovesBasic { 3 | class States { 4 | class CutSceneAnimationBase; 5 | class GVAR(drinkStand): CutSceneAnimationBase { 6 | file = QPATHTOF(anim\drink_stand.rtm); 7 | actions = "CivilStandActions"; 8 | speed = 0.1; 9 | disableWeapons = 1; 10 | disableWeaponsLong = 1; 11 | canReload = 0; 12 | canPullTrigger = 0; 13 | showWeaponAim = 0; 14 | looped = 0; 15 | head = "headNo"; 16 | aiming = "aimingNo"; 17 | legs = "legsNo"; 18 | connectTo[] = {"AmovPercMstpSnonWnonDnon", 0.1}; 19 | interpolateFrom[] = {"AmovPercMstpSnonWnonDnon", 0.1}; 20 | interpolateTo[] = {"Unconscious", 0.1}; 21 | }; 22 | class GVAR(drinkCrouch): GVAR(drinkStand) { 23 | file = QPATHTOF(anim\drink_crouch.rtm); 24 | actions = "CivilKneelActions"; 25 | connectTo[] = {"AmovPknlMstpSnonWnonDnon", 0.1}; 26 | interpolateFrom[] = {"AmovPknlMstpSnonWnonDnon", 0.1}; 27 | }; 28 | class GVAR(drinkProne): GVAR(drinkStand) { 29 | file = QPATHTOF(anim\drink_prone.rtm); 30 | actions = "CivilProneActions"; 31 | connectTo[] = {"AmovPpneMstpSnonWnonDnon", 0.1}; 32 | interpolateFrom[] = {"AmovPpneMstpSnonWnonDnon", 0.1}; 33 | }; 34 | class GVAR(drinkStandCan): GVAR(drinkStand) { 35 | file = QPATHTOF(anim\drink_stand_can.rtm); 36 | speed = 1/9; 37 | }; 38 | class GVAR(drinkCrouchCan): GVAR(drinkCrouch) { 39 | file = QPATHTOF(anim\drink_crouch_can.rtm); 40 | speed = 1/9; 41 | }; 42 | class GVAR(drinkProneCan): GVAR(drinkProne) { 43 | file = QPATHTOF(anim\drink_prone_can.rtm); 44 | speed = 1/9; 45 | }; 46 | class GVAR(drinkFromSource): GVAR(drinkStand) { 47 | file = QPATHTOF(anim\drink_source.rtm); 48 | speed = 1/8; 49 | }; 50 | class GVAR(drinkFromSourceHigh): GVAR(drinkFromSource) { 51 | file = QPATHTOF(anim\drink_source_high.rtm); 52 | }; 53 | class GVAR(drinkFromSourceLow): GVAR(drinkFromSource) { 54 | file = QPATHTOF(anim\drink_source_low.rtm); 55 | }; 56 | class GVAR(drinkFromSourceSquat): GVAR(drinkFromSource) { 57 | file = QPATHTOF(anim\drink_source_squat.rtm); 58 | interpolateFrom[] = {"AmovPercMstpSnonWnonDnon", 0.1, "AmovPknlMstpSnonWnonDnon", 0.1}; 59 | }; 60 | class GVAR(drinkFromSourceSquatHigh): GVAR(drinkFromSourceSquat) { 61 | file = QPATHTOF(anim\drink_source_squat_high.rtm); 62 | }; 63 | class GVAR(drinkFromSourceSquatLow): GVAR(drinkFromSourceSquat) { 64 | file = QPATHTOF(anim\drink_source_squat_low.rtm); 65 | }; 66 | }; 67 | }; 68 | -------------------------------------------------------------------------------- /addons/field_rations/CfgSounds.hpp: -------------------------------------------------------------------------------- 1 | class CfgSounds { 2 | class GVAR(drink1) { 3 | name = QGVAR(drink1); 4 | sound[] = {QPATHTOF(sounds\drink1.ogg), 1, 1}; 5 | titles[] = {}; 6 | }; 7 | class GVAR(drink2) { 8 | name = QGVAR(drink2); 9 | sound[] = {QPATHTOF(sounds\drink2.ogg), 1, 1}; 10 | titles[] = {}; 11 | }; 12 | class GVAR(drinkCan1) { 13 | name = QGVAR(drinkCan1); 14 | sound[] = {QPATHTOF(sounds\drink_can1.ogg), 1, 1}; 15 | titles[] = {}; 16 | }; 17 | class GVAR(drinkCan2) { 18 | name = QGVAR(drinkCan2); 19 | sound[] = {QPATHTOF(sounds\drink_can2.ogg), 1, 1}; 20 | titles[] = {}; 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /addons/field_rations/CfgUIGrids.hpp: -------------------------------------------------------------------------------- 1 | class CfgUIGrids { 2 | class IGUI { 3 | class Presets { 4 | class Arma3 { 5 | class Variables { 6 | GVAR(grid)[] = { 7 | { 8 | safeZoneX + safeZoneW - 4.2 * GUI_GRID_W, 9 | safeZoneY + safeZoneH - 2.2 * GUI_GRID_H, 10 | 4 * GUI_GRID_W, 11 | 2 * GUI_GRID_H 12 | }, 13 | GUI_GRID_W, 14 | GUI_GRID_H 15 | }; 16 | }; 17 | }; 18 | }; 19 | class Variables { 20 | class GVAR(grid) { 21 | displayName = CSTRING(IGUI_DisplayName); 22 | description = CSTRING(IGUI_Description); 23 | preview = QPATHTOF(ui\igui_preview.paa); 24 | saveToProfile[] = {0, 1}; 25 | canResize = 0; 26 | }; 27 | }; 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /addons/field_rations/README.md: -------------------------------------------------------------------------------- 1 | acex_field_rations 2 | ================== 3 | 4 | Provides a survival style, hunger and thirst system. 5 | Adds consumable items such as MREs. 6 | 7 | ## Maintainers 8 | 9 | The people responsible for merging changes to this component or answering potential questions. 10 | 11 | - [mharis001](https://github.com/mharis001) 12 | - [PabstMirror](https://github.com/PabstMirror) 13 | - [Glowbal](https://github.com/Glowbal) 14 | -------------------------------------------------------------------------------- /addons/field_rations/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(addStatusModifier); 2 | PREP(addWaterSourceInteractions); 3 | PREP(canDrinkFromSource); 4 | PREP(canRefillItem); 5 | PREP(checkWater); 6 | PREP(consumeItem); 7 | PREP(drinkFromSource); 8 | PREP(getActionOffset); 9 | PREP(getConsumableChildren); 10 | PREP(getDrinkAnimation); 11 | PREP(getRefillChildren); 12 | PREP(getRemainingWater); 13 | PREP(handleEffects); 14 | PREP(handleHUD); 15 | PREP(handleRespawn); 16 | PREP(refillItem); 17 | PREP(setRemainingWater); 18 | PREP(update); 19 | -------------------------------------------------------------------------------- /addons/field_rations/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | #include "initSettings.sqf" 10 | 11 | // Init arrays of status modifiers 12 | GVAR(thirstModifiers) = []; 13 | GVAR(hungerModifiers) = []; 14 | 15 | private _cache = call (uiNamespace getVariable [QGVAR(cacheP3Ds), {ERROR("no cache")}]); // cache built at preStart 16 | // List of p3d water sources (case sensitive) for objects that report `typeOf == ""` 17 | GVAR(waterSourceP3Ds) = _cache select 0; 18 | // List of refill action offsets corresponding to the p3ds in the array above 19 | GVAR(waterSourceOffsets) = _cache select 1; 20 | 21 | ADDON = true; 22 | -------------------------------------------------------------------------------- /addons/field_rations/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | 5 | // List of p3d water sources (case sensitive) for objects that report `typeOf == ""` 6 | private _waterSourceP3Ds = [ 7 | "misc_wellpump.p3d" // [11899, 9150, 0] on chenarus 8 | ]; 9 | 10 | // List of refill action offsets corresponding to the p3ds in the array above 11 | private _waterSourceOffsets = [ 12 | [0, 0, 0] 13 | ]; 14 | 15 | // Fill water source arrays from CfgVehicles 16 | { 17 | private _split = (getText (_x >> "model")) splitString "\"; 18 | private _string = toLower (_split param [((count _split) - 1), ""]); 19 | 20 | // Append extension if necessary 21 | if ((_string select [count _string - 4]) != ".p3d") then { 22 | _string = _string + ".p3d" 23 | }; 24 | 25 | private _index = _waterSourceP3Ds pushBackUnique _string; 26 | if (_index != -1) then { 27 | _waterSourceOffsets pushBack ([_x >> QGVAR(offset), "ARRAY", [0, 0, 0]] call CBA_fnc_getConfigEntry); 28 | }; 29 | } forEach (QUOTE(isNumber (_x >> 'GVAR(waterSupply)') && {(getNumber (_x >> 'GVAR(waterSupply)')) != REFILL_WATER_DISABLED}) configClasses (configFile >> "CfgVehicles")); 30 | 31 | uiNamespace setVariable [QGVAR(cacheP3Ds), compileFinal str [_waterSourceP3Ds, _waterSourceOffsets]]; 32 | TRACE_1("compiled",count _waterSourceP3Ds); 33 | -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_crouch.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_crouch.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_crouch_can.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_crouch_can.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_prone.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_prone.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_prone_can.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_prone_can.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source_high.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source_high.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source_low.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source_low.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source_squat.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source_squat.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source_squat_high.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source_squat_high.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_source_squat_low.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_source_squat_low.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_stand.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_stand.rtm -------------------------------------------------------------------------------- /addons/field_rations/anim/drink_stand_can.rtm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/anim/drink_stand_can.rtm -------------------------------------------------------------------------------- /addons/field_rations/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = { 7 | "ACE_WaterBottle_Item", 8 | "ACE_WaterBottle_Half_Item", 9 | "ACE_WaterBottle_Empty_Item", 10 | "ACE_Canteen_Item", 11 | "ACE_Canteen_Half_Item", 12 | "ACE_Canteen_Empty_Item", 13 | "ACE_Can_Spirit_Item", 14 | "ACE_Can_Franta_Item", 15 | "ACE_Can_RedGull_Item", 16 | "ACE_MRE_LambCurry_Item", 17 | "ACE_MRE_BeefStew_Item", 18 | "ACE_MRE_CreamTomatoSoup_Item", 19 | "ACE_MRE_CreamChickenSoup_Item", 20 | "ACE_MRE_ChickenTikkaMasala_Item", 21 | "ACE_MRE_SteakVegetables_Item", 22 | "ACE_MRE_MeatballsPasta_Item", 23 | "ACE_MRE_ChickenHerbDumplings_Item", 24 | "ACE_Humanitarian_Ration_Item" 25 | }; 26 | weapons[] = { 27 | "ACE_WaterBottle", 28 | "ACE_WaterBottle_Half", 29 | "ACE_WaterBottle_Empty", 30 | "ACE_Canteen", 31 | "ACE_Canteen_Half", 32 | "ACE_Canteen_Empty", 33 | "ACE_Can_Spirit", 34 | "ACE_Can_Franta", 35 | "ACE_Can_RedGull", 36 | "ACE_MRE_LambCurry", 37 | "ACE_MRE_BeefStew", 38 | "ACE_MRE_CreamTomatoSoup", 39 | "ACE_MRE_CreamChickenSoup", 40 | "ACE_MRE_ChickenTikkaMasala", 41 | "ACE_MRE_SteakVegetables", 42 | "ACE_MRE_MeatballsPasta", 43 | "ACE_MRE_ChickenHerbDumplings", 44 | "ACE_Humanitarian_Ration" 45 | }; 46 | requiredVersion = REQUIRED_VERSION; 47 | requiredAddons[] = {"acex_main", "ace_interact_menu"}; 48 | author = ACECSTRING(common,ACETeam); 49 | authors[] = {"mharis001", "Glowbal", "PabstMirror"}; 50 | url = ACECSTRING(main,URL); 51 | VERSION_CONFIG; 52 | }; 53 | }; 54 | 55 | #include "CfgEventHandlers.hpp" 56 | #include "CfgVehicles.hpp" 57 | #include "CfgWeapons.hpp" 58 | #include "CfgSounds.hpp" 59 | #include "CfgMoves.hpp" 60 | #include "Cfg3DEN.hpp" 61 | #include "RscTitles.hpp" 62 | #include "CfgUIGrids.hpp" 63 | -------------------------------------------------------------------------------- /addons/field_rations/data/mre.rvmat: -------------------------------------------------------------------------------- 1 | ambient[] = {1,1,1,1}; 2 | diffuse[] = {0.5,0.5,0.5,1}; 3 | forcedDiffuse[] = {0.5,0.5,0.5,0}; 4 | emmisive[] = {0,0,0,1}; 5 | specular[] = {0.30000001,0.30000001,0.30000001,0}; 6 | specularPower = 17; 7 | PixelShaderID = "NormalMapSpecularDIMap"; 8 | VertexShaderID = "NormalMap"; 9 | class Stage1 { 10 | texture = "z\acex\addons\field_rations\data\mre_nohq.paa"; 11 | uvSource = "tex"; 12 | class uvTransform { 13 | aside[] = {1,0,0}; 14 | up[] = {0,1,0}; 15 | dir[] = {0,0,1}; 16 | pos[] = {0,0,0}; 17 | }; 18 | }; 19 | class Stage2 { 20 | texture = "z\acex\addons\field_rations\data\mre_smdi.paa"; 21 | uvSource = "tex"; 22 | class uvTransform { 23 | aside[] = {1,0,0}; 24 | up[] = {0,1,0}; 25 | dir[] = {0,0,1}; 26 | pos[] = {0,0,0}; 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /addons/field_rations/data/mre_human.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_human.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_human_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_human_co.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_nohq.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_nohq.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_smdi.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_smdi.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type1.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type1.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type1_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type1_co.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type2.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type2.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type3.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type3.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type3_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type3_co.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type4.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type4.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type4_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type4_co.paa -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type5.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type5.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type6.p3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type6.p3d -------------------------------------------------------------------------------- /addons/field_rations/data/mre_type6_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/data/mre_type6_co.paa -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_addStatusModifier.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Adds a status modifier. Should be called on all machines. 5 | * Code must return a NUMBER which will be applied additively with other status changes. 6 | * 7 | * Arguments: 8 | * 0: Status to modify (0 - Thirst, 1 - Hunger, 2 - Both) 9 | * 1: Code (is passed the unit ) 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [0, {}] call acex_field_rations_fnc_addStatusModifier 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params [["_type", -1, [0]], ["_code", {}, [{}]]]; 21 | 22 | if (_type isEqualTo -1 || {_code isEqualTo {}}) exitWith {}; 23 | 24 | if (_type isEqualTo 2) then { 25 | GVAR(thirstModifiers) pushBack _code; 26 | GVAR(hungerModifiers) pushBack _code; 27 | } else { 28 | private _modifierArray = [GVAR(thirstModifiers), GVAR(hungerModifiers)] select _type; 29 | _modifierArray pushBack _code; 30 | }; 31 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_addWaterSourceInteractions.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Dynamically adds actions to nearby water sources when interact_menu is opened. 5 | * Called by the "ace_interactMenuOpened" event. 6 | * 7 | * Arguments: 8 | * Interact Menu Type (0 - World, 1 - Self) 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [0] call acex_field_rations_fnc_addWaterSourceInteractions 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_interactionType"]; 20 | 21 | // Ignore when self-interaction, mounted vehicle interaction, or water source actions are disabled 22 | if ( 23 | _interactionType != 0 24 | || {vehicle ACE_player != ACE_player} 25 | || {GVAR(waterSourceActions) == 0} 26 | ) exitWith {}; 27 | 28 | TRACE_1("Starting interact PFH",_interactionType); 29 | 30 | [{ 31 | BEGIN_COUNTER(interactEH); 32 | params ["_args", "_pfhID"]; 33 | _args params ["_setPosition", "_addedHelpers", "_sourcesHelped"]; 34 | 35 | if (!ACEGVAR(interact_menu,keyDown)) then { 36 | TRACE_1("Ending interact PFH",_pfhID); 37 | {detach _x; deleteVehicle _x} forEach _addedHelpers; 38 | [_pfhID] call CBA_fnc_removePerFrameHandler; 39 | } else { 40 | // Prevent rare error when ending mission with interact key down 41 | if (isNull ACE_player) exitWith {}; 42 | 43 | // Rescan if player has moved more than 5 meters from last position 44 | if (getPosASL ACE_player distanceSqr _setPosition > 25) then { 45 | BEGIN_COUNTER(updatePosition); 46 | { 47 | if (!(_x in _sourcesHelped) && {GVAR(terrainObjectActions) || {!(_x call CBA_fnc_isTerrainObject)}}) then { 48 | private _waterRemaining = [_x] call FUNC(getRemainingWater); 49 | 50 | if (_waterRemaining != REFILL_WATER_DISABLED) then { 51 | private _offset = [_x] call FUNC(getActionOffset); 52 | private _helper = QGVAR(helper) createVehicleLocal [0, 0, 0]; 53 | _helper setVariable [QGVAR(waterSource), _x]; 54 | _helper attachTo [_x, _offset]; 55 | 56 | _addedHelpers pushBack _helper; 57 | _sourcesHelped pushBack _x; 58 | TRACE_3("Added interaction helper",_x,typeOf _x,_waterRemaining); 59 | }; 60 | }; 61 | } forEach nearestObjects [ACE_player, [], 15]; 62 | 63 | _args set [0, getPosASL ACE_player]; 64 | END_COUNTER(updatePosition); 65 | }; 66 | }; 67 | END_COUNTER(interactEH); 68 | }, 0.5, [getPosASL ACE_player vectorAdd [-100, 0, 0], [], []]] call CBA_fnc_addPerFrameHandler; 69 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_canDrinkFromSource.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Checks if the player can drink directly from the given water source. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Water Source 9 | * 10 | * Return Value: 11 | * Can Drink From Source 12 | * 13 | * Example: 14 | * [_player, _source] call acex_field_rations_canDrinkFromSource 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_player", "_source"]; 20 | 21 | GVAR(waterSourceActions) == 2 && { 22 | private _water = _source call FUNC(getRemainingWater); 23 | _water == REFILL_WATER_INFINITE || {_water >= DRINK_FROM_SOURCE_AMOUNT} 24 | } 25 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_canRefillItem.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Checks whether the player can refill an item from given water source. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 1: Player 9 | * 2: Item classname 10 | * 11 | * Return Value: 12 | * Can refill item 13 | * 14 | * Example: 15 | * [_source, _player, "ACE_WaterBottle_Empty"] call acex_field_rations_fnc_canRefillItem 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_source", "_player", "_item"]; 21 | 22 | alive _source 23 | && {GVAR(waterSourceActions) != 0} 24 | && {_item in (_player call ACEFUNC(common,uniqueItems))} 25 | && { 26 | private _water = _source call FUNC(getRemainingWater); 27 | _water == REFILL_WATER_INFINITE || {_water >= getNumber (configFile >> "CfgWeapons" >> _item >> QGVAR(refillAmount))} 28 | } 29 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_checkWater.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Displays the remaining water in the given water source. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Water source 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [_player, _source] call acex_field_rations_fnc_checkWater 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_player", "_source"]; 20 | 21 | [ 22 | CHECK_WATER_TIME, 23 | [_player, _source], 24 | { 25 | params ["_args"]; 26 | _args params ["_player", "_source"]; 27 | 28 | private _water = _source call FUNC(getRemainingWater); 29 | 30 | if (_water > 0) then { 31 | [[LSTRING(RemainingWater), _water], 1.5, _player] call ACEFUNC(common,displayTextStructured); 32 | } else { 33 | [LSTRING(NoWaterRemaining), 1.5, _player] call ACEFUNC(common,displayTextStructured); 34 | }; 35 | }, 36 | {}, 37 | LLSTRING(CheckingWater) 38 | ] call ACEFUNC(common,progressBar); 39 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_drinkFromSource.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Makes the player drink directly from the given water source. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Water Source 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [_player, _source] call acex_field_rations_drinkFromSource 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_player", "_source"]; 20 | 21 | // Store current animation for resetting 22 | _player setVariable [QGVAR(previousAnim), animationState _player]; 23 | 24 | private _animation = [_player, _source] call FUNC(getDrinkAnimation); 25 | [_player, _animation, 1] call ACEFUNC(common,doAnimation); 26 | 27 | private _fnc_onSuccess = { 28 | params ["_args"]; 29 | _args params ["_player", "_source"]; 30 | 31 | // Reduce player thirst 32 | private _thirst = _player getVariable [QGVAR(thirst), 0]; 33 | _player setVariable [QGVAR(thirst), (_thirst - (DRINK_FROM_SOURCE_QUENCHED * GVAR(thirstQuenched))) max 0]; 34 | _player setVariable [QGVAR(previousAnim), nil]; 35 | 36 | // Update remaining water in source 37 | private _waterInSource = _source call FUNC(getRemainingWater); 38 | 39 | if (_waterInSource != REFILL_WATER_INFINITE) then { 40 | [_source, (_waterInSource - DRINK_FROM_SOURCE_AMOUNT) max 0] call FUNC(setRemainingWater); 41 | }; 42 | }; 43 | 44 | private _fnc_onFailure = { 45 | params ["_args"]; 46 | _args params ["_player"]; 47 | 48 | // Reset animation if needed 49 | if (vehicle _player == _player && {!(_player call ACEFUNC(common,isSwimming))}) then { 50 | private _previousAnim = _player getVariable [QGVAR(previousAnim), ""]; 51 | if (_previousAnim != "") then { 52 | [_player, _previousAnim, 2] call ACEFUNC(common,doAnimation); 53 | }; 54 | }; 55 | 56 | _player setVariable [QGVAR(previousAnim), nil]; 57 | }; 58 | 59 | private _fnc_condition = { 60 | params ["_args"]; 61 | _args params ["_player", "_source"]; 62 | 63 | [_player, _source] call FUNC(canDrinkFromSource) 64 | }; 65 | 66 | private _sourceType = typeOf _source; 67 | private _progressText = if (_sourceType == "") then { 68 | LLSTRING(DrinkingFromSource) 69 | } else { 70 | format [LLSTRING(DrinkingFromX), getText (configFile >> "CfgVehicles" >> _sourceType >> "displayName")] 71 | }; 72 | 73 | [ 74 | DRINK_FROM_SOURCE_TIME, 75 | [_player, _source], 76 | _fnc_onSuccess, 77 | _fnc_onFailure, 78 | _progressText, 79 | _fnc_condition 80 | ] call ACEFUNC(common,progressBar); 81 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_getActionOffset.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Returns the refill action offset for given object. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 9 | * Return Value: 10 | * Action offset 11 | * 12 | * Example: 13 | * [cursorObject] call acex_field_rations_fnc_getActionOffset 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_object"]; 19 | 20 | private _typeOf = typeOf _object; 21 | if (_typeOf != "") then { 22 | // Check for offset in config since we have valid typeOf 23 | private _offset = getArray (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(offset)); 24 | if (_offset isEqualTo []) then {[0, 0, 0]} else {_offset}; 25 | } else { 26 | // Check for offset corresponding to p3d list 27 | GVAR(waterSourceOffsets) param [GVAR(waterSourceP3ds) find (getModelInfo _object select 0), [0, 0, 0], [[]]]; 28 | }; 29 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_getConsumableChildren.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Returns children actions for consumable items in player's inventory. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * Actions 11 | * 12 | * Example: 13 | * [_player] call acex_field_rations_fnc_getConsumableChildren 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | private _fnc_getActions = { 21 | TRACE_1("Creating consumable item actions",_player); 22 | 23 | private _actions = []; 24 | private _cfgWeapons = configFile >> "CfgWeapons"; 25 | 26 | { 27 | private _config = _cfgWeapons >> _x; 28 | if (getNumber (_config >> QGVAR(thirstQuenched)) > 0 || {getNumber (_config >> QGVAR(hungerSatiated)) > 0}) then { 29 | private _displayName = getText (_config >> "displayName"); 30 | private _picture = getText (_config >> "picture"); 31 | 32 | // Exec next frame so closing interaction menu doesn't block progressBar 33 | private _action = [_x, _displayName, _picture, {[FUNC(consumeItem), _this] call CBA_fnc_execNextFrame}, {true}, {}, _x] call ACEFUNC(interact_menu,createAction); 34 | _actions pushBack [_action, [], _player]; 35 | }; 36 | } forEach (_player call ACEFUNC(common,uniqueItems)); 37 | 38 | _actions 39 | }; 40 | 41 | [[], _fnc_getActions, _player, QGVAR(consumableActionsCache), 9999, "cba_events_loadoutEvent"] call ACEFUNC(common,cachedCall); 42 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_getDrinkAnimation.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Returns an appropriate animation for drinking directly from the given water source. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Water Source 9 | * 10 | * Return Value: 11 | * Animation 12 | * 13 | * Example: 14 | * [_player, _source] call acex_field_rations_getDrinkAnimation 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_player", "_source"]; 20 | 21 | private _offset = _source call FUNC(getActionOffset); 22 | private _actionPos = _source modelToWorld _offset; 23 | private _playerPos = _player modelToWorld [0, 0, 0]; 24 | 25 | private _difference = (_actionPos vectorDiff _playerPos) select 2; 26 | 27 | // Experimentally determined values to try to match height difference to different animations 28 | switch (true) do { 29 | case (_difference < 0.1): {QGVAR(drinkFromSourceSquatLow)}; 30 | case (_difference < 0.4): {QGVAR(drinkFromSourceSquat)}; 31 | case (_difference < 0.8): {QGVAR(drinkFromSourceSquatHigh)}; 32 | case (_difference < 1.2): {QGVAR(drinkFromSourceLow)}; 33 | case (_difference < 1.4): {QGVAR(drinkFromSource)}; 34 | default {QGVAR(drinkFromSourceHigh)}; 35 | }; 36 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_getRefillChildren.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Returns children actions for refillable items in player's inventory for given water source. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 1: Player 9 | * 10 | * Return Value: 11 | * Actions 12 | * 13 | * Example: 14 | * [_source, _player] call acex_field_rations_fnc_getRefillChildren 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_source", "_player"]; 20 | 21 | // Exit if disabled or source has no water 22 | private _water = _source call FUNC(getRemainingWater); 23 | if (_water == 0 || {_water == REFILL_WATER_DISABLED}) exitWith {[]}; 24 | 25 | private _actions = []; 26 | private _cfgWeapons = configFile >> "CfgWeapons"; 27 | 28 | { 29 | private _config = _cfgWeapons >> _x; 30 | if (getText (_config >> QGVAR(refillItem)) != "" && {_water == REFILL_WATER_INFINITE || {getNumber (_config >> QGVAR(refillAmount)) <= _water}}) then { 31 | private _displayName = format ["%1: %2", LLSTRING(Refill), getText (_config >> "displayName")]; 32 | private _picture = getText (_config >> "picture"); 33 | private _action = [_x, _displayName, _picture, FUNC(refillItem), FUNC(canRefillItem), {}, _x] call ACEFUNC(interact_menu,createAction); 34 | _actions pushBack [_action, [], _source]; 35 | }; 36 | } forEach (_player call ACEFUNC(common,uniqueItems)); 37 | 38 | _actions 39 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_getRemainingWater.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, PabstMirror 4 | * Returns the remaining water in a source. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 9 | * Return Value: 10 | * Remaining water 11 | * 12 | * Example: 13 | * [_source] call acex_field_rations_fnc_getRemainingWater 14 | * 15 | * Public: Yes 16 | */ 17 | 18 | params [["_source", objNull, [objNull]]]; 19 | 20 | if (!alive _source) exitWith {0}; 21 | 22 | private _water = _source getVariable QGVAR(currentWaterSupply); 23 | 24 | if (isNil "_water") then { 25 | private _typeOf = typeOf _source; 26 | if (_typeOf != "") then { 27 | // Check for waterSupply entry since we have valid typeOf 28 | _water = getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(waterSupply)); 29 | if (_water == 0) then {_water = REFILL_WATER_DISABLED}; 30 | 31 | if (_water != REFILL_WATER_DISABLED) then { 32 | if (_source call CBA_fnc_isTerrainObject) then { 33 | _water = REFILL_WATER_INFINITE; 34 | } else { 35 | _source setVariable [QGVAR(currentWaterSupply), _water, true]; 36 | }; 37 | }; 38 | } else { 39 | // Check the p3d name against list 40 | _water = if ((getModelInfo _source select 0) in GVAR(waterSourceP3ds)) then {REFILL_WATER_INFINITE} else {REFILL_WATER_DISABLED}; 41 | }; 42 | }; 43 | 44 | _water 45 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_handleEffects.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Handles the effects/consequences of high thirst/hunger. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Thirst 9 | * 2: Hunger 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [_player, _thirst, _hunger] call acex_field_rations_fnc_handleEffects 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_player", "_thirst", "_hunger"]; 21 | 22 | // Kill unit with max thirst or hunger 23 | if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith { 24 | if (["ace_medical"] call ACEFUNC(common,isModLoaded)) then { 25 | [_player, "Hunger/Thirst empty"] call ACEFUNC(medical_status,setDead); 26 | } else { 27 | _player setDamage 1; 28 | }; 29 | }; 30 | 31 | // Exit if unit is not awake, below are animation based consequences 32 | if !(_player call ACEFUNC(common,isAwake)) exitWith {}; 33 | 34 | // Set unit unconscious (chance based on how high thirst/hunger are) 35 | if ((_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}) exitWith { 36 | if (["ace_medical"] call ACEFUNC(common,isModLoaded)) then { 37 | [_player, true, 5, true] call ACEFUNC(medical,setUnconscious); 38 | }; 39 | }; 40 | 41 | // Make unit fall if moving fast 42 | if ((_thirst > 93 || {_hunger > 93}) && {speed _player > 1} && {vehicle _player == _player}) exitWith { 43 | [_player, "down"] call ACEFUNC(common,doGesture); 44 | }; 45 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_handleHUD.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Handles creating and updating the visuals of the HUD. 5 | * 6 | * Arguments: 7 | * 0: Thirst (default: getVariable from ACE_player) 8 | * 1: Hunger (default: getVariable from ACE_player) 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [_thirst, _hunger] call acex_field_rations_fnc_handleHUD 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [["_thirst", ACE_player getVariable [QGVAR(thirst), 0]], ["_hunger", ACE_player getVariable [QGVAR(hunger), 0]]]; 20 | 21 | private _display = uiNamespace getVariable [QGVAR(hudDisplay), displayNull]; 22 | 23 | // Create HUD if display is null 24 | if (isNull _display) then { 25 | private _rscType = [QGVAR(hudColoredIcons), QGVAR(hudDrainingIcons)] select GVAR(hudType); 26 | QGVAR(hud) cutRsc [_rscType, "PLAIN", -1, false]; 27 | _display = uiNamespace getVariable [QGVAR(hudDisplay), displayNull]; 28 | }; 29 | 30 | if (GVAR(hudType) == 0) then { 31 | // Get HUD transparency based on setting 32 | private _fade = if (GVAR(hudTransparency) == -1) then { 33 | linearConversion [0, 70, _thirst max _hunger, 1, 0, true]; 34 | } else { 35 | GVAR(hudTransparency); 36 | }; 37 | 38 | // Reduce transparency if hovering on interaction 39 | if (GVAR(hudInteractionHover)) then { 40 | _fade = _fade min 0.5; 41 | }; 42 | 43 | // Update HUD icon colors (White -> Yellow -> Orange -> Red) 44 | { 45 | _x params ["_status", "_iconIDC"]; 46 | 47 | private _iconCtrl = _display displayCtrl _iconIDC; 48 | private _color = [1, linearConversion [35, 90, _status, 1, 0, true], linearConversion [0, 40, _status, 1, 0, true], 1]; 49 | _iconCtrl ctrlSetTextColor _color; 50 | _iconCtrl ctrlSetFade _fade; 51 | _iconCtrl ctrlCommit 1; 52 | } forEach [ 53 | [_thirst, IDC_COLORED_HUD_THIRST], 54 | [_hunger, IDC_COLORED_HUD_HUNGER] 55 | ]; 56 | } else { 57 | // Reposition controls group and icon to create draining effect 58 | private _defaultY = profileNamespace getVariable [QUOTE(TRIPLES(IGUI,GVAR(grid),Y)), safeZoneY + safeZoneH - 2.2 * GUI_GRID_H]; 59 | { 60 | _x params ["_status", "_groupIDC", "_iconIDC"]; 61 | 62 | private _changeY = _status / 50 * GUI_GRID_H; 63 | 64 | private _groupCtrl = _display displayCtrl _groupIDC; 65 | private _groupPos = ctrlPosition _groupCtrl; 66 | _groupPos set [1, _defaultY + _changeY]; 67 | _groupCtrl ctrlSetPosition _groupPos; 68 | _groupCtrl ctrlCommit 0; 69 | 70 | private _iconCtrl = _display displayCtrl _iconIDC; 71 | _iconCtrl ctrlSetPosition [0, -_changeY]; 72 | _iconCtrl ctrlCommit 0; 73 | } forEach [ 74 | [_thirst, IDC_DRAINING_HUD_THIRST_GROUP, IDC_DRAINING_HUD_THIRST_ICON], 75 | [_hunger, IDC_DRAINING_HUD_HUNGER_GROUP, IDC_DRAINING_HUD_HUNGER_ICON] 76 | ]; 77 | }; 78 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_handleRespawn.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Handles the respawning of a unit by resetting necessary variables. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 1: Corpse 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [newUnit, oldUnit] call acex_field_rations_fnc_handleRespawn 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_unit", "_corpse"]; 20 | TRACE_2("Handle Respawn",_unit,_corpse); 21 | 22 | if !(local _unit) exitWith {}; 23 | 24 | _unit setVariable [QGVAR(thirst), 0]; 25 | _unit setVariable [QGVAR(hunger), 0]; 26 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_refillItem.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Refills an item from given water source. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 1: Player 9 | * 2: Item classname 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [_source, _player, "ACE_WaterBottle_Empty"] call acex_field_rations_fnc_refillItem 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_source", "_player", "_item"]; 21 | TRACE_3("Item refill started",_source,_player,_item); 22 | 23 | private _config = configFile >> "CfgWeapons" >> _item; 24 | 25 | // Get config values for refill 26 | private _refillItem = getText (_config >> QGVAR(refillItem)); 27 | private _refillAmount = getNumber (_config >> QGVAR(refillAmount)); 28 | private _refillTime = getNumber (_config >> QGVAR(refillTime)); 29 | 30 | private _fnc_onSuccess = { 31 | params ["_args"]; 32 | _args params ["_source", "_player", "_item", "_refillItem", "_refillAmount"]; 33 | TRACE_1("Refill item successful",_args); 34 | 35 | // Replace item with refilled one 36 | _player removeItem _item; 37 | [_player, _refillItem] call ACEFUNC(common,addToInventory); 38 | 39 | // Update remaining water in source 40 | private _waterInSource = _source call FUNC(getRemainingWater); 41 | if (_waterInSource != REFILL_WATER_INFINITE) then { 42 | _waterInSource = (_waterInSource - _refillAmount) max 0; 43 | [_source, _waterInSource] call FUNC(setRemainingWater); 44 | }; 45 | 46 | ["acex_rationRefilled", [_source, _player, _item, _refillItem, _refillAmount]] call CBA_fnc_localEvent; 47 | 48 | // Show refilled item hint 49 | private _picture = getText (configFile >> "CfgWeapons" >> _refillItem >> "picture"); 50 | [LSTRING(ItemRefilled), _picture] call ACEFUNC(common,displayTextPicture); 51 | }; 52 | 53 | private _fnc_onFailure = { 54 | TRACE_1("Refill item failed",_this); 55 | }; 56 | 57 | private _fnc_condition = { 58 | params ["_args"]; 59 | _args call FUNC(canRefillItem); 60 | }; 61 | 62 | [ 63 | _refillTime, 64 | [ 65 | _source, 66 | _player, 67 | _item, 68 | _refillItem, 69 | _refillAmount 70 | ], 71 | _fnc_onSuccess, 72 | _fnc_onFailure, 73 | LLSTRING(Refilling), 74 | _fnc_condition 75 | ] call ACEFUNC(common,progressBar); 76 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_setRemainingWater.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, PabstMirror 4 | * Sets the remaining water supply for given water source. 5 | * 6 | * Arguments: 7 | * 0: Water source 8 | * 1: Amount (-10 - Infinite, -1 - Disabled) 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [_source, 1000] call acex_field_rations_fnc_setRemainingWater 15 | * 16 | * Public: Yes 17 | */ 18 | 19 | params [["_source", objNull, [objNull]], ["_water", nil, [0]]]; 20 | 21 | if (!alive _source || {isNil "_water"}) exitWith {}; 22 | 23 | _source setVariable [QGVAR(currentWaterSupply), _water, true]; 24 | -------------------------------------------------------------------------------- /addons/field_rations/functions/fnc_update.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001, Glowbal, PabstMirror 4 | * Main looping function that updates thirst/hunger status. 5 | * 6 | * Arguments: 7 | * 0: Next MP sync 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [60] call acex_field_rations_fnc_update 14 | * 15 | * Public: No 16 | */ 17 | 18 | // 1 sec (update interval) * 100 (max thirst/hunger) / 3600 (sec in hour) = 0.02777778 19 | #define CHANGE_CONSTANT 0.02777778 20 | 21 | params ["_nextMpSync"]; 22 | 23 | // Access global variable once 24 | private _player = ACE_player; 25 | 26 | // Exit if player is not alive or a virtual unit 27 | if (!alive _player || {_player isKindOf "VirtualMan_F"}) exitWith { 28 | [FUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; 29 | QGVAR(hud) cutFadeOut 0.5; 30 | }; 31 | 32 | // Get current thirst and hunger 33 | private _thirst = _player getVariable [QGVAR(thirst), 0]; 34 | private _hunger = _player getVariable [QGVAR(hunger), 0]; 35 | 36 | // Determine base change based on work multiplier 37 | private _currentWork = 1; 38 | if (vehicle _player == _player && {isTouchingGround _player}) then { 39 | private _speed = vectorMagnitude velocity _player; 40 | _currentWork = linearConversion [2, 7, _speed, 1, 2, true]; 41 | }; 42 | 43 | private _thirstChange = _currentWork * CHANGE_CONSTANT / GVAR(timeWithoutWater); 44 | private _hungerChange = _currentWork * CHANGE_CONSTANT / GVAR(timeWithoutFood); 45 | 46 | // Run status modifiers 47 | {_thirstChange = _thirstChange + (_player call _x) * CHANGE_CONSTANT / GVAR(timeWithoutWater)} forEach GVAR(thirstModifiers); 48 | {_hungerChange = _hungerChange + (_player call _x) * CHANGE_CONSTANT / GVAR(timeWithoutFood)} forEach GVAR(hungerModifiers); 49 | 50 | // Change thirst and hunger status 51 | _thirst = _thirst + _thirstChange min 100 max 0; 52 | _hunger = _hunger + _hungerChange min 100 max 0; 53 | 54 | // Check if we want to do a MP sync 55 | private _doSync = false; 56 | 57 | if (CBA_missionTime >= _nextMpSync) then { 58 | _doSync = true; 59 | _nextMpSync = CBA_missionTime + MP_SYNC_INTERVAL; 60 | }; 61 | 62 | // Set new thirst and hunger values 63 | _player setVariable [QGVAR(thirst), _thirst, _doSync]; 64 | _player setVariable [QGVAR(hunger), _hunger, _doSync]; 65 | 66 | // Handle any effects/consequences of high thirst or hunger 67 | [_player, _thirst, _hunger] call FUNC(handleEffects); 68 | 69 | // Handle showing/updating or hiding of HUD 70 | if (!ACEGVAR(common,OldIsCamera) && {_thirst > GVAR(hudShowLevel) || {_hunger > GVAR(hudShowLevel)} || {GVAR(hudInteractionHover)}}) then { 71 | [_thirst, _hunger] call FUNC(handleHUD); 72 | } else { 73 | QGVAR(hud) cutFadeOut 0.5; 74 | }; 75 | 76 | [FUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; 77 | -------------------------------------------------------------------------------- /addons/field_rations/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\field_rations\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/field_rations/initSettings.sqf: -------------------------------------------------------------------------------- 1 | [ 2 | QGVAR(enabled), 3 | "CHECKBOX", 4 | [ACELSTRING(common,Enabled), LSTRING(Enabled_Description)], 5 | LSTRING(DisplayName), 6 | false, 7 | true, 8 | {}, 9 | true // Needs restart 10 | ] call CBA_settings_fnc_init; 11 | 12 | [ 13 | QGVAR(timeWithoutWater), 14 | "SLIDER", 15 | [LSTRING(TimeWithoutWater_DisplayName), LSTRING(TimeWithoutWater_Description)], 16 | LSTRING(DisplayName), 17 | [0.1, 168, 2, 1], 18 | true 19 | ] call CBA_settings_fnc_init; 20 | 21 | [ 22 | QGVAR(timeWithoutFood), 23 | "SLIDER", 24 | [LSTRING(TimeWithoutFood_DisplayName), LSTRING(TimeWithoutFood_Description)], 25 | LSTRING(DisplayName), 26 | [0.1, 504, 2, 1], 27 | true 28 | ] call CBA_settings_fnc_init; 29 | 30 | [ 31 | QGVAR(thirstQuenched), 32 | "SLIDER", 33 | [LSTRING(ThirstQuenched_DisplayName), LSTRING(ThirstQuenched_Description)], 34 | LSTRING(DisplayName), 35 | [0.1, 10, 1, 1], 36 | true 37 | ] call CBA_settings_fnc_init; 38 | 39 | [ 40 | QGVAR(hungerSatiated), 41 | "SLIDER", 42 | [LSTRING(HungerSatiated_DisplayName), LSTRING(HungerSatiated_Description)], 43 | LSTRING(DisplayName), 44 | [0.1, 10, 1, 1], 45 | true 46 | ] call CBA_settings_fnc_init; 47 | 48 | [ 49 | QGVAR(waterSourceActions), 50 | "LIST", 51 | [LSTRING(WaterSourceActions_DisplayName), LSTRING(WaterSourceActions_Description)], 52 | LSTRING(DisplayName), 53 | [[0, 1, 2], [ACELSTRING(common,Disabled), LSTRING(RefillOnly), ACELSTRING(common,Enabled)], 2], 54 | true 55 | ] call CBA_settings_fnc_init; 56 | 57 | [ 58 | QGVAR(terrainObjectActions), 59 | "CHECKBOX", 60 | [LSTRING(TerrainObjectActions_DisplayName), LSTRING(TerrainObjectActions_Description)], 61 | LSTRING(DisplayName), 62 | true, 63 | true 64 | ] call CBA_settings_fnc_init; 65 | 66 | [ 67 | QGVAR(affectAdvancedFatigue), 68 | "CHECKBOX", 69 | [LSTRING(AffectAdvancedFatigue_DisplayName), LSTRING(AffectAdvancedFatigue_Description)], 70 | LSTRING(DisplayName), 71 | true, 72 | true 73 | ] call CBA_settings_fnc_init; 74 | 75 | [ 76 | QGVAR(hudType), 77 | "LIST", 78 | [LSTRING(HudType_DisplayName), LSTRING(HudType_Description)], 79 | LSTRING(DisplayName), 80 | [[0, 1], [LSTRING(ColoredIcons), LSTRING(DrainingIcons)], 0], 81 | false, 82 | { 83 | QGVAR(hud) cutFadeOut 0; 84 | } 85 | ] call CBA_settings_fnc_init; 86 | 87 | [ 88 | QGVAR(hudShowLevel), 89 | "LIST", 90 | [LSTRING(HudShowLevel_DisplayName), LSTRING(HudShowLevel_Description)], 91 | LSTRING(DisplayName), 92 | [[0, 10, 20, 30, 40, 50, 60, 70], [LSTRING(Always), "10%", "20%", "30%", "40%", "50%", "60%", "70%"], 0], 93 | false 94 | ] call CBA_settings_fnc_init; 95 | 96 | [ 97 | QGVAR(hudTransparency), 98 | "LIST", 99 | [LSTRING(HudTransparency_DisplayName), LSTRING(HudTransparency_Description)], 100 | LSTRING(DisplayName), 101 | [[-1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], [LSTRING(Dynamic), "0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", 0], 0], 102 | false 103 | ] call CBA_settings_fnc_init; 104 | -------------------------------------------------------------------------------- /addons/field_rations/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT field_rations 2 | #define COMPONENT_BEAUTIFIED Field Rations 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_FIELD_RATIONS 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_FIELD_RATIONS 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_FIELD_RATIONS 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | 19 | #include "\a3\ui_f\hpp\defineCommonGrids.inc" 20 | 21 | #define MP_SYNC_INTERVAL (60 + random 60) 22 | 23 | #define REFILL_WATER_INFINITE -10 24 | #define REFILL_WATER_DISABLED -1 25 | #define CHECK_WATER_TIME 2 26 | #define DRINK_FROM_SOURCE_AMOUNT 1 27 | #define DRINK_FROM_SOURCE_QUENCHED 10 28 | #define DRINK_FROM_SOURCE_TIME 10 29 | 30 | #define IDC_COLORED_HUD_THIRST 6740 31 | #define IDC_COLORED_HUD_HUNGER 6750 32 | #define IDC_DRAINING_HUD_THIRST_GROUP 7740 33 | #define IDC_DRAINING_HUD_THIRST_ICON 7750 34 | #define IDC_DRAINING_HUD_HUNGER_GROUP 7840 35 | #define IDC_DRAINING_HUD_HUNGER_ICON 7850 36 | -------------------------------------------------------------------------------- /addons/field_rations/sounds/drink1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/sounds/drink1.ogg -------------------------------------------------------------------------------- /addons/field_rations/sounds/drink2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/sounds/drink2.ogg -------------------------------------------------------------------------------- /addons/field_rations/sounds/drink_can1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/sounds/drink_can1.ogg -------------------------------------------------------------------------------- /addons/field_rations/sounds/drink_can2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/sounds/drink_can2.ogg -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_can_franta_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_can_franta_ca.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_can_redgull_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_can_redgull_ca.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_can_spirit_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_can_spirit_ca.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_hud_hungerstatus.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_hud_hungerstatus.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_hud_thirststatus.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_hud_thirststatus.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_survival.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_survival.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/icon_water_tap.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/icon_water_tap.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/igui_preview.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/igui_preview.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_canteen_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_canteen_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_human_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_human_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type1_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type1_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type2_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type2_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type3_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type3_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type4_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type4_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type5_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type5_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_mre_type6_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_mre_type6_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_waterbottle_empty_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_waterbottle_empty_co.paa -------------------------------------------------------------------------------- /addons/field_rations/ui/item_waterbottle_full_co.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/field_rations/ui/item_waterbottle_full_co.paa -------------------------------------------------------------------------------- /addons/fortify/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\fortify 2 | -------------------------------------------------------------------------------- /addons/fortify/ACEX_Fortify_Presets.hpp: -------------------------------------------------------------------------------- 1 | class ACEX_Fortify_Presets { 2 | class small { 3 | displayName = CSTRING(small); 4 | objects[] = { 5 | {"Land_BagFence_Round_F", 5}, 6 | {"Land_BagFence_Short_F", 5}, 7 | {"Land_BagFence_Long_F", 10}, 8 | {"Land_Plank_01_4m_F", 10}, 9 | {"Land_BagBunker_Small_F", 25} 10 | }; 11 | }; 12 | class smallGreen { 13 | displayName = CSTRING(smallGreen); 14 | objects[] = { 15 | {"Land_BagFence_01_round_green_F", 5}, 16 | {"Land_BagFence_01_short_green_F", 5}, 17 | {"Land_BagFence_01_long_green_F", 10}, 18 | {"Land_Plank_01_4m_F", 10}, 19 | {"Land_WoodenShelter_01_F", 25} 20 | }; 21 | }; 22 | class medium { 23 | displayName = CSTRING(medium); 24 | objects[] = { 25 | {"Land_HBarrierTower_F", 100}, 26 | {"Land_HBarrierWall4_F", 25}, 27 | {"Land_HBarrierWall_corner_F", 25}, 28 | {"Land_HBarrier_1_F", 5} 29 | }; 30 | }; 31 | class mediumGreen { 32 | displayName = CSTRING(mediumGreen); 33 | objects[] = { 34 | {"Land_HBarrier_01_big_tower_green_F", 100}, 35 | {"Land_HBarrier_01_wall_4_green_F", 25}, 36 | {"Land_HBarrier_01_wall_corner_green_F", 25}, 37 | {"Land_HBarrier_01_line_1_green_F", 5} 38 | }; 39 | }; 40 | class big { 41 | displayName = CSTRING(big); 42 | objects[] = { 43 | {"Land_BagBunker_Tower_F", 50}, 44 | {"Land_BagBunker_Large_F", 100}, 45 | {"Land_BagBunker_Small_F", 25}, 46 | {"Land_Cargo_Patrol_V1_F", 100}, 47 | {"Land_BagFence_Round_F", 5}, 48 | {"Land_BagFence_Short_F", 5}, 49 | {"Land_BagFence_Long_F", 10} 50 | }; 51 | }; 52 | class bigGreen { 53 | displayName = CSTRING(bigGreen); 54 | objects[] = { 55 | {"Land_PillboxBunker_01_big_F", 100}, 56 | {"Land_PillboxWall_01_3m_F", 10}, 57 | {"Land_PillboxWall_01_6m_F", 15}, 58 | {"Land_PillboxBunker_01_hex_F", 50}, 59 | {"Land_PillboxBunker_01_rectangle_F", 50}, 60 | {"Land_Plank_01_8m_F", 10}, 61 | {"Land_Plank_01_4m_F", 5}, 62 | {"Land_BagFence_01_round_green_F", 5}, 63 | {"Land_BagFence_01_short_green_F", 5}, 64 | {"Land_BagFence_01_long_green_F", 10} 65 | }; 66 | }; 67 | }; 68 | -------------------------------------------------------------------------------- /addons/fortify/Cfg3DEN.hpp: -------------------------------------------------------------------------------- 1 | class Cfg3DEN { 2 | class Attributes { 3 | class Default; 4 | class Title: Default { 5 | class Controls { 6 | class Title; 7 | }; 8 | }; 9 | class Combo: Title { 10 | class Controls: Controls { 11 | class Title: Title {}; 12 | class Value; 13 | }; 14 | }; 15 | class GVAR(presetSelection): Combo { 16 | class Controls: Controls { 17 | class Title: Title {}; 18 | class Value: Value { 19 | delete Items; 20 | class ItemsConfig { 21 | path[] = {QGVAR(Presets)}; 22 | localConfig = 1; 23 | propertyText = "displayName"; 24 | sort = true; 25 | }; 26 | }; 27 | }; 28 | }; 29 | }; 30 | }; 31 | -------------------------------------------------------------------------------- /addons/fortify/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | 13 | class Extended_PostInit_EventHandlers { 14 | class ADDON { 15 | init = QUOTE(call COMPILE_FILE(XEH_postInit)); 16 | }; 17 | }; 18 | 19 | class Extended_DisplayLoad_EventHandlers { 20 | class RscDisplayMission { 21 | ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad)); 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /addons/fortify/CfgWeapons.hpp: -------------------------------------------------------------------------------- 1 | class CfgWeapons { 2 | class ACE_ItemCore; 3 | class CBA_MiscItem_ItemInfo; 4 | 5 | class ACE_Fortify: ACE_ItemCore { 6 | author = ACECSTRING(common,ACETeam); 7 | displayName = CSTRING(FortifyItem_name); 8 | descriptionShort = ""; 9 | model = "\A3\Structures_F\Items\Tools\Hammer_F.p3d"; 10 | picture = QPATHTOF(UI\hammer_ca.paa); 11 | scope = 2; 12 | class ItemInfo: CBA_MiscItem_ItemInfo { 13 | mass = 0; 14 | }; 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /addons/fortify/README.md: -------------------------------------------------------------------------------- 1 | acex_fortify 2 | ============ 3 | 4 | Allows quick placement of fortifications. 5 | 6 | ## Author 7 | 8 | - [Kingsley](https://github.com/jameslkingsley) 9 | 10 | ## Maintainers 11 | 12 | The people responsible for merging changes to this component or answering potential questions. 13 | 14 | - [PabstMirror](https://github.com/PabstMirror) 15 | -------------------------------------------------------------------------------- /addons/fortify/UI/hammer_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/fortify/UI/hammer_ca.paa -------------------------------------------------------------------------------- /addons/fortify/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | TRACE_1("",QUOTE(ADDON)); 2 | 3 | PREP(addDeployHandler); 4 | PREP(registerObjects); 5 | PREP(canFortify); 6 | PREP(deployObject); 7 | PREP(deployConfirm); 8 | PREP(handleScrollWheel); 9 | PREP(addActions); 10 | PREP(getCost); 11 | PREP(getBudget); 12 | PREP(updateBudget); 13 | PREP(axisLengths); 14 | PREP(handleChatCommand); 15 | PREP(parseSide); 16 | PREP(getPlaceableSet); 17 | PREP(modifyAction); 18 | PREP(setupModule); 19 | PREP(buildLocationModule); 20 | -------------------------------------------------------------------------------- /addons/fortify/XEH_missionDisplayLoad.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | if (!hasInterface) exitWith {}; 4 | 5 | params ["_display"]; 6 | 7 | _display displayAddEventHandler ["MouseZChanged", { 8 | (_this select 1) call FUNC(handleScrollWheel); 9 | }]; 10 | 11 | _display displayAddEventHandler ["MouseButtonDown", { 12 | if (GVAR(isPlacing) != PLACE_WAITING) exitWith {false}; 13 | if ((_this select 1) != 1) exitWith {false}; 14 | GVAR(isPlacing) = PLACE_CANCEL 15 | }]; 16 | -------------------------------------------------------------------------------- /addons/fortify/XEH_postInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | if (isServer) then { 4 | [QGVAR(registerObjects), LINKFUNC(registerObjects)] call CBA_fnc_addEventHandler; 5 | [QGVAR(objectPlaced), { 6 | params ["_unit", "_side", "_object"]; 7 | TRACE_3("objectPlaced",_unit,_side,_object); 8 | private _jipID = [QGVAR(addActionToObject), [_side, _object]] call CBA_fnc_globalEventJIP; 9 | [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; // idealy this function should be called on the server 10 | }] call CBA_fnc_addEventHandler; 11 | }; 12 | 13 | if (!hasInterface) exitWith {}; 14 | 15 | GVAR(isPlacing) = PLACE_CANCEL; 16 | ["ace_interactMenuOpened", {GVAR(isPlacing) = PLACE_CANCEL}] call CBA_fnc_addEventHandler; 17 | 18 | GVAR(objectRotationX) = 0; 19 | GVAR(objectRotationY) = 0; 20 | GVAR(objectRotationZ) = 0; 21 | 22 | // Register CBA Chat command for admins (Example: #ace-fortify west small 200) 23 | ["ace-fortify", LINKFUNC(handleChatCommand), "admin"] call CBA_fnc_registerChatCommand; 24 | 25 | [QGVAR(sideBudgetHint), { 26 | params ["_side"]; 27 | if (_side isEqualTo side group ACE_player && {GVAR(settingHint) isEqualTo 2 || {GVAR(settingHint) isEqualTo 1 && {"ACE_Fortify" in (ACE_player call ACEFUNC(common,uniqueItems))}}}) then { 28 | private _budget = [_side] call FUNC(getBudget); 29 | TRACE_2("sideBudgetHint",_side,_budget); 30 | [format ["%1 $%2", LLSTRING(Budget), _budget]] call ACEFUNC(common,displayTextStructured); 31 | }; 32 | }] call CBA_fnc_addEventHandler; 33 | 34 | [QGVAR(addActionToObject), { 35 | params ["_side", "_object"]; 36 | TRACE_2("addActionToObject EH",_side,_object); 37 | if (isNull _object) exitWith {}; 38 | if (_side isEqualTo side group ace_player) then { 39 | private _budget = [_side] call FUNC(getBudget); 40 | private _cost = [_side, typeOf _object] call FUNC(getCost); 41 | private _text = [format ["Remove Object +$%1", _cost], "Remove Object"] select (_budget == -1); 42 | 43 | // Remove object action 44 | private _removeAction = [ 45 | QGVAR(removeObject), 46 | _text, 47 | "", 48 | { 49 | params ["_target", "_player", "_params"]; 50 | _params params ["_side"]; 51 | TRACE_2("deleting placed object",_target,_params); 52 | [QGVAR(objectDeleted), [_player, _side, _target]] call CBA_fnc_globalEvent; 53 | deleteVehicle _target; 54 | _params call FUNC(updateBudget); 55 | }, 56 | {(missionNamespace getVariable [QGVAR(fortifyAllowed), true]) && {"ACE_Fortify" in (_player call ACEFUNC(common,uniqueItems))}}, 57 | {}, 58 | [_side, _cost], 59 | {[0, 0, 0]}, 60 | 5 61 | ] call ACEFUNC(interact_menu,createAction); 62 | 63 | [_object, 0, ["ACE_MainActions"], _removeAction] call ACEFUNC(interact_menu,addActionToObject); 64 | }; 65 | }] call CBA_fnc_addEventHandler; 66 | -------------------------------------------------------------------------------- /addons/fortify/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | // Init array of build locations at preinit 10 | // Can add anything that would work in inArea (triggers, markers or array format [center, a, b, angle, isRectangle, c]) 11 | GVAR(locations) = []; 12 | 13 | // Custom deploy handlers 14 | GVAR(deployHandlers) = []; 15 | 16 | #include "initSettings.sqf" 17 | 18 | ADDON = true; 19 | -------------------------------------------------------------------------------- /addons/fortify/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/fortify/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | units[] = {}; 6 | weapons[] = {}; 7 | requiredVersion = REQUIRED_VERSION; 8 | requiredAddons[] = {"acex_main", "ace_interaction"}; 9 | author = ACECSTRING(common,ACETeam); 10 | authors[] = {"Kingsley"}; 11 | url = ACECSTRING(main,URL); 12 | VERSION_CONFIG; 13 | }; 14 | }; 15 | 16 | #include "Cfg3DEN.hpp" 17 | #include "CfgEventHandlers.hpp" 18 | #include "CfgVehicles.hpp" 19 | #include "CfgWeapons.hpp" 20 | 21 | #include "ACEX_Fortify_Presets.hpp" 22 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_addActions.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Adds the child actions. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * Actions 11 | * 12 | * Example: 13 | * [player] call acex_fortify_fnc_addActions 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | private _side = side group _player; 21 | private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _side], []]; 22 | private _actions = []; 23 | private _infiniteBudget = ([side group _player] call FUNC(getBudget)) == -1; 24 | 25 | { 26 | _x params ["_classname", "_cost"]; 27 | 28 | private _displayName = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); 29 | 30 | private _action = [ 31 | _classname, 32 | if (_infiniteBudget) then { _displayName } else { format ["$%1 - %2", _cost, _displayName] }, 33 | "", 34 | LINKFUNC(deployObject), 35 | { 36 | params ["", "_player", "_args"]; 37 | 38 | private _cost = _args call FUNC(getCost); 39 | private _budget = [side group _player] call FUNC(getBudget); 40 | _budget == -1 || {_budget >= _cost} 41 | }, 42 | {}, 43 | [_side, _classname] 44 | ] call ACEFUNC(interact_menu,createAction); 45 | 46 | _actions pushBack [_action, [], _player]; 47 | } forEach _objects; 48 | 49 | _actions 50 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_addDeployHandler.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Cuel, mharis001 4 | * Adds a custom deploy handler. 5 | * Code needs to return BOOL: true (allowed) / false (blocked). 6 | * 7 | * Arguments: 8 | * 0: Code 9 | * - Passed [Unit , Object being placed , Cost ] 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [{(_this select 0) getVariable ["isBobTheBuilder", false]}] call acex_fortify_fnc_addDeployHandler 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params [["_code", {}, [{}]]]; 21 | 22 | if (_code isEqualTo {} || {_code isEqualTo {true}}) exitWith {}; 23 | GVAR(deployHandlers) pushBack _code; 24 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_axisLengths.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Gets the longest axis of the bounding box of the given object. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 9 | * Return Value: 10 | * Lengths 11 | * 12 | * Example: 13 | * [_object] call acex_fortify_fnc_axisLengths; 14 | * 15 | * Public: Yes 16 | */ 17 | 18 | params [["_object", objNull, [objNull]]]; 19 | 20 | (boundingBoxReal _object) params ["_p1", "_p2"]; 21 | 22 | [ 23 | (abs ((_p2 select 0) - (_p1 select 0))), 24 | (abs ((_p2 select 1) - (_p1 select 1))), 25 | (abs ((_p2 select 2) - (_p1 select 2))) 26 | ] 27 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_buildLocationModule.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror 4 | * Handles build location module 5 | * 6 | * Arguments: 7 | * 0: The module logic 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [logic] call acex_fortify_fnc_buildLocationModule 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_logic"]; 19 | TRACE_1("buildLocations",_logic); 20 | 21 | private _area = _logic getvariable ["objectArea",[0,0,0,false,0]]; // seems to be set via the canSetArea config 22 | if ((_area param [0, 0]) == 0) exitWith {WARNING_1("Bad size? %1",_area);}; 23 | private _locationArray = [_logic]; 24 | _locationArray append _area; 25 | 26 | TRACE_1("Adding build location",_locationArray); 27 | GVAR(locations) pushBack _locationArray; 28 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_canFortify.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Checks whether the given player can fortify. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Cost (default: 0) 9 | * 10 | * Return Value: 11 | * Can Fortify 12 | * 13 | * Example: 14 | * [player] call acex_fortify_fnc_canFortify 15 | * 16 | * Public: Yes 17 | */ 18 | 19 | params ["_player", ["_cost", 0]]; 20 | 21 | (missionNamespace getVariable [QGVAR(fortifyAllowed), true]) && 22 | {"ACE_Fortify" in (_player call ACEFUNC(common,uniqueItems))} && 23 | { 24 | private _budget = [side group _player] call FUNC(getBudget); 25 | ((_budget == -1) || {_budget >= _cost}) 26 | } && { 27 | private _inArea = GVAR(locations) isEqualTo []; 28 | { 29 | if (_player inArea _x) exitWith {_inArea = true}; 30 | } forEach GVAR(locations); 31 | _inArea 32 | } 33 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_deployConfirm.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Confirms the deployment. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Fortify Object 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [player, wall] call acex_fortify_fnc_deployConfirm 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_unit", "_object"]; 20 | TRACE_2("deployConfirm",_unit,_object); 21 | 22 | private _side = side group _unit; 23 | private _cost = [_side, typeOf _object] call FUNC(getCost); 24 | [_side, -_cost] call FUNC(updateBudget); 25 | 26 | private _typeOf = typeOf _object; 27 | private _posASL = getPosASL _object; 28 | private _vectorUp = vectorUp _object; 29 | private _vectorDir = vectorDir _object; 30 | 31 | deleteVehicle _object; 32 | 33 | private _newObject = _typeOf createVehicle _posASL; 34 | _newObject setPosASL _posASL; 35 | _newObject setVectorDirAndUp [_vectorDir, _vectorUp]; 36 | 37 | // Server will use this event to run the jip compatible QGVAR(addActionToObject) event 38 | [QGVAR(objectPlaced), [_unit, _side, _newObject]] call CBA_fnc_globalEvent; 39 | 40 | if (cba_events_control) then { 41 | // Re-run if ctrl key held 42 | [_unit, _unit, [_side, _typeOf, [GVAR(objectRotationX), GVAR(objectRotationY), GVAR(objectRotationZ)]]] call FUNC(deployObject); 43 | }; 44 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_getBudget.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Gets the budget for the given side. 5 | * 6 | * Arguments: 7 | * 0: Side 8 | * 9 | * Return Value: 10 | * Budget 11 | * 12 | * Example: 13 | * [west] call acex_fortify_fnc_getBudget 14 | * 15 | * Public: Yes 16 | */ 17 | 18 | params ["_side"]; 19 | 20 | (missionNamespace getVariable [format [QGVAR(Budget_%1), _side], -1]) 21 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_getCost.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Gets the cost for the given side and classname. 5 | * 6 | * Arguments: 7 | * 0: Side 8 | * 1: Classname 9 | * 10 | * Return Value: 11 | * Cost 12 | * 13 | * Example: 14 | * [west, "Sandbag"] call acex_fortify_fnc_getCost 15 | * 16 | * Public: Yes 17 | */ 18 | 19 | params ["_side", "_classname"]; 20 | 21 | private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _side], []]; 22 | 23 | (((_objects select {(_x select 0) == _classname}) param [0, []]) param [1, 0]) 24 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_getPlaceableSet.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Gets placeable object classnames and values. 5 | * 6 | * Arguments: 7 | * 0: Size 8 | * 9 | * Return Value: 10 | * Pairs of classnames and costs 11 | * 12 | * Example: 13 | * ["small"] call acex_fortify_fnc_getPlaceableSet 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_preset"]; 19 | TRACE_1("getPlaceableSet",_preset); 20 | 21 | private _config = missionConfigFile >> "ACEX_Fortify_Presets" >> _preset; 22 | if (!isClass _config) then { 23 | _config = configfile >> "ACEX_Fortify_Presets" >> _preset; 24 | }; 25 | if (!isClass _config) exitWith { 26 | private _msg = format ["Could not find [%1]", _preset]; 27 | ERROR_WITH_TITLE("Preset not found",_msg); 28 | [] 29 | }; 30 | 31 | private _objects = getArray (_config >> "objects"); 32 | 33 | // Attemp to filter bad input 34 | _objects = _objects select { 35 | if ((_x isEqualTypeParams ["", 0])) then { 36 | _x params [["_classname", "#", [""]], ["_cost", -1, [0]]]; 37 | if (isClass (configFile >> "CfgVehicles" >> _classname)) then { 38 | true 39 | } else { 40 | ERROR_2("Preset [%1] - Classname does not exist",_preset,_classname); 41 | }; 42 | } else { 43 | ERROR_2("Preset [%1] - Bad data in objects array %2",_preset,_x); 44 | false 45 | }; 46 | }; 47 | 48 | _objects 49 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_handleChatCommand.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Handles the chat command usage by admin. 5 | * 6 | * Arguments: 7 | * 0: Chat Text 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [""] call acex_fortify_fnc_handleChatCommand 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_args"]; 19 | TRACE_1("handleChatCommand",_args); 20 | 21 | _args = _args splitString " "; 22 | if (_args isEqualTo []) exitWith {ERROR("Bad command");}; 23 | private _command = toLower (_args select 0); 24 | _args deleteAt 0; 25 | 26 | switch (_command) do { 27 | // Turns fortify mode on 28 | case "on": { 29 | missionNamespace setVariable [QGVAR(fortifyAllowed), true, true]; 30 | }; 31 | 32 | // Turns fortify mode off 33 | case "off": { 34 | missionNamespace setVariable [QGVAR(fortifyAllowed), false, true]; 35 | }; 36 | 37 | // Registers fortify presets for given side 38 | default { 39 | _args params [["_preset", "small"], ["_budget", "-1"]]; 40 | 41 | private _side = [_command] call FUNC(parseSide); 42 | _budget = parseNumber _budget; 43 | 44 | private _objects = [_preset] call FUNC(getPlaceableSet); 45 | 46 | [QGVAR(registerObjects), [_side, _budget, _objects]] call CBA_fnc_serverEvent; 47 | }; 48 | }; 49 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_handleScrollWheel.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Handles the object direction. 5 | * 6 | * Arguments: 7 | * 0: Scroll 8 | * 9 | * Return Value: 10 | * Handled 11 | * 12 | * Example: 13 | * [5] call acex_fortify_fnc_handleScrollWheel 14 | * 15 | * Public: No 16 | */ 17 | 18 | if (GVAR(isPlacing) != PLACE_WAITING) exitWith {false}; 19 | 20 | params ["_scroll"]; 21 | 22 | if (cba_events_shift) exitWith { 23 | GVAR(objectRotationX) = GVAR(objectRotationX) + (_scroll * 5); 24 | true 25 | }; 26 | 27 | if (cba_events_control) exitWith { 28 | GVAR(objectRotationY) = GVAR(objectRotationY) + (_scroll * 5); 29 | true 30 | }; 31 | 32 | GVAR(objectRotationZ) = GVAR(objectRotationZ) + (_scroll * 5); 33 | true 34 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_modifyAction.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror 4 | * Modifies the fortify action, shows current budget. 5 | * 6 | * Arguments: 7 | * 0: Target 8 | * 1: Player 9 | * 2: Args 10 | * 3: Action Data 11 | * 12 | * Return Value: 13 | * None 14 | * 15 | * Example: 16 | * [player, player, [], []] call acex_fortify_fnc_modifyAction 17 | * 18 | * Public: No 19 | */ 20 | 21 | params ["", "_player", "", "_actionData"]; 22 | 23 | private _budget = [side group _player] call FUNC(getBudget); 24 | private _actionText = if (_budget > 0) then { 25 | format ["%1 [$%2]", LLSTRING(fortify), _budget]; 26 | } else { 27 | LLSTRING(fortify); 28 | }; 29 | 30 | _actionData set [1, _actionText]; 31 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_parseSide.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Parses the given text and returns a side. 5 | * 6 | * Arguments: 7 | * 0: Text 8 | * 9 | * Return Value: 10 | * Side 11 | * 12 | * Example: 13 | * ["blufor"] call acex_fortify_fnc_parseSide; 14 | * ["west"] call acex_fortify_fnc_parseSide; 15 | * ["b"] call acex_fortify_fnc_parseSide; 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params ["_side"]; 21 | TRACE_1("parseSide",_side); 22 | 23 | if (_side isEqualType sideUnknown) exitWith {_side}; 24 | 25 | private _char = toLower (_side select [0, 1]); 26 | 27 | private _return = switch (_char) do { 28 | case ("b"); 29 | case ("w"): {west}; 30 | case ("o"); 31 | case ("e"): {east}; 32 | case ("r"); 33 | case ("i"): {resistance}; 34 | case ("c"): {civilian}; 35 | default {sideUnknown}; 36 | }; 37 | 38 | TRACE_2("",_char,_return); 39 | _return 40 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_registerObjects.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Registers the given objects in the given side's player interaction menu. 5 | * Players on that side must have the pickaxe item in their inventory to access the menu. 6 | * Classnames must be in the format [, ] 7 | * MUST BE CALLED ON SERVER! 8 | * 9 | * Arguments: 10 | * 0: Side 11 | * 1: Budget 12 | * 2: Object Classnames 13 | * 14 | * Return Value: 15 | * None 16 | * 17 | * Example: 18 | * [west, 5000, [["Land_BagFence_Long_F", 5], ["Land_BagBunker_Small_F", 50]]] call acex_fortify_fnc_registerObjects 19 | * 20 | * Public: Yes 21 | */ 22 | 23 | if (!isServer) exitWith {}; 24 | 25 | params [["_side", sideUnknown, [sideUnknown]], ["_budget", -1, [0]], ["_objects", [], [[]]]]; 26 | TRACE_3("registerObjects",_side,_budget,_objects); 27 | 28 | if (_side isEqualTo sideUnknown) exitWith {ERROR_1("Bad Side %1",_this);}; 29 | 30 | _objects select { 31 | private _isValid = _x params [["_xClassname", "", [""]], ["_xCost", 0, [0]]]; 32 | if (_isValid) then { 33 | _isValid = isClass (configFile >> "CfgVehicles" >> _xClassname); 34 | if (!_isValid) then {WARNING_1("Classname does not exist in CfgVehicles %1",_x);}; 35 | } else { 36 | WARNING_1("Bad classname/cost input %1, should be [,]",_x); 37 | }; 38 | _isValid 39 | }; 40 | 41 | if (!isNil {missionNamespace getVariable format [QGVAR(Budget_%1), _side]}) then { 42 | INFO_1("Overwriting previous budget for side [%1]",_side); 43 | }; 44 | if (!isNil {missionNamespace getVariable format [QGVAR(Objects_%1), _side]}) then { 45 | INFO_1("Overwriting previous objects for side [%1]",_side); 46 | }; 47 | 48 | missionNamespace setVariable [format [QGVAR(Budget_%1), _side], _budget, true]; 49 | missionNamespace setVariable [format [QGVAR(Objects_%1), _side], _objects, true]; 50 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_setupModule.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror 4 | * Handles setup module. 5 | * 6 | * Arguments: 7 | * 0: The module logic 8 | * 1: Synchronized units 9 | * 2: Activated 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [logic, [], true] call acex_fortify_fnc_setupModule 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_logic", "", "_activated"]; 21 | TRACE_2("setupModule",_logic,_activated); 22 | 23 | // Note: no changes needed here for cba-setting switch 24 | if (!isServer) exitWith {}; 25 | if (!_activated) exitWith {}; 26 | 27 | 28 | private _side = _logic getVariable ["Side", 1]; 29 | _side = switch (_side) do { 30 | case (1): {west}; 31 | case (2): {east}; 32 | case (3): {resistance}; 33 | case (4): {civilian}; 34 | default {sideUnknown}; 35 | }; 36 | 37 | private _preset = _logic getVariable ["Preset", "small"]; 38 | if IS_NUMBER(_preset) then { // Legacy support 39 | _preset = switch (_preset) do { 40 | case 1: {"small"}; 41 | case 2: {"medium"}; 42 | case 3: {"big"}; 43 | case 4: {"smallGreen"}; 44 | case 5: {"mediumGreen"}; 45 | case 6: {"bigGreen"}; 46 | default {"?"}; 47 | }; 48 | }; 49 | 50 | private _budget = _logic getVariable ["Budget", -1]; 51 | if (!(_budget isEqualType 0)) then {_budget = -1}; 52 | 53 | private _addToolItem = _logic getVariable ["AddToolItem", false]; 54 | if (!(_addToolItem isEqualType false)) then {_addToolItem = false}; 55 | 56 | 57 | private _objects = [_preset] call FUNC(getPlaceableSet); 58 | [QGVAR(registerObjects), [_side, _budget, _objects]] call CBA_fnc_serverEvent; 59 | 60 | if (_addToolItem) then { 61 | [{ 62 | params ["_side"]; 63 | TRACE_1("Adding tool",_side); 64 | { 65 | if (((side group _x) == _side) && {!("ACE_Fortify" in (_x call ACEFUNC(common,uniqueItems)))}) then { 66 | _x addItem "ACE_Fortify"; 67 | }; 68 | } forEach allUnits; 69 | }, [_side], 3] call CBA_fnc_waitAndExecute; 70 | }; 71 | 72 | INFO_4("Fortify Module Actived [Side: %1][Preset: %2][Budget: %3][AutoAdd: %4]",_side,_preset,_budget,_addToolItem); 73 | -------------------------------------------------------------------------------- /addons/fortify/functions/fnc_updateBudget.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Updates the given sides budget. 5 | * 6 | * Arguments: 7 | * 0: Side 8 | * 1: Change (default: 0) 9 | * 2: Display hint (default: true) 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [west, -250, false] call acex_fortify_fnc_updateBudget 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params [["_side", sideUnknown, [sideUnknown]], ["_change", 0, [0]], ["_hint", true, [true]]]; 21 | TRACE_3("updateBudget",_side,_change,_hint); 22 | 23 | if (_side isEqualTo sideUnknown) exitWith {ERROR("Unknown side");}; 24 | 25 | private _budget = [_side] call FUNC(getBudget); 26 | private _newBudget = _budget + _change; 27 | 28 | _newBudget = 0 max _newBudget; 29 | 30 | if (_budget != -1) then { 31 | missionNamespace setVariable [format [QGVAR(Budget_%1), _side], _newBudget, true]; 32 | 33 | if (_hint) then { 34 | [QGVAR(sideBudgetHint), [_side]] call CBA_fnc_globalEvent; 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /addons/fortify/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\fortify\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/fortify/initSettings.sqf: -------------------------------------------------------------------------------- 1 | [ 2 | QGVAR(settingHint), 3 | "LIST", 4 | [LLSTRING(settingHint), LLSTRING(settingHintDesc)], 5 | LLSTRING(settingsCategory), 6 | [ 7 | [0, 1, 2], 8 | [LLSTRING(settingHintNone), LLSTRING(settingHintHasTool), LLSTRING(settingHintEveryone)], 9 | 2 10 | ] 11 | ] call CBA_settings_fnc_init; 12 | -------------------------------------------------------------------------------- /addons/fortify/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT fortify 2 | #include "\z\acex\addons\main\script_mod.hpp" 3 | 4 | // #define DEBUG_MODE_FULL 5 | // #define DISABLE_COMPILE_CACHE 6 | // #define ENABLE_PERFORMANCE_COUNTERS 7 | 8 | #ifdef DEBUG_ENABLED_FORTIFY 9 | #define DEBUG_MODE_FULL 10 | #endif 11 | 12 | #ifdef DEBUG_SETTINGS_FORTIFY 13 | #define DEBUG_SETTINGS DEBUG_SETTINGS_FORTIFY 14 | #endif 15 | 16 | #include "\z\acex\addons\main\script_macros.hpp" 17 | #include "\a3\ui_f\hpp\defineDIKCodes.inc" 18 | 19 | #define PLACE_WAITING -1 20 | #define PLACE_CANCEL 0 21 | #define PLACE_APPROVE 1 22 | -------------------------------------------------------------------------------- /addons/headless/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\headless 2 | -------------------------------------------------------------------------------- /addons/headless/ACE_Settings.hpp: -------------------------------------------------------------------------------- 1 | class ACE_Settings { 2 | class GVAR(enabled) { 3 | category = CSTRING(Module); 4 | value = 0; 5 | typeName = "BOOL"; 6 | displayName = ACECSTRING(common,Enabled); 7 | description = CSTRING(EnabledDesc); 8 | }; 9 | class GVAR(delay) { 10 | category = CSTRING(Module); 11 | value = DELAY_DEFAULT; 12 | typeName = "SCALAR"; 13 | displayName = CSTRING(Delay); 14 | description = CSTRING(DelayDesc); 15 | sliderSettings[] = {0, 120, DELAY_DEFAULT, 0}; 16 | }; 17 | class GVAR(endMission) { 18 | category = CSTRING(Module); 19 | value = 0; 20 | values[] = {ACECSTRING(Common,Disabled), CSTRING(Instant), CSTRING(Delayed)}; 21 | typeName = "SCALAR"; 22 | displayName = CSTRING(EndMission); 23 | description = CSTRING(EndMissionDesc); 24 | }; 25 | class GVAR(log) { 26 | category = CSTRING(Module); 27 | value = 0; 28 | typeName = "BOOL"; 29 | displayName = CSTRING(Log); 30 | description = CSTRING(LogDesc); 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /addons/headless/CfgEden.hpp: -------------------------------------------------------------------------------- 1 | class Cfg3DEN { 2 | class Object { 3 | class AttributeCategories { 4 | class ace_attributes { 5 | class Attributes { 6 | class GVAR(blacklist) { 7 | displayName = CSTRING(BlacklistEden); 8 | tooltip = CSTRING(BlacklistEdenDesc); 9 | property = QGVAR(blacklist); 10 | control = "Checkbox"; 11 | condition = "objectControllable"; 12 | expression = QUOTE(_this setVariable [ARR_3(QQGVAR(blacklist), _value, true)]); 13 | defaultValue = "(false)"; 14 | }; 15 | }; 16 | }; 17 | }; 18 | }; 19 | class Group { 20 | class AttributeCategories { 21 | class ace_attributes { 22 | class Attributes { 23 | class GVAR(blacklist) { 24 | displayName = CSTRING(BlacklistEden); 25 | tooltip = CSTRING(BlacklistEdenDesc); 26 | property = QGVAR(blacklist); 27 | control = "Checkbox"; 28 | expression = QUOTE(_this setVariable [ARR_3(QQGVAR(blacklist), _value, true)]); 29 | defaultValue = "(false)"; 30 | }; 31 | }; 32 | }; 33 | }; 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /addons/headless/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | 13 | class Extended_PostInit_EventHandlers { 14 | class ADDON { 15 | init = QUOTE(call COMPILE_FILE(XEH_postInit)); 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /addons/headless/CfgVehicles.hpp: -------------------------------------------------------------------------------- 1 | class CfgVehicles { 2 | class ACE_Module; 3 | class GVAR(module): ACE_Module { 4 | author = ACECSTRING(common,ACETeam); 5 | category = "ACEX"; 6 | displayName = CSTRING(Module); 7 | function = QFUNC(moduleInit); 8 | scope = 1; 9 | isGlobal = 1; // Global 10 | isTriggerActivated = 0; 11 | isDisposable = 0; 12 | icon = QPATHTOF(UI\Icon_Module_Headless_ca.paa); 13 | class Arguments { 14 | class enabled { 15 | displayName = ACECSTRING(common,Enabled); 16 | description = CSTRING(EnabledDesc); 17 | typeName = "BOOL"; 18 | defaultValue = 0; 19 | }; 20 | class delay { 21 | displayName = CSTRING(Delay); 22 | description = CSTRING(DelayDesc); 23 | typeName = "NUMBER"; 24 | defaultValue = DELAY_DEFAULT; 25 | }; 26 | class endMission { 27 | displayName = CSTRING(EndMission); 28 | description = CSTRING(EndMissionDesc); 29 | typeName = "NUMBER"; 30 | class values { 31 | class disabled { 32 | name = ACECSTRING(Common,Disabled); 33 | value = 0; 34 | default = 1; 35 | }; 36 | class instant { 37 | name = CSTRING(Instant); 38 | value = 1; 39 | }; 40 | class delayed { 41 | name = CSTRING(Delayed); 42 | value = 2; 43 | }; 44 | }; 45 | }; 46 | class log { 47 | displayName = CSTRING(Log); 48 | description = CSTRING(LogDesc); 49 | typeName = "BOOL"; 50 | defaultValue = 0; 51 | }; 52 | }; 53 | class ModuleDescription { 54 | description = CSTRING(ModuleDesc); 55 | }; 56 | }; 57 | }; 58 | -------------------------------------------------------------------------------- /addons/headless/README.md: -------------------------------------------------------------------------------- 1 | acex_headless 2 | ============ 3 | 4 | Adds automatic passing of AI groups to (up to 3) Headless Clients. 5 | - Automatic Headless Client recognition 6 | - Event-based transferring (on unit spawn, Headless Client connect and disconnect) 7 | - Round-robin transferring when more than 1 Headless Client is present 8 | - Mission makers can use the following to prevent a group from transferring to a Headless Client: 9 | `this setVariable ["acex_headless_blacklist", true, true];` 10 | 11 | 12 | ## Maintainers 13 | 14 | The people responsible for merging changes to this component or answering potential questions. 15 | 16 | - [Jonpas](http://github.com/jonpas) 17 | -------------------------------------------------------------------------------- /addons/headless/UI/Icon_Module_Headless_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/headless/UI/Icon_Module_Headless_ca.paa -------------------------------------------------------------------------------- /addons/headless/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(endMissionNoPlayers); 2 | PREP(handleConnectHC); 3 | PREP(handleDisconnect); 4 | PREP(handleSpawn); 5 | PREP(moduleInit); 6 | PREP(rebalance); 7 | PREP(transferGroups); 8 | -------------------------------------------------------------------------------- /addons/headless/XEH_postInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ["ace_settingsInitialized", { 4 | // Register and remove HCs if not client that is not server and distribution or end mission enabled 5 | if ((!hasInterface || isServer) && {GVAR(enabled) || GVAR(endMission) != 0}) then { 6 | if (isServer) then { 7 | // Request rebalance on any unit spawn (only if distribution enabled) 8 | if (GVAR(enabled)) then { 9 | ["AllVehicles", "init", FUNC(handleSpawn), nil, nil, true] call CBA_fnc_addClassEventHandler; 10 | }; 11 | // Add disconnect EH 12 | addMissionEventHandler ["HandleDisconnect", {call FUNC(handleDisconnect)}]; 13 | } else { 14 | // Register HC (this part happens on HC only) 15 | [QGVAR(headlessClientJoined), [player]] call CBA_fnc_globalEvent; // Global event for API purposes 16 | }; 17 | 18 | // Transfer loadouts (naked unit work-around) 19 | if (GVAR(transferLoadout) > 0) then { 20 | ["CAManBase", "Local", { 21 | params ["_unit", "_local"]; 22 | 23 | // Check if naked unit bug happened 24 | if (_local && {uniform _unit == ""}) then { 25 | INFO_1("Unit [%1] became local with broken loadout - attempting to fix",_unit); 26 | if (GVAR(transferLoadout) == 1) then { 27 | // Transferred loadout, if unavailable reset to config default (still better than naked) 28 | _unit setUnitLoadout (_unit getVariable [QGVAR(loadout), typeOf _unit]); 29 | } else { 30 | // Config default loadout 31 | _unit setUnitLoadout (typeOf _unit); 32 | }; 33 | }; 34 | }] call CBA_fnc_addClassEventHandler; 35 | }; 36 | }; 37 | }] call CBA_fnc_addEventHandler; 38 | -------------------------------------------------------------------------------- /addons/headless/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | #include "initSettings.sqf" 10 | 11 | if (isServer) then { 12 | GVAR(headlessClients) = []; 13 | GVAR(inRebalance) = false; 14 | GVAR(endMissionCheckDelayed) = false; 15 | GVAR(blacklistType) = [BLACKLIST_UAV]; 16 | [QGVAR(headlessClientJoined), FUNC(handleConnectHC)] call CBA_fnc_addEventHandler; 17 | }; 18 | 19 | ADDON = true; 20 | -------------------------------------------------------------------------------- /addons/headless/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/headless/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = {}; 7 | weapons[] = {}; 8 | requiredVersion = REQUIRED_VERSION; 9 | requiredAddons[] = {"acex_main"}; 10 | author = ACECSTRING(common,ACETeam); 11 | authors[]= {"Jonpas"}; 12 | url = ACECSTRING(main,URL); 13 | VERSION_CONFIG; 14 | }; 15 | }; 16 | 17 | #include "ACE_Settings.hpp" 18 | #include "CfgEventHandlers.hpp" 19 | #include "CfgVehicles.hpp" 20 | #include "CfgEden.hpp" 21 | 22 | class ACE_newEvents { 23 | ACE_HeadlessClientJoined = QGVAR(headlessClientJoined); 24 | }; 25 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_endMissionNoPlayers.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Ends mission on server if no players are connected. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [] call acex_headless_fnc_endMissionNoPlayers 14 | * 15 | * Public: No 16 | */ 17 | 18 | // Exit if no players of virtual curators present 19 | if (call CBA_fnc_players isEqualTo [] && {(allCurators select {isPlayer getAssignedCuratorUnit _x}) isEqualTo []}) exitWith { 20 | // End mission 21 | [] call BIS_fnc_endMissionServer; 22 | if (GVAR(log)) then { 23 | INFO("Ended Mission on all players leaving."); 24 | }; 25 | }; 26 | 27 | // Delay mission end otherwise 28 | GVAR(endMissionCheckDelayed) = false; 29 | TRACE_2("Players are present",count (call CBA_fnc_players),count allCurators); 30 | 31 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_handleConnectHC.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Registers connected Headless Client for use. 5 | * 6 | * Arguments: 7 | * 0: Headless Client 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [headlessClient] call acex_headless_fnc_handleConnectHC 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_headlessClient"]; 19 | 20 | // Exit if HC already registered 21 | // No need to check if distribution or end mission enabled, as if disabled this will never run 22 | if (_headlessClient in GVAR(headlessClients)) exitWith {}; 23 | 24 | // Register for use 25 | GVAR(headlessClients) pushBack _headlessClient; 26 | 27 | if (GVAR(log)) then { 28 | INFO_1("Registered HC: %1",_headlessClient); 29 | }; 30 | 31 | // Exit if AI distribution is disabled 32 | if (!GVAR(enabled)) exitWith {true}; 33 | 34 | // Rebalance 35 | [true] call FUNC(rebalance); 36 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_handleDisconnect.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Removes Headless Client from use. 5 | * Ends mission if setting enabled and only Headless Clients are still connected. 6 | * 7 | * Arguments: 8 | * 0: Object 9 | * 10 | * Return Value: 11 | * Transfer To Server 12 | * 13 | * Example: 14 | * [unit] call acex_headless_fnc_handleDisconnect 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_object"]; 20 | TRACE_1("HandleDisconnect",_this); 21 | 22 | // Exit if not HC 23 | if !(_object in GVAR(headlessClients)) exitWith { 24 | TRACE_2("Object not in HC list",_object,GVAR(headlessClients)); 25 | // End mission when no players present 26 | if (GVAR(endMission) != 0 && {!GVAR(endMissionCheckDelayed)}) then { 27 | // Delay check until 2.5 minutes into the mission - wait for allPlayers to sync 28 | if (CBA_missionTime < 150) then { 29 | TRACE_1("Mission start delay",CBA_missionTime); 30 | GVAR(endMissionCheckDelayed) = true; 31 | [{ 32 | call FUNC(endMissionNoPlayers); 33 | }, [], 150 - CBA_missionTime] call CBA_fnc_waitAndExecute; 34 | } else { 35 | // End instantly or after delay 36 | if (GVAR(endMission) == 1) then { 37 | TRACE_2("Instant end",GVAR(endMission),CBA_missionTime); 38 | call FUNC(endMissionNoPlayers); 39 | } else { 40 | TRACE_2("Delayed 60s end",GVAR(endMission),CBA_missionTime); 41 | GVAR(endMissionCheckDelayed) = true; 42 | [FUNC(endMissionNoPlayers), [], 60] call CBA_fnc_waitAndExecute; 43 | }; 44 | }; 45 | }; 46 | false 47 | }; 48 | 49 | // Exit if AI distribution is disabled 50 | if (!GVAR(enabled)) exitWith {true}; 51 | 52 | // Remove HC 53 | GVAR(headlessClients) deleteAt (GVAR(headlessClients) find _object); 54 | 55 | if (GVAR(log)) then { 56 | INFO_1("Removed HC: %1",_object); 57 | }; 58 | 59 | // Rebalance 60 | [true] call FUNC(rebalance); 61 | 62 | // Prevent transferring of HC to server 63 | false 64 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_handleSpawn.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Handles AI spawn and requests a rebalance if applicable. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [object] call acex_headless_fnc_handleSpawn 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_object"]; 19 | TRACE_1("Spawn",_object); 20 | 21 | // Exit if HC transferring disabled or object not a unit (including unit inside vehicle) or is player 22 | if (!(_object in allUnits) || {isPlayer _object}) exitWith {}; 23 | 24 | // Exit and blacklist if of blacklist type 25 | if ({_object isKindOf _x} count GVAR(blacklistType) > 0) exitWith { 26 | _object setVariable [QGVAR(blacklist), true]; 27 | }; 28 | 29 | // Rebalance 30 | [false] call FUNC(rebalance); 31 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_moduleInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Initializes the Headless module. 5 | * 6 | * Arguments: 7 | * 0: The module logic 8 | * 1: Units (Unused) 9 | * 2: Activated 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Public: No 15 | */ 16 | 17 | params ["_logic", "", "_activated"]; 18 | 19 | if (!_activated) exitWith {}; 20 | 21 | [_logic, QGVAR(enabled), "enabled"] call ACEFUNC(common,readSettingFromModule); 22 | [_logic, QGVAR(delay), "delay"] call ACEFUNC(common,readSettingFromModule); 23 | [_logic, QGVAR(endMission), "endMission"] call ACEFUNC(common,readSettingFromModule); 24 | [_logic, QGVAR(log), "log"] call ACEFUNC(common,readSettingFromModule); 25 | 26 | INFO("Headless Module Initialized."); 27 | -------------------------------------------------------------------------------- /addons/headless/functions/fnc_rebalance.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Rebalance AI groups accross HCs. 5 | * 6 | * Arguments: 7 | * 0: Force 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [false] call acex_headless_fnc_rebalance 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_force"]; 19 | 20 | TRACE_3("Rebalance",GVAR(inRebalance),GVAR(headlessClients),_force); 21 | 22 | // Exit if waiting for rebalance or no HCs present 23 | if (GVAR(inRebalance) || {GVAR(headlessClients) isEqualTo []}) exitWith {}; 24 | 25 | // Transfer after rebalance delay 26 | [FUNC(transferGroups), [_force], GVAR(Delay)] call CBA_fnc_waitAndExecute; 27 | 28 | // Currently in rebalance flag 29 | GVAR(inRebalance) = true; 30 | -------------------------------------------------------------------------------- /addons/headless/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\headless\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/headless/initSettings.sqf: -------------------------------------------------------------------------------- 1 | [ 2 | QGVAR(transferLoadout), 3 | "LIST", 4 | [LSTRING(TransferLoadout), LSTRING(TransferLoadoutDesc)], 5 | format ["ACEX %1", LLSTRING(Module)], 6 | [[0, 1, 2], [ACELSTRING(Common,Disabled), LSTRING(TransferLoadoutCurrent), LSTRING(TransferLoadoutConfig)], 0], 7 | true, 8 | {}, 9 | true // needs mission restart 10 | ] call CBA_settings_fnc_init; 11 | -------------------------------------------------------------------------------- /addons/headless/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT headless 2 | #define COMPONENT_BEAUTIFIED Headless 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_HEADLESS 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_HEADLESS 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_HEADLESS 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | 19 | #define DELAY_DEFAULT 15 20 | #define BLACKLIST_UAV "UAV", "UAV_AI_base_F", "B_UAV_AI", "O_UAV_AI", "I_UAV_AI" 21 | -------------------------------------------------------------------------------- /addons/intelitems/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\intelitems 2 | -------------------------------------------------------------------------------- /addons/intelitems/CfgEditorSubcategories.hpp: -------------------------------------------------------------------------------- 1 | class CfgEditorSubcategories { 2 | class ADDON { 3 | displayName = CSTRING(Category); 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /addons/intelitems/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | class Extended_PreInit_EventHandlers { 7 | class ADDON { 8 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 9 | }; 10 | }; 11 | class Extended_PostInit_EventHandlers { 12 | class ADDON { 13 | init = QUOTE(call COMPILE_FILE(XEH_postInit)); 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /addons/intelitems/CfgMagazines.hpp: -------------------------------------------------------------------------------- 1 | class CfgMagazines { 2 | class CA_Magazine; 3 | class GVAR(base): CA_Magazine { 4 | count = 1; 5 | mass = 1; 6 | ACE_isUnique = 1; 7 | GVAR(intel) = 1; 8 | GVAR(control) = ""; 9 | }; 10 | 11 | class GVAR(notepad): GVAR(base) { 12 | author = ACECSTRING(common,ACETeam); 13 | scope = 2; // Allows players to access from arsenal 14 | displayName = CSTRING(Notepad_DisplayName); 15 | descriptionShort = CSTRING(Notepad_Description); 16 | picture = QPATHTOF(ui\notepad_ca.paa); 17 | model = "\a3\structures_f\items\documents\notepad_f.p3d"; 18 | GVAR(control) = QGVAR(RscNotepad); 19 | }; 20 | 21 | class GVAR(document): GVAR(base) { 22 | author = ACECSTRING(common,ACETeam); 23 | displayName = CSTRING(Document_DisplayName); 24 | descriptionShort = CSTRING(Document_Description); 25 | picture = QPATHTOF(ui\document_ca.paa); 26 | model = "\a3\structures_f\items\documents\file2_f.p3d"; 27 | GVAR(control) = QGVAR(RscDocument); 28 | }; 29 | 30 | class GVAR(photo): GVAR(base) { 31 | author = ACECSTRING(common,ACETeam); 32 | displayName = CSTRING(Photo_DisplayName); 33 | descriptionShort = CSTRING(Photo_Description); 34 | picture = QPATHTOF(ui\photo_ca.paa); 35 | model = "\a3\structures_f\items\documents\filephotos_f.p3d"; 36 | GVAR(control) = QGVAR(RscPhoto); 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /addons/intelitems/CfgVehicles.hpp: -------------------------------------------------------------------------------- 1 | class CfgVehicles { 2 | class Man; 3 | class CAManBase: Man { 4 | class ACE_SelfActions { 5 | class ADDON { 6 | displayName = CSTRING(DisplayName); 7 | condition = QUOTE(visibleMap); 8 | exceptions[] = {"isNotInside", "notOnMap"}; 9 | statement = ""; 10 | insertChildren = QUOTE(_player call FUNC(addActions)); 11 | icon = ""; 12 | }; 13 | }; 14 | }; 15 | 16 | class ThingX; 17 | class GVAR(base): ThingX { 18 | XEH_ENABLED; 19 | icon = "iconObject_2x3"; 20 | mapSize = 0.3; 21 | simulation = "House"; // Needed because the objects don't have good collision physx 22 | destrType = "DesturctNo"; 23 | curatorInfoTypeEmpty = QGVAR(RscSetData); 24 | editorSubcategory = QUOTE(ADDON); 25 | GVAR(magazine) = ""; 26 | class Attributes { 27 | class GVAR(data) { 28 | displayName = CSTRING(Text); 29 | property = QGVAR(data); 30 | control = "EditMulti5"; 31 | expression = QUOTE([ARR_2(_this,_value)] call FUNC(setObjectData)); 32 | defaultValue = "''"; 33 | validate = "STRING"; 34 | typeName = "STRING"; 35 | }; 36 | }; 37 | class ACE_Actions { 38 | class GVAR(pickup) { 39 | displayName = CSTRING(Pickup); 40 | icon = "\a3\ui_f\data\igui\cfg\actions\take_ca.paa"; 41 | distance = 2; 42 | condition = QUOTE(_this call FUNC(canPickup)); 43 | statement = QUOTE(_this call FUNC(pickup)); 44 | }; 45 | }; 46 | }; 47 | 48 | class GVAR(notepad): GVAR(base) { 49 | author = ACECSTRING(common,ACETeam); 50 | displayName = CSTRING(Notepad_DisplayName); 51 | model = "\a3\structures_f\items\documents\notepad_f.p3d"; 52 | editorPreview = "\a3\editorpreviews_f\data\cfgvehicles\land_notepad_f.jpg"; 53 | scope = 2; 54 | scopeCurator = 2; 55 | GVAR(magazine) = QGVAR(notepad); 56 | }; 57 | 58 | class GVAR(document): GVAR(base) { 59 | author = ACECSTRING(common,ACETeam); 60 | displayName = CSTRING(Document_DisplayName); 61 | model = "\a3\structures_f\items\documents\file2_f.p3d"; 62 | editorPreview = "\a3\editorpreviews_f\data\cfgvehicles\intel_file2_f.jpg"; 63 | scope = 2; 64 | scopeCurator = 2; 65 | GVAR(magazine) = QGVAR(document); 66 | }; 67 | 68 | class GVAR(photo): GVAR(base) { 69 | author = ACECSTRING(common,ACETeam); 70 | displayName = CSTRING(Photo_DisplayName); 71 | model = "\a3\structures_f\items\documents\filephotos_f.p3d"; 72 | editorPreview = "\a3\editorpreviews_f\data\cfgvehicles\land_filephotos_f.jpg"; 73 | scope = 2; 74 | scopeCurator = 2; 75 | GVAR(magazine) = QGVAR(photo); 76 | class Attributes: Attributes { 77 | class GVAR(data): GVAR(data) { 78 | displayName = CSTRING(Photo_Filename); 79 | control = "Edit"; 80 | }; 81 | }; 82 | }; 83 | }; 84 | -------------------------------------------------------------------------------- /addons/intelitems/README.md: -------------------------------------------------------------------------------- 1 | acex_intelitems 2 | =============== 3 | 4 | Implements an intel system with unique items. 5 | 6 | ## Maintainers 7 | 8 | The people responsible for merging changes to this component or answering potential questions. 9 | 10 | - [PabstMirror](https://github.com/PabstMirror) 11 | - [mharis001](https://github.com/mharis001) 12 | -------------------------------------------------------------------------------- /addons/intelitems/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(addActions); 2 | PREP(addIntel); 3 | PREP(attributeFocus); 4 | PREP(canPickup); 5 | PREP(createControl); 6 | PREP(deleteControl); 7 | PREP(handleLoadout); 8 | PREP(handleMagIndex); 9 | PREP(onMouseButtonDown); 10 | PREP(onMouseButtonUp); 11 | PREP(onMouseMoving); 12 | PREP(pickup); 13 | PREP(setObjectData); 14 | -------------------------------------------------------------------------------- /addons/intelitems/XEH_postInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | // Only handle loadout change when on map or have open controls 4 | ["loadout", { 5 | if (!visibleMap && {GVAR(controlsGroups) isEqualTo []}) exitWith {}; 6 | call FUNC(handleLoadout); 7 | }, true] call CBA_fnc_addPlayerEventHandler; 8 | 9 | // Check loadout when map is opened 10 | ["visibleMap", { 11 | params ["", "_visibleMap"]; 12 | if (_visibleMap) then {call FUNC(handleLoadout)}; 13 | }, true] call CBA_fnc_addPlayerEventHandler; 14 | -------------------------------------------------------------------------------- /addons/intelitems/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | if (isServer) then { 10 | // Master Count - only on server and needed before postInit 11 | GVAR(intelCount) = 0; 12 | 13 | // Map of all magazine ids and their corresponding intel index 14 | GVAR(intelMap) = [true] call CBA_fnc_createNamespace; 15 | publicVariable QGVAR(intelMap); 16 | 17 | // Namespace of intel indices and their corresponding data 18 | GVAR(intelData) = [true] call CBA_fnc_createNamespace; 19 | publicVariable QGVAR(intelData); 20 | 21 | [QGVAR(handleMagIndex), FUNC(handleMagIndex)] call CBA_fnc_addEventHandler; 22 | [QGVAR(setObjectData), FUNC(setObjectData)] call CBA_fnc_addEventHandler; 23 | }; 24 | 25 | if (hasInterface) then { 26 | // Array of all open controls groups 27 | GVAR(controlsGroups) = []; 28 | 29 | // Hash to track controls group positions on map between closing 30 | GVAR(controlsData) = [] call CBA_fnc_hashCreate; 31 | }; 32 | 33 | ADDON = true; 34 | -------------------------------------------------------------------------------- /addons/intelitems/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/intelitems/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = { 7 | QGVAR(notepad), 8 | QGVAR(document), 9 | QGVAR(photo) 10 | }; 11 | weapons[] = {}; 12 | requiredVersion = REQUIRED_VERSION; 13 | requiredAddons[] = {"ace_interact_menu", "ace_zeus"}; 14 | author = ACECSTRING(common,ACETeam); 15 | authors[] = {"PabstMirror", "mharis001"}; 16 | url = ACECSTRING(main,URL); 17 | VERSION_CONFIG; 18 | }; 19 | }; 20 | 21 | #include "CfgEventHandlers.hpp" 22 | #include "CfgEditorSubcategories.hpp" 23 | #include "CfgMagazines.hpp" 24 | #include "CfgVehicles.hpp" 25 | #include "gui.hpp" 26 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_addActions.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Returns children actions for intel items in the player's inventory. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * Actions 11 | * 12 | * Example: 13 | * [player] call acex_intelitems_fnc_addActions 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | private _actions = []; 21 | 22 | private _cfgMagazines = configFile >> "CfgMagazines"; 23 | private _magazines = magazines _player; 24 | 25 | private _openIndices = GVAR(controlsGroups) apply {_x getVariable QGVAR(index)}; 26 | 27 | { 28 | private _config = _cfgMagazines >> _x; 29 | 30 | if (getNumber (_config >> QGVAR(intel)) == 1) then { 31 | private _displayName = getText (_config >> "displayName"); 32 | private _picture = getText (_config >> "picture"); 33 | private _controlType = getText (_config >> QGVAR(control)); 34 | 35 | private _magazineIds = [_player, _x] call CBA_fnc_getMagazineIndex; 36 | 37 | { 38 | private _index = GVAR(intelMap) getVariable _x; 39 | 40 | // Only add actions for intel indices that are not open 41 | if !(_index in _openIndices) then { 42 | private _action = [ 43 | format [QGVAR(%1), _index], 44 | _displayName, 45 | _picture, 46 | {(_this select 2) call FUNC(createControl)}, 47 | {true}, 48 | {}, 49 | [_controlType, _index] 50 | ] call ACEFUNC(interact_menu,createAction); 51 | 52 | _actions pushBack [_action, [], _player]; 53 | }; 54 | } forEach _magazineIds; 55 | }; 56 | } forEach (_magazines arrayIntersect _magazines); 57 | 58 | _actions 59 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_addIntel.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Adds the given intel item (magazine) to the given unit. 5 | * Must be called on the server. 6 | * 7 | * Arguments: 8 | * 0: Unit 9 | * 1: Item 10 | * 3: Data 11 | * 12 | * Return Value: 13 | * Successful 14 | * 15 | * Example: 16 | * [_unit, "acex_intelitems_notepad", "Notes!"] call acex_intelitems_fnc_addIntel 17 | * 18 | * Public: Yes 19 | */ 20 | 21 | if (canSuspend) exitWith { 22 | [FUNC(addIntel), _this] call CBA_fnc_directCall; 23 | }; 24 | 25 | params [["_unit", objNull, [objNull]], ["_item", "", [""]], ["_data", "", [""]]]; 26 | 27 | if ( 28 | !isServer 29 | || {!(_unit isKindOf "CAManBase")} 30 | || {!(_unit canAdd _item)} 31 | || {getNumber (configFile >> "CfgMagazines" >> _item >> QGVAR(intel)) != 1} 32 | ) exitWith { ERROR_1("addIntel failed - %1",_this); false }; 33 | 34 | // Add the magazine item to the unit's inventory and get its id 35 | private _magazinesBefore = [_unit, _item] call CBA_fnc_getMagazineIndex; 36 | _unit addMagazine [_item, 1]; 37 | private _magazinesAfter = [_unit, _item] call CBA_fnc_getMagazineIndex; 38 | 39 | private _magazineId = _magazinesAfter - _magazinesBefore; 40 | if (_magazineId isEqualTo []) exitWith {false}; 41 | 42 | // Assign an intel index to the added magazine id and set its data 43 | private _index = [_magazineId select 0] call FUNC(handleMagIndex); 44 | SET_DATA(_index,_data); 45 | 46 | true 47 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_attributeFocus.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Initializes the Zeus attributes display for intel objects. 5 | * 6 | * Arguments: 7 | * 0: Controls group 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [CONTROL] call acex_intelitems_fnc_attributeFocus 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_control"]; 19 | 20 | private _display = ctrlParent _control; 21 | private _ctrlButtonOK = _display displayCtrl 1; // IDC_OK 22 | private _object = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); 23 | 24 | _control ctrlRemoveAllEventHandlers "SetFocus"; 25 | 26 | private _ctrlLabel = _display displayCtrl IDC_ATTRIBUTE_LABEL; 27 | private _labelText = getText (configFile >> "CfgVehicles" >> typeOf _object >> "Attributes" >> QGVAR(data) >> "displayName"); 28 | _ctrlLabel ctrlSetText _labelText; 29 | 30 | private _index = _object getVariable [QGVAR(index), -1]; 31 | 32 | if (_index != -1) then { 33 | private _ctrlEdit = _display displayCtrl IDC_ATTRIBUTE_EDIT; 34 | _ctrlEdit ctrlSetText GET_DATA(_index); 35 | }; 36 | 37 | private _fnc_onConfirm = { 38 | params ["_ctrlButtonOK"]; 39 | 40 | private _display = ctrlParent _ctrlButtonOK; 41 | private _object = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); 42 | private _data = ctrlText (_display displayCtrl IDC_ATTRIBUTE_EDIT); 43 | 44 | [QGVAR(setObjectData), [_object, _data]] call CBA_fnc_serverEvent; 45 | }; 46 | 47 | _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm]; 48 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_canPickup.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Checks if the player can pickup an intel object. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Player 9 | * 10 | * Return Value: 11 | * Can pickup 12 | * 13 | * Example: 14 | * [cursorObject, player] call acex_intelitems_fnc_canPickup 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_object", "_player"]; 20 | 21 | private _magazineClass = getText (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(magazine)); 22 | 23 | _magazineClass != "" && {_player canAdd _magazineClass} 24 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_createControl.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Creates an intel controls group. 5 | * 6 | * Arguments: 7 | * 0: Control type 8 | * 1: Intel index 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * ["RscNotepad", 1] call acex_intelitems_fnc_createControl 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_controlType", "_index"]; 20 | 21 | private _display = findDisplay IDD_MAIN_MAP; 22 | private _controlsGroup = _display ctrlCreate [_controlType, -1]; 23 | _controlsGroup setVariable [QGVAR(index), _index]; 24 | 25 | GVAR(controlsGroups) pushBack _controlsGroup; 26 | 27 | // Add event handlers to header to allow moving controls group 28 | private _ctrlHeader = _controlsGroup controlsGroupCtrl IDC_HEADER; 29 | _ctrlHeader ctrlAddEventHandler ["MouseButtonDown", {call FUNC(onMouseButtonDown)}]; 30 | _ctrlHeader ctrlAddEventHandler ["MouseButtonUp", {call FUNC(onMouseButtonUp)}]; 31 | _ctrlHeader ctrlAddEventHandler ["MouseMoving", {call FUNC(onMouseMoving)}]; 32 | 33 | // Add event handler to close controls group 34 | private _ctrlClose = _controlsGroup controlsGroupCtrl IDC_CLOSE; 35 | _ctrlClose ctrlAddEventHandler ["ButtonClick", { 36 | params ["_ctrlClose"]; 37 | 38 | private _controlsGroup = ctrlParentControlsGroup _ctrlClose; 39 | [_controlsGroup] call FUNC(deleteControl); 40 | }]; 41 | 42 | // Set data in content control 43 | private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT; 44 | _ctrlContent ctrlSetText GET_DATA(_index); 45 | 46 | // Restore position of controls group (center if not saved) 47 | private _position = [GVAR(controlsData), _index] call CBA_fnc_hashGet; 48 | 49 | if (isNil "_position") then { 50 | ctrlPosition _controlsGroup params ["", "", "_posW", "_posH"]; 51 | _position = [0.5 - _posW / 2, 0.5 - _posH / 2]; 52 | }; 53 | 54 | _controlsGroup ctrlSetPosition _position; 55 | _controlsGroup ctrlCommit 0; 56 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_deleteControl.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Deletes an intel controls group. 5 | * 6 | * Arguments: 7 | * 0: Controls group 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [CONTROL] call acex_intelitems_fnc_deleteControl 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_controlsGroup"]; 19 | 20 | private _index = _controlsGroup getVariable QGVAR(index); 21 | 22 | // Save position of controls group 23 | ctrlPosition _controlsGroup params ["_posX", "_posY"]; 24 | [GVAR(controlsData), _index, [_posX, _posY]] call CBA_fnc_hashSet; 25 | 26 | // Update data if modified 27 | private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT; 28 | private _data = ctrlText _ctrlContent; 29 | 30 | if !(_data isEqualTo GET_DATA(_index)) then { 31 | SET_DATA(_index,_data); 32 | }; 33 | 34 | // Delete the controls group 35 | GVAR(controlsGroups) deleteAt (GVAR(controlsGroups) find _controlsGroup); 36 | ctrlDelete _controlsGroup; 37 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_handleLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Handles the player loadout changed event. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [player] call acex_intelitems_fnc_handleLoadout 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | private _allIndices = []; 21 | 22 | // Handle magazine ids with missing index assignments 23 | private _cfgMagazines = configFile >> "CfgMagazines"; 24 | private _magazines = magazines _player; 25 | 26 | { 27 | if (getNumber (_cfgMagazines >> _x >> QGVAR(intel)) == 1) then { 28 | private _magazineIds = [_player, _x] call CBA_fnc_getMagazineIndex; 29 | 30 | { 31 | private _index = GVAR(intelMap) getVariable _x; 32 | 33 | if (isNil "_index") then { 34 | // Need new intel index from server 35 | [QGVAR(handleMagIndex), _x] call CBA_fnc_serverEvent; 36 | } else { 37 | // Add valid index to array of all indices 38 | _allIndices pushBack _index; 39 | }; 40 | } forEach _magazineIds; 41 | }; 42 | } forEach (_magazines arrayIntersect _magazines); 43 | 44 | // Close any open controls if player no longer has needed magazine 45 | { 46 | private _index = _x getVariable QGVAR(index); 47 | 48 | if !(_index in _allIndices) then { 49 | [_x] call FUNC(deleteControl); 50 | }; 51 | } forEach +GVAR(controlsGroups); 52 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_handleMagIndex.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Handles assigning a unique intel index to a magazine id. 5 | * 6 | * Arguments: 7 | * 0: Magazine id 8 | * 9 | * Return Value: 10 | * Intel Index 11 | * 12 | * Example: 13 | * ["001"] call acex_intelitems_fnc_handleMagIndex 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_magazineId"]; 19 | 20 | private _index = GVAR(intelMap) getVariable _magazineId; 21 | 22 | if (isNil "_index") then { 23 | _index = GVAR(intelCount); 24 | GVAR(intelCount) = GVAR(intelCount) + 1; 25 | }; 26 | 27 | GVAR(intelMap) setVariable [_magazineId, _index, true]; 28 | 29 | _index 30 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_onMouseButtonDown.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Handles the mouse button down event for an intel control. 5 | * 6 | * Arguments: 7 | * 0: Header control 8 | * 1: Button 9 | * 2: X position 10 | * 3: Y position 11 | * 12 | * Return Value: 13 | * None 14 | * 15 | * Example: 16 | * [CONTROL, 0, 0.5, 0.5] call acex_intelitems_fnc_onMouseButtonDown 17 | * 18 | * Public: No 19 | */ 20 | 21 | params ["_ctrlHeader", "_button", "_posX", "_posY"]; 22 | 23 | if (_button != 0) exitWith {}; 24 | 25 | private _controlsGroup = ctrlParentControlsGroup _ctrlHeader; 26 | _controlsGroup setVariable [QGVAR(clickPos), [_posX, _posY]]; 27 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_onMouseButtonUp.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Handles the mouse button up event for an intel control. 5 | * 6 | * Arguments: 7 | * 0: Header control 8 | * 1: Button 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [CONTROL, 0] call acex_intelitems_fnc_onMouseButtonUp 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_ctrlHeader", "_button"]; 20 | 21 | if (_button != 0) exitWith {}; 22 | 23 | private _controlsGroup = ctrlParentControlsGroup _ctrlHeader; 24 | _controlsGroup setVariable [QGVAR(clickPos), nil]; 25 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_onMouseMoving.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: mharis001 4 | * Handles the mouse moving event for an intel control. 5 | * 6 | * Arguments: 7 | * 0: Header control 8 | * 1: X position 9 | * 2: Y position 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * [CONTROL, 0.1, 0.2] call acex_intelitems_fnc_onMouseMoving 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_ctrlHeader", "_posX", "_posY"]; 21 | 22 | private _controlsGroup = ctrlParentControlsGroup _ctrlHeader; 23 | 24 | private _clickPos = _controlsGroup getVariable QGVAR(clickPos); 25 | if (isNil "_clickPos") exitWith {}; 26 | 27 | ctrlPosition _controlsGroup params ["_groupX", "_groupY"]; 28 | _clickPos params ["_clickX", "_clickY"]; 29 | 30 | _controlsGroup ctrlSetPosition [_groupX + _posX - _clickX, _groupY + _posY - _clickY]; 31 | _controlsGroup ctrlCommit 0; 32 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_pickup.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Picks up an intel object by converting it into a unique magazine. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Player 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [cursorObject, player] call acex_intelitems_fnc_pickup 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_object", "_player"]; 20 | 21 | private _magazineClass = getText (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(magazine)); 22 | private _index = _object getVariable [QGVAR(index), -1]; 23 | 24 | // Add magazine to inventory and get its id 25 | private _magazinesBefore = [_player, _magazineClass] call CBA_fnc_getMagazineIndex; 26 | _player addMagazine _magazineClass; 27 | private _magazinesAfter = [_player, _magazineClass] call CBA_fnc_getMagazineIndex; 28 | 29 | private _magazineId = _magazinesAfter - _magazinesBefore; 30 | if (_magazineId isEqualTo []) exitWith {}; 31 | 32 | _magazineId = _magazineId select 0; 33 | 34 | // Delete object as it now exists as a magazine 35 | deleteVehicle _object; 36 | 37 | if (_index == -1) then { 38 | // Need new intel index from server 39 | [QGVAR(handleMagIndex), _magazineId] call CBA_fnc_serverEvent; 40 | } else { 41 | // Can simply broadcast index for magazine id 42 | GVAR(intelMap) setVariable [_magazineId, _index, true]; 43 | }; 44 | -------------------------------------------------------------------------------- /addons/intelitems/functions/fnc_setObjectData.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: PabstMirror, mharis001 4 | * Sets the intel data for an object. Used by 3DEN and Zeus attributes. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Data 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * [cursorObject, "123"] call acex_intelitems_fnc_setObjectData 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_object", "_data"]; 20 | 21 | private _index = _object getVariable [QGVAR(index), -1]; 22 | 23 | if (_index == -1) then { 24 | _index = GVAR(intelCount); 25 | GVAR(intelCount) = GVAR(intelCount) + 1; 26 | 27 | _object setVariable [QGVAR(index), _index, true]; 28 | }; 29 | 30 | SET_DATA(_index,_data); 31 | -------------------------------------------------------------------------------- /addons/intelitems/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\intelitems\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/intelitems/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT intelitems 2 | #define COMPONENT_BEAUTIFIED Intel Items 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_INTELITEMS 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_INTELITEMS 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_INTELITEMS 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | 19 | #include "\a3\ui_f\hpp\defineResincl.inc" 20 | #include "\a3\ui_f\hpp\defineCommonGrids.inc" 21 | 22 | #define POS_X(N) ((N) * GUI_GRID_W + GUI_GRID_CENTER_X) 23 | #define POS_Y(N) ((N) * GUI_GRID_H + GUI_GRID_CENTER_Y) 24 | #define POS_W(N) ((N) * GUI_GRID_W) 25 | #define POS_H(N) ((N) * GUI_GRID_H) 26 | 27 | #define IDC_BORDER 10 28 | #define IDC_BACKGROUND 20 29 | #define IDC_HEADER 30 30 | #define IDC_CLOSE 40 31 | #define IDC_CONTENT 50 32 | 33 | #define IDC_ATTRIBUTE_GROUP 4800 34 | #define IDC_ATTRIBUTE_LABEL 4801 35 | #define IDC_ATTRIBUTE_EDIT 4802 36 | 37 | #define SYS_DATA(index) (format [QGVAR(%1), index]) 38 | #define SET_DATA(index,data) (GVAR(intelData) setVariable [SYS_DATA(index), data, true]) 39 | #define GET_DATA(index) (GVAR(intelData) getVariable [SYS_DATA(index), ""]) 40 | -------------------------------------------------------------------------------- /addons/intelitems/ui/document_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/intelitems/ui/document_ca.paa -------------------------------------------------------------------------------- /addons/intelitems/ui/notepad_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/intelitems/ui/notepad_ca.paa -------------------------------------------------------------------------------- /addons/intelitems/ui/photo_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/intelitems/ui/photo_ca.paa -------------------------------------------------------------------------------- /addons/killtracker/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\killtracker 2 | -------------------------------------------------------------------------------- /addons/killtracker/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PostInit_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_postInit)); 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /addons/killtracker/README.md: -------------------------------------------------------------------------------- 1 | acex_killTracker 2 | ============ 3 | 4 | Tracks deaths/kills and logs to the end mission disaplay. Attemps to log kills from ace_medical by using ace_medical_lastDamageSource. 5 | 6 | Note: Requires config setup in a mission's description.ext - has no effect if mission is not setup correctly. 7 | 8 | ```powershell 9 | class CfgDebriefingSections { 10 | class acex_killTracker { 11 | title = "ACEX Killed Events"; 12 | variable = "acex_killTracker_outputText"; 13 | }; 14 | }; 15 | ``` 16 | 17 | ## Maintainers 18 | 19 | The people responsible for merging changes to this component or answering potential questions. 20 | 21 | - [PabstMirror](https://github.com/PabstMirror) 22 | -------------------------------------------------------------------------------- /addons/killtracker/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = {}; 7 | weapons[] = {}; 8 | requiredVersion = REQUIRED_VERSION; 9 | requiredAddons[] = {"acex_main", "ace_medical"}; 10 | author = ACECSTRING(common,ACETeam); 11 | authors[]= {"PabstMirror"}; 12 | url = ACECSTRING(main,URL); 13 | VERSION_CONFIG; 14 | }; 15 | }; 16 | 17 | #include "CfgEventHandlers.hpp" 18 | -------------------------------------------------------------------------------- /addons/killtracker/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT killtracker 2 | #define COMPONENT_BEAUTIFIED KillTracker 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_KILLTRACKER 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_KILLTRACKER 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_KILLTRACKER 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | -------------------------------------------------------------------------------- /addons/killtracker/stringtable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Total Kills: 6 | Всего убийств: 7 | Liczba zabójstw: 8 | Toplam Öldürme: 9 | 10 | 11 | Kill: %1 %2 12 | Убил: %1 %2 13 | Zabójstwo: %1 %2 14 | Öldürülen: %1 %2 15 | 16 | 17 | Killer: %1 %2 18 | Убийца: %1 %2 19 | Zabójca: %1 %2 20 | Öldüren: %1 %2 21 | 22 | 23 | Vehicle: %1 24 | Техника: %1 25 | Pojazd: %1 26 | Araç :%1 27 | 28 | 29 | Friendly Fire 30 | 誤擊友方 31 | Tir fratricide 32 | Fuego aliado 33 | Fuoco amico 34 | Ostrzał sojuszniczy 35 | Дружественный огонь 36 | Teambeschuss 37 | Střelba do vlastních! 38 | Fogo amigo 39 | 아군 오인사격 40 | 友军误射 41 | 同士討ち 42 | Dost Atışı 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /addons/main/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\main 2 | -------------------------------------------------------------------------------- /addons/main/CfgModuleCategories.hpp: -------------------------------------------------------------------------------- 1 | class CfgFactionClasses { 2 | class NO_CATEGORY; 3 | class ACEX: NO_CATEGORY { 4 | displayName = "ACEX"; 5 | priority = 2; 6 | side = 7; 7 | }; 8 | }; 9 | 10 | class CfgVehicleClasses { 11 | class ACEX_Vehicles { 12 | displayName = "ACEX Vehicles"; 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /addons/main/CfgSettings.hpp: -------------------------------------------------------------------------------- 1 | class CfgSettings { 2 | class CBA { 3 | class Versioning { 4 | class ACEX { 5 | class dependencies { 6 | ACE[] = {"ace_common", REQUIRED_ACE_VERSION, "(true)"}; 7 | }; 8 | }; 9 | }; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /addons/main/README.md: -------------------------------------------------------------------------------- 1 | acex_main 2 | ======== 3 | 4 | Backbone of other components, defining most of the commonly used macros. 5 | -------------------------------------------------------------------------------- /addons/main/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = {}; 7 | weapons[] = {}; 8 | requiredVersion = REQUIRED_VERSION; 9 | requiredAddons[] = {"ace_common"}; 10 | author = ACECSTRING(common,ACETeam); 11 | authors[] = {"Glowbal"}; 12 | url = ACECSTRING(main,URL); 13 | VERSION_CONFIG; 14 | }; 15 | }; 16 | 17 | #include "CfgModuleCategories.hpp" 18 | #include "CfgSettings.hpp" 19 | -------------------------------------------------------------------------------- /addons/main/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT main 2 | #define COMPONENT_BEAUTIFIED Main 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define CBA_DEBUG_SYNCHRONOUS 8 | // #define ENABLE_PERFORMANCE_COUNTERS 9 | 10 | #ifdef DEBUG_ENABLED_MAIN 11 | #define DEBUG_MODE_FULL 12 | #endif 13 | 14 | #ifdef DEBUG_SETTINGS_MAIN 15 | #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN 16 | #endif 17 | 18 | #include "\z\acex\addons\main\script_macros.hpp" 19 | -------------------------------------------------------------------------------- /addons/main/script_macros.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\ace\addons\main\script_macros.hpp" 2 | 3 | #define ACE_PREFIX ace 4 | 5 | #define ACEGVAR(module,var) TRIPLES(ACE_PREFIX,module,var) 6 | #define QACEGVAR(module,var) QUOTE(ACEGVAR(module,var)) 7 | 8 | #define ACEFUNC(var1,var2) TRIPLES(DOUBLES(ACE_PREFIX,var1),fnc,var2) 9 | #define DACEFUNC(var1,var2) TRIPLES(DOUBLES(ACE_PREFIX,var1),fnc,var2) 10 | #define QACEFUNC(var1,var2) QUOTE(DACEFUNC(var1,var2)) 11 | 12 | #define ACECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(ACE_PREFIX,var1),var2)) 13 | #define ACELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(ACE_PREFIX,var1),var2)) 14 | -------------------------------------------------------------------------------- /addons/main/script_mod.hpp: -------------------------------------------------------------------------------- 1 | // COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp 2 | 3 | #define MAINPREFIX z 4 | #define PREFIX acex 5 | 6 | #include "script_version.hpp" 7 | 8 | #define VERSION MAJOR.MINOR 9 | #define VERSION_STR MAJOR.MINOR.PATCHLVL.BUILD 10 | #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD 11 | 12 | // MINIMAL required version for the Mod. Components can specify others.. 13 | #define REQUIRED_VERSION 1.96 14 | #define REQUIRED_ACE_VERSION {3,13,0} 15 | 16 | #ifdef COMPONENT_BEAUTIFIED 17 | #define COMPONENT_NAME QUOTE(ACEX - COMPONENT_BEAUTIFIED) 18 | #else 19 | #define COMPONENT_NAME QUOTE(ACEX - COMPONENT) 20 | #endif 21 | -------------------------------------------------------------------------------- /addons/main/script_version.hpp: -------------------------------------------------------------------------------- 1 | #define MAJOR 3 2 | #define MINOR 5 3 | #define PATCHLVL 4 4 | #define BUILD 23 5 | -------------------------------------------------------------------------------- /addons/sitting/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\sitting 2 | -------------------------------------------------------------------------------- /addons/sitting/ACE_Settings.hpp: -------------------------------------------------------------------------------- 1 | class ACE_Settings { 2 | class GVAR(enable) { 3 | category = CSTRING(ModuleDisplayName); 4 | value = 0; 5 | typeName = "BOOL"; 6 | displayName = CSTRING(Enable); 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /addons/sitting/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | 2 | class Extended_PreStart_EventHandlers { 3 | class ADDON { 4 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 5 | }; 6 | }; 7 | 8 | class Extended_PreInit_EventHandlers { 9 | class ADDON { 10 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 11 | }; 12 | }; 13 | 14 | class Extended_PostInit_EventHandlers { 15 | class ADDON { 16 | clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); 17 | }; 18 | }; 19 | 20 | class Extended_Killed_EventHandlers { 21 | class CAManBase { 22 | class ADDON { 23 | killed = QUOTE(_this call DFUNC(handleInterrupt)); 24 | }; 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /addons/sitting/README.md: -------------------------------------------------------------------------------- 1 | acex_sitting 2 | =============== 3 | 4 | The Sitting module introduces ability to sit on chairs. 5 | 6 | 7 | ## Maintainers 8 | 9 | The people responsible for merging changes to this component or answering potential questions. 10 | 11 | - [Jonpas](https://github.com/jonpas) 12 | -------------------------------------------------------------------------------- /addons/sitting/UI/Icon_Module_Sitting_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/sitting/UI/Icon_Module_Sitting_ca.paa -------------------------------------------------------------------------------- /addons/sitting/UI/sit_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/sitting/UI/sit_ca.paa -------------------------------------------------------------------------------- /addons/sitting/UI/stand_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/sitting/UI/stand_ca.paa -------------------------------------------------------------------------------- /addons/sitting/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(addSitActions); 2 | PREP(canSit); 3 | PREP(canStand); 4 | PREP(getRandomAnimation); 5 | PREP(handleInterrupt); 6 | PREP(moduleInit); 7 | PREP(sit); 8 | PREP(stand); 9 | -------------------------------------------------------------------------------- /addons/sitting/XEH_clientInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | // Exit on Headless 4 | if (!hasInterface) exitWith {}; 5 | 6 | ["ace_settingsInitialized", { 7 | TRACE_1("SettingInit", GVAR(enable)); 8 | 9 | // If not enabled, then do not add CanInteractWith Condition or event handlers 10 | if (!GVAR(enable)) exitWith {}; 11 | 12 | // Initialize classes as they spawn 13 | ["ThingX", "init", FUNC(addSitActions), nil, nil, true] call CBA_fnc_addClassEventHandler; 14 | 15 | // Initialize statically defined benches (also appear as world objects, no class EH thrown) 16 | { 17 | [_x] call FUNC(addSitActions); 18 | } forEach [BENCHES]; 19 | 20 | // Add interaction menu exception 21 | ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(sittingStatus)}}] call ACEFUNC(common,addCanInteractWithCondition); 22 | 23 | // Handle interruptions 24 | ["ace_unconscious", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; 25 | ["ace_captives_SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; 26 | }] call CBA_fnc_addEventHandler; 27 | -------------------------------------------------------------------------------- /addons/sitting/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | if (hasInterface) then { 10 | GVAR(initializedClasses) = []; 11 | }; 12 | 13 | ADDON = true; 14 | -------------------------------------------------------------------------------- /addons/sitting/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/sitting/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = {}; 7 | weapons[] = {}; 8 | requiredVersion = REQUIRED_VERSION; 9 | requiredAddons[] = {"acex_main", "ace_interaction"}; 10 | author = ACECSTRING(common,ACETeam); 11 | authors[] = {"Jonpas"}; 12 | url = ACECSTRING(main,URL); 13 | VERSION_CONFIG; 14 | }; 15 | 16 | // backwards compatability 17 | class ACE_common; 18 | class ACE_Sitting: ACE_common { 19 | name = COMPONENT_NAME; 20 | units[] = {}; 21 | weapons[] = {}; 22 | requiredVersion = REQUIRED_VERSION; 23 | requiredAddons[] = {}; 24 | author = ACECSTRING(common,ACETeam); 25 | authors[] = {"Jonpas"}; 26 | url = ACECSTRING(main,URL); 27 | // VERSION_CONFIG will be inherited from ace for version checking 28 | }; 29 | }; 30 | 31 | #include "ACE_Settings.hpp" 32 | #include "CfgEventHandlers.hpp" 33 | #include "CfgMoves.hpp" 34 | #include "CfgVehicles.hpp" 35 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_addSitActions.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Adds sit actions. 5 | * 6 | * Arguments: 7 | * 0: Seat 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [cursorObject] call acex_sitting_fnc_addSitActions 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_seat"]; 19 | 20 | private _type = _seat; 21 | if (_seat isEqualType objNull) then { 22 | _type = typeOf _seat; 23 | }; 24 | 25 | private _configFile = configFile >> "CfgVehicles" >> _type; 26 | 27 | // Exit if sitting disabled or the object is not specified as a seat 28 | if (!GVAR(enable) || {getNumber (_configFile >> QGVAR(canSit)) != 1}) exitWith {}; 29 | 30 | // Exit if class already initialized 31 | if (_type in GVAR(initializedClasses)) exitWith {}; 32 | GVAR(initializedClasses) pushBack _type; 33 | 34 | TRACE_1("Adding Sit Action",_type); 35 | 36 | private _sitPosition = getArray (_configFile >> QGVAR(sitPosition)); 37 | private _interactPosition = getArray (_configFile >> QGVAR(interactPosition)); 38 | 39 | if (count _sitPosition != count _interactPosition) exitWith { 40 | WARNING_1("Invalid sitting configuration of %1!",_type); 41 | }; 42 | 43 | if !((_sitPosition select 0) isEqualType []) then { 44 | _sitPosition = [_sitPosition]; 45 | _interactPosition = [_interactPosition]; 46 | }; 47 | 48 | { 49 | private _menuPosition = [0,0,0]; 50 | private _menuType = ["ACE_MainActions"]; 51 | if (count _interactPosition >= _forEachIndex) then { 52 | _menuPosition = _interactPosition select _forEachIndex; 53 | _menuType = []; 54 | }; 55 | 56 | TRACE_3("Menu Position",_menuPosition,_menuType,_forEachIndex); 57 | 58 | private _sitAction = [ 59 | format [QGVAR(Sit_%1), _forEachIndex], 60 | LLSTRING(Sit), 61 | QUOTE(PATHTOF(UI\sit_ca.paa)), 62 | {_this call FUNC(sit)}, 63 | {_this call FUNC(canSit)}, 64 | {}, 65 | _forEachIndex, 66 | _menuPosition, 67 | 1.5 68 | ] call ACEFUNC(interact_menu,createAction); 69 | [_type, 0, _menuType, _sitAction] call ACEFUNC(interact_menu,addActionToClass); 70 | } forEach _sitPosition; 71 | 72 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_canSit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas, vabene1111 4 | * Check if the player can sit down. 5 | * 6 | * Arguments: 7 | * 0: Seat 8 | * 1: Player 9 | * 2: Seat Position (default: 0) 10 | * 11 | * Return Value: 12 | * Can Sit Down 13 | * 14 | * Example: 15 | * [cursorObject, player] call acex_sitting_fnc_canSit 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_seat", "_player", ["_seatPos", 0]]; 21 | 22 | // Sitting enabled, not occupied and standing up (or not on a big slope) 23 | GVAR(enable) && 24 | {isNil {_player getVariable QGVAR(sittingStatus)}} && 25 | { 26 | private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; 27 | _seatsClaimed isEqualTo [] || {!(_seatsClaimed select _seatPos)} 28 | } && 29 | {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} 30 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_canStand.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Check if the player can stand up (is in sitting position). 5 | * 6 | * Arguments: 7 | * Player 8 | * 9 | * Return Value: 10 | * Can Stand Up 11 | * 12 | * Example: 13 | * player call acex_sitting_fnc_canStand 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | // Sitting 21 | !isNil {_player getVariable QGVAR(sittingStatus)} 22 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_getRandomAnimation.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Gets a random animations from the list. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Random Animation 11 | * 12 | * Example: 13 | * _animation = call acex_sitting_fnc_getRandomAnimation 14 | * 15 | * Public: No 16 | */ 17 | 18 | // Select random animation from Animations Pool 19 | selectRandom [ 20 | QGVAR(HubSittingChairA_idle1), 21 | QGVAR(HubSittingChairA_idle2), 22 | QGVAR(HubSittingChairA_idle3), 23 | QGVAR(HubSittingChairA_move1), 24 | QGVAR(HubSittingChairB_idle1), 25 | QGVAR(HubSittingChairB_idle2), 26 | QGVAR(HubSittingChairB_idle3), 27 | QGVAR(HubSittingChairB_move1), 28 | QGVAR(HubSittingChairC_idle1), 29 | QGVAR(HubSittingChairC_idle2), 30 | QGVAR(HubSittingChairC_idle3), 31 | QGVAR(HubSittingChairC_move1), 32 | QGVAR(HubSittingChairUA_idle1), 33 | QGVAR(HubSittingChairUA_idle2), 34 | QGVAR(HubSittingChairUA_idle3), 35 | QGVAR(HubSittingChairUA_move1), 36 | QGVAR(HubSittingChairUB_idle1), 37 | QGVAR(HubSittingChairUB_idle2), 38 | QGVAR(HubSittingChairUB_idle3), 39 | QGVAR(HubSittingChairUB_move1), 40 | QGVAR(HubSittingChairUC_idle1), 41 | QGVAR(HubSittingChairUC_idle2), 42 | QGVAR(HubSittingChairUC_idle3), 43 | QGVAR(HubSittingChairUC_move1) 44 | ] 45 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_handleInterrupt.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Handles interruptions of sitting, like killed or unconsciousness. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * player call acex_sitting_fnc_handleInterrupt 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | 20 | if (!isNil {_player getVariable QGVAR(sittingStatus)}) then { 21 | _player call FUNC(stand); 22 | }; 23 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_moduleInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Initializes the Sitting module. 5 | * 6 | * Arguments: 7 | * 0: The module logic 8 | * 1: Units 9 | * 2: Activated 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Public: No 15 | */ 16 | 17 | params ["_logic", "_units", "_activated"]; 18 | 19 | if (!_activated) exitWith {}; 20 | 21 | [_logic, QGVAR(enable), "enable"] call ACEFUNC(common,readSettingFromModule); 22 | 23 | INFO("Sitting Module Initialized."); 24 | -------------------------------------------------------------------------------- /addons/sitting/functions/fnc_stand.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Stands up the player. 5 | * 6 | * Arguments: 7 | * Player 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * player call acex_sitting_fnc_stand 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_player"]; 19 | TRACE_1("stand",_player); 20 | 21 | (_player getVariable QGVAR(sittingStatus)) params ["_seat", "_actionID", ["_seatPos", 0]]; 22 | TRACE_3("sittingStatus",_seat,_actionID,_seatPos); 23 | 24 | // Remove scroll-wheel action 25 | _player removeAction _actionID; 26 | 27 | // Restore animation 28 | private _animation = switch (currentWeapon _player) do { 29 | case "": {"amovpercmstpsnonwnondnon"}; 30 | case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"}; 31 | case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"}; 32 | default {"amovpercmstpsnonwnondnon"}; 33 | }; 34 | 35 | [_player, _animation, 2] call ACEFUNC(common,doAnimation); 36 | 37 | // Set sitting status to nil 38 | _player setVariable [QGVAR(sittingStatus), nil]; 39 | 40 | ["ace_stoodUp", [_player, _seat, _seatPos]] call CBA_fnc_localEvent; 41 | 42 | if (isNull _seat) exitWith {}; 43 | 44 | // Allow sitting on this seat again 45 | private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; 46 | _seatsClaimed set [_seatPos, false]; 47 | _seat setVariable [QGVAR(seatsClaimed), _seatsClaimed, true]; 48 | 49 | // Unclaim if no one else sitting on it 50 | if (_seatsClaimed find true == -1) then { 51 | [objNull, _seat] call ACEFUNC(common,claim); 52 | }; 53 | -------------------------------------------------------------------------------- /addons/sitting/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\sitting\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/sitting/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT sitting 2 | #define COMPONENT_BEAUTIFIED Sitting 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_SITTING 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_SITTING 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_SITTING 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | 19 | 20 | #define BENCHES "Land_Bench_01_F", "Land_Bench_02_F", "Land_Bench_03_F", "Land_Bench_04_F", "Land_Bench_05_F" 21 | -------------------------------------------------------------------------------- /addons/viewrestriction/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\viewrestriction 2 | -------------------------------------------------------------------------------- /addons/viewrestriction/ACE_Settings.hpp: -------------------------------------------------------------------------------- 1 | #define MACRO_VALUES \ 2 | CSTRING(Disabled), CSTRING(FirstPerson), CSTRING(ThirdPerson) 3 | 4 | class ACE_Settings { 5 | class GVAR(mode) { 6 | category = CSTRING(ModuleDisplayName); 7 | value = 0; 8 | typeName = "SCALAR"; 9 | displayName = CSTRING(Mode); 10 | description = CSTRING(ModeDesc); 11 | values[] = {MACRO_VALUES, CSTRING(Selective)}; 12 | }; 13 | class GVAR(modeSelectiveFoot) { 14 | category = CSTRING(ModuleDisplayName); 15 | value = 0; 16 | typeName = "SCALAR"; 17 | displayName = CSTRING(ModeSelectiveFoot); 18 | description = CSTRING(ModeSelectiveFootDesc); 19 | values[] = {MACRO_VALUES}; 20 | }; 21 | class GVAR(modeSelectiveLand) { 22 | category = CSTRING(ModuleDisplayName); 23 | value = 0; 24 | typeName = "SCALAR"; 25 | displayName = CSTRING(ModeSelectiveLand); 26 | description = CSTRING(ModeSelectiveLandDesc); 27 | values[] = {MACRO_VALUES}; 28 | }; 29 | class GVAR(modeSelectiveAir) { 30 | category = CSTRING(ModuleDisplayName); 31 | value = 0; 32 | typeName = "SCALAR"; 33 | displayName = CSTRING(ModeSelectiveAir); 34 | description = CSTRING(ModeSelectiveAirDesc); 35 | values[] = {MACRO_VALUES}; 36 | }; 37 | class GVAR(modeSelectiveSea) { 38 | category = CSTRING(ModuleDisplayName); 39 | value = 0; 40 | typeName = "SCALAR"; 41 | displayName = CSTRING(ModeSelectiveSea); 42 | description = CSTRING(ModeSelectiveSeaDesc); 43 | values[] = {MACRO_VALUES}; 44 | }; 45 | // Disabled - Reference comment in FUNC(canChangeCamera) 46 | /*class GVAR(modeSelectiveUAV) { 47 | category = CSTRING(ModuleDisplayName); 48 | value = 0; 49 | typeName = "SCALAR"; 50 | displayName = CSTRING(ModeSelectiveUAV); 51 | description = CSTRING(ModeSelectiveUAVDesc); 52 | values[] = {MACRO_VALUES}; 53 | };*/ 54 | }; 55 | -------------------------------------------------------------------------------- /addons/viewrestriction/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | 13 | class Extended_PostInit_EventHandlers { 14 | class ADDON { 15 | clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /addons/viewrestriction/CfgVehicles.hpp: -------------------------------------------------------------------------------- 1 | #define MACRO_OPTIONS \ 2 | class Disabled { \ 3 | default = 1; \ 4 | name = CSTRING(Disabled); \ 5 | value = 0; \ 6 | }; \ 7 | class FirstPerson { \ 8 | name = CSTRING(FirstPerson); \ 9 | value = 1; \ 10 | }; \ 11 | class ThirdPerson { \ 12 | name = CSTRING(ThirdPerson); \ 13 | value = 2; \ 14 | }; 15 | 16 | class CfgVehicles { 17 | class ACE_Module; 18 | class GVAR(Module): ACE_Module { 19 | author = "$STR_ACE_common_ACETeam"; 20 | category = "ACEX"; 21 | function = QFUNC(moduleInit); 22 | displayName = CSTRING(ModuleDisplayName); 23 | scope = 1; 24 | isGlobal = 1; 25 | icon = QUOTE(PATHTOF(UI\Icon_Module_ViewRestriction_ca.paa)); 26 | class Arguments { 27 | class mode { 28 | displayName = CSTRING(Mode); 29 | description = CSTRING(ModeDesc); 30 | typeName = "NUMBER"; 31 | class values { 32 | MACRO_OPTIONS 33 | class Selective { 34 | name = CSTRING(Selective); 35 | value = 3; 36 | }; 37 | }; 38 | }; 39 | class modeSelectiveFoot { 40 | displayName = CSTRING(ModeSelectiveFoot); 41 | description = CSTRING(ModeSelectiveFootDesc); 42 | typeName = "NUMBER"; 43 | class values { 44 | MACRO_OPTIONS 45 | }; 46 | }; 47 | class modeSelectiveLand { 48 | displayName = CSTRING(ModeSelectiveLand); 49 | description = CSTRING(ModeSelectiveLandDesc); 50 | typeName = "NUMBER"; 51 | class values { 52 | MACRO_OPTIONS 53 | }; 54 | }; 55 | class modeSelectiveAir { 56 | displayName = CSTRING(ModeSelectiveAir); 57 | description = CSTRING(ModeSelectiveAirDesc); 58 | typeName = "NUMBER"; 59 | class values { 60 | MACRO_OPTIONS 61 | }; 62 | }; 63 | class modeSelectiveSea { 64 | displayName = CSTRING(ModeSelectiveSea); 65 | description = CSTRING(ModeSelectiveSeaDesc); 66 | typeName = "NUMBER"; 67 | class values { 68 | MACRO_OPTIONS 69 | }; 70 | }; 71 | // Disabled - Reference comment in FUNC(canChangeCamera) 72 | /*class modeSelectiveUAV { 73 | displayName = CSTRING(ModeSelectiveUAV); 74 | description = CSTRING(ModeSelectiveUAVDesc); 75 | typeName = "NUMBER"; 76 | class values { 77 | MACRO_OPTIONS 78 | }; 79 | };*/ 80 | }; 81 | class ModuleDescription { 82 | description = CSTRING(ModuleDescription); 83 | }; 84 | }; 85 | }; 86 | -------------------------------------------------------------------------------- /addons/viewrestriction/README.md: -------------------------------------------------------------------------------- 1 | acex_viewrestriction 2 | =============== 3 | 4 | The View Restriction module introduces restricting of first and third person views overall or configured per type. 5 | 6 | ## Maintainers 7 | 8 | The people responsible for merging changes to this component or answering potential questions. 9 | 10 | - [Jonpas](https://github.com/jonpas) 11 | - [esteldunedain](https://github.com/esteldunedain) 12 | -------------------------------------------------------------------------------- /addons/viewrestriction/UI/Icon_Module_ViewRestriction_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/addons/viewrestriction/UI/Icon_Module_ViewRestriction_ca.paa -------------------------------------------------------------------------------- /addons/viewrestriction/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(canChangeCamera); 2 | PREP(changeCamera); 3 | PREP(moduleInit); 4 | PREP(selectiveChangeCamera); 5 | PREP(switchPreserveView); 6 | -------------------------------------------------------------------------------- /addons/viewrestriction/XEH_clientInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | // Exit on Headless Client 4 | if !(hasInterface) exitWith {}; 5 | 6 | ["ace_settingsInitialized", { 7 | // Exit if module is disabled 8 | if (GVAR(mode) == 0) exitWith {}; 9 | 10 | // Exit if all Selective Modes are Disabled 11 | if (GVAR(mode) == 3 && 12 | {GVAR(modeSelectiveFoot) == 0} && 13 | {GVAR(modeSelectiveLand) == 0} && 14 | {GVAR(modeSelectiveAir) == 0} && 15 | {GVAR(modeSelectiveSea) == 0}/* && 16 | {GVAR(modeSelectiveUAV) == 0}*/ 17 | ) exitWith { 18 | WARNING("Selective mode enabled, but all sub-modes are disabled.") 19 | }; 20 | 21 | // Exit if third person view is not available 22 | if (difficultyOption "thirdPersonView" == 0) exitWith { 23 | WARNING("View Restriction is enabled, but 3rd person is disabled with server difficulty."); 24 | }; 25 | 26 | // Add Event Handler for changing camera - also happens on spawn 27 | ["cameraView", { 28 | [_this select 1, cameraOn] call FUNC(changeCamera); 29 | }] call CBA_fnc_addPlayerEventHandler; 30 | 31 | // Add Event Hander for exiting and entering a vehicle when on Selective mode - cameraView does not fire on simple enter/exit 32 | if (GVAR(mode) == 3) then { 33 | ["vehicle", { 34 | [cameraView, _this select 1] call FUNC(changeCamera); 35 | }] call CBA_fnc_addPlayerEventHandler; 36 | }; 37 | }] call CBA_fnc_addEventHandler; 38 | -------------------------------------------------------------------------------- /addons/viewrestriction/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | #include "initSettings.sqf" 10 | 11 | ADDON = true; 12 | -------------------------------------------------------------------------------- /addons/viewrestriction/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/viewrestriction/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | name = COMPONENT_NAME; 6 | units[] = {}; 7 | weapons[] = {}; 8 | requiredVersion = REQUIRED_VERSION; 9 | requiredAddons[] = {"acex_main"}; 10 | author = ACECSTRING(common,ACETeam); 11 | authors[] = {"Jonpas", "esteldunedain"}; 12 | url = ACECSTRING(main,URL); 13 | VERSION_CONFIG; 14 | }; 15 | }; 16 | 17 | #include "CfgEventHandlers.hpp" 18 | #include "ACE_Settings.hpp" 19 | #include "CfgVehicles.hpp" 20 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/fnc_canChangeCamera.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Checks if camera can be changed. 5 | * 6 | * Arguments: 7 | * 0: New Camera View 8 | * 1: Vehicle 9 | * 2: Check gunner view (default: true) 10 | * 11 | * Return Value: 12 | * Can Change Camera 13 | * 14 | * Example: 15 | * ["INTERNAL", vehicle] call acex_viewrestriction_fnc_canChangeCamera 16 | * 17 | * Public: No 18 | */ 19 | 20 | params ["_newCameraView", "_cameraOn", ["_checkGunnerView", true]]; 21 | 22 | // Remote control hates switchCamera (control returns to player, camera is left on remotely controlled object/unit), make sure remote controlled units are not impacted 23 | 24 | !(_newCameraView isEqualTo "GUNNER" && {_checkGunnerView}) && 25 | {!(_newCameraView isEqualTo "GROUP")} && 26 | {!isNull ACE_player} && 27 | {player == ACE_player} && 28 | {alive ACE_player} && 29 | {ACE_player == _cameraOn || vehicle ACE_player == _cameraOn} && 30 | {"" isEqualTo call CBA_fnc_getActiveFeatureCamera} && 31 | {!(_cameraOn isKindOf "UAV" || _cameraOn isKindOf "UAV_01_base_F")} // UAVs are remote controlled 32 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/fnc_changeCamera.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Change camera based on setting. 5 | * 6 | * Arguments: 7 | * 0: New Camera View 8 | * 1: Vehicle 9 | * 10 | * Return Value: 11 | * None 12 | * 13 | * Example: 14 | * ["INTERNAL", vehicle] call acex_viewrestriction_fnc_changeCamera 15 | * 16 | * Public: No 17 | */ 18 | 19 | params ["_newCameraView", "_cameraOn"]; 20 | 21 | if (! ([_newCameraView, _cameraOn] call FUNC(canChangeCamera))) exitWith {}; 22 | 23 | TRACE_1("View Restricted",GVAR(mode)); 24 | 25 | // FirstPerson 26 | if (GVAR(mode) == 1) exitWith { 27 | _cameraOn switchCamera "INTERNAL"; 28 | }; 29 | 30 | // ThirdPerson 31 | if (GVAR(mode) == 2) exitWith { 32 | _cameraOn switchCamera "EXTERNAL"; 33 | }; 34 | 35 | // Selective 36 | if (GVAR(mode) == 3) exitWith { 37 | [_cameraOn] call FUNC(selectiveChangeCamera); 38 | }; 39 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/fnc_moduleInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Initializes the View Restriction module. 5 | * 6 | * Arguments: 7 | * 0: logic 8 | * 1: Synchronised Units 9 | * 2: Module Activated 10 | * 11 | * Return Value: 12 | * None 13 | */ 14 | 15 | params ["_logic", "_units", "_activated"]; 16 | 17 | if (!_activated) exitWith {}; 18 | 19 | [_logic, QGVAR(mode), "mode"] call ACEFUNC(common,readSettingFromModule); 20 | 21 | // Read selective options only if selective mode selected 22 | if (GVAR(mode) == 3) then { 23 | [_logic, QGVAR(modeSelectiveFoot), "modeSelectiveFoot"] call ACEFUNC(common,readSettingFromModule); 24 | [_logic, QGVAR(modeSelectiveLand), "modeSelectiveLand"] call ACEFUNC(common,readSettingFromModule); 25 | [_logic, QGVAR(modeSelectiveAir), "modeSelectiveAir"] call ACEFUNC(common,readSettingFromModule); 26 | [_logic, QGVAR(modeSelectiveSea), "modeSelectiveSea"] call ACEFUNC(common,readSettingFromModule); 27 | //[_logic, QGVAR(modeSelectiveUAV), "modeSelectiveUAV"] call ACEFUNC(common,readSettingFromModule); // Disabled - Reference comment in FUNC(canChangeCamera) 28 | 29 | INFO_5("View Restriction Module Initialized. Mode: %1 (Foot: %2, Land: %3, Air: %4, Sea: %5)",GVAR(mode),GVAR(modeSelectiveFoot),GVAR(modeSelectiveLand), GVAR(modeSelectiveAir),GVAR(modeSelectiveSea)); 30 | } else { 31 | INFO_1("View Restriction Module Initialized. Mode: %1",GVAR(mode)); 32 | }; 33 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/fnc_selectiveChangeCamera.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Jonpas 4 | * Changes camera mode based on vehicle type the player is currently occupying. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [vehicle] call acex_viewrestriction_fnc_selectiveChangeCamera 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_cameraOn"]; 19 | 20 | // Foot 21 | if (_cameraOn isKindOf "CAManBase") exitWith { 22 | if (GVAR(modeSelectiveFoot) == 1) exitWith { 23 | _cameraOn switchCamera "INTERNAL"; 24 | }; 25 | if (GVAR(modeSelectiveFoot) == 2) exitWith { 26 | _cameraOn switchCamera "EXTERNAL"; 27 | }; 28 | }; 29 | 30 | // Land Vehicles 31 | if (_cameraOn isKindOf "LandVehicle") exitWith { 32 | if (GVAR(modeSelectiveLand) == 1) exitWith { 33 | _cameraOn switchCamera "INTERNAL"; 34 | }; 35 | if (GVAR(modeSelectiveLand) == 2) exitWith { 36 | _cameraOn switchCamera "EXTERNAL"; 37 | }; 38 | }; 39 | 40 | // UAVs (must be evaluated before Air Vehicles due to inheritance tree) 41 | // Disabled - Reference comment in FUNC(canChangeCamera) 42 | /*if (_cameraOn isKindOf "UAV" || {_cameraOn isKindOf "UAV_01_base_F"}) exitWith { 43 | if (GVAR(modeSelectiveUAV) == 1) exitWith { 44 | _cameraOn switchCamera "INTERNAL"; 45 | }; 46 | if (GVAR(modeSelectiveUAV) == 2) exitWith { 47 | _cameraOn switchCamera "EXTERNAL"; 48 | }; 49 | };*/ 50 | 51 | // Air Vehicles (must be evaluated after UAVs due to inheritance tree) 52 | if (_cameraOn isKindOf "Air") exitWith { 53 | if (GVAR(modeSelectiveAir) == 1) exitWith { 54 | _cameraOn switchCamera "INTERNAL"; 55 | }; 56 | if (GVAR(modeSelectiveAir) == 2) exitWith { 57 | _cameraOn switchCamera "EXTERNAL"; 58 | }; 59 | }; 60 | 61 | // Sea Vehicles 62 | if (_cameraOn isKindOf "Ship") exitWith { 63 | if (GVAR(modeSelectiveSea) == 1) exitWith { 64 | _cameraOn switchCamera "INTERNAL"; 65 | }; 66 | if (GVAR(modeSelectiveSea) == 2) exitWith { 67 | _cameraOn switchCamera "EXTERNAL"; 68 | }; 69 | }; 70 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/fnc_switchPreserveView.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Dystopian 4 | * Controls View Preserving state. 5 | * 6 | * Arguments: 7 | * 0: Enabled 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * true call acex_viewrestriction_fnc_switchPreserveView 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_enabled"]; 19 | 20 | if (!_enabled || {GVAR(mode) > 0}) exitWith { 21 | if (isNil QGVAR(preserveViewCameraViewEH)) exitWith {}; 22 | ["cameraView", GVAR(preserveViewCameraViewEH)] call CBA_fnc_removePlayerEventHandler; 23 | ["vehicle", GVAR(preserveViewVehicleEH)] call CBA_fnc_removePlayerEventHandler; 24 | GVAR(preserveViewCameraViewEH) = nil; 25 | GVAR(preserveViewVehicleEH) = nil; 26 | }; 27 | 28 | GVAR(preserveViewCameraViewEH) = ["cameraView", { 29 | params ["_player", "_cameraView"]; 30 | if !([_cameraView, cameraOn] call FUNC(canChangeCamera)) exitWith {}; 31 | 32 | private _vehicle = vehicle _player; 33 | private _vehicleClass = {if (_vehicle isKindOf _x) exitWith {_x}} forEach ["CAManBase", "LandVehicle", "Air", "Ship", "All"]; 34 | private _varName = QGVAR(preserveView) + _vehicleClass; 35 | if !(_cameraView isEqualTo (profileNamespace getVariable [_varName, ""])) then { 36 | profileNamespace setVariable [_varName, _cameraView]; 37 | }; 38 | }] call CBA_fnc_addPlayerEventHandler; 39 | 40 | GVAR(preserveViewVehicleEH) = ["vehicle", { 41 | params ["_player", "_vehicle"]; 42 | private _cameraView = cameraView; 43 | if !([_cameraView, cameraOn, false] call FUNC(canChangeCamera)) exitWith {}; 44 | 45 | private _vehicleClass = {if (_vehicle isKindOf _x) exitWith {_x}} forEach ["CAManBase", "LandVehicle", "Air", "Ship", "All"]; 46 | private _savedView = profileNamespace getVariable (QGVAR(preserveView) + _vehicleClass); 47 | if (!isNil "_savedView" && {!(_cameraView isEqualTo _savedView)}) then { 48 | _vehicle switchCamera _savedView; 49 | }; 50 | }, true] call CBA_fnc_addPlayerEventHandler; 51 | -------------------------------------------------------------------------------- /addons/viewrestriction/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\viewrestriction\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/viewrestriction/initSettings.sqf: -------------------------------------------------------------------------------- 1 | [ 2 | QGVAR(preserveView), 3 | "CHECKBOX", 4 | [LSTRING(SettingPreserveViewName), LSTRING(SettingPreserveViewDesc)], 5 | format ["ACEX %1", LLSTRING(ModuleDisplayName)], 6 | false, 7 | false, 8 | LINKFUNC(switchPreserveView) 9 | ] call CBA_settings_fnc_init; 10 | -------------------------------------------------------------------------------- /addons/viewrestriction/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT viewrestriction 2 | #define COMPONENT_BEAUTIFIED View Restriction 3 | #include "\z\acex\addons\main\script_mod.hpp" 4 | 5 | // #define DEBUG_MODE_FULL 6 | // #define DISABLE_COMPILE_CACHE 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_VIEWRESTRICTION 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_VIEWRESTRICTION 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_VIEWRESTRICTION 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | -------------------------------------------------------------------------------- /addons/volume/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\volume 2 | -------------------------------------------------------------------------------- /addons/volume/ACE_Settings.hpp: -------------------------------------------------------------------------------- 1 | class ACE_Settings { 2 | class GVAR(enabled) { 3 | value = 0; 4 | typeName = "BOOL"; 5 | category = CSTRING(Name); 6 | displayName = ACECSTRING(common,Enabled); 7 | description = CSTRING(KeybindDescription); 8 | isClientSettable = 1; 9 | force = 0; 10 | }; 11 | class GVAR(reduction) { 12 | value = 5; 13 | typeName = "SCALAR"; 14 | category = CSTRING(Name); 15 | displayName = CSTRING(Reduction); 16 | description = CSTRING(ReductionDescription); 17 | isClientSettable = 1; 18 | force = 0; 19 | values[] = {"0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"}; 20 | }; 21 | class GVAR(fadeDelay) { 22 | value = 1; 23 | typeName = "SCALAR"; 24 | category = CSTRING(Name); 25 | displayName = CSTRING(FadeDelay); 26 | description = CSTRING(FadeDelayDescription); 27 | isClientSettable = 1; 28 | force = 0; 29 | values[] = {"0s", "1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "10s"}; 30 | }; 31 | class GVAR(lowerInVehicles) { 32 | value = 0; 33 | typeName = "BOOL"; 34 | category = CSTRING(Name); 35 | displayName = CSTRING(LowerInVehicles); 36 | description = CSTRING(LowerInVehiclesDescription); 37 | isClientSettable = 1; 38 | force = 0; 39 | }; 40 | class GVAR(showNotification) { 41 | value = 1; 42 | typeName = "BOOL"; 43 | category = CSTRING(Name); 44 | displayName = CSTRING(ShowNotification); 45 | description = CSTRING(ShowNotificationDescription); 46 | isClientSettable = 1; 47 | force = 0; 48 | }; 49 | class GVAR(remindIfLowered) { 50 | value = 0; 51 | typeName = "BOOL"; 52 | category = CSTRING(Name); 53 | displayName = CSTRING(RemindIfLowered); 54 | description = CSTRING(RemindIfLoweredDescription); 55 | isClientSettable = 1; 56 | force = 0; 57 | }; 58 | }; 59 | -------------------------------------------------------------------------------- /addons/volume/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | 13 | class Extended_PostInit_EventHandlers { 14 | class ADDON { 15 | clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /addons/volume/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(lowerVolume); 2 | PREP(remind); 3 | PREP(restoreVolume); 4 | -------------------------------------------------------------------------------- /addons/volume/XEH_postInitClient.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | if (!hasInterface) exitWith {}; 4 | 5 | ["ACEX", QGVAR(toggle), [LLSTRING(KeybindName), LLSTRING(KeybindDescription)], "", { 6 | if (!GVAR(enabled)) exitWith { 7 | if (GVAR(isLowered)) then { 8 | call FUNC(restoreVolume); 9 | }; 10 | }; 11 | 12 | if (GVAR(isLowered)) then { 13 | call FUNC(restoreVolume); 14 | } else { 15 | call FUNC(lowerVolume); 16 | }; 17 | 18 | false 19 | }] call CBA_fnc_addKeybind; 20 | 21 | ["vehicle", { 22 | params ["_unit"]; 23 | 24 | if (!GVAR(lowerInVehicles)) exitWith {}; 25 | 26 | if (vehicle _unit != _unit) then { 27 | call FUNC(lowerVolume); 28 | } else { 29 | call FUNC(restoreVolume); 30 | }; 31 | }] call CBA_fnc_addPlayerEventHandler; 32 | 33 | // Self-calling reminder 34 | [FUNC(remind), [], REMINDER_DELAY] call CBA_fnc_waitAndExecute; 35 | 36 | // Restore volume on respawn 37 | ace_player addEventHandler ["Respawn", FUNC(restoreVolume)]; 38 | -------------------------------------------------------------------------------- /addons/volume/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | GVAR(isLowered) = false; 10 | GVAR(initialGameVolume) = soundVolume; 11 | GVAR(initialMusicVolume) = musicVolume; 12 | 13 | ADDON = true; 14 | -------------------------------------------------------------------------------- /addons/volume/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /addons/volume/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | units[] = {}; 6 | weapons[] = {}; 7 | requiredVersion = REQUIRED_VERSION; 8 | requiredAddons[] = {"acex_main"}; 9 | author = ACECSTRING(common,ACETeam); 10 | authors[] = {"Kingsley"}; 11 | url = ACECSTRING(main,URL); 12 | VERSION_CONFIG; 13 | }; 14 | }; 15 | 16 | #include "CfgEventHandlers.hpp" 17 | #include "ACE_Settings.hpp" 18 | -------------------------------------------------------------------------------- /addons/volume/functions/fnc_lowerVolume.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Lowers the game and music volume with values from ACE settings. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [] call acex_volume_fnc_lowerVolume; 14 | * 15 | * Public: No 16 | */ 17 | 18 | ACEGVAR(hearing,disableVolumeUpdate) = true; 19 | 20 | private _coef = GVAR(reduction) / 10; 21 | private _reductionGame = _coef * GVAR(initialGameVolume); 22 | private _reductionMusic = _coef * GVAR(initialMusicVolume); 23 | 24 | GVAR(fadeDelay) fadeSound (GVAR(initialGameVolume) - _reductionGame); 25 | GVAR(fadeDelay) fadeMusic (GVAR(initialMusicVolume) - _reductionMusic); 26 | 27 | GVAR(isLowered) = true; 28 | 29 | if (GVAR(showNotification)) then { 30 | [LLSTRING(Lowered)] call ACEFUNC(common,displayTextStructured); 31 | }; 32 | -------------------------------------------------------------------------------- /addons/volume/functions/fnc_remind.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Reminds about lowered volume. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [] call acex_volume_fnc_remind; 14 | * 15 | * Public: No 16 | */ 17 | 18 | // Exit if reminder not enabled or not lowered 19 | if (!GVAR(remindIfLowered) || {!GVAR(isLowered)}) exitWith {}; 20 | 21 | [LLSTRING(LoweredReminder)] call ACEFUNC(common,displayTextStructured); 22 | 23 | // Fire another reminder in 60s 24 | [FUNC(remind), [], REMINDER_DELAY] call CBA_fnc_waitAndExecute; 25 | -------------------------------------------------------------------------------- /addons/volume/functions/fnc_restoreVolume.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | /* 3 | * Author: Kingsley 4 | * Restores the game and music volume to what it was when the mission first started, 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * None 11 | * 12 | * Example: 13 | * [] call acex_volume_fnc_restoreVolume; 14 | * 15 | * Public: No 16 | */ 17 | 18 | ACEGVAR(hearing,disableVolumeUpdate) = false; 19 | 20 | GVAR(fadeDelay) fadeSound GVAR(initialGameVolume); 21 | GVAR(fadeDelay) fadeMusic GVAR(initialMusicVolume); 22 | 23 | GVAR(isLowered) = false; 24 | 25 | if (GVAR(showNotification)) then { 26 | [LLSTRING(Restored)] call ACEFUNC(common,displayTextStructured); 27 | }; 28 | -------------------------------------------------------------------------------- /addons/volume/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\volume\script_component.hpp" 2 | -------------------------------------------------------------------------------- /addons/volume/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT volume 2 | #include "\z\acex\addons\main\script_mod.hpp" 3 | 4 | // #define DEBUG_MODE_FULL 5 | // #define DISABLE_COMPILE_CACHE 6 | // #define ENABLE_PERFORMANCE_COUNTERS 7 | 8 | #ifdef DEBUG_ENABLED_VOLUME 9 | #define DEBUG_MODE_FULL 10 | #endif 11 | 12 | #ifdef DEBUG_SETTINGS_VOLUME 13 | #define DEBUG_SETTINGS DEBUG_SETTINGS_VOLUME 14 | #endif 15 | 16 | #include "\z\acex\addons\main\script_macros.hpp" 17 | 18 | 19 | #define REMINDER_DELAY 60 20 | -------------------------------------------------------------------------------- /extras/assets/logo/black/ACEX-Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/extras/assets/logo/black/ACEX-Logo.jpg -------------------------------------------------------------------------------- /extras/assets/logo/black/ACEX-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/extras/assets/logo/black/ACEX-Logo.png -------------------------------------------------------------------------------- /extras/assets/logo/white/ACEX-Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/extras/assets/logo/white/ACEX-Logo.jpg -------------------------------------------------------------------------------- /extras/assets/logo/white/ACEX-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/extras/assets/logo/white/ACEX-Logo.png -------------------------------------------------------------------------------- /extras/blank/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\acex\addons\blank 2 | -------------------------------------------------------------------------------- /extras/blank/CfgEventHandlers.hpp: -------------------------------------------------------------------------------- 1 | class Extended_PreStart_EventHandlers { 2 | class ADDON { 3 | init = QUOTE(call COMPILE_FILE(XEH_preStart)); 4 | }; 5 | }; 6 | 7 | class Extended_PreInit_EventHandlers { 8 | class ADDON { 9 | init = QUOTE(call COMPILE_FILE(XEH_preInit)); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /extras/blank/XEH_PREP.hpp: -------------------------------------------------------------------------------- 1 | PREP(empty); 2 | -------------------------------------------------------------------------------- /extras/blank/XEH_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | ADDON = false; 4 | 5 | PREP_RECOMPILE_START; 6 | #include "XEH_PREP.hpp" 7 | PREP_RECOMPILE_END; 8 | 9 | ADDON = true; 10 | -------------------------------------------------------------------------------- /extras/blank/XEH_preStart.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | #include "XEH_PREP.hpp" 4 | -------------------------------------------------------------------------------- /extras/blank/config.cpp: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | class CfgPatches { 4 | class ADDON { 5 | units[] = {}; 6 | weapons[] = {}; 7 | requiredVersion = REQUIRED_VERSION; 8 | requiredAddons[] = {"acex_main"}; 9 | author = ACECSTRING(common,ACETeam); 10 | authors[] = {""}; 11 | url = ACECSTRING(main,URL); 12 | VERSION_CONFIG; 13 | }; 14 | }; 15 | 16 | #include "CfgEventHandlers.hpp" 17 | -------------------------------------------------------------------------------- /extras/blank/functions/fnc_empty.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp" 2 | 3 | diag_log text format["This is here as an example!!!"]; 4 | -------------------------------------------------------------------------------- /extras/blank/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "\z\acex\addons\blank\script_component.hpp" 2 | -------------------------------------------------------------------------------- /extras/blank/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define COMPONENT blank 2 | #include "\z\acex\addons\main\script_mod.hpp" 3 | 4 | // #define DEBUG_MODE_FULL 5 | // #define DISABLE_COMPILE_CACHE 6 | // #define CBA_DEBUG_SYNCHRONOUS 7 | // #define ENABLE_PERFORMANCE_COUNTERS 8 | 9 | #ifdef DEBUG_ENABLED_BLANK 10 | #define DEBUG_MODE_FULL 11 | #endif 12 | 13 | #ifdef DEBUG_SETTINGS_BLANK 14 | #define DEBUG_SETTINGS DEBUG_SETTINGS_BLANK 15 | #endif 16 | 17 | #include "\z\acex\addons\main\script_macros.hpp" 18 | -------------------------------------------------------------------------------- /hemtt.toml: -------------------------------------------------------------------------------- 1 | name = "ACEX" 2 | prefix = "acex" 3 | author = "ACE-Team" 4 | files = [ 5 | "mod.cpp", 6 | "README.md", 7 | "AUTHORS.txt", 8 | "LICENSE", 9 | "logo_acex_ca.paa", 10 | "meta.cpp" 11 | ] 12 | 13 | keyname = "{{prefix}}_{{version}}" 14 | signame = "{{prefix}}_{{version}}-{{git \"id 8\"}}" 15 | 16 | releasebuild = [ 17 | "@zip acex_{{semver.major}}.{{semver.minor}}.{{semver.patch}}" 18 | ] 19 | 20 | [header_exts] 21 | version= "{{git \"id 8\"}}" 22 | -------------------------------------------------------------------------------- /include/a3/ui_f/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | a3\ui_f -------------------------------------------------------------------------------- /include/x/cba/addons/main/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | x\cba\addons\main -------------------------------------------------------------------------------- /include/x/cba/addons/xeh/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | x\cba\addons\xeh -------------------------------------------------------------------------------- /include/z/ace/addons/main/$PBOPREFIX$: -------------------------------------------------------------------------------- 1 | z\ace\addons\main 2 | -------------------------------------------------------------------------------- /logo_acex_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acemod/ACEX/d484800d687b9b85e762b959d4ce760e48afc6b4/logo_acex_ca.paa -------------------------------------------------------------------------------- /meta.cpp: -------------------------------------------------------------------------------- 1 | protocol = 1; 2 | publishedid = 708250744; 3 | -------------------------------------------------------------------------------- /mod.cpp: -------------------------------------------------------------------------------- 1 | name = "Advanced Combat Environment Extras 0.0.0"; 2 | picture = "logo_acex_ca.paa"; 3 | actionName = "GitHub"; 4 | action = "https://github.com/acemod/ACEX"; 5 | description = "ACEX - Version 0.0.0"; 6 | logo = "logo_acex_ca.paa"; 7 | logoOver = "logo_acex_ca.paa"; 8 | tooltip = "ACEX"; 9 | tooltipOwned = "ACEX Owned"; 10 | overview = "Advanced Combat Environment Extras, also known as ACEX, adds a variety of additional systems on top of the ACE3 framework."; 11 | author = "ACE3 Team"; 12 | overviewPicture = "logo_acex_ca.paa"; 13 | -------------------------------------------------------------------------------- /tools/build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | 7 | ######## GLOBALS ######### 8 | MAINPREFIX = "z" 9 | PREFIX = "acex_" 10 | ########################## 11 | 12 | def tryHemttBuild(projectpath): 13 | hemttExe = os.path.join(projectpath, "hemtt.exe") 14 | if os.path.isfile(hemttExe): 15 | os.chdir(projectpath) 16 | ret = subprocess.call([hemttExe, "pack"], stderr=subprocess.STDOUT) 17 | print("Using hemtt: {}".format(ret)); 18 | return True 19 | else: 20 | print("hemtt not installed"); 21 | return False 22 | 23 | def mod_time(path): 24 | if not os.path.isdir(path): 25 | return os.path.getmtime(path) 26 | maxi = os.path.getmtime(path) 27 | for p in os.listdir(path): 28 | maxi = max(mod_time(os.path.join(path, p)), maxi) 29 | return maxi 30 | 31 | 32 | def check_for_changes(addonspath, module): 33 | if not os.path.exists(os.path.join(addonspath, "{}{}.pbo".format(PREFIX,module))): 34 | return True 35 | return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "{}{}.pbo".format(PREFIX,module))) 36 | 37 | def check_for_obsolete_pbos(addonspath, file): 38 | module = file[len(PREFIX):-4] 39 | if not os.path.exists(os.path.join(addonspath, module)): 40 | return True 41 | return False 42 | 43 | def main(): 44 | print(""" 45 | #################### 46 | # ACEX Debug Build # 47 | #################### 48 | """) 49 | 50 | scriptpath = os.path.realpath(__file__) 51 | projectpath = os.path.dirname(os.path.dirname(scriptpath)) 52 | addonspath = os.path.join(projectpath, "addons") 53 | 54 | if (tryHemttBuild(projectpath)): return 55 | 56 | os.chdir(addonspath) 57 | 58 | made = 0 59 | failed = 0 60 | skipped = 0 61 | removed = 0 62 | 63 | for file in os.listdir(addonspath): 64 | if os.path.isfile(file): 65 | if check_for_obsolete_pbos(addonspath, file): 66 | removed += 1 67 | print(" Removing obsolete file => " + file) 68 | os.remove(file) 69 | print("") 70 | 71 | for p in os.listdir(addonspath): 72 | path = os.path.join(addonspath, p) 73 | if not os.path.isdir(path): 74 | continue 75 | if p[0] == ".": 76 | continue 77 | if not check_for_changes(addonspath, p): 78 | skipped += 1 79 | print(" Skipping {}.".format(p)) 80 | continue 81 | 82 | print("# Making {} ...".format(p)) 83 | 84 | try: 85 | subprocess.check_output([ 86 | "makepbo", 87 | "-NUP", 88 | "-@={}\\{}\\addons\\{}".format(MAINPREFIX,PREFIX.rstrip("_"),p), 89 | p, 90 | "{}{}.pbo".format(PREFIX,p) 91 | ], stderr=subprocess.STDOUT) 92 | except: 93 | failed += 1 94 | print(" Failed to make {}.".format(p)) 95 | else: 96 | made += 1 97 | print(" Successfully made {}.".format(p)) 98 | 99 | print("\n# Done.") 100 | print(" Made {}, skipped {}, removed {}, failed to make {}.".format(made, skipped, removed, failed)) 101 | 102 | 103 | if __name__ == "__main__": 104 | sys.exit(main()) 105 | -------------------------------------------------------------------------------- /tools/deploy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | #################################### 4 | # ACEX automatic deployment script # 5 | # ================================ # 6 | # This is not meant to be run # 7 | # directly! # 8 | #################################### 9 | 10 | import os 11 | import sys 12 | import shutil 13 | import traceback 14 | import subprocess as sp 15 | from pygithub3 import Github 16 | 17 | 18 | TRANSLATIONISSUE = 17 19 | TRANSLATIONBODY = """**[ACE3 Translation Guide](http://ace3mod.com/wiki/development/how-to-translate-ace3.html)** 20 | 21 | {} 22 | """ 23 | 24 | REPOUSER = "acemod" 25 | REPONAME = "ACEX" 26 | REPOPATH = "{}/{}".format(REPOUSER,REPONAME) 27 | 28 | 29 | def update_translations(token): 30 | diag = sp.check_output(["python3", "tools/stringtablediag.py", "--markdown"]) 31 | diag = str(diag, "utf-8") 32 | repo = Github(token).get_repo(REPOPATH) 33 | issue = repo.get_issue(TRANSLATIONISSUE) 34 | issue.edit(body=TRANSLATIONBODY.format(diag)) 35 | 36 | 37 | def main(): 38 | print("Obtaining token ...") 39 | try: 40 | token = os.environ["GH_TOKEN"] 41 | except: 42 | print("Could not obtain token.") 43 | print(traceback.format_exc()) 44 | return 1 45 | else: 46 | print("done.") 47 | 48 | print("\nUpdating translation issue ...") 49 | try: 50 | update_translations(token) 51 | except: 52 | print("Failed to update translation issue.") 53 | print(traceback.format_exc()) 54 | return 1 55 | else: 56 | print("done.") 57 | 58 | return 0 59 | 60 | 61 | if __name__ == "__main__": 62 | sys.exit(main()) 63 | -------------------------------------------------------------------------------- /tools/stringtableduplicates.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | 6 | import xml.dom 7 | from xml.dom import minidom 8 | 9 | # STRINGTABLE DIAG TOOL 10 | # Author: KoffeinFlummi 11 | # --------------------- 12 | # Counts duplicates stringtable entries 13 | 14 | 15 | def check_module(projectpath, module): 16 | """ Checks the given module for all the different languages. """ 17 | localized = [] 18 | 19 | stringtablepath = os.path.join(projectpath, module, "stringtable.xml") 20 | try: 21 | xmldoc = minidom.parse(stringtablepath) 22 | except IOError: 23 | return 0 24 | keys = xmldoc.getElementsByTagName("Key") 25 | 26 | duplicates = 0 27 | for key in keys: 28 | children = key.childNodes 29 | entries = [] 30 | for c in range(children.length): 31 | entries.append(children.item(c)) 32 | entries = list(filter(lambda x: x.nodeType == x.ELEMENT_NODE, entries)) 33 | entries = list(map(lambda x: str(x.nodeName).lower(), entries)) 34 | diff = len(entries) - len(list(set(entries))) 35 | duplicates += diff 36 | if diff > 0: 37 | print(key.getAttribute("ID")) 38 | 39 | return duplicates 40 | 41 | def main(): 42 | scriptpath = os.path.realpath(__file__) 43 | projectpath = os.path.dirname(os.path.dirname(scriptpath)) 44 | projectpath = os.path.join(projectpath, "addons") 45 | 46 | print("###############################") 47 | print("# Stringtable Duplicates Tool #") 48 | print("###############################\n") 49 | 50 | duplicates = 0 51 | for module in os.listdir(projectpath): 52 | d = check_module(projectpath, module) 53 | 54 | print("# {} {}".format(module.ljust(20), d)) 55 | duplicates += d 56 | 57 | print("\nTotal number of duplicates: {}".format(duplicates)) 58 | 59 | if __name__ == "__main__": 60 | main() 61 | --------------------------------------------------------------------------------