Jump to content
Sign in to follow this  
max1944

Adding custom loadouts

Recommended Posts

Hello

I found a quite comfortable way to add custom loadouts, but I would like to know if there is a better way.

1) With the "Virtual Arsenal" a soldier can be created with custom weapons, uniform, vest, face, voice. With Export the data will be copied to the clipboard (right click & paste into a text file).

Here is a example: I made a CTRG "James" with a silenced black MX rifle and silenced 4-five

comment "Exported from Arsenal by";

comment "Remove existing items";
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;

comment "Add containers";
this forceAddUniform "U_B_CTRG_3";
this addItemToUniform "FirstAidKit";
for "_i" from 1 to 2 do {this addItemToUniform "MiniGrenade";};
for "_i" from 1 to 2 do {this addItemToUniform "Chemlight_green";};
for "_i" from 1 to 2 do {this addItemToUniform "11Rnd_45ACP_Mag";};
this addVest "V_PlateCarrierH_CTRG";
for "_i" from 1 to 5 do {this addItemToVest "30Rnd_65x39_caseless_mag";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addBackpack "B_AssaultPack_rgr";
this addItemToBackpack "Medikit";
for "_i" from 1 to 10 do {this addItemToBackpack "FirstAidKit";};
this addHeadgear "H_Watchcap_blk";
this addGoggles "G_Tactical_Clear";

comment "Add weapons";
this addWeapon "arifle_MX_Black_F";
this addPrimaryWeaponItem "muzzle_snds_H";
this addPrimaryWeaponItem "acc_pointer_IR";
this addPrimaryWeaponItem "optic_Hamr";
this addWeapon "hgun_Pistol_heavy_01_F";
this addHandgunItem "muzzle_snds_acp";
this addHandgunItem "optic_MRD";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this linkItem "ItemGPS";

comment "Set identity";
this setFace "WhiteHead_01";
this setSpeaker "Male01ENGB";



2) Now all the lines with "comment" can be erased and the term "this" has to be exchanged with "player" (for the player) or the unit name given in the editor.

example: unit name = BIS_ctrgJames

// James loadout
removeAllWeapons BIS_ctrgJames;
removeAllItems BIS_ctrgJames;
removeAllAssignedItems BIS_ctrgJames;
removeUniform BIS_ctrgJames;
removeVest BIS_ctrgJames;
removeBackpack BIS_ctrgJames;
removeHeadgear BIS_ctrgJames;
removeGoggles BIS_ctrgJames;
BIS_ctrgJames forceAddUniform "U_B_CTRG_3";
BIS_ctrgJames addItemToUniform "FirstAidKit";
for "_i" from 1 to 2 do {BIS_ctrgJames addItemToUniform "MiniGrenade";};
for "_i" from 1 to 2 do {BIS_ctrgJames addItemToUniform "Chemlight_green";};
for "_i" from 1 to 2 do {BIS_ctrgJames addItemToUniform "11Rnd_45ACP_Mag";};
BIS_ctrgJames addVest "V_PlateCarrierH_CTRG";
for "_i" from 1 to 6 do {BIS_ctrgJames addItemToVest "30Rnd_65x39_caseless_mag";};
for "_i" from 1 to 2 do {BIS_ctrgJames addItemToVest "SmokeShell";};
for "_i" from 1 to 2 do {BIS_ctrgJames addItemToVest "HandGrenade";};
BIS_ctrgJames addBackpack "B_AssaultPack_rgr";
BIS_ctrgJames addItemToBackpack "Medikit";
for "_i" from 1 to 10 do {BIS_ctrgJames addItemToBackpack "FirstAidKit";};
BIS_ctrgJames addHeadgear "H_Watchcap_blk";
BIS_ctrgJames addGoggles "G_Tactical_Clear";
BIS_ctrgJames addWeapon "arifle_MX_Black_F";
BIS_ctrgJames addPrimaryWeaponItem "muzzle_snds_H";
BIS_ctrgJames addPrimaryWeaponItem "acc_pointer_IR";
BIS_ctrgJames addPrimaryWeaponItem "optic_Hamr";
BIS_ctrgJames addItemToVest "30Rnd_65x39_caseless_mag";
BIS_ctrgJames addWeapon "hgun_Pistol_heavy_01_F";
BIS_ctrgJames addHandgunItem "muzzle_snds_acp";
BIS_ctrgJames addHandgunItem "optic_MRD";
BIS_ctrgJames addItemToUniform "11Rnd_45ACP_Mag";
BIS_ctrgJames linkItem "ItemMap";
BIS_ctrgJames linkItem "ItemCompass";
BIS_ctrgJames linkItem "ItemWatch";
BIS_ctrgJames linkItem "ItemRadio";
BIS_ctrgJames linkItem "ItemGPS";
BIS_ctrgJames setFace "WhiteHead_01";
BIS_ctrgJames setSpeaker "Male01ENGB";



