ace_common_fnc_addMapMarkerCreatedEventHandler
Description
Add a map marker creation event handler.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Code to execute | CODE or STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| ID of the event script (used to remove it later). | NUMBER |
Example
["bob"] call ace_common_fnc_addMapMarkerCreatedEventHandler
Authors
- commy2
ace_common_fnc_addSwayFactor
Description
Adds a factor to player sway calculation
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Type of factor, “baseline” or “multiplier” | STRING | |
| 1 | Factor function, must return number | CODE | |
| 2 | Factor ID, unique to type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Factor added | BOOL |
Example
["baseline", {1}, "ace_common"] call ace_common_fnc_addSwayFactor
Authors
- LinkIsGrim
ace_common_fnc_addSyncedEventHandler
Description
Register an event handler for an ACE synced event
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Name | STRING | |
| 1 | Handler | CODE | |
| 2 | TTL | NUMBER or CODE | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Boolean of success | BOOL |
Example
["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
Authors
- jaynus
ace_common_fnc_addToInventory
Description
Adds an item, weapon, or magazine to the unit’s inventory or places it in a weapon holder if no space.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Classname | STRING | |
| 2 | Container (uniform, vest, backpack) | STRING | ”” |
| 3 | Magazine Ammo Count | NUMBER | -1 |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Added to player | BOOL |
Example
[player, "30Rnd_65x39_caseless_mag", "", 5] call ace_common_fnc_addToInventory
Authors
- Garth ‘L-H’ de Wet
ace_common_fnc_addWeapon
Description
Adds weapon to unit without taking a magazine. Same as CBA_fnc_addWeaponWithoutItems, but doesn’t remove linked items by default.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit to add the weapon to | OBJECT | |
| 1 | Weapon to add | STRING | |
| 2 | If linked items should be removed or not | BOOL | false |
| 3 | Magazines that should be added to the weapon | ARRAY | [] |
| 0 | Magazine classname | STRING | |
| 1 | Ammo count | NUMBER |
Return Value
None
Example
[player, "arifle_MX_GL_F", true, [["30Rnd_65x39_caseless_mag", 30], ["1Rnd_HE_Grenade_shell", 1]]] call ace_common_fnc_addWeapon
Authors
- commy2
- johnb43
ace_common_fnc_ambientBrightness
Description
Returns a brightness value depending on the sun and moon state. Ranges from 0 to 1 (dark … bright).
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Ambient brightness | NUMBER |
Example
[] call ace_common_fnc_ambientBrightness
Authors
- commy2
- idea by Falke
ace_common_fnc_arithmeticGetResult
Description
Returns the arithmetic result of performing the given operation on a set.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Namespace | OBJECT or LOCATION or NAMESPACE | |
| 1 | Number Set ID | STRING | |
| 2 | Operation (max, min, sum, product, avg) (Case Sensitive) | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Value | NUMBER |
Example
[ace_player, "ace_aimCoefficents", "product"] call ace_common_fnc_arithmeticGetResult
[missionNameSpace, "ace_hearing", "min"] call ace_common_fnc_arithmeticGetResult
Authors
- PabstMirror
ace_common_fnc_arithmeticSetSource
Description
Adds or removes a source to an arithmetic set.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Namespace | OBJECT or LOCATION or NAMESPACE | |
| 1 | Number Set ID | STRING | |
| 2 | Source | STRING | |
| 3 | Code that returns a number (can access var _namespace) [use {} to remove] | CODE |
Return Value
None
Example
[missionNameSpace, "ace_hearing", "myMission", {0.5}] call ace_common_fnc_arithmeticSetSource
[ace_player, "ace_aimCoefficents", "ace_medical", {linearConversion [0,1,(_namespace getVariable "ace_medical_pain",1,0.2,true]}] call ace_common_fnc_arithmeticSetSource
Authors
- PabstMirror
ace_common_fnc_binarizeNumber
Description
Get a binary equivalent of a decimal number.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Decimal Number | NUMBER | |
| 1 | Minimum length of the returned Array, note: returned array can be larger | NUMBER | 8 |
Return Value
| Description | Datatype(s) |
|---|---|
| Booleans | ARRAY |
Example
[5, 5] call ace_common_fnc_binarizeNumber
Authors
- commy2
ace_common_fnc_blurScreen
Description
Blurs screen.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | ID | NUMBER | |
| 1 | Show? | BOOL or NUMBER |
Return Value
None
Example
[5, true] call ace_common_fnc_blurScreen
Authors
- Glowbal
ace_common_fnc_canInteractWith
Description
Check if the unit can interact.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | The player. | OBJECT | |
| 1 | The interaction target. objNull to ignore. | OBJECT | |
| 2 | Exceptions. What general conditions are to skip? | ARRAY | [] |
Return Value
| Description | Datatype(s) |
|---|---|
| Unit can interact? | BOOL |
Example
[bob, target, []] call ace_common_fnc_canInteractWith
Authors
- commy2
ace_common_fnc_checkPBOs
Description
Used to execute the checkPBOs module without placing the module. Don’t use this together with the module. Checks PBO versions and compares to the one running on server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Mode | NUMBER | |
| 1 | Check all PBOs? | BOOL | false |
| 2 | Whitelist as list of addons. Regex patterns can be used to match addons. Addon name will be matched case-insensitive by default. | STRING | ”” |
Return Value
None
Example
[0, true, "acex_headless,cba_.*"] call ace_common_fnc_checkPBOs
Authors
- commy2
- johnb43
- Timi007
ace_common_fnc_claimSafeServer
Description
Unit claims the ownership over an object. This is used to prevent multiple players from dragging the same ammo box or using up the same wheel when repairing etc. This function only runs on the server and handles the “ace_common_claimSafe” event. It provides a network safe way claiming objects as all claims are run on server. Return event is passed [_unit, _target, _success] for new claims, no event on claim release
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit that claims another object. ObjNull to remove claim. | OBJECT | |
| 1 | The object that gets claimed. | OBJECT | |
| 2 | Lock the claimed object as well? | BOOL | false |
| 3 | Target event to trigger for calling machine (called where _unit is local) | STRING | No event |
Return Value
None
Example
[bob, flag, true, "claimReturn"] call ace_common_fnc_claimSafeServer
Authors
- commy2
- PabstMirror
ace_common_fnc_codeToString
Description
Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Code | CODE or STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Code | STRING |
Example
["bob"] call ace_common_fnc_codeToString
Authors
- commy2
ace_common_fnc_createOrthonormalReference
Description
Returns a orthonormal system of reference aligned with the supplied vector
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vector to align the coordinate system with | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Vector Normalized | ARRAY |
Example
[[0,0,0]] call ace_common_fnc_createOrthonormalReference
Authors
- esteldunedain
ace_common_fnc_currentChannel
Description
Returns the current radio / chat / marker channel.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| The current channel (“group”, “side”, “global”, “command”, “vehicle”, “direct”, “custom_X”) | STRING |
Example
[] call ace_common_fnc_currentChannel
Authors
- commy2
ace_common_fnc_debug
Description
Print logging messages through the ACE framework.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Message | ANY | |
| 1 | Level | NUMBER | 2 |
Return Value
| Description | Datatype(s) |
|---|---|
| Message is Printed | BOOL |
Example
[bob, 2] call ace_common_fnc_debug
Authors
- Glowbal
ace_common_fnc_defineVariable
Description
Define a variable for the ACE variable framework
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Name | STRING | |
| 1 | Default value | ANY | |
| 2 | Public flag | BOOL | |
| 3 | Category | STRING | |
| 4 | Type | NUMBER | 0 |
| 5 | Persistent flag | BOOL | false |
Return Value
None
Example
["bob", 1, true, "category", 1, true] call ace_common_fnc_defineVariable
Authors
- Glowbal
ace_common_fnc_displayIcon
Description
Displays an icon at a CBA settings-defined position and ensures multiple icons are shown after each other
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | icon ID | STRING | |
| 1 | show | BOOL | |
| 2 | Icon Path | STRING | |
| 3 | Icon color | ARRAY | |
| 4 | timeAlive. -1 = forever | NUMBER | 6 |
Return Value
None
Example
["myID", true, QPATHTOF(data\icon_group.paa), [1,1,1,1], 0] call ace_common_fnc_displayIcon;
Authors
- Glowbal
ace_common_fnc_displayText
Description
Display a message.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Message | STRING | |
| 1 | Play a clicking sound | BOOL | false |
| 2 | How long before hiding the message in seconds | NUMBER | 2 |
| 3 | Priority, higher priority messages will override lesser important ones | NUMBER | 0 |
Return Value
None
Example
["Message", true, 5, 2] call ace_common_fnc_displayText
Authors
- commy2
ace_common_fnc_displayTextPicture
Description
Display a structured text with image.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Text | ANY | |
| 1 | Image | STRING | |
| 2 | Image color | ARRAY | [1, 1, 1] |
| 3 | Target Unit. Will only display if target is the player controlled object | OBJECT | ACE_player |
| 4 | Size | NUMBER | 2 |
Return Value
None
Example
["text", "image", [1, 1, 1], ACE_player, 2] call ace_common_fnc_displayTextPicture
["text", "image", nil, nil, 3] call ace_common_fnc_displayTextPicture
Authors
- commy2
- Glowbal
ace_common_fnc_displayTextStructured
Description
Display a structured text.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Text | ANY | |
| 1 | Size of the textbox | NUMBER | 1.5 |
| 2 | Target Unit. Will only display if target is the player controlled object | OBJECT | ACE_player |
| 3 | Custom Width | NUMBER | 10 |
Return Value
None
Example
[["Test: %1", 123], 1.5] call ace_common_fnc_displayTextStructured
["wow", 1, ace_player, 3] call ace_common_fnc_displayTextStructured
Authors
- commy2
- Glowbal
- GitHawk
ace_common_fnc_doAnimation
Description
Execute an animation. This is used to not break things like the unconsciousness animation.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Animation | STRING | |
| 2 | Priority of the animation. | NUMBER | 0 |
Return Value
None
Example
[player, "AmovPercMstpSnonWnonDnon_exerciseKata", 1] call ace_common_fnc_doAnimation
Authors
- commy2
ace_common_fnc_dropBackpack
Description
Drops a backback. Also returns the ground weapon holder object of the dropped backpack.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit that has a backpack | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Ground weapon holder with backpack | OBJECT |
Example
[unit] call ace_common_fnc_dropBackpack
Authors
- commy2
ace_common_fnc_escapeRegex
Description
Escapes special characters used in regex from a string
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | String | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Safe string | STRING |
Example
"\Q.*?AK-15.*?\E" call ace_common_fnc_escapeRegex
Authors
- LinkIsGrim
ace_common_fnc_getAddon
Description
Returns a config’s addon.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Config entry | CONFIG |
Return Value
| Description | Datatype(s) |
|---|---|
| Addon name | STRING |
Example
[configFile >> "CfgWeapons" >> "arifle_AK12_F"] call ace_common_fnc_getAddon
Authors
- johnb43
ace_common_fnc_getAllDefinedSetVariables
Description
Returns an 2d array of all variables that have been set on the object
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Limiting Category | STRING | ”” |
Return Value
| Description | Datatype(s) |
|---|---|
| Variable Data | ARRAY |
Example
[bob, ""] call ace_common_fnc_getAllDefinedSetVariables
Authors
- Glowbal
ace_common_fnc_getChildren
Description
Obtain children of a config entry
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Parent Entry Class Children | ARRAY |
Example
[bob] call ace_common_fnc_getChildren
Authors
- commy2
ace_common_fnc_getConfigCommander
Description
Get the commander config of a vehicles turret.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Commander config | CONFIG |
Example
[car] call ace_common_fnc_getConfigCommander
Authors
- commy2
ace_common_fnc_getConfigGunner
Description
Get the gunner config of a vehicles turret.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Gunner config | CONFIG |
Example
[car] call ace_common_fnc_getConfigGunner
Authors
- commy2
ace_common_fnc_getConfigName
Description
Returns an item’s config case sensitive name.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Class name (item or object) | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Config case item name (“” if config is not found) | STRING |
Example
["arifle_AK12_F"] call ace_common_fnc_getConfigName
Authors
- johnb43
ace_common_fnc_getCountOfItem
Description
Return how many items of type _itemType the player has in his containers (Uniform, Vest, Backpack) Doesn’t count assignedItems, weapons, weapon attachments, magazines in weapons
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Classname of item (Case-Sensitive) | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Item Count | NUMBER |
Example
[bob, "FirstAidKit"] call ace_common_fnc_getCountOfItem
Authors
- Dedmen
- Blue
- johnb43
ace_common_fnc_getDefinedVariableDefault
Description
Get the variable default value
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Variable Name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Default value of variable | ANY |
Example
["name"] call ace_common_fnc_getDefinedVariableDefault
Authors
- Glowbal
ace_common_fnc_getDLC
Description
Get the DLC information of a class.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Classname or Config | STRING or CONFIG | |
| 1 | Config root, searches if unspecified or null | CONFIG | configNull |
Return Value
| Description | Datatype(s) |
|---|---|
| DLC Info | ARRAY |
Example
"launch_NLAW_F" call ace_common_fnc_getDLC
Authors
- Brett Mayson
ace_common_fnc_getDoorTurrets
Description
Returns all turret indices of door gunners.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| All turret indices of the Vehicle | ARRAY |
Example
[car] call ace_common_fnc_getDoorTurrets
Authors
- bux578
ace_common_fnc_getFiremodeIndex
Description
Get the firemode index of the weapon for use with “SwitchWeapon”
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Muzzle | STRING | current weapon muzzle |
| 2 | Firemode | STRING | current weapon fire mode |
Return Value
| Description | Datatype(s) |
|---|---|
| Weapon/Mode index | NUMBER |
Example
[player] call ace_common_fnc_getFiremodeIndex
Authors
- PabstMirror
ace_common_fnc_getFirstObjectIntersection
Description
Returns the the first intersection with terrain between two positions.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | PositionASL | ARRAY | |
| 1 | PositionATL | ARRAY | |
| 2 | Accuracy | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Intersects | BOOL |
Example
[[1,2,3], [0,0,5], 5] call ace_common_fnc_getFirstObjectIntersection
Authors
- Ruthberg
ace_common_fnc_getFirstTerrainIntersection
Description
Returns the the first intersection with an object between two positions. @todo rewrite using lineIntersectsSurfaces?
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | PositionASL | ARRAY | |
| 1 | PositionATL | ARRAY | |
| 2 | Accuracy | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Intersects | BOOL |
Example
[[1,2,3], [0,0,5], 5] call ace_common_fnc_getFirstTerrainIntersection
Authors
- Ruthberg
ace_common_fnc_getGunner
Description
Returns gunner using specified weapon type in vehicle. Only works if all turrets have different weapons.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | |
| 1 | Weapon | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Gunner | OBJECT |
Example
[car, "gun"] call ace_common_fnc_getGunner
Authors
- commy2
ace_common_fnc_getInPosition
Description
Move unit into given vehicle position or switch to that position if the unit is already inside the vehicle.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Vehicle | OBJECT | |
| 2 | Position (“Driver”, “Pilot”, “Gunner”, “Commander”, “Copilot”, “Turret”, “FFV”, “Codriver”, “Cargo”) | STRING | |
| 3 | Index (only applies to “Turret”, “FFV”, “Codriver”, “Cargo”) | NUMBER | next free index |
Return Value
None
Example
[unit, vehicle, "Driver", 5] call ace_common_fnc_getInPosition
Authors
- commy2
ace_common_fnc_getItemReplacements
Description
Returns item replacements for a given type and/or item.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Item or item type ID to check | STRING or NUMBER | |
| 1 | Include type replacements for items | BOOL | true |
Return Value
| Description | Datatype(s) |
|---|---|
| Item replacements | ARRAY of STRINGs |
Example
["FirstAidKit", false] call ace_common_fnc_getItemReplacements
Authors
- LinkIsGrim
ace_common_fnc_getItemType
Description
Returns item type of given classname.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Item | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Type (“weapon”, “item”, “magazine”, “”) | STRING |
Example
["tire"] call ace_common_fnc_getItemType
Authors
- commy2
ace_common_fnc_getLightProperties
Description
Read properties of given vehicles light.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object with lights | OBJECT | |
| 1 | Light classname | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Light intensity | NUMBER |
Example
[car, "light"] call ace_common_fnc_getLightProperties
Authors
- commy2
ace_common_fnc_getLightPropertiesWeapon
Description
Read properties of given flashlight.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Flashlight | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Light intensity | NUMBER |
Example
["flashlight"] call ace_common_fnc_getLightPropertiesWeapon
Authors
- commy2
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
| Description | Datatype(s) |
|---|---|
| Array of local Units | ARRAY |
Example
[] call ace_common_fnc_getLocalUnits
Authors
- dedmen
ace_common_fnc_getMagneticBearing
Description
Returns magnetic heading (0..360)
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object or Bearing | OBJECT or NUMBER | ACE_player |
Return Value
| Description | Datatype(s) |
|---|---|
| Compass Bearing | NUMBER |
Example
[player] call ace_common_fnc_getMagneticBearing
Authors
- PabstMirror
ace_common_fnc_getMapGridFromPos
Description
Gets a 10-digit map grid for the given world position
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Position (2D Position) | ARRAY | |
| 1 | Return type; false for array of easting and northing, true for single string | BOOL | false |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Easting | STRING |
Example
[getPos player] call ace_common_fnc_getMapGridFromPos
Authors
- VKing
- PabstMirror
ace_common_fnc_getMapPosFromGrid
Description
Gets position from grid cords
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Grid Cords | STRING | |
| 1 | Grid center (true), Grid Bottom Right (false) | BOOL | true |
Return Value
| Description | Datatype(s) |
|---|---|
| Position | ARRAY |
Example
["6900080085"] call ace_common_fnc_getMapPosFromGrid
Authors
- PabstMirror
ace_common_fnc_getName
Description
Returns the name of the object. Used to prevent issues with the name command.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object | OBJECT | |
| 1 | Use effective commander name when used on vehicles | BOOL | false |
| 2 | Get Raw Name (Don’t sanitize HTML tags </>) | BOOL | false |
Return Value
| Description | Datatype(s) |
|---|---|
| Object Name | STRING |
Example
[player, false, true] call ace_common_fnc_getName;
Authors
- commy2
ace_common_fnc_getPitchBankYaw
Description
Returns pitch, bank, yaw for given vehicle in degrees.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit/Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: pitch | NUMBER |
Example
[plane] call ace_common_fnc_getPitchBankYaw
Authors
- KoffeinFlummi
ace_common_fnc_getReflectorsWithSelections
Description
Returns all lighting hitpoints of any vehicle. Note: These are actual selections that are affected by setHit and getHit, not getHitPointDamage or setHitpointDamage. They behave like having an armor value of 0.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Light Hitpoints | ARRAY |
Example
[car] call ace_common_fnc_getReflectorsWithSelections
Authors
- commy2
ace_common_fnc_getTargetAzimuthAndInclination
Description
Get players viewing direction and slope.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Azimuth | NUMBER |
Example
[] call ace_common_fnc_getTargetAzimuthAndInclination
Authors
- commy2
ace_common_fnc_getTargetDistance
Description
Get the distance to the next object the player is looking at. Used for laser distance measurements.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Measurement Accuracy | NUMBER | 1 |
| 1 | Maximum measure distance | NUMBER | 5000 |
| 2 | Minimum measure distance | NUMBER | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Distance in meters | NUMBER |
Example
[5,20000,56] call ace_common_fnc_getTargetDistance
Authors
- VKing
ace_common_fnc_getTargetObject
Description
Get the nearest object the player is looking at. Used for laser designator instead of cursorTarget.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Maximum search distance | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Nearest object in line of sight, objNull if none are found | OBJECT |
Example
[56] call ace_common_fnc_getTargetObject
Authors
- commy2
ace_common_fnc_getTurnedOnLights
Description
Returns all turned on lights of any vehicle or streetlamp.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| All burning lights | ARRAY |
Example
[car] call ace_common_fnc_getTurnedOnLights
Authors
- commy2
ace_common_fnc_getTurretCommander
Description
Get the turret index of a vehicles commander.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle commander turret indices | ARRAY |
Example
[car] call ace_common_fnc_getTurretCommander
Authors
- commy2
ace_common_fnc_getTurretConfigPath
Description
Get the config path of a vehicles turret.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle Config | CONFIG | |
| 1 | Turret indices | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Turret config | CONFIG |
Example
[CfgVehicle, [Array]] call ace_common_fnc_getTurretConfigPath
Authors
- commy2
ace_common_fnc_getTurretCopilot
Description
Get the turret index of a vehicles copilot.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle Copilot Turret indices | ARRAY |
Example
[car] call ace_common_fnc_getTurretCopilot
Authors
- commy2
ace_common_fnc_getTurretDirection
Description
Get the absolute turret direction for FOV/PIP turret.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | |
| 1 | Turret Position | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Position ASL | ARRAY |
Example
[car, [5,6,5]] call ace_common_fnc_getTurretDirection
Authors
- jaynus
ace_common_fnc_getTurretGunner
Description
Get the turret index of a vehicles gunner.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle Gunner Turret indices | ARRAY |
Example
[car] call ace_common_fnc_getTurretGunner
Authors
- commy2
ace_common_fnc_getTurretIndex
Description
Get the turret index of a units current turret.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Turret Index | ARRAY |
Example
[ace_player] call ace_common_fnc_getTurretIndex
Authors
- commy2
ace_common_fnc_getTurretsFFV
Description
Get the turret indices of ffv turrets.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle FFV Turret indices | ARRAY |
Example
[car] call ace_common_fnc_getTurretsFFV
Authors
- commy2
ace_common_fnc_getTurretsOther
Description
Get the turret indices of other turrets (not gunner, commander, copilot or ffv).
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle Other Turret indices | ARRAY |
Example
[car] call ace_common_fnc_getTurretsOther
Authors
- commy2
ace_common_fnc_getUavControlPosition
Description
Returns the seat position of a UAV that the unit is actively controlling.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Position | STRING |
Example
[ACE_Player] call ace_common_fnc_getUavControlPosition
Authors
- PabstMirror
ace_common_fnc_getVehicleCargo
Description
Get the vehicle cargo positions. Codrivers and ffv positions are not listed.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle cargo positions | ARRAY |
Example
[car] call ace_common_fnc_getVehicleCargo
Authors
- commy2
ace_common_fnc_getVehicleCodriver
Description
Get the vehicle codriver positions.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle codriver positions | ARRAY |
Example
["car"] call ace_common_fnc_getVehicleCodriver
Authors
- commy2
ace_common_fnc_getVehicleCrew
Description
Returns array of crew member objects.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | |
| 1 | Slot types filter | ARRAY | [“driver”, “commander”, “gunner”, “turret”, “cargo”, “ffv”] |
Return Value
| Description | Datatype(s) |
|---|---|
| Crew | ARRAY |
Example
[car, ["driver"]] call ace_common_fnc_getVehicleCrew
Authors
- commy2
ace_common_fnc_getVehicleIcon
Description
Function used to get the vehicle icon for provided object (cached for repeat use)
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object to get icon of | OBJECT or STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Icon of vehicle | STRING |
Example
["B_Soldier_F"] call ace_common_fnc_getVehicleIcon;
Authors
- AACO
ace_common_fnc_getVehicleUAVCrew
Description
Returns array of uav dummy ais.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| UAV Dummy Crew | ARRAY |
Example
[car] call ace_common_fnc_getVehicleUAVCrew
Authors
- commy2
ace_common_fnc_getVersion
Description
Get the version number of the current ACE build.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| ACE Version | STRING |
Example
[] call ace_common_fnc_getVersion
Authors
- Glowbal
ace_common_fnc_getWeaponAzimuthAndInclination
Description
Get local players weapon direction and slope.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Weapon name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Azimuth | NUMBER |
Example
["gun"] call ace_common_fnc_getWeaponAzimuthAndInclination
Authors
- commy2
ace_common_fnc_getWeaponIndex
Description
Get the index of the weapon.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Weapon | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Weapon index | NUMBER |
Example
[bob, "gun"] call ace_common_fnc_getWeaponIndex
Authors
- commy2
ace_common_fnc_getWeaponModes
Description
Get the available firing modes of a weapon. Will ignore the AI helper modes.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Weapon | STRING | |
| 1 | Muzzle | STRING | weapon |
Return Value
| Description | Datatype(s) |
|---|---|
| Firing Modes | ARRAY |
Example
"arifle_AK12_F" call ace_common_fnc_getWeaponModes
Authors
- commy2
- johnb43
ace_common_fnc_getWeaponMuzzles
Description
Get the muzzles of a weapon.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Weapon | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| All weapon muzzles | ARRAY |
Example
"arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles
Authors
- commy2
- johnb43
ace_common_fnc_getWeaponState
Description
Return current state of the weapon. Attachments and magazines with ammo.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Weapon | STRING | Unit’s current weapon |
Return Value
| Description | Datatype(s) |
|---|---|
| 0: Attachments | ARRAY |
Example
[bob, "gun"] call ace_common_fnc_getWeaponState
Authors
- commy2
ace_common_fnc_getWeaponType
Description
Check what kind of weapon the given class name is.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Weapons | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Slot index | NUMBER |
Example
["gun"] call ace_common_fnc_getWeaponType
Authors
- commy2
ace_common_fnc_getWindDirection
Description
Get the compass direction the wind is blowing from.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Wind cardinal direction | STRING |
Example
[] call ace_common_fnc_getWindDirection
Authors
- commy2
ace_common_fnc_getZoom
Description
Returns a value depending on current zoom level.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Zoom | NUMBER |
Example
[] call ace_common_fnc_getZoom
Authors
- commy2
ace_common_fnc_hadamardProduct
Description
Returns the Hadamard Product of two vectors. (x hadamard y) = [x1y1, x2y2, x3*y3]
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vector 1 | ARRAY | |
| 1 | Vector 2 | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Hadamard Product | ARRAY |
Example
[[0,0,0], [1,1,1]] call ace_common_fnc_hadamardProduct
Authors
- KoffeinFlummi
ace_common_fnc_hasHatch
Description
Check if unit is in a vehicle position where it can turn in or out.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Unit has a hatch? | BOOL |
Example
[bob] call ace_common_fnc_hasHatch
Authors
- commy2
ace_common_fnc_hasItem
Description
Check if given unit has an item of given classname. Note: Case sensitive.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Item classname | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Unit has item | BOOL |
Example
[player, "ACE_Banana"] call ace_common_fnc_hasItem
Authors
- Glowbal
ace_common_fnc_hasMagazine
Description
Check if given unit has a magazine of given classname. Note: Case sensitive.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Magazine classname | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Unit has magazine | BOOL |
Example
[player, "30Rnd_65x39_caseless_mag"] call ace_common_fnc_hasMagazine
Authors
- Glowbal
ace_common_fnc_hasZeusAccess
Description
Check if current player has Zeus access
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Has Zeus | BOOL |
Example
call ace_common_fnc_hasZeusAccess
Authors
- LinkIsGrim
ace_common_fnc_hideUnit
Description
Globally hides a unit. This allows the handling of more than one reason to hide an object globally.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Reason to hide the unit | STRING |
Return Value
None
Example
[ACE_Player, "SpectatorMode"] call ace_common_fnc_hideUnit
Authors
- kymckay (based on muteUnit)
ace_common_fnc_interpolateFromArray
Description
Interpolates between two set points in a curve.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | List of numbers to interpolate from | ARRAY | |
| 1 | Value / index | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Interpolation result | NUMBER |
Example
[[0,1], 5] call ace_common_fnc_interpolateFromArray
Authors
- commy2
ace_common_fnc_inTransitionAnim
Description
Check if given unit is in a transitional animation
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | A soldier | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Boolean | BOOL |
Example
[bob] call ace_common_fnc_inTransitionAnim
Authors
- commy2
ace_common_fnc_isAwake
Description
Check if unit is awake. Will be false when death or unit is unconscious.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| if unit is awake | BOOL |
Example
[bob] call ace_common_fnc_isAwake
Authors
- Glowbal
ace_common_fnc_isBeingCarried
Description
Returns if an object is being carried. (from ace_dragging)
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Is being carried | BOOL |
Example
bob call ace_common_fnc_isBeingCarried
Authors
- PabstMirror
ace_common_fnc_isBeingDragged
Description
Returns if an object is being dragged. (from ace_dragging)
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Is being dragged | BOOL |
Example
bob call ace_common_fnc_isBeingDragged
Authors
- PabstMirror
ace_common_fnc_isEngineer
Description
Checks if a unit is an engineer.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit to be checked | OBJECT | |
| 1 | Engineer level | NUMBER | 1 |
Return Value
| Description | Datatype(s) |
|---|---|
| is the unit an engineer | BOOL |
Example
[player] call ace_common_fnc_isEngineer
Authors
- marc_book
- commy2
- DartRuffian
ace_common_fnc_isEOD
Description
Checks whether the passed unit is an explosive specialist. Either through config entry: “canDeactivateMines” or unit setVariable [“ACE_isEOD”, true]
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit to check if is a specialist | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| is the unit an EOD | BOOL |
Example
[player] call ace_common_fnc_isEOD
Authors
- Garth de Wet (LH)
ace_common_fnc_isInBuilding
Description
Check if the unit is in a building. Will return true if the unit is sitting in a bush.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Is the unit in a building? | BOOL |
Example
[bob] call ace_common_fnc_isInBuilding
Authors
- commy2
ace_common_fnc_isMedic
Description
Check if a unit is a medic
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | The Unit | OBJECT | |
| 1 | Medic level | NUMBER | 1 |
Return Value
| Description | Datatype(s) |
|---|---|
| Unit is medic | BOOL |
Example
[player] call ace_common_fnc_isMedic
Authors
- kymckay
- DartRuffian
ace_common_fnc_isModLoaded
Description
Check in CfgPatches if modification is loaded
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Classname of the mod in CfgPatches | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| If modification is loaded | BOOL |
Example
"class" call ace_common_fnc_isModLoaded
Authors
- Glowbal
- Grim
ace_common_fnc_isPlayer
Description
Checks if a unit is a player / curator controlled unit. This now includes both local and non-local remote controlled zeus units. (Remotes from another zeus machine)
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | unit to be checked | OBJECT | |
| 1 | exclude remote controlled units | BOOL |
Return Value
| Description | Datatype(s) |
|---|---|
| Is unit a player? | BOOL |
Example
[cursorTarget, false] call ace_common_fnc_isPlayer;
Authors
- bux578
- commy2
- akalegman
ace_common_fnc_isSwimming
Description
Check if unit is swimming (surface swimming or diving).
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| If unit is swimming | BOOL |
Example
[bob] call ace_common_fnc_isSwimming
Authors
- das attorney
- Jonpas
ace_common_fnc_lightIntensityFromObject
Description
Calculate light intensity object 1 receives from object 2
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Object that receives light | OBJECT | |
| 1 | Object that emits light | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Brightest light level | NUMBER |
Example
[receiver, giver] call ace_common_fnc_lightIntensityFromObject
Authors
- commy2
ace_common_fnc_loadPerson
Description
Loads a specified unit into any nearby vehicle, or _vehicle parameter.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit that will load | OBJECT | |
| 1 | Unit to be loaded | OBJECT | |
| 2 | Vehicle that the unit will be loaded in | OBJECT | objNull |
| 3 | Preferred seats | ARRAY | |
| 4 | Reverse fill | BOOL |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle that the unitToBeloaded has been loaded in. Returns objNull if function failed | OBJECT |
Example
[bob, kevin] call ace_common_fnc_loadPerson
Authors
- Glowbal
ace_common_fnc_loadPersonLocal
Description
Load a person, local
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | unit to be loaded | OBJECT | |
| 1 | vehicle that will beloaded | OBJECT | |
| 2 | caller that will load | OBJECT | |
| 3 | preferred seats | ARRAY | |
| 4 | reverse fill | BOOL |
Return Value
None
Example
[bob, car, kevin] call ace_common_fnc_loadPersonLocal
Authors
- Glowbal
ace_common_fnc_monitor
Description
hint retun value of given function every frame
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Code to monitor | CODE |
Return Value
None
Example
[{code}] call ace_common_fnc_monitor
Authors
- commy2
ace_common_fnc_muteUnit
Description
Mutes the unit. It won’t trigger auto generated chat messages either.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Reason to mute the unit | STRING |
Return Value
None
Example
[bob, "because"] call ace_common_fnc_muteUnit
Authors
- commy2
ace_common_fnc_nearestVehiclesFreeSeat
Description
Returns a list of vehicles near given unit that the unit can be a passenger in.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Distance | NUMBER | 10 |
| 2 | Restricted to cargo only | BOOL | false |
Return Value
| Description | Datatype(s) |
|---|---|
| Nearest vehicles with a free seat | ARRAY |
Example
[cursorObject] call ace_common_fnc_nearestVehiclesFreeSeat
Authors
- 654wak654
ace_common_fnc_normalRandom
Description
Returns a random variable according to a normal distribution with mean/stddev. Uses Box-Muller transform to approximate distribution
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Mean | NUMBER> or <ARRAY | |
| 1 | Standard Deviation | NUMBER> or <ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Pair of random numbers according to normal distribution | ARRAY |
Example
[0.5, [0.1, 5]] call ace_common_fnc_normalRandom // e.g. returns [4, 0.1]
Authors
- tcvm
ace_common_fnc_numberToDigits
Description
Transforms a number to an array of the corresponding digits.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Number to ‘digitize’ | NUMBER | |
| 1 | Set the minimal length of the returned array. Useful for getting left hand zeroes. | NUMBER | 1 |
Return Value
| Description | Datatype(s) |
|---|---|
| Digits. The maximum count is six digits. | ARRAY |
Example
[5, 5] call ace_common_fnc_numberToDigits
Authors
- commy2
- kymckay
ace_common_fnc_numberToString
Description
Converts a number to a string without losing as much precision as str or format.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | A number | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| The number as string | STRING |
Example
[5] call ace_common_fnc_numberToString
Authors
- commy2
ace_common_fnc_playConfigSound3D
Description
Plays a sound defined in CfgSounds using playSound3D, with global effect.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Sound class | STRING | |
| 1 | Position ASL | ARRAY | |
| 2 | Volume | NUMBER | from sound config |
| 3 | Distance | NUMBER | from sound config |
Return Value
None
Example
["hint", getPosASL player, 5, 5] call ace_common_fnc_playConfigSound3D
Authors
- esteldunedain
ace_common_fnc_player
Description
Returns the player or curator controlled unit. Use this in INIT and RESPAWN eh scripts, because ACE_player isn’t reset yet.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Player controlled unit | OBJECT |
Example
[] call ace_common_fnc_player
Authors
- bux578
- commy2
ace_common_fnc_playerSide
Description
Return the current side of the player
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| current local side | SIDE |
Example
[] call ace_common_fnc_playerSide
Authors
- commy2
ace_common_fnc_positionToASL
Description
Converts Arma “Position” to ASL
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Position x | NUMBER | |
| 1 | Position y | NUMBER | |
| 2 | Position z | NUMBER |
Return Value
None
Example
[1, 1, 1] call ace_common_fnc_positionToASL
Authors
- esteldunedain
ace_common_fnc_progressBar
Description
Draw progress bar and execute given function if successful. Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Total Time (in game “time” seconds) | NUMBER | |
| 1 | Arguments, passed to condition, fail and finish | ARRAY | |
| 2 | On Finish: Code called or STRING raised as event. | CODE or STRING | |
| 3 | On Failure: Code called or STRING raised as event. | CODE or STRING | |
| 4 | Localized Title | STRING | ”” |
| 5 | Code to check each frame | CODE | {true} |
| 6 | Exceptions for checking ace_common_fnc_canInteractWith | ARRAY | [] |
| 7 | Create progress bar as dialog, this blocks user input | BOOL | true |
Return Value
None
Example
[5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar
Authors
- commy2
- Glowbal
- PabstMirror
ace_common_fnc_registerItemReplacement
Description
Registers an event handler that replaces an item or item type with one or more other items.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Item or item type ID to replace | STRING or NUMBER | |
| 1 | Item or list of items | STRING or ARRAY | |
| 2 | Replace items that inherit from original item (only if 0 is STRING) | BOOL | false |
Return Value
None
Example
["FirstAidKit", "ACE_fieldDressing"] call ace_common_fnc_registerItemReplacement
Authors
- BaerMitUmlaut
ace_common_fnc_removeMapMarkerCreatedEventHandler
Description
Remove a map marker creation event handler.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | ID of the event handler | NUMBER |
Return Value
None
Example
[5] call ace_common_fnc_removeMapMarkerCreatedEventHandler
Authors
- commy2
ace_common_fnc_replaceRegisteredItems
Description
Handles replacing unit’s items with their registered replacements. Called by CBA Player Loadout Event, but can be used to replace items on AI.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
None
Example
[ACE_player] call ace_common_fnc_replaceRegisteredItems
Authors
- BaerMitUmlaut
ace_common_fnc_runTests
Description
Run test functions.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Specific test to run (default is to run all) | STRING | #all |
Return Value
None
Example
[] call ace_common_fnc_runTests
["fcs"] call ace_common_fnc_runTests
Authors
- PabstMirror
ace_common_fnc_sanitizeString
Description
Removes quotation marks to avoid exploits and optionally HTML tags from text to avoid conflicts with structured text.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Source string | STRING | |
| 1 | Remove HTML tags | BOOL | false |
Return Value
| Description | Datatype(s) |
|---|---|
| Sanitized string | STRING |
Example
["<CoolGroup>CoolGuy", true] call ace_common_fnc_sanitizeString;
Authors
- esteldunedain
- based on Killzone-Kid code
ace_common_fnc_sendRequest
Description
Send a request to an unit and execute code based upon results.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | caller | OBJECT | |
| 1 | target | OBJECT | |
| 2 | requestID | STRING | |
| 3 | requestMessage Will be localized for other target object. | STRING | |
| 4 | callback Code called upon accept or decline. | CODE |
Return Value
None
Example
[bob, kevin, "ID", "Message", {callback}] call ace_common_fnc_sendRequest
Authors
- Glowbal
ace_common_fnc_setAimCoef
Description
Handle set AimCoef calls. Will use the highest available setting.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Unique ID | STRING | |
| 2 | Aim coefficient (a higher value causes more shaking) | NUMBER | |
| 3 | Add (true) or remove (false) | BOOL | true |
Return Value
None
Example
[player, "ace_advanced_fatigue", 1, true] call ace_common_fnc_setAimCoef
Authors
- xrufix
- Glowbal
ace_common_fnc_setDead
Description
Kills a unit without changing visual appearance.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | ARRAY | |
| 1 | Reason for death (only used if ace_medical is loaded) | STRING | ”” |
| 2 | Killer (vehicle that killed unit) | ARRAY | objNull |
| 3 | Instigator (unit who pulled trigger) | ARRAY | objNull |
Return Value
None
Example
[cursorObject, "", player, player] call ace_common_fnc_setDead;
Authors
- johnb43
ace_common_fnc_setDefinedVariable
Description
setVariable value
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | variableName | STRING | |
| 2 | value | ANY |
Return Value
None
Example
[bob, "var", 5] call ace_common_fnc_setDefinedVariable
Authors
- Glowbal
ace_common_fnc_setDisableUserInputStatus
Description
Disables the user input. Works stacked.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | id | STRING | |
| 1 | disable | BOOL |
Return Value
None
Example
["id", true] call ace_common_fnc_setDisableUserInputStatus
Authors
- Glowbal
ace_common_fnc_setHearingCapability
Description
Handle set volume calls. Will use the lowest available volume setting.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | ID | STRING | |
| 1 | Settings | NUMBER | |
| 2 | Add (true) or remove (false) | BOOL | true |
| 3 | Volume fade duration | NUMBER | 0 |
Return Value
None
Example
["earwax", 0.5, true] call ace_common_fnc_setHearingCapability
Authors
- Glowbal
- BaerMitUmlaut
ace_common_fnc_setPitchBankYaw
Description
Sets the value of an ACE_Parameter and makes it public.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit/Vehicle | OBJECT | |
| 1 | Pitch | NUMBER | |
| 2 | Yaw | NUMBER | |
| 3 | Bank | NUMBER |
Return Value
None
Example
[bob, 1, 2, 3] call ace_common_fnc_setPitchBankYaw
Authors
- Bohemia Interactive edit by KoffeinFlummi
ace_common_fnc_setProne
Description
Force a unit to go prone
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
None
Example
[bob] call ace_common_fnc_setProne
Authors
- Glowbal
ace_common_fnc_setWeaponLightLaserState
Description
Toggles the unit’s current weapon’s light & laser. API for persistent lasers. Doesn’t work on AI, as they have their own logic.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Weapon light/laser state | BOOL | false |
Return Value
None
Example
[player, true] call ace_common_fnc_setWeaponLightLaserState
Authors
- johnb43
ace_common_fnc_showHud
Description
Allows multiple sources to not overwrite showHud command. Bitwise AND Logic (a single false in a mask will make it false).
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Source ID | STRING | ”” |
| 1 | Show Hud Bool Array (10 to set, empty to remove) | ARRAY | [] |
Return Value
| Description | Datatype(s) |
|---|---|
| Resulting ShowHud Array | ARRAY |
Example
["hideHud", [false, true, true, true, true, true, true, false, true, true]] call ace_common_fnc_showHud; //This is equivalent to the old showHud false
[] call ace_common_fnc_showHud; //sets `showHud` and returns the result array used
Authors
- PabstMirror
ace_common_fnc_statusEffect_get
Description
Retrieves list of current status effects
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle that it will be attached to (player or vehicle) | OBJECT | |
| 1 | Effect Name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Effect status | ARRAY |
Example
[player, "forceWalk"] call ace_common_fnc_statusEffect_get
Authors
- PabstMirror
ace_common_fnc_statusEffect_set
Description
Adds or removes an id to a status effect and will send an event to apply.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle that it will be attached to (player or vehicle) | OBJECT | |
| 1 | Effect Name | STRING | |
| 2 | Unique Reason ID | STRING | |
| 3 | Is Set (true adds/false removes) | BOOL |
Return Value
None
Example
[player, "setCaptive", "reason1", true] call ace_common_fnc_statusEffect_set
Authors
- PabstMirror
ace_common_fnc_stopGesture
Description
Stops a unit’s gesture.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Target | OBJECT |
Return Value
None
Example
[bob] call ace_common_fnc_stopGesture
Authors
- ACRE2Team
ace_common_fnc_stringCompare
Description
Determines whether one string matches another and how many characters match. Case insensitive.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | stringA | STRING | |
| 1 | stringB | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Number of matching characters | NUMBER |
Example
["a", "b"] call ace_common_fnc_stringCompare
Authors
- bovine3dom
ace_common_fnc_stringToColoredText
Description
Create a centered, colored text.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Text | ANY | |
| 1 | Color | ARRAY or STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Text | STRING |
Example
["text", [0, 1, 2]] call ace_common_fnc_stringToColoredText
Authors
- commy2
ace_common_fnc_switchToGroupSide
Description
Stack group switches. Will always trace back to original group.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | switch | BOOL | |
| 2 | id | STRING | |
| 3 | side | SIDE |
Return Value
None
Example
[bob, true, "id", SIDE] call ace_common_fnc_switchToGroupSide
Authors
- Glowbal
ace_common_fnc_toBin
Description
Converts number to binary number
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | A number | NUMBER | |
| 1 | Minimum length of numbers | NUMBER | 1 |
Return Value
| Description | Datatype(s) |
|---|---|
| A binary number as string | STRING |
Example
[5] call ace_common_fnc_toBin
Authors
- commy2
ace_common_fnc_toBitmask
Description
Convert an array of booleans into a number.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Boolean | BOOL | |
| 1 | Boolean | BOOL | |
| 2 | Boolean | BOOL |
Return Value
| Description | Datatype(s) |
|---|---|
| Bitmask | NUMBER |
Example
[[true, false]] call ace_common_fnc_toBitmask
Authors
- commy2
ace_common_fnc_toHex
Description
Converts number to hexadecimal number
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | A number between 0 and 255 | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| A hexadecimal number as string | STRING |
Example
[154] call ace_common_fnc_toHex
Authors
- commy2
- esteldunedain
ace_common_fnc_toNumber
Description
Takes a string/number and returns the number.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Value to attempt to convert to number or if number simply return number. | STRING or NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Number | NUMBER |
Example
number = ["102"] call ace_common_fnc_toNumber;
Authors
- Garth de Wet (LH)
ace_common_fnc_unhideUnit
Description
Globally unhides a unit. Only unhides if the last reason was removed.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Reason to unhide the unit | STRING |
Return Value
None
Example
[ACE_Player, "SpectatorMode"] call ace_common_fnc_unhideUnit
Authors
- kymckay (based on unmuteUnit)
ace_common_fnc_uniqueElements
Description
Make a copy of an array with only the unique elements.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | array | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Copy of original array | ARRAY |
Example
[[array]] call ace_common_fnc_uniqueElements
Authors
- Glowbal
ace_common_fnc_uniqueUnitItems
Description
Returns list of items (including magazines, backpacks and other) in a unit’s inventory. Number definition: 0: Do not return value, 1: Return container only, 2: Return container and content, 3: Return content only
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Weapon items | NUMBER | 2 |
| 2 | Uniform items | NUMBER | 2 |
| 3 | Vest items | NUMBER | 2 |
| 4 | Backpack items | NUMBER | 2 |
| 5 | Assigned items | BOOL | true |
Return Value
| Description | Datatype(s) |
|---|---|
| Items | HASHMAP |
Example
[player] call ace_common_fnc_uniqueUnitItems
Authors
- johnb43
ace_common_fnc_unmuteUnit
Description
Unmutes the unit. Only unmutes if the last reason was removed.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | |
| 1 | Reason to unmute the unit. | STRING |
Return Value
None
Example
[bob, "because"] call ace_common_fnc_unmuteUnit
Authors
- commy2
ace_common_fnc_useItem
Description
Use item
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | unit | OBJECT | |
| 1 | item | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| if item has been used. | BOOL |
Example
[bob, "gun"] call ace_common_fnc_useItem
Authors
- Glowbal
ace_common_fnc_useMagazine
Description
Use magazine
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | unit | OBJECT | |
| 1 | magazine | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| if magazine has been used. | BOOL |
Example
[bob, "magazine"] call ace_common_fnc_useMagazine
Authors
- Glowbal
ace_common_fnc_watchVariable
Description
Shows multiple watched variables on the main display (for easy debugging).
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Title (var name) | STRING | ”” |
| 1 | Code to generate result (passed nothing, can return any) | CODE | {} |
| 2 | Array containing modifiers | ARRAY | [] |
| 0 | Show Delta change | BOOL | true |
| 1 | Slider Min Value | NUMBER | 0 |
| 2 | Slider Max Value | NUMBER | 0 |
Return Value
None
Example
["CBA_missionTime"] call ace_common_fnc_watchVariable // Uses title as code
["diag_frameNo", {diag_frameNo}, [false]] call ace_common_fnc_watchVariable // Won't show delta
["blood", {player getVariable "ace_medical_bloodVolume"}, [true, 0, 6]] call ace_common_fnc_watchVariable // Shows slider
["multiLine text", {"Line 1 <br/>Line 2"}, [2]] call ace_common_fnc_watchVariable
["player names", {allPlayers apply {name _x}}, [5]] call ace_common_fnc_watchVariable // handles any data types
Authors
- PabstMirror