Jump to content
Sign in to follow this  
Chabbowabbo

Copy and paste/export virtual arsenal set up into playable slots init not working

Recommended Posts

Hi there,

 

It used to work fine, but having issues now. I host a server for me and my mates and I normally pick their loadouts from the arsenal/virtual armoury while in the editor and then copy and paste it into the init so that they are ready to rock when the server is live. Here is an example:

 

Quote

"comment "Exported from Arsenal by Chabbowabbo"; 
 
comment "[!] UNIT MUST BE LOCAL [!]"; 
if (!local this) exitWith {}; 
 
comment "Remove existing items"; 
removeAllWeapons this; 
removeAllItems this; 
removeAllAssignedItems this; 
removeUniform this; 
removeVest this; 
removeBackpack this; 
removeHeadgear this; 
removeGoggles this; 
 
comment "Add weapons"; 
this addWeapon "CUP_arifle_L85A2_Holo_laser"; 
this addPrimaryWeaponItem "CUP_acc_LLM"; 
this addPrimaryWeaponItem "CUP_optic_Eotech553_Black"; 
this addPrimaryWeaponItem "CUP_30Rnd_556x45_Stanag"; 
 
comment "Add containers"; 
this forceAddUniform "CUP_U_B_BAF_MTP_UBACSLONG_Gloves"; 
this addVest "CUP_V_BAF_Osprey_Mk2_DPM_Pilot"; 
 
comment "Add items to containers"; 
this addItemToUniform "ACE_fieldDressing"; 
this addItemToUniform "ACE_packingBandage"; 
this addItemToUniform "ACE_morphine"; 
this addItemToUniform "ACE_tourniquet"; 
for "_i" from 1 to 2 do {this addItemToUniform "CUP_30Rnd_556x45_Stanag";}; 
this addItemToUniform "rhs_mag_m18_green"; 
this addHeadgear "FIR_JHMCS"; 
 
comment "Add items"; 
this linkItem "ItemMap"; 
this linkItem "ItemCompass"; 
this linkItem "ItemWatch"; 
this linkItem "ItemRadio"; "

It has worked fine before - but now it seems that it has no effect and when the players load in - the lads do not have this above equipment. I note that the "unit must be local" bit seems new to me? Never noticed it before and I wonder if this is the issue? 

 

Any help would be appreciated.

 

Thank you. 🙂 

Share this post


Link to post
Share on other sites

Use code blocks ( <> )when pasting code on the forums, please!

 

