├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yaml │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── release.yml └── workflows │ ├── create_artifacts.yml │ ├── deploy.yml │ ├── deploy_artifacts_main.yml │ ├── deploy_artifacts_tag.yml │ └── testing.yml ├── .gitignore ├── Compositions ├── 1.Cav_Viking_Platoon │ ├── composition.sqe │ └── header.sqe ├── 2.Cav_Bandit_Platoon │ ├── composition.sqe │ └── header.sqe ├── 3.Cav_Misfit_Platoon │ ├── composition.sqe │ └── header.sqe ├── 4.Cav_ATLAS_Platoon │ ├── composition.sqe │ └── header.sqe ├── 5.Cav_JTAC_Addon │ ├── composition.sqe │ └── header.sqe ├── 6.Cav_Rotary_Aviation │ ├── composition.sqe │ └── header.sqe ├── 7.Cav_Fixed_Wing_Aviation │ ├── composition.sqe │ └── header.sqe ├── 8.Cav_S3_Mission_Controller │ ├── composition.sqe │ └── header.sqe ├── README.md └── TacR_Public_Deployment │ ├── composition.sqe │ └── header.sqe ├── Data ├── MissionLogo.paa └── MissionLogo.psd ├── LICENSE ├── README.md ├── cScripts ├── CfgFunctions.hpp ├── CfgLoadouts.hpp ├── Data │ ├── Icon │ │ ├── icon_00.paa │ │ ├── icon_01.paa │ │ ├── icon_02.paa │ │ ├── icon_arsenal_ca.paa │ │ └── icon_x.paa │ └── Images │ │ ├── 7CAV_LOGO_00.paa │ │ ├── 7CAV_LOGO_01.paa │ │ ├── AB_Admin_Checklist.paa │ │ ├── AB_Drop_Checklist.paa │ │ ├── CFF.jpg │ │ ├── LPSIZES.paa │ │ ├── LZ-MAP-MARKINGS.paa │ │ ├── LZTYPES.paa │ │ ├── extract-admin-checklist.paa │ │ ├── extract-extract-checklist.paa │ │ ├── insertion-admin-checklist.paa │ │ └── insertion-insert-checklist.paa ├── Loadouts │ ├── CfgLoadouts_Alpha.hpp │ ├── CfgLoadouts_Alpha_FixedWing.hpp │ ├── CfgLoadouts_Alpha_Rotary.hpp │ ├── CfgLoadouts_Bravo_Atlas.hpp │ ├── CfgLoadouts_Bravo_Crew.hpp │ ├── CfgLoadouts_Bravo_Viking.hpp │ ├── CfgLoadouts_Bravo_Viking_Weapons.hpp │ ├── CfgLoadouts_Charlie_Squad.hpp │ ├── CfgLoadouts_Charlie_Weapon.hpp │ ├── CfgLoadouts_Common.hpp │ ├── CfgLoadouts_Special.hpp │ ├── CfgLoadouts_Training.hpp │ └── CfgLoadouts_UserCustom.hpp ├── cScripts_logistics.sqf ├── cScripts_postInit.sqf ├── cScripts_preInit.sqf ├── cScripts_pylons.sqf ├── functions │ ├── civ │ │ ├── fn_civ_checkProjectile.sqf │ │ ├── fn_civ_damage.sqf │ │ └── fn_civ_init.sqf │ ├── diag │ │ ├── fn_error.sqf │ │ ├── fn_info.sqf │ │ ├── fn_log.sqf │ │ └── fn_warning.sqf │ ├── documents │ │ ├── fn_DocChklist_CFF.sqf │ │ ├── fn_DocChklist_JMTASKS.sqf │ │ ├── fn_DocChklist_LZEXTRACT.sqf │ │ ├── fn_DocChklist_LZINSERT.sqf │ │ ├── fn_DocChklist_LZSPECS.sqf │ │ ├── fn_DocRadio_LACEACE.sqf │ │ ├── fn_DocRadio_MEDEVAC.sqf │ │ ├── fn_DocRadio_ROTARYPICKUP.sqf │ │ ├── fn_DocRadio_SPOTREP.sqf │ │ ├── fn_Doc_Info.sqf │ │ ├── fn_Doc_MissionControl.sqf │ │ └── fn_Doc_Radio.sqf │ ├── gear │ │ ├── fn_gear_applyAbilities.sqf │ │ ├── fn_gear_applyCosmetics.sqf │ │ ├── fn_gear_applyFunctions.sqf │ │ ├── fn_gear_applyLoadout.sqf │ │ ├── fn_gear_getLoadoutDisplayName.sqf │ │ ├── fn_gear_getLoadoutName.sqf │ │ ├── fn_gear_getLoadoutRole.sqf │ │ ├── fn_gear_getSideConfig.sqf │ │ ├── fn_gear_hasSavedLoadout.sqf │ │ ├── fn_gear_loadLoadout.sqf │ │ ├── fn_gear_postInit.sqf │ │ ├── fn_gear_postInitProxy.sqf │ │ ├── fn_gear_preInit.sqf │ │ ├── fn_gear_removeLoadout.sqf │ │ ├── fn_gear_saveLoadout.sqf │ │ ├── fn_gear_selectLoadout.sqf │ │ └── fn_gear_setupRadios.sqf │ ├── init │ │ ├── fn_init_aceArsenal.sqf │ │ ├── fn_init_aceItemReplace.sqf │ │ ├── fn_init_chatCommands.sqf │ │ ├── fn_init_diary.sqf │ │ ├── fn_init_eventHandlers.sqf │ │ ├── fn_init_logistics.sqf │ │ ├── fn_init_message.sqf │ │ ├── fn_init_pylons.sqf │ │ ├── fn_init_skillAdjustment.sqf │ │ ├── fn_init_staging.sqf │ │ ├── fn_init_vehicle.sqf │ │ └── fn_init_zenModuels.sqf │ ├── logistics │ │ ├── fn_addCargo.sqf │ │ ├── fn_checkItemValidity.sqf │ │ ├── fn_createCargoCrate.sqf │ │ ├── fn_doEmptyCrate.sqf │ │ ├── fn_doFieldHospital.sqf │ │ ├── fn_doStarterCrateSupplies.sqf │ │ ├── fn_doSupplyCrate.sqf │ │ ├── fn_logistics_getAllContainerItems.sqf │ │ ├── fn_logistics_getContainer.sqf │ │ ├── fn_setCargo.sqf │ │ └── fn_setCargoAttributes.sqf │ ├── mission │ │ ├── fn_addBaseCrate.sqf │ │ ├── fn_addEscapeWreck.sqf │ │ ├── fn_addGetOutHelo.sqf │ │ ├── fn_addHaloJump.sqf │ │ ├── fn_addLineJump.sqf │ │ ├── fn_addLoadoutAction.sqf │ │ ├── fn_addStagingZone.sqf │ │ ├── fn_doStarterCrate.sqf │ │ ├── fn_gate.sqf │ │ ├── fn_makeAgent.sqf │ │ ├── fn_setVehicleLable.sqf │ │ └── fn_teleport.sqf │ ├── modules │ │ ├── fn_zenModule_applyLoadout.sqf │ │ ├── fn_zenModule_callEndex.sqf │ │ ├── fn_zenModule_createFieldHospital.sqf │ │ ├── fn_zenModule_createMedicalCrate.sqf │ │ ├── fn_zenModule_createStarterCrate.sqf │ │ ├── fn_zenModule_createSupplyCrate.sqf │ │ ├── fn_zenModule_enableUnitSimulation.sqf │ │ ├── fn_zenModule_regearTrooper.sqf │ │ ├── fn_zenModule_rekitVehicle.sqf │ │ ├── fn_zenModule_resetPlayerRadio.sqf │ │ ├── fn_zenModule_setDamage.sqf │ │ └── fn_zenModule_stagingZones.sqf │ ├── players │ │ ├── fn_getRadioChannel.sqf │ │ ├── fn_player_getClanTag.sqf │ │ ├── fn_player_getCompany.sqf │ │ ├── fn_player_getOrganization.sqf │ │ ├── fn_player_getPlatoon.sqf │ │ ├── fn_player_getRank.sqf │ │ ├── fn_player_getRole.sqf │ │ ├── fn_player_hasClanTag.sqf │ │ ├── fn_player_isCurator.sqf │ │ ├── fn_player_isMissionAdmin.sqf │ │ ├── fn_player_setOrganization.sqf │ │ ├── fn_player_setRank.sqf │ │ ├── fn_player_setSquad.sqf │ │ ├── fn_profile_loadInsignia.sqf │ │ ├── fn_profile_saveInsignia.sqf │ │ ├── fn_setActiveRadio.sqf │ │ ├── fn_setRadioChannel.sqf │ │ ├── fn_unit_getName.sqf │ │ ├── fn_unit_getSquadInsignia.sqf │ │ ├── fn_unit_getSquadName.sqf │ │ ├── fn_unit_getVariables.sqf │ │ ├── fn_unit_setInsignia.sqf │ │ └── fn_unit_setTeamColor.sqf │ ├── script_component.hpp │ ├── systems │ │ ├── fn_addArsenal.sqf │ │ ├── fn_addDefaultArsenalLoadout.sqf │ │ ├── fn_addDefaultArsenalLoadouts.sqf │ │ ├── fn_addHeal.sqf │ │ ├── fn_addInsigniaSelection.sqf │ │ ├── fn_addInsigniaSelectionList.sqf │ │ ├── fn_addLoadoutSelection.sqf │ │ ├── fn_addObjectToCurator.sqf │ │ ├── fn_addReGear.sqf │ │ ├── fn_allowLoadout.sqf │ │ ├── fn_checkStagingZone.sqf │ │ ├── fn_clearDefaultArsenalLoadouts.sqf │ │ ├── fn_clearRadioIds.sqf │ │ ├── fn_createActionCategory.sqf │ │ ├── fn_createVehicleLable.sqf │ │ ├── fn_deleteDroppedObjects.sqf │ │ ├── fn_doGetOutHeloSide.sqf │ │ ├── fn_filterUnitLoadout.sqf │ │ ├── fn_getArsenalWhitelist.sqf │ │ ├── fn_getAttendance.sqf │ │ ├── fn_getChannelName.sqf │ │ ├── fn_getIcon.sqf │ │ ├── fn_getRadioBase.sqf │ │ ├── fn_getServerMetrics.sqf │ │ ├── fn_getVehicleLable.sqf │ │ ├── fn_isValidFaction.sqf │ │ ├── fn_para_backpack.sqf │ │ ├── fn_para_equipment.sqf │ │ ├── fn_para_haloJump.sqf │ │ ├── fn_para_lineJump.sqf │ │ ├── fn_renameObject.sqf │ │ ├── fn_setupLoadoutCategories.sqf │ │ ├── fn_setupLoadoutSelection.sqf │ │ ├── fn_training_addHitIndicator.sqf │ │ ├── fn_training_addTargetComputer.sqf │ │ └── fn_training_clearhitIndicator.sqf │ ├── testing │ │ ├── fn_testing_equipmentUsed.sqf │ │ └── fn_testing_loadoutArrays.sqf │ └── vehicle │ │ ├── fn_vehicle_addCosmeticSelection.sqf │ │ ├── fn_vehicle_addCosmetics.sqf │ │ ├── fn_vehicle_addDefaultLoadout.sqf │ │ ├── fn_vehicle_addFlagAction.sqf │ │ ├── fn_vehicle_addFunctions.sqf │ │ ├── fn_vehicle_addFunctionsGlobal.sqf │ │ ├── fn_vehicle_addInventory.sqf │ │ ├── fn_vehicle_addPylonSelection.sqf │ │ ├── fn_vehicle_addRadio.sqf │ │ ├── fn_vehicle_addRegearAction.sqf │ │ ├── fn_vehicle_addRepairAction.sqf │ │ ├── fn_vehicle_addStagingActions.sqf │ │ ├── fn_vehicle_applyLoadout.sqf │ │ ├── fn_vehicle_applyTextures.sqf │ │ ├── fn_vehicle_getPylonIcon.sqf │ │ ├── fn_vehicle_getPylonLoadout.sqf │ │ ├── fn_vehicle_getPylonName.sqf │ │ ├── fn_vehicle_reset.sqf │ │ ├── fn_vehicle_setRadio.sqf │ │ └── fn_vehicle_setupPylonCategories.sqf ├── initSettings.inc.sqf ├── script_component.hpp └── script_macros.hpp ├── cba_settings.sqf ├── description.ext ├── init.sqf ├── resourses ├── logo.png ├── logo.psd ├── misc │ ├── build.bat │ └── cav.ico └── wikigfx │ ├── 7Cav_Modules.png │ ├── CBA_Mission_Settings.png │ ├── Diary_Records.png │ ├── Insignia_Arsenal.png │ ├── Insignia_Crate.png │ ├── Logistical_Crates.png │ ├── Starter_Crate.png │ ├── Texture_Lable.png │ └── gear_applyloadout_examples.png └── tools ├── build.py ├── build_settings_config.sh ├── checkDebug.sh ├── checkFixme.sh ├── checkLogging.sh ├── checkPullRequestTitle.sh ├── checkTodo.sh ├── check_loadout_classnames.py ├── config.json ├── config_debug.json ├── config_noLoadouts.json ├── config_noRadio.json ├── config_style_checker.py ├── deploy.sh ├── export_classnames.py ├── generate_wiki_articles.py ├── link_compositions.py ├── search_privates.py ├── search_undefinedFunctions.py ├── search_unused_privates.py ├── sqf_linter.py └── sqf_validator.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 | 14 | [*.yml] 15 | indent_size = 2 16 | 17 | [*.hpp] 18 | indent_style = space 19 | indent_size = 4 20 | 21 | [*.cpp] 22 | indent_style = space 23 | indent_size = 4 24 | 25 | [*.sqf] 26 | indent_style = space 27 | indent_size = 4 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.png binary 3 | *.jpg binary 4 | *.paa binary 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yaml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a report to help us improve 3 | labels: ['bug'] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | - type: textarea 10 | id: what-happened 11 | attributes: 12 | label: What happened? 13 | description: Describe what happened. You can also provide a screenshot. 14 | validations: 15 | required: true 16 | - type: dropdown 17 | id: version 18 | attributes: 19 | label: Version 20 | description: What version of cScripts are you running? 21 | options: 22 | - Release build 23 | - Tampered release build 24 | - Outdated build 25 | - Tampered outdated build 26 | - Development build 27 | default: 0 28 | validations: 29 | required: true 30 | - type: textarea 31 | id: logs 32 | attributes: 33 | label: RPT log 34 | description: Please copy and paste any relevant RPT log output. (If applicable) 35 | render: shell 36 | -------------------------------------------------------------------------------- /.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 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.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 | - Include documentation if applicable 5 | - Respect the [Development Guidelines](https://github.com/7Cav/cScripts/wiki/Code-and-development-policy) 6 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | labels: 4 | - ignore changelog 5 | -------------------------------------------------------------------------------- /.github/workflows/create_artifacts.yml: -------------------------------------------------------------------------------- 1 | name: Create Artifacts 2 | on: workflow_dispatch 3 | 4 | jobs: 5 | build: 6 | name: Create And Upload Releases 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout code 10 | uses: actions/checkout@master 11 | 12 | - name: Build releases 13 | run: ./tools/deploy.sh DevBuild_${{ github.ref_name }}-$(git rev-parse --short HEAD) 14 | 15 | - name: Upload releases 16 | uses: actions/upload-artifact@v3 17 | with: 18 | name: cScripts_DevBuilds 19 | path: release/* 20 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Release 2 | on: 3 | release: 4 | types: [published] 5 | 6 | jobs: 7 | build: 8 | name: Create And Upload Release 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@master 13 | 14 | - name: Build releases 15 | run: ./tools/deploy.sh ${{github.ref_name}} 16 | 17 | - name: Upload release (cScripts) 18 | uses: svenstaro/upload-release-action@v2 19 | with: 20 | repo_token: ${{ secrets.GITHUB_TOKEN }} 21 | tag: ${{ github.ref }} 22 | asset_name: cScripts-${{github.ref_name}}.zip 23 | file: release/cScripts-${{github.ref_name}}.zip 24 | 25 | - name: Upload release (Compositions) 26 | uses: svenstaro/upload-release-action@v2 27 | with: 28 | repo_token: ${{ secrets.GITHUB_TOKEN }} 29 | tag: ${{ github.ref }} 30 | asset_name: Compositions-${{github.ref_name}}.zip 31 | file: release/Compositions-${{github.ref_name}}.zip 32 | 33 | - name: Upload release (cScripts_Debug) 34 | uses: svenstaro/upload-release-action@v2 35 | with: 36 | repo_token: ${{ secrets.GITHUB_TOKEN }} 37 | tag: ${{ github.ref }} 38 | asset_name: cScripts_Debug-${{github.ref_name}}.zip 39 | file: release/cScripts_Debug-${{github.ref_name}}.zip 40 | 41 | - name: Upload release (cScripts_NoRadio) 42 | uses: svenstaro/upload-release-action@v2 43 | with: 44 | repo_token: ${{ secrets.GITHUB_TOKEN }} 45 | tag: ${{ github.ref }} 46 | asset_name: cScripts_NoRadio-${{github.ref_name}}.zip 47 | file: release/cScripts_NoRadio-${{github.ref_name}}.zip 48 | 49 | - name: Upload release (cScripts_NoLoadouts) 50 | uses: svenstaro/upload-release-action@v2 51 | with: 52 | repo_token: ${{ secrets.GITHUB_TOKEN }} 53 | tag: ${{ github.ref }} 54 | asset_name: cScripts_NoLoadouts-${{github.ref_name}}.zip 55 | file: release/cScripts_NoLoadouts-${{github.ref_name}}.zip 56 | 57 | - name: Upload CBA_Settings.sqf 58 | uses: svenstaro/upload-release-action@v2 59 | with: 60 | repo_token: ${{ secrets.GITHUB_TOKEN }} 61 | tag: ${{ github.ref }} 62 | asset_name: cba_settings.sqf 63 | file: release/cba_settings.sqf 64 | -------------------------------------------------------------------------------- /.github/workflows/deploy_artifacts_main.yml: -------------------------------------------------------------------------------- 1 | name: Deploy DevBuild Artifacts 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | build: 9 | name: Create And Upload Releases 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@master 14 | 15 | - name: Build releases 16 | run: ./tools/deploy.sh DevBuild-$(git rev-parse --short HEAD) 17 | 18 | - name: Upload releases 19 | uses: actions/upload-artifact@v3 20 | with: 21 | name: cScripts_DevBuilds 22 | path: release/* 23 | -------------------------------------------------------------------------------- /.github/workflows/deploy_artifacts_tag.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Tag Artifacts 2 | on: 3 | push: 4 | tags: 5 | - "*" 6 | 7 | jobs: 8 | build: 9 | name: Create And Upload Releases 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@master 14 | 15 | - name: Build releases 16 | run: ./tools/deploy.sh ${{github.ref_name}} 17 | 18 | - name: Upload releases 19 | uses: actions/upload-artifact@v3 20 | with: 21 | name: cScripts_Releases 22 | path: release/* 23 | -------------------------------------------------------------------------------- /.github/workflows/testing.yml: -------------------------------------------------------------------------------- 1 | name: Testing 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | types: [opened, synchronize, ready_for_review] 8 | 9 | 10 | jobs: 11 | validate: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout the source code 15 | uses: actions/checkout@master 16 | - name: Validate SQF 17 | run: python3 tools/sqf_validator.py 18 | - name: Validate Config 19 | run: python3 tools/config_style_checker.py 20 | 21 | lint: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout the source code 25 | uses: actions/checkout@master 26 | - name: Lint (sqflint) 27 | uses: arma-actions/sqflint@master 28 | with: 29 | args: --exit e --directory cScripts/functions 30 | continue-on-error: true # No failure due to many false-positives 31 | 32 | quality: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Checkout the source code 36 | uses: actions/checkout@master 37 | - name: Check DEBUG_MODE 38 | if: always() 39 | run: bash tools/checkDebug.sh 40 | - name: Check TODO 41 | if: always() 42 | run: bash tools/checkTodo.sh 43 | continue-on-error: true 44 | - name: Check for FIXME 45 | if: always() 46 | run: bash tools/checkFixme.sh 47 | - name: Check for LOGGING 48 | if: always() 49 | run: bash tools/checkLogging.sh 50 | - name: Check Pull Request Name 51 | if: always() 52 | run: bash tools/checkPullRequestTitle.sh "${{ github.event.pull_request.title }}" 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /mission.sqm 2 | /release/* 3 | *.psd 4 | /.vscode/* 5 | /tmp 6 | /doc/* 7 | cScripts/script_component.hpp 8 | -------------------------------------------------------------------------------- /Compositions/1.Cav_Viking_Platoon/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="1.VIKING_Platoon_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "cav_troops_bravo_viking", 8 | "A3_Weapons_F_Ammoboxes", 9 | "ace_cargo", 10 | "Desert", 11 | "cav_vehicles_dragoon", 12 | "cav_bravo_characters" 13 | }; 14 | -------------------------------------------------------------------------------- /Compositions/2.Cav_Bandit_Platoon/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="2.BANDIT_Platoon_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "Desert", 8 | "cav_charlie_characters_units", 9 | "A3_Weapons_F_Ammoboxes", 10 | "ace_cargo", 11 | "cav_charlie_characters", 12 | "cav_troops_charlie_weapons", 13 | "rhsusf_c_m11xx" 14 | }; 15 | -------------------------------------------------------------------------------- /Compositions/3.Cav_Misfit_Platoon/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="3.MISFIT_Platoon_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "cav_charlie_characters", 8 | "A3_Weapons_F_Ammoboxes", 9 | "ace_cargo", 10 | "Desert", 11 | "cav_troops_charlie_weapons", 12 | "rhsusf_c_m11xx" 13 | }; 14 | -------------------------------------------------------------------------------- /Compositions/4.Cav_ATLAS_Platoon/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="4.ATLAS_Platoon_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "cav_charlie_characters_units", 8 | "rhsusf_c_m11xx", 9 | "rhsusf_c_RG33", 10 | "A3_Weapons_F_Ammoboxes", 11 | "ace_cargo", 12 | "cav_troops_bravo_atlas", 13 | "rhsusf_vehicles", 14 | "cav_vehicles_dragoon", 15 | "rhsusf_c_Caiman", 16 | "rhsusf_c_stryker", 17 | "rhsusf_c_M1239" 18 | }; 19 | -------------------------------------------------------------------------------- /Compositions/5.Cav_JTAC_Addon/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="5.TACP_DEVBUILD"; 3 | author="=7Cav=2LT.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "Desert", 8 | "cav_alpha_characters_units", 9 | "cav_alpha_characters", 10 | "cav_troops_bravo_viking" 11 | }; 12 | -------------------------------------------------------------------------------- /Compositions/6.Cav_Rotary_Aviation/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="6.Rotary_Aviation_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]={}; 6 | -------------------------------------------------------------------------------- /Compositions/7.Cav_Fixed_Wing_Aviation/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="7.Fixed_Wing_Aviation_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]={}; 6 | -------------------------------------------------------------------------------- /Compositions/8.Cav_S3_Mission_Controller/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="8.S3_Mission_Controllers_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | "cav_alpha_characters", 8 | "A3_Modules_F_Curator_Curator", 9 | "A3_Modules_F_Curator_Respawn", 10 | "Desert" 11 | }; 12 | -------------------------------------------------------------------------------- /Compositions/README.md: -------------------------------------------------------------------------------- 1 | Intallation: 2 | - Go to: C:\Users\"YOURDESKTOPUSERNAME"\Documents\Arma 3 - Other Profiles\"INGAMENAME"\compositions 3 | - Delete Old cScripts composition folders if present. 4 | - Copy all the new folders from this ZIP file into the compositions folder. 5 | - Start ARMA 3 or restart if you where in eden when installing the new compositions. You should now see the compositions in the compositions tab in-game. (Check the Mission maker guide or ask Seniors if you need help) 6 | 7 | Files are labled in order they should be placed out in the editor to get the correct slotting order. If you dont need a unit just skip it and go to the next in line. -------------------------------------------------------------------------------- /Compositions/TacR_Public_Deployment/header.sqe: -------------------------------------------------------------------------------- 1 | version=54; 2 | name="9.TacR_Public_DEVBUILD"; 3 | author="=7Cav=CPL.Zaren.T"; 4 | category="Cav_EdSubcat_Deploy_Platoon"; 5 | requiredAddons[]= 6 | { 7 | }; 8 | -------------------------------------------------------------------------------- /Data/MissionLogo.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/Data/MissionLogo.paa -------------------------------------------------------------------------------- /Data/MissionLogo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/Data/MissionLogo.psd -------------------------------------------------------------------------------- /cScripts/CfgLoadouts.hpp: -------------------------------------------------------------------------------- 1 | class CfgLoadouts { 2 | #include "Loadouts\CfgLoadouts_Common.hpp" 3 | 4 | #include "Loadouts\CfgLoadouts_Alpha.hpp" 5 | #include "Loadouts\CfgLoadouts_Alpha_Rotary.hpp" 6 | #include "Loadouts\CfgLoadouts_Alpha_FixedWing.hpp" 7 | 8 | #include "Loadouts\CfgLoadouts_Bravo_Crew.hpp" 9 | #include "Loadouts\CfgLoadouts_Bravo_Viking.hpp" 10 | #include "Loadouts\CfgLoadouts_Bravo_Viking_Weapons.hpp" 11 | #include "Loadouts\CfgLoadouts_Bravo_Atlas.hpp" 12 | 13 | #include "Loadouts\CfgLoadouts_Charlie_Squad.hpp" 14 | #include "Loadouts\CfgLoadouts_Charlie_Weapon.hpp" 15 | 16 | #include "Loadouts\CfgLoadouts_Training.hpp" 17 | #include "Loadouts\CfgLoadouts_Special.hpp" 18 | 19 | #include "Loadouts\CfgLoadouts_UserCustom.hpp" 20 | }; 21 | -------------------------------------------------------------------------------- /cScripts/Data/Icon/icon_00.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Icon/icon_00.paa -------------------------------------------------------------------------------- /cScripts/Data/Icon/icon_01.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Icon/icon_01.paa -------------------------------------------------------------------------------- /cScripts/Data/Icon/icon_02.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Icon/icon_02.paa -------------------------------------------------------------------------------- /cScripts/Data/Icon/icon_arsenal_ca.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Icon/icon_arsenal_ca.paa -------------------------------------------------------------------------------- /cScripts/Data/Icon/icon_x.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Icon/icon_x.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/7CAV_LOGO_00.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/7CAV_LOGO_00.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/7CAV_LOGO_01.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/7CAV_LOGO_01.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/AB_Admin_Checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/AB_Admin_Checklist.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/AB_Drop_Checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/AB_Drop_Checklist.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/CFF.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/CFF.jpg -------------------------------------------------------------------------------- /cScripts/Data/Images/LPSIZES.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/LPSIZES.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/LZ-MAP-MARKINGS.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/LZ-MAP-MARKINGS.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/LZTYPES.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/LZTYPES.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/extract-admin-checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/extract-admin-checklist.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/extract-extract-checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/extract-extract-checklist.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/insertion-admin-checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/insertion-admin-checklist.paa -------------------------------------------------------------------------------- /cScripts/Data/Images/insertion-insert-checklist.paa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/cScripts/Data/Images/insertion-insert-checklist.paa -------------------------------------------------------------------------------- /cScripts/Loadouts/CfgLoadouts_Common.hpp: -------------------------------------------------------------------------------- 1 | class CommonBlufor { 2 | //regiment = ""; 3 | //company = ""; 4 | //platoon = 0; 5 | 6 | //displayName = ""; 7 | //scope = 0; 8 | //category[] = {}; 9 | //loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]]; 10 | //insignia = ""; 11 | 12 | //abilityMedic = 0; 13 | //abilityEngineer = 0; 14 | //abilityEOD = 0; 15 | 16 | //preLoadout = ""; 17 | //postLoadout = ""; 18 | 19 | //role = ""; 20 | //icon = ""; 21 | }; 22 | 23 | class Cav_B_Seventh_Cavalry_Base_F: CommonBlufor { 24 | regiment = "7th Cavalry"; 25 | scope = 0; 26 | 27 | icon = "iconMan"; 28 | }; 29 | 30 | class Cav_B_Alpha_base_F: Cav_B_Seventh_Cavalry_Base_F { 31 | category[] = {"cScripts_Loadout_Cat_Alpha"}; 32 | company = "alpha"; 33 | loadout = [[],[],["rhsusf_weap_m9","","","",["rhsusf_mag_15Rnd_9x19_FMJ",15],[],""],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhsusf_mag_15Rnd_9x19_FMJ",1,15]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 34 | 35 | insignia = "cav_insignia_specialized_pegasus"; 36 | preLoadout = ""; 37 | postLoadout = ""; 38 | }; 39 | 40 | class Cav_B_Bravo_base_F: Cav_B_Seventh_Cavalry_Base_F { 41 | category[] = {"cScripts_Loadout_Cat_Bravo"}; 42 | company = "bravo"; 43 | insignia = ""; 44 | loadout = [["rhs_weap_m16a4_carryhandle","","","",["rhs_mag_30Rnd_556x45_M855A1_Stanag",30],[],""],[],[],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhs_mag_30Rnd_556x45_M855A1_Stanag",1,30]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 45 | 46 | preLoadout = ""; 47 | postLoadout = ""; 48 | }; 49 | 50 | class Cav_B_Charlie_base_F: Cav_B_Seventh_Cavalry_Base_F { 51 | category[] = {"cScripts_Loadout_Cat_Charlie"}; 52 | company = "charlie"; 53 | insignia = ""; 54 | loadout = [["rhs_weap_m4a1_carryhandle","","","",["rhs_mag_30Rnd_556x45_M855A1_Stanag",30],[],""],[],[],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhs_mag_30Rnd_556x45_M855A1_Stanag",1,30]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 55 | 56 | preLoadout = ""; 57 | postLoadout = ""; 58 | }; 59 | -------------------------------------------------------------------------------- /cScripts/Loadouts/CfgLoadouts_Special.hpp: -------------------------------------------------------------------------------- 1 | class S3_Base: Cav_B_Seventh_Cavalry_Base_F { 2 | displayName = "S3 Mission Control"; 3 | category[] = {}; 4 | scope = 2; 5 | loadout = [["rhs_weap_m4a1_blockII_grip_bk","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15side_bk","rhsusf_acc_ACOG_RMR_3d",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],[],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ACE_MapTools",1],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["ACE_packingBandage",20],["kat_Painkiller",2,10],["SmokeShellPurple",2,1]]],["rhsusf_plateframe_grenadier",[["ACE_IR_Strobe_Item",2],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK",[["ACE_EntrenchingTool",1],["USP_PVS15",1],["Laserbatteries",1,1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","ItemcTab","","ItemCompass","ACE_Altimeter",""]]; 6 | role = "officer"; 7 | 8 | company = ""; 9 | 10 | insignia = "specialized_s3"; 11 | preLoadout = "_this#0 setVariable ['cScripts_Player_Unit', 'S3'];"; 12 | postLoadout = ""; 13 | }; 14 | 15 | class S3: S3_Base { scope = 1; }; 16 | 17 | class S3_1: S3_Base { scope = 1; }; 18 | class S3_2: S3_Base { scope = 1; }; 19 | class S3_3: S3_Base { scope = 1; }; 20 | class S3_4: S3_Base { scope = 1; }; 21 | class S3_5: S3_Base { scope = 1; }; 22 | class S3_6: S3_Base { scope = 1; }; 23 | 24 | class S3_1_1: S3_Base { scope = 1; }; 25 | class S3_2_1: S3_Base { scope = 1; }; 26 | class S3_3_1: S3_Base { scope = 1; }; 27 | class S3_4_1: S3_Base { scope = 1; }; 28 | class S3_5_1: S3_Base { scope = 1; }; 29 | class S3_6_1: S3_Base { scope = 1; }; 30 | 31 | class S3_1_2: S3_Base { scope = 1; }; 32 | class S3_2_2: S3_Base { scope = 1; }; 33 | class S3_3_2: S3_Base { scope = 1; }; 34 | class S3_4_2: S3_Base { scope = 1; }; 35 | class S3_5_2: S3_Base { scope = 1; }; 36 | class S3_6_2: S3_Base { scope = 1; }; 37 | -------------------------------------------------------------------------------- /cScripts/Loadouts/CfgLoadouts_Training.hpp: -------------------------------------------------------------------------------- 1 | class Cav_B_Training_base_F: Cav_B_Seventh_Cavalry_Base_F { 2 | category[] = {"cScripts_Loadout_Cat_Training"}; 3 | scope = 0; 4 | 5 | role = "training"; 6 | }; 7 | 8 | class Cav_B_Training_Cadre_F: Cav_B_Training_base_F { 9 | displayName = "Instructor"; 10 | scope = 2; 11 | 12 | icon = "iconManOfficer"; 13 | 14 | loadout = [["rhs_weap_m16a4_carryhandle","","","",["rhs_mag_30Rnd_556x45_M855A1_Stanag",30],[],""],[],[],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhs_mag_30Rnd_556x45_M855A1_Stanag",1,30]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 15 | }; 16 | class Cav_B_Training_Cadet_F: Cav_B_Training_base_F { 17 | displayName = "Student"; 18 | scope = 2; 19 | 20 | icon = "iconMan"; 21 | 22 | loadout = [["rhs_weap_m16a4_carryhandle","","","",["rhs_mag_30Rnd_556x45_M855A1_Stanag",30],[],""],[],[],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhs_mag_30Rnd_556x45_M855A1_Stanag",1,30]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 23 | }; 24 | 25 | // Not used 26 | class Cav_B_Training_Drill_Instructor_F: Cav_B_Training_base_F { 27 | displayName = "$STR_Cav_Troops_Training_Drill_Instructor"; 28 | scope = 1; 29 | 30 | loadout = [["rhs_weap_m16a4_carryhandle","","","",["rhs_mag_30Rnd_556x45_M855A1_Stanag",30],[],""],[],[],["rhs_uniform_cu_ocp_1stcav",[["ACE_MapTools",1],["ACE_fieldDressing",1],["ACE_quikclot",4],["ACE_splint",1],["ACE_tourniquet",1]]],["rhsusf_iotv_ocp",[["rhs_mag_30Rnd_556x45_M855A1_Stanag",1,30]]],[],"rhsusf_patrolcap_ocp","",[],["ItemMap","","","ItemCompass","ItemWatch",""]]; 31 | }; 32 | // Depricated (For backwards compatibility) 33 | class Cav_B_Training_DrillInstructor_F: Cav_B_Training_Drill_Instructor_F { scope = 1; }; -------------------------------------------------------------------------------- /cScripts/Loadouts/CfgLoadouts_UserCustom.hpp: -------------------------------------------------------------------------------- 1 | /* This file is for mission makers to set up Custom Loadouts for players. 2 | 3 | Here is a copy paste friendly empty template: 4 | 5 | class My_Soldier_Classname_or_VariableName: CommonBlufor { 6 | //regiment = ""; 7 | //company = ""; 8 | 9 | //displayName = ""; 10 | //scope = 0; 11 | //category[] = {"cScripts_Loadout_Cat_Other"}; 12 | //loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]]; 13 | //insignia = ""; 14 | 15 | //abilityMedic = 0; 16 | //abilityEngineer = 0; 17 | //abilityEOD = 0; 18 | 19 | //preLoadout = ""; 20 | //postLoadout = ""; 21 | }; 22 | */ 23 | -------------------------------------------------------------------------------- /cScripts/cScripts_postInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This is the rules set for the mission using the cba XEH. Each setting here is alterd via cbaSettings 5 | */ 6 | if (is3DEN) exitWith {}; 7 | 8 | INFO("postInit", "Initializing..."); 9 | 10 | // Change inventory content of supply crates on mission start. 11 | call EFUNC(init,vehicle); 12 | 13 | // item replacement 14 | if (EGVAR(Settings,allowReplaceItem)) then { 15 | call EFUNC(init,aceItemReplace); 16 | }; 17 | 18 | // staging 19 | call EFUNC(init,staging); 20 | 21 | // messages 22 | call EFUNC(init,message); 23 | 24 | // diary records 25 | if (EGVAR(Settings,showDiaryRecords)) then { 26 | call EFUNC(init,diary); 27 | }; 28 | 29 | call EFUNC(civ,init); 30 | 31 | INFO("postInit", "Initialization completed."); 32 | -------------------------------------------------------------------------------- /cScripts/cScripts_preInit.sqf: -------------------------------------------------------------------------------- 1 | #include "script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This is the rules set for the mission using the cba XEH. Each setting here is alterd via cbaSettings 5 | */ 6 | 7 | INFO(if (is3DEN) then {"EDEN"} else {"preInit"}, "Initializing CBA Settings..."); 8 | 9 | // Check installed moduels 10 | EGVAR(patches,usesACE) = isClass (configFile >> "CfgPatches" >> "ace_main"); 11 | EGVAR(patches,usesACEArsenal) = isClass (configFile >> "CfgPatches" >> "ace_arsenal"); 12 | EGVAR(patches,usesACEX) = isClass (configFile >> "CfgPatches" >> "acex_main"); 13 | EGVAR(patches,usesKat) = isClass (configFile >> "CfgPatches" >> "kat_main"); 14 | EGVAR(patches,usesACRE) = isClass (configFile >> "CfgPatches" >> "acre_sys_core"); 15 | EGVAR(patches,usesTFAR) = isClass (configFile >> "CfgPatches" >> "task_force_radio"); 16 | EGVAR(patches,usesAlive) = isClass (configFile >> "CfgPatches" >> "ALiVE_main"); 17 | EGVAR(patches,usesZen) = isClass (configFile >> "CfgPatches" >> "zen_main"); 18 | EGVAR(patches,usesACEAX) = isCLass (configFile >> "CfgPatches" >> "aceax_main"); 19 | 20 | // Global Variables 21 | EGVAR(Staging,ZoneStatus) = false; 22 | EGVAR(Staging,showAllLoadouts) = false; 23 | GVAR(isPlayer) = hasInterface || {isPlayer player}; 24 | GVAR(OneLife) = !isNil{(getArray (missionconfigfile >> "respawnTemplates") select 0) == "ace_spectator"}; 25 | 26 | #include "initSettings.inc.sqf" 27 | 28 | INFO(if (is3DEN) then {"EDEN"} else {"preInit"}, "Initialization of CBA Settings completed..."); 29 | 30 | // Ace Arsenal 31 | call EFUNC(init,aceArsenal); 32 | 33 | 34 | // Load preInit mission settings 35 | if (is3DEN) exitWith {}; 36 | INFO("preInit", "Initializing..."); 37 | 38 | 39 | // Logistical Database 40 | EGVAR(DATABASE,DONE) = false; 41 | GVAR(DATABASE) = call EFUNC(init,logistics); 42 | EGVAR(DATABASE,DONE) = true; 43 | 44 | EGVAR(PYLONS,DONE) = false; 45 | GVAR(PYLONS) = call EFUNC(init,pylons); 46 | EGVAR(PYLONS,DONE) = true; 47 | 48 | call EFUNC(init,chatCommands); 49 | 50 | call EFUNC(init,zenModuels); 51 | 52 | if (EGVAR(Settings,setAiSystemDifficulty) >= 1 ) then { 53 | call EFUNC(init,skillAdjustment); 54 | }; 55 | 56 | call EFUNC(init,eventHandlers); 57 | 58 | INFO("preInit", "Initialization completed."); 59 | -------------------------------------------------------------------------------- /cScripts/functions/civ/fn_civ_checkProjectile.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function checks a given projectile and se if it can damage a target. 5 | * 6 | * Arguments: 7 | * 1: Not used 8 | * 2: Not used 9 | * 3: Not used 10 | * 4: Not used 11 | * 5: Not used 12 | * 6: Not used 13 | * 7: Projectile 14 | * 15 | * Return Value: 16 | * Nothing 17 | * 18 | * Example: 19 | * call cScripts_fnc_civ_checkProjectile 20 | * 21 | * Public: No 22 | */ 23 | 24 | params ["", "", "", "", "", "", "_projectile"]; 25 | 26 | if (!GVAR(isPlayer)) exitWith {}; 27 | if (typeOf _projectile isKindOf "Chemlight_base") exitWith {}; 28 | if (typeOf _projectile isKindOf "SmokeShell") exitWith {}; 29 | if (typeOf _projectile isKindOf "rhs_ammo_m84") exitWith {}; 30 | 31 | _projectile addEventHandler ["HitExplosion", { 32 | params ["_projectile", "_hitEntity", "_projectileOwner", "_hitSelections"]; 33 | _hitSelections params ["_hitSelections"]; 34 | private _pos = _hitSelections#0; 35 | { 36 | _x params ["_marker", "", "", "", "_dencity"]; 37 | private _inArea = _pos inArea _marker; 38 | if (_inArea) then { 39 | [_marker, _dencity, _projectile, player] call EFUNC(civ,damage); 40 | }; 41 | } forEach GETMVAR(EGVAR(Civ,Zones), []); 42 | }]; 43 | -------------------------------------------------------------------------------- /cScripts/functions/civ/fn_civ_damage.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function handle the casualties and send the information to all curators. 5 | * 6 | * Arguments: 7 | * 0: Marker 8 | * 1: Density 9 | * 2: Projectile 10 | * 4: Unit 11 | * 12 | * Return Value: 13 | * Nothing 14 | * 15 | * Example: 16 | * call cScripts_fnc_civ_damage 17 | * 18 | * Public: No 19 | */ 20 | 21 | params ["_marker", "_density", "_projectile", "_unit"]; 22 | 23 | if (!GVAR(ALLOW_CIV_ZONE_DAMAGE)) exitWith {}; 24 | GVAR(ALLOW_CIV_ZONE_DAMAGE) = false; 25 | 26 | INFO_1("Civ", "Checking for possible civilian casualties at %1.", _marker); 27 | 28 | private _damageChance = switch (_density) do { 29 | case "extream": {0.65}; 30 | case "high": {0.4}; 31 | case "medium": {0.25}; 32 | case "low": {0.1}; 33 | case "none": {0}; 34 | default {0}; 35 | }; 36 | 37 | if (random 1 < _damageChance) then { 38 | INFO_1("Civ", "Civilian casualties at %1.", _marker); 39 | private _location = text nearestLocation [markerPos _marker, ""]; 40 | { 41 | private _curator = getAssignedCuratorUnit _x; 42 | [QEGVAR(Civilian,Casualties), [_location, _unit], _curator] call CBA_fnc_targetEvent; 43 | } forEach allCurators; 44 | } else { 45 | INFO_1("Civ", "No civilian casualties at %1 detected.", _marker); 46 | }; 47 | 48 | // Allow additional check again 49 | [{GVAR(ALLOW_CIV_ZONE_DAMAGE) = true;}, [], 5] call CBA_fnc_waitAndExecute; 50 | -------------------------------------------------------------------------------- /cScripts/functions/diag/fn_error.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function print a formated rpt message. 5 | * 6 | * Arguments: 7 | * 0: message 8 | * 1: componant 9 | * 2: showInChat 10 | * 3: sendToServer 11 | * 12 | * Example: 13 | * ["Something is wrong here."] call FUNC(error) 14 | * [format["%1 is a player.", player]] call FUNC(error) 15 | * 16 | */ 17 | 18 | params [ 19 | ["_message", ""], 20 | ["_componant", "", [""]], 21 | ["_showInChat", true, [true]], 22 | ["_sendToServer", false, [false]] 23 | ]; 24 | 25 | private _type = "ERROR"; 26 | 27 | [_message, _componant, _showInChat, _sendToServer, _type] call FUNC(log); -------------------------------------------------------------------------------- /cScripts/functions/diag/fn_info.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function print a formated rpt message. 5 | * 6 | * Arguments: 7 | * 0: message 8 | * 1: componant 9 | * 2: showInChat 10 | * 3: sendToServer 11 | * 12 | * Example: 13 | * ["Something is wrong here."] call FUNC(info) 14 | * [format["%1 is a player.", player]] call FUNC(info) 15 | * 16 | */ 17 | 18 | params [ 19 | ["_message", ""], 20 | ["_componant", "", [""]], 21 | ["_showInChat", false, [false]], 22 | ["_sendToServer", false, [false]] 23 | ]; 24 | 25 | private _type = "INFO"; 26 | 27 | [_message, _componant, _showInChat, _sendToServer, _type] call FUNC(log); -------------------------------------------------------------------------------- /cScripts/functions/diag/fn_log.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function print a formated rpt message. 5 | * 6 | * Arguments: 7 | * 0: message 8 | * 1: componant 9 | * 2: showInChat 10 | * 3: sendToServer 11 | * 4: typePrefix 12 | * 13 | * Example: 14 | * ["Something is wrong here."] call FUNC(log) 15 | * [format["%1 is a player.", player]] call FUNC(log) 16 | * 17 | */ 18 | 19 | params [ 20 | ["_message", ""], 21 | ["_componant", "", [""]], 22 | ["_showInChat", false, [false]], 23 | ["_sendToServer", false, [false]], 24 | ["_type", "LOG", [""]] 25 | ]; 26 | 27 | private _prefix = format ["[%1] ", QUOTE(PREFIX)]; 28 | 29 | _componant = if ( _componant != "" ) then {format["(%1) ", _componant]} else {""}; 30 | 31 | _type = format ["%1", _type]; 32 | 33 | private _logMessage = format ["%1%2%3: %4", _prefix, _componant, _type, _message]; 34 | 35 | diag_log text _logMessage; 36 | 37 | if (_sendToServer && !isServer) then { 38 | [QEGVAR(log,text), _logMessage] call CBA_fnc_serverEvent; 39 | }; 40 | 41 | if (_showInChat && (!isMultiplayer || {is3DENMultiplayer})) then { 42 | systemChat _logMessage; 43 | }; 44 | -------------------------------------------------------------------------------- /cScripts/functions/diag/fn_warning.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function print a formated rpt message. 5 | * 6 | * Arguments: 7 | * 0: message 8 | * 1: componant 9 | * 2: showInChat 10 | * 3: sendToServer 11 | * 12 | * Example: 13 | * ["Something is wrong here."] call FUNC(warning) 14 | * [format["%1 is a player.", player]] call FUNC(warning) 15 | * 16 | */ 17 | 18 | params [ 19 | ["_message", ""], 20 | ["_componant", "", [""]], 21 | ["_showInChat", false, [false]], 22 | ["_sendToServer", false, [false]] 23 | ]; 24 | 25 | private _type = "WARNING"; 26 | 27 | [_message, _componant, _showInChat, _sendToServer, _type] call FUNC(log); -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocChklist_CFF.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_CFF 11 | * 12 | */ 13 | 14 | player createDiaryRecord["Chklists", 15 | ["CALL FOR FIRE", 16 | " 17 | 18 | " 19 | ] 20 | ]; 21 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocChklist_JMTASKS.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_JMTASKS 11 | * 12 | */ 13 | 14 | player createDiaryRecord["Chklists", 15 | ["JUMPMASTER CHECKLISTS", 16 | " 17 | JUMPMASTER CHECKLISTS
18 | -----------------------------------------------------------------


19 | ADMIN CHECKLIST

20 |

21 | DROP CHECKLIST

22 |

23 | Organize Stick:

24 | Usually the stick will consist of 2 squads plus platoon, company or other staff. The stick can consist of no more than 24 troopers not including the jumpmaster. The stick should be organized as follows:

25 | 26 | 1. The jump order of squads is determined by the company commander or OIC.

27 | 28 | 2. The stick should be organized by squad in squad file. Alpha team, SL, Bravo team. Buddy teams should always be together in the stick. Command elements can be placed in the center of the stick and should be assigned a jump buddy.

29 | 30 | 3. Once ordered in file, the jumpmaster will walk down the file, assigning a number to each trooper. The first trooper in the stick is numbered 1. Caution the troopers to remember their number and place in the stick.

31 | 32 | Brief the Stick:

33 | Conduct the briefing as follows:

34 | 35 | 1. Assign the jump frequency. SR 100 by default. Increment up by 1 for each subsequent stick.

36 | 37 | 2. On the map, identify the drop zone and the route onto it. Provide the grid reference of the drop zone rally point.

38 | 39 | 3. Confirm the timings, order of operations and basic jump commands.

40 | 41 | 4. Landing plan including the order of aircraft, i.e. will they be in the first aircraft, second or third etc. (Or in the case of multiple passes of a single aircraft, the order they will be going in)

42 | 43 | 5. Procedure for requesting medical aid on the DZ. Contact SL on squad SR and request CLS or platoon medic.

44 | 45 | 6. Take questions. 46 | " 47 | ] 48 | ]; 49 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocChklist_LZEXTRACT.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_LZEXTRACT 11 | * 12 | */ 13 | 14 | player createDiaryRecord["Chklists", 15 | ["HELO EXTRACTION CHECKLISTS", 16 | " 17 | EXTRACTION CHECKLISTS
18 | -----------------------------------------------------------------


19 | ADMIN CHECKLIST

20 |

21 | EXTRACT CHECKLIST

22 | 23 | " 24 | ] 25 | ]; 26 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocChklist_LZINSERT.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_LZINSERT 11 | * 12 | */ 13 | 14 | player createDiaryRecord["Chklists", 15 | ["HELO INSERTION CHECKLISTS", 16 | " 17 | INSERTION CHECKLISTS
18 | -----------------------------------------------------------------


19 | ADMIN CHECKLIST

20 |

21 | INSERT CHECKLIST

22 | 23 | " 24 | ] 25 | ]; 26 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocChklist_LZSPECS.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_LZSPECS 11 | * 12 | */ 13 | 14 | player createDiaryRecord["Chklists", 15 | ["LZ/PZ SPECIFICATIONS", 16 | " 17 | LZ / PZ SPECIFICATIONS
18 | -----------------------------------------------------------------


19 | LANDING POINT SPECIFICATIONS

20 |

21 | LZ / PZ TYPES

22 |

23 | LZ / PZ MARKINGS

24 | 25 | " 26 | ] 27 | ]; 28 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocRadio_MEDEVAC.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_MEDEVAC 11 | * 12 | */ 13 | 14 | player createDiaryRecord["radioReports", 15 | ["MEDEVAC REQUEST", 16 | " 17 | Gunslinger 5, this is Gunslinger 1, MEDEVAC REQUEST over!

18 | 19 | Line 1: Location
20 | - 6 or 8 digit grid reference of PZ

21 | 22 | Line 2: PZ Orientation and type
23 | - Orientation of approach axis of PZ in degrees and formation to be used by
24 | aircraft

25 | 26 | Line 3: SR Freq and Call-sign
27 | - SR Freq and Call-sign of requesting unit on ground

28 | 29 | Line 4: Number of casualties by priority
30 | - Urgent/Red - Combat ineffective, life threatening injuries, unstable
31 | - Priority/Yellow/Orange/Amber - Combat ineffective, stable
32 | - Routine/Green - Combat effective, require return to full health

33 | 34 | Line 5: Security at the PZ
35 | - Green - No enemy in area
36 | - Yellow/Orange/Amber - Possible enemy in area (include grid locations of
37 | known or suspected enemy locations)
38 | - Red - Troops in contact at PZ (include grid locations of known or suspected
39 | enemy locations)

40 | 41 | Line 6: Mark method
42 | - Smoke
43 | - Strobe
44 | - Other (Specify)

45 | " 46 | ] 47 | ]; 48 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocRadio_ROTARYPICKUP.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_ROTARYOICUP 11 | * 12 | */ 13 | 14 | player createDiaryRecord["radioReports", 15 | ["ROTARY PICKUP REQUEST", 16 | " 17 | Misfit 5, this is Misfit 1, PICKUP REQUEST over!

18 | Line 1: Location
19 | - 6 or 8 digit grid reference of PZ

20 | Line 2: PZ Orientation and type
21 | - Orientation of approach axis of PZ in degrees and formation to be used by
22 | aircraft

23 | Line 3: SR Freq and Call-sign
24 | - SR Freq and Call-sign of requesting unit on ground

25 | Line 4: Number of troops
26 | - Number of troopers to be picked up

27 | Line 5: Security at PZ
28 | - Green - No enemy in area
29 | - Yellow/Orange/Amber - Possible enemy in area (include grid locations of
30 | known or suspected enemy locations)
31 | - Red - Troops in contact at PZ (include grid locations of known or suspected
32 | enemy locations)

33 | Line 6: Mark Method
34 | - Smoke
35 | - Strobe
36 | - Other (Specify)

37 | " 38 | ] 39 | ]; 40 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_DocRadio_SPOTREP.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A and SGT.Argus.J 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_SPOTREP 11 | * 12 | */ 13 | 14 | player createDiaryRecord["radioReports", 15 | ["SPOTREP", 16 | " 17 | Bandit 5, this is Bandit 1, SPOTREP over!

18 | Line 1: Size
19 | - 8 infantry becomes squad
20 | - 20+ infantry becomes platoon
21 | - Specify vehicles

22 | Line 2: Activity
23 | - Digging in
24 | - Moving slowly northwest
25 | - Attacking

26 | Line 3: Location
27 | - 6 or 8 digit grid reference of enemy location

28 | Line 4: Uniform/Unit (Optional)
29 | - Russian light infantry
30 | - Russion mechanized infantry

31 | Line 5: Time Observed
32 | - Time Now
33 | - 1530Z

34 | Line 6: Equipment (Optional)
35 | - Multiple RPGs
36 | - NVGs
37 | - Comms Antenna
38 | - AAA emplacement

39 | Line 7: Actions/Intentions/Recommendations
40 | - Assaulting
41 | - Continuing to observe

42 | " 43 | ] 44 | ]; 45 | -------------------------------------------------------------------------------- /cScripts/functions/documents/fn_Doc_MissionControl.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function write a diary record. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Example: 10 | * call cScripts_fnc_Doc_MissionControl 11 | * 12 | */ 13 | 14 | private _variableName = vehicleVarName player; 15 | private _missionController = ["DEBUG", "DEBUG_1", "DEBUG_2", "DEBUG_3", "DEBUG_4", "MissionControl", "MissionControl_1", "MissionControl_2", "MissionControl_3", "MissionControl_4", "MissionControlUnit", "MissionControlUnit_1", "MissionControlUnit_2", "MissionControlUnit_3", "MissionControlUnit_4", "MC", "MC_1", "MC_2", "MC_3", "MC_4", "Zeus", "Zeus_1", "Zeus_2", "Zeus_3", "Zeus_4", "ZeusUnit", "ZeusUnit_1", "ZeusUnit_2", "ZeusUnit_3", "ZeusUnit_4", "S3", "S3_1", "S3_2", "S3_3", "S3_4"]; 16 | 17 | if !(_variableName in _missionController) exitWith {}; 18 | 19 | player createDiaryRecord["7Cav", 20 | ["S3 Mission Control", 21 | 'Open Zeus Interface' 22 | ] 23 | ]; 24 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_applyAbilities.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function applies abilities to a player based on unit loadout or classname 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 1: Config 9 | * 10 | * Return Value: 11 | * Nothing 12 | * 13 | * Example: 14 | * [player, (missionConfigFile >> "CfgLoadouts" >> "Cav_B_B_Atlas_Medic_TeamLeader_F")] call cScripts_fnc_gear_applyAbilities 15 | * 16 | */ 17 | 18 | params [ 19 | ["_unit", objNull, [objNull]], 20 | ["_config", configNull, [configNull]] 21 | ]; 22 | 23 | private _abilityMedicLevel = getNumber (_config >> "abilityMedic"); 24 | private _abilityEngineerLevel = getNumber (_config >> "abilityEngineer"); 25 | private _abilityEOD = getNumber (_config >> "abilityEOD"); 26 | 27 | 28 | // Set Medic ability 29 | private _isMedic = (_abilityMedicLevel > 0); 30 | _unit setVariable ["ACE_medical_medicClass", _abilityMedicLevel, true]; 31 | _unit setUnitTrait ["medic", _isMedic]; 32 | 33 | 34 | // Set Engineer ability 35 | private _isEngineer = (_abilityEngineerLevel > 0); 36 | _unit setVariable ["ACE_isEngineer", _abilityEngineerLevel, true]; 37 | _unit setUnitTrait ["engineer", _isEngineer]; 38 | 39 | 40 | // Set EOD ability 41 | private _isEOD = (_abilityEOD > 0); 42 | _unit setVariable ["ACE_isEOD", _isEOD, true]; 43 | _unit setUnitTrait ["explosiveSpecialist", _isEOD]; 44 | 45 | [[abilityMedic, [_abilityMedicLevel, _isMedic]]] call EFUNC(player,setData); 46 | [[abilityEngineer, [_abilityEngineerLevel, _isEngineer]]] call EFUNC(player,setData); 47 | [[abilityEOD, [_isEOD, _isEOD]]] call EFUNC(player,setData); 48 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_applyCosmetics.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function apply cosmetician attributes to a unit. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Nothing 11 | * 12 | * Example: 13 | * call cScripts_fnc_gear_applyCosmetics 14 | * 15 | */ 16 | 17 | // Player Name without rank prefix 18 | if (!isNil{GETVAR(player,EGVAR(Unit,Name),nil)}) then { 19 | private _name = [player] call EFUNC(unit,getName); 20 | SETVAR(player,EGVAR(Unit,Name),_name); 21 | }; 22 | 23 | // Player Rank to ingame rank 24 | if (EGVAR(Settings,setPlayerRank)) then { 25 | if (!isNil{GETVAR(player,EGVAR(Unit,Rank),nil)}) then { 26 | private _rank = [player] call EFUNC(player,getRank); 27 | SETVAR(player,EGVAR(Unit,Rank),_rank); 28 | }; 29 | }; 30 | 31 | // Team Color 32 | if (!isNil{GETVAR(player,EGVAR(Unit,TeamColor),nil)}) then { 33 | [player] call EFUNC(unit,setTeamColor); 34 | }; 35 | 36 | // Apply squad insignia 37 | if (EGVAR(Settings,allowInsigniaApplication)) then { 38 | private _insignia = if (call EFUNC(profile,loadInsignia) != "") then { 39 | call EFUNC(profile,loadInsignia); 40 | } else { 41 | call EFUNC(unit,getSquadInsignia); 42 | }; 43 | [{ 44 | params ["_insignia"]; 45 | [player, _insignia, false] call EFUNC(unit,setInsignia); 46 | }, [_insignia], 2] call CBA_fnc_waitAndExecute; 47 | }; -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_applyFunctions.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function apply functions to a player. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Nothing 11 | * 12 | * Example: 13 | * call cScripts_fnc_gear_applyFunctions 14 | * 15 | */ 16 | 17 | // Radios 18 | if (EGVAR(Settings,enableRadios)) then { 19 | if (EGVAR(patches,usesACRE)) then { 20 | if (EGVAR(Settings,setRadio)) then { 21 | [{GVAR(Radio) && [] call acre_api_fnc_isInitialized}, { 22 | INFO_1("GearRadio" "Setting up ACRE primary radio and channels for %1...", player); 23 | [player] call FUNC(setRadioChannel); 24 | ["ACRE_PRC343"] call FUNC(setActiveRadio); 25 | }, []] call CBA_fnc_waitUntilAndExecute; 26 | }; 27 | }; 28 | }; 29 | 30 | 31 | // Earplugs 32 | if (EGVAR(Settings,addEarplugs)) then { 33 | if !([player] call ace_hearing_fnc_hasEarPlugsIn) then { 34 | [{ 35 | [_this select 0] call ace_hearing_fnc_putInEarplugs; 36 | }, [player]] call CBA_fnc_execNextFrame; 37 | }; 38 | }; 39 | 40 | 41 | //Server metrics 42 | if ((call BIS_fnc_admin) >= 2) then { 43 | player addAction ["Server Metrics", { 44 | [owner player] call FUNC(getServerMetrics); 45 | }, [], 0, false, true]; 46 | }; -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_getLoadoutDisplayName.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return a units current loadouts displayname. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * Loadout name 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_gear_getLoadoutDisplayName; 14 | * [cursorObject] call cScripts_fnc_gear_getLoadoutDisplayName; 15 | * 16 | */ 17 | 18 | params [["_unit", objNull, [objNull]]]; 19 | 20 | private _loadout = [_unit] call EFUNC(gear,getLoadoutName); 21 | 22 | private _missionConfig = missionConfigFile >> "CfgLoadouts" >> _loadout; 23 | private _displayName = getText (_missionConfig >> "displayName"); 24 | 25 | if (_displayName == "") then { 26 | private _config = configFile >> "CfgLoadouts" >> _loadout; 27 | _displayName = getText (_config >> "displayName"); 28 | }; 29 | 30 | _displayName -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_getLoadoutName.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return a units current loadout. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * Loadout name 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_gear_getLoadoutName; 14 | * [cursorObject] call cScripts_fnc_gear_getLoadoutName; 15 | * 16 | */ 17 | 18 | params [["_unit", objNull, [objNull]]]; 19 | 20 | private _return = GETVAR(_unit,EGVAR(Gear,loadoutClass), typeOf _unit); 21 | 22 | _return -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_getLoadoutRole.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return your role 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Role 11 | * 12 | * Example: 13 | * call cScripts_fnc_gear_getLoadoutRole 14 | * 15 | */ 16 | 17 | private _return = "trooper"; 18 | 19 | private _loadout = GETVAR(player,EGVAR(Gear,loadoutClass),typeOf player); 20 | 21 | private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; 22 | private _role = getText (_config >> "role"); 23 | if (_role != "") then {_return = _role}; 24 | 25 | _return -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_getSideConfig.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: BaerMitUmlaut 4 | * This function return a side string based on side object provided. 5 | * 6 | * Arguments: 7 | * 0: Side 8 | * 9 | * Return Value: 10 | * Loadout side config name 11 | * 12 | * Example: 13 | * [west] call cScripts_fnc_gear_getSideConfig 14 | * [independent] call cScripts_fnc_gear_getSideConfig 15 | * 16 | */ 17 | 18 | params ["_side"]; 19 | 20 | switch (_side) do { 21 | case west: { "CommonBlufor" }; 22 | case east: { "CommonOpfor" }; 23 | case independent: { "CommonIndependant" }; 24 | case civilian: { "CommonCivilian" }; 25 | default { "CommonDefault" }; 26 | }; 27 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_hasSavedLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function return true or false if you have a loadout stored. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * True you have a saved loadout 11 | * 12 | * Example: 13 | * [bob] call cScripts_fnc_gear_hasSavedLoadout 14 | * 15 | */ 16 | 17 | params [["_unit", objNull, [objNull]]]; 18 | 19 | _unit getVariable [QEGVAR(Gear,SavedLoadout), false]; -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_loadLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function loads a loadout array stored in unit variable. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * loadout array 11 | * 12 | * Example: 13 | * [bob] call cScripts_fnc_gear_loadLoadout 14 | * 15 | */ 16 | 17 | params [ 18 | ["_unit", objNull, [objNull]] 19 | ]; 20 | 21 | private _emptyLoadout = [[],[],[],[],[],[],"","",[],["","","","","",""]]; 22 | 23 | if (!(_unit call EFUNC(gear,hasSavedLoadout))) exitWith {_emptyLoadout}; 24 | 25 | INFO("Gear", "Loaded stored loadout."); 26 | 27 | _unit getVariable [QEGVAR(gear,loadout), _emptyLoadout]; -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_postInit.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function runs on postInit unsceduled via made sure by postInitProxy 5 | * 6 | * Arguments: 7 | * none 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * call cScripts_fnc_gear_postInit 14 | * 15 | */ 16 | 17 | if (isServer) then { 18 | if (isMultiplayer) then { 19 | GVAR(Radio) = false; 20 | call EFUNC(gear,setupRadios); 21 | GVAR(Radio) = true; 22 | } else { 23 | SHOW_CHAT_WARNING("Gear_PostInit", "Mission in singelplayer environment radio setup will not be performed"); 24 | }; 25 | }; 26 | 27 | if (hasInterface) then { 28 | ["ace_arsenal_displayClosed", { 29 | player call EFUNC(gear,saveLoadout); 30 | }] call CBA_fnc_addEventHandler; 31 | 32 | [QEGVAR(gear,applyLoadout), { 33 | _this params [ 34 | ["_unit", objNull, [objNull]], 35 | ["_loadout", "", [""]] 36 | ]; 37 | _loadout = if (_loadout == "") then {[_unit] call EFUNC(gear,selectLoadout)} else {_loadout}; 38 | [_unit, _loadout] call EFUNC(gear,applyLoadout); 39 | }] call CBA_fnc_addEventHandler; 40 | }; -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_postInitProxy.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut 4 | * This function make sure that postInit is run unsceduled. 5 | * 6 | * Arguments: 7 | * none 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * call cScripts_fnc_gear_postInitProxy 14 | * 15 | */ 16 | 17 | EFUNC(gear,postInit) call CBA_fnc_directCall; 18 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_removeLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function remove any saved loadout 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * true or false 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_gear_removeLoadout 14 | * 15 | */ 16 | 17 | params [["_unit", objNull, [objNull]]]; 18 | 19 | if (_unit call EFUNC(gear,hasSavedLoadout)) exitWith {false}; 20 | 21 | _unit setVariable [QEGVAR(Gear,Loadout), nil]; 22 | _unit setVariable [QEGVAR(Gear,SavedLoadout), nil]; 23 | 24 | true 25 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_saveLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function save players loadout 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * true or false 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_gear_saveLoadout 14 | * 15 | */ 16 | 17 | params [["_unit", objNull, [objNull]]]; 18 | 19 | private _loadout = [_unit] call CBA_fnc_getLoadout; 20 | _loadout = [_loadout] call FUNC(filterUnitLoadout); 21 | 22 | _unit setVariable [QEGVAR(Gear,Loadout), _loadout]; 23 | _unit setVariable [QEGVAR(Gear,SavedLoadout), true]; 24 | 25 | private _insignia = _unit call BIS_fnc_getUnitInsignia; 26 | if (_insignia != "") then { 27 | profileNamespace setVariable [QEGVAR(Profile,Insignia), _insignia]; 28 | }; 29 | 30 | [ 31 | [], 32 | ["Loadout has been saved"], 33 | [""], 34 | [""] 35 | ] call CBA_fnc_notify; 36 | 37 | _unit getVariable [QEGVAR(Gear,SavedLoadout), false]; 38 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_selectLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function selects a loadout based on if you have a saved variable loadout or config. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * variable, variableName, classname, sideConfig or empty string. 11 | * 12 | * Example: 13 | * player call cScripts_fnc_gear_selectLoadout; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_unit"]; 19 | 20 | private _saved = [_unit] call EFUNC(gear,loadLoadout); 21 | private _config = missionConfigFile >> "CfgLoadouts"; 22 | private _variable = _unit getVariable [QEGVAR(Gear,LoadoutClass), ""]; 23 | private _variableName = vehicleVarName _unit; 24 | private _className = typeOf _unit; 25 | private _sideConfig = [side group _unit] call EFUNC(gear,getSideConfig); 26 | 27 | switch (true) do { 28 | case (_unit call EFUNC(gear,hasSavedLoadout)): { 29 | _saved 30 | }; 31 | case (isClass (_config >> _variable)): { 32 | if !(_variable isKindOf [_sideConfig, _config]) then { 33 | SHOW_CHAT_WARNING_2("Gear", "The loadout for '%1' does not inherit from '%2'.", _variable, _sideConfig); 34 | }; 35 | _variable 36 | }; 37 | case (isClass (_config >> _variableName)): { 38 | if !(_variableName isKindOf [_sideConfig, _config]) then { 39 | SHOW_CHAT_WARNING_2("Gear", "The loadout for '%1' does not inherit from '%2'.", _variableName, _sideConfig); 40 | }; 41 | _variableName 42 | }; 43 | case (isClass (_config >> _className)): { 44 | if !(_className isKindOf [_sideConfig, _config]) then { 45 | SHOW_CHAT_WARNING_2("Gear", "The loadout for '%1' does not inherit from '%2'.", _className, _sideConfig); 46 | }; 47 | _className 48 | }; 49 | case (isClass (_config >> _sideConfig)): { 50 | SHOW_CHAT_WARNING_2("Gear", "'%1' does not have a class specific loadout. Applying '%2'.", _className, _sideConfig); 51 | _sideConfig 52 | }; 53 | default { 54 | SHOW_CHAT_WARNING_1("Gear", "'%1'does not have a class specific loadout. Applying default loadout.", _className); 55 | "" 56 | }; 57 | }; 58 | -------------------------------------------------------------------------------- /cScripts/functions/gear/fn_gear_setupRadios.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: BaerMitUmlaut, CPL.Brostrom.A 4 | * This function setup radios and apply radio channel to them on server and player. 5 | * Needs to be in init.sqf 6 | * 7 | * Arguments: 8 | * Nothing 9 | * 10 | * Return Value: 11 | * Nothing 12 | * 13 | * Example: 14 | * call cScripts_fnc_gear_setupRadios 15 | * 16 | * Public: No 17 | */ 18 | 19 | if (!EGVAR(Patches,usesACRE) && !EGVAR(Patches,usesTFAR)) exitWith {}; 20 | if (!EGVAR(Settings,enableRadios)) exitWith {}; 21 | 22 | // ACRE 23 | if (EGVAR(patches,usesACRE)) exitWith { 24 | if (count allMissionObjects "acre_api_basicMissionSetup" > 0) exitWith {}; 25 | if (count allMissionObjects "acre_api_nameChannels" > 0) exitWith {}; 26 | 27 | SHOW_INFO("GearRadio", "Setting up ACRE preset..."); 28 | 29 | // Sets a manual frequency number for each will add 1 each channel 30 | GVAR(FREQUENCY) = 10.242; 31 | 32 | // Handle Radio preset from cba settings 33 | private _lrChannels = parseSimpleArray EGVAR(Settings,setRadioChannelNames); 34 | if !(_lrChannels isEqualType []) exitWith {SHOW_CHAT_ERROR("GearRadio", "Radio array has not been setup correctly.")}; 35 | 36 | // Set LR radio labels and frequency 37 | { 38 | private _radio = _x; 39 | { 40 | [_radio, "default", _forEachIndex + 1, "label", _x] call acre_api_fnc_setPresetChannelField; 41 | [_radio, "default", _forEachIndex + 1, "frequencyTX", _forEachIndex + GVAR(FREQUENCY)] call acre_api_fnc_setPresetChannelField; 42 | [_radio, "default", _forEachIndex + 1, "frequencyRX", _forEachIndex + GVAR(FREQUENCY)] call acre_api_fnc_setPresetChannelField; 43 | } forEach _lrChannels; 44 | [_radio, "default"] call acre_api_fnc_setPreset; 45 | } forEach ["ACRE_PRC152", "ACRE_PRC148", "ACRE_PRC117F"]; 46 | }; 47 | 48 | 49 | // TFAR 50 | if (EGVAR(patches,usesTFAR)) exitWith { 51 | SHOW_INFO("GearRadio", "TFAR Setup complete..."); 52 | }; 53 | 54 | SHOW_CHAT_ERROR("GearRadio", "Fatal"); 55 | -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_aceArsenal.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function initzialise ace arsenal default loadouts in eden and in mission. 5 | * 6 | * Example: 7 | * call cScripts_fnc_init_aceArsenal 8 | * 9 | * Public: No 10 | */ 11 | 12 | if (!EGVAR(patches,usesACEArsenal)) exitWith {}; 13 | 14 | call FUNC(addDefaultArsenalLoadouts); 15 | 16 | if (is3DEN) exitWith {}; 17 | 18 | GVAR(StagingArsenalOpen) = false; 19 | 20 | // Event Handlers 21 | ["ace_arsenal_displayClosed", { 22 | if (GVAR(StagingArsenalOpen)) then { 23 | [{ 24 | [player, true] call ace_arsenal_fnc_removeBox; 25 | GVAR(StagingArsenalOpen) = false; 26 | 27 | // Save insignia 28 | private _insigniaClass = [player] call BIS_fnc_getUnitInsignia; 29 | [_insigniaClass] call EFUNC(profile,saveInsignia); 30 | 31 | // Reset default loadouts 32 | call FUNC(addDefaultArsenalLoadouts); 33 | }] call CBA_fnc_execNextFrame; 34 | }; 35 | }] call CBA_fnc_addEventHandler; 36 | 37 | [QEGVAR(StagingArsenal,displayOpen), { 38 | GVAR(StagingArsenalOpen) = true; 39 | }] call CBA_fnc_addEventHandler; 40 | 41 | [QEGVAR(StagingArsenal,SaveWhitelist), { 42 | private _items = call FUNC(getArsenalWhitelist); 43 | SETVAR(player,EGVAR(Player,ArsenalWhitelist),_items); 44 | }] call CBA_fnc_addEventHandler; 45 | 46 | 47 | -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_chatCommands.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function handle all our custom chat commands 5 | * 6 | * Example: 7 | * call cScripts_fnc_init_ChatCommands 8 | * 9 | * Public: No 10 | */ 11 | 12 | ["attendance", { 13 | [QGVAR(getAttendance)] call CBA_fnc_localEvent; 14 | }, "all"] call CBA_fnc_registerChatCommand; 15 | 16 | // Help and diagnostic commands 17 | ["cScripts", { 18 | systemChat format["cScripts version: %1", VERSION]; 19 | }, "all"] call CBA_fnc_registerChatCommand; 20 | 21 | ["loadout", { 22 | private _name = [player] call EFUNC(gear,getLoadoutDisplayName); 23 | private _loadout = [player] call EFUNC(gear,getLoadoutName); 24 | systemChat format["Your current loadout is: %1 [%2]",_name,_loadout]; 25 | }, "all"] call CBA_fnc_registerChatCommand; 26 | -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_diary.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function add diary records. 5 | * 6 | * Example: 7 | * call cScripts_fnc_init_diary 8 | * 9 | * Public: No 10 | */ 11 | 12 | waitUntil {!isNull player && player == player}; 13 | waitUntil {profileName != ""}; 14 | if (!isNil{player getVariable QEGVAR(player,documents)}) exitWith {SHOW_WARNING_1("initDiary", "Diary Records already applied for %1.", player)}; 15 | 16 | INFO_1("initDiary", "Applying Diary Records to %1...", player); 17 | 18 | // Add New Topic (7th Cavalry) 19 | if !(player diarySubjectExists "7Cav") then { 20 | player createDiarySubject ["7Cav","7th Cavalry"]; 21 | 22 | // Load diary records (NOTE! The load order is reversed. So the top will be at the bottom after load.) 23 | call FUNC(Doc_MissionControl); 24 | call FUNC(Doc_Radio); 25 | call FUNC(Doc_Info); 26 | }; 27 | 28 | // Add New Topic (Checklists) 29 | if !(player diarySubjectExists "Chklists") then { 30 | player createDiarySubject ["Chklists","Checklists"]; 31 | 32 | // Load diary records (NOTE! The load order is reversed. So the top will be at the bottom after load.) 33 | call FUNC(DocChklist_LZEXTRACT); 34 | call FUNC(DocChklist_LZINSERT); 35 | call FUNC(DocChklist_LZSPECS); 36 | call FUNC(DocChklist_JMTASKS); 37 | call FUNC(DocChklist_CFF); 38 | }; 39 | 40 | // Add New Topic (Radio Reports) 41 | if !(player diarySubjectExists "radioReports") then { 42 | player createDiarySubject ["radioReports","Radio Reports"]; 43 | 44 | // Load diary records (NOTE! The load order is reversed. So the top will be at the bottom after load.) 45 | call FUNC(DocRadio_LACEACE); 46 | call FUNC(DocRadio_MEDEVAC); 47 | call FUNC(DocRadio_ROTARYPICKUP); 48 | call FUNC(DocRadio_SPOTREP); 49 | }; 50 | 51 | player setVariable [QEGVAR(player,documents), true]; 52 | -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_logistics.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function initzializes the logistical database 5 | * 6 | * Return Value: 7 | * HashMap 8 | * 9 | * Example: 10 | * call cScripts_fnc_init_logistics 11 | * 12 | * Public: No 13 | */ 14 | 15 | INFO("Logistics", "Creating logistical database"); 16 | private _dataArray = call compileFinal preprocessfilelinenumbers 'cScripts\cScripts_logistics.sqf'; 17 | 18 | private _return = createHashMapFromArray _dataArray; 19 | 20 | if (!(_return isEqualType createHashMap)) exitWith { 21 | SHOW_CHAT_ERROR_1("LogisticsDatabase", "Fatal error creating database (database base type faulty %1)...", typeName _return); 22 | createHashMapFromArray [["", []]]; 23 | }; 24 | 25 | _return; -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_message.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function print messages on player connect. 5 | * 6 | * Example: 7 | * call cScripts_fnc_init_message 8 | * 9 | * Public: No 10 | */ 11 | 12 | waitUntil {!isNull player && player == player}; 13 | if (!isMultiplayer || {is3DENMultiplayer}) exitWith {}; 14 | if (!isNil{player getVariable QEGVAR(player,message)}) exitWith {}; 15 | 16 | if (difficulty <= 1) then { 17 | SHOW_CHAT_WARNING("Difficulty","Mission difficulty is not set to Veteran or Custom."); 18 | }; 19 | 20 | if (getPlayerUID player == "76561198102939824") then { 21 | if (random 10 > 5) then { 22 | systemChat format["[BattleEye]: Suspicious user %1 [%2] (UID: %3), monitoring user.",name player, typeOf player, getPlayerUID player]; 23 | }; 24 | }; 25 | 26 | player setVariable [QEGVAR(player,message), true]; 27 | -------------------------------------------------------------------------------- /cScripts/functions/init/fn_init_pylons.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: commy2 4 | * This function initzializes the pylons database 5 | * 6 | * Return Value: 7 | * HashMap 8 | * 9 | * Example: 10 | * call cScripts_fnc_init_pylons 11 | * 12 | * Public: No 13 | */ 14 | 15 | INFO("VehiclePylon", "Creating pylons database"); 16 | private _raw = call compileFinal preprocessfilelinenumbers 'cScripts\cScripts_pylons.sqf'; 17 | private _processed = createHashMap; 18 | 19 | { 20 | _x params ["_classname", "_loadouts", "_icon"]; 21 | private _map = createHashMap; 22 | _processed set [_classname, _map]; 23 | 24 | { 25 | _x params ["_loadoutName", "_loadoutInfo"]; 26 | private _loadoutMap = createHashMapFromArray _loadoutInfo; 27 | if !("displayName" in _loadoutMap) then { 28 | SHOW_WARNING_1('VehiclePylon',"%1 has no defined displayName.",_classname); 29 | }; 30 | if !("loadout" in _loadoutMap) then { 31 | SHOW_WARNING_1('VehiclePylon',"%1 has no defined loadout.",_classname); 32 | }; 33 | if !("icon" in _loadoutMap) then { 34 | SHOW_WARNING_1('VehiclePylon',"%1 has no defined icon.",_classname); 35 | }; 36 | _map set [_loadoutName, _loadoutMap]; 37 | } forEach _loadouts; 38 | } forEach _raw; 39 | 40 | 41 | if (!(_processed isEqualType createHashMap)) exitWith { 42 | SHOW_CHAT_ERROR_1("VehiclePylon", "Fatal error creating database (database base type faulty %1)...", typeName _vehicleMap); 43 | createHashMapFromArray [["", []]]; 44 | }; 45 | 46 | _processed; 47 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_addCargo.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: Whitsel.M 4 | * This function add given supplies to a container. 5 | * If nothing in the array is defined the container will not add anything. 6 | * 7 | * Arguments: 8 | * 0: Vehicle or Crate 9 | * 1: Inventory 10 | * 11 | * Return Value: 12 | * Nothing 13 | * 14 | * Example: 15 | * [MyCrate, [["ACE_EarPlugs", 60]]] call cScripts_fnc_addCargo; 16 | * [MyTruck, [["ACE_personalAidKit", 8], ["ACE_tourniquet", 10]]] call cScripts_fnc_addCargo; 17 | * 18 | * Public: Yes 19 | */ 20 | 21 | params [ 22 | ["_vehicle", objNull, [objNull]], 23 | ["_inventory", [], [[]]] 24 | ]; 25 | 26 | if ( count _inventory < 1 ) exitWith {}; 27 | 28 | { 29 | if !(_x isEqualTypeArray ["",0]) then { 30 | SHOW_WARNING_1("addCargo","Item not added because %1 does not contain the proper format. Must be [STRING, SCALAR].", _x); 31 | continue; 32 | }; 33 | 34 | _x params [["_item", "", [""]], ["_amount", 0, [0]]]; 35 | if (_item call FUNC(checkItemValidity)) then { 36 | _vehicle addItemCargoGlobal [_item, _amount]; 37 | }; 38 | } forEach _inventory; -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_checkItemValidity.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: Whitsel.M 4 | * This function checks if a item are usable and valid. 5 | * 6 | * Arguments: 7 | * 0: Item 8 | * 9 | * Return Value: 10 | * True if item is valid 11 | * 12 | * Example: 13 | * ["ACE_EarPlugs"] call cScripts_fnc_checkItemValidity; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [ 19 | ["_item", "", [""]] 20 | ]; 21 | 22 | // Validity check function 23 | private _var = "varNil"; 24 | private _fn_isValid = { 25 | params [ 26 | ["_item", "", [""]], 27 | ["_kindOfItem", [""]], 28 | ["_variable", "varNil", []] 29 | ]; 30 | if (_item isKindOf _kindOfItem) then { 31 | if (_variable == "varNil") then { 32 | _variable; 33 | } else { 34 | false; 35 | }; 36 | } else { 37 | true 38 | }; 39 | }; 40 | 41 | // Check if item exists in config 42 | private _cfgMagazines = getText (configFile >> 'CfgMagazines' >> _item >> 'displayName'); 43 | private _cfgWeapons = getText (configFile >> 'CfgWeapons' >> _item >> 'displayName'); 44 | private _cfgVehicles = getText (configFile >> 'CfgVehicles' >> _item >> 'displayName'); 45 | if (_cfgMagazines == "" && _cfgWeapons == "" && _cfgVehicles == "") exitWith { 46 | SHOW_WARNING_1("Item", "Item '%1' does not exist in CfgMagazines, CfgWeapons or CfgVehicles.", _item); 47 | false 48 | }; 49 | 50 | // Check mod settings and item validity 51 | if (EGVAR(patches,usesACE)) then { 52 | _var = if (!isNil {ace_hearing_disableEarRinging}) then {ace_hearing_disableEarRinging} else {"varNil"}; 53 | if (!([_item, "ACE_EarPlugs", _var] call _fn_isValid)) exitWith {false}; 54 | 55 | _var = if (!isNil {ace_fastroping_requireRopeItems}) then {ace_fastroping_requireRopeItems} else {"varNil"}; 56 | if (!([_item, "ACE_ropeBase", _var] call _fn_isValid)) exitWith {false}; 57 | 58 | _var = if (!isNil {acex_field_rations_enabled}) then {acex_field_rations_enabled} else {"varNil"}; 59 | if (!([_item, "ACE_WaterBottle", _var] call _fn_isValid)) exitWith {false}; 60 | if (!([_item, "ACE_Canteen", _var] call _fn_isValid)) exitWith {false}; 61 | if (!([_item, "ACE_Can_Spirit", _var] call _fn_isValid)) exitWith {false}; 62 | if (!([_item, "ACE_MRE_LambCurry", _var] call _fn_isValid)) exitWith {false}; 63 | if (!([_item, "ACE_WaterBottle", _var] call _fn_isValid)) exitWith {false}; 64 | }; 65 | 66 | true 67 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_doEmptyCrate.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function resupply a crate and changes it's texture. 5 | * 6 | * Arguments: 7 | * 0: Crate 8 | * 9 | * Example: 10 | * [this] call cScripts_fnc_doEmptyCrate; 11 | */ 12 | 13 | if (!isServer) exitWith {}; 14 | 15 | params [["_crate", objNull]]; 16 | 17 | clearweaponcargoGlobal _crate; 18 | clearmagazinecargoGlobal _crate; 19 | clearitemcargoGlobal _crate; 20 | clearbackpackcargoGlobal _crate; 21 | 22 | // Change ace logistics size of crate 23 | [_crate, 1] remoteExec ["ace_cargo_fnc_setSize",0,true]; 24 | [_crate, true] remoteExec ["ace_dragging_fnc_setDraggable",0,true]; 25 | [_crate, true] remoteExec ["ace_dragging_fnc_setCarryable",0,true]; 26 | 27 | // If a correct classname add texture 28 | private _smallBox = [ 29 | "Box_T_East_Ammo_F", 30 | "Box_East_Ammo_F", 31 | "Box_NATO_Ammo_F", 32 | 33 | "Box_T_East_WpsSpecial_F", 34 | "Box_East_WpsSpecial_F", 35 | "Box_T_NATO_WpsSpecial_F", 36 | "Box_NATO_WpsSpecial_F", 37 | 38 | "Box_East_AmmoOrd_F", 39 | "Box_NATO_AmmoOrd_F", 40 | 41 | "Box_T_East_Wps_F", 42 | "Box_East_Wps_F", 43 | "Box_T_NATO_Wps_F", 44 | "Box_NATO_Wps_F", 45 | 46 | "Box_East_Grenades_F", 47 | "Box_NATO_Grenades_F", 48 | 49 | "Box_East_WpsLaunch_F", 50 | "Box_NATO_WpsLaunch_F" 51 | ]; 52 | private _largeBox = [ 53 | "B_CargoNet_01_ammo_F" 54 | ]; 55 | if (typeOf _crate in _smallBox) then { 56 | _crate setObjectTextureGlobal [0, "\z\cav\addons\supplies\data\Ammobox_7CAV_co.paa"]; 57 | }; 58 | if (typeOf _crate in _largeBox) then { 59 | _crate setObjectTextureGlobal [1, "\z\cav\addons\supplies\data\Ammobox_7CAV_co.paa"]; 60 | }; 61 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_doFieldHospital.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, SPC.Turn.J 4 | * This scripts crate the 7th cavalry field hostpital. 5 | * It adds equipment and some optional selections to a given object. 6 | * 7 | * Arguments: 8 | * 0: Crate 9 | * 1: Medical Facility (Default: true) 10 | * 2: Scale cargo ammount (Default: 1) 11 | * 12 | * Example: 13 | * [this] call cScripts_fnc_doFieldHospital; 14 | * [this, true, 1] call cScripts_fnc_doFieldHospital; 15 | */ 16 | 17 | params [ 18 | ["_crate", objNull, [objNull]], 19 | ["_isFacility", true] 20 | ]; 21 | 22 | INFO("", "Field Hostiptal applied to %1.", _crate); 23 | 24 | // Make addAction Topic 25 | _crate addAction [" 7th Cavalry Field Hospital", {}, [], 1.5, true, true, "", "true", 5]; 26 | 27 | if (_isFacility) then { 28 | _crate setVariable ["ace_medical_isMedicalFacility", true, true]; 29 | }; 30 | 31 | // If isServer add medical equipment 32 | if (isServer) then { 33 | private _crateContent = ["atlas"] call FUNC(getMedicalCrate); 34 | [_crate, _crateContent] call FUNC(setCargo); 35 | }; 36 | 37 | // Change ace logistics size of crate 38 | [_crate, 1] remoteExec ["ace_cargo_fnc_setSize",0,true]; 39 | [_crate, true] remoteExec ["ace_dragging_fnc_setDraggable",0,true]; 40 | [_crate, true] remoteExec ["ace_dragging_fnc_setCarryable",0,true]; 41 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_doStarterCrateSupplies.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function adds equipment to a given item baserd on company type. 5 | * 6 | * Arguments: 7 | * 0: Crate 8 | * 1: Set company type. ["none","alpha","bravo","charlie","medical","full"] 9 | * 10 | * Return Value: 11 | * Nothing 12 | * 13 | * Example: 14 | * [this] call cScripts_fnc_doStarterCrateSupplies; 15 | * [this,"none"] call cScripts_fnc_doStarterCrateSupplies; 16 | * 17 | */ 18 | 19 | params [ 20 | ["_crate", objNull, [objNull]], 21 | ["_companySelector", "NONE"] 22 | ]; 23 | 24 | if (!isServer) exitWith {}; 25 | 26 | // Set upper case 27 | _companySelector = toUpper(_companySelector); 28 | 29 | // Create categories 30 | private _officer = ["OFFICER"]; 31 | private _alpha = ["ALPHA", "BUFFALO", "TITAN", "RAIDER", "SPARROW"]; 32 | private _bravo = ["BRAVO", "LANCER", "VIKING", "SABER", "BANSHEE", "ATLAS"]; 33 | private _charlie = ["CHARLIE", "BANDIT", "MISFIT"]; 34 | 35 | if !(_companySelector in (["NONE", "FULL", "ALL"] + _officer + _alpha + _bravo + _charlie)) exitWith { 36 | ERROR_2("StarterCrate", "%1 (Starter Crate Supplies) is using a unsupported cartegory '%2'.", _crate, _companySelector); 37 | }; 38 | 39 | INFO_3("StarterCrate", "Applying %1 items to %2 (%3)", _companySelector, _crate, typeOf _crate); 40 | 41 | private _container = switch (_companySelector) do { 42 | case "BUFFALO"; 43 | case "TITAN"; 44 | case "RAIDER"; 45 | case "SPARROW"; 46 | case "ALPHA": {GET_CONTAINER("alpha_company");}; 47 | 48 | case "ATLAS": {GET_CONTAINER("bravo_company_atlas");}; 49 | case "SABER"; 50 | case "VIKING"; 51 | case "BRAVO": {GET_CONTAINER("bravo_company_viking");}; 52 | 53 | case "BANDIT"; 54 | case "MISFIT"; 55 | case "CHARLIE": {GET_CONTAINER("charlie_company");}; 56 | 57 | case "FULL"; 58 | case "ALL": { 59 | private _fullContainer = []; 60 | { 61 | private _items = GET_CONTAINER(_x); 62 | _fullContainer append _items; 63 | } forEach ["alpha_company", "bravo_company_atlas", "bravo_company_viking", "charlie_company"]; 64 | }; 65 | 66 | case ""; 67 | case "NONE": {[]}; 68 | default {[]}; 69 | }; 70 | 71 | [_crate, _container] call FUNC(setCargo); 72 | 73 | true -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_logistics_getAllContainerItems.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, SPC.Turn.J 4 | * This function return a array of all available content in logistics. 5 | * 6 | * Arguments: 7 | * 0: Return only keys 8 | * 9 | * Return: 10 | * ARRAY of items and amounts or items or empty 11 | * 12 | * Example: 13 | * call cScripts_fnc_logistics_getAllContainerItems; 14 | * [false] call cScripts_fnc_logistics_getAllContainerItems; 15 | * 16 | * Public: Yes 17 | */ 18 | 19 | params [ 20 | ["_keysOnly", false, []] 21 | ]; 22 | 23 | private _containerMap = GVAR(DATABASE); 24 | private _allContainers = []; 25 | 26 | { 27 | if (_keysOnly) then { 28 | private _keys = [_x, true] call EFUNC(logistics,getContainer); 29 | _allContainers append _keys; 30 | } else { 31 | _allContainers append _y; 32 | }; 33 | } foreach _containerMap; 34 | 35 | if (_keysOnly) then { 36 | _allContainers = _allContainers arrayIntersect _allContainers; 37 | }; 38 | 39 | _allContainers; 40 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_logistics_getContainer.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, SPC.Turn.J 4 | * This function return a array of content 5 | * 6 | * Arguments: 7 | * 0: Crate type 8 | * 1: Return only keys 9 | * 10 | * Return: 11 | * ARRAY of items and amounts or items or empty 12 | * 13 | * Example: 14 | * [""] call cScripts_fnc_logistics_getContainer; 15 | * ["", false] call cScripts_fnc_logistics_getContainer; 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params [ 21 | ["_key", "", [""]], 22 | ["_keysOnly", false, [false]] 23 | ]; 24 | 25 | if (_key == "") exitWith {}; 26 | 27 | private _containerMap = GVAR(DATABASE); 28 | private _container = _containerMap getOrDefaultCall [_key, {SHOW_WARNING_1("Logistics", "%1 does not exist.", _key); []}]; 29 | 30 | if (_keysOnly) then { 31 | private _containerItemMap = createHashMapFromArray _container; 32 | _container = keys _containerItemMap; 33 | }; 34 | 35 | if (isNil{_container}) exitWith {ERROR_1("Logistics", "%1 returned null.", _key);}; 36 | 37 | _container; 38 | -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_setCargo.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: Whitsel.M 4 | * This function sets given supplies to a container. 5 | * If nothing in the array is defined the container will be empty. 6 | * 7 | * Arguments: 8 | * 0: Vehicle or Crate 9 | * 1: Inventory 10 | * 11 | * Return Value: 12 | * Nothing 13 | * 14 | * Example: 15 | * [MyCrate, [["ACE_EarPlugs", 60]]] call cScripts_fnc_setCargo; 16 | * [MyTruck, [["ACE_personalAidKit", 8], ["ACE_tourniquet", 10]]] call cScripts_fnc_setCargo; 17 | * 18 | * Public: Yes 19 | */ 20 | 21 | params [ 22 | ["_vehicle", objNull, [objNull]], 23 | ["_inventory", [], [[]]] 24 | ]; 25 | 26 | clearWeaponCargoGlobal _vehicle; 27 | clearMagazineCargoGlobal _vehicle; 28 | clearItemCargoGlobal _vehicle; 29 | clearBackpackCargoGlobal _vehicle; 30 | 31 | [_vehicle, _inventory] call FUNC(addCargo); -------------------------------------------------------------------------------- /cScripts/functions/logistics/fn_setCargoAttributes.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: Whitsel.M 4 | * This function allow you to set the cargo space and size of the given object. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: Cargo Space (nil to keep default value) 9 | * 2: Cargo Size (nil to keep default value) 10 | * 3: Draggable (Default; true) 11 | * 4: Carryable (Default; true) 12 | * 13 | * Example: 14 | * [myTruck] call cScripts_fnc_setCargoAttributes; 15 | * [myTruck, 30, -1] call cScripts_fnc_setCargoAttributes; 16 | * [myCrate, -1, 2] call cScripts_fnc_setCargoAttributes; 17 | * [myCrate, -1, 2, true, false] call cScripts_fnc_setCargoAttributes; 18 | * [myCrate, nil, nil, true, false] call cScripts_fnc_setCargoAttributes; 19 | * 20 | * Public: Yes 21 | */ 22 | 23 | params [ 24 | ["_vehicle", objNull, [objNull]], 25 | ["_space", nil, [0, nil]], 26 | ["_size", nil, [0, nil]], 27 | ["_draggable", true, [true]], 28 | ["_carryable", true, [true]] 29 | ]; 30 | 31 | if (!isServer) exitWith {}; 32 | 33 | if (!isNil{_space}) then { 34 | [_vehicle, _space] call ace_cargo_fnc_setSpace; 35 | }; 36 | if (!isNil{_size}) then { 37 | [_vehicle, _size] call ace_cargo_fnc_setSize; 38 | }; 39 | 40 | [_vehicle, _draggable] call ace_dragging_fnc_setDraggable; 41 | [_vehicle, _carryable] call ace_dragging_fnc_setCarryable; -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_addBaseCrate.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function creates a base create contining staging zone and everythig. 5 | * (This is a quick function for the starter create) 6 | * 7 | * Arguments: 8 | * 0: Object 9 | * 1: Crate Type (Default: "none") 10 | * 11 | * Return Value: 12 | * true or false 13 | * 14 | * Example: 15 | * [this] call cScripts_fnc_addBaseCrate; 16 | * [this, "charlie"] call cScripts_fnc_addBaseCrate; 17 | * [this, "all"] call cScripts_fnc_addBaseCrate; 18 | * 19 | * Public: Yes 20 | */ 21 | 22 | params [ 23 | ["_object", objNull, [objNull]], 24 | ["_type", "none", [""]] 25 | ]; 26 | 27 | if (_object isKindOf "Man") exitWith {false}; 28 | 29 | [_object, _type, true, true, true, false, false, true] call FUNC(doStarterCrate); 30 | 31 | true -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_addEscapeWreck.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Turn.J, heavy influence from SGT.Brostrom.A 4 | * This adds a function to allow pilots to escape from wrecked airframes. 5 | * 6 | * 7 | * Arguments: 8 | * 0: Object 9 | * 10 | * Example: 11 | * [this] call cScripts_fnc_addEscapeWreck 12 | */ 13 | 14 | params [ 15 | ["_vehicle", objNull, [objNull]] 16 | ]; 17 | 18 | // Check so the options arent added twice. 19 | if (!isNil {_vehicle getVariable QEGVAR(VehicleFunc,EscapeAction)}) exitWith {SHOW_WARNING_1("EscapeWreck", "Escape wreck already set for %1.", _vehicle)}; 20 | 21 | private _conditionAction = '(!(assignedVehicleRole player isEqualTo [])) && ((damage vehicle player) >= 1)'; 22 | 23 | private _actionID = [ 24 | _vehicle, 25 | "Escape Wreck (HOLD)", 26 | "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa", 27 | "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa", 28 | _conditionAction, 29 | "true", 30 | {}, 31 | {}, 32 | { 33 | params ["_target", "_caller", "_actionID"]; 34 | [_target, true] call FUNC(doGetOutHeloSide); 35 | }, 36 | {}, 37 | [], 38 | 5, 39 | 25, 40 | true 41 | ] call BIS_fnc_holdActionAdd; 42 | 43 | _vehicle setVariable [QEGVAR(VehicleFunc,EscapeAction), _actionID]; -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_addGetOutHelo.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A (With the help from; 654wak654) 4 | * This function add two get out side addActions avaible for players in 5 | * cargoIndex positions. 6 | * 7 | * Arguments: 8 | * 0: Object 9 | * 1: Color Action 10 | * 11 | * Example: 12 | * [this] call cScripts_fnc_addGetOutHelo 13 | * [this, true] call cScripts_fnc_addGetOutHelo 14 | */ 15 | 16 | params [ 17 | ["_vehicle", objNull, [objNull]], 18 | ["_useColor", true] 19 | ]; 20 | 21 | // Check so the options arent added twice. 22 | if (!isNil {_vehicle getVariable QEGVAR(VehicleFunc,GetOutAction)}) exitWith {SHOW_WARNING_1("GetOutHelo", "Helicopter Get out setting already applied for %1.", _vehicle)}; 23 | 24 | private _leftSide = "Get out Left Side"; 25 | private _rightSide = "Get out Right Side"; 26 | 27 | if (_useColor) then { 28 | _leftSide = "Get out Left Side"; 29 | _rightSide = "Get out Right Side"; 30 | }; 31 | 32 | private _actionIDL = _vehicle addAction [ 33 | _leftSide, 34 | {[_this select 0, true] call FUNC(doGetOutHeloSide)}, 35 | 0, 1.5, true, true, "User12", 36 | "(_target getCargoIndex _this) != -1" 37 | ]; 38 | 39 | private _actionIDR = _vehicle addAction [ 40 | _rightSide, 41 | {[_this select 0, false] call FUNC(doGetOutHeloSide)}, 42 | 0, 1.5, true, true, "User13", 43 | "(_target getCargoIndex _this) != -1" 44 | ]; 45 | 46 | _vehicle setVariable [QEGVAR(VehicleFunc,GetOutAction), [_vehicle, [_actionIDL, _actionIDR]]]; 47 | -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_addLoadoutAction.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This adds a addAction option to the given item for a given loadout. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Lable 9 | * 2: Loadout 10 | * 11 | * 12 | * Return Value: 13 | * ActionID 14 | * 15 | * Example: 16 | * [this, "My Custom Loadout", "My_Loadout_Classname"] call cScripts_fnc_addLoadoutAction 17 | * [this, "Rifleman", "B_Soldier_F"] call cScripts_fnc_addLoadoutAction 18 | * [this, "Apply a special variable loadout", "Variable_Name"] call cScripts_fnc_addLoadoutAction 19 | * [this, "Go Nude", [[],[],[],[],[],[],"","",[],["","","","","",""]]] call cScripts_fnc_addLoadoutAction 20 | * 21 | * Public: Yes 22 | */ 23 | 24 | params [ 25 | ["_object", objNull, [objNull]], 26 | ["_lable", "", [""]], 27 | ["_loadout", "", ["", []]] 28 | ]; 29 | 30 | if (_lable == "") exitWith {}; 31 | if (_loadout == "") exitWith {}; 32 | 33 | private _id = _object addAction [format ["%1", _lable], { 34 | params ["_target", "_caller", "_actionId", "_arguments"]; 35 | _arguments params ["_loadout"]; 36 | [_caller, _loadout] call EFUNC(gear,applyLoadout); 37 | }, _loadout, 1.5, true, true, "", "", 5]; 38 | 39 | _id 40 | -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_gate.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, with help from Commy2 4 | * This function make a given gate the ability to open and close automaticly whitout much fiddeling with triggers. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Side (Optional) (Default; WEST) 9 | * 2: Distance (Optional) (Default; 30) 10 | * 11 | * Return Value: 12 | * None 13 | * 14 | * Example: 15 | * ["gate"] call cScripts_fnc_gate 16 | * ["gate","WEST"] call cScripts_fnc_gate 17 | * ["gate","WEST", 30] call cScripts_fnc_gate 18 | * 19 | * Public: Yes 20 | */ 21 | 22 | params[ 23 | ["_object", objNull, [objNull]], 24 | ["_triggerSide", "WEST", [""]], 25 | ["_distance", 30] 26 | ]; 27 | 28 | SHOW_WARNING_1("DEPRICATED", "Function 'cScripts_fnc_gate' on %1 is depricated (cScripts_fnc_gate => cav_mission_fnc_gate)...", _object); 29 | [_object, _triggerSide, _distance] call cav_mission_fnc_gate; -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_makeAgent.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function removes and recreates a given unit as a agent when in proximity. 5 | * Run this function in the object or unit init. 6 | * 7 | * Arguments: 8 | * 0: Unit 9 | * 10 | * Example: 11 | * [this] call cScripts_fnc_makeAgent 12 | * 13 | */ 14 | 15 | params [["_unit", objNull, [objNull]]]; 16 | 17 | private _classname = typeOf _unit; 18 | private _postion = getPosASL _unit; 19 | private _vectorUp = vectorUp _unit; 20 | private _vectorDir = vectorDir _unit; 21 | private _side = side _unit; 22 | 23 | deleteVehicle _unit; 24 | 25 | _agent = createAgent [_classname, _postion, [], 0, 'CAN_COLLIDE']; 26 | _agent setPosASL _postion; 27 | _agent setVectorDirAndUp [_vectorDir, _vectorUp]; 28 | 29 | INFO_3("Agent", "Converted %1 (%2) to agent %3 (%2).", _unit, _classname, _agent); 30 | 31 | if (_side == civilian) then { 32 | [{ 33 | params ["_agent"]; 34 | _agent unassignItem "ItemMap"; 35 | _agent removeItem "ItemMap"; 36 | _agent unassignItem "ItemCompass"; 37 | _agent removeItem "ItemCompass"; 38 | 39 | private _watch = selectRandom ["ItemWatch", "", ""]; 40 | if (_watch == "") then { 41 | _agent unassignItem "ItemWatch"; 42 | _agent removeItem "ItemWatch"; 43 | }; 44 | 45 | private _money = selectRandom ["Money_roll", "Money_bunch", "Money_bunch", "Money_bunch", "Money_bunch", "", ""]; 46 | if (_money != "") then { 47 | [_agent, _money] call CBA_fnc_addItem; 48 | }; 49 | 50 | private _wallet = selectRandom ["Wallet_ID", "Wallet_ID", ""]; 51 | if (_wallet != "") then { 52 | [_agent, _wallet] call CBA_fnc_addItem; 53 | }; 54 | 55 | private _phone = selectRandom ["MobilePhone", "MobilePhone", "MobilePhone", "SmartPhone", "", "", "", ""]; 56 | if (_phone != "") then { 57 | [_agent, _phone] call CBA_fnc_addItem; 58 | }; 59 | }, [_agent]] call CBA_fnc_execNextFrame; 60 | }; 61 | 62 | -------------------------------------------------------------------------------- /cScripts/functions/mission/fn_teleport.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This teleports a target to a given marker or any other kind of object. 5 | * Z will always be 0 for MARKER, LOCATION and TASK. 6 | * 7 | * Arguments: 8 | * 0: Object 9 | * 1: Label text 10 | * 2: Destination 11 | * 12 | * Return Value: 13 | * Nothing 14 | * 15 | * Example: 16 | * [this,"Teleport - Airfield", Airstrip] call cScripts_fnc_teleport 17 | * [this,"Teleport - Base", MyBase] call cScripts_fnc_teleport 18 | * [this,"Teleport - Talon", "FOB_Talon"] call cScripts_fnc_teleport 19 | * [this,"Teleport - Base", "respawn_west"] call cScripts_fnc_teleport 20 | * 21 | * Public: Yes 22 | */ 23 | 24 | params [ 25 | ["_object", objNull, [objNull]], 26 | ["_action", "Teleport"], 27 | ["_dest", nil, [objNull, grpNull, "", locationNull, taskNull, []]] 28 | ]; 29 | 30 | SHOW_WARNING_1("DEPRICATED", "Function 'cScripts_fnc_teleport' on %1 is depricated (cScripts_fnc_teleport => cav_mission_fnc_teleport)...", _object); 31 | [_object, _action, _dest] call cav_mission_fnc_teleport; -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_createFieldHospital.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function spawn a 7th Cavalry Fieald Hostpital. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_createFieldHospital 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | [ 19 | "7th Cavalry Fieald Hostpital Crate", 20 | [ 21 | ["SLIDER:PERCENT", ["Supply size", "Regulate the total amount of supplies in the crate"], [0, 1, 1], false] 22 | ], 23 | { 24 | params ["_arg", "_pos"]; 25 | _arg params ["_size"]; 26 | _pos params ["_modulePos"]; 27 | 28 | private _crate = "C_IDAP_supplyCrate_F" createVehicle _modulePos; 29 | [_crate, false, _size] remoteExec [QFUNC(doFieldHospital), 0, true]; 30 | 31 | // Change ace characteristics of crate 32 | [_crate, 1] call ace_cargo_fnc_setSize; 33 | [_crate, true] call ace_dragging_fnc_setDraggable; 34 | [_crate, true] call ace_dragging_fnc_setCarryable; 35 | 36 | // Add object to Zeus 37 | [{ 38 | _this call ace_zeus_fnc_addObjectToCurator; 39 | }, _crate] call CBA_fnc_execNextFrame; 40 | }, 41 | {}, 42 | [_modulePos] 43 | ] call zen_dialog_fnc_create; 44 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_createMedicalCrate.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, SPC.Turn.J 4 | * This module function spawn a supply medical crate. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_createMedicalCrate 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | // The crate type that will be passed to the supply crate spawner. 19 | private _crateTypeList = [ 20 | 'crate_medicalAtlas', 21 | 'crate_medicalInfantry' 22 | ]; 23 | 24 | // Display text for the crate list selection. This is what the zeus sees. 25 | private _displayTextList = 26 | [ 27 | ['Atlas Team', "Contains enough supplies to sustain two Atlas teams as well supplementing one infantry platoon."], 28 | ['Infantry Plt', "Contains enough medical supplies for one infantry platoon."] 29 | ]; 30 | 31 | 32 | [ 33 | "7th Cavalry Medical Crate", 34 | [ 35 | ["LIST", ["Crate Type", "Select the type of unit you are supplying with this crate"], 36 | [ 37 | _crateTypeList, 38 | _displayTextList, 39 | 0, 40 | 2 41 | ], false] 42 | ], 43 | { 44 | params ["_arg", "_pos"]; 45 | _arg params ["_crateType"]; 46 | _pos params ["_modulePos"]; 47 | 48 | _crateContents = [_crateType] call EFUNC(logistics,getContainer); 49 | private _groundLevel = ASLToAGL _modulePos; 50 | [ 51 | "ace_medicalSupplyCrate", 52 | _crateContents, 53 | _groundLevel 54 | ] remoteExec [QFUNC(createCargoCrate),2]; 55 | }, 56 | {}, 57 | [_modulePos] 58 | ] call zen_dialog_fnc_create; 59 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_createSupplyCrate.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, J.Turn 4 | * This module function spawn a supply crate. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_createSupplyCrate 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | // The crate type that will be passed to the supply crate spawner. 18 | private _crateTypeList = [ 19 | 'crate_resupply_general', 20 | 'crate_medicalAtlas', 21 | 'crate_medicalInfantry', 22 | 'crate_stinger' 23 | ]; 24 | 25 | // Display text for the crate list selection. This is what the zeus sees. 26 | private _displayTextList = 27 | [ 28 | ['Infantry Resupply', "Contains weapons, ammo, and supplies for one infantry platoon"], 29 | ['Atlas Team', "Contains enough supplies to sustain two Atlas teams as well supplementing one infantry platoon."], 30 | ['Infantry Medical', "Contains enough medical supplies for one infantry platoon."], 31 | ['Stinger MANPAD', "Contains 1 launcher and 2 missiles."] 32 | ]; 33 | [ 34 | "7th Cavalry Supply Crates", 35 | [ 36 | ["LIST", ["Crate Type", "Select the type of unit you are supplying with this crate"], 37 | [ 38 | _crateTypeList, 39 | _displayTextList, 40 | 0, 41 | 4 42 | ], false] 43 | ], 44 | { 45 | params ["_arg", "_pos"]; 46 | _arg params ["_crateType"]; 47 | _pos params ["_modulePos"]; 48 | 49 | [_modulePos, _crateType] remoteExec [QFUNC(doSupplyCrate), 2, false]; 50 | }, 51 | {}, 52 | [_modulePos] 53 | ] call zen_dialog_fnc_create; 54 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_enableUnitSimulation.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function enables adn unhide a units, vehicle and its group; 5 | * that have been hidden and disabled by simulation manager and dynamic simulation. 6 | * 7 | * Arguments: 8 | * 0: modulePos 9 | * 1: objectPos 10 | * 11 | * Example: 12 | * [getPos logic, this] call cScripts_fnc_zenModule_enableUnitSimulation 13 | * 14 | * Public: No 15 | */ 16 | 17 | params ["_modulePos", "_objectPos"]; 18 | 19 | if (isNull _objectPos) exitWith { 20 | ["Not a valid unit"] call zen_common_fnc_showMessage; 21 | }; 22 | if (!(isObjectHidden _objectPos) && simulationEnabled _objectPos) exitWith { 23 | ["Unit already active"] call zen_common_fnc_showMessage; 24 | }; 25 | 26 | _objectPos enableDynamicSimulation false; 27 | [_objectPos, true] remoteExec ["enableSimulationGlobal", 2]; 28 | [_objectPos, false] remoteExec ["hideObjectGlobal", 2]; 29 | 30 | group _objectPos enableDynamicSimulation false; 31 | { 32 | [_x, true] remoteExec ["enableSimulationGlobal", 2]; 33 | [_x, false] remoteExec ["hideObjectGlobal", 2]; 34 | } forEach units group _objectPos; 35 | 36 | ["Unit has been activated"] call zen_common_fnc_showMessage; 37 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_regearTrooper.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function regear to a given unit. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_regearTrooper 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | if (_objectPos isKindOf "Man") exitWith { 19 | private _unit = _objectPos; 20 | [QEGVAR(gear,applyLoadout), [_unit], _unit] call CBA_fnc_targetEvent; 21 | [format["Regeared %1", name _unit]] call zen_common_fnc_showMessage; 22 | }; 23 | 24 | ["Not a valid unit"] call zen_common_fnc_showMessage; -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_rekitVehicle.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function regear to a given unit. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_regearTrooper 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | 19 | 20 | [ 21 | "7th Cavalry Rekit Vehicle", 22 | [ 23 | ["CHECKBOX", ["Medical Vehicle", "Fills this vehicle with a medical loadout."], true, false] 24 | ], 25 | { 26 | params ["_arg", "_pos"]; 27 | _arg params ["_medVehicle"]; 28 | _pos params ["_objectPos"]; 29 | 30 | if (_medVehicle) then { 31 | _objectPos setVariable [QEGVAR(Vehicle,Type), "MED", true]; 32 | } else { 33 | _objectPos setVariable [QEGVAR(Vehicle,Type), nil, true]; 34 | }; 35 | 36 | _objectPos setVariable [QEGVAR(Vehicle,Inventory), nil, true]; 37 | 38 | 39 | private _cargoArray = _objectPos getVariable ["ace_cargo_loaded",[]]; 40 | 41 | { 42 | [_x, _objectPos] call ace_cargo_fnc_removeCargoItem; 43 | 44 | } forEach _cargoArray; 45 | 46 | _objectPos call EFUNC(vehicle,addFunctions); 47 | _objectPos call EFUNC(vehicle,addInventory); 48 | _objectPos call EFUNC(vehicle,addPylonLoadout); 49 | _objectPos call EFUNC(vehicle,addCosmetics); 50 | _objectPos call EFUNC(vehicle,addStagingActions); 51 | _objectPos call EFUNC(vehicle,addRadio); 52 | 53 | }, 54 | {}, 55 | [_objectPos] 56 | ] call zen_dialog_fnc_create; 57 | 58 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_resetPlayerRadio.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module resets the player radio. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_resetPlayerRadio; 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | if (_objectPos isKindOf "Man") exitWith { 19 | private _unit = _objectPos; 20 | [] remoteExec [QFUNC(clearRadioIds), _unit]; 21 | 22 | SHOW_SERVER_INFO_2("GearRadio", "Player %1 (%2) radio has been reset", name _unit, getPlayerUID _unit); 23 | [format["Radio reset for %1", name _unit]] call zen_common_fnc_showMessage; 24 | }; 25 | 26 | [ 27 | "Reset radio for all players", 28 | [ 29 | ["CHECKBOX", ["Are you sure?", ""], false, false] 30 | ], 31 | { 32 | params ["_arg", "_pos"]; 33 | _arg params ["_sure"]; 34 | _pos params ["_modulePos"]; 35 | 36 | 37 | if (_sure) exitWith { 38 | [] remoteExec [QFUNC(clearRadioIds), -2]; 39 | SHOW_CHAT_SERVER_WARNING("GearRadio", "All players radios have been reset in this mission"); 40 | ["Radios have been reset for all players called"] call zen_common_fnc_showMessage; 41 | }; 42 | ["Nothing has been done"] call zen_common_fnc_showMessage; 43 | }, 44 | {}, 45 | [_modulePos] 46 | ] call zen_dialog_fnc_create; 47 | 48 | ["Nothing has been done"] call zen_common_fnc_showMessage; 49 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_setDamage.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function spawn a supply crate. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * Example: 11 | * [getPos logic, this] call cScripts_fnc_zenModule_createSupplyCrate 12 | * 13 | * Public: No 14 | */ 15 | 16 | params ["_modulePos", "_objectPos"]; 17 | 18 | [ 19 | "Unit injuries", 20 | [ 21 | ["CHECKBOX", ["Mak unit unconscious", ""], true, false], 22 | ["LIST", ["Injurie", "Select type of injurie"], 23 | [ 24 | [ 25 | 'Nothing' 26 | '2 bullets in the cheast' 27 | ], 28 | [ 29 | '' 30 | 'twoBulletInChest' 31 | ], 32 | 0, 33 | 1 34 | ], false], 35 | ], 36 | { 37 | params ["_arg", "_pos"]; 38 | _arg params ["_setUnconscious"]; 39 | _pos params ["_objectPos"]; 40 | 41 | [_objectPos, _setUnconscious] call ace_medical_fnc_setUnconscious; 42 | 43 | switch () do { 44 | case "twoBulletInChest": { 45 | [_objectPos, 0.20, "hitbody", "bullet"] call ace_medical_fnc_addDamageToUnit; 46 | [_objectPos, 0.20, "hitbody", "bullet"] call ace_medical_fnc_addDamageToUnit; 47 | }; 48 | default {}; 49 | }; 50 | }, 51 | {}, 52 | [_objectPos] 53 | ] call zen_dialog_fnc_create; 54 | -------------------------------------------------------------------------------- /cScripts/functions/modules/fn_zenModule_stagingZones.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This module function can disable the staging zones mid mission. 5 | * 6 | * Arguments: 7 | * 0: modulePos 8 | * 1: objectPos 9 | * 10 | * 11 | * Example: 12 | * [getPos logic, this] call cScripts_fnc_zenModule_stagingZones; 13 | * 14 | * Public: No 15 | */ 16 | 17 | params ["_modulePos", "_objectPos"]; 18 | 19 | [ 20 | "Staging zones", 21 | [ 22 | ["CHECKBOX", ["Allow access to staging zones", "This allow or deny access for staging zones globaly on all zones."], true, false] 23 | ], 24 | { 25 | params ["_arg", "_pos"]; 26 | _arg params [ 27 | "_stagingZones" 28 | ]; 29 | _pos params ["_modulePos"]; 30 | 31 | if (_stagingZones) then { 32 | missionNamespace setVariable [QEGVAR(mission,stagingZonesEnabled), true]; 33 | } else { 34 | missionNamespace setVariable [QEGVAR(mission,stagingZonesEnabled), false]; 35 | }; 36 | }, 37 | {}, 38 | [_modulePos] 39 | ] call zen_dialog_fnc_create; 40 | -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_getClanTag.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return players clan tag or empty if none. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * ClanTag or Empty 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_getClanTag 14 | * 15 | */ 16 | 17 | if (!GVAR(isPlayer)) exitWith {""}; 18 | 19 | if !(isNil {squadParams player select 0 select 0}) exitWith { 20 | private _clanTag = squadParams player select 0 select 0; 21 | _clanTag = toUpper(_clanTag); 22 | _clanTag 23 | }; 24 | 25 | "" -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_getCompany.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return your company 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * CompanyName 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_getCompany; 14 | * 15 | * Public: No 16 | */ 17 | 18 | private _company = GETVAR(player,EGVAR(Player,Company), ""); 19 | _company = toLower _company; 20 | 21 | _company -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_getOrganization.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return your platoon and company 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Organization 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_getOrganization; 14 | * 15 | * Public: No 16 | */ 17 | 18 | private _loadout = [player] call EFUNC(gear,getLoadoutName); 19 | 20 | private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; 21 | 22 | private _configPlatoon = getNumber (_config >> "platoon"); 23 | private _platoon = GETVAR(player,EGVAR(Player,Platoon),_configPlatoon); 24 | 25 | private _configCompany = getText (_config >> "company"); 26 | private _company = GETVAR(player,EGVAR(Player,Company),_configCompany); 27 | _company = toLower _company; 28 | 29 | [_platoon, _company] -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_getPlatoon.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return your platoon 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Platoon Number 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_getPlatoon; 14 | * 15 | * Public: No 16 | */ 17 | 18 | private _platoon = GETVAR(player,EGVAR(Player,Platoon), 0); 19 | 20 | _platoon -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_getRole.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function fetches your rank based on your name description prefix or unit config display text. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Role name 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_getRole 14 | * 15 | */ 16 | 17 | private _return = "Trooper"; 18 | 19 | if (!isMultiplayer) exitWith { _return }; 20 | if (!GVAR(isPlayer)) exitWith { _return }; 21 | 22 | private _playerRole = roleDescription player; 23 | 24 | if !(_playerRole == "") then { 25 | _playerRole = _playerRole splitString "@"; 26 | _playerRole = _playerRole select 0; 27 | _return = _playerRole; 28 | } else { 29 | _playerRole = getText (configFile >> "CfgVehicles" >> typeOf player >> "displayName"); 30 | _playerRole = _playerRole splitString " "; 31 | if (_playerRole select 0 in ["Platoon", "Squad"]) then { 32 | _return = [_playerRole select 0, _playerRole select 1] joinString " "; 33 | } else { 34 | _return = _playerRole joinString " "; 35 | }; 36 | }; 37 | 38 | _return; 39 | -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_hasClanTag.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function checks if you have the defined clan tag. 5 | * 6 | * Arguments: 7 | * 0: player 8 | * 9 | * Return Value: 10 | * True or False 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_player_hasClanTag 14 | * 15 | */ 16 | 17 | if (!GVAR(isPlayer)) exitWith {false}; 18 | if (!isMultiplayer) exitWith {false}; 19 | 20 | private _playerTag = call EFUNC(player,getClanTag); 21 | private _settingsTag = toUpper EGVAR(Settings,primaryClanTag); 22 | if (_playerTag == _settingsTag) exitWith {true}; 23 | 24 | false -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_isCurator.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return true if a player is curator 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * true/False 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_isCurator 14 | * 15 | */ 16 | 17 | if (!isNull (getAssignedCuratorLogic player)) exitWith {true}; 18 | 19 | private _curator = player getVariable [QEGVAR(Player,Unit), ""]; 20 | _curator = toLower _curator; 21 | if (_curator == "s3") exitWith {true}; 22 | if (_curator == "zeus") exitWith {true}; 23 | if (_curator == "curator") exitWith {true}; 24 | if (_curator == "debug") exitWith {true}; 25 | 26 | false -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_isMissionAdmin.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return true if a player is curator or admin 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * True/False 11 | * 12 | * Example: 13 | * call cScripts_fnc_player_isMissionAdmin 14 | * 15 | */ 16 | 17 | if (!isNull (getAssignedCuratorLogic player)) exitWith {true}; 18 | if (call BIS_fnc_admin > 1) exitWith {true}; 19 | if (!isMultiplayer || {is3DENMultiplayer}) exitWith {true}; 20 | 21 | false -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_setOrganization.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function sets your set your company name 5 | * 6 | * Arguments: 7 | * 0: Platoon 8 | * 1: Company 9 | * 10 | * Return Value: 11 | * Organization 12 | * 13 | * Example: 14 | * [2,"Charlie"] call cScripts_fnc_player_setOrganization; 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [ 20 | ["_platoon", 0, [0]], 21 | ["_company", "", [""]] 22 | ]; 23 | 24 | // Set platoon number 25 | if (_platoon < 0 || _platoon > 4) then { 26 | SHOW_WARNING_1("Player","Platoon number '%1' is invalid. Must be between 0 and 4. Setting to default.",_platoon); 27 | _platoon = 0; 28 | }; 29 | 30 | SETVAR(player,EGVAR(Player,Platoon),_platoon); 31 | 32 | // Set company name 33 | _company = toLower _company; 34 | SETVAR(player,EGVAR(Player,Company),_company); 35 | 36 | private _unit = name player; 37 | INFO_3("Player", "%1 has company set to '%2' and platoon set to '%3'",_unit,_company,_platoon); 38 | 39 | [_platoon, _company] -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_setRank.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function is used to apply a rank to a player. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * BIS Rank 11 | * 12 | * Example: 13 | * [bob] call cScripts_fnc_player_setRank; 14 | * 15 | */ 16 | 17 | params [["_player", objNull, [objNull]]]; 18 | 19 | if (!GVAR(isPlayer)) exitWith {}; 20 | waitUntil {!isNull player && player == player}; 21 | 22 | private _rank = 'PRIVATE'; 23 | if (call EFUNC(player,hasClanTag)) then { 24 | _rank = [_player, 'BIS'] call EFUNC(player,getRank); 25 | }; 26 | 27 | if (_rank in ['PRIVATE','CORPORAL','SERGEANT','LIEUTENANT','CAPTAIN','MAJOR','COLONEL']) then { 28 | _player setRank _rank; 29 | }; 30 | 31 | SETVAR(_player,EGVAR(Player,Rank), _rank); 32 | _rank -------------------------------------------------------------------------------- /cScripts/functions/players/fn_player_setSquad.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function sets your squad name. 5 | * 6 | * Arguments: 7 | * 0: player 8 | * 1: squadLeader 9 | * 10 | * Return Value: 11 | * Squad Name 12 | * 13 | * Example: 14 | * [this, "Bandit-1"] call cScripts_fnc_player_setSquad 15 | * [this, "Bandit-1", true] call cScripts_fnc_player_setSquad 16 | * 17 | */ 18 | 19 | params [ 20 | ["_player", objNull, [objNull]], 21 | ["_squadName", "", [""]], 22 | ["_squadLeader", false, [false]] 23 | ]; 24 | 25 | if (!GVAR(isPlayer)) exitWith {}; 26 | if (_squadName == "") exitWith {}; 27 | 28 | private _group = group _player; 29 | _group setGroupId [_squadName]; 30 | 31 | if (_squadLeader) then { 32 | _group setGroupIdGlobal ["_squadName"]; 33 | }; 34 | 35 | SETVAR(player,EGVAR(Player,Squad),_rank); 36 | _rank -------------------------------------------------------------------------------- /cScripts/functions/players/fn_profile_loadInsignia.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return your profile saved insignia 5 | * 6 | * Arguments: 7 | * Nothing 8 | * 9 | * Return Value: 10 | * Classname of insignia 11 | * 12 | * Example: 13 | * call cScripts_fnc_profile_loadInsignia 14 | * 15 | * Public: No 16 | */ 17 | if (!isPlayer _unit) exitWith {}; 18 | 19 | private _insignia = GETPRVAR(EGVAR(Profile,Insignia), ""); 20 | 21 | INFO_2("PlayerProfile", "%1 insignia '%2' obtained on profile variable...", player, _insignia); 22 | 23 | _insignia -------------------------------------------------------------------------------- /cScripts/functions/players/fn_profile_saveInsignia.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function saves your selected insignia to your profile 5 | * 6 | * Arguments: 7 | * 0: InsigniaClassname 8 | * 9 | * Return Value: 10 | * True 11 | * 12 | * Example: 13 | * ["curator"] call cScripts_fnc_profile_saveInsignia 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_insignia", "", [""]]]; 19 | 20 | if (!isPlayer _unit) exitWith {}; 21 | 22 | SETPRVAR(EGVAR(Profile,Insignia), _insignia); 23 | 24 | INFO_2("PlayerProfile", "%1 insignia '%2' saved on profile variable...", player, _insignia); 25 | 26 | true -------------------------------------------------------------------------------- /cScripts/functions/players/fn_setRadioChannel.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function sets a player radio channels based on squad name. If -1 no radio will be set. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 9 | * Return Value: 10 | * Nothing 11 | * 12 | * Example: 13 | * ["bob"] call cScripts_fnc_setRadioChannel 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_player", objNull, [objNull]]]; 19 | 20 | if (!EGVAR(Patches,usesACRE) && !EGVAR(Patches,usesTFAR)) exitWith {}; 21 | if (!EGVAR(Settings,enableRadios)) exitWith {}; 22 | if (!GVAR(isPlayer)) exitWith {}; 23 | 24 | 25 | // ACRE 26 | if (EGVAR(patches,usesACRE)) exitWith { 27 | SETVAR(_player,EGVAR(Player,RadioChannel), []); 28 | private _playerRadios = [_player] call acre_api_fnc_getCurrentRadioList; 29 | { 30 | if !(_x == "") then { 31 | private _radio = [_x] call acre_api_fnc_getBaseRadio; 32 | private _channel = [[_player] call EFUNC(unit,getSquadName), _radio] call FUNC(getRadioChannel); 33 | 34 | [_x, _channel] call acre_api_fnc_setRadioChannel; 35 | INFO_3("Radio", "%1 radio (%2) has its channel set to %3", _player, _x, _channel); 36 | 37 | // Store radio channels in variable. 38 | private _radioAndChannel = _player getVariable [QEGVAR(Player,RadioChannel), []]; 39 | _radioAndChannel pushBack [[_x] call acre_api_fnc_getBaseRadio, _channel]; 40 | SETVAR(_player,EGVAR(Player,RadioChannel), _radioAndChannel); 41 | 42 | } else { 43 | SHOW_SERVER_WARNING_1("Radio", "Empty radio is trying to get it's channel applied for %1", _player); 44 | }; 45 | } forEach _playerRadios; 46 | }; 47 | 48 | 49 | // TFAR 50 | if (EGVAR(patches,usesTFAR)) exitWith { 51 | /** TODO: Code goes here */ 52 | }; 53 | 54 | SHOW_CHAT_ERROR("Radio", "Fatal"); 55 | -------------------------------------------------------------------------------- /cScripts/functions/players/fn_unit_getName.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function strips your rank from your name if you have defined squad XML. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * Rank striped profileName OR profileName 11 | * 12 | * Example: 13 | * [bob] call cScripts_fnc_unit_getName 14 | * 15 | */ 16 | 17 | params [["_unit", objNull, [objNull]]]; 18 | 19 | if (!GVAR(isPlayer)) exitWith {name _unit}; 20 | if (!isMultiplayer) exitWith {profileName}; 21 | 22 | if (call EFUNC(player,hasClanTag)) exitWith { 23 | [profileName, 4] call BIS_fnc_trimString; 24 | }; 25 | 26 | profileName -------------------------------------------------------------------------------- /cScripts/functions/players/fn_unit_getVariables.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function List all variables on a player 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * HASHMAP 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_unit_getVariables 14 | * [cursorObject] call cScripts_fnc_unit_getVariables 15 | * 16 | */ 17 | 18 | params [["_unit", objNull, [objNull]]]; 19 | 20 | private _isPlayer = isPlayer _unit; 21 | private _classname = typeOf _unit; 22 | private _netId = netId _unit; 23 | private _uid = if (isPlayer _unit) then {getPlayerUID _unit} else {""}; 24 | 25 | private _name = GETVAR(_unit,EGVAR(Unit,Name),""); 26 | private _profileName = if (isPlayer _unit) then {profileName} else {""}; 27 | private _profileNameSteam = if (isPlayer _unit) then {profileNameSteam} else {""}; 28 | private _clanTag = call EFUNC(player,getClanTag); 29 | 30 | private _rank = [player, 'USA'] call cScripts_fnc_player_getRank; 31 | private _rank_bis = GETVAR(_unit,EGVAR(Player,Rank),"PRIVATE"); 32 | 33 | private _regiment = ""; 34 | private _company = GETVAR(player,EGVAR(Player,Company), ""); 35 | private _platoon = GETVAR(player,EGVAR(Player,Platoon), 0); 36 | private _squad = GETVAR(_unit,EGVAR(Player,Squad),groupId group _unit); 37 | private _squadInsignia = [_unit] call BIS_fnc_getUnitInsignia; 38 | private _team = ""; 39 | 40 | private _abilityMedic = []; 41 | private _abilityEngineer = []; 42 | private _abilityEOD = []; 43 | 44 | private _map = createHashMapFromArray [ 45 | ["isPlayer", _isPlayer], 46 | ["unit", _unit], 47 | ["classname", _classname], 48 | ["netId", _netId], 49 | ["uid", _uid], 50 | 51 | ["name", _name], 52 | ["profileName", _profileName], 53 | ["profileNameSteam", _profileNameSteam], 54 | ["clanTag", _clanTag], 55 | 56 | ["rank", _rank], 57 | ["rank_bis", _rank_bis], 58 | 59 | ["regiment", _regiment], 60 | ["company", _company], 61 | ["platoon", _platoon], 62 | ["squad", _squad], 63 | ["squadInsignia", _squadInsignia], 64 | ["team", _team], // Team Color 65 | 66 | ["abilityMedic", _abilityMedic], // ace ability 67 | ["abilityEngineer", _abilityEngineer], // ace ability 68 | ["abilityEOD", _abilityEOD] // ace ability 69 | ]; 70 | _map -------------------------------------------------------------------------------- /cScripts/functions/players/fn_unit_setInsignia.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function sets your insignia and save it to your profile. 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 1: Insignia 9 | * 10 | * Return Value: 11 | * Nothing 12 | * 13 | * Example: 14 | * [bob, "curator"] call cScripts_fnc_unit_setInsignia 15 | * 16 | */ 17 | 18 | params [ 19 | ["_unit", objNull, [objNull]], 20 | ["_insignia", "", [""]], 21 | ["_save", true, [true]] 22 | 23 | ]; 24 | 25 | [_unit, _insignia] call BIS_fnc_setUnitInsignia; 26 | 27 | if (!isPlayer _unit) exitWith {}; 28 | if (!_save) exitWith {}; 29 | 30 | [_insignia] call EFUNC(profile,saveInsignia); -------------------------------------------------------------------------------- /cScripts/functions/players/fn_unit_setTeamColor.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function sets the team color of the _unit based on displayName or Role Description 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return Value: 10 | * Array of color and name 11 | * 12 | * Example: 13 | * [bob] call cScripts_fnc_unit_setTeamColor 14 | * 15 | */ 16 | 17 | params [["_unit", objNull, [objNull]]]; 18 | 19 | private _name = ""; 20 | if !(roleDescription _unit == "") then { 21 | _name = roleDescription _unit; 22 | } else { 23 | _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); 24 | }; 25 | _name = _name splitString " "; 26 | _name = _name#0; 27 | _nameUpper = toUpper _name; 28 | 29 | private _color = switch (_nameUpper) do { 30 | case "ALPHA": {"RED"}; 31 | case "BRAVO": {"BLUE"}; 32 | case "CHARLIE": {"GREEN"}; 33 | case "DELTA": {"YELLOW"}; 34 | default {"WHITE"}; 35 | }; 36 | 37 | [_unit, _color] call ace_interaction_fnc_joinTeam; 38 | SETVAR(_unit,EGVAR(Unit,TeamColor),_color); 39 | 40 | INFO_2("TeamColor", "%1 was assigned as team %2.", _unit, _color); 41 | 42 | [_name, _color]; -------------------------------------------------------------------------------- /cScripts/functions/script_component.hpp: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addDefaultArsenalLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function creates a default loadouts and adds it to the arsenal based on the config loadout name. 5 | * The loadout is added to the players arsenal. 6 | * 7 | * Arguments: 8 | * None 9 | * 10 | * Return: 11 | * True on success 12 | * 13 | * Example: 14 | * call cScripts_fnc_addDefaultArsenalLoadout 15 | */ 16 | 17 | if (!EGVAR(patches,usesACEArsenal)) exitWith {}; 18 | 19 | INFO("Default Arsenal", "Setting up default arsenal loadout for unit..."); 20 | 21 | private _empty = [[],[],[],[],[],[],"","",[],["","","","","",""]]; 22 | ["", _empty, false] call ace_arsenal_fnc_addDefaultLoadout; 23 | 24 | private _loadout = [player] call EFUNC(gear,getLoadoutName); 25 | if !(isClass (missionConfigFile >> "CfgLoadouts" >> _loadout)) exitWith { 26 | SHOW_CHAT_WARNING_1("Default Arsenal", "Loadout '%1' does not exist inside of mission config. No default arsenal will be created.", _loadout); 27 | }; 28 | 29 | private _name = getText (missionConfigFile >> "CfgLoadouts" >> _loadout >> "displayName"); 30 | private _company = getText (missionConfigFile >> "CfgLoadouts" >> _loadout >> "company"); 31 | private _company = [_company] call CBA_fnc_capitalize; 32 | 33 | 34 | _name = format["[7CAV] %1 %2 (Default)", _company, _name]; 35 | private _loadout = parseSimpleArray getText (missionConfigFile >> "CfgLoadouts" >> _loadout >> "loadout"); 36 | if (EGVAR(patches,usesACRE)) then { _loadout = [_loadout] call acre_api_fnc_filterUnitLoadout }; 37 | 38 | [_name, _loadout, false] call ace_arsenal_fnc_addDefaultLoadout; 39 | INFO_1("Default Arsenal", "Loadout name %1 created for player arsenal", _name); 40 | 41 | true -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addDefaultArsenalLoadouts.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This adds default arsenal loadouts based on cfgLoadouts gear system loadouts. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return: 10 | * True on success 11 | * 12 | * Example: 13 | * call cScripts_fnc_addDefaultArsenalLoadouts 14 | * 15 | * Public: No 16 | */ 17 | 18 | if (!EGVAR(patches,usesACEArsenal)) exitWith {}; 19 | 20 | INFO(if (is3DEN) then {"EDEN Default Arsenal"} else {"Default Arsenal"}, "Setting up default arsenal loadouts..."); 21 | 22 | private _empty = [[],[],[],[],[],[],"","",[],["","","","","",""]]; 23 | ["", _empty] call ace_arsenal_fnc_addDefaultLoadout; 24 | 25 | private _classnameList = configProperties [missionconfigfile >> "CfgLoadouts", "getNumber (_x >> 'scope') >= 2", true]; 26 | { 27 | private _class = configName _x; 28 | private _classname = configName (missionConfigFile >> 'CfgLoadouts' >> _class); 29 | private _company = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "company"); 30 | _company = [_company] call CBA_fnc_capitalize; 31 | private _displayName = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "displayName"); 32 | private _loadout = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "loadout"); 33 | _loadout = parseSimpleArray _loadout; 34 | if (EGVAR(patches,usesACRE)) then { _loadout = [_loadout] call acre_api_fnc_filterUnitLoadout }; 35 | private _name = format["[%1] %2 - %3", EGVAR(Settings,primaryClanTag), _company, _displayName]; 36 | 37 | INFO_1(if (is3DEN) then {"EDEN Default Arsenal"} else {"Default Arsenal"}, "Setting up default arsenal loadout '%1'.", _displayName); 38 | 39 | // Error if 40 | if (_displayName == "") exitWith { 41 | private _scope = getNumber (missionConfigFile >> 'CfgLoadouts' >> _class >> "scope"); 42 | SHOW_ERROR_2(if (is3DEN) then {"EDEN Default Arsenal"} else {"Default Arsenal"}, "No displayName for %1 with scope %2.", _class, _scope); 43 | }; 44 | [_name, _loadout] call ace_arsenal_fnc_addDefaultLoadout; 45 | } forEach _classnameList; 46 | 47 | true -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addHeal.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This adds a adda ction as well as a ACE interaction reGear selection. The script reapplyes the players start loadout. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 9 | * Example: 10 | * [this] call cScripts_fnc_addHeal; 11 | */ 12 | 13 | params [ 14 | ["_object", objNull, [objNull]], 15 | ["_category", ["ACE_MainActions"], [["ACE_MainActions"]]] 16 | ]; 17 | 18 | // Make addAction 19 | if (!isPlayer _object) then { 20 | _object addAction [" Heal", { 21 | params ["_target", "_caller", "_actionId", "_arguments"]; 22 | [_target, _caller] call ace_medical_treatment_fnc_fullHeal; 23 | [[],["You have been healed"], [""], [""]] call CBA_fnc_notify; 24 | }, [], 1.5, true, true, "", QUOTE(!GVAR(OneLife)), 5]; 25 | }; 26 | 27 | // Make ACE Interaction for ReGear 28 | private _Icon = "\z\ACE\addons\medical_gui\ui\cross.paa"; 29 | private _healStatement = { 30 | [_this select 0, player] call ace_medical_treatment_fnc_fullHeal; 31 | [[],["You have been healed"], [""], [""]] call CBA_fnc_notify; 32 | }; 33 | 34 | private _actionType = parseNumber (isPlayer _object); 35 | 36 | private _healAction = [QEGVAR(Actions,HealAction), "Heal", "\z\ACE\addons\medical_gui\ui\cross.paa", _healStatement, {!GVAR(OneLife)}] call ace_interact_menu_fnc_createAction; 37 | [_object, _actionType, _category, _healAction] call ace_interact_menu_fnc_addActionToObject; 38 | 39 | true -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addInsigniaSelection.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function generates a insignia selection button. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Lable 9 | * 2: actionName 10 | * 3: Path to icon 11 | * 4: Categorys (Optional) 12 | * 13 | * Example: 14 | * [this,"Remove Insignia"] call cScripts_fnc_addInsigniaSelection; 15 | * [this,"Squad Insignia 1/1/C/1-7","11C_17_Insignia","cScripts\Data\Insignia\1-1-C-17.paa"] call cScripts_fnc_addInsigniaSelection; 16 | * [this,"Platoon Insignia 1/1/C/1-7","2C_17_Insignia","cScripts\Data\Insignia\2-C-17.paa"] call cScripts_fnc_addInsigniaSelection; 17 | */ 18 | 19 | params [ 20 | ["_object", objNull, [objNull]], 21 | ["_lable", "", [""]], 22 | ["_className", "", [""]], 23 | ["_icon", "", [""]], 24 | ["_category", ["ACE_MainActions","cScriptInsigniaSelectionMenu"], [[]]] 25 | ]; 26 | 27 | if (_className != '') then { 28 | _className = format[QUOTE(TRIPLES(Cav,Insignia,%1)), _className]; 29 | } else { 30 | _className = _className; 31 | }; 32 | 33 | INFO_2("InsigniaSelection", "Created insignia selection for '%1' on '%2'", _className, _object); 34 | 35 | //add addAction 36 | if (!isPlayer _object) then { 37 | if (_category isEqualTo ["ACE_MainActions", "cScriptInsigniaSelectionMenu"]) then { 38 | _object addAction [format [" %2", _icon, _lable], { 39 | [player, _this select 3] call EFUNC(unit,setInsignia); 40 | }, _className, 1.5, true, true, "", "true", 5]; 41 | }; 42 | }; 43 | 44 | //add aceInteraction 45 | private _insigniaSelection = [format ["cScriptInsigniaSelection_%1", _className], _lable, _icon, { 46 | params ["_object", "_caller", "_params"]; 47 | _params params ["_className"]; 48 | [player, _className] call EFUNC(unit,setInsignia); 49 | }, {true}, {}, [_className]] call ace_interact_menu_fnc_createAction; 50 | 51 | private _actionType = parseNumber (isPlayer _object); 52 | [_object, _actionType, _category, _insigniaSelection] call ace_interact_menu_fnc_addActionToObject; 53 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addLoadoutSelection.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A (With help from Commy2) 4 | * This function generates a quick selection button. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Lable [Default: ""] 9 | * 2: Loadout classname [Default: ""] 10 | * 3: Path to icon (Optional) [Default: ""] 11 | * 4: Categorys (Optional) [Default: ["ACE_MainActions","cScripts_Loadout_Cat_Main"]] 12 | * 5: Company required to use (Optional) [Default: ""] 13 | * 6: Allow All Loadouts (Optional) [Default: false] 14 | * 15 | * Example: 16 | * [this,"Rifleman","Class_Rifleman"] call cScripts_fnc_addLoadoutSelection; 17 | * [this,"Rifleman","Class_Rifleman","",["ACE_MainActions","cScripts_Loadout_Cat_Main"],""] call cScripts_fnc_addLoadoutSelection; 18 | * [this,"Rifleman","Class_Rifleman","",["ACE_MainActions","cScripts_Loadout_Cat_Main"],"", false] call cScripts_fnc_addLoadoutSelection; 19 | * 20 | * Public: No 21 | */ 22 | 23 | params [ 24 | ["_object", objNull, [objNull]], 25 | ["_lable", "", [""]], 26 | ["_className", "", [""]], 27 | ["_icon", "", [""]], 28 | ["_category", ["ACE_MainActions", "cScripts_Loadout_Cat_Main"], [[]]], 29 | ["_company", "", [""]], 30 | ["_platoon", 0, [0]], 31 | ["_allowAllLoadouts", false] 32 | ]; 33 | 34 | private _condition = { 35 | params ["", "", "_params"]; 36 | _params params ["_className", "_company", "_allowAllLoadouts"]; 37 | if (_allowAllLoadouts) exitWith {true}; 38 | if ([player] call EFUNC(gear,getLoadoutName) == _className) exitWith {true}; 39 | if ([_company,_platoon] call FUNC(allowLoadout)) exitWith {true}; 40 | false 41 | }; 42 | 43 | private _action = [format ["cScripts_Loadout_%1", _className], _lable, _icon, { 44 | params ["", "", "_params"]; 45 | _params params ["_className"]; 46 | [player] call EFUNC(gear,removeLoadout); 47 | [player, _className] call EFUNC(gear,applyLoadout); 48 | }, _condition, {}, [_className, _company, _allowAllLoadouts]] call ace_interact_menu_fnc_createAction; 49 | 50 | private _actionType = parseNumber (isPlayer _object); 51 | [_object, _actionType, _category, _action] call ace_interact_menu_fnc_addActionToObject; 52 | 53 | INFO_4("LoadoutSelector", "%1; selector '%2' with type %3 added for '%4' crate.", _object, _lable, _actionType, _company); 54 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addObjectToCurator.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * Add object to all curators on next frame. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 9 | * Example: 10 | * [this] call cScripts_fnc_addObjectToCurator 11 | * 12 | * Public: No 13 | */ 14 | 15 | params [["_object", objNull, [objNull]]]; 16 | 17 | INFO_1("addObjectToCurator", "%1 has been added to all curators.", _object); 18 | 19 | [{ 20 | { 21 | _x addCuratorEditableObjects [[_this], true]; 22 | } forEach allCurators; 23 | }, _object] call CBA_fnc_execNextFrame; -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_addReGear.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This adds a reGear selection option. The script reApplyes the players start loadout. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: ACE Category (Optional) 9 | * 10 | * Example: 11 | * [this] call cScripts_fnc_addReGear 12 | * [this] call cScripts_fnc_addReGear 13 | * [this, ["ACE_MainActions"]] call cScripts_fnc_addReGear 14 | */ 15 | 16 | params [ 17 | ["_object", objNull, [objNull]], 18 | ["_category", ["ACE_MainActions"], [["ACE_MainActions"]]] 19 | ]; 20 | 21 | // Make addAction 22 | if (!isPlayer _object) then { 23 | _object addAction [" ReGear", { 24 | params ["_target", "_caller", "_actionId", "_arguments"]; 25 | [QEGVAR(gear,applyLoadout)] call CBA_fnc_localEvent; 26 | [[],["You have been rearmed"], [""], [""]] call CBA_fnc_notify; 27 | }, [], 1.5, true, true, "", "true", 5]; 28 | }; 29 | 30 | // Make ACE Interaction for ReGear 31 | private _Icon = "cScripts\Data\Icon\icon_00.paa"; 32 | private _regearStatement = { 33 | [QEGVAR(gear,applyLoadout)] call CBA_fnc_localEvent; 34 | [[],["You have been rearmed"], [""], [""]] call CBA_fnc_notify; 35 | }; 36 | private _actionType = parseNumber (isPlayer _object); 37 | 38 | private _regearAction = ["cScriptsReGearAce", "ReGear", _Icon, _regearStatement, {true}] call ace_interact_menu_fnc_createAction; 39 | [_object, _actionType, _category, _regearAction] call ace_interact_menu_fnc_addActionToObject; 40 | 41 | true 42 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_allowLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return true if you allow to take a loadout. 5 | * 6 | * Arguments: 7 | * 0: Required company 8 | * 9 | * Return Value: 10 | * True or False 11 | * 12 | * Example: 13 | * ["key"] call cScripts_fnc_allowLoadout; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_company", "_platoon"]; 19 | 20 | _company = toLower _company; 21 | 22 | // If you dont have a company don't show any. 23 | if (_company == "") exitWith {false}; 24 | 25 | // There are 4 platoons in a company. 0 is for if there is no difference between the companies. 26 | if (_platoon < 0 || _platoon > 4) exitWith {false}; 27 | 28 | 29 | // Show all loadouts 30 | if (EGVAR(Settings,showAllLoadouts)) exitWith {true}; 31 | if (EGVAR(Staging,showAllLoadouts)) exitWith {true}; 32 | 33 | 34 | // Check if player is Zeus or Debug 35 | if (call EFUNC(player,isCurator)) exitWith {true}; 36 | if (call EFUNC(player,isMissionAdmin)) exitWith {true}; 37 | 38 | // Check if does not have any company 39 | private _playerCompany = call EFUNC(player,getCompany); 40 | if (_playerCompany == "") exitWith {false}; 41 | 42 | if (_playerCompany == _company) exitWith {true}; 43 | 44 | false -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_checkStagingZone.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function checks if your near a staging zone and change the global variable for the player. 5 | * 6 | * Arguments: 7 | * None 8 | * 9 | * Return: 10 | * True or False 11 | * 12 | * Example: 13 | * call cScripts_fnc_checkStagingZone 14 | */ 15 | 16 | false; 17 | private _stagingZones = GETMVAR(EGVAR(Staging,Zones), []); 18 | private _stagingZonesEnabled = GETMVAR(EGVAR(Mission,stagingZonesEnabled), true); 19 | 20 | if !(_stagingZonesEnabled) exitWith { false }; 21 | if (EGVAR(Staging,ZoneStatus)) exitWith { true }; 22 | 23 | if (count _stagingZones > 0) then { 24 | { 25 | _x params ["_zone", "_size", "_type"]; 26 | 27 | private _playerHight = (getPosVisual player)#2; 28 | if (player inArea _zone && _playerHight <= 30 ) exitWith { true }; 29 | 30 | // Object distacne check 31 | private _objectZoneSize = _size#0; 32 | private _distance = if (_type isEqualType objNull) then {player distance getPos _zone} else {999999}; 33 | private _checkDistance = if (_type isEqualType objNull) then {_distance <= _objectZoneSize} else {false}; 34 | if (_checkDistance) exitWith { true }; 35 | false 36 | } forEach _stagingZones; 37 | } else { false }; 38 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_clearDefaultArsenalLoadouts.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function remove all ace arsenal default loadouts. 5 | * 6 | * Example: 7 | * call cScripts_fnc_removeDefaultArsenalLoadouts 8 | * 9 | * Public: No 10 | */ 11 | 12 | if (!EGVAR(patches,usesACEArsenal)) exitWith {}; 13 | 14 | ace_arsenal_defaultLoadoutsList = []; 15 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_clearRadioIds.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return a funtion icon path or path provided. 5 | * 6 | * Arguments: 7 | * nothing 8 | * 9 | * Return Value: 10 | * Nothing 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_clearRadioIds 14 | * 15 | */ 16 | 17 | if (!EGVAR(Patches,usesACRE) && !EGVAR(Patches,usesTFAR)) exitWith {}; 18 | if (!EGVAR(Settings,enableRadios)) exitWith {}; 19 | if (!GVAR(isPlayer)) exitWith {}; 20 | 21 | // ACRE 22 | if (EGVAR(patches,usesACRE)) exitWith { 23 | private _playerRadios = [] call acre_api_fnc_getCurrentRadioList; 24 | 25 | { 26 | private _base = [_x] call acre_api_fnc_getBaseRadio; 27 | player removeItem _x; 28 | player addItem _base; 29 | } forEach _playerRadios; 30 | 31 | [{ 32 | [player] call FUNC(setRadioChannel); 33 | ["ACRE_PRC343"] call FUNC(setActiveRadio); 34 | }] call CBA_fnc_execNextFrame; 35 | 36 | "Your radios have been reset" call CBA_fnc_notify; 37 | 38 | SHOW_CHAT_SERVER_INFO("ClearRadioID", "%1: Your radios have been reset", name player) 39 | }; 40 | 41 | // TFAR 42 | if (EGVAR(patches,usesTFAR)) exitWith { 43 | /** TODO: Code goes here */ 44 | }; 45 | 46 | SHOW_CHAT_ERROR("ClearRadioID", "Fatal"); 47 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_createActionCategory.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This script creates a ace category. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: ActionName 9 | * 2: Lable 10 | * 3: Path to icon 11 | * 4: Categorys (Optional) 12 | * 5: Condition (Optional) 13 | * 14 | * Example: 15 | * [this,"MyCategory","Insignia","icon.paa",["ACE_MainActions"]] call cScripts_fnc_createActionCategory; 16 | * [this,"MySecondCategory","Misc","data/icon.paa",["ACE_MainActions","MyCategory"]] call cScripts_fnc_createActionCategory; 17 | */ 18 | 19 | params [ 20 | ["_object", objNull, [objNull]], 21 | ["_name", "", [""]], 22 | ["_lable", "", [""]], 23 | ["_icon", "", [""]], 24 | ["_category", ["ACE_MainActions"], [[]]], 25 | ["_condition", { true }] 26 | ]; 27 | 28 | // Make ACE Category 29 | private _aceInteractionAction = [_name, _lable, _Icon, {}, _condition] call ace_interact_menu_fnc_createAction; 30 | private _actionType = parseNumber (isPlayer _object); 31 | [_object, _actionType, _category, _aceInteractionAction] call ace_interact_menu_fnc_addActionToObject; 32 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_createVehicleLable.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function create a texture that is attached to a given object. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: Position 9 | * 2: Rotation 10 | * 3: Texture 11 | * 4: Vector (Optional) (Default; [0,0,1]) 12 | * 4: VectorDirAndUp (Alternative; if Rotation is False) 13 | * 1: vectorDir [x1, y1, z1] 14 | * 2: vectorUp [x2, y2, z2] 15 | * 16 | * Example: 17 | * ["UH60", [-0.49,-2.45,-1.3], 87, "path/to/texture.paa"] call cScripts_fnc_createVehicleLable 18 | * ["C130", [0.205,-11.9,8.920],-90, "path/to/texture.paa", [-0.05,0,1]] call cScripts_fnc_createVehicleLable 19 | * ["Stryker", [1.666,-1.32,-0.42] , false, "path/to/texture.paa", [[-1,0,-0.152], [0,0,1]]] call cScripts_fnc_createVehicleLable; 20 | * 21 | */ 22 | 23 | params [ 24 | ["_vehicle", objNull, [objNull]], 25 | ["_pos", [0,0,0]], 26 | ["_dir", 0, [0, false]], 27 | ["_texture", "", [""]], 28 | ["_vector",[0,0,1], [[]]] 29 | ]; 30 | 31 | 32 | if (!isServer) exitWith {}; 33 | if (_texture == '') exitWith {}; 34 | if (!fileExists _texture) exitWith { 35 | SHOW_CHAT_ERROR_3("VehicleLable", "Texture '%1' tried to be applied to %2 (%3) does not exist.", _texture, _vehicle, typeOf _vehicle); 36 | }; 37 | 38 | INFO_3("VehicleLabel","Texture label '%1' is being created for %2 (%3).", _texture, _vehicle, typeOf _vehicle); 39 | 40 | private _label = "UserTexture1m_F" createVehicle [0,0,0]; 41 | _label attachTo [_vehicle, _pos]; 42 | _label setObjectTextureGlobal [0, _texture]; 43 | 44 | private _checkDirType = _dir isEqualType 0; 45 | if (_checkDirType) then { 46 | _label setDir _dir; 47 | _label setvectorUp _vector; 48 | } else { 49 | _label setVectorDirAndUp _vector; 50 | }; 51 | 52 | // Collect lables in to variable 53 | private _labels = _vehicle getVariable [QEGVAR(Vehicle,Labels), []]; 54 | _labels pushBack _label; 55 | _vehicle setVariable [QEGVAR(Vehicle,Labels), _labels, true]; 56 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_deleteDroppedObjects.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * This function deletes objects and junk on the ground in a given radius. 4 | * 5 | * Arguments: 6 | * 0: Object 7 | * 1: Radius 8 | * 9 | * Example: 10 | * [this,5] call cScripts_fnc_deleteDroppedObjects 11 | * [_object,5] call cScripts_fnc_deleteDroppedObjects 12 | * 13 | */ 14 | 15 | params [ 16 | ["_object", objNull, [objNull]], 17 | ["_radius", 5] 18 | ]; 19 | 20 | [_object, "ContainerClosed", { 21 | params ["_object", "_unit"]; 22 | [{(count ((_this select 0) nearEntities ["Man", (_this select 1)]) < 1)}, {{ deleteVehicle _x; } forEach nearestObjects [getpos (_this select 0), ["WeaponHolder", "GroundWeaponHolder"], (_this select 1)];}, [_object, _thisArgs]] call CBA_fnc_waitUntilAndExecute; 23 | }, _radius] call CBA_fnc_addBISEventHandler; -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_doGetOutHeloSide.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A (With the help from; 654wak654) 4 | * Move the player outside the passanger door on the left or right side. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Door side (Default Left/true) 9 | * 10 | * Example: 11 | * [this, true] call cScripts_fnc_doGetOutHeloSide; 12 | */ 13 | 14 | params [ 15 | ["_vehicle", objNull, [objNull]], 16 | ["_doorSide", true] 17 | ]; 18 | 19 | private _rhs_UH60 = [ 20 | "RHS_UH60M_MEV_d", 21 | "RHS_UH60M_MEV2_d", 22 | "RHS_UH60M2_d", 23 | "RHS_UH60M_ESSS_d", 24 | "RHS_UH60M_ESSS2_d", 25 | "RHS_UH60M_d", 26 | "RHS_UH60M", 27 | "RHS_UH60M_ESSS", 28 | "RHS_UH60M_ESSS2", 29 | "RHS_UH60M2", 30 | "RHS_UH60M_MEV2", 31 | "RHS_UH60M_MEV" 32 | ]; 33 | private _UH80 = [ 34 | "B_CTRG_Heli_Transport_01_sand_F", 35 | "B_CTRG_Heli_Transport_01_tropic_F", 36 | "B_Heli_Transport_01_F" 37 | ]; 38 | 39 | // Door Animation handler 40 | if (_doorSide) then { // Left 41 | if (typeOf _vehicle in _rhs_UH60) then { 42 | if (_vehicle doorPhase "doorLB" == 0) then{ 43 | _vehicle animateDoor ["doorLB", 1]; 44 | } else { 45 | if (_vehicle doorPhase "doorLB" != 0) then { 46 | [_vehicle, "doorLB"] spawn rhs_fnc_doorHandler; 47 | }; 48 | }; 49 | }; 50 | } else { // Right 51 | if (typeOf _vehicle in _rhs_UH60) then { 52 | if (_vehicle doorPhase "doorRB" == 0) then{ 53 | _vehicle animateDoor ["doorRB", 1]; 54 | } else { 55 | if (_vehicle doorPhase "doorRB" != 0) then { 56 | [_vehicle, "doorRB"] spawn rhs_fnc_doorHandler; 57 | }; 58 | }; 59 | }; 60 | }; 61 | sleep 1; 62 | 63 | private _dir = getDir _vehicle; 64 | _dir = if (_doorSide) then { _dir - 50 } else { _dir + 50 }; 65 | 66 | private _posASL = (getPosASL _vehicle) vectorAdd [sin _dir * 2.5, cos _dir * 2.5, 0]; 67 | moveOut player; 68 | player setPosASL _posASL; 69 | 70 | if (_doorSide) then { // Left 71 | player setDir _dir - 40; 72 | } else { // Right 73 | player setDir _dir + 40; 74 | }; 75 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_filterUnitLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: ACRE2Team, CPL.Brostrom.A 4 | * Filters unitLoadout for ACRE or TFAR ID classes and replacing them for base classes. 5 | * 6 | * Arguments: 7 | * 0: Loadout (default: getUnitLoadout player) 8 | * 9 | * Return Value: 10 | * Loadout 11 | * 12 | * Example: 13 | * _loadout = [_loadout] call cScripts_fnc_filterUnitLoadout; 14 | * _loadout = [getUnitLoadout _unit] call cScripts_fnc_filterUnitLoadout; 15 | * _loadout = [player] call cScripts_fnc_filterUnitLoadout; 16 | * 17 | * Public: Yes 18 | */ 19 | 20 | params [["_loadout", getUnitLoadout player, [[], objNull, "", configNull]]]; 21 | 22 | if !(_loadout isEqualType []) then { 23 | _loadout = [_loadout] call CBA_fnc_getLoadout; 24 | }; 25 | 26 | if (_loadout isEqualTo []) exitWith { 27 | _loadout; 28 | }; 29 | 30 | private _baseLoadout = _loadout; 31 | if (EGVAR(Patches,usesACEAX)) then { 32 | _baseLoadout = _loadout#0; 33 | }; 34 | 35 | // Remove "ItemRadioAcreFlagged" 36 | if (_baseLoadout#9#2 == "ItemRadioAcreFlagged") then { 37 | _baseLoadout#9 set [2, ""]; 38 | }; 39 | 40 | // Set ACRE base classes 41 | private _replaceRadio = { 42 | params ["_item"]; 43 | if (EGVAR(Patches,usesACRE)) then { 44 | // Replace only if string (array can be eg. weapon inside container) and an ACRE radio 45 | if (!(_item isEqualType []) && {[_item] call acre_api_fnc_isRadio}) then { 46 | _this set [0, [_item] call acre_api_fnc_getBaseRadio]; 47 | }; 48 | }; 49 | if (EGVAR(Patches,usesTFAR)) then { 50 | // Replace only if string (array can be eg. weapon inside container) and an TFAR radio 51 | if (!(_item isEqualType []) && {_item call TFAR_fnc_isRadio}) then { 52 | private _baseClassRadio = getText (configFile >> "CfgWeapons" >> _item >> "ace_arsenal_uniqueBase"); 53 | _this set [0, _baseClassRadio]; 54 | }; 55 | }; 56 | }; 57 | 58 | if ((_baseLoadout#3) isNotEqualTo []) then { 59 | {_x call _replaceRadio} forEach (_baseLoadout#3#1); // Uniform items 60 | }; 61 | 62 | if ((_baseLoadout#4) isNotEqualTo []) then { 63 | {_x call _replaceRadio} forEach (_baseLoadout#4#1); // Vest items 64 | }; 65 | 66 | if ((_baseLoadout#5) isNotEqualTo []) then { 67 | {_x call _replaceRadio} forEach (_baseLoadout#5#1); // Backpack items 68 | }; 69 | 70 | if (EGVAR(Patches,usesACEAX)) then { 71 | _loadout set [0,_baseLoadout]; 72 | }; 73 | 74 | _loadout -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_getIcon.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function return a icon from config or path provided. It also allow a fallback icon 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 1: Fallback Icon 9 | * 10 | * Return Value: 11 | * Path of icon 12 | * 13 | * Example: 14 | * ["\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"] call cScripts_fnc_getIcon 15 | * ["iconManLeader"] call cScripts_fnc_getIcon 16 | * 17 | */ 18 | 19 | params[["_icon", "", [""]]]; 20 | 21 | { 22 | if (_x != "") exitWith {_x}; 23 | } forEach [ 24 | getText (configFile >> 'CfgVehicleIcons' >> _icon), 25 | getText (configFile >> 'CfgGroupIcons' >> _icon >> "icon"), 26 | getText (configfile >> "CfgUnitInsignia" >> _icon >> "texture"), 27 | if (fileExists _icon) then {_icon} else {""} 28 | ]; 29 | 30 | "" -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_getRadioBase.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function is both a wrapper and function that retreave the baseclass of a radio. 5 | * 6 | * Arguments: 7 | * 0: Radio 8 | * 9 | * Return Value: 10 | * Radio Baseclass 11 | * 12 | * Example: 13 | * ["ACRE_PRC343"] call cScripts_fnc_getRadioBase 14 | * ["TFAR_anprc152"] call cScripts_fnc_getRadioBase 15 | * 16 | */ 17 | 18 | params[["_radio", "", [""]]]; 19 | 20 | if (!EGVAR(Patches,usesACRE) && !EGVAR(Patches,usesTFAR)) exitWith {_radio}; 21 | if (!EGVAR(Settings,enableRadios)) exitWith {_radio}; 22 | 23 | if (EGVAR(patches,usesACRE)) exitWith {[_radio] call acre_api_fnc_getBaseRadio}; 24 | 25 | if (EGVAR(patches,usesTFAR)) exitWith { 26 | private _radioBase = getText (configFile >> "CfgWeapons" >> _radio >> "tf_parent"); 27 | if (_radioBase isEqualTo "") exitWith {_radio}; 28 | _radioBase; 29 | }; 30 | 31 | SHOW_CHAT_ERROR("RadioGetBase", "Fatal"); 32 | _radio -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_getServerMetrics.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: Liber.N 4 | * This function allow you to get statistics from the server. 5 | * 6 | * Arguments: 7 | * 0: Client ID 8 | * 9 | * Return Value: 10 | * Nothing 11 | * 12 | * Example: 13 | * [owner player] call cScripts_fnc_getServerMetrics 14 | * 15 | * Public: No 16 | */ 17 | 18 | params ["_clientID"]; 19 | 20 | private _countUnits = ({ local _x } count allUnits); 21 | private _countGroups = ({ local _x } count allGroups); 22 | private _countVehicles = ({ local _x } count vehicles); 23 | 24 | private _countGlobalUnits = (count allUnits); 25 | private _countGlobalGroups = (count allGroups); 26 | private _countGlobalVehicles = (count vehicles); 27 | 28 | private _fps = (round diag_fps); 29 | private _fpsMin = (round diag_fpsMin); 30 | private _upTime = (round diag_tickTime); 31 | private _missionTime = (round time); 32 | 33 | private _activeScripts = diag_activeScripts; 34 | private _spawn = _activeScripts select 0; 35 | private _execVM = _activeScripts select 1; 36 | private _exec = _activeScripts select 2; 37 | private _execFSM = _activeScripts select 3; 38 | 39 | private _local_units = format ["
- Server -
Units: %1
Groups: %2
Vehicles: %3

