Jump to content
Sign in to follow this  
ZeeSquared

Adding a BAF backpack to an ammo crate ...

Recommended Posts

Hi, all!

We run Domination on our server. It uses Xeno's x_weaponcargo.sqf script for generating weapons & ammo in the Domination ammo crate. Here's a code snippet:

x_weaponcargo.sqf

// by Xeno
#include "x_setup.sqf"
private "_vec";

#define __awc(wtype,wcount) _vec addWeaponCargo [#wtype,wcount];
#define __amc(mtype,mcount) _vec addMagazineCargo [#mtype,mcount];

_vec = _this select 0;
clearMagazineCargo _vec;
clearWeaponCargo _vec;

// BIS_BAF added.
if (d_player_faction in ["USMC", "CDF", "BIS_BAF"]) then {
__awc(M9,100)
__awc(M9SD,100)
__awc(Colt1911,100)
__awc(revolver_EP1,100)			// Revovler
__awc(M16A2,100)
__awc(M16A2GL,100)
__awc(M16A4,100)
__awc(M16A4_GL,100)
__awc(M16A4_ACG,100)
__awc(M16A4_ACG_GL,100)
__awc(M4A1,100)
__awc(M4A1_HWS_GL,100)
__awc(M4A1_HWS_GL_camo,100)
__awc(M4A1_HWS_GL_SD_Camo,100)
__awc(M4A1_RCO_GL,100)
__awc(M4A1_Aim,100)
__awc(M4A1_Aim_camo,100)
__awc(M4A1_AIM_SD_camo,100)

__awc(G36a,100)
__awc(G36c,100)
__awc(G36_C_SD_eotech,100)
__awc(G36k,100)

__awc(M1014,100)
// __awc(MP5A5,100)
// __awc(MP5SD,100)

// __awc(M8_carbine,100)
// __awc(M8_carbineGL,100)
// __awc(M8_compact,100)

__awc(MG36,100)
__awc(Mk_48,100)
__awc(M240,100)
__awc(M249,100)
// __awc(M8_SAW,100)

__awc(M24,100)
__awc(DMR,100)
__awc(M107,100)
__awc(M40A3,100)
__awc(M4SPR,100)
// __awc(M8_sharpshooter,100)
__awc(M110_TWS_EP1,100)			// M110 TWS
__awc(SCAR_H_STD_TWS_SD,100)		// SCAR TWS SD

__awc(M136,100)
__awc(SMAW,100)

__awc(Laserdesignator,100)
__awc(Binocular,100)
__awc(Binocular_Vector,100)		// Rangefinder
__awc(NVGoggles,100)
__awc(JAVELIN,100)
__awc(STINGER,100)

// BIS_BAF weapons.
__awc(BAF_AS50_scoped,100)
__awc(BAF_AS50_TWS,100)
__awc(BAF_L85A2_RIS_ACOG,100)
__awc(BAF_L110A1_Aim,100)
__awc(BAF_LRR_scoped,100)
__awc(BAF_NLAW_Launcher,100)

// BIS_BAF ammo.
__amc(5Rnd_86x70_L115A1,100)
__amc(5Rnd_127x99_as50,100)
__amc(200Rnd_556x45_L110A1,100)
__amc(BAF_L109A1_HE,100)
__amc(NLAW,100)

__amc(20Rnd_762x51_B_SCAR,100)		// M110 TWS ammo
__amc(20Rnd_762x51_SB_SCAR,100)		// SCAR TWS SD ammo

__amc(HandGrenade_West,100)
__amc(HandGrenade_Stone,100)
__amc(Smokeshell,100)
// __amc(Smokeshellred,100)
__amc(Smokeshellgreen,100)
__amc(SmokeShellYellow,100)
// __amc(SmokeShellOrange,100)
// __amc(SmokeShellPurple,100)
// __amc(30Rnd_9x19_MP5,100)
// __amc(30Rnd_9x19_MP5SD,100)
__amc(7Rnd_45ACP_1911,100)
__amc(15Rnd_9x19_M9,100)
__amc(15Rnd_9x19_M9SD,100)
__amc(6Rnd_45ACP,100)			// Revolver ammo
__amc(20Rnd_556x45_Stanag,100)
__amc(30Rnd_556x45_Stanag,100)
__amc(30Rnd_556x45_StanagSD,100)
__amc(30Rnd_556x45_G36,100)
__amc(200Rnd_556x45_M249,100)
__amc(100Rnd_556x45_BetaCMag,100)
__amc(8Rnd_B_Beneli_74Slug,100)
__amc(5Rnd_762x51_M24,100)		
__amc(20Rnd_762x51_DMR,100)
__amc(10Rnd_127x99_M107,100)
__amc(100Rnd_762x51_M240,100)
// __amc(FlareWhite_M203,100)
// __amc(FlareGreen_M203,100)
// __amc(FlareRed_M203,100)
// __amc(FlareYellow_M203,100)
__amc(1Rnd_HE_M203,100)
__amc(M136,100)
__amc(SMAW_HEAA,100)
__amc(SMAW_HEDP,100)
__amc(Pipebomb,100)
__amc(Mine,100)
__amc(Laserbatteries,100)
__amc(JAVELIN,100)
__amc(STINGER,100)
__amc(30Rnd_545x39_AK,100)
__amc(PG7V,100)
__amc(PG7VR,100)
__amc(PG7VL,100)
__amc(100Rnd_762x54_PK,100)
__amc(75Rnd_545x39_RPK,100)

} else {
__awc(AK_107_kobra,100)
__awc(AK_107_GL_kobra,100)
__awc(AK_107_GL_pso,100)
__awc(AK_107_pso,100)
__awc(AK_74,100)
__awc(AK_74_GL,100)
__awc(AK_47_M,100)
__awc(AK_47_S,100)
__awc(AKS_74_kobra,100)
__awc(AKS_74_pso,100)
__awc(AKS_74_U,100)
__awc(AKS_74_UN_kobra,100)
__awc(Bizon,100)
__awc(bizon_silenced,100)
__awc(Saiga12K,100)
__awc(VSS_vintorez,100)

__awc(Pecheneg,100)
__awc(PK,100)
__awc(RPK_74,100)

__awc(KSVK,100)
__awc(SVD,100)
__awc(SVD_CAMO,100)

__awc(Makarov,100)
__awc(MakarovSD,100)

__awc(Igla,100)
__awc(MetisLauncher,100)
__awc(RPG18,100)
__awc(RPG7V,100)

__awc(STRELA,100)
__awc(Binocular,100)
__awc(NVGoggles,100)

__amc(30Rnd_545x39_AK,100)
__amc(30Rnd_762x39_AK47,100)
__amc(64Rnd_9x19_Bizon,100)
__amc(64Rnd_9x19_SD_Bizon,100)
__amc(8Rnd_B_Saiga12_74Slug,100)
__amc(10Rnd_9x39_SP5_VSS,100)
__amc(75Rnd_545x39_RPK,100)
// __amc(FlareWhite_GP25,100)
// __amc(FlareGreen_GP25,100)
// __amc(FlareRed_GP25,100)
// __amc(FlareYellow_GP25,100)
__amc(1Rnd_HE_GP25,100)
__amc(30Rnd_545x39_AKSD,100)
__amc(100Rnd_762x54_PK,100)
__amc(10Rnd_762x54_SVD,100)
__amc(8Rnd_9x18_Makarov,100)
__amc(8Rnd_9x18_MakarovSD,100)
__amc(PG7V,100)
__amc(PG7VR,100)
__amc(PG7VL,100)
__amc(OG7,100)
__amc(AT13,100)
__amc(RPG18,100)
__amc(Igla,100)
// __amc(SmokeShellRed,100)
// __amc(SmokeShellGreen,100)
// __amc(SmokeShell,100)
__amc(HandGrenade_East,100)
__amc(5Rnd_127x108_KSVK,100)
__amc(Mine,100)
__amc(Pipebomb,100)
__amc(Laserbatteries,100)
__amc(Strela,100)
};

