API Functions - broma-arma/BromA-A3-Framework-Mark3 GitHub Wiki
Sometimes in your missions, you'll want to do some scripting of your own, and that's okay. We've prepared some small functions to aid you in your endeavors.
| BRM_FMK_fnc_artillery | |
| Create a falling CfgAmmo. | |
| PARAMETERS |
0 - Target. If an array, will randomly select one for each shot. (OBJECT / MARKER / POSITION2D / POSITION3D / ARRAY) 1 - CfgAmmo classname. If an array, will randomly select one for each shot. (STRING / ARRAY) 2 - (OPTIONAL) Radius around target to target. Array format is [minRadius, maxRadius]. Default 0 (NUMBER / ARRAY) 3 - (OPTIONAL) Delay, in seconds, between shots. Array format is [minSeconds, randomSeconds] or [minSeconds, midSeconds, maxSeconds]. Default 1 (NUMBER / ARRAY) 4 - (OPTIONAL) Number of shots. Default 1 (NUMBER) 5 - (OPTIONAL) CfgSounds classname to play for each shot. Empty string ("") for no sound (STRING / ARRAY / CODE) CODE - params ["_ammo", "_cfgAmmo", "_ammoSimulation"]; // Ammo classname, ammo config, and ammo simulation. |
| RETURNS | Nothing. |
| USAGE | [player, "F_20mm_white"] call BRM_FMK_fnc_artillery;
[allPlayers, ["F_20mm_white", "F_20mm_Red", "F_20mm_yellow", "F_20mm_green"], 50] call BRM_FMK_fnc_artillery; |
| BRM_FMK_fnc_cas | |
| Create a plane that does a CAS run on a specified position. | |
| PARAMETERS |
0 - Target. (POSITIONATL / OBJECT) 1 - Plane classname. (STRING) 2 - (OPTIONAL) Weapon type bitflags. 1: Gun, 2: Missile, 4: Bomb, 8: Rocket, 16: Cannon. Default 1 (NUMBER) 3 - (OPTIONAL) Direction, degrees, of the CAS run. -1 for random direction. Default -1 (NUMBER) |
| RETURNS | Nothing. |
| USAGE | [[1800, 1400, 0], "B_Plane_CAS_01_F", 1] call BRM_FMK_fnc_cas; // Gun run from a random direction
[[1800, 1400, 0], "B_Plane_CAS_01_F", 31, 0] call BRM_FMK_fnc_cas; // Gun, Missile, Bomb, Rocket, and/or Cannon run from the South. |
| BRM_FMK_fnc_doLog | |
| Logs or displays any desired value, targeting any desired environment. | |
| PARAMETERS |
0 - Scope or environment where the argument will be logged: "SERVER_ONLY", "CLIENT_ONLY", "LOCAL", "SERVER", "CLIENTS", "ALL" (STRING) 1 - The type of logging: "HINT", "CHAT", "LOG", "DEBUG" (CHAT + LOG), "F_LOG" (STRING) 2 - The value or format args to be logged. (ANY) 3 - Condition for the logging to happen. (BOOL) |
| RETURNS | Nothing. |
| USAGE | ["ALL", "HINT", "Loaded the message!"] call BRM_FMK_fnc_doLog;
["LOCAL", "LOG", name player] call BRM_FMK_fnc_doLog;
["SERVER", "F_LOG", "All events initialized."] call BRM_FMK_fnc_doLog;
["LOCAL", "LOG", ["Hello %1!", name player]] call BRM_FMK_fnc_doLog;
["LOCAL", "CHAT", "Debug mode is on!", DEBUG_MODE] call BRM_FMK_fnc_doLog; |
| BRM_FMK_fnc_halo | |
| HALO drop a unit. | |
| PARAMETERS |
0 - Unit. (OBJECT) 1 - (OPTIONAL) Altitude, minimum of 500. -1 to not change unit altitude. Default 2000 (NUMBER) 2 - (OPTIONAL) Parachute backpack classname. Default "B_Parachute" (STRING) 3 - (OPTIONAL) Altitude to automatically deploy parachute. -1 to not auto-deploy. -2 to auto-deploy immediately. Default -1 (NUMBER) |
| RETURNS | Nothing. |
| USAGE | player call BRM_FMK_fnc_halo;
[player, 5000] call BRM_FMK_fnc_halo; |
| BRM_FMK_fnc_paratroop | |
| Paratroop synchronized or all, if no synchronized, players from a plane at plane's first and only waypoint and deletes plane. Player's should not be placed in the plane. | |
| PARAMETERS |
0 - Vehicle. (OBJECT) 1 - (OPTIONAL) Static line. If true, causes player parachute to be automatically deployed shortly after leaving aircraft. Default true (BOOLEAN) 2 - (OPTIONAL) Parachute backpack classname. Default "B_Parachute" (STRING) 3 - (OPTIONAL) Internal use. Default -1 (NUMBER) |
| RETURNS | Nothing. |
| USAGE | this call BRM_FMK_fnc_paratroop;
[this, false] call BRM_FMK_fnc_paratroop; // Manual parachute deployment |
| BRM_FMK_fnc_reachTarget | |
| Executes a callback when all objects have reached the targets. | |
| PARAMETERS |
0 - Objects. (ARRAY of OBJECT|GROUP) 1 - Targets. (ARRAY of OBJECT|POSITION|MARKER) 2 - Callback, execution is in unscheduled enviroment. (CODE) 3 - (OPTIONAL) The maximum distance from the target. Default is 50. (NUMBER) 4 - (OPTIONAL) Seconds between checking if target has been reached. Default is 1. (NUMBER) |
| RETURNS | Nothing. |
| USAGE | [[myGroupA, myUnitZ], [myTargetObject, "myMarker", [200, 100, 50], [0, 0]], { systemChat "Group A and Unit Z made it to one of the targets!"; }, 100, 5] call BRM_FMK_fnc_reachTarget; |
| BRM_FMK_fnc_garrisonUnits | |
| Teleports the units to random windows of the building(s) within the distance Faces units in the right direction and orders them to stand up or crouch on a roof Units will only fill the building to as many positions as there are windows Multiple buildings can be filled either evenly or to the limit of each sequentially | |
| PARAMETERS |
0 - The building(s) nearest this position is used. (ARRAY) 1 - Array of objects, the units that will garrison the building(s). (ARRAY) 2 - (OPTIONAL) Radius in which to fill building(s), -1 for only nearest building. Default -1 (SCALAR) 3 - (OPTIONAL) true to put units on the roof, false for only inside. Default false (BOOLEAN) 4 - (OPTIONAL) true to fill all buildings in radius evenly, false for one by one. Default false (BOOLEAN) 5 - (OPTIONAL) true to fill from the top of the building down. Default false (BOOLEAN) 6 - (OPTIONAL) true to order AI units to move to the position instead of teleporting. Default false (BOOLEAN) |
| RETURNS | Array of objects, the units that were not garrisoned (ARRAY) |
| USAGE | [getMarkerPos "myPosition", myArrayOfUnits, -1, true, true] call BRM_FMK_fnc_garrisonUnits |
| BRM_FMK_fnc_appendIndices | |
| Returns an array of the specified indices appended together. | |
| PARAMETERS |
0 - Source array (ARRAY) 1 - Indices (ARRAY) |
| RETURNS | Array containing the specified indices appended together (ARRAY) |
| USAGE | ["Hello", "Foo", "World"] = [[["Hello"], ["Foo"], ["Bar"], ["World"]], [0, 1, 3]] call BRM_FMK_fnc_appendIndices; |
| BRM_FMK_fnc_verboseArray | |
| Converts an array into an english reading format. | |
| PARAMETERS |
0+ - Item (ANY) |
| RETURNS | Verbosed array (STRING) |
| USAGE | ["Nife", "Royal", "Knite"] call BRM_FMK_fnc_verboseArray; // "Nife, Royal and Knite" |
| BRM_FMK_fnc_getFactionVehicles - DEPRECATED: Use BRM_FMK_fnc_appendIndices. | |
| 'Alias' for appendIndices | |
| PARAMETERS |
0 - Source array (ARRAY) 1 - Indices (ARRAY) |
| RETURNS | Array containing the specified indices appended together (ARRAY) |
| USAGE | ["Hello", "Foo", "World"] = [[["Hello"], ["Foo"], ["Bar"], ["World"]], [0, 1, 3]] call BRM_FMK_fnc_getFactionVehicles; |
| BRM_FMK_fnc_getUnitsArray - DEPRECATED: Use: [_side, "units"] call BRM_FMK_fnc_getSideInfo | |
| Returns an array containing unit class names for the side | |
| PARAMETERS |
0 - Side to get the unit class names of. (SIDE) |
| RETURNS | An array containing unit class names for the side. (ARRAY) |
| USAGE | [WEST] call BRM_FMK_fnc_getUnitsArray; |
| BRM_FMK_fnc_setVehiclesArray - DEPRECATED: Replace usage with: #include "\broma_framework\loadouts\includes\default-equipment.sqf" | |
| Redundant function, currently used to set default equipment values for backward compatibility. | |
| PARAMETERS |
Anything. (ANY) |
| RETURNS | Received parameters. (ANY) |
| USAGE | [] call BRM_FMK_fnc_setVehiclesArray; |
| BRM_FMK_fnc_error | |
| Display error message. BIS_fnc_error, without restrictions on when error shown/logged. | |
| PARAMETERS |
0 - Formatted message (STRING) 1+ - (OPTIONAL) additional parameters (ANY) |
| RETURNS | Nothing. |
| USAGE | ["Player is too far away (%1 metres)", round (player distance [0, 0, 0])] call BRM_FMK_fnc_error;
if (!isServer) exitWith { ["This function must run on the server"] call BRM_FMK_fnc_error };
if (!hasInterface) exitWith { ["This function must not run on a headless machine"] call BRM_FMK_fnc_error };
if (!local _vehicle) exitWith { ["This function must run on the vehicle owner's machine"] call BRM_FMK_fnc_error }; |
| BRM_FMK_fnc_paramsCheck | |
| Validate parameters. | |
| PARAMETERS |
0+ - paramN (STRING/ARRAY) STRING: name of the private variable (can be an empty string "", in which case the param is skipped) ARRAY format [variableName, expectedDataTypes, expectedValues/customValidation]: 0 - variableName: name of the private variable (STRING) 1 - (OPTIONAL) expectedDataTypes: (Optional) checks if passed value is one of listed Data Types. Empty array [] means every data type is accepted. (ARRAY of direct Data Types) In an Array Data Type, valid sizes of the array can be specified. 2 - (OPTIONAL) expectedValues or customValidation (ARRAY/CODE) ARRAY: Array of expected values - (Optional) array containing valid values for the parameter. Empty array [] means any value is accepted. (ARRAY) CODE: Code that returns an array with the format of [valid, error], valid being a BOOLEAN signifying if the value is valid and error is a STRING containing the error text shown when valid is false. _this is the tested value. In the error text, %1 is replaced with the parameter value, %2 is replaced with the parameter value type, and %3 is replaced with the parameter name. (CODE) |
| RETURNS | true if params are valid, otherwise false. (BOOLEAN) |
| USAGE | [["_myNumber", [0]]] call BRM_FMK_fnc_paramsCheck; // Validates _myNumber is a number.
[["_myString", [""], ["a", "b", "c"]]] call BRM_FMK_fnc_paramsCheck; // Validates _myString is a string and is "a", "b", or "c".
[["_myArray", [[2]]]] call BRM_FMK_fnc_paramsCheck; // Validates _myArray is an array containing 2 elements.
[["_myArray", [[2, 4]]]] call BRM_FMK_fnc_paramsCheck; // Validates _myArray is an array containing 2 or 4 elements.
[["_myNumberRange", [0], { [_this > 0 && _this < 10, "%3 must be 1 to 9, got %1"] }]] call BRM_FMK_fnc_paramsCheck; // Validates _myNumberRange is a number between 0 and 10.
[ // All of the above.
["_myNumber", [0]],
["_myString", [""], ["a", "b", "c"]],
["_myArray", [[2]]],
["_myArray", [[2, 3]]],
["_myNumberRange", [0], { [_this > 0 && _this < 10, "%3 must be 1 to 9, got %1"] }]
] call BRM_FMK_fnc_paramsCheck; |
| BRM_FMK_fnc_getFactionInfo | |
| Get the faction and side of the faction. | |
| PARAMETERS |
0 - The side or faction name. (STRING) 1 - (OPTIONAL) The default faction side. (SIDE) |
| RETURNS | The faction name and side. (ARRAY) |
| USAGE | ["side_a"] call BRM_FMK_fnc_getFactionInfo;
["west"] call BRM_FMK_fnc_getFactionInfo;
["NATO"] call BRM_FMK_fnc_getFactionInfo; |
| BRM_FMK_fnc_newMarker | |
| Creates a marker with the specified settings. | |
| PARAMETERS |
0 - (OPTIONAL) Marker locality - true for global. Default false. (BOOLEAN) 1 - (OPTIONAL) Name. Default "BRM_FMK_newMarker%d". (ARRAY) 2 - (OPTIONAL) Position. Default [0, 0]. (ARRAY) 3 - (OPTIONAL) Shape: "ICON", "RECTANGLE", "ELLIPSE" or "POLYLINE". Default "ICON". (STRING) 4 - (OPTIONAL) Brush: "Solid", "SolidFull", "Horizontal", "Vertical", "Grid", "FDiagonal", "BDiagonal", "DiagGrid", "Cross", "Border", or "SolidBorder". Default "Solid". (STRING) 5 - (OPTIONAL) Type: See https://community.bistudio.com/wiki/Arma_3:_CfgMarkers#Marker_Classes for possible values. Default "". (STRING) 6 - (OPTIONAL) Color: See https://community.bistudio.com/wiki/Arma_3:_CfgMarkerColors#Marker_Color_Classes for possible values. Default "Default". (STRING) 7 - (OPTIONAL) Size: an array with half width and half height. Default [1, 1]. (ARRAY) 8 - (OPTIONAL) Text. Default "". (STRING) 9 - (OPTIONAL) Direction, in degrees. Default 0. (NUMBER) 10 - (OPTIONAL) Alpha: 0 to 1, with 0 being transparent. Default 1. (NUMBER) |
| RETURNS | The created marker's name. (STRING) |
| USAGE | // Create a 50% transparent, solid, blue, 500x500 rectangle at the player's position.
_mynewMarker = [true, nil, player, "RECTANGLE", "Solid", nil, "ColorBlue", [250, 250], nil, 0, 0.5] call BRM_FMK_fnc_newMarker;
// Create a 50% transparent, cross, red, 500x500 ellipse at the player's position.
_markerName = [false, nil, player, "ELLIPSE", "Cross", nil, "ColorRed", [250, 250], nil, 0, 0.5] call BRM_FMK_fnc_newMarker
// Create a opaque, blue, 1x1 hd_flag labeled "Help us!" at the player's position.
_markerName = [true, nil, player, nil, nil, "hd_flag", "ColorBlue", [1, 1], "Help us!", 0, 1] call BRM_FMK_fnc_newMarker
// Create a opaque, red, 0.5x0.5 hd_warning labeled "Enemy infantry" at the position of 'enemy'.
_markerName = [false, nil, enemy, nil, nil, "hd_warning", "ColorRed", [0.5, 0.5], "Enemy infantry", 0, 0.3] call BRM_FMK_fnc_newMarker</code></pre></td></tr>
|
| BRM_FMK_fnc_newMarkerArea | |
| Easier and shorter way to create markers. Makes an area marker. | |
| PARAMETERS |
0 - Locality - "global" or "local" (STRING) 1 - Position. (ARRAY) 2 - Type: The area type - "RECTANGLE" or "ELLIPSE" (STRING) 3 - Brush: Fill: see https://community.bistudio.com/wiki/setMarkerBrush (STRING) 4 - (OPTIONAL) Color: "ColorRed", "ColorBlue" etc. (STRING) 5 - (OPTIONAL) Size: an array with the width and the height, 1 being the default. (ARRAY) 6 - (OPTIONAL) Direction in degrees. (NUMBER) 7 - (OPTIONAL) Opacity, from 0 to 1. (NUMBER) |
| RETURNS | Object of the marker created. (MARKER) |
| USAGE | _mynewMarker = ["global", (getPos player), "RECTANGLE", "Solid", "ColorBlue", [250,250], 0, 0.5] call BRM_FMK_fnc_newMarkerArea
_mynewMarker = ["local", (getPos player), "ELLIPSE", "Cross", "ColorRed", [250,250], 0, 0.5] call BRM_FMK_fnc_newMarkerArea</code></pre></td></tr>
|
| BRM_FMK_fnc_newMarkerIcon | |
| Easier and shorter way to create markers. Makes an icon marker. | |
| PARAMETERS |
0 - Locality - "global" or "local" (STRING) 1 - Position. (ARRAY) 2 - Type: The marker's icon. See https://community.bistudio.com/wiki/Arma_3:_CfgMarkers#Marker_Classes (STRING) 3 - (OPTIONAL) Color: "ColorRed", "ColorBlue" etc. (STRING) 4 - (OPTIONAL) Text. (STRING) 5 - (OPTIONAL) Size: an array with the width and the height, 1 being the default. (ARRAY) 6 - (OPTIONAL) Direction in degrees. (NUMBER) 7 - (OPTIONAL) Opacity, from 0 to 1. (NUMBER) |
| RETURNS | Object of the marker created. (MARKER) |
| USAGE | _mynewMarker = ["global", (getPos player), "hd_flag", "ColorBlue", "Help us!", [1,1], 0, 1] call BRM_FMK_fnc_newMarkerIcon
_mynewMarker = ["local", (getPos enemy), "hd_warning", "ColorRed", "Enemy infantry", [0.5,0.5], 0, 0.3] call BRM_FMK_fnc_newMarkerIcon</code></pre></td></tr>
|
| BRM_FMK_fnc_callEnding - DEPRECATED: Use BRM_FMK_fnc_endMission. | |
| This function will effectively end the mission and call other ending events. | |
| PARAMETERS |
0 - Ending event that should be called (STRING) |
| RETURNS | Nothing. |
| USAGE | ["victory"] call BRM_FMK_fnc_callEnding |
| BRM_FMK_fnc_endMission | |
| End the mission. | |
| PARAMETERS |
0 - End classname, defined in BRM_FMK >> Endings in mission or addon config (STRING) |
| RETURNS | Nothing. |
| USAGE | ["victory"] call BRM_FMK_fnc_endMission |
| BRM_FMK_fnc_initAI - DEPRECATED: Remove usage. | |
| Initializes an AI unit with their loadout and environment variables. | |
| PARAMETERS |
0 - Target unit. (OBJECT) 1 - Faction the unit belongs to. (STRING) |
| RETURNS | Nothing. |
| USAGE | [aiUnit, "SLA"] call BRM_FMK_fnc_initAI;
[this, "RACS"] call BRM_FMK_fnc_initAI; |
| BRM_FMK_fnc_isPluginActive | |
| Check if a framework plugin is active. | |
| PARAMETERS |
0 - Plugin class name (STRING) |
| RETURNS | true if plugin is active, otherwise false. (BOOLEAN) |
| USAGE | [] call BRM_FMK_fnc_isPluginActive |
| BRM_FMK_fnc_distance | |
| Get distance between two entities. | |
| PARAMETERS |
0 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) 1 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) |
| RETURNS | distance (NUMBER) |
| USAGE | [player, target] call BRM_FMK_fnc_distance; |
| BRM_FMK_fnc_distance2D | |
| Get 2D distance between two entities. | |
| PARAMETERS |
0 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) 1 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) |
| RETURNS | 2D distance (NUMBER) |
| USAGE | [player, target] call BRM_FMK_fnc_distance2D; |
| BRM_FMK_fnc_distance2DSqr | |
| Get 2D squared distance between two entities. | |
| PARAMETERS |
0 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) 1 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) |
| RETURNS | 2D squared distance (NUMBER) |
| USAGE | [player, target] call BRM_FMK_fnc_distance2DSqr; |
| BRM_FMK_fnc_distanceSqr | |
| Get squared distance between two entities. | |
| PARAMETERS |
0 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) 1 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / CONTROL / WAYPOINT / ARRAY) |
| RETURNS | squared distance (NUMBER) |
| USAGE | [player, target] call BRM_FMK_fnc_distanceSqr; |
| BRM_FMK_fnc_getPos | |
| Get position of an entity. | |
| PARAMETERS |
0 - Entity (OBJECT / GROUP / MARKER / LOCATION / POSITION / WAYPOINT / ARRAY) |
| RETURNS | OBJECT / GROUP / MARKER / LOCATION / WAYPOINT: ASL position ARRAY: []: [0, 0, 0] [n]: ASL position for [n, n] [x, y]: ASL position for [x, y] [x, y, z(, ...)]: [x, y, z] (POSITION) |
| USAGE | player call BRM_FMK_fnc_getPos; |
| BRM_FMK_fnc_checkCasualties | |
| Executes a callback when a specified percent of players, on a specified side, are dead. | |
| PARAMETERS |
0 - Side. (SIDE) 1 - Percentage, 0 to 1. (NUMBER) 2 - Callback, execution is in unscheduled enviroment. (CODE) 3 - (OPTIONAL) Seconds between checking if percentage has been reached. Default is 5. (NUMBER) |
| RETURNS | Nothing |
| USAGE | [WEST, 1, { systemChat "Blufor, game over man."; }, 10] call BRM_FMK_fnc_checkCasualties;
[EAST, 0.65, { systemChat "65% of Opfor have died!"; }] call BRM_FMK_fnc_checkCasualties; |
| BRM_FMK_fnc_getSideInfo | |
| Returns the relevant information about any side. | |
| PARAMETERS |
0 - Side whose information should be returned. (SIDE) 1 - The type of information: "faction", "side", "color", "name", "skill", "callsigns", "units", "vehicles", "objects", or "dacCamps" (STRING) |
| RETURNS | The requested information. (ANY) |
| USAGE | [west, "callsigns"] call BRM_FMK_fnc_getSideInfo;
[east, "name"] call BRM_FMK_fnc_getSideInfo;
[resistance, "faction"] call BRM_FMK_fnc_getSideInfo; |
| BRM_FMK_fnc_getMusic | |
| Returns available music. | |
| PARAMETERS |
None. |
| RETURNS | Available music. (ARRAY) |
| USAGE | call BRM_FMK_fnc_getMusic; |
| BRM_FMK_fnc_playCfgSound | |
| playSound3D with CfgSound support. | |
| PARAMETERS |
0 - CfgSound classname to play. (STRING) 1 - Object or ASL position to play the sound at. (OBJECT / POSITION) 2 - (OPTIONAL) Simulate the sound being played inside a building or similar. Default false (BOOLEAN) 3 - (OPTIONAL) Start offset, in seconds. Default 0 (NUMBER) 4 - (OPTIONAL) Play sound locally. Default false (BOOLEAN) |
| RETURNS | Nothing. |
| USAGE | [player, "alert"] call BRM_FMK_fnc_playCfgSound; |
| BRM_FMK_fnc_playGlobal | |
| Plays a track global to all players. | |
| PARAMETERS |
0 - Track. (STRING) |
| RETURNS | Nothing. |
| USAGE | ["LeadTrack01_F"] call BRM_FMK_fnc_playGlobal |
| BRM_FMK_fnc_isSpectating | |
| Get if player is spectating. | |
| PARAMETERS |
None |
| RETURNS | true if spectating, otherwise false. (BOOLEAN) |
| USAGE | [] call BRM_FMK_fnc_isSpectating; |
| BRM_FMK_fnc_setSpectating | |
| Start or stop spectating. | |
| PARAMETERS |
0 - true to start, false to stop (BOOLEAN) |
| RETURNS | Nothing. |
| USAGE | [true] call BRM_FMK_fnc_setSpectating; |
| BRM_FMK_fnc_formatElapsedTime | |
| Formats time, in seconds, according to a format. | |
| PARAMETERS |
0 - Seconds to format. (NUMBER) 1 - The format, consisting of the following seperated by a colon (:): Default "H:MM:SS". (STRING) S.MS - seconds.milliseconds S - seconds M - minutes H - hours D - days T - months 2 - Return type: "", "array", or "long". Default "". (STRING) |
| RETURNS | Formatted time (STRING) |
| USAGE | [time, "M:SS.MS"] call BRM_FMK_fnc_formatElapsedTime; // "3:38.847"
[time, "D:HH:MM:SS"] call BRM_FMK_fnc_formatElapsedTime; // "0:00:03:38"
[time, "DD:HH:MM:SS"] call BRM_FMK_fnc_formatElapsedTime; // "00:00:03:38"
[time, "DD:HH:MM:SS", "array"] call BRM_FMK_fnc_formatElapsedTime; // ["00", "00", "03", "38"]
[time, "DD:HH:MM:SS", "long"] call BRM_FMK_fnc_formatElapsedTime; // "3 minutes and 38 seconds" |
| BRM_FMK_fnc_createTask | |
| Create a task. | |
| PARAMETERS |
0 - Who will receive the task. (SIDE/GROUP/OBJECT) 1 - ID of the task or array in the format [ID, parent ID]. (STRING/ARRAY) 2 - Priority. (NUMBER) 0: Primary, completion required to complete mission and failure causes mission failure. 1: Secondary, completion or failure required to complete mission. 2: Abortive, failure causes mission failure. 3: Optional, outcome doesn't affect mission outcome. 3 - Title, description, and type. (ARRAY/STRING) ARRAY: 0 - Title. (STRING) 1 - Description. (STRING) 2 - Type: https://community.bistudio.com/wiki/Arma_3:_Task_Framework#Task_Icons (STRING) STRING: CfgTaskDescriptions class name. If empty string, task ID is used. 4 - Position. Use null object, empty string, or empty array for no position: objNull, "", [] (OBJECT/STRING/POSITION/ARRAY) OBJECT: Position will change with object movement. STRING: Marker name. Position doesn't change if marker is moved. ARRAY: 0 - Object (OBJECT) 1 - Position update (ARRAY/NUMBER/BOOLEAN) NUMBER: Seconds between updating the task position ARRAY: Random seconds between updating the task position. [min, max] or [min, mid, max] BOOLEAN: Use owner's knowledge of the object. POSITION: [x, y] or [x, y, z] 5 - Conditions. (ARRAY) 0 - Completion. (CODE/STRING) 1 - (OPTIONAL) Failure. Default {false} (CODE/STRING) 2 - (OPTIONAL) Assignment. Default {true} (CODE/STRING) 6 - (OPTIONAL) Event callbacks. (ARRAY) 0 - (OPTIONAL) Completed. Default {} (CODE/STRING) 1 - (OPTIONAL) Failed. Default {} (CODE/STRING) 2 - (OPTIONAL) Assigned. Default {} (CODE/STRING) |
| RETURNS | Nothing. |
| USAGE | [side_a_side, "aKillVIP", 1,
["Kill the VIP.", "We need to make sure he doesn't spill the beans.", "kill"], vip,
[{ !alive vip }, { vipEscaped }],
[{ vipKilled = true; }, { hint "Oops, something bad is going to happen!"; }]
] call BRM_FMK_fnc_createTask;
[side_a_side, "aCleanup", 2,
["Clean the Beans.", "Clean up the spilt beans.", "destroy"], objNull,
[{ beansCleaned }, { false }, { vipEscaped }]
] call BRM_FMK_fnc_createTask;</code></pre></td></tr>
|
| BRM_FMK_fnc_newTask - DEPRECATED: Use BRM_FMK_fnc_createTask. | |
| Adds a new task. | |
| PARAMETERS |
0 - Assignees: who will the task be assigned to. (SIDE/GROUP/UNIT) 1 - The ID of the task or array in the format [id, parent id]. (STRING/ARRAY) 2 - The details of the task. (ARRAY) 0 - Task title. (STRING) 1 - Description. (STRING) 2 - The Type of the Task (STRING) See https://community.bistudio.com/wiki/Arma_3:_Task_Framework#Task_Icons for task types 3 - Position of the Task (POSITION/OBJECT/STRING) No position will be shown if an empty array/string or null object. 3 - Conditions. (ARRAY) 0 - Condition for assignment. (STRING, but must evaluate to BOOLEAN) 1 - Condition for completion. (STRING, but must evaluate to BOOLEAN) 2 - Condition for failure. (STRING, but must evaluate to BOOLEAN) 4 - Task priority. (NUMBER) 2 - Primary, completion required to complete mission and failure causes mission failure. 1 - Secondary, completion or failure required to complete mission. 3 - Abortive, failure causes mission failure. 0 - Optional, outcome doesn't affect mission outcome. 5 - Task event callback. (ARRAY) 0 - Code executed when the task is assigned to the players. (STRING, but must evaluate to CODE) 1 - Code executed whenever the mission is completed. (STRING, but must evaluate to CODE) 2 - Code executed whenever the mission fails. |
| RETURNS | Nothing. |
| USAGE | [
side_a_side,
"newTaskVIPKill",
"destroy",
(getPos VIP),
["Kill the VIP.",
"We need to make sure he doesn't spills the beans."],
["(true)","!(alive VIP)", "(VIPhasEscaped)"],
1,
["","goodVariable = true","hint 'Oops, something bad is going to happen!"]
] spawn BRM_FMK_fnc_newTask; |
| BRM_FMK_fnc_setTask | |
| Sets a task's state over the network. | |
| PARAMETERS |
0 - Task ID (STRING) 1 - Desired state (STRING) |
| RETURNS | true if task exists and state was changed. (BOOLEAN) |
| USAGE | ["myTaskID", "FAILED"] call BRM_FMK_fnc_setTask |
| BRM_FMK_fnc_callCodeArea | |
| Executes code on all units inside a trigger area. Call this from a trigger init field. | |
| PARAMETERS |
0 - thisTrigger (TRIGGER) 1 - Filter (STRING that evaluates as an EXPRESSION / CODE that returns BOOLEAN) 2 - Code to be executed (STRING that evaluates as CODE / CODE) |
| RETURNS | Nothing. |
| USAGE | ON A TRIGGER'S INIT FIELD (make sure you set the condition to TRUE):
_nul = [thisTrigger, "(side _x == east)", "[_x, 'side_b'] call BRM_FMK_fnc_initAI"] spawn BRM_FMK_fnc_callCodeArea
_nul = [thisTrigger, "(side _x == civilian) && (alive _x)", "[_x, 'RACS'] call BRM_FMK_fnc_initAI"] spawn BRM_FMK_fnc_callCodeArea</code></pre></td></tr>
|
| BRM_FMK_fnc_colorToHex | |
| Converts a CfgMarkerColors name to its hexadecimal equivalent. | |
| PARAMETERS |
0 - Color name (STRING) black, grey, red, brown, orange, yellow, khaki, green, blue, pink, white, west, east, guer, civ, unknown, blufor, opfor, independent, civilian, or another CfgMarkerColors classname without the 'Color' prefix |
| RETURNS | Color hex code (STRING) |
| USAGE | myColor = ["red"] call BRM_FMK_fnc_colorToHex |
| BRM_FMK_fnc_showText | |
| Shows text in an organized and timed fashion. | |
| PARAMETERS |
n Screens to display (ARRAY): 0 - Text to show (STRING) 1 - Type of title (STRING) 2 - How long to display (NUMBER) |
| RETURNS | All titles have been displayed. (BOOLEAN) |
| USAGE | [
["This is an intro...", "BLACK FADED", 3],
["And it just ended!", "PLAIN", 5]
] spawn BRM_FMK_fnc_showText |
| BRM_FMK_fnc_alive | |
| Check if a unit is alive. | |
| PARAMETERS |
0 - Unit (OBJECT) |
| RETURNS | true if alive, otherwise false. (BOOLEAN) |
| USAGE | player call BRM_FMK_fnc_alive |
| BRM_FMK_fnc_disableObject | |
| Hide and disable simulation of an object. | |
| PARAMETERS |
0 - Object (OBJECT) 0 - Disable (BOOLEAN) |
| RETURNS | Nothing. |
| USAGE | [player, true] call BRM_FMK_fnc_disableObject |
| BRM_FMK_fnc_respawn | |
| Respawn a specific player, a number of players, or a specific side. | |
| PARAMETERS |
0 - Player, player's in-game name, amount of players, or a side to revive. (OBJECT/STRING/NUMBER/SIDE) 1 - (OPTIONAL) Varies depending on first parameter type: (NUMBER) OBJECT/STRING/NUMBER: How many lives they will get. Default mission parameter. SIDE: Amount of players to respawn. Default mission parameter. 2 - (OPTIONAL) SIDE only: How many lives they will get. Default mission parameter. (NUMBER) |
| RETURNS | Nothing. |
| USAGE | [player] call BRM_FMK_fnc_respawn; // Respawn the player
["Nife"] call BRM_FMK_fnc_respawn; // Respawn a player named "Nife"
[-1] call BRM_FMK_fnc_respawn; // Respawn all players
[4] call BRM_FMK_fnc_respawn; // Respawn 4 players
[side_a_side] call BRM_FMK_fnc_respawn; // Respawn players on Side A
["Nife", 2] call BRM_FMK_fnc_respawn; // Respawn a player named "Nife" with 2 lives
[4, 1] call BRM_FMK_fnc_respawn; // Respawn 4 players with 1 life
[BLUFOR, 5] call BRM_FMK_fnc_respawn; // Respawn 5 players on the BLUFOR side
[side_a_side, 10, 1] call BRM_FMK_fnc_respawn; // Respawn 10 players on Side A with 1 life</code></pre></td></tr>
|
| BRM_FMK_fnc_unitFromName | |
| Gets a unit's object from its name. | |
| PARAMETERS |
0 - Name (STRING) |
| RETURNS | Unit (OBJECT) |
| USAGE | ["Nife"] call BRM_FMK_fnc_unitFromName |
| BRM_FMK_fnc_respawnVehicle | |
| Set a vehicle to respawn. | |
| PARAMETERS |
0 - Vehicle. (OBJECT) 1 - (OPTIONAL) code executed on current and respawned vehicles. _this being the vehicle. Default {}. (CODE) 2 - (OPTIONAL) number of times the vehicle can be respawned. Default -1, unlimited. (NUMBER) 3 - (OPTIONAL) respawn delay, in seconds. Default -1, 3DEN vehicle respawn delay/description.ext respawnVehicleDelay. (NUMBER) 4 - (OPTIONAL) delete old wreck after respawn. Default false. (BOOLEAN) |
| RETURNS | Nothing. |
| USAGE | [this] call BRM_FMK_fnc_respawnVehicle;
[this, { [_this, "blufor", ["medical", "ammo", "radio", "at"]] call BRM_FMK_fnc_assignCargo; }] call BRM_FMK_fnc_respawnVehicle;
[this, { [_this, "blufor", ["medical", "ammo", "radio", "at"]] call BRM_FMK_fnc_assignCargo; }, 5] call BRM_FMK_fnc_respawnVehicle;
[this, { [_this, "blufor", ["medical", "ammo", "radio", "at"]] call BRM_FMK_fnc_assignCargo; }, -1, 5] call BRM_FMK_fnc_respawnVehicle;
[this, { [_this, "blufor", ["medical", "ammo", "radio", "at"]] call BRM_FMK_fnc_assignCargo; }, -1, 5, true] call BRM_FMK_fnc_respawnVehicle; |
| BRM_FMK_fnc_isDisposableLauncher | |
| Check if a launcher is disposable. | |
| PARAMETERS |
0 - Launcher class name. (STRING) |
| RETURNS | true if the launcher is disposable, otherwise false. (BOOLEAN) |
| USAGE | "launch_nlaw_f" call BRM_FMK_fnc_isDisposableLauncher; |
| BRM_FMK_fnc_z_setAll | |
| Changes the relevant attributes of all units currently selected by Zeus. | |
| PARAMETERS |
0 - Loadout (STRING) 1 - Skill (NUMBER) 2 - Combat mode (STRING) 3 - Behavior (STRING) 4 - (OPTIONAL) Side to filter units. (SIDE) |
| RETURNS | Nothing. |
| USAGE | While in Zeus mode, select the desired units first.
["RACS", 0.3, "GREEN", "ALERT", west] spawn BRM_FMK_fnc_z_setMode</code></pre></td></tr>
|
| BRM_FMK_fnc_z_setLoadout | |
| Changes the loadout of all units currently selected by Zeus. | |
| PARAMETERS |
0 - Loadout (STRING) 1 - (OPTIONAL) Side to filter units. (SIDE) |
| RETURNS | Nothing. |
| USAGE | While in Zeus mode, select the desired units first.
["SLA"] spawn BRM_FMK_fnc_z_setLoadout
["RACS", west] spawn BRM_FMK_fnc_z_setLoadout</code></pre></td></tr>
|
| BRM_FMK_fnc_z_setMode | |
| Changes the combat mode of all units currently selected by Zeus. | |
| PARAMETERS |
0 - Combat mode (STRING) 1 - Behavior (STRING) 2 - (OPTIONAL) Side to filter units. (SIDE) |
| RETURNS | Nothing. |
| USAGE | While in Zeus mode, select the desired units first.
["GREEN", "SAFE"] spawn BRM_FMK_fnc_z_setMode
["RED", "STEALTH", east] spawn BRM_FMK_fnc_z_setMode</code></pre></td></tr>
|
| BRM_FMK_fnc_z_setSkill | |
| Changes the skill of all units currently selected by Zeus. | |
| PARAMETERS |
0 - Skill (NUMBER) 1 - (OPTIONAL) Side to filter units. (SIDE) |
| RETURNS | Nothing. |
| USAGE | While in Zeus mode, select the desired units first.
[1] spawn BRM_FMK_fnc_z_setLoadout
[0.5, west] spawn BRM_FMK_fnc_z_setLoadout</code></pre></td></tr>
|