Every line that starts with "comment" can be ignored - better, change the "comment" to two fore slashes ( // ) - best, removed as they are slow and unnecessary.

if (!local this) exitWith {}; 
 
removeAllWeapons this; 
removeAllItems this; 
removeAllAssignedItems this; 
removeUniform this; 
removeVest this; 
removeBackpack this; 
removeHeadgear this; 
removeGoggles this; 
 
this addWeapon "CUP_arifle_L85A2_Holo_laser"; 
this addPrimaryWeaponItem "CUP_acc_LLM"; 
this addPrimaryWeaponItem "CUP_optic_Eotech553_Black"; 
this addPrimaryWeaponItem "CUP_30Rnd_556x45_Stanag"; 
 
this forceAddUniform "CUP_U_B_BAF_MTP_UBACSLONG_Gloves"; 
this addVest "CUP_V_BAF_Osprey_Mk2_DPM_Pilot"; 
 
this addItemToUniform "ACE_fieldDressing"; 
this addItemToUniform "ACE_packingBandage"; 
this addItemToUniform "ACE_morphine"; 
this addItemToUniform "ACE_tourniquet"; 
for "_i" from 1 to 2 do {this addItemToUniform "CUP_30Rnd_556x45_Stanag";}; 
this addItemToUniform "rhs_mag_m18_green"; 
this addHeadgear "FIR_JHMCS"; 
 
this linkItem "ItemMap"; 
this linkItem "ItemCompass"; 
this linkItem "ItemWatch"; 
this linkItem "ItemRadio";

The locality check is to make sure that the unit is local to (or "owned" by) the machine running the code - this way, each player only runs the code on their own unit and not on everyone else's.

 

Aside from that, it should work, providing everyone has the correct mods loaded.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
16 hours ago, Harzach said:

Use code blocks ( <> )when pasting code on the forums, please!

 

Every line that starts with "comment" can be ignored - better, change the "comment" to two fore slashes ( // ) - best, removed as they are slow and unnecessary.


if (!local this) exitWith {}; 
 
removeAllWeapons this; 
removeAllItems this; 
removeAllAssignedItems this; 
removeUniform this; 
removeVest this; 
removeBackpack this; 
removeHeadgear this; 
removeGoggles this; 
 
this addWeapon "CUP_arifle_L85A2_Holo_laser"; 
this addPrimaryWeaponItem "CUP_acc_LLM"; 
this addPrimaryWeaponItem "CUP_optic_Eotech553_Black"; 
this addPrimaryWeaponItem "CUP_30Rnd_556x45_Stanag"; 
 
this forceAddUniform "CUP_U_B_BAF_MTP_UBACSLONG_Gloves"; 
this addVest "CUP_V_BAF_Osprey_Mk2_DPM_Pilot"; 
 
this addItemToUniform "ACE_fieldDressing"; 
this addItemToUniform "ACE_packingBandage"; 
this addItemToUniform "ACE_morphine"; 
this addItemToUniform "ACE_tourniquet"; 
for "_i" from 1 to 2 do {this addItemToUniform "CUP_30Rnd_556x45_Stanag";}; 
this addItemToUniform "rhs_mag_m18_green"; 
this addHeadgear "FIR_JHMCS"; 
 
this linkItem "ItemMap"; 
this linkItem "ItemCompass"; 
this linkItem "ItemWatch"; 
this linkItem "ItemRadio";

The locality check is to make sure that the unit is local to (or "owned" by) the machine running the code - this way, each player only runs the code on their own unit and not on everyone else's.

 

Aside from that, it should work, providing everyone has the correct mods loaded.

 

Hi thanks for the reply - I copied in the above and still didn't work. Sorry, maybe I misunderstood your comment and I need to still add in (//)? I removed the comment lines too. Its odd because about a month or two ago - I could ctrl+c an arsenal loadout into the init without having to change anything and it worked fine. I also went and followed the steps here. Doesn't work for me. https://community.bistudio.com/wiki/Arma_3:_Arsenal

 

Thanks again. 

Share this post


Link to post
Share on other sites
On 3/14/2023 at 3:32 AM, Chabbowabbo said:

while in the editor and then copy and paste it into the init

init of what the playable units?

 

Why not just have an ammobox with arsenal and then have your mates have saved loadouts

and then when they get ingame, just load up arsenal and they can choose their loadouts

that they had setup previously.

   Any loadout you save in arsenal as you know can be chosen from arsenal from any mission, imo your almost doing extra work

to just setup their loadouts when it would take them less then a minute to get their already built loadouts from arsenal.

 

And use this code in an ammo box's init if your interested in such functions:

["AmmoboxInit", [this, true]] spawn BIS_fnc_arsenal;

  • Thanks 1

Share this post


Link to post
Share on other sites
39 minutes ago, Gunter Severloh said:

init of what the playable units?

 

Why not just have an ammobox with arsenal and then have your mates have saved loadouts

and then when they get ingame, just load up arsenal and they can choose their loadouts

that they had setup previously.

   Any loadout you save in arsenal as you know can be chosen from arsenal from any mission, imo your almost doing extra work

to just setup their loadouts when it would take them less then a minute to get their already built loadouts from arsenal.

 

And use this code in an ammo box's init if your interested in such functions:

["AmmoboxInit", [this, true]] spawn BIS_fnc_arsenal;

 

Hi thanks for the reply.

 

Yes we have the ammo box with arsenal already, but we all want to avoid having to go over to use it and save time by spawning in with our chosen loadout. We all work and every minute we can save - the better. Sometimes the arsenal takes one particular player a while to load up too. 

 

Thanks again. 

Share this post


Link to post
Share on other sites

I know I'm late to this but this also works. This in the description.ext

[east, "east1"] call BIS_fnc_addRespawnInventory;
[east, "east2"] call BIS_fnc_addRespawnInventory;
[west, "west1"] call BIS_fnc_addRespawnInventory;
[west, "west2"] call BIS_fnc_addRespawnInventory;
[resistance, "resistance1"] call BIS_fnc_addRespawnInventory;
[resistance, "resistance2"] call BIS_fnc_addRespawnInventory;

Then in init.sqf

respawnTemplateseast[] = {"MenuInventory","MenuPosition"};
respawnTemplateswest[] = {"MenuInventory","MenuPosition"};
#include "loadout.cpp"

Then the format of the loadouts is like this and they are selectable from the spawn screen. You put this stuff in the loadout.cpp file

 

class CfgRespawnInventory
{

class east1
{
displayName = "Rebel Rifleman"; // Name visible in the menu
role = "east1";
// Loadout definition, uses same entries as CfgVehicles classes
uniformClass = "U_BG_Guerilla2_1";
backpack = "B_FieldPack_taiga_F";
weapons[] = {"uns_ak47","CUP_hgun_Deagle","uns_binocular_army","Throw","Put"};
magazines[] = {"uns_ak47mag","CUP_7Rnd_50AE_Deagle","uns_ak47mag_NT","uns_ak47mag_NT","uns_ak47mag_NT","uns_ak47mag_NT","uns_ak47mag_NT","uns_mk2gren","uns_mk2gren","CUP_7Rnd_50AE_Deagle","uns_ak47mag_NT","uns_ak47mag_NT","uns_ak47mag_NT","uns_leaflet12","uns_item_condoms"};
items[] = {"FirstAidKit","UNS_TrapKit","ToolKit","FirstAidKit","FirstAidKit","FirstAidKit"};
linkedItems[] = {"CUP_V_OI_TKI_Jacket5_01","CUP_H_USArmy_Helmet_M1_plain_M81","CUP_G_Oakleys_Drk","ItemMap","ItemCompass","ItemWatch"};

};

class east2
{
displayName = "Rebel Sapper Miner";
role = "east2";
uniformClass = "U_BG_Guerilla1_2_F";
backpack = "CUP_B_Kombat_Olive";
weapons[] = {"uns_ithaca37_grip","uns_binocular_army","Throw","Put"};
magazines[] = {"uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","uns_12gaugemag_4","ATMine_Range_Mag","ATMine_Range_Mag","ATMine_Range_Mag","uns_12gaugemag_4"};
items[] = {"UNS_TrapKit","FirstAidKit","FirstAidKit","ToolKit"};
linkedItems[] = {"muzzle_snds_B",
"optic_KHS_old",
"bipod_01_F_blk","V_Chestrig_khk","CUP_H_USArmy_Helmet_M1_plain_M81","CUP_G_Oakleys_Drk","ItemMap","ItemC};

};


class west1
{
displayName = "Government Rifleman";
role = "west1";
weapons[] = {
"LIB_M1_Garand"
};
magazines[] = {
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_8Rnd_762x63",
"LIB_US_Mk_2",
"LIB_US_Mk_2",
"LIB_TM44_MINE_mag",
"SatchelCharge_Remote_Mag"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"V_LIB_US_Vest_Carbine",
"H_LIB_US_Helmet_Net",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
uniformClass = "U_LIB_US_NAC_Uniform";
backpack = "B_LIB_USA_Backpack_Vide";
};

class west2
{
displayName = "MachineGunner";
role = "west2";
weapons[] = {
"LIB_M1919A6"
};
magazines[] = {
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_50Rnd_762x63",
"LIB_US_Mk_2",
"LIB_US_Mk_2"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"V_LIB_US_Vest_Carbine_eng",
"H_LIB_US_Helmet_Net",
"ItemMap",
"ItemCompass",
"ItemWatch"
};
uniformClass = "U_LIB_US_NAC_Uniform";
backpack = "B_LIB_USA_Backpack_Vide";
};
};

You get them out in sqf format with CONTROL SHIFT C. Still if you have a different sight on the gun you have to add it in linked items manually. The first two are done with control shift C. Pain in the butt to copy them out and get them right the other way, which is how that second ones were done. Want them in another battle just copy those 3 files over to the new mission.

 

https://steamcommunity.com/sharedfiles/filedetails/?id=1986342104

 

 

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  

×