",_countUnits,_countGroups,_countVehicles]; 40 | private _global_units = format ["
- Global -
Units: %1
Groups: %2
Vehicles: %3

",_countGlobalUnits,_countGlobalGroups,_countGlobalVehicles] ; 41 | private _scripts = format ["
- Scripts -
Spawn: %1
execVM: %2
Exec: %3
execFSM: %4

",_countUnits,_countGroups,_countVehicles]; 42 | private _fps_all = format ["
- Performance -
FPS: %1
FpsMin: %2
Uptime: %3
MissionTime: %4

",_fps,_fpsMin,_upTime,_missionTime]; 43 | 44 | parseText (_local_units + _global_units + _scripts + _fps_all) remoteExec ["hint", _clientID]; -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_isValidFaction.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * Checks if the given object is in the faction array and there for return true or false 5 | * 6 | * Arguments: 7 | * 0: Unit 8 | * 9 | * Return Value: 10 | * True or False 11 | * 12 | * Example: 13 | * [player] call cScripts_fnc_isValidFaction 14 | * [_vehicle] call cScripts_fnc_isValidFaction 15 | * 16 | */ 17 | 18 | params[["_unit", objNull, [objNull]]]; 19 | 20 | private _factionArray = parseSimpleArray EGVAR(Settings,vehicleFactions); 21 | 22 | if !(_factionArray isEqualType []) exitWith { 23 | SHOW_CHAT_ERROR("FactionArray", "Faction array has not been setup correctly."); 24 | false 25 | }; 26 | 27 | faction _unit in _factionArray; 28 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_para_backpack.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This save your current objects inside of your backpack as a variable 5 | * And simulate a packpack on your chest. Action is added to allow you to swap back. 6 | * 7 | * Arguments: 8 | * 0: Player 9 | * 1: ChuteBackpackClass (Optional) (Default; "B_Parachute") 10 | * 11 | * Example: 12 | * ["bob"] call cScripts_fnc_para_backpack 13 | * ["bob", "B_Parachute"] call cScripts_fnc_para_backpack 14 | * 15 | */ 16 | 17 | params [ 18 | ["_player", objNull, [objNull]], 19 | ["_chuteBackpackClass", "B_Parachute", ["B_Parachute"]] 20 | ]; 21 | 22 | private _backpack = backpack _player call BIS_fnc_basicBackpack; 23 | 24 | private _cargo = backpackItems _player; 25 | 26 | private _backpackAndContent = [_backpack, _cargo]; 27 | 28 | _player setVariable [QEGVAR(player,backpack), _backpackAndContent]; 29 | 30 | removeBackpack _player; 31 | _player addBackpack _chuteBackpackClass; 32 | 33 | _player forceWalk true; 34 | 35 | [ 36 | _player, 37 | "Put on backpack", 38 | "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unloadDevice_ca.paa", 39 | "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unloadDevice_ca.paa", 40 | format["((count (_this getVariable ['%1', []])) > 1) && ((getPosATL _this)#2 < 2)", QEGVAR(player,backpack)], 41 | format["((count (_caller getVariable ['%1', []])) > 1) && ((getPosATL _caller)#2 < 5)", QEGVAR(player,backpack)], 42 | {}, 43 | {}, 44 | { 45 | params ["_target", "_caller", "_actionId", "_arguments"]; 46 | private _backpackAndContent = _caller getVariable [QEGVAR(player,backpack), []]; 47 | _backpackAndContent params [ 48 | ["_backpack", ""], 49 | ["_cargo", []] 50 | ]; 51 | 52 | removeBackpack _caller; 53 | _caller addBackpack _backpack; 54 | 55 | { 56 | _caller addItemToBackpack _x; 57 | } forEach _cargo; 58 | 59 | _caller setVariable [QEGVAR(player,backpack), nil]; 60 | 61 | _caller forceWalk false; 62 | }, 63 | {}, 64 | [], 65 | 5, 66 | 0, 67 | false, 68 | false 69 | ] call BIS_fnc_holdActionAdd; -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_para_haloJump.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function throw a player out from a airplane and replaces their current backpack with a parachute. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Vehicle 9 | * 2: Chute Vehicle (Optional) [Default; "NonSteerable_Parachute_F"] 10 | * 3: Staggared Jump (Optional) [Default; false] 11 | * 12 | * Example: 13 | * ["bob","my_C130"] call cScripts_fnc_para_haloJump 14 | * ["bob","my_C130", "NonSteerable_Parachute_F", false] call cScripts_fnc_para_haloJump 15 | * 16 | */ 17 | 18 | params [ 19 | ["_player", objNull, [objNull]], 20 | ["_vehicle", objNull, [objNull]], 21 | ["_chuteBackpackClass", "B_Parachute"], 22 | ["_allowStaggared", false, [false]] 23 | ]; 24 | 25 | private _offset = if (_allowStaggared) then { 26 | if (GETVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),true)) then { 27 | 12+(random [-5,0,5]); 28 | } else { 29 | -12+(random [-5,0,5]); 30 | }; 31 | } else { 32 | random [-14,0,14]; 33 | }; 34 | 35 | if (_allowStaggared) then { 36 | private _side = GETVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),true); 37 | SETPVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),!_side); 38 | }; 39 | 40 | _player allowDamage false; 41 | 42 | private _dir = getDir _vehicle - 50; 43 | moveOut _player; 44 | private _pos = ([_vehicle, 14, ((getDir _vehicle) + 180 + _offset)] call BIS_fnc_relPos); 45 | _pos = [_pos#0, _pos#1, ((getPosATL _vehicle)#2)];; 46 | _player setPosATL _pos; 47 | _player setDir _dir - 140; 48 | 49 | sleep 1.5; 50 | 51 | [_player, true] call EFUNC(para,equipment); 52 | 53 | sleep 0.5; 54 | 55 | [_player] call EFUNC(para,backpack); 56 | 57 | sleep 0.5; 58 | 59 | _player allowDamage true; 60 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_para_lineJump.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This jump throw a player out of a aircraft and attaches a parashoot. 5 | * 6 | * Arguments: 7 | * 0: Player 8 | * 1: Vehicle 9 | * 2: Chute Vehicle (Optional) [Default; "NonSteerable_Parachute_F"] 10 | * 3: Staggared Jump (Optional) [Default; false] 11 | * 12 | * Example: 13 | * ["bob","my_C130"] call cScripts_fnc_para_lineJump 14 | * ["bob","my_C130", "NonSteerable_Parachute_F", false] call cScripts_fnc_para_lineJump 15 | * 16 | */ 17 | 18 | params [ 19 | ["_player", objNull, [objNull]], 20 | ["_vehicle", objNull, [objNull]], 21 | ["_chuteVehicleClass", "NonSteerable_Parachute_F"], 22 | ["_allowStaggared", false, [false]] 23 | ]; 24 | 25 | private _offset = if (_allowStaggared) then { 26 | if (GETVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),true)) then { 27 | 12+(random [-5,0,5]); 28 | } else { 29 | -12+(random [-5,0,5]); 30 | }; 31 | } else { 32 | random [-14,0,14]; 33 | }; 34 | 35 | if (_allowStaggared) then { 36 | private _side = GETVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),true); 37 | SETPVAR(_vehicle,EGVAR(VehicleFunc,StaggaredSide),!_side); 38 | }; 39 | 40 | _player allowDamage false; 41 | 42 | private _dir = getDir _vehicle - 50; 43 | moveOut _player; 44 | private _pos = ([_vehicle, 14, ((getDir _vehicle) + 180 + _offset)] call BIS_fnc_relPos); 45 | _pos = [_pos#0, _pos#1, ((getPosATL _vehicle)#2)];; 46 | _player setPosATL _pos; 47 | _player setDir _dir - 140; 48 | 49 | sleep 1.5; 50 | private _velocity = velocity _player; 51 | private _chute = createVehicle [_chuteVehicleClass, (position _player), [], 0, "CAN_COLLIDE"]; 52 | _chute AttachTo [_player, [0,0,0]]; 53 | detach _chute; 54 | _player moveInDriver _chute; 55 | _chute setVelocity _velocity; 56 | 57 | [_player] call EFUNC(para,equipment); 58 | 59 | sleep 0.5; 60 | 61 | _player allowDamage true; 62 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_renameObject.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function renames a given object. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Name 9 | * 10 | * Return Value: 11 | * Name or Empty string 12 | * 13 | * Example: 14 | * [_object, "My Supply Crate"] call cScripts_fnc_renameObject 15 | * 16 | * Public: Yes 17 | */ 18 | 19 | params[ 20 | ["_object", objNull, [objNull]], 21 | ["_name", "", [""]] 22 | ]; 23 | 24 | if (!EGVAR(patches,usesACE)) exitWith {""}; 25 | if (!isNil {ace_cargo_noRename}) exitWith {""}; 26 | if (_object getVariable ["ace_cargo_noRename", false]) exitWith {""}; 27 | 28 | if (_name isEqualTo "") exitWith { 29 | _object setVariable ["ace_cargo_customName", nil, true]; 30 | "" 31 | }; 32 | 33 | _object setVariable ["ace_cargo_customName", _name, true]; 34 | 35 | _name -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_setupLoadoutSelection.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function setup a quick loadout selection bases on config 5 | * 6 | * Arguments: 7 | * 0: Vehicle/Object/Crate 8 | * 1: Allow Only For Company (Optional) (Default; true) 9 | * 2: Ace Interact Category (Optional) (Default; ACE_MainActions) 10 | * 11 | * Return Value: 12 | * Nothing 13 | * 14 | * Example: 15 | * [this, "Charlie", "ACE_MainActions", true] call cScripts_fnc_setupLoadoutSelection; 16 | * [this, "Charlie", "ACE_SelfActions", true] call cScripts_fnc_setupLoadoutSelection; 17 | * 18 | * Public: No 19 | */ 20 | 21 | params[ 22 | ["_object", objNull, [objNull]], 23 | ["_aceCategory", "ACE_MainActions", ["ACE_MainActions"]], 24 | ["_allowAllLoadouts", true, [true]] 25 | ]; 26 | 27 | 28 | INFO_1("LoadoutSelector", "Setting up loadout selections on %1.", _object); 29 | 30 | // Setup categories 31 | private _mainCategory = [_object, _aceCategory] call FUNC(setupLoadoutCategories); 32 | 33 | // Setup loadouts 34 | private _classnameList = configProperties [missionconfigfile >> "CfgLoadouts", "getNumber (_x >> 'scope') >= 2", true]; 35 | { 36 | private _class = configName _x; 37 | private _displayName = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "displayName"); 38 | private _classname = configName (missionConfigFile >> 'CfgLoadouts' >> _class); 39 | private _icon = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "icon") call FUNC(getIcon); 40 | if (isNil{_icon}) then { _icon = "iconMan" }; 41 | private _company = getText (missionConfigFile >> 'CfgLoadouts' >> _class >> "company"); 42 | private _platoon = getNumber (missionConfigFile >> 'CfgLoadouts' >> _class >> "platoon"); 43 | private _category = getArray (missionConfigFile >> 'CfgLoadouts' >> _class >> "category"); 44 | 45 | INFO_2("LoadoutSelector", "Setting up %1 loadout on %2.", _displayName, _object); 46 | 47 | _category = [_aceCategory, _mainCategory] + _category; 48 | [_object, _displayName, _classname, _icon, _category, _company, _platoon, _allowAllLoadouts] call FUNC(addLoadoutSelection); 49 | } forEach _classnameList; 50 | 51 | INFO_1("LoadoutSelector", "Done setting up quick selections on %1.", _object); -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_training_addHitIndicator.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, Ocean.M 4 | * This object add tiny hit markers to the target you are firing on indikating where you fired. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 1: Indikator (Optional) 9 | * 10 | * Example: 11 | * [this] call cScripts_fnc_training_addHitIndicator; 12 | * [this, myOtherTarget] call cScripts_fnc_training_addHitIndicator; 13 | * [this, myOtherTarget, "#(argb,8,8,3)color(1,0.6,0.1,1.0,ca)"] call cScripts_fnc_training_addHitIndicator; 14 | * [this, myOtherTarget, "#(argb,8,8,3)color(1,0.1,0.6,1.0,ca)"] call cScripts_fnc_training_addHitIndicator; 15 | */ 16 | 17 | params [ 18 | ["_object", objNull, [objNull]], 19 | ["_board", objNull, [objNull]], 20 | ["_color", "#(argb,8,8,3)color(1,0.6,0.1,1.0,ca)", [""]] 21 | ]; 22 | 23 | if !(isNull _board) then {_object setVariable [QEGVAR(training,hitIndikator), _board]}; 24 | _object setVariable [QEGVAR(training,hitIndikatorColor), _color]; 25 | 26 | _object addEventHandler ["HitPart", { 27 | _this#0 params ["_object", "", "", "_position"]; 28 | 29 | // Create marker on impact 30 | private _marker = "Sign_Sphere10cm_F" createVehicle [0,0,0]; 31 | _marker setPosASL _position; 32 | 33 | // Handle other board indicator 34 | private _board = _object getVariable [QEGVAR(training,hitIndikator), _object]; 35 | if (_board != _object) then { 36 | private _oldPos = getPosASL _board; 37 | private _oldVectorDirAndUp = [vectorDir _board, vectorUp _board]; 38 | 39 | // Move target and attach markers 40 | _board setPosASL (getPosASL _object); 41 | _board setVectorDirAndUp [vectorDir _object, vectorUp _object]; 42 | _marker attachTo [_board]; 43 | 44 | // Reset target board position 45 | _board setPosASL _oldPos; 46 | _board setVectorDirAndUp _oldVectorDirAndUp; 47 | }; 48 | 49 | // Save marker for future clearing 50 | private _hitmarkers = _board getVariable [QEGVAR(training,hitIndikatorMarkers), []]; 51 | _hitmarkers pushBack _marker; 52 | _board setVariable [QEGVAR(training,hitIndikatorMarkers), _hitmarkers, true]; 53 | 54 | private _color = _object getVariable QEGVAR(training,hitIndikatorColor); 55 | _marker setObjectTextureGlobal [0, _color]; 56 | [{_this#0 setObjectScale 0.5;}, [_marker]] call CBA_fnc_execNextFrame; 57 | }]; 58 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_training_addTargetComputer.sqf: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: SGT.Brostrom.A 3 | * This function allow you to keep targets down as well as resetting the targets 4 | * 5 | * Arguments: 6 | * 0: resetButtonObject 7 | * 1: listOfTargets 8 | * 2: actionCaption (Optional) 9 | * 10 | * Return: 11 | * ActionID 12 | * 13 | * Example: 14 | * [this, [MyTargetVariableName], "Reset Range Targets"] call cScripts_fnc_training_addTargetComputer; 15 | * [this, [T1,T2,T3,T4]] call cScripts_fnc_training_addTargetComputer; 16 | */ 17 | 18 | params [ 19 | ["_object", objNull, [objNull]], 20 | ["_targets",[], [[]]], 21 | ["_action", "Reset Range Targets", [""]] 22 | ]; 23 | 24 | { 25 | _x setVariable ["BIS_poppingEnabled", false]; 26 | _x setVariable ["BIS_isPopping", false]; 27 | _x addEventHandler ["HitPart", { 28 | (_this select 0) params ["_target"]; 29 | 30 | _target setVariable ["nopop", true]; 31 | 32 | _target setVariable ["BIS_isLeaning", false]; 33 | _target setVariable ["BIS_leaningEnabled", false]; 34 | private _rpm = _target getVariable ["BIS_rpm", 6]; 35 | _target animate [format ["Swivel_%1rpm_rot", _rpm], _target animationPhase (format ["Swivel_%1rpm_rot", _rpm])]; 36 | _target setVariable ["BIS_isPopping", false]; 37 | 38 | _target animate ["Terc", 1]; 39 | }]; 40 | } forEach _targets; 41 | 42 | [ 43 | _object, 44 | _action, 45 | "", "", 46 | "true", "true", 47 | {}, 48 | {}, 49 | { 50 | params ["", "", "", "_arguments"]; 51 | _arguments params ["_targets"]; 52 | { 53 | _x setVariable ["nopop", nil]; 54 | 55 | _x setVariable ["BIS_isLeaning", _x getVariable ["BIS_leaningEnabled", false]]; 56 | _x setVariable ["BIS_poppingEnabled", false]; 57 | _x setVariable ["BIS_isPopping", false]; 58 | _x animate ["terc", 0]; 59 | 60 | _x setVariable ["BIS_leaningEnabled", true]; 61 | if (_x getVariable ["BIS_leaningEnabled", false]) then { 62 | _x animate [_x getVariable ["BIS_animName", "Swivel_6rpm_rot"], _x getVariable ["BIS_animPhaseTarget", _x animationPhase (_x getVariable ["BIS_animName", "Swivel_6rpm_rot"])]]; 63 | }; 64 | } forEach _targets; 65 | }, 66 | {}, 67 | [_targets], 0, nil, false, false 68 | ] call BIS_fnc_holdActionAdd; 69 | -------------------------------------------------------------------------------- /cScripts/functions/systems/fn_training_clearhitIndicator.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A, Ocean.M 4 | * This function clear a hitIndicator objects markers. 5 | * 6 | * Arguments: 7 | * 0: Object 8 | * 9 | * Example: 10 | * [cursorTarget] call cScripts_fnc_training_clearhitIndicator; 11 | */ 12 | 13 | params [["_object", objNull, [objNull]]]; 14 | 15 | private _hitmarkers = _object getVariable [QEGVAR(training,hitMarkers), []]; 16 | if (count _hitmarkers != 0) then { 17 | {deleteVehicle _x} forEach _hitmarkers; 18 | }; -------------------------------------------------------------------------------- /cScripts/functions/testing/fn_testing_equipmentUsed.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function test all loadout arrays 5 | * 6 | * Arguments: 7 | * 8 | * Return Value: 9 | * True or False 10 | * 11 | * Example: 12 | * call cScripts_fnc_testing_loadoutArrays 13 | * 0 spawn compile preprocessFileLineNumbers 'cScripts\functions\testing\fn_testing_equipmentUsed.sqf' 14 | * 15 | */ 16 | 17 | diag_log text ""; 18 | diag_log text "###############################################################################################################"; 19 | diag_log text ""; 20 | ["STARTING UNIT TEST FOR LOADOUT ARRAYS", "INFO", true, false, "TESTING"] call FUNC(log); 21 | ["There should be no script errors when this function runs.", "INFO", true, false, "TESTING"] call FUNC(log); 22 | 23 | diag_log text ""; 24 | diag_log text "###############################################################################################################"; 25 | diag_log text ""; 26 | 27 | private _return = true; 28 | 29 | private _database = GVAR(DATABASE); 30 | 31 | private _faultyEquipment = []; 32 | 33 | ["TESTING KEYS FROM DATABASE", "INFO", true, false, "TESTING"] call FUNC(log); 34 | { 35 | //[format ["TESTING KEY '%1'", _x], "INFO", true, false, "TESTING"] call FUNC(log); 36 | { 37 | _x params ["_item"]; 38 | //[format ["TESTING ITEM '%1'", _item], "INFO", false, false, "TESTING"] call FUNC(log);; 39 | private _cfgMagazines = getText (configFile >> 'CfgMagazines' >> _item >> 'displayName'); 40 | private _cfgWeapons = getText (configFile >> 'CfgWeapons' >> _item >> 'displayName'); 41 | private _cfgVehicles = getText (configFile >> 'CfgVehicles' >> _item >> 'displayName'); 42 | if (_cfgMagazines == "" && _cfgWeapons == "" && _cfgVehicles == "") then { 43 | [format ["FAILED: '%1' does not exist in CfgMagazines, CfgWeapons or CfgVehicles.", _item], "INFO", true, false, "TESTING"] call FUNC(log); 44 | _return = false 45 | }; 46 | } forEach _y; 47 | } forEach _database; 48 | 49 | if (_return) then { 50 | ["TEST SUCCESSFUL", "INFO", true, false, "TESTING"] call FUNC(log); 51 | } else { 52 | ["TEST FAILED", "INFO", true, false, "TESTING"] call FUNC(log); 53 | }; 54 | 55 | ["TEST COMPLETED", "INFO", true, false, "TESTING"] call FUNC(log); 56 | diag_log text ""; 57 | diag_log text "###############################################################################################################"; 58 | diag_log text ""; 59 | 60 | _return; 61 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addDefaultLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function apply a default loadouts to a selected vehicle. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * [_vehicle] call cScripts_fnc_vehicle_addDefaultLoadout; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | if (!isServer) exitWith {}; 21 | if (!isNil{_vehicle getVariable QEGVAR(VehicleFunc,DefaultPylon)}) exitWith {SHOW_WARNING_2("VehicleDefaultLoadout", "Vehicle loadouts already applied for %1. [%2].", _vehicle, typeOf _vehicle);}; 22 | if (!(_vehicle call FUNC(isValidFaction))) exitWith {}; 23 | 24 | INFO_2("VehicleDefaultLoadout", "Applying vehicle loadout to %1 [%2].", _vehicle, typeOf _vehicle); 25 | 26 | // Default pylon applied 27 | private _pylon = []; 28 | 29 | { 30 | if (_vehicle iskindOf _x) exitWith { 31 | _pylon = [_x, "default"] call EFUNC(vehicle,getPylonLoadout); 32 | INFO_3("VehicleDefaultLoadout", "Vehicle %1 [%2] applied have loadout %3.", _vehicle, typeOf _vehicle, _pylon); 33 | [_vehicle, "default", _pylon] call EFUNC(vehicle,applyLoadout); 34 | }; 35 | } forEach (keys GVAR(PYLONS)); 36 | 37 | if (count _pylon == 0) then { 38 | WARNING_2("VehicleDefaultLoadout", "Vehicle %1 [%2] has no loadout setup.", _vehicle, typeOf _vehicle); 39 | } else { 40 | _vehicle setVariable ["ace_rearm_scriptedLoadout", true, true]; 41 | }; 42 | 43 | _vehicle setVariable [QEGVAR(VehicleFunc,DefaultPylon), true, true]; 44 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addFlagAction.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function adds a put up and take down flag action to the given vehicle. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * [_vehicle] call cScripts_fnc_vehicle_addFlagAction; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | if (isNull _vehicle) exitWith {SHOW_WARNING("FlagAction", "Attempted to apply function to null vehicle");}; 21 | 22 | private _icon = "iconLogic" call FUNC(getIcon); 23 | 24 | private _addCondition = { 25 | params ["_vehicle", "_caller", "_params"]; 26 | !(_vehicle getVariable [QEGVAR(Vehicle,hasFlag), false]) && isTurnedOut _caller; 27 | }; 28 | private _putFlag = [QEGVAR(Actions_Vehicle,PutFlag), "Put up flag", _icon, { 29 | params ["_vehicle", "_caller", "_params"]; 30 | private _flagTexture = "z\cav\addons\flag\data\flag_01_ca.paa"; //"\A3\Data_F\Flags\Flag_red_CO.paa" 31 | _vehicle forceFlagTexture _flagTexture; 32 | _vehicle setVariable [QEGVAR(Vehicle,hasFlag), true, true]; 33 | }, _addCondition] call ace_interact_menu_fnc_createAction; 34 | [_vehicle, 1, ["ACE_SelfActions"], _putFlag] call ace_interact_menu_fnc_addActionToObject; 35 | 36 | 37 | private _remCondition = { 38 | params ["_vehicle", "_caller", "_params"]; 39 | _vehicle getVariable [QEGVAR(Vehicle,hasFlag), false] && isTurnedOut _caller; 40 | }; 41 | private _takeFlag = [QEGVAR(Actions_Vehicle,TakeFlag), "Take down flag", _icon, { 42 | params ["_vehicle", "_caller", "_params"]; 43 | _vehicle forceFlagTexture ""; 44 | _vehicle setVariable [QEGVAR(Vehicle,hasFlag), false, true]; 45 | }, _remCondition] call ace_interact_menu_fnc_createAction; 46 | [_vehicle, 1, ["ACE_SelfActions"], _takeFlag] call ace_interact_menu_fnc_addActionToObject; 47 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addPylonSelection.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function add a staging loadout selection ace action. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: DisplayName 9 | * 2: VehicleKind 10 | * 3: LoadoutName 11 | * 4: PylonArray 12 | * 5: Icon 13 | * 6: Category 14 | * 15 | * Return Value: 16 | * nothing 17 | * 18 | * Example: 19 | * [_vehicle, "Default Loadout", "rhsusf_m1a1tank_base", "default", [], ""] call cScripts_fnc_vehicle_addPylonSelection; 20 | * [_vehicle, _displayName, _classname, _pylonName, _loadout _icon] call cScripts_fnc_vehicle_addPylonSelection; 21 | * [_vehicle, "Default Loadout", "rhsusf_m1a1tank_base", "default", [_vehicle, "rhsusf_m1a1tank_base", "default"] call cScripts_fnc_vehicle_getPylon, ""] call cScripts_fnc_vehicle_addPylonSelection; 22 | * 23 | * Public: No 24 | */ 25 | 26 | params [ 27 | ["_vehicle", objNull, [objNull]], 28 | ["_displayName", "", [""]], 29 | ["_classname", "", [""]], 30 | ["_pylonName", "", [""]], 31 | ["_loadout", [], ["",[],0]], 32 | ["_icon", "", [""]] 33 | ]; 34 | 35 | private _condition = { 36 | params ["_vehicle", "", "_params"]; 37 | _params params ["_classname"]; 38 | _vehicle iskindOf _classname; 39 | }; 40 | 41 | private _statement = { 42 | params ["_vehicle", "_player", "_params"]; 43 | _params params ["", "_pylonName", "_loadout"]; 44 | [_vehicle, _pylonName, _loadout] call EFUNC(vehicle,applyLoadout); 45 | }; 46 | 47 | private _selfCategory = ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat), QEGVAR(Actions_Vehicle,Pylon_Cat)]; 48 | private _actionName = format["%1_%2_%3", QGVAR(Pylon), _classname, _pylonName]; 49 | 50 | private _action = [_actionName, _displayName, _icon, _statement, _condition, nil, [_classname, _pylonName, _loadout]] call ace_interact_menu_fnc_createAction; 51 | [_vehicle, 1, _selfCategory, _action] call ace_interact_menu_fnc_addActionToObject; 52 | 53 | INFO_4("VehiclePylonSelector", "Selector for kindOf '%1' named '%2' added to %3 (%4)", _classname, _displayName, _vehicle, typeOf _vehicle); -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addRegearAction.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function add a reGear action to a vehicle inside of a staging zone. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * [_vehicle] call cScripts_fnc_vehicle_addRegearAction 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | if (isNull _vehicle) exitWith {}; 21 | 22 | private _icon = "cScripts\Data\Icon\icon_00.paa" call FUNC(getIcon); 23 | 24 | private _condition = { call FUNC(checkStagingZone) }; 25 | private _stagingCat = [QEGVAR(Actions_Vehicle,Repair), "Regear", _icon, { 26 | params ["_vehicle"]; 27 | 28 | private _vehicleLoadout = _vehicle getVariable [QEGVAR(vehicle,pylon), ["", []]]; 29 | _vehicleLoadout params ["_loadoutName", "_pylon"]; 30 | 31 | [_vehicle, _loadoutName, _pylon] call EFUNC(vehicle,applyLoadout); 32 | _vehicle setFuel 1; 33 | [ 34 | [], 35 | ["Vehicle has been rearmed and refueled."], 36 | [""], 37 | [""] 38 | ] call CBA_fnc_notify; 39 | }, _condition] call ace_interact_menu_fnc_createAction; 40 | [_vehicle, 1, ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)], _stagingCat] call ace_interact_menu_fnc_addActionToObject; 41 | 42 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addRepairAction.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function add a repair action to a vehicle inside of a staging zone. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * [_vehicle] call cScripts_fnc_vehicle_addRepairAction 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | if (isNull _vehicle) exitWith {}; 21 | 22 | private _icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa" call FUNC(getIcon); 23 | 24 | private _condition = { call FUNC(checkStagingZone) }; 25 | private _stagingCat = [QEGVAR(Actions_Vehicle,Repair), "Repair and Refuel", _icon, { 26 | params ["_vehicle", "_caller", "_params"]; 27 | ["", _vehicle] call ace_repair_fnc_doFullRepair; 28 | _vehicle setFuel 1; 29 | [ 30 | [], 31 | ["Vehicle has been refueled and repaired."], 32 | [""], 33 | [""] 34 | ] call CBA_fnc_notify; 35 | }, _condition] call ace_interact_menu_fnc_createAction; 36 | [_vehicle, 1, ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)], _stagingCat] call ace_interact_menu_fnc_addActionToObject; 37 | 38 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function add staging actions to vehicles 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 9 | * Return Value: 10 | * nothing 11 | * 12 | * Example: 13 | * [_vehicle] call cScripts_fnc_vehicle_addStagingActions; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | if (!hasInterface) exitWith {}; 21 | if (!EGVAR(Settings,enableStagingSystem)) exitWith {}; 22 | if (!(_vehicle call FUNC(isValidFaction))) exitWith {}; 23 | if (!isNil{_vehicle getVariable QEGVAR(VehicleFunc,StagingActions)}) exitWith {SHOW_WARNING_2("VehicleStagingActions", "Vehicle staging actions already applied for %1. [%2].", _vehicle, typeOf _vehicle);}; 24 | 25 | INFO_2("VehicleStagingActions", "Applying vehicle staging actions to %1 (%2)", _vehicle, typeOf _vehicle); 26 | 27 | private _condition = { call FUNC(checkStagingZone) }; 28 | private _stagingCat = [QEGVAR(Actions_Vehicle,Main_Cat), "Vehicle Staging Zone", "cScripts\Data\Icon\icon_00.paa", {true}, _condition] call ace_interact_menu_fnc_createAction; 29 | private _actionArray = [_vehicle, 1, ["ACE_SelfActions"], _stagingCat] call ace_interact_menu_fnc_addActionToObject; 30 | 31 | private _stagingCat = [QEGVAR(Actions_Vehicle,Cosmetic_Cat), "Vehicle Cosmetics", "cScripts\Data\Icon\icon_00.paa", {true}, {true}] call ace_interact_menu_fnc_createAction; 32 | [_vehicle, 1, ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)], _stagingCat] call ace_interact_menu_fnc_addActionToObject; 33 | 34 | [_vehicle] call EFUNC(vehicle,addRegearAction); 35 | [_vehicle] call EFUNC(vehicle,addRepairAction); 36 | [_vehicle] call EFUNC(vehicle,addCosmeticSelection); 37 | [_vehicle] call EFUNC(vehicle,setupPylonCategories); 38 | 39 | _vehicle setVariable [QEGVAR(VehicleFunc,StagingActions), _actionArray]; 40 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_applyLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function apply a loadout to a vehicle and save it as a variable. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: LoadoutName 9 | * 2: VehicleLoadout 10 | * 11 | * Return Value: 12 | * nothing 13 | * 14 | * Example: 15 | * [_vehicle, "default", []] call cScripts_fnc_vehicle_applyLoadout; 16 | * 17 | * Public: No 18 | */ 19 | 20 | params [ 21 | ["_vehicle", objNull, [objNull]], 22 | ["_loadoutName", "", [""]], 23 | ["_vehicleLoadout", [], [[]]] 24 | ]; 25 | 26 | if (_vehicle iskindOf "man") exitWith {}; 27 | if (isNull _vehicle) exitWith {}; 28 | if (_loadoutName == "") exitWith {}; 29 | if (count _vehicleLoadout == 0) exitWith {}; 30 | 31 | INFO_3("VehiclePylonApply", "Applying pylon '%1' to %2 (%3)", _loadoutName, _vehicle, typeOf _vehicle); 32 | 33 | // Rearm vehicle first 34 | _vehicle setVehicleAmmo 1; 35 | 36 | // Clear magazine 37 | { 38 | _x params ["_magazineClassname", "_turretPath"]; 39 | INFO_4("VehiclePylonApply", "Removing magazine '%1' in turrent %2 to %3 (%4)", _magazineClassname, _turretPath, _vehicle, typeOf _vehicle); 40 | _vehicle removeMagazinesTurret [_magazineClassname, _turretPath]; 41 | } forEach magazinesAllTurrets _vehicle; 42 | 43 | // Add magazine 44 | { 45 | _x params [ 46 | ["_magazineClassname", "", [""]], 47 | ["_turretPath", [], [[]]], 48 | ["_amount", -1, [0]] 49 | ]; 50 | if (_amount != 0) then { 51 | INFO_5("VehiclePylonApply", "Adding magazine '%1' (%2) in turrent %23 to %4 (%5)", _magazineClassname, _amount, _turretPath, _vehicle, typeOf _vehicle); 52 | _vehicle addMagazineTurret [ 53 | _magazineClassname, 54 | _turretPath, 55 | if (_amount < 0) then {getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count")} else {_amount} 56 | ]; 57 | }; 58 | } forEach _vehicleLoadout; 59 | 60 | INFO_3("VehiclePylonApply", "Vehicle %1 (%2) has been rearmed with '%3'", _vehicle, typeOf _vehicle, _loadoutName); 61 | _vehicle setVariable [QEGVAR(Vehicle,Pylon), [_loadoutName, _vehicleLoadout], true]; 62 | -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_applyTextures.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SPC.Turn.J 4 | * This function applies textures to a given vehicle. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: Textures 9 | * 10 | * Return Value: 11 | * nothing 12 | * 13 | * Example: 14 | * ["vic", [[1, "path/to/texture.paa"]]] call cScripts_fnc_vehicle_applyTextures; 15 | * ["vic",] call cScripts_fnc_vehicle_applyTextures; 16 | * 17 | * Public: No 18 | */ 19 | 20 | params [ 21 | ["_vehicle", objNull, [objNull]], 22 | ["_textureIndexMap", [], [[]]] 23 | ]; 24 | 25 | if (count _textureIndexMap == 0) exitWith {}; 26 | 27 | private _map = createHashMapFromArray _textureIndexMap; 28 | 29 | { 30 | _vehicle setObjectTextureGlobal [_x, _y]; 31 | } forEach _map; -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_getPylonIcon.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return a pylon icon 5 | * 6 | * Arguments: 7 | * 0: VehicleKind 8 | * 1: LoadoutName (Default; "default") 9 | * 10 | * Return Value: 11 | * DisplayName 12 | * 13 | * Example: 14 | * ["rhsusf_m1a1tank_base", "default"] call cScripts_fnc_vehicle_getPylonIcon; 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [ 20 | ["_classname", "", [""]], 21 | ["_loadout", "default", [""]] 22 | ]; 23 | 24 | 25 | private _icon = GVAR(PYLONS) get _classname get _loadout getOrDefault ["icon", ""]; 26 | private _return = [_icon] call FUNC(getIcon); 27 | 28 | _return -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_getPylonLoadout.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function returns a vehicle loadout or pylon 5 | * 6 | * Arguments: 7 | * 0: VehicleKind 8 | * 1: LoadoutName (Default; "default") 9 | * 10 | * Return Value: 11 | * Vehicle loadout Array 12 | * 13 | * Example: 14 | * ["rhsusf_m1a1tank_base", "default"] call cScripts_fnc_vehicle_getPylonLoadout; 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [ 20 | ["_classname", "", [""]], 21 | ["_loadout", "default", [""]] 22 | ]; 23 | 24 | GVAR(PYLONS) get _classname get _loadout getOrDefault ["loadout", ""] -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_getPylonName.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function return a pylon displayname 5 | * 6 | * Arguments: 7 | * 0: VehicleKind 8 | * 1: LoadoutName (Default; "default") 9 | * 10 | * Return Value: 11 | * DisplayName 12 | * 13 | * Example: 14 | * ["rhsusf_m1a1tank_base", "default"] call cScripts_fnc_vehicle_getPylonName; 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [ 20 | ["_classname", "", [""]], 21 | ["_loadout", "default", [""]] 22 | ]; 23 | 24 | GVAR(PYLONS) get _classname get _loadout getOrDefault ["displayName", ""] -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_setRadio.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This function changes the inventory of the given vehicle. 5 | * 6 | * Arguments: 7 | * 0: Vehicle 8 | * 1: Channel 9 | * 10 | * Return Value: 11 | * nothing 12 | * 13 | * Example: 14 | * [_vehicle] call cScripts_fnc_vehicle_setRadio; 15 | * 16 | * Public: No 17 | */ 18 | 19 | params [ 20 | ["_vehicle", objNull, [objNull]], 21 | ["_radioChannel", [], [[]]] 22 | ]; 23 | 24 | if (!EGVAR(Patches,usesACRE) && !EGVAR(Patches,usesTFAR)) exitWith {}; 25 | if (!EGVAR(Settings,enableRadios)) exitWith {}; 26 | if (!EGVAR(Settings,enableVehicleRadios)) exitWith {}; 27 | if (isNull _vehicle) exitWith {}; 28 | if (!(_vehicle call FUNC(isValidFaction))) exitWith {}; 29 | 30 | // ACRE 31 | if (EGVAR(patches,usesACRE)) exitWith { 32 | if (!isServer) exitWith {}; 33 | 34 | [_vehicle, "default"] call acre_api_fnc_setVehicleRacksPreset; 35 | [_vehicle, {}] call acre_api_fnc_initVehicleRacks; 36 | 37 | waitUntil { _vehicle call acre_api_fnc_areVehicleRacksInitialized }; 38 | 39 | INFO_4("VehicleRadio", "Vehicle rack initzialized for %1 (%2)", _vehicle, typeOf _vehicle); 40 | 41 | private _racks = [_vehicle] call acre_api_fnc_getVehicleRacks; 42 | if (count _racks == 0) exitWith {INFO_2("VehicleRadio", "No Vehicle Racks discoverd for %1 (%2).", _vehicle, typeOf _vehicle);}; 43 | 44 | // Add extra channels 45 | _radioChannel = _radioChannel + [1,1,1,1,1]; 46 | 47 | { 48 | private _radio = [_x] call acre_api_fnc_getMountedRackRadio; 49 | if (count _radio != 0) then { 50 | private _channel = _radioChannel select _forEachIndex; 51 | [_radio, _channel] call acre_api_fnc_setRadioChannel; 52 | INFO_4("VehicleRadio", "Vehicle %1 (%2) radio %3 in rack %3 has radio set to channel %4", _vehicle, typeOf _vehicle, _radio, _x, _channel); 53 | }; 54 | } forEach _racks; 55 | }; 56 | 57 | 58 | // TFAR 59 | if (EGVAR(patches,usesTFAR)) exitWith { 60 | /** TODO: Code goes here */ 61 | }; 62 | 63 | SHOW_CHAT_ERROR("VehicleRadio", "Fatal"); -------------------------------------------------------------------------------- /cScripts/functions/vehicle/fn_vehicle_setupPylonCategories.sqf: -------------------------------------------------------------------------------- 1 | #include "..\script_component.hpp"; 2 | /* 3 | * Author: SGT.Brostrom.A 4 | * This function setup a loadout categories 5 | * 6 | * Arguments: 7 | * 0: Vehicle/Object/Crate 8 | * 9 | * Return Value: 10 | * True on success 11 | * 12 | * Example: 13 | * [this] call cScripts_fnc_vehicle_setupPylonCategories; 14 | * 15 | * Public: No 16 | */ 17 | 18 | params [["_vehicle", objNull, [objNull]]]; 19 | 20 | // Icons 21 | //private _icon = "iconTank" call FUNC(getIcon); 22 | 23 | // Loadout action setup 24 | private _pylonList = []; 25 | 26 | { 27 | _x params ["_classname"]; 28 | if (_vehicle iskindOf _classname) then { 29 | { 30 | _x params ["_pylonName"]; 31 | private _displayName = [_classname, _pylonName] call EFUNC(vehicle,getPylonName); 32 | private _loadout = [_classname, _pylonName] call EFUNC(vehicle,getPylonLoadout); 33 | private _icon = [_classname, _pylonName] call EFUNC(vehicle,getPylonIcon); 34 | _pylonList append [[_classname, _displayName, _pylonName, _loadout, _icon]]; 35 | } forEach (keys (GVAR(PYLONS) get _classname)); 36 | break; 37 | }; 38 | } forEach (keys GVAR(PYLONS)); 39 | 40 | if (count _pylonList == 0) exitWith {false}; 41 | // Setup category 42 | private _mainCategory = ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)]; 43 | private _vehiclePylon = [QEGVAR(Actions_Vehicle,Pylon_Cat), "Vehicle Loadouts", "", {true}, { call FUNC(checkStagingZone) }] call ace_interact_menu_fnc_createAction; 44 | [_vehicle, 1, _mainCategory, _vehiclePylon] call ace_interact_menu_fnc_addActionToObject; 45 | 46 | // Setup loadouts selection 47 | { 48 | _x params ["_classname", "_displayName", "_pylonName", "_loadout", "_icon"]; 49 | INFO_4("VehiclePylonSetup", "Creating loadout '%1' (%2) action for vehicle %3 (%4)", _displayName, _pylonName, _vehicle, typeOf _vehicle); 50 | [_vehicle, _displayName, _classname, _pylonName, _loadout, _icon] call EFUNC(vehicle,addPylonSelection); 51 | } forEach _pylonList; 52 | 53 | true -------------------------------------------------------------------------------- /cScripts/script_component.hpp: -------------------------------------------------------------------------------- 1 | #define PREFIX cScripts 2 | #define VERSION "DEVBUILD" 3 | 4 | // Uncomment to enable debug mode 5 | //#define DEBUG_MODE 6 | 7 | #include "script_macros.hpp" 8 | -------------------------------------------------------------------------------- /description.ext: -------------------------------------------------------------------------------- 1 | /* INFO */ 2 | 3 | /*=================== O N L Y E D I T B E T W E E N T H E S E L I N E S====================*/ 4 | 5 | dev = "1SG Tully.B"; 6 | author = "1SG Tully.B"; 7 | 8 | onLoadName = "MyMissionName"; 9 | onLoadMission = "7th Cavalry - S3 1BN Battle Staff Operation"; 10 | onLoadIntro = "S3 1BN Battle Staff Operation"; 11 | 12 | loadScreen = "Data\MissionLogo.paa"; 13 | overviewPicture = "Data\MissionLogo.paa"; 14 | 15 | /*=================== D O N O T E D I T B E L O W T H E S E L I N E S====================*/ 16 | 17 | /* RULES */ 18 | 19 | disabledAI = true; 20 | disableChannels[] = {{0,false,true},{1,false,true},{2,true,true},{6,true,true}}; 21 | 22 | cba_settings_hasSettingsFile = 1; 23 | cba_settings_whitelist[] = { 24 | "76561197962051582", // Brostrom.A 25 | "76561198136771473" // Turn.J 26 | }; 27 | 28 | enableTargetDebug = 1; 29 | enableDebugConsole[] = { 30 | "76561197962051582", // Brostrom.A 31 | "76561198136771473" // Turn.J 32 | }; 33 | 34 | forceRotorLibSimulation = 1; 35 | 36 | /* GARBADGE COLLECTIOR */ 37 | 38 | corpseManagerMode = 3; 39 | corpseLimit = 25; 40 | corpseRemovalMinTime = 60; 41 | corpseRemovalMaxTime = 7200; 42 | minPlayerDistance = 250; 43 | 44 | /* RESPAWN */ 45 | 46 | // Name a marker "respawn_west" to set spawn. 47 | // See https://community.bistudio.com/wiki/Arma_3_Respawn for more info on respawn. 48 | respawn = BASE; 49 | respawnDelay = 4; 50 | //respawnDelay = 30000; // Enable for 1 life operations and disable the other. 51 | respawnOnStart = -1; 52 | respawnTemplatesWest[] = {"MenuPosition"}; 53 | //respawnTemplates[] = {"spectator"}; // Enable for 1 life operations and disable the other. 54 | 55 | /* SYSTEMS */ 56 | 57 | class Header { 58 | gameType = Coop; 59 | minPlayers = 1; 60 | maxPlayers = 100; 61 | }; 62 | 63 | class Extended_PreInit_EventHandlers { 64 | cScripts_preInit = "0 spawn compile preprocessFileLineNumbers 'cScripts\cScripts_preInit.sqf'"; 65 | }; 66 | class Extended_PostInit_EventHandlers { 67 | cScripts_postInit = "0 spawn compile preprocessFileLineNumbers 'cScripts\cScripts_postInit.sqf'"; 68 | }; 69 | 70 | class CfgFunctions { 71 | #include "cScripts\CfgFunctions.hpp" 72 | }; 73 | #include "cScripts\CfgLoadouts.hpp" 74 | 75 | /* OTHER */ 76 | -------------------------------------------------------------------------------- /init.sqf: -------------------------------------------------------------------------------- 1 | #include "cScripts\script_component.hpp" 2 | /* 3 | * Author: CPL.Brostrom.A 4 | * This is the mission init.sqf this is run witout exceptions on mission start. 5 | * Some sections in this script only run when your on a multiplayer enviroment to avoid errors and issues. 6 | * Read more about Initzialisation order here: https://community.bistudio.com/wiki/Initialization_Order 7 | */ 8 | 9 | if (!isMultiplayer) then {SHOW_CHAT_WARNING("", "Mission is running on singelplayer enviroment!");}; 10 | #ifdef DEBUG_MODE 11 | SHOW_INFO("init", "Initializing..."); 12 | SHOW_CHAT_INFO_1("init", "cScripts Version %1 is running.", VERSION); 13 | SHOW_CHAT_WARNING("init", "Debug mode is currently active."); 14 | logEntities; 15 | #endif 16 | 17 | enableSaving [false, false]; 18 | 19 | // To Turns off or on ambient Wildelife, Ambient Sounds and wind sound strenght. 20 | enableEnvironment [false, true, 1]; 21 | 22 | ACE_maxWeightCarry = 8000; 23 | ACE_maxWeightDrag = 12000; 24 | 25 | INFO("init", "Initialization completed."); 26 | 27 | /* APPLY STUFF ONLY BELOW THIS LINE */ 28 | -------------------------------------------------------------------------------- /resourses/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/logo.png -------------------------------------------------------------------------------- /resourses/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/logo.psd -------------------------------------------------------------------------------- /resourses/misc/build.bat: -------------------------------------------------------------------------------- 1 | pyinstaller ..\..\tools\build.py -F -n build -i cav.ico 2 | -------------------------------------------------------------------------------- /resourses/misc/cav.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/misc/cav.ico -------------------------------------------------------------------------------- /resourses/wikigfx/7Cav_Modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/7Cav_Modules.png -------------------------------------------------------------------------------- /resourses/wikigfx/CBA_Mission_Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/CBA_Mission_Settings.png -------------------------------------------------------------------------------- /resourses/wikigfx/Diary_Records.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Diary_Records.png -------------------------------------------------------------------------------- /resourses/wikigfx/Insignia_Arsenal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Insignia_Arsenal.png -------------------------------------------------------------------------------- /resourses/wikigfx/Insignia_Crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Insignia_Crate.png -------------------------------------------------------------------------------- /resourses/wikigfx/Logistical_Crates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Logistical_Crates.png -------------------------------------------------------------------------------- /resourses/wikigfx/Starter_Crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Starter_Crate.png -------------------------------------------------------------------------------- /resourses/wikigfx/Texture_Lable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/Texture_Lable.png -------------------------------------------------------------------------------- /resourses/wikigfx/gear_applyloadout_examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/7Cav/cScripts/cf2fbfb8b741a195a9e7f436a51642597c2a5459/resourses/wikigfx/gear_applyloadout_examples.png -------------------------------------------------------------------------------- /tools/build_settings_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION_TAG=$* 4 | 5 | mkdir -p tmp/cba_settings_userconfig 6 | 7 | cp cba_settings.sqf tmp/cba_settings_userconfig/ 8 | set 'g/force force /force /' tmp/cba_settings_userconfig/cba_settings.sqf 9 | 10 | touch tmp/cba_settings_userconfig/\$PBOPREFIX\$ 11 | echo "cba_settings_userconfig" > tmp/cba_settings_userconfig/\$PBOPREFIX\$ 12 | 13 | touch tmp/cba_settings_userconfig/config.cpp 14 | 15 | echo """ 16 | class CfgPatches { 17 | class cba_settings_userconfig { 18 | author = \"\$STR_CBA_Author\"; 19 | name = \"\$STR_CBA_Settings_Component\"; 20 | url = \"\$STR_CBA_URL\"; 21 | units[] = {}; 22 | weapons[] = {}; 23 | requiredVersion = 1.0; 24 | requiredAddons[] = {\"cba_settings\"}; 25 | version = ${VERSION_TAG}; 26 | authors[] = {\"Brostrom.A\"}; 27 | }; 28 | }; 29 | """ > tmp/cba_settings_userconfig/config.cpp 30 | 31 | armake build -f tmp/cba_settings_userconfig cba_settings_userconfig.pbo 32 | 33 | zip -0 release/Server_Config-${VERSION_TAG}.zip cba_settings_userconfig.pbo 34 | -------------------------------------------------------------------------------- /tools/checkDebug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTPATH=`dirname $(readlink -f $0)` 4 | cd $SCRIPTPATH/../cScripts 5 | 6 | 7 | [[ ! $(grep -n "//#define DEBUG_MODE" script_component.hpp | wc -l) == 1 ]] && echo "ERROR: Global debugging enabled" && exit 1 8 | 9 | grep -rn "#define DEBUG_MODE" --exclude=script_component.hpp 10 | [[ ! $(grep -rn "#define DEBUG_MODE" --exclude=script_component.hpp | wc -l) == 0 ]] && echo "ERROR: DEBUG_MODE is enabled" && exit 1 11 | 12 | 13 | echo "SUCCESS" 14 | exit 0 -------------------------------------------------------------------------------- /tools/checkFixme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTPATH=`dirname $(readlink -f $0)` 4 | cd $SCRIPTPATH/../cScripts 5 | 6 | grep -rn "FIXME" 7 | [[ ! $(grep -rn "FIXME" | wc -l) == 0 ]] && echo "ERROR: FIXME found" && exit 1 8 | 9 | echo "SUCCESS" 10 | exit 0 -------------------------------------------------------------------------------- /tools/checkLogging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTPATH=`dirname $(readlink -f $0)` 4 | cd $SCRIPTPATH/../cScripts 5 | 6 | grep -rn "LOG(" --exclude=script_macros.hpp 7 | grep -rn "LOG_" --exclude=script_macros.hpp 8 | [[ ! $(grep -rn "LOG(" --exclude=script_macros.hpp | wc -l) == 0 ]] && echo "ERROR: LOG usage detected" && exit 1 9 | [[ ! $(grep -rn "LOG_" --exclude=script_macros.hpp | wc -l) == 0 ]] && echo "ERROR: LOG usage detected" && exit 1 10 | 11 | echo "SUCCESS" 12 | exit 0 -------------------------------------------------------------------------------- /tools/checkPullRequestTitle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _throw() { 4 | echo "FAILED: Pull Request: $1" 5 | exit 1 6 | } 7 | 8 | string="$*" 9 | string=${string,,} 10 | 11 | echo "Validating '$*'..." 12 | 13 | if [[ ${#string} == 0 ]]; then echo "SUCCESS: Empty name (Assumed bransh run)"; exit 0; fi 14 | 15 | if [[ ${#string} -lt 20 ]]; then _throw "Short name"; fi 16 | if [[ $string == "update"*".sqf" ]]; then _throw "Bad name"; fi 17 | if [[ $string == "add"*".sqf" ]]; then _throw "Bad name"; fi 18 | if [[ $string == "remove"*".sqf" ]]; then _throw "Bad name"; fi 19 | 20 | 21 | # Descriptor 22 | valid_list=(Added Fixed Adjusted Changed Updated Improved Cleaned Replaced Removed Reverted Revert Enabled Disabled) 23 | missing_descriptor_error="Missing descriptor [${valid_list[@]}]" 24 | _valid=false 25 | for contain in ${valid_list[@]}; do 26 | contain=${contain,,} 27 | [[ $string == *${contain}* ]] && _valid=true && break 28 | done 29 | [ "$_valid" == "false" ] && _throw "$missing_descriptor_error" 30 | 31 | echo "SUCCESS" 32 | exit 0 33 | -------------------------------------------------------------------------------- /tools/checkTodo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTPATH=`dirname $(readlink -f $0)` 4 | cd $SCRIPTPATH/../cScripts 5 | 6 | grep -rn "TODO" 7 | [[ ! $(grep -rn "TODO" | wc -l) == 0 ]] && echo "WARNING: TODO found" && exit 0 8 | 9 | echo "SUCCESS" 10 | exit 0 11 | -------------------------------------------------------------------------------- /tools/check_loadout_classnames.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys, os, re, json, glob 3 | 4 | __version__ = 1.0 5 | 6 | # set projecty path 7 | scriptPath = os.path.realpath(__file__) 8 | scriptDir = os.path.dirname(scriptPath) 9 | rootDir = os.path.dirname(os.path.dirname(scriptPath)) 10 | os.chdir(rootDir) 11 | 12 | def strip_path_from_filename(pathfile=''): 13 | filenamepath = pathfile.split('/') 14 | filename = filenamepath[-1] 15 | filename = str(filename) 16 | return filename 17 | 18 | def main(): 19 | data = {} 20 | loadoutConfigs = glob.glob(rootDir + '/cScripts/Loadouts/*.hpp') 21 | 22 | for loadout in loadoutConfigs: 23 | cfgFile = open(loadout) 24 | configName = os.path.basename(loadout) 25 | data[configName] = [] 26 | CfgLoadout = cfgFile.read() 27 | classnames = re.findall('%s(.*)%s' % ('class', ':'), CfgLoadout) 28 | for classname in classnames: 29 | classname = classname.strip() 30 | data[configName].append(classname) 31 | print(json.dumps(data)) 32 | 33 | if __name__ == "__main__": 34 | sys.exit(main()) 35 | -------------------------------------------------------------------------------- /tools/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "build" : { 3 | "scriptName": "cScripts", 4 | "version": "DevBuild", 5 | "notlist": ["doc", "tools", "release", "resourses", "Compositions", "mission.sqm"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tools/config_debug.json: -------------------------------------------------------------------------------- 1 | { 2 | "build" : { 3 | "scriptName": "cScripts Debug" 4 | }, 5 | "cScripts/script_component.hpp" : { 6 | "//#define DEBUG_MODE" : "#define DEBUG_MODE" 7 | } 8 | } -------------------------------------------------------------------------------- /tools/config_noLoadouts.json: -------------------------------------------------------------------------------- 1 | { 2 | "build" : { 3 | "scriptName": "cScripts NoLoadouts" 4 | }, 5 | "cScripts/CfgLoadouts.hpp" : { 6 | "rem": [""], 7 | "add": [ 8 | "class CfgLoadouts {", 9 | "};" 10 | ] 11 | }, 12 | "cScripts/Loadouts/CfgLoadouts_Alpha_FixedWing.hpp" : "REMOVE", 13 | "cScripts/Loadouts/CfgLoadouts_Alpha_Rotary.hpp" : "REMOVE", 14 | "cScripts/Loadouts/CfgLoadouts_Alpha.hpp" : "REMOVE", 15 | "cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp" : "REMOVE", 16 | "cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp" : "REMOVE", 17 | "cScripts/Loadouts/CfgLoadouts_Bravo_Leadership.hpp" : "REMOVE", 18 | "cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp" : "REMOVE", 19 | "cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp" : "REMOVE", 20 | "cScripts/Loadouts/CfgLoadouts_Charlie_Weapon.hpp" : "REMOVE", 21 | "cScripts/Loadouts/CfgLoadouts_Common.hpp" : "REMOVE", 22 | "cScripts/Loadouts/CfgLoadouts_UserCustom.hpp" : "REMOVE" 23 | } -------------------------------------------------------------------------------- /tools/config_noRadio.json: -------------------------------------------------------------------------------- 1 | { 2 | "build" : { 3 | "scriptName": "cScripts NoRadio" 4 | }, 5 | "cba_settings.sqf" : { 6 | "add": [ 7 | "\n// cScripts Mission Settings", 8 | "force force cScripts_Settings_enableRadios = false;" 9 | ] 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tools/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION_TAG=$* 6 | 7 | mkdir -p release/ 8 | 9 | sed -i "s/#define VERSION.*/#define VERSION \"${VERSION_TAG}\"/" cScripts/script_component.hpp 10 | sed -i "s/DevBuild/${VERSION_TAG}/" tools/config.json 11 | 12 | cp cba_settings.sqf release/cba_settings.sqf 13 | 14 | python3 tools/build.py --deploy 15 | 16 | # Special Builds 17 | python3 tools/build.py --build config_debug.json --deploy 18 | python3 tools/build.py --build config_noLoadouts.json --deploy 19 | python3 tools/build.py --build config_noRadio.json --deploy 20 | 21 | sed -i "s/DEVBUILD/v${VERSION_TAG}/g" Compositions/*/header.sqe 22 | 23 | # Make a patch release 24 | #set +e # allow fail 25 | #PREV_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) 26 | #echo "Creating patch build for ${PREV_TAG} to ${VERSION_TAG}" 27 | #git diff --name-only ${PREV_TAG} ${VERSION_TAG} > pre_changed_file_list.txt 28 | #sed '/tools/d;/Compositions/d;/resourses/d;/^\.\(.*\)/d' pre_changed_file_list.txt > changed_file_list.txt 29 | #zip release/cScripts_PATCH_v${PREV_TAG}_to_v${VERSION_TAG}.zip -@ < changed_file_list.txt 30 | #set -e 31 | 32 | # Pack Compositions 33 | cd Compositions 34 | zip ../release/Compositions-${VERSION_TAG}.zip -r . 35 | 36 | # Disabled 37 | #chmod +x ./tools/build_settings_config.sh 38 | #./tools/build_settings_config.sh $VERSION_TAG -------------------------------------------------------------------------------- /tools/export_classnames.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys, os, re, json 3 | 4 | __version__ = 1.0 5 | 6 | # set projecty path 7 | scriptPath = os.path.realpath(__file__) 8 | scriptDir = os.path.dirname(scriptPath) 9 | rootDir = os.path.dirname(os.path.dirname(scriptPath)) 10 | os.chdir(rootDir) 11 | 12 | def strip_path_from_filename(pathfile=''): 13 | filenamepath = pathfile.split('/') 14 | filename = filenamepath[-1] 15 | filename = str(filename) 16 | return filename 17 | 18 | def get_loadout_files(): 19 | loadoutFiles = os.listdir(os.path.join(rootDir, 'cScripts', 'Loadouts')) 20 | return loadoutFiles 21 | 22 | def main(): 23 | data = {} 24 | loadoutFiles = get_loadout_files() 25 | for file in loadoutFiles: 26 | configFile = file.replace('.hpp', '') 27 | data[configFile] = [] 28 | if ".hpp" in file: 29 | cfgFile = open(os.path.join(rootDir, 'cScripts', 'Loadouts', file), 'r') 30 | CfgLoadout = cfgFile.read() 31 | classnames = re.findall('%s(.*)%s' % ('class', ':'), CfgLoadout) 32 | for classname in classnames: 33 | classname = classname.strip() 34 | blacklist = [] 35 | if classname in blacklist: 36 | continue 37 | data[configFile].append(classname) 38 | print(json.dumps(data)) 39 | 40 | if __name__ == "__main__": 41 | sys.exit(main()) 42 | -------------------------------------------------------------------------------- /tools/link_compositions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys, os, shutil, urllib.parse, winreg 3 | 4 | __version__ = 1.0 5 | 6 | def get_Arma3_Profile_Path_HKCU(lable='Program', regKey='', key='path'): 7 | try: 8 | registry = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) 9 | keypath = winreg.OpenKey(registry, regKey) 10 | except: 11 | sys.exit('Path for \'{}\' is invalid.'.format(lable)) 12 | try: 13 | path = winreg.QueryValueEx(keypath, key) 14 | return path[0] 15 | except: 16 | sys.exit('Some thing whent wrong when looking for {}.'.format(key)) 17 | 18 | def get_compositions(path): 19 | compDir = os.listdir(path) 20 | compList = [] 21 | for dir in compDir: 22 | if os.path.isdir(os.path.join(path,dir)): 23 | compList.append(dir) 24 | return compList 25 | 26 | def main(): 27 | global scriptPath 28 | scriptPath = os.path.realpath(__file__) 29 | global scriptDir 30 | scriptDir = os.path.dirname(scriptPath) 31 | global rootDir 32 | rootDir = os.path.dirname(os.path.dirname(scriptPath)) 33 | os.chdir(rootDir) 34 | 35 | profileName = get_Arma3_Profile_Path_HKCU('Player Name', 'SOFTWARE\\Bohemia Interactive\\Arma 3', 'Player Name') 36 | profileName = urllib.parse.quote_plus(profileName) 37 | profileName = profileName.replace(".", "%2e") 38 | 39 | scriptCompPath = os.path.join(rootDir, "Compositions") 40 | profileCompPath = os.path.join(os.environ['USERPROFILE'], 'Documents', 'Arma 3 - Other Profiles', profileName, 'compositions') 41 | 42 | Compositions = get_compositions(scriptCompPath) 43 | 44 | for comp in Compositions: 45 | destName = "Dev_{}".format(comp) 46 | srcPath = os.path.join(scriptCompPath,comp) 47 | dstPath = os.path.join(profileCompPath,destName) 48 | 49 | if os.path.isdir(os.path.join(dstPath)): 50 | if "--force" in sys.argv: 51 | os.rmdir(dstPath) 52 | else: 53 | print('> {} already linked skipping...'.format(destName)) 54 | continue 55 | os.symlink(srcPath,dstPath, target_is_directory=True) 56 | print('> {} link created...'.format(destName)) 57 | 58 | if __name__ == "__main__": 59 | sys.exit(main()) 60 | --------------------------------------------------------------------------------