We use BAF soldiers in Domination and I notice that the models have backpacks on them; however, unless chosen from the editor specifically the soldier won't have a backpack option. I was wondering if it's possible to add a backpack to Xeno's ammo crate so players can choose one if they wanted?

I tried adding this code below but it didn't work. (FYI: I'm a total newbie at scripting):

_awc(US_Patrol_Pack_EP1,100)

I also couldn't find the BAF backpack class name in the ARMA 2 library.

In addition we have an ammo crate script separate from Domination's. The code is as follows:

/////////////////////////////////////////////////////
//
// US Weapons Ammo Crate Fill Script.
//
// Called from an ammocrate's init field via:
//   nul = this execVM "ammo.sqf";
//
/////////////////////////////////////////////////////

while {alive _this} do
{

// Remove the stock items from the crate
clearMagazineCargo _this;
clearWeaponCargo _this;

/////////////////////////////////////////////////////
// WEAPONS
/////////////////////////////////////////////////////

// Main Battle Rifles (MBR)
_this addWeaponCargo ["G36a", 100];
_this addWeaponCargo ["G36C", 100];
_this addWeaponCargo ["G36_C_SD_eotech", 100];
_this addWeaponCargo ["G36K", 100];
_this addWeaponCargo ["M1014", 100];
_this addWeaponCargo ["M16A2", 100];
_this addWeaponCargo ["M16A2GL", 100];
_this addWeaponCargo ["M16A4", 100];
_this addWeaponCargo ["M16A4_GL", 100];
_this addWeaponCargo ["M16A4_ACG_GL", 100];
_this addWeaponCargo ["M16A4_ACG", 100];
_this addWeaponCargo ["M4A1", 100];
_this addWeaponCargo ["M4A1_HWS_GL", 100];
_this addWeaponCargo ["M4A1_HWS_GL_camo", 100];
_this addWeaponCargo ["M4A1_HWS_GL_SD_Camo", 100];
_this addWeaponCargo ["M4A1_RCO_GL", 100];
_this addWeaponCargo ["M4A1_Aim", 100];
_this addWeaponCargo ["M4A1_Aim_camo", 100];
_this addWeaponCargo ["M4A1_AIM_SD_camo", 100];
// _this addWeaponCargo ["M8_carbine", 100];
// _this addWeaponCargo ["M8_carbineGL", 100];
// _this addWeaponCargo ["M8_compact", 100];

// BAF weapons
_this addWeaponCargo ["BAF_AS50_scoped", 100];
_this addWeaponCargo ["BAF_AS50_TWS", 100];
_this addWeaponCargo ["BAF_L85A2_RIS_ACOG", 100];
_this addWeaponCargo ["BAF_LRR_scoped", 100];

// Submachineguns (SMG)
// _this addWeaponCargo ["MP5A5", 100];
// _this addWeaponCargo ["MP5SD", 100];

// Light Machineguns (LMG)
_this addWeaponCargo ["MG36", 100];
_this addWeaponCargo ["Mk_48", 100];
_this addWeaponCargo ["M240", 100];
_this addWeaponCargo ["M249", 100];
// _this addWeaponCargo ["M8_SAW", 100];

// Sniper rifles
_this addWeaponCargo ["DMR", 100];
_this addWeaponCargo ["M4SPR", 100];
// _this addWeaponCargo ["M8_sharpshooter", 100];
_this addWeaponCargo ["M107", 100];
_this addWeaponCargo ["M107_TWS_EP1", 100]; // M107 with TWS
_this addWeaponCargo ["M24", 100];
_this addWeaponCargo ["M40A3", 100];
_this addWeaponCargo ["M110_TWS_EP1", 100]; // M110 TWS
_this addWeaponCargo ["SCAR_H_STD_TWS_SD", 100]; // SCAR TWS SD

// Pistols
_this addWeaponCargo ["Colt1911", 100];
_this addWeaponCargo ["M9", 100];
_this addWeaponCargo ["M9SD", 100];
_this addWeaponCargo ["revolver_EP1", 100]; // Revolver

// AT & AA
_this addWeaponCargo ["Javelin", 100];
_this addWeaponCargo ["M136", 100];
_this addWeaponCargo ["SMAW", 100];
_this addWeaponCargo ["Stinger", 100];

/////////////////////////////////////////////////////
// AMMO
/////////////////////////////////////////////////////

// BAF ammo & grenades
_this addMagazineCargo ["5Rnd_86x70_L115A1",100];
_this addMagazineCargo ["5Rnd_127x99_as50", 100];
_this addMagazineCargo ["BAF_L109A1_HE", 100];

// LMG ammo
_this addMagazineCargo ["100Rnd_556x45_BetaCMag", 100];
_this addMagazineCargo ["100Rnd_762x51_M240", 100];
_this addMagazineCargo ["200Rnd_556x45_M249", 100];

// Sniper Rifle ammo
_this addMagazineCargo ["20Rnd_762x51_DMR", 100];
_this addMagazineCargo ["10Rnd_127x99_m107", 100];
_this addMagazineCargo ["5Rnd_762x51_M24", 100];
_this addMagazineCargo ["20Rnd_762x51_B_SCAR", 100]; // M110 TWS ammo
_this addMagazineCargo ["20Rnd_762x51_SB_SCAR", 100]; // SCAR TWS SD ammo

// MBR ammo
_this addMagazineCargo ["20Rnd_556x45_Stanag", 100];
_this addMagazineCargo ["30Rnd_556x45_G36", 100];
_this addMagazineCargo ["30Rnd_556x45_G36SD", 100];
_this addMagazineCargo ["30Rnd_556x45_Stanag", 100];
_this addMagazineCargo ["30Rnd_556x45_StanagSD", 100];
_this addMagazineCargo ["8Rnd_B_Beneli_74Slug", 100];

// SMG ammo
// _this addMagazineCargo ["30Rnd_9x19_MP5", 100];
// _this addMagazineCargo ["30Rnd_9x19_MP5SD", 100];

// Pistol ammo
_this addMagazineCargo ["15Rnd_9x19_M9", 100];
_this addMagazineCargo ["15Rnd_9x19_M9SD", 100];
_this addMagazineCargo ["7Rnd_45ACP_1911", 100];
_this addMagazineCargo ["6Rnd_45ACP", 100]; // Revolver ammo

// M203 ammo
_this addMagazineCargo ["1Rnd_HE_M203", 100];
_this addMagazineCargo ["1Rnd_Smoke_M203", 100];
// _this addMagazineCargo ["1Rnd_SmokeGreen_M203", 100];
// _this addMagazineCargo ["1Rnd_SmokeRed_M203", 100];
// _this addMagazineCargo ["1Rnd_SmokeYellow_M203", 100];
// _this addMagazineCargo ["FlareGreen_M203", 100];
// _this addMagazineCargo ["FlareRed_M203", 100];
// _this addMagazineCargo ["FlareWhite_M203", 100];
// _this addMagazineCargo ["FlareYellow_M203", 100];

// AT & AA ammo
_this addMagazineCargo ["Javelin", 100];
_this addMagazineCargo ["M136", 100];
_this addMagazineCargo ["SMAW_HEAA", 100];
_this addMagazineCargo ["SMAW_HEDP", 100];
_this addMagazineCargo ["Stinger", 100];

// Items
_this addWeaponCargo ["Binocular", 100];
_this addWeaponCargo ["Binocular_Vector", 100]; // Rangefinder
_this addWeaponCargo ["NVGoggles", 100];
_this addWeaponCargo ["ItemGPS", 100];
_this addWeaponCargo ["LaserDesignator", 100];
_this addMagazineCargo ["LaserBatteries", 100];

// Grenades & Satchels
_this addMagazineCargo ["HandGrenade_West", 100];
_this addMagazineCargo ["SmokeShell", 100];
_this addMagazineCargo ["SmokeShellGreen", 100];
// _this addMagazineCargo ["SmokeShellRed", 100];
_this addMagazineCargo ["SmokeShellYellow", 100];
// _this addMagazineCargo ["SmokeShellOrange", 100];
// _this addMagazineCargo ["SmokeShellPurple", 100];
// _this addMagazineCargo ["SmokeShellBlue", 100];
_this addMagazineCargo ["PipeBomb", 100];
_this addMagazineCargo ["Mine", 100];

// Restock time.  1800 = 30 minutes.
// sleep 1800;
sleep 1200;
};

