Arma 3 Scripting

Arma 3 scripting reference

Functions

2062 functions in 99 groups. A page can belong to several groups.

AI Human

Aircraft Carrier

Aircraft Functionality

  • BIS_fnc_aircraftFoldingWingsHandles foldable wings of aircrafts. Is supposed to be used from within class Eventhandlers of the vehicle. See Arma 3: Aircraft Systems for…
  • BIS_fnc_aircraftTailhookAiHandles landing on the aircraft carrier for AI and player autopilot.
  • BIS_fnc_ejectionSeatRelease- This function is designed as part of set of functions to implement semi-authenthic ejection system on fixed wing aircrfat that have such…
  • BIS_fnc_planeAiEject- This function is designed as part of set of functions to implement semi-authenthic ejection system on fixed wing aircrfat that have such…
  • BIS_fnc_planeEjection- This function is designed to implement semi-authenthic ejection system on fixed wing aircrfat that have such functionality enabled/configured.
  • BIS_fnc_planeEjectionFX- This function is designed as part of set of functions to implement semi-authenthic ejection system on fixed wing aircrfat that have such…

Ambient

Arrays

  • BIS_fnc_addToPairsAdds given value to pair array, stored under unique key.
  • BIS_fnc_arrayCompareThis function checks if two arrays are containing the same elements in the same order.
  • BIS_fnc_arrayFindDeepSearches an array for a specific value and returns its index.
  • BIS_fnc_arrayInsertInserts the elements of one array into another, at a specified index. Neither arrays are touched by reference, a new array is returned.
  • BIS_fnc_arrayPopThis function removes the last (rightmost) element of an array and returns it.
  • BIS_fnc_arrayPushThis function adds an element to the end of an array and returns the array.
  • BIS_fnc_arrayPushStackThis function is similar to the array push function; however, it pushes the contents of an array onto the stack array.
  • BIS_fnc_arrayShiftThis function removes the first (leftmost) element of an array and returns it.
  • BIS_fnc_arrayShuffleReturn a new array with randomized order of elements from input array.
  • BIS_fnc_arrayUnShiftThis function adds an element to the beginning of an array and returns the array. The array is passed by reference so changes inside the function…
  • BIS_fnc_colorConfigToRGBAConverts config color format to RGBA array of numbers.
  • BIS_fnc_colorRGBAtoHTMLConverts RGBA color format to #AARRGGBB HTML color format.
  • BIS_fnc_colorRGBAtoTextureConverts RGB color format to procedural texture, e.g `[0,0,0,1]` becomes `"#(argb,8,8,3)color(0,0,0,1)"`.
  • BIS_fnc_colorRGBtoHTMLConverts RGB color format to HTML color format.
  • BIS_fnc_conditionalSelectThis returns a sub-array of elements that satisfy a specific condition in the order they have been passed.
  • BIS_fnc_consolidateArrayFinds duplicates in the given array of anything and consolidates them into an array of sub-arrays
  • BIS_fnc_findAllNestedElementsReturns array of paths to all matching elements in deeply nested array, similar to BIS_fnc_findNestedElement but with all occurences.
  • BIS_fnc_findExtremeReturns the minimum or maximum value in an array of numbers.
  • BIS_fnc_findInPairsSearches the associative array for the first occurance of the key string and returns its index. Seach is not case-sensitive.
  • BIS_fnc_findNestedElementFunction to find item in nested arrays and return a path to the first match.
  • BIS_fnc_getFromPairsSearches the associative array for the 1st occurance of the key string and returns the value associated with it. Search is not case sensitiv.
  • BIS_fnc_greatestNumReturns the greatest number out of the passed set.
  • BIS_fnc_lowestNumReturns the lowest number out of the passed set.
  • BIS_fnc_maxDiffArrayFunction to return the maximum difference between all values in an array.
  • BIS_fnc_nearestNumReturns the provided set closest number to the target number.
  • BIS_fnc_numberDigitsBreak number into array of digits.
  • BIS_fnc_paramLoad a script parameter. See Arma 3: Functions Library for detailed description.
  • BIS_fnc_paramInSee BIS_fnc_param. Overloading default values is disabled in this variant. It's intended to be used where _this is not used as an input param.
  • BIS_fnc_parseNumberSafeConverts expression into a number. Can also convert array of expressions into an array of numbers. If expression does not return a number, 0 is…
  • BIS_fnc_randomIndexReturn a random integer representing an index in the passed array.
  • BIS_fnc_removeFromPairsRemoves an item from pair array, modifying or not the original array.
  • BIS_fnc_removeIndexTakes an array, and returns a new array with the specified index(es) removed. This takes the array passed in the first parameter, and returns an…
  • BIS_fnc_removeNestedElementFunction to remove an item in a nested array. Modifies the array by reference.
  • BIS_fnc_returnNestedElementFunction to return an item at a path in an array.
  • BIS_fnc_selectRandomSelects one of the arguments at random.
  • BIS_fnc_selectRandomWeightedSelects a random item from an array, taking into account item weight.
  • BIS_fnc_setNestedElementFunction to set an item in a nested array using a path. Modifies the array by reference.
  • BIS_fnc_setToPairsWorks similar to the BIS_fnc_addToPairs but it doesn't try to add values. It just overwrites the volue if the key already exists.
  • BIS_fnc_sortAlphabeticallyAlphabetically sort an array of strings without modifying the original. See also sort.
  • BIS_fnc_sortBySorts an array according to given algorithm. See sort for simple sorts.
  • BIS_fnc_sortNumSorts an array of numbers from lowest (left) to highest (right). The passed array is modified by reference. This function uses the quick sort…
  • BIS_fnc_subSelectReturns a sub-selection of the passed array.

