BIS fnc arsenal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[[^|]+\| *([a-zA-Z= _]+) *\]\]([^<]*)<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "{{Feature | Informative | " to "{{Feature|informative|")
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:


|descr= Function used for the [[Arma 3: Arsenal|Virtual Arsenal]]. The function features four different modes, each mode comes with its own parameters.
|descr= Function used for the [[Arma 3: Arsenal|Virtual Arsenal]]. The function features four different modes, each mode comes with its own parameters.
{{Feature | Informative | If Arsenal is launched within the first second from the mission start, the unit loadout will be randomised.}}
{{Feature|informative|If Arsenal is launched within the first second from the mission start, the unit loadout will be randomised.}}


|s1= [mode, params] call [[BIS_fnc_arsenal]]
|s1= [mode, params] call [[BIS_fnc_arsenal]]
Line 25: Line 25:
** ammobox: [[Object]] - Object which should get a virtual ammobox
** ammobox: [[Object]] - Object which should get a virtual ammobox
** allItems: [[Boolean]] - (Optional, default [[false]]) [[true]] to make all items available
** allItems: [[Boolean]] - (Optional, default [[false]]) [[true]] to make all items available
** condition: [[Code]] - (Optional, default {{ic|{ [[true]] }<nowiki/>}}) condition for the [[Arsenal]] to be accessible. Available arguments are the same as in [[addAction]]'s ''condition'' parameter:
** condition: [[Code]] - (Optional, default <sqf inline>{ true }</sqf>) condition for the [[Arsenal]] to be accessible. Available arguments are the same as in [[addAction]]'s ''condition'' parameter:
*** _target: [[Object]] - object to which the action is attached or, if the object is a unit inside of vehicle, the vehicle
*** _target: [[Object]] - object to which the action is attached or, if the object is a unit inside of vehicle, the vehicle
*** _this: [[Object]] - caller person to whom the action is shown (or not depending on ''condition'')
*** _this: [[Object]] - caller person to whom the action is shown (or not depending on ''condition'')
Line 34: Line 34:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>// Opens [[Arma 3: Arsenal|Arsenal]] with all items
|x1= Opens [[Arma 3: Arsenal|Arsenal]] with all items:
["Open", [<nowiki/>[[true]]]] [[call]] [[BIS_fnc_arsenal]];</code>
<sqf>["Open", [true]] call BIS_fnc_arsenal;</sqf>


|x2= <code>// Preloads Arsenal's config
|x2= Preloads [[Arma 3: Arsenal|Arsenal]]'s config:
["Preload"] call BIS_fnc_arsenal;</code>
<sqf>["Preload"] call BIS_fnc_arsenal;</sqf>


|x3= <code>// Adds full [[Arsenal]] to the [[player]] object and makes the [[addAction|action]] available when the player is closer than 10 meters from ammoBox
|x3= Adds full [[Arsenal]] to the [[player]] object and makes the [[addAction|action]] available when the player is closer than 10 meters from ammoBox:
["AmmoboxInit", [ammoBox, [[true]], { _this [[distance]] _target  < 10 }]] [[call]] [[BIS_fnc_arsenal]];</code>
<sqf>["AmmoboxInit", [ammoBox, true, { _this distance _target  < 10 }]] call BIS_fnc_arsenal;</sqf>


|x4= <code>// Removes Arsenal from player object
|x4= Removes Arsenal from player object:
["AmmoboxExit", player] call BIS_fnc_arsenal;</code>
<sqf>["AmmoboxExit", player] call BIS_fnc_arsenal;</sqf>


|seealso= [[Arma 3: Arsenal]] [[BIS_fnc_garage]]
|seealso= [[Arma 3: Arsenal]] [[BIS_fnc_garage]]
}}
}}

Latest revision as of 21:41, 16 May 2024

Hover & click on the images for description

Description

Description:
Function used for the Virtual Arsenal. The function features four different modes, each mode comes with its own parameters.
If Arsenal is launched within the first second from the mission start, the unit loadout will be randomised.
Execution:
call
Groups:
Inventory

Syntax

Syntax:
[mode, params] call BIS_fnc_arsenal
Parameters:
mode: String - mode, can be one of:
  • "Open" - opens the Arsenal
  • "Preload" - preloads item configs, without preloading the configs are parsed the first time it is opened
  • "AmmoboxInit" - adds a virtual ammobox. Action to access the Arsenal will be added automatically to all clients
  • "AmmoboxExit" - remove virtual ammobox
params: Anything - mode parameters:
  • "Open": [full, cargo, center]
  • "Preload": no parameters
  • "AmmoboxInit": [ammobox, allItems, condition]
    • ammobox: Object - Object which should get a virtual ammobox
    • allItems: Boolean - (Optional, default false) true to make all items available
    • condition: Code - (Optional, default { true }) condition for the Arsenal to be accessible. Available arguments are the same as in addAction's condition parameter:
      • _target: Object - object to which the action is attached or, if the object is a unit inside of vehicle, the vehicle
      • _this: Object - caller person to whom the action is shown (or not depending on condition)
      • _originalTarget: Object - original object to which the action is attached, regardless if the object/unit is in a vehicle or not
  • "AmmoboxExit": [ammobox]
Return Value:
Nothing

Examples

Example 1:
Opens Arsenal with all items:
["Open", [true]] call BIS_fnc_arsenal;
Example 2:
Preloads Arsenal's config:
["Preload"] call BIS_fnc_arsenal;
Example 3:
Adds full Arsenal to the player object and makes the action available when the player is closer than 10 meters from ammoBox:
["AmmoboxInit", [ammoBox, true, { _this distance _target < 10 }]] call BIS_fnc_arsenal;
Example 4:
Removes Arsenal from player object:
["AmmoboxExit", player] call BIS_fnc_arsenal;

Additional Information

See also:
Arma 3: Arsenal BIS_fnc_garage

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note