I tried adding:

_this addWeaponCargo ["US_Patrol_Pack_EP1", 100];

... but it didn't work as well. Would anyone know how to add the backpack to this script?

Thanks in advance!

Share this post


Link to post
Share on other sites

I couldnt get it work so threw a few on the ground around the ammo crate, from searching these forums its seems its impossible to add an item that contains ammo into a crate.

Share this post


Link to post
Share on other sites
I couldnt get it work so threw a few on the ground around the ammo crate, from searching these forums its seems its impossible to add an item that contains ammo into a crate.

Is it possible to use this? _this addMagazineCargo ["US_Patrol_Pack_EP1", 100];

Not sure if it works, but i'll try when I get home.

Share this post


Link to post
Share on other sites

_this addBackpackCargo ["US_Patrol_Pack_EP1",5];

and i would really recomend only adding a few, and not 100 hundred as crate in domination is each players private crate, so 1 or 2 would be enough, also crates do NOT have unlimited space.

Edit: by "each players private crate" i mean that there are one crate for every player, players do not use same crate as the crate itself is client/player side only.

Edited by Demonized

Share this post


Link to post
Share on other sites

Great list,, but?

I was unable to find the names of these items so as to add them to a custom crate?

 

NLAW rocket ammo missing?

M32 Grenade Launcher            6*40 mm HE gnds and color rounds?

M110 TWS

Mk 17 EGLM RCO

Mk 17 Sniper

Mk 17 TWS SD

AKS-74 Goshawk

M8 Automatic Rifle                   MG36 Mag Rounds 100

M8 + M320

M8 TWS

M47 Dragon                             M47 missile

MG36 (camo)                           MG36 mag 100 rnds

 

Mk12 SPR

M4A1 Holo                             M203 HE

 

 

100Rnd M240

100Rnd PKM Mag

 

If any one can help .. Thanks..

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  

×