BIS fnc arsenal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Undo revision 104397 by Lou Montana (talk))
(page overhault)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


|<code> /*
| Function used for Virtual [[Arsenal]]. The function features four different modes, each mode comes with its own paramters. |= Description
Author: Karel Moricky
____________________________________________________________________________________________
 
Description:
Splendid arsenal viewer
 
Parameter(s):


0: STRING - mode
| [mode,params] call '''BIS_fnc_arsenal''' |= Syntax
1: ANY - params (see below)


Modes:
|p1= mode: [[String]] - Mode, can be "Open", "Preload", "AmmoboxInit" and "AmmoboxExit"|= Parameter 1
"Open" - Open the Arsenal
|p2= params: [[Anything]] - Parameters used by mode (See below for details)
0 (Optional): BOOL - true to open full Arsenal, with all categories and items available (default: false)
*'''"Open"''' - Opens the Arsenal
**0: [[Boolean]] - [[true|True]] to open full [[Arsenal]] with all items available (default: [[false]])
*'''"Preload"''' - Preloads item configs, without preloading the configs are parsed the first time it's opened
**No parameters
*'''"AmmoboxInit"''' - Adds a virtual ammobox. Action to access the [[Arsenal]] will be added automatically to all clients
**0: [[Object]] - Object which should get a virtual ammobox
**1: [[Boolean]] -  [[true|True]] to make all items available (optional, default: [[false]])
**2: [[Code]] - Condition for the [[Arsenal]] to be accessable (optional,default: {[[false]]})
***Passed arguments are the same as in [[addAction]] condition, i.e. _target - the object, _this - the caller
*'''"AmmoboxExit"''' - Remove virtual ammobox
**0: [[Object]] - The object the [[Arsenal]] was added to |= Parameter 2


"Preload" - Preload item configs for Arsenal (without preloading, configs are parsed the first time Arsenal is opened)
No params


"AmmoboxInit" - Add virtual ammobox. Action to access the Arsenal will be added automatically on all clients.
0: OBJECT - ammobox
1 (Optional): BOOL - true to make all weapons and items in the game available in the box (default: false)
2 (Optional): Condition for showing the Arsenal action (default: {true})
      Passed arguments are the same as in addAction condition, i.e., _target - the box, _this - caller


"AmmoboxExit" - Remove virtual ammobox
| [[Nothing]] |= Return value
0: OBJECT - ammobox
 
 
Returns:
NOTHING
*/
</code> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| [mode,params] [[spawn]] [[BIS_fnc_arsenal]] |= Syntax
|x1= <code>[ "Open", [ [[true]] ] [[call]] '''BIS_fnc_arsenal''';</code> |= example 1
 
|x2= <code>[ "Preload" ] [[call]] '''BIS_fnc_arsenal''';</code> |= example 2
|p1= |= Parameter 1
|x3= <code>[ "AmmoboxInit", [ [[player]], [[true]], {(_this [[distance]] _target) < 10} ] ] [[call]] '''BIS_fnc_arsenal''';</code> |= example 3
 
|x4= <code>[ "AmmoboxExit", [[player]] ] [[call]] '''BIS_fnc_arsenal''';</code> |= example 4
| |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>["Open",[[true]] ] [[spawn]] [[BIS_fnc_arsenal]];//Using [[call]] crashes the game</code> |=
| [[Arsenal]], [[BIS_fnc_garage]] |= See also
|x2= <code>["Preload"] [[call]] [[BIS_fnc_arsenal]]; </code> |=
|x3= <code>["AmmoboxInit",[ammobox,[[true]],{[[true]]}]] spawn BIS_fnc_arsenal;//applies [[Arsenal]] to object "ammobox" and includes all items.</code> |=
____________________________________________________________________________________________
 
| [[Arsenal]], [[BIS_fnc_garage]]|= See also
 
}}
}}


Line 88: Line 70:
<dt class="note">[[User:Lou Montana|Lou Montana]]</dt>
<dt class="note">[[User:Lou Montana|Lou Montana]]</dt>
<dd class="note">
<dd class="note">
calling or spawning BIS_fnc_Arsenal with arguments ["AmmoboxInit", [myBox, true]] will show a "%ALL" error ([[BIS_fnc_error]]) when the player actually uses it.<br />
[[call|calling]] or [[spawn|spawning]] '''BIS_fnc_Arsenal''' with arguments ["AmmoboxInit", [myBox, true]] will show a "%ALL" error ([[BIS_fnc_error]]) when the player actually uses it.<br />
Use <code>[myCrate, "%ALL", true] call BIS_fnc_removeVirtualWeaponCargo</code> to remove this "%ALL" parameter.
Use <code>[ myCrate, "%ALL", [[true]] ] [[call]] [[BIS_fnc_removeVirtualWeaponCargo]]</code> to remove this "%ALL" parameter.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 10:58, 13 May 2018

Hover & click on the images for description

Description

Description:
Function used for Virtual Arsenal. The function features four different modes, each mode comes with its own paramters.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[mode,params] call BIS_fnc_arsenal
Parameters:
mode: String - Mode, can be "Open", "Preload", "AmmoboxInit" and "AmmoboxExit"
params: Anything - Parameters used by mode (See below for details)
  • "Open" - Opens the Arsenal
  • "Preload" - Preloads item configs, without preloading the configs are parsed the first time it's opened
    • No parameters
  • "AmmoboxInit" - Adds a virtual ammobox. Action to access the Arsenal will be added automatically to all clients
    • 0: Object - Object which should get a virtual ammobox
    • 1: Boolean - True to make all items available (optional, default: false)
    • 2: Code - Condition for the Arsenal to be accessable (optional,default: {false})
      • Passed arguments are the same as in addAction condition, i.e. _target - the object, _this - the caller
  • "AmmoboxExit" - Remove virtual ammobox
Return Value:
Nothing

Examples

Example 1:
[ "Open", [ true ] call BIS_fnc_arsenal;
Example 2:
[ "Preload" ] call BIS_fnc_arsenal;
Example 3:
[ "AmmoboxInit", [ player, true, {(_this distance _target) < 10} ] ] call BIS_fnc_arsenal;
Example 4:
[ "AmmoboxExit", player ] call BIS_fnc_arsenal;

Additional Information

See also:
ArsenalBIS_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

Notes

Bottom Section

Posted on October 6, 2014 - 04:59 (UTC)
Benargee
To remove arsenal from an ammo box, you can use: removeAllActions ammobox
Posted on September 2, 2017 - 22:36 (UTC)
Lou Montana
calling or spawning BIS_fnc_Arsenal with arguments ["AmmoboxInit", [myBox, true]] will show a "%ALL" error (BIS_fnc_error) when the player actually uses it.
Use [ myCrate, "%ALL", true ] call BIS_fnc_removeVirtualWeaponCargo to remove this "%ALL" parameter.