diff --git a/components/gearScript/crateSupport/fn_addBackpacksToCrate.sqf b/components/gearScript/crateSupport/fn_addBackpacksToCrate.sqf index 294cdf5..bbcc200 100644 --- a/components/gearScript/crateSupport/fn_addBackpacksToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addBackpacksToCrate.sqf @@ -16,8 +16,13 @@ if (_loadoutVariants isEqualTo []) exitWith DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: the loadout doesn't exist.",_loadout,_crateName,_side) }; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addLauncherAmmoToCrate.sqf b/components/gearScript/crateSupport/fn_addLauncherAmmoToCrate.sqf index b371c5c..5fb1188 100644 --- a/components/gearScript/crateSupport/fn_addLauncherAmmoToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addLauncherAmmoToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addLauncherToCrate.sqf b/components/gearScript/crateSupport/fn_addLauncherToCrate.sqf index d327055..f432f3b 100644 --- a/components/gearScript/crateSupport/fn_addLauncherToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addLauncherToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addPistolAmmoToCrate.sqf b/components/gearScript/crateSupport/fn_addPistolAmmoToCrate.sqf index 34cb3fd..1552fa9 100644 --- a/components/gearScript/crateSupport/fn_addPistolAmmoToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addPistolAmmoToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addPistolToCrate.sqf b/components/gearScript/crateSupport/fn_addPistolToCrate.sqf index 7ae6f98..29baf81 100644 --- a/components/gearScript/crateSupport/fn_addPistolToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addPistolToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addRifleAmmoToCrate.sqf b/components/gearScript/crateSupport/fn_addRifleAmmoToCrate.sqf index 465e2b0..df60953 100644 --- a/components/gearScript/crateSupport/fn_addRifleAmmoToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addRifleAmmoToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addRifleGrenadesToCrate.sqf b/components/gearScript/crateSupport/fn_addRifleGrenadesToCrate.sqf index 1287dfc..5435673 100644 --- a/components/gearScript/crateSupport/fn_addRifleGrenadesToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addRifleGrenadesToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/crateSupport/fn_addRifleToCrate.sqf b/components/gearScript/crateSupport/fn_addRifleToCrate.sqf index 3f0e175..a3a2c1b 100644 --- a/components/gearScript/crateSupport/fn_addRifleToCrate.sqf +++ b/components/gearScript/crateSupport/fn_addRifleToCrate.sqf @@ -17,7 +17,13 @@ if (_loadoutVariants isEqualTo []) exitWith }; -_baseVariant = [_loadoutVariants # 0] call f_fnc_normaliseCbaExtendedLoadout; +_baseVariant = _loadoutVariants # 0; +if !(_basevariant isEqualType []) exitWith +{ + DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Unable to add item from loadout '%1' into crate %2 for side %3: only arsenal gearscripts are supported.",_loadout,_crateName,_side) +}; + +_baseVariant = [_baseVariant] call f_fnc_normaliseCbaExtendedLoadout; _baseVariant = _baseVariant # 0; if !(typeName _baseVariant == "ARRAY" and {count _baseVariant > 0 and {typeName (_baseVariant select 0) == "ARRAY"}}) exitWith diff --git a/components/gearScript/fn_addGogglesEventHandler.sqf b/components/gearScript/fn_addGogglesEventHandler.sqf index 8509999..263d29b 100644 --- a/components/gearScript/fn_addGogglesEventHandler.sqf +++ b/components/gearScript/fn_addGogglesEventHandler.sqf @@ -26,6 +26,8 @@ if (hasInterface) then f_var_firstPlayerLoadout = true; + if !(_loadout isEqualType []) exitWith {}; + if ((_unit isEqualTo player) and {!isNil 'f_var_playerGoggles'}) then { _loadout set [7, f_var_playerGoggles]; diff --git a/components/gearScript/fn_applyLoadout.sqf b/components/gearScript/fn_applyLoadout.sqf index 04b81d6..773c1c4 100644 --- a/components/gearScript/fn_applyLoadout.sqf +++ b/components/gearScript/fn_applyLoadout.sqf @@ -72,46 +72,62 @@ if (_loadoutVariants isEqualTo []) exitWith }; -private _originalLoadout = +(selectRandom _loadoutVariants); -_originalLoadout = [_originalLoadout] call f_fnc_normaliseCbaExtendedLoadout; +private _loadout = selectRandom _loadoutVariants; +private _extendedArray = []; -private _loadout = _originalLoadout#0; -private _extendedArray = _originalLoadout#1; +if !(_loadout isEqualTypeAny [[], ""]) exitWith +{ + private _loadoutType = typeName _loadout; + DEBUG_FORMAT1_LOG("[GEARSCRIPT-2]: Unsupported type of gearscript (found %1, expected ARRAY or STRING).",_loadoutType) +}; +if ((_loadout isEqualType "") and (isPlayer _unit)) exitWith +{ + DEBUG_PRINT_LOG("[GEARSCRIPT-2]: Unit-classname gearscripts are not supported for players.") +}; -if (count HATS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then +if (_loadout isEqualType []) then { - private _hat = selectRandom HATS_DYNAMIC(_gearVariant,_typeofUnit); - DEBUG_FORMAT1_LOG("Selected variant hat: %1",_hat) + private _originalLoadout = +_loadout; + _originalLoadout = [_originalLoadout] call f_fnc_normaliseCbaExtendedLoadout; - _loadout set [6, _hat]; -}; + _extendedArray = _originalLoadout#1; -if (count VESTS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then -{ - private _vest = selectRandom VESTS_DYNAMIC(_gearVariant,_typeofUnit); - DEBUG_FORMAT1_LOG("Selected variant vest: %1",_vest) + if (count HATS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then + { + private _hat = selectRandom HATS_DYNAMIC(_gearVariant,_typeofUnit); + DEBUG_FORMAT1_LOG("Selected variant hat: %1",_hat) - _loadout select 4 set [0, _vest]; -}; + _loadout set [6, _hat]; + }; -if (count UNIFORMS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then -{ - private _uniform = selectRandom UNIFORMS_DYNAMIC(_gearVariant,_typeofUnit); - DEBUG_FORMAT1_LOG("Selected variant uniform: %1",_uniform) + if (count VESTS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then + { + private _vest = selectRandom VESTS_DYNAMIC(_gearVariant,_typeofUnit); + DEBUG_FORMAT1_LOG("Selected variant vest: %1",_vest) - _loadout select 3 set [0, _uniform]; -}; + _loadout select 4 set [0, _vest]; + }; -if (count BACKPACKS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then -{ - private _backpack = selectRandom BACKPACKS_DYNAMIC(_gearVariant,_typeofUnit); - DEBUG_FORMAT1_LOG("Selected variant backpack: %1",_backpack) + if (count UNIFORMS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then + { + private _uniform = selectRandom UNIFORMS_DYNAMIC(_gearVariant,_typeofUnit); + DEBUG_FORMAT1_LOG("Selected variant uniform: %1",_uniform) + + _loadout select 3 set [0, _uniform]; + }; + - _loadout select 5 set [0, _backpack]; + if (count BACKPACKS_DYNAMIC(_gearVariant,_typeofUnit) > 0) then + { + private _backpack = selectRandom BACKPACKS_DYNAMIC(_gearVariant,_typeofUnit); + DEBUG_FORMAT1_LOG("Selected variant backpack: %1",_backpack) + + _loadout select 5 set [0, _backpack]; + }; }; ["CA_PreGearscriptUnit_Local", [_typeOfUnit, _unit, _faction, _loadout, _extendedArray]] call CBA_fnc_localEvent; diff --git a/components/gearScript/fn_removeItemFromLoadout.sqf b/components/gearScript/fn_removeItemFromLoadout.sqf index 010c2d9..0dcbc3d 100644 --- a/components/gearScript/fn_removeItemFromLoadout.sqf +++ b/components/gearScript/fn_removeItemFromLoadout.sqf @@ -41,6 +41,8 @@ private _removeItem = }; { + if !(_x isEqualType []) then {continue}; + private _cbaLoadout = [_x] call f_fnc_normaliseCbaExtendedLoadout; private _loadout = _cbaLoadout#0; diff --git a/components/gearScript/fn_removeLinkedItemFromLoadout.sqf b/components/gearScript/fn_removeLinkedItemFromLoadout.sqf index 8b740b8..9bdc6d6 100644 --- a/components/gearScript/fn_removeLinkedItemFromLoadout.sqf +++ b/components/gearScript/fn_removeLinkedItemFromLoadout.sqf @@ -14,7 +14,9 @@ if (_loadoutVariants isEqualTo []) exitWith DEBUG_FORMAT3_LOG("[GEARSCRIPT-2]: Removing linked item #%1 from loadout '%2' for side '%3'.",_itemIndex,_unitType,_faction) -{ +{ + if !(_x isEqualType []) then {continue}; + private _cbaLoadout = [_x] call f_fnc_normaliseCbaExtendedLoadout; private _loadout = _cbaLoadout#0; diff --git a/components/radio/acre/fn_acre_removeRadiosFromLoadout.sqf b/components/radio/acre/fn_acre_removeRadiosFromLoadout.sqf index aba47b3..a1c5d28 100644 --- a/components/radio/acre/fn_acre_removeRadiosFromLoadout.sqf +++ b/components/radio/acre/fn_acre_removeRadiosFromLoadout.sqf @@ -4,6 +4,8 @@ params ["_loadout"]; +if !(_loadout isEqualType []) exitWith {}; + private _filterOutRadios = { if (_this isEqualTo []) exitWith {}; diff --git a/components/radio/acre/fn_acre_replaceUnitRadios.sqf b/components/radio/acre/fn_acre_replaceUnitRadios.sqf index 56840f5..bb9f1e0 100644 --- a/components/radio/acre/fn_acre_replaceUnitRadios.sqf +++ b/components/radio/acre/fn_acre_replaceUnitRadios.sqf @@ -6,6 +6,8 @@ params ["_typeOfUnit", "_unit", "_faction", "_loadout", "_extendedArray"]; +if !(_loadout isEqualType []) exitWith {}; + [_loadout] call f_fnc_acre_removeRadiosFromLoadout; private _groupName = groupId group _unit; diff --git a/components/radio/common/fn_configureUnitRadios.sqf b/components/radio/common/fn_configureUnitRadios.sqf index d11ba59..45a0aec 100644 --- a/components/radio/common/fn_configureUnitRadios.sqf +++ b/components/radio/common/fn_configureUnitRadios.sqf @@ -5,6 +5,8 @@ params [["_typeOfUnit", ""], "_unit", "_faction", "_loadout", "_extendedArray"]; +if !(_loadout isEqualType []) exitWith {}; + LOCAL_ONLY(_unit); if (_typeOfUnit isEqualTo "") then diff --git a/components/radio/common/fn_replaceUnitRadios.sqf b/components/radio/common/fn_replaceUnitRadios.sqf index d66c522..0c7d64b 100644 --- a/components/radio/common/fn_replaceUnitRadios.sqf +++ b/components/radio/common/fn_replaceUnitRadios.sqf @@ -3,6 +3,8 @@ params ["_typeOfUnit", "_unit", "_faction", "_loadout", "_extendedArray"]; +if !(_loadout isEqualType []) exitWith {}; + if (["acre_sys_radio"] call ace_common_fnc_isModLoaded) then { _this call f_fnc_acre_replaceUnitRadios; diff --git a/configuration/loadouts/gear_blufor.sqf b/configuration/loadouts/gear_blufor.sqf index 84326f7..705607d 100644 --- a/configuration/loadouts/gear_blufor.sqf +++ b/configuration/loadouts/gear_blufor.sqf @@ -15,7 +15,7 @@ BEGIN_LOADOUTS; Available commands FOR UNIT LOADOUTS: - CREATE_LOADOUT(UNIT_NAME,); + CREATE_LOADOUT(UNIT_NAME, OR ); COPY_LOADOUT(TO,FROM); ADD_HAT(UNIT_NAME,"Hat Classname"); @@ -32,7 +32,7 @@ BEGIN_LOADOUTS; CLEAR_ADDONS(UNIT_NAME); - ADD_VARIANT(UNIT_NAME,); + ADD_VARIANT(UNIT_NAME, OR ); ------------------------------------------------- diff --git a/configuration/loadouts/gear_civilian.sqf b/configuration/loadouts/gear_civilian.sqf index 01b0b89..b2394d5 100644 --- a/configuration/loadouts/gear_civilian.sqf +++ b/configuration/loadouts/gear_civilian.sqf @@ -15,7 +15,7 @@ BEGIN_LOADOUTS; Available commands FOR UNIT LOADOUTS: - CREATE_LOADOUT(UNIT_NAME,); + CREATE_LOADOUT(UNIT_NAME, OR ); COPY_LOADOUT(TO,FROM); ADD_HAT(UNIT_NAME,"Hat Classname"); @@ -32,7 +32,7 @@ BEGIN_LOADOUTS; CLEAR_ADDONS(UNIT_NAME); - ADD_VARIANT(UNIT_NAME,); + ADD_VARIANT(UNIT_NAME, OR ); ------------------------------------------------- diff --git a/configuration/loadouts/gear_guerrilla.sqf b/configuration/loadouts/gear_guerrilla.sqf index 7adea6b..d4e0551 100644 --- a/configuration/loadouts/gear_guerrilla.sqf +++ b/configuration/loadouts/gear_guerrilla.sqf @@ -17,7 +17,7 @@ BEGIN_LOADOUTS; Available commands FOR UNIT LOADOUTS: - CREATE_LOADOUT(UNIT_NAME,); + CREATE_LOADOUT(UNIT_NAME, OR ); COPY_LOADOUT(TO,FROM); ADD_HAT(UNIT_NAME,"Hat Classname"); @@ -34,7 +34,7 @@ BEGIN_LOADOUTS; CLEAR_ADDONS(UNIT_NAME); - ADD_VARIANT(UNIT_NAME,); + ADD_VARIANT(UNIT_NAME, OR ); ------------------------------------------------- diff --git a/configuration/loadouts/gear_indfor.sqf b/configuration/loadouts/gear_indfor.sqf index 012d4cd..3fd866b 100644 --- a/configuration/loadouts/gear_indfor.sqf +++ b/configuration/loadouts/gear_indfor.sqf @@ -15,7 +15,7 @@ BEGIN_LOADOUTS; Available commands FOR UNIT LOADOUTS: - CREATE_LOADOUT(UNIT_NAME,); + CREATE_LOADOUT(UNIT_NAME, OR ); COPY_LOADOUT(TO,FROM); ADD_HAT(UNIT_NAME,"Hat Classname"); @@ -32,7 +32,7 @@ BEGIN_LOADOUTS; CLEAR_ADDONS(UNIT_NAME); - ADD_VARIANT(UNIT_NAME,); + ADD_VARIANT(UNIT_NAME, OR ); ------------------------------------------------- diff --git a/configuration/loadouts/gear_opfor.sqf b/configuration/loadouts/gear_opfor.sqf index 914a8bf..284070b 100644 --- a/configuration/loadouts/gear_opfor.sqf +++ b/configuration/loadouts/gear_opfor.sqf @@ -15,7 +15,7 @@ BEGIN_LOADOUTS; Available commands FOR UNIT LOADOUTS: - CREATE_LOADOUT(UNIT_NAME,); + CREATE_LOADOUT(UNIT_NAME, OR ); COPY_LOADOUT(TO,FROM); ADD_HAT(UNIT_NAME,"Hat Classname"); @@ -32,7 +32,7 @@ BEGIN_LOADOUTS; CLEAR_ADDONS(UNIT_NAME); - ADD_VARIANT(UNIT_NAME,); + ADD_VARIANT(UNIT_NAME, OR ); ------------------------------------------------- diff --git a/configuration/loadouts/gearscript_readme.txt b/configuration/loadouts/gearscript_readme.txt index 3777007..e6cbeb5 100644 --- a/configuration/loadouts/gearscript_readme.txt +++ b/configuration/loadouts/gearscript_readme.txt @@ -13,6 +13,11 @@ Available commands FOR UNIT LOADOUTS: CREATE_LOADOUT(UNIT_NAME,); - Assigns the ACE Arsenal loadout to the unit. For example, you can create a Rifleman loadout and assign it to the unit-name "rif". The rif class will now be available at Loadout Lockers in-game. +- Also supports unit class-names. You can get these from the editor by using "copy class name" from the right-click menu. + This is only supported for NPCs and will not work upon players! +- For example: + CREATE_LOADOUT(med,"O_medic_F"); + Any non-player medic will now look like a CSAT medic. COPY_LOADOUT(TO,FROM); - Copies a loadout from one unit-type to another unit-type. Useful if you want to give the same loadout to FTLs and SLs, etc. @@ -63,7 +68,7 @@ CLEAR_BACKPACKS(UNIT_NAME); CLEAR_ADDONS(UNIT_NAME); - Empties all of the "random lists" for the unit type at the same time. Just like using all of the CLEAR_* commands at once. -ADD_VARIANT(UNIT_NAME,); +ADD_VARIANT(UNIT_NAME, OR ); - Advanced feature. Adds alternative loadouts to the unit-type. The loadout will now be randomly chosen between the two. You must create the first loadout using the CREATE_LOADOUT command before using this command. Randomisation options apply across all variant loadouts. @@ -73,6 +78,12 @@ ADD_VARIANT(UNIT_NAME,); Use ACE Arsenal to create a different Rifleman loadout with an M-16 rifle. ADD_VARIANT(rif,); All riflemen will now randomly have an AK-47 or M-16 rifle. +- Also supports unit class-names. You can get these from the editor by using "copy class name" from the right-click menu. + This is only supported for NPCs and will not work upon players! +- For example: + ADD_VARIANT(med,"O_medic_F"); + Any non-player medic will now look like a CSAT medic. + PUT_GUN_IN_GUNBAG(UNIT_NAME,) - Allows the backpack of the given unit to be turned into an ACE gunbag, with the given contents placed inside.