Custom Loadout
Loadout.sqf is a script that modifies a unit's loadout. Go into your scripts folder if you are using the complex template and open up ammo.sqf with notepad++
DO NOT DELETE
_unit = _this select 0;
This line defines the unit
removeallweapons _unit;
removebackpack _unit;
These lines remove all items from the unit
_unit = _this select 0;
This line defines the unit
removeallweapons _unit;
removebackpack _unit;
These lines remove all items from the unit
Removebackpack _unit is for Operation Arrowhead. If you are editing for ARMA 2 standalone, you don't need it.
Now modify this
_unit addbackpack "X";
X = classname of backpack
_unit addbackpack "X";
X = classname of backpack
_unit addbackpack "x" is for Operation Arrowhead. If you are editing for ARMA 2 standalone, you don't need it.
If you need backpack classnames, refer to this post.
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1667574&viewfull=1#post1667574
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1667574&viewfull=1#post1667574
Now let's start adding items into our backpack.
(unitBackpack _unit) addmagazineCargo ["X",#];
(unitBackpack _unit) addweaponCargo ["X",#];
X = classname of weapon, magazine, item
# = amount of that item available in the backpack (depending on how much space backpack has)
Use (unitBackpack _unit) addmagazineCargo ["X",#]; for ammo, explosives, grenades, satchels, etc
Use (unitBackpack _unit) addweaponCargo ["X",#]; for weapons
(unitBackpack _unit) addmagazineCargo ["X",#];
(unitBackpack _unit) addweaponCargo ["X",#];
X = classname of weapon, magazine, item
# = amount of that item available in the backpack (depending on how much space backpack has)
Use (unitBackpack _unit) addmagazineCargo ["X",#]; for ammo, explosives, grenades, satchels, etc
Use (unitBackpack _unit) addweaponCargo ["X",#]; for weapons
(unitBackpack _unit) addmagazineCargo ["X",#] and (unitBackpack _unit) addweaponCargo ["X",#] is for Operation Arrowhead. If you are editing for ARMA 2 standalone, you don't need it.
Now it's time to edit your personal loadout and what you'll be carrying as your weapon and store in your vest pouch.
_unit addmagazines "X";
_unit addweapon "X";
X = classname of weapon, magazine, item, attachment
NOTE: When adding weapon magazines and weapon. The magazines should always go first before the weapon or else your character will have to manually reload on the beginning of the mission because the magazine won't be loaded in the gun.
Use _unit addmagazine "X"; to add magazines, grenades, explosive charges, etc to your inventory. Each addmagazine adds 1 magazine so copy and paste it over and over until you get the desired amount of magazines/ammo you like.
Use _unit addweapon "X"; to select your weapon of choice (or item of choice, GPS, binoculars, NVGoggles, etc)
If you need classnames of weaponries and ammos, refer to these sites.
http://browser.six-projects.net/cfg_weapons/classlist
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1292940&viewfull=1#post1292940
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1663809&viewfull=1#post1663809
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1732933&viewfull=1#post1732933
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1732933&viewfull=1#post1732933
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=2257304&viewfull=1#post2257304
_unit addmagazines "X";
_unit addweapon "X";
X = classname of weapon, magazine, item, attachment
NOTE: When adding weapon magazines and weapon. The magazines should always go first before the weapon or else your character will have to manually reload on the beginning of the mission because the magazine won't be loaded in the gun.
Use _unit addmagazine "X"; to add magazines, grenades, explosive charges, etc to your inventory. Each addmagazine adds 1 magazine so copy and paste it over and over until you get the desired amount of magazines/ammo you like.
Use _unit addweapon "X"; to select your weapon of choice (or item of choice, GPS, binoculars, NVGoggles, etc)
If you need classnames of weaponries and ammos, refer to these sites.
http://browser.six-projects.net/cfg_weapons/classlist
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1292940&viewfull=1#post1292940
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1663809&viewfull=1#post1663809
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1732933&viewfull=1#post1732933
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=1732933&viewfull=1#post1732933
http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!&p=2257304&viewfull=1#post2257304
Save after you are done. You can always make a duplicate and call it something like loadout2.sqf.
Now go inside the mission editor, find your unit or whatever soldier you want to modify their loadout with, and add the following line in their init
[this] call compile preprocessFileLineNumbers "scripts\loadout.sqf";
If your loadout.sqf is in the same folder as your mission.sqm instead of inside the scripts folder, then just put in [this] call compile preprocessFileLineNumbers "loadout.sqf";
Now go inside the mission editor, find your unit or whatever soldier you want to modify their loadout with, and add the following line in their init
[this] call compile preprocessFileLineNumbers "scripts\loadout.sqf";
If your loadout.sqf is in the same folder as your mission.sqm instead of inside the scripts folder, then just put in [this] call compile preprocessFileLineNumbers "loadout.sqf";