Author: aeroson
Author Website:

Requirements: No addons required

Version: 2014-03-25

Short description: Useful for saving/loading loadouts.

Date: 2014-03-25 16:52


Comments: (13)
Rating:



 

Loadout get/set functions and Loadout manager

by
aeroson


Description/Features:
These scripts allows you set/get (load/save)all of the unit's gear, including:
  • uniform
  • vest
  • backpack
  • contents of backpacks
  • all quiped items
  • all three weapons with their attachments
  • currently loaded magazines and number of ammo in magazines.
All this while preserving order of items.
Useful for saving/loading loadouts.
Ideal for revive scripts where you have to set exactly the same loadout to newly created unit.
Uses workaround with placeholders to add vest/backpack items, so items stay where you put them.

Why should i use it?
Well i was sceptical at first as well, i was like hell i don't need to use 200 lines script if i can just write it with 20 lines. That's basically how i started. After days of testing and debuging i found out that Arma 3 is not perfect. And to make the loadout set/get functions work as expected i had to figure out many workarounds and spend much more time on this than i would expect. In the end it turns out to be this big but it does also works perfectly and exactly how you would expect it to work. If you are interested in the workarounds scroll to the bottom of this post. Also if you decide not to use this, i will most likely come to your thread and tell you all the bugs your loadout saving/loading code has (which you could have avoided by using this), by now i can tell it only by looking at the code.

Loadout manager:
A simple scroll wheel based loadout manager.
Uses profileNamespace so all loadouts are saved permanently into your profile.
You can load all previously saved loadouts in VAS (both new and old)
Offer loadout is WIP.


Included files:
loadout_fncs/fnc_set_loadout.sqf
loadout_fncs/fnc_get_loadout.sqf
loadout_manager.sqf


Usage:
Usage: Some examples can be found here.
And for latest example of all these scripts working together with custom crate fillers, download the example mission.


Credits & Thanks:
eggbeast and his Evolution for extensive testing and feedback
Nimrod and sxp2high for code edit and ideas
Foxhound for constantly updating this on armaholic
Tonic's VAS for ideas
SMS for reporting issue
and of course everyone who participated anyhow


Changelog:
fnc_get_loadout.sqf
v3.4
- Added: "repetitve" option flag, will not use selectWeapon, means no visible effect on solder, but will not save magazines of assigned items such as laser designator batteries
- Added: weapons magazines are now saved using the new magazinesAmmoFull command

fnc_set_loadout.sqf
v4.3
- Added: now using addItemTo commands
- Fixed: assigned binocular/laser designator is now properly added

loadout_manager.sqf
v1.3
-


Forums Topic:
- BI Forums




Enable javascript to be able to download from Armaholic please!



Tags: Get,   Loadout,   Set