Behavior

Bitwise

  • BIS_fnc_bitflagsCheckChecks if one or more flags are set in the given flagset, represented with decimal or hexadecimal number
  • BIS_fnc_bitflagsFlipFlips one or more flags (set gets unset and vice versa) in the given flagset, represented with decimal or hexadecimal number
  • BIS_fnc_bitflagsSetSets one or more flags in the given flagset, represented with decimal or hexadecimal number
  • BIS_fnc_bitflagsToArrayReturns array with all bit flags which are set in the given flagset
  • BIS_fnc_bitflagsUnsetUnsets one or more flags in the given flagset, represented with decimal or hexadecimal number
  • BIS_fnc_bitwiseANDPerforms bitwise AND operation on two decimal or hexadecimal unsigned 24 bit integers (Hexadecimal number representation is simply auto-converted…
  • BIS_fnc_bitwiseNOTPerforms bitwise NOT operation on decimal or hexadecimal unsigned 24 bit integer (Hexadecimal number representation is simply auto-converted into…
  • BIS_fnc_bitwiseORPerforms bitwise OR operation on two decimal or hexadecimal unsigned 24 bit integers (Hexadecimal number representation is simply auto-converted into…
  • BIS_fnc_bitwiseXORPerforms bitwise XOR operation on two decimal or hexadecimal unsigned 24 bit integers (Hexadecimal number representation is simply auto-converted…
  • BIS_fnc_decodeFlagsDecodes a single scalar into array of unique binary flags with indexes between 0-15.
  • BIS_fnc_decodeFlags2Decodes a single scalar into array of unique binary flags (zeroes or ones).
  • BIS_fnc_decodeFlags4Decodes a single scalar into array of unique 4-state flags (values 0,1,2,3).
  • BIS_fnc_decodeFlags8Decodes a single scalar into array of unique 8-state flags (values 0,1,2,3,4,5,6,7).
  • BIS_fnc_encodeFlagsEncodes array of unique binary flags with indexes between 0-15 into a single scalar.
  • BIS_fnc_encodeFlags2Encodes array of unique binary flags (zeroes or ones) into a single scalar.
  • BIS_fnc_encodeFlags4Encodes array of unique 4-state flags (0,1,2,3) into a single number.
  • BIS_fnc_encodeFlags8Encodes array of unique 8-state flags (0,1,2,3,4,5,6,7) into a single number.

Boat Recovery

Briefing

Broken Functions

Camera

Camera3DEN

Campaign

CampaignLobby

CampaignManager

Cargo Platform

Checkpoint

Collisions

Combat

  • BIS_fnc_enemyDetectedReturns true if unit knows about nearby enemy unit or driven vehicle.
  • BIS_fnc_enemyTargetsReturn list of nearby enemy targets for given unit.
  • BIS_fnc_fireMakes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is…
  • BIS_fnc_fireSupportMortar/artillery fire support.
  • BIS_fnc_spotterMake spotter report target distance to sniper. Will only stop if one of the two units dies.
  • BIS_fnc_stalkContinuously set WP of one group to a different group to hunt it. It does not change the group's behaviour.
  • BIS_fnc_threatCalculates threat values of given unit.

CombatPatrol

Communication Menu

Configs

  • BIS_fnc_baseVehicleReturns base vehicle (i.e., vehicle which is not just derivative of other with different textures / animations).
  • BIS_fnc_classMagazineReturns class of magazine given by string.
  • BIS_fnc_configExtremesScan config paths and return min and max values for each property.
  • BIS_fnc_configPathReturns config path to given entry in given format.
  • BIS_fnc_controlConfigsReturn config paths to all display controls.
  • BIS_fnc_displayNameReturn given class displayName value. Return base class name if displayName not defined.
  • BIS_fnc_getCfgSmart-return config (extension for BIS_fnc_getCfgXXXX functions). Can by called 2 ways: - 1st way - passing config directly - 2nd way - passing array…
  • BIS_fnc_getCfgDataSmart-return number, text or array value from config. - Default syntax works for any config. - Alternative syntax is for working comfortably with…
  • BIS_fnc_getCfgDataArrayGets an array defined in Config. If the value is not an array, it is retyped into one.
  • BIS_fnc_getCfgDataBoolGets a number defined in config and retype it into a boolean. Everything greater than 0 is true, otherwise it is false.
  • BIS_fnc_getCfgDataObjectGet the object defined in cfg by its name (global variable).
  • BIS_fnc_getCfgDataPoolGet array of attribute values out of the parent config class. Attributes need to be in this format: "_n", where n is an index number (starting from…
  • BIS_fnc_getCfgIsClassReturn true if it is a class. Can by called in two ways: - first way (general) works for any config - second way is for comfortable working with…
  • BIS_fnc_getCfgSubClassesReturn all child classes of given class.
  • BIS_fnc_loadClassSearches for class in mission, campaign and then in global config file.
  • BIS_fnc_loadEntrySearches for config entry in mission, campaign and then in global config file.
  • BIS_fnc_returnChildrenReturns all subclasses within given class.
  • BIS_fnc_returnConfigEntryExplores parent classes in the run-time config for the value of a config entry.
  • BIS_fnc_returnParentsReturns list of all parent classes.
  • BIS_fnc_subClasses*Same function as BIS_fnc_returnChildren*
  • BIS_fnc_uniqueClassesComposes an array of classes with unique param (based on returned value of passed code). If class inherits the param from parent, it's not listed.
  • BIS_fnc_unitAddonReturn addon from CfgPatches to which a given object belongs to.

Contact

ControlPoint

ControlPoint3DEN

Conversations

Curator

CuratorChallenges

Curve3DEN

Database

Decon Shower

Destroyer

Diagnostic

Diary

Eden Editor

Effects

EM Interface

Environment

Event Handlers

Feedback

Geometry

GUI

Helicopters

IDWMap

Interaction

Interpolation

Inventory

Key

Key3DEN

KeyframeAnimation

Live Feed

Map and Markers

Math

Mission Parameters

Missions

Modules

Modules - CBRN

Modules - Curator

Modules - Firing Drills

Modules - Live Feed

Modules - Strategic

Modules - Time Trials

Movement

Multiplayer

Object Manipulation

Old Man

OO

Phone

Positions

Priority Queue

Probe

Probing

Program Flow

  • BIS_fnc_callExecute given code with or without parameter.
  • BIS_fnc_CPWaitUntilFunction waits until condition becomes true. Condition is checked with given interval.
  • BIS_fnc_execFSMExecute the scripted FSM. Shell for execFSM command
  • BIS_fnc_execVMexecVM desired script with desired argument(s). This function is only really useful when combined with BIS_fnc_MP to execute a script remotely.
  • BIS_fnc_haltHalts current function and all its parents and logs an error message.
  • BIS_fnc_loopLoop stacked code/function with timing and conditional control. Code and conditions are executed in non-scheduled environment.
  • BIS_fnc_runLaterStack code/function that should be run later, after some time/frames or/and custom condition. Internally calls BIS_fnc_loop.
  • BIS_fnc_spawnExecute given code with or without parameter.
  • BIS_fnc_spawnOrderedSpawns given function and executes it in the order it was called in case multiple calls are made. If mutex name is not specified, function name is…

Puzzles

Radio

Respawn

Revive

RichCurve

Scenes

Scripts

Sides

  • BIS_fnc_areFriendlyFunction that takes two Sides and compares them, returning whether they are friendly or not.
  • BIS_fnc_enemySidesReturns sides hostile to the given side / object.
  • BIS_fnc_friendlySidesReturns sides allied to the given side / object.
  • BIS_fnc_FTLmanagerFTL (Friendly To Local) manager tracks relationship between player and civilian side.
  • BIS_fnc_getFactionsGets list and sides of current factions.
  • BIS_fnc_objectSideReturns object side as defined in config (i.e. not affected by dynamic changing like rating)
  • BIS_fnc_playerSideFactionReturn representative faction of the given side. Faction of the first detected player is used.
  • BIS_fnc_respectRESpect - The Effective Calculation Process.
  • BIS_fnc_sideColorReturns colour of define side either as Array in format RGBA or the name of the colour as String
  • BIS_fnc_sideIDReturn config side number. - 0 = opfor (east) - 1 = blufor (west) - 2 = independent (resistance) - 3 = civilian - 4 = sideUnknown - 5 = sideEnemy - 6…
  • BIS_fnc_sideIsEnemyDetermines if side B is enemy to side A the way the game engine does it. The relationship table can be found here: Side Relations.
  • BIS_fnc_sideIsFriendlyDetermines if side B is friendly to side A the way the game engine does it. The relationship table can be found here: Side Relations.
  • BIS_fnc_sideNameReturns localized side name. - 0 / opfor (east) = "OPFOR" - 1 / blufor (west) = "BLUFOR" - 2 / independent (resistance) = "Independent" - 3 /…
  • BIS_fnc_sideNameUnlocalizedReturns unlocalized side name.
  • BIS_fnc_sideTypeReturns side type based on side ID. See BIS_fnc_sideID for more information.
  • BIS_fnc_tridentClient*N/A*
  • BIS_fnc_tridentExecuteExecute a code based on Trident relationship.
  • BIS_fnc_tridentGetRelationshipGets the relationship of competing Trident sides. The value slowly decreases towards 0.
  • BIS_fnc_tridentHandleDamageRegister a unit as Trident unit. When competing sides are still friendly and the unit is killed by the competing side, the killer won't be punsihed…
  • BIS_fnc_tridentSetRelationshipSet relationship of competing Trident sides. When the value reaches threshold, side relationship will change. The value slowly decreases towards 0.

Sound

Spectator

Strategic

Strings

Supports

Systems

Tasks

Timeline

Timeline3DEN

TXScan

Variables

  • BIS_fnc_areEqualThis function returns true if all of the passed data elements are of the same type and value. One or more elements can be passed.
  • BIS_fnc_areEqualNotNilCompares all elements of passed array between each other and returns true is all are defined and identical.
  • BIS_fnc_getServerVariableFetch a variable saved on server. Used when you want to share variables only to specific clients to prevent large traffic. Must be run in scheduled…
  • BIS_fnc_setServerVariableSet variable stored only on server. Clients can the download it using BIS_fnc_getServerVariable. Used when you want to share variables only to…
  • BIS_fnc_swapVarsSwaps the values of two variables passed as String.
  • BIS_fnc_variableSpaceAddAdd element to variable from someone's variable space.
  • BIS_fnc_variableSpaceRemoveRemove element from variable from someone's variable space.

Vectors

Vehicles

VR

Warlords

Waypoints

Weapons

  • BIS_fnc_addWeaponAdds a weapon to the specified unit, with magazine classnames taken from the weapon's config (in CfgWeapons).
  • BIS_fnc_baseWeaponDetermines base weapon class, with no attachments.
  • BIS_fnc_classWeaponReturns class of weapon given by string.
  • BIS_fnc_compatibleMagazinesGets all compatible magazines for selected weapons. Function looks both for magazines listed in `magazines` array and compatible `magazineWells`.
  • BIS_fnc_fireMakes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is…
  • BIS_fnc_magazinesEntityTypeReturn object's magazines as defined in config. Scans also turrets and pylons.
  • BIS_fnc_packStaticWeaponThis function will make weapon team pack a static weapon. The weapon crew will pack carried weapon (or given weapon if different) and follow leader.…
  • BIS_fnc_unpackStaticWeaponThis function will move given support team to the given weapon position. The weapon crew will unpack carried weapon and start watching given target…
  • BIS_fnc_weaponAddonReturn addon from CfgPatches to which a given weapon class belongs to.
  • BIS_fnc_weaponComponentsReturns array with classname of the parent weapon (without attachments), followed by classnames of all its attachments.
  • BIS_fnc_weaponDirectionRelativeReturns relative direction vector of given weapon for the given vehicle
  • BIS_fnc_weaponsEntityTypeReturn object's weapons as defined in config. Scans also turrets and pylons.

WeatherManager