Arsenal - Add Default Loadouts API (#6558)

* Add addDefaultLoadout function

* Initialize defaultLoadoutsList by default

* Close params bracket

* Revert "Initialize defaultLoadoutsList by default"

This reverts commit a53d21046e.

* Add isNil check

* Remove tab

* Overwrite loadout if it exists

* Fix file name typo

* Use findIf and copy array

* Add override note to header

* Make btnImport use new function instead of duplicating code

* Use GVAR

* Use findIf

* Fix spacing

* Add documentation

* Improve documentation
This commit is contained in:
Ozan Eğitmen
2018-09-17 21:22:04 +03:00
committed by PabstMirror
parent 64cc287408
commit db6a40f91d
7 changed files with 60 additions and 22 deletions

View File

@ -116,6 +116,8 @@ Both of them are optional.
## 4. Default loadouts
### 4.1 Adding default loadouts via 3DEN
While in 3DEN you have the ability to save default loadouts in ACE Arsenal, doing so will make the saved loadouts available to all players (those loadouts are still subject to loadout verification).
To do so:
- Open ACE Arsenal in 3DEN by editing a unit's loadout.
@ -125,6 +127,19 @@ To do so:
This loadout list can be exported to the clipboard by using <kbd>Shift</kbd>. + <kbd>LMB</kbd>. on the export button, doing the same on the import button will import the list currently in the clipboard.
### 4.2 Adding default loadouts via script
Since 3.13.0, you can also add default loadouts with the `ace_arsenal_fnc_addDefaultLoadout` function.
```cpp
* 0: Name of loadout <STRING>
* 1: getUnitLoadout array <ARRAY>
```
Example:
`["Squad Leader", getUnitLoadout sql1] call ace_arsenal_fnc_addDefaultLoadout`
If a loadout with the same name exists, it will be overwritten.
## 5. Stats
ACE Arsenal stats are customizable, this will show you how.