All items and magazines are properly sorted to the uniform, vest and backpack (I love it).

3) This can be added into the "initMission.hpp"

By default the initMission.hpp is located within C:\Users\yourUserName\Documents\Arma 3\missions\yourMapName.Stratis or .Altis

Done

If there is no initMission.hpp

1) create a .txt file and rename it to init.sqf
2) open the init.sqf with a editor like Notepad++ and add #include "initMission.hpp"
3) create a .txt file and rename it to initMission.hpp

Add both files within C:\Users\yourUserName\Documents\Arma 3\missions\yourMapName.Stratis or .Altis

Edited by max1944

Share this post


Link to post
Share on other sites

While this does work quite well since you get to actually see what the loadout is and it adds it properly, it can be quite static if you just leave it as that. What I like to do is define some alternative loadouts, put them in a script with two arguments, the player and the type (type being like rifleman, medic etc.) and then in a switch statement load the loadout for the correct type.

Share this post


Link to post
Share on other sites

Could my described method lead to performance issues? I would guess there is a reason the loadout is handled mostly within the description.ext

Share this post


Link to post
Share on other sites
Could my described method lead to performance issues? I would guess there is a reason the loadout is handled mostly within the description.ext

No it should be fine for performance. Besides is there even another way of adding a weapon/magazines? If it works for you and it doesn't lag your mission out at the start then it's fine!

Share this post


Link to post
Share on other sites

I like this method too so I can see what the unit will look like beforehand without having to just "imagine it" but I've discovered when you use it in the editor you lose 1 magazine for each gun, I'm guessing because it has to load it in the gun, so I always have to add an extra primary and secondary magazine manually after I export it. The VR must give you a "free" loaded magazine in each gun when you use the TRY function of the VR.

Share this post


Link to post
Share on other sites

Yes Mynock, one magazine will go into the weapon.

To solve this you can simply copy the line with the magazine and paste it below the weapon. Change it to "1 to 1" or remove the {} brackets and everything outside of it. With that one magazine will be added after the weapon is loaded.

example:

BIS_ctrgJames addWeapon "hgun_Pistol_heavy_01_F";
for "_i" from 1 to 1 do {BIS_ctrgJames addItemToUniform "11Rnd_45ACP_Mag";};

or

BIS_ctrgJames addWeapon "hgun_Pistol_heavy_01_F";
BIS_ctrgJames addItemToUniform "11Rnd_45ACP_Mag";

Things on top of the list will be done first. Because of that clothes and gear should be on top, then magazines (if there is no vest/uniform, magazines can't be added).

Besides is there even another way of adding a weapon/magazines?

I know three methods.

1) with the description.ext

2) within the initMission.hpp

3) directly in the editor if you double-click a unit and add something to the "INITIALIZATION:" window.

Edited by max1944

Share this post


Link to post
Share on other sites
Yes Mynock, one magazine will go into the weapon.

To solve this you can simply copy the line with the magazine and paste it below the weapon. Change it to "1 to 1". With that one magazine will be added after the weapon is loaded.

example:

BIS_ctrgJames addWeapon "hgun_Pistol_heavy_01_F";
for "_i" from 1 to 1 do {BIS_ctrgJames addItemToUniform "11Rnd_45ACP_Mag";};

Things on top of the list will be done first. Because of that clothes and gear should be on top, then magazines (if there is no vest, magazines can't be added).

I know three methods.

1) with the description.ext

2) within the initMission.hpp

3) directly in the editor if you double-click a unit and add something to the "INITIALIZATION:" window.

Yeah I know of those methods I mean the functions, since the functions for adding weapons and magazines is what would make it slow after all.

Share this post


Link to post
Share on other sites
Yeah I know of those methods I mean the functions, since the functions for adding weapons and magazines is what would make it slow after all.

Exporting the data thru the virtual arsenal is the only way I know to automatically add functions. With everything else I had to search the cfg's and add them myself.

Edited by max1944

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×