Jump to content
Sign in to follow this  
bigstone

How do you change weapons

Recommended Posts

I would like to change BOSS's 2nd Infantry Division soldiers M-16A2's to M4's and the same for the M-16A2/M203 to M4/M203.

Share this post


Link to post
Share on other sites

Unless you want to edit the config.cpp for the soldiers themselves, you can change this in the editor.

In a unit's init line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this removeWeapon "m16a2"; this addWeapon "NewWeaponName"

M4's and M16's share the same magazine type so you don't have to mess with removing the stanags. You will however have to add m203 rounds to units that were not Grenadiers to start, meaning that a soldier with a non-m203 equipped weapon will need to have the m203 magazine added if he is going to be carrying an m203 equipped weapon. For instance:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this removeWeapon "m16A2";this addMagazine "1Rnd_HE_M203";this addMagazine "1Rnd_HE_M203";this addMagazine "1Rnd_HE_M203";this addMagazine "1Rnd_HE_M203";this addMagazine "1Rnd_HE_M203";this addWeapon "M4A1GL"

You could execute this in a trigger for a bunch of soldiers inside the said trigger by setting the trigger to detect blufor, and in the OnAct line put it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x removeWeapon "M16A4_ACG"; _x addMagazine "1Rnd_HE_M203";_x addMagazine "1Rnd_HE_M203";_x addMagazine "1Rnd_HE_M203";_x addMagazine "1Rnd_HE_M203";_x addMagazine "1Rnd_HE_M203"; _x addweapon "M4GL"}forEach ThisList

Here is the list of default ARMA Weapons, their classnames, ammo names etc.

http://community.bistudio.com/wiki/ArmA:_Weapons

For other weapons, like Aimpoint Desert Weapons for example, the easiest way to find out what his weapon names are is to de-pbo the addon and check the config.cpp for his classnames.

PS: I'm sure there are much better methods of using the code, but that's just my rusty tech in the works; at its best haha

Edit: If you want to change the config.cpp just change the weapons that the unit starts with in the CfgVehicles portion of the config.cpp and then re-pbo.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles

{

/*extern*/ class SoldierWB;

class USMC_SoldierWB: SoldierWB

{

model = "\USMC_Woodland\us_soldier_b";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put", "M9"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "HandGrenadeTimed", "HandGrenadeTimed", "HandGrenadeTimed", "HandGrenadeTimed", "HandGrenadeTimed", "15Rnd_9x19_M9", "15Rnd_9x19_M9", "15Rnd_9x19_M9"};

Each type of soldier in the addon pack you're editing should have a CfgVehicles for that type of soldier. Change teh weapons and corresponding ammo to what you want.

pistols.gif

Vidz

Share this post


Link to post
Share on other sites

Thanks I would like to change the weapons of the soldiers themselves. Where do I find the config.cpp and how do I change all weapons that are M-16A2's to M4's? Same for the M16-A2/M203 to M4's/M203's.

Share this post


Link to post
Share on other sites

The config.cpp can be found by downloading and installingthese tools from Kegetys, and using cPBO to de-pbo the pbo file that the units came in. This is the pbo file you put into your addons directory, or created a mod folder for.

Once you install the tools, and double-click on the pbo for the soldiers, the program will create a folder and 'unpack' the soldiers. In that folder is where you find the config.cpp.

Find the weapon name for the M16A2 m203 in the weapons list, in my other post, in the CfgVehicles area change the M16A2 m203 weapon to the one you want. Save the file(it opens with notepad by default - or it should anyway) and then go up one level so that you see the original PBO the soldiers were in, and the folder the cPBO created. Right-click on the folder, select "Create PBO." This will automatically overwrite the original pbo that was unpacked.

I suggest you make a backup copy first.

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  

×