### Whitelist Example 3 Source: https://ace3.acemod.org/wiki/framework/checkPBOs-framework.html Example combining whitelists from different mods. ```plaintext ["cyp_pushtohear_a3", "blastcore_sun", "blastcore_smokecs", "warfxpe", "blastcore_vep"] ``` -------------------------------- ### Whitelist Example 3 Source: https://ace3.acemod.org/wiki/framework/checkpbos-framework Example combining whitelists for two different mods: @cyp_pushtohear_a3 and @BC-Phoenix. ```plaintext ["cyp_pushtohear_a3", "blastcore_sun", "blastcore_smokecs", "warfxpe", "blastcore_vep"] ``` -------------------------------- ### Install cargo-make Source: https://ace3.acemod.org/wiki/development/extension-guidelines.html Install the cargo-make tool, which is used for managing build tasks and configurations. ```bash cargo install --no-default-features --force cargo-make ``` -------------------------------- ### Whitelist Example 2 Source: https://ace3.acemod.org/wiki/framework/checkPBOs-framework.html Example of a whitelist for multiple mods. ```plaintext ["blastcore_sun", "blastcore_smokecs", "warfxpe", "blastcore_vep"] ``` -------------------------------- ### Whitelist Example 4 (Regex) Source: https://ace3.acemod.org/wiki/framework/checkPBOs-framework.html Example of using a Regex pattern in the whitelist to match multiple addons with a common prefix. ```plaintext ["jsrs_soundmod_2025_.+"] ``` -------------------------------- ### Whitelist Example 1 Source: https://ace3.acemod.org/wiki/framework/checkPBOs-framework.html Example of a simple whitelist for a single mod. ```plaintext ["cyp_pushtohear_a3"] ``` -------------------------------- ### Whitelist Example 2 Source: https://ace3.acemod.org/wiki/framework/checkpbos-framework Example of whitelisting multiple mods, specifically components of @BC-Phoenix. ```plaintext ["blastcore_sun", "blastcore_smokecs", "warfxpe", "blastcore_vep"] ``` -------------------------------- ### ACE3 Event Example: Tap Shoulder Source: https://ace3.acemod.org/wiki/framework/events-framework.html An example demonstrating how to add an event handler for 'ace_interact_tapShoulder' and then call it as a target event on another machine. ```sqf // Event handler added on a target machine ["ace_interact_tapShoulder", ace_example_fnc_onTapShoulder] call CBA_fnc_addEventHandler; // Event called on another machine (tapping above target machine) ["ace_interact_tapShoulder", [arguments], [target]] call CBA_fnc_targetEvent; ``` -------------------------------- ### ace_explosives_fnc_setupExplosive Source: https://ace3.acemod.org/wiki/functions/explosives Initiates the setup process for a given explosive. This function is intended for player use only. ```APIDOC ## ace_explosives_fnc_setupExplosive ### Description Starts the setup process for the passed explosive. Player only. ### Parameters #### Path Parameters - **0** (OBJECT) - Optional - Target (not used). Default: - **1** (OBJECT) - Optional - Unit. Default: objNull - **2** (STRING) - Optional - Magazine classname of explosive to place. Default: "" ### Example ``` [objNull, player, "SatchelCharge_Remote_Mag"] call ace_explosives_fnc_setupExplosive ``` ``` -------------------------------- ### Whitelist Example 4 (Regex) Source: https://ace3.acemod.org/wiki/framework/checkpbos-framework Example of whitelisting multiple JSRS 2025 addons using a Regex pattern. ```plaintext ["jsrs_soundmod_2025_.+"] ``` -------------------------------- ### Setup Explosive for Player Source: https://ace3.acemod.org/wiki/functions/explosives Initiates the explosive setup process for the player. Requires the magazine classname of the explosive to be placed. ```sqf [objNull, player, "SatchelCharge_Remote_Mag"] call ace_explosives_fnc_setupExplosive ``` -------------------------------- ### Example: Create and Add Action to Object Source: https://ace3.acemod.org/wiki/framework/interactionmenu-framework Demonstrates creating an action to set target damage to 1 and then assigning it to the cursor target. ```arma-script _action = ["VulcanPinch", "Vulcan Pinch", "", {_target setDamage 1;}, {true}, {}, [parameters], [0, 0, 0], 100] call ace_interact_menu_fnc_createAction; [cursorTarget, 0, ["ACE_TapShoulderRight"], _action] call ace_interact_menu_fnc_addActionToObject; ``` -------------------------------- ### Example: Create and Add Action for Zeus Source: https://ace3.acemod.org/wiki/framework/interactionmenu-framework Demonstrates creating a mission event action that plays a sound at the base and then assigning it to Zeus actions. ```arma-script _statement = { playSound3D ["alarm.ogg", theBase] }; _action = ["myMissionEvent1", "Mission Event: Play Base Alarm", "", _statement, {true}] call ace_interact_menu_fnc_createAction; [["ACE_ZeusActions"], _action] call ace_interact_menu_fnc_addActionToZeus; ``` -------------------------------- ### Get Turned On Lights Source: https://ace3.acemod.org/wiki/functions/common Returns an array of all lights that are currently on for a given vehicle or streetlamp. ```en [car] call ace_common_fnc_getTurnedOnLights ``` -------------------------------- ### Simple Uniform Sleeves Configuration Source: https://ace3.acemod.org/wiki/framework/wardrobe-framework Configure uniform sleeves with no component requirements. This example shows how to define states for sleeves being up or down and allows toggling between them. ```cpp class ace_wardrobe { class ace_wardrobe_base_U_sleeves_down; class ace_wardrobe_base_U_sleeves_up; class U_B_CTRG_1: ace_wardrobe_base_U_sleeves_down { components[] = {}; class modifiableTo { class U_B_CTRG_3 {}; }; }; class U_B_CTRG_3: ace_wardrobe_base_U_sleeves_up { components[] = {}; class modifiableTo { class U_B_CTRG_1 {}; }; }; }; ``` -------------------------------- ### Define Configuration Class Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Define configuration classes within header files. This example shows a basic class structure for ACE settings. ```cpp class ACE_Settings { // Content }; ``` -------------------------------- ### Get CfgPatches Classes Source: https://ace3.acemod.org/wiki/framework/checkPBOs-framework.html Use this script in the editor to copy all CfgPatches classes to your clipboard. This is useful for identifying PBOs to add to your whitelist. ```ArmaScript copyToClipboard str ("true" configClasses (configFile >> "CfgPatches") apply {configName _x}); ``` -------------------------------- ### ACE3 Feature Documentation Template Source: https://ace3.acemod.org/wiki/development/documentation-guidelines-and-tips.html Use this template for documenting a new feature. It includes sections for overview, usage, dependencies, and guides. ```markdown --- layout: wiki title: Component description: Description of the feature. group: feature category: interaction parent: wiki mod: ace version: major: 3 minor: 0 patch: 0 --- ## 1. Overview ### 1.1 Sub-feature 1 Short description of sub-feature 1. ### 1.2 Sub-feature 2 Short description of sub-feature 2. ## 2. Usage ### 2.1 Thing n°1 - Step 1. - Step 2. - Step 3. ### 2.2 Thing n°2 - Step 1. - Step 2. - Step 3. ## 3. Dependencies {% include dependencies_list.md component="blank" %} ## 4. Guides Information about other guides and pages about this feature. ``` -------------------------------- ### Get CfgPatches Classes Source: https://ace3.acemod.org/wiki/framework/checkpbos-framework Use this script in the editor to list CfgPatches classes for enabled mods. This helps identify PBOs for whitelisting. ```plaintext copyToClipboard str ("true" configClasses (configFile >> "CfgPatches") apply {configName _x}); ``` -------------------------------- ### Get Detonators for a Unit Source: https://ace3.acemod.org/wiki/functions/explosives Returns all detonator config names a given unit possesses. No setup is required. ```enFunctions player call ace_explosives_fnc_getDetonators ``` -------------------------------- ### Launch Test Build with File Patching Source: https://ace3.acemod.org/wiki/development/setting-up-the-development-environment.html Use this modline to start the game with a test build. This build is binarized and suitable for group testing but not for release. It includes debugging flags. ```bash -mod=@CBA_A3;z\ace -skipIntro -noSplash -showScriptErrors -debug ``` -------------------------------- ### Get Vehicle Lighting Hitpoints Source: https://ace3.acemod.org/wiki/functions/common Returns all lighting hitpoints (selections) of a vehicle that can be affected by setHit and getHit. These selections have an armor value of 0. ```ArmaScript [car] call ace_common_fnc_getReflectorsWithSelections ``` -------------------------------- ### Get Flashlight Properties Source: https://ace3.acemod.org/wiki/functions/common Reads properties of a given flashlight. Use this to get the light intensity of a flashlight. ```en ["flashlight"] call ace_common_fnc_getLightPropertiesWeapon ``` -------------------------------- ### PBO Dependency Structure Example Source: https://ace3.acemod.org/wiki/development/modularity-and-pbo-structure.html Illustrates a common dependency hierarchy for ACE3 modules, showing how main components rely on common, interaction, and feature-specific PBOs. ```plaintext Main -> Common -> Interaction -> Most things Main -> Common -> Config things Main -> Common -> 3D Models | Interaction | -> Feature ``` -------------------------------- ### Example: Create and Add Self-Action to Class Source: https://ace3.acemod.org/wiki/framework/interactionmenu-framework Shows how to create a self-action for a player, checking conditions like radio finder status and interaction possibility, then adding it to the player's class. ```arma-script _condition = { (!pabst_radioFinder_on) && {(backpack _player) in pabst_radioFinder_backpacks} && {[_player, _target, []] call ace_common_fnc_canInteractWith} }; _statement = { [true] call pabst_fnc_radioFinder_action; }; _action = ["Open RDF", "Radio Direction Finder", "pabst\RDF.jpg", _statement, _condition] call ace_interact_menu_fnc_createAction; [typeOf _unit, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass; ``` -------------------------------- ### Get Weapon Azimuth and Inclination Source: https://ace3.acemod.org/wiki/functions/common Gets the local player's weapon direction and slope. Requires the weapon name as a string parameter. ```en ["gun"] call ace_common_fnc_getWeaponAzimuthAndInclination ``` -------------------------------- ### Get Local Units Source: https://ace3.acemod.org/wiki/functions/common Gets an array of local units, filtering out null objects. This is a safer alternative to directly accessing `ace_common_localUnits` if null objects are not handled. ```en [] call ace_common_fnc_getLocalUnits ``` -------------------------------- ### Demonstrate Scheduler Issues with Concurrent Spawns Source: https://ace3.acemod.org/wiki/development/arma-3-scheduler-and-our-practices.html This example illustrates how concurrent spawns, especially those with tight loops and shared variables, can lead to unexpected behavior due to the scheduler halting script execution. It highlights the importance of understanding execution environments. ```ArmaScript myVar = true; 0 spawn { while {true} do { if (myVar) then { if (!myVar) then { hint "hi"; }; }; }; }; 0 spawn { while {true} do { myVar = !myVar; }; }; ``` -------------------------------- ### Example: Add Action with Inheritance to Class Source: https://ace3.acemod.org/wiki/framework/interactionmenu-framework Illustrates adding a 'Check Fuel' action to all land vehicles, and then demonstrates how to exclude specific child classes like 'MRAP_01_Base' from inheriting this action. It also shows creating a sub-action for external fuel checks on tanks. ```arma-script // Adds action to check fuel levels for all land vehicles _action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; ["LandVehicle", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; // Same as above, but children of "MRAP_01_Base" will not have the action _action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; ["LandVehicle", 0, ["ACE_MainActions"], _action, true, ["MRAP_01_Base"]] call ace_interact_menu_fnc_addActionToClass; // Adds action to check external fuel levels on tanks. Will be a sub action of the previous action. _action = ["CheckExtTank", "Check External Tank", "", {hint format ["Ext Tank: %1", 5]}, {true}] call ace_interact_menu_fnc_createAction; ["Tank_F", 0, ["ACE_MainActions", "CheckFuel"], _action, true] call ace_interact_menu_fnc_addActionToClass; ``` -------------------------------- ### Get Remaining Fuel Source: https://ace3.acemod.org/wiki/functions/refuel Gets the current amount of fuel remaining in a fuel source. The result is in liters. Ensure the provided object is a valid fuel source. ```sqf [fuelTruck] call ace_refuel_fnc_getFuel ``` -------------------------------- ### Example of Calling a Wound Handler Function Source: https://ace3.acemod.org/wiki/framework/medical-framework This example demonstrates how to invoke the wound handler function with sample arguments for a unit, damage dealt, damage type, and ammo. ```sqf [player, [[0.5, "Body", 1], [0.3, "Head", 0.6]], "grenade", "grenade_ammo"] ace_medical_damage_fnc_woundsHandlerBase ``` -------------------------------- ### Use Standard 'for' Loop Syntax Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Prefer the standard `for ... from ... step ... do` loop syntax over the older C-style `for [{...},{...},{...}] do` for clarity and consistency. ```ArmaScript for "_y" from # to # step # do { ... } ``` -------------------------------- ### Get Object Name Source: https://ace3.acemod.org/wiki/functions/common Retrieves the name of an object, with options to use the commander's name for vehicles and to get the raw name without HTML tag sanitization. ```ArmaScript [player, false, true] call ace_common_fnc_getName; ``` -------------------------------- ### Example Module Definition Source: https://ace3.acemod.org/wiki/framework/modules-framework Defines a custom module 'ACE_bananaModule' inheriting from 'ACE_Module'. This snippet shows how to set up basic properties like scope, display name, category, initialization function, and author for a module within the ACE3 framework. ```cpp class CfgVehicles { class ACE_Module; class ACE_bananaModule: ACE_Module { scope = 2; displayName = "Spawn Banana"; category = "ACE"; function = "ace_fnc_bananaModuleInit"; functionPriority = 10; isGlobal = 0; isTriggerActivated = 0; isDisposable = 0; author = "Monkey123"; }; }; ``` -------------------------------- ### Start Explosive Timer with ACE3 Source: https://ace3.acemod.org/wiki/functions/explosives Starts a detonation timer for an explosive. Specify the explosive object, detonation time in seconds, an optional trigger classname, and the unit initiating the timer. ```sqf [cursorObject, 10] call ace_explosives_fnc_startTimer ``` -------------------------------- ### ACE3 Settings via Mission Parameters in description.ext Source: https://ace3.acemod.org/wiki/framework/settings-framework This example demonstrates how to define Mission Parameters in the description.ext file to control ACE3 settings like medical level and spare parts availability. Ensure the parameter class name matches the ACE setting and includes the ACE_setting flag. ```Arma 3 Config class Params { class ace_medical_level { title = "Medical Level"; ACE_setting = 1; values[] = {1, 2}; texts[] = {"Basic", "Advanced"}; default = 2; }; class ace_repair_addSpareParts { title = "$STR_ACE_Repair_addSpareParts_name"; ACE_setting = 1; values[] = {0, 1}; texts[] = {"False", "True"}; default = 1; }; }; ``` -------------------------------- ### ace_refuel_fnc_getFuel Source: https://ace3.acemod.org/wiki/functions/refuel Get the remaining fuel amount in a fuel source. ```APIDOC ## ace_refuel_fnc_getFuel ### Description Get the remaining fuel amount. ### Parameters #### Path Parameters - **Fuel Source** (OBJECT) - Required - The fuel source object. ### Return Value - **Fuel left** (NUMBER) - The remaining fuel in liters. ### Request Example ``` [fuelTruck] call ace_refuel_fnc_getFuel ``` ``` -------------------------------- ### Define Custom Tag with Addon Paths Source: https://ace3.acemod.org/wiki/framework/tagging-framework.html When defining tags in description.ext and using addon paths for assets like textures or materials, prefix the paths with `@`. This example shows how to configure a tag using addon paths. ```sqf class ACE_Tags { class yourTagClass { displayName = "My Tag"; // Name of your tag being displayed in the interaction menu requiredItem = "ACE_SpraypaintBlack"; // Required item to have in the inventory to be able to spray your tag (eg. `"ACE_SpraypaintBlack"`, `"ACE_SpraypaintRed"`, `"ACE_SpraypaintGreen"`, `"ACE_SpraypaintBlue"` or any custom item from `CfgWeapons`) textures[] = {"@path\to\texture1.paa", "@path\to\texture2.paa"}; // List of texture variations (one is randomly selected when tagging) materials[] = {"@path\to\material.rvmat"}; // Optional: List of material variations (one is randomly selected). Keep empty if you don't need a custom material. icon = "@path\to\icon.paa"; // Icon being displayed in the interaction menu tagModel = "ace_tagging_texture1m"; // Optional: The 3D Model that will be spawned with the texture on it, can either be CfgVehicles classname or P3D file path. condition = "true"; // Optional: Condition for the Spraytag Action. Needs to return bool. }; }; ``` -------------------------------- ### ace_refuel_fnc_getCapacity Source: https://ace3.acemod.org/wiki/functions/refuel Gets the capacity of a fuel source's tank. ```APIDOC ## ace_refuel_fnc_getCapacity ### Description Gets the capacity of a fuel source’s tank. ### Parameters #### Path Parameters - **Fuel Source** (OBJECT) - Required - The fuel source object. ### Return Value - **Fuel capacity** (NUMBER) - The capacity of the fuel source's tank. ### Request Example ``` [fuelTruck] call ace_refuel_fnc_getCapacity ``` ``` -------------------------------- ### Class Definition with Braces - Correct Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Demonstrates the correct placement of braces for class definitions, with the opening brace on the same line as the keyword and the closing brace on its own line. ```Arma class Something: Or { class Other { foo = "bar"; }; }; ``` -------------------------------- ### ace_refuel_fnc_getFuel Source: https://ace3.acemod.org/wiki/framework/refuel-framework Gets the current fuel supply of a fuel truck. ```APIDOC ## ace_refuel_fnc_getFuel ### Description Gets the current fuel supply of a fuel truck. ### Arguments - **0** (Object): Fuel Truck - Required ### Return Value - Fuel amount left (in liters) (Number) ### Example ``` [fuelTruck] call ace_refuel_fnc_getFuel; ``` ``` -------------------------------- ### ace_cargo_fnc_getCargoSpaceLeft Source: https://ace3.acemod.org/wiki/functions/cargo Gets the remaining cargo space of a given object (vehicle). ```APIDOC ## ace_cargo_fnc_getCargoSpaceLeft ### Description Gets the object’s remaining cargo space. ### Parameters #### Path Parameters - **Holder object (vehicle)** (OBJECT) - Required - The object whose cargo space is to be checked. ### Return Value - **Cargo space left** (NUMBER) - The amount of cargo space remaining. ### Example ``` cursorObject call ace_cargo_fnc_getCargoSpaceLeft ``` ``` -------------------------------- ### Create Slideshow with Custom Settings Source: https://ace3.acemod.org/wiki/framework/slideshow-framework Use this function to create a slideshow on specified screen objects. Configure image paths, actions, slide duration, set name, and texture selection. Ensure image paths use backslashes. ```sqf [[object1, object2], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides", 1] call ace_slideshow_fnc_createSlideshow; ``` -------------------------------- ### Get Player Side - ACE3 Source: https://ace3.acemod.org/wiki/functions/common Returns the current side of the local player. ```arma_script [] call ace_common_fnc_playerSide ``` -------------------------------- ### Indentation - Correct Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Demonstrates correct indentation with each new scope on a new line, using 4 spaces per indent. Avoids trailing whitespace. ```Arma call { call { if (/* condition */) then { /* code */ }; }; }; ``` -------------------------------- ### Get Turret Commander Source: https://ace3.acemod.org/wiki/functions/common Retrieves the turret indices for a vehicle's commander. ```en [car] call ace_common_fnc_getTurretCommander ``` -------------------------------- ### Include Header File Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Include header files for configuration to organize settings. Ensure the header file name matches the config class name. ```cpp #include "ACE_Settings.hpp" ``` -------------------------------- ### ace_explosives_fnc_getPlacedExplosives Source: https://ace3.acemod.org/wiki/functions/explosives Gets all placed explosives by a unit, with an option to filter by trigger type. ```APIDOC ## ace_explosives_fnc_getPlacedExplosives ### Description Gets all placed explosives by unit, optionally filtered by specific trigger type. ### Parameters #### Path Parameters * **Unit** (OBJECT) - The unit whose placed explosives are to be retrieved. Defaults to the current object if not provided. * **Trigger classname** (STRING) - Optional. A classname to filter the explosives by. If empty, all explosives are returned. ### Return Value * **Explosives** (ARRAY) - An array of placed explosives. ### Request Example ``` _allExplosives = player call ace_explosives_fnc_getPlacedExplosives _deadmanExplosives = [player, "DeadManSwitch"] call ace_explosives_fnc_getPlacedExplosives ``` ``` -------------------------------- ### ace_common_fnc_getWeaponAzimuthAndInclination Source: https://ace3.acemod.org/wiki/functions/common Gets the local player's weapon direction (azimuth) and slope (inclination). ```APIDOC ## ace_common_fnc_getWeaponAzimuthAndInclination ### Description Get local players weapon direction and slope. ### Parameters - **Weapon name** (STRING) - Description: Weapon name ### Return Value - **Azimuth** (NUMBER) - **Inclination** (NUMBER) ### Example ``` ["gun"] call ace_common_fnc_getWeaponAzimuthAndInclination ``` ``` -------------------------------- ### Make a jerry can with default fuel Source: https://ace3.acemod.org/wiki/framework/refuel-framework Initialize a jerry can object to function as a portable fuel source with the default 20 liters capacity. Meant to be run on all clients and server. ```sqf [can] call ace_refuel_fnc_makeJerryCan; ``` -------------------------------- ### Launch Development Build with File Patching Source: https://ace3.acemod.org/wiki/development/setting-up-the-development-environment.html Use this command to launch Arma 3 with a development build using file patching. This command assumes you have already run `$ hemtt dev`. It's useful for testing changes without binarization. ```bash -mod=@CBA_A3;z\ace -skipIntro -noSplash -showScriptErrors -debug -filePatching ``` -------------------------------- ### Create Vehicle Locally with Zero Position Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Creating a vehicle locally at `[0, 0, 0]` is significantly faster as it bypasses collision detection. Apply the desired position using `setPosATL` afterwards. ```ArmaScript _vehicle = _type createVehicleLocal [0, 0, 0]; _vehicle setPosATL _posATL; ``` -------------------------------- ### ace_common_fnc_getTargetAzimuthAndInclination Source: https://ace3.acemod.org/wiki/functions/common Gets the player's current viewing direction (azimuth) and inclination (slope). ```APIDOC ## ace_common_fnc_getTargetAzimuthAndInclination ### Description Get players viewing direction and slope. ### Parameters None ### Return Value - **Azimuth** (NUMBER) - Description: Azimuth ### Request Example ``` [] call ace_common_fnc_getTargetAzimuthAndInclination ``` ``` -------------------------------- ### Get Virtual Items Source: https://ace3.acemod.org/wiki/functions/arsenal Retrieves a hashmap of virtual items available to a target object. ```sqf cursorObject call ace_arsenal_fnc_getVirtualItems ``` -------------------------------- ### ace_scopes_fnc_getBoreHeight Source: https://ace3.acemod.org/wiki/functions/scopes Gets the bore height of the weapon & optic combination with the given weapon index. ```APIDOC ## ace_scopes_fnc_getBoreHeight ### Description Gets the bore height of the weapon & optic combination with the given weapon index. ### Parameters #### Path Parameters - **Unit** (OBJECT) - Required - The unit to get the bore height for. - **Weapon index** (NUMBER) - Required - The index of the weapon. ### Return Value #### Success Response - **bore height** (NUMBER) - The bore height of the weapon & optic combination. ### Request Example ``` [player, 0] call ace_scopes_fnc_getBoreHeight ``` ``` -------------------------------- ### ace_scopes_fnc_getBaseAngle Source: https://ace3.acemod.org/wiki/functions/scopes Gets the base angle of the weapon & optic combination with the given weapon index. ```APIDOC ## ace_scopes_fnc_getBaseAngle ### Description Gets the base angle of the weapon & optic combination with the given weapon index. ### Parameters #### Path Parameters - **Unit** (OBJECT) - Required - The unit to get the angle for. - **Weapon index** (NUMBER) - Required - The index of the weapon. ### Return Value #### Success Response - **base angle** (NUMBER) - The base angle of the weapon & optic combination. ### Request Example ``` [player, 0] call ace_scopes_fnc_getBaseAngle ``` ``` -------------------------------- ### Make a jerry can with specified fuel Source: https://ace3.acemod.org/wiki/framework/refuel-framework Initialize a jerry can object with a custom fuel capacity. Meant to be run on all clients and server. ```sqf [can, 200] call ace_refuel_fnc_makeJerryCan; ``` -------------------------------- ### Get Remaining Water Source: https://ace3.acemod.org/wiki/functions/field_rations.html Returns the remaining water in a source. The source is an OBJECT. ```Arma Script [_source] call ace_field_rations_fnc_getRemainingWater ``` -------------------------------- ### Initialize Arsenal Box with Loadout Items Source: https://ace3.acemod.org/wiki/framework/arsenal-framework.html Use to initialize an Arsenal box with only items from specified loadouts. Requires a pre-generated array of item class names. ```sqf [_box, ["item1", "item2", "itemN"]] call ace_arsenal_fnc_initBox ``` -------------------------------- ### Get ACE Version Source: https://ace3.acemod.org/wiki/functions/common Retrieves the version number of the current ACE build. No parameters are required. ```en [] call ace_common_fnc_getVersion ``` -------------------------------- ### Get Item Name Source: https://ace3.acemod.org/wiki/functions/cargo Retrieves the name of an item, with an option to include its custom name if available. ```sqf cursorObject call ace_cargo_fnc_getNameItem ``` -------------------------------- ### Set Engine Startup Delay via Script Source: https://ace3.acemod.org/wiki/framework/vehicles-framework Dynamically set the engine startup delay for a specific vehicle object using the ace_vehicles_fnc_setVehicleStartDelay function. This function has global effects on the specified vehicle. ```sqf [myCar, 2.2] call ace_vehicles_fnc_setVehicleStartDelay; ``` -------------------------------- ### Get Current Zoom Level Source: https://ace3.acemod.org/wiki/functions/common Call this function to retrieve the current zoom level. No parameters are required. ```en [] call ace_common_fnc_getZoom ``` -------------------------------- ### ace_slideshow_fnc_createSlideshow Source: https://ace3.acemod.org/wiki/functions/slideshow Prepares necessary variables and default image for creating a slideshow. It takes various parameters to define the slideshow's content, behavior, and appearance. ```APIDOC ## ace_slideshow_fnc_createSlideshow ### Description Prepares necessary variables and default image. ### Parameters #### Path Parameters - **Objects** (ARRAY) - Required - Objects to be included in the slideshow. - **Controller Objects** (ARRAY) - Required - Controller objects for the slideshow. - **Image Paths** (ARRAY) - Required - Paths to the images for the slideshow. - **Action Names** (ARRAY) - Required - Action names associated with the slideshow. - **Slide Duration** (NUMBER) - Optional - Duration of each slide in seconds. 0 disables automatic transitions. Defaults to the value of the last parameter if not provided. - **Set Name** (STRING) - Optional - The name of the slideshow set. Defaults to localized “Slides”. - **Texture Selection** (NUMBER) - Optional - Texture selection option. Defaults to 0. ### Return Value - **Slideshow ID** (NUMBER) - The unique identifier for the created slideshow. ### Request Example ``` [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides"] call ace_slideshow_fnc_createSlideshow ``` ``` -------------------------------- ### Class Definition with Braces - Incorrect Source: https://ace3.acemod.org/wiki/development/coding-guidelines.html Illustrates incorrect brace placement for class definitions, showing common mistakes to avoid. ```Arma class Something : Or { class Other { foo = "bar"; }; }; ``` ```Arma class Something : Or { class Other { foo = "bar"; }; }; ``` -------------------------------- ### Get Base Attachment Source: https://ace3.acemod.org/wiki/functions/arsenal Retrieves the base attachment name for a given scripted attachment. Adapted from CBA_fnc_switchableAttachments. ```sqf "ACE_acc_pointer_green_IR" call ace_arsenal_fnc_baseAttachment ``` -------------------------------- ### Get Wind Direction - ACE Common Source: https://ace3.acemod.org/wiki/functions/common Retrieves the cardinal direction from which the wind is blowing. This function requires no parameters. ```sqf [] call ace_common_fnc_getWindDirection ``` -------------------------------- ### ACE3 Framework Documentation Template Source: https://ace3.acemod.org/wiki/development/documentation-guidelines-and-tips.html Use this template for documenting a framework. It covers config values, events, and scripting. ```markdown --- layout: wiki title: Component Framework description: Description of the framework. group: framework parent: wiki mod: ace version: major: 3 minor: 0 patch: 0 --- ## 1. Config Values Config API. ## 2. Events Table of public events. ## 3. Scripting Public functions. ``` -------------------------------- ### Define a Nested Self Action via Config Source: https://ace3.acemod.org/wiki/framework/interactionmenu-framework Demonstrates how to create a nested self-action, like 'PutInEarplugs', as a sub-action under the 'ACE_Equipment' category within the CfgVehicles configuration. ```sqf class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { class ACE_PutInEarplugs {}; }; }; }; ``` -------------------------------- ### Get Vehicle Codriver Positions Source: https://ace3.acemod.org/wiki/functions/common Retrieves the positions of codrivers for a given vehicle. Ensure the vehicle object is valid. ```en ["car"] call ace_common_fnc_getVehicleCodriver ``` -------------------------------- ### Get Magnetic Bearing of an Object Source: https://ace3.acemod.org/wiki/functions/common Retrieves the magnetic heading of a specified object. Defaults to the player if no object is provided. ```ArmaScript [player] call ace_common_fnc_getMagneticBearing ``` -------------------------------- ### Create Basic Map Image Source: https://ace3.acemod.org/wiki/framework/slideshow-framework Generates a procedural map texture. This function needs to be run on all machines. It can take position, scale, markers, map type, initialization code, and resolution as arguments. ```sqf tex1 = [] call ace_slideshow_fnc_mapImage; ``` ```sqf tex2 = [(getPos aWhiteboard), 0.5, [[getpos aWhiteboard, "you", "mil_start"]], 0] call ace_slideshow_fnc_mapImage; ``` ```sqf tex3 = [[4000, 4000], 0.5, [[[5000, 5000], "target", "mil_objective"]], 2] call ace_slideshow_fnc_mapImage; ``` -------------------------------- ### ace_common_fnc_getLocalUnits Source: https://ace3.acemod.org/wiki/functions/common Gets the localUnits array, filtering out null objects. This provides a clean array of units that are local to the player. ```APIDOC ## ace_common_fnc_getLocalUnits ### Description Gets localUnits array filtering out nullObjects. If you can handle null objects you can use the array `ace_common_localUnits` directly. Should be equivalent to `allUnits select {local _x}`. ### Parameters None ### Return Value - **Array of local Units** (ARRAY) - An array containing all local units. ### Request Example ``` [] call ace_common_fnc_getLocalUnits ``` ``` -------------------------------- ### ACE3 Setting Definition Example Source: https://ace3.acemod.org/wiki/framework/settings-framework This snippet shows the structure of a setting definition within the ACE_Settings class in the config. It includes properties like display name, description, settability, type, default value, and optional values for scalar types. ```ArmaConfig class ACE_Settings { class ACE_module_sampleSetting { // Following 2 entries are redundant if isClientSettable = 0 displayName = "$STR_ACE_Common_SettingName"; // Stringtable entry with the setting name description = "$STR_ACE_Common_SettingDescription"; // Stringtable entry with the setting description isClientSettable = 1; // Show in client options menu (0-no, 1-yes) typeName = "SCALAR"; // Type (BOOL/SCALAR/STRING/ARRAY/COLOR) value = 1; // Value // Following entry is redundant if typeName is NOT "SCALAR" values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; // (Optional) Stringtable entries that describe the options // Following entry is present only in export force = 0; // Force the setting (0-no, 1-yes), exported settings are forced by default }; }; ``` -------------------------------- ### ace_zeus_fnc_showMessage Source: https://ace3.acemod.org/wiki/functions/zeus.html Shows a Zeus message through the BIS function, handles localization. If multiple args are given, they get formatted. ```APIDOC ## ace_zeus_fnc_showMessage ### Description Shows a Zeus message through the BIS function, handles localization. If multiple args are given, they get formatted. ### Parameters #### Path Parameters - **Message** (STRING) - Required - The message to display. Can include formatting specifiers like %1, %2. ### Request Example ``` ["something"] call ace_zeus_fnc_showMessage ["something %1 in %2", "strange", getPos neighborhood] call ace_zeus_fnc_showMessage ``` ### Response #### Success Response (200) This function does not return any value. ``` -------------------------------- ### ace_explosives_fnc_startDefuse Source: https://ace3.acemod.org/wiki/functions/explosives Starts the process of defusing an explosive. It requires the unit performing the defusal and the interaction object or target explosive. ```APIDOC ## ace_explosives_fnc_startDefuse ### Description Starts defusing an explosive. ### Parameters #### Parameters - **Unit** (OBJECT) - Required - The unit performing the defusal. - **Interaction object or target explosive** (OBJECT) - Required - The object to interact with or the target explosive. ### Return Value None ### Example ``` [player, cursorObject] call ace_explosives_fnc_startDefuse ``` ``` -------------------------------- ### Set Vehicle Engine Startup Delay Source: https://ace3.acemod.org/wiki/functions/vehicles.html Sets the engine startup delay for a specific vehicle. The first parameter is the vehicle object, and the second is the delay in seconds. ```sqf [hemtt, 3.2] call ace_vehicles_fnc_setVehicleStartDelay ``` -------------------------------- ### Enable Fastroping with FRIES System Source: https://ace3.acemod.org/wiki/framework/fastroping-framework.html Configure ACE3 for fastroping using a FRIES (Fast Rope Insertion Extraction System). This requires specifying the FRIES model, attachment point, and callback functions for preparation and cutting. ```config ace_fastroping_enabled = 2; ance_fastroping_friesType = "yourFRIESType"; ance_fastroping_friesAttachmentPoint[] = {x, y, z}; ance_fastroping_onCut = "ace_fastroping_fnc_onCutCommon"; ance_fastroping_onPrepare "ace_fastroping_fnc_onPrepareCommon"; ance_fastroping_ropeOrigins[] = {"ropeOriginLeft", "ropeOriginRight"}; ``` -------------------------------- ### Get Vehicle Icon Source: https://ace3.acemod.org/wiki/functions/common Fetches the icon string for a given vehicle object or classname. This function caches results for efficiency. ```en ["B_Soldier_F"] call ace_common_fnc_getVehicleIcon; ``` -------------------------------- ### ace_common_fnc_getName Source: https://ace3.acemod.org/wiki/functions/common Retrieves the name of an object, with options to use the effective commander name for vehicles and to get the raw, unsanitized name. ```APIDOC ## ace_common_fnc_getName ### Description Returns the name of the object. Used to prevent issues with the name command. ### Parameters #### Path Parameters - **Object** (OBJECT) - Required - The object to get the name of. - **Use effective commander name** (BOOL) - Optional - If true, uses the effective commander name for vehicles. Defaults to false. - **Get Raw Name** (BOOL) - Optional - If true, gets the raw name without sanitizing HTML tags. Defaults to false. ### Return Value - **Object Name** (STRING) - The name of the object. ### Request Example ``` [player, false, true] call ace_common_fnc_getName; ``` ``` -------------------------------- ### Define Custom Fortify Presets Source: https://ace3.acemod.org/wiki/framework/fortify-framework Defines custom fortification presets and categories using configuration classes. Presets can include object classnames, costs, and optional categories or references to other presets. ```config class ACEX_Fortify_Presets { class TAG_MyPreset { displayName = "My Preset"; objects[] = { {"Sandbag", 5}, {"Bunker", 50} }; }; class TAG_categories { displayName = "My Categories"; objects[] = { {"Sandbag", 5, "A Category"}, {"Bunker", 50, "TAG_MyPreset"} // will use the localized displayName of that preset ("My Preset") }; }; }; ```