Jump to content
Sign in to follow this  
topeira

selecting weapons? how?

Recommended Posts

hi guys.

when im creating a costum mission in the editor, can i pick what weapons im using somehow without picking the soldier class itself?

it seems like if i want to use a LMG than i must pick a machinegunner or an automatic.

also there are weapons (like the XM8 or the MP5) that dont fit into anyone's hands. no class uses them.

question is - how can i create a mission and give my guys (or the enemy) whatever weapon i want?

maybe even give the USMC AKs, for example?

as unrealistic as it may be, i can only assume it would be possible....

thanks

Share this post


Link to post
Share on other sites

You'd use the this RemoveWeapon "name" and this RemoveMagazine "name" commands to get rid of their kit (or just use RemoveAllWeapons this to get rid of all their loadout), then use the this addweapon "name" and this addmagazine "name" commands to add the new weapons; check out the classnames in the editing section for all the proper names to use.

In terms of units not using weapons, there is always a slight degree of redundancy in that respect in all the OFP series of games (oh how I fondly remember the steyr)

Edited by DaveP

Share this post


Link to post
Share on other sites

thanks, dave.

i didnt quit get it -

im looking at this like:

AA Specialist USMC_Soldier_AA

what is the weapons name here? the USMC_Soldier_AA?? where is the magazine name?

how can i add weapons that are not in use of the soldiers like the silenced MP5 (MP5SD something) ?

can you, if u dont mind, use the MP5SD weapons and actually give me an example on how the line should look like for that weapon? or if u dont know the name of that weapon than some other weapon?

so i can see an example of the lines i should put in the editor.

thanks :)

Share this post


Link to post
Share on other sites

AA Specialist is the displayname for the USMC_Soldier_AA unit, in other words, he's not a weapon in this respect, but a soldier.

Look in the sticky class thread on top of this forum, contains many classes for both units, weapons, and ammunition.

Share this post


Link to post
Share on other sites

Here is a quick example. If you want to add a Stingerlauncher and a missile to a soldier you have placed on the map just add this in the soldiers initialization this addmagazine "stinger"; this addweapon "stinger";

Share this post


Link to post
Share on other sites

1. Place your soldier

2. Look up the weapon name (middle one) and the magazine name (right ones) you want to use >> here <<

3. In case for an MP5, put this into the init line of the soldier:

removeAllWeapons this;
removeAllMagazines this;

this addMagazine "30Rnd_9x19_MP5";
this addWeapon "MP5A5";

this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this selectWeapon "MP5A5";

You add the mag first, then the weapon so that the unit starts with a reloaded weapon. Then you can add additional mags. If you want to force the unit to use a specific weapon, use 'selectWeapon'.

That should be all.

Edited by ])rStrangelove

Share this post


Link to post
Share on other sites
thanks, dave.

i didnt quit get it -

im looking at this like:

AA Specialist USMC_Soldier_AA

what is the weapons name here? the USMC_Soldier_AA?? where is the magazine name?

how can i add weapons that are not in use of the soldiers like the silenced MP5 (MP5SD something) ?

can you, if u dont mind, use the MP5SD weapons and actually give me an example on how the line should look like for that weapon? or if u dont know the name of that weapon than some other weapon?

so i can see an example of the lines i should put in the editor.

thanks :)

Copy and paste this into the init line of a unit:

removeAllWeapons this; this addWeapon "SMAW"; this addMagazine "SMAW_HEAA"; this addWeapon "M4A1_HWS_GL_SD_Camo"; this addMagazine "30Rnd_556x45_StanagSD"; this addMagazine "30Rnd_556x45_StanagSD"; this addMagazine "30Rnd_556x45_StanagSD"; this addMagazine "30Rnd_556x45_StanagSD"; this addMagazine "30Rnd_556x45_StanagSD"; this addMagazine "30Rnd_556x45_StanagSD"; 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 addMagazine "1Rnd_HE_M203";

It will give him a layout of:

1 Woodland M4A1SD M203 EoTech

-6 StanagSD clips

-6 M203 rounds

1 SMAW Launcher

-1 HEAA ammo

Just change the class names for the weapons and ammo with the weapons/ammo of your choice from the class name sticky

Share this post


Link to post
Share on other sites

thank you VERY much guys. i think this will be very helpful! :)

will try that soon.

thanks for the help.

Share this post


Link to post
Share on other sites

Taking advantage of this topic, how do i add weapons to a vehicle or box?

I added them to a soldier and it worked:

removeAllWeapons this; this addMagazine "30Rnd_762x39_AK47"; this addWeapon "AKS_GOLD"; this addMagazine "30Rnd_762x39_AK47"; this addMagazine "30Rnd_762x39_AK47"; this addMagazine "30Rnd_762x39_AK47"; this addMagazine "30Rnd_762x39_AK47"; this addMagazine "30Rnd_762x39_AK47"; this addMagazine "30Rnd_762x39_AK47"; this selectWeapon "AKS_GOLD";

But it didn't work in vehicles and ammo boxes.

Best regards

Share this post


Link to post
Share on other sites

Dont know if ArmaEdit works for ARMA2? In that you have a CRATE editor where you can add weapons and then give the crate a name. So you get a script with all weapons and its easy to edit etc. Then just add any crate in-game and in the crates INIT - call the custom crate script. How to do more detailed is in the download i think. Check it out - you might get lucky. ;)

Quick how to:

-Open ArmaEdit

-Choose Crate Builder Wizard

-Add what you need

-Save script to mission folder

-Add any type of ammobox in editor

-Add the line needed to call up the custom weapons you made in the ammoboxe's INIT.

ARMAEDIT (remember i dont know if this works in ARMA2).

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites

@anc: For vehicles and crates you might have to use

clearWeaponCargo this;
clearMagazineCargo this;
this addWeaponCargo ["AKS_GOLD",1];
this addMagazineCargo ["30Rnd_762x39_AK47",7];

instead. Sorry, not able to verify.

Share this post


Link to post
Share on other sites

It worked!!!!

Thx a lot CarlGustaffa!!!! =D

Kudos for you mate!!!

Share this post


Link to post
Share on other sites

I used the search function, but didn't find anything, so I put it in here.

How can I give players the possibility to choose their weapons in the briefing window?

I heard that it doesn't work anymore to write it in the "Description.ext". So, any ideas?

IndeedPete

Share this post


Link to post
Share on other sites

Does anyone know if the Satchel charge is counted as ammo or as a weapon?

So what script do you use to add that one?

Share this post


Link to post
Share on other sites

the description.ext is where you define the briefing gear

showCompass = 0;
showGPS = 0;
showWatch = 0;

class Weapons
{
class AK74 { count = 3; };
class Binocular { count = 5; };
};

class Magazines
{
	class 30Rnd_545x39_AK { count = 15; };
};

Not tested it in Arma II so not sure if it does or dont work..

EDIT: it does work except the AK74 will throw an error cus its ARMA I gun :P

Edited by Junker

Share this post


Link to post
Share on other sites

Well that's great news! I'll try it in a second... :D

Share this post


Link to post
Share on other sites
)rStrangelove;1299694']1. Place your soldier

2. Look up the weapon name (middle one) and the magazine name (right ones) you want to use >> here <<

3. In case for an MP5' date=' put this into the init line of the soldier:

removeAllWeapons this;
removeAllMagazines this;

this addMagazine "30Rnd_9x19_MP5";
this addWeapon "MP5A5";

this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this selectWeapon "MP5A5";

You add the mag first, then the weapon so that the unit starts with a reloaded weapon. Then you can add additional mags. If you want to force the unit to use a specific weapon, use 'selectWeapon'.

That should be all.[/quote']

Hey im trying to do exactly this, give all my team MP5 SDs. however when i

copy and paste this code into the init box i get the error:

Missing ;

:confused::confused:

Share this post


Link to post
Share on other sites

This is really useful stuff, thanks guys. But how do I get the kit to stay put even after death/respawn? At the moment, you get all the init gear in your first life, but when you die and respawn you end up with the class default loadout again. Any ideas?

Share this post


Link to post
Share on other sites
Hey im trying to do exactly this, give all my team MP5 SDs. however when i

copy and paste this code into the init box i get the error:

Missing ;

:confused::confused:

When the error comes up simply press ok and press the ';' key. The editor automatically moves the typing cursor in the init. box to where you need to insert what is missing :)

coulda worded that better but oh well.

Share this post


Link to post
Share on other sites
This is really useful stuff, thanks guys. But how do I get the kit to stay put even after death/respawn? At the moment, you get all the init gear in your first life, but when you die and respawn you end up with the class default loadout again. Any ideas?[/QUOT

When they equip save what weapons they have to a variable. Then when they die, use that variable to reload them. Evolution saved it when they were near the ammo box and did the grab from cargo animation.

Share this post


Link to post
Share on other sites

AnimalMother: delete that second line.

When they equip save what weapons they have to a variable. Then when they die, use that variable to reload them. Evolution saved it when they were near the ammo box and did the grab from cargo animation.
What? How would I do all this?

Share this post


Link to post
Share on other sites

another way to do it, which I have used, is to edit the description.ext file, and in the class weapons section, add in every weapon and ammo type from a list. Then, on the mission start screen, you can select your player, click the gear link, and choose from everything that you had put into the class weapons part of the description.ext file.

You can also drop an ammo crate and use the weapon fill script to add all weapons and ammo types to that crate. Then at mission start you can go to the crate and pick up whatever kit you want, no matter what soldier type you are playing as.

Share this post


Link to post
Share on other sites

I have a trigger:

activation: BLUEFOR Present

On Act:

{removeAllWeapons _x;} forEach thislist; 
{_x addWeapon "NVGoggles";} forEach thislist; 
{_x addWeapon "Binocular";} forEach thislist;   
{_x addWeapon "MP5A5";} forEach thislist;  
{_x addMagazine "30Rnd_9x19_MP5";} forEach thislist;  
{_x addMagazine "30Rnd_9x19_MP5";} forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "SmokeShell";}forEach thislist;  ;
{_x addMagazine "SmokeShell";} forEach thislist   ;
{_x addMagazine "SmokeShell";} forEach thislist; 
{_x selectweapon "MP5A5";} forEach thislist; 

The problem is that the BLUEFOR players start without their weapons loaded and have to reload.

this addWeapon "NVGoggles";
this addWeapon "Binocular";
this addWeapon "MP5A5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "SmokeShell";
this addMagazine "SmokeShell";
this addMagazine "SmokeShell";
this selectweapon "MP5A5";

I tried putting the above in the units initialization but it still did not work

Share this post


Link to post
Share on other sites

As mentioned in this thread you need to add the weapon after adding atleast one magazine.

Please note that you don't have to make the last selectweapon if you only add one weapon, use it if you added for example a AT4 and want the soldier to start with that weapon in his hands.

And for the grenade launchers use the weapons muzzle class name(second column in the arma 2 class names/weapons)

{removeAllWeapons _x;} forEach thislist; 
{_x addWeapon "NVGoggles";} forEach thislist; 
{_x addWeapon "Binocular";} forEach thislist;   
[s]{_x addWeapon "MP5A5";} forEach thislist;  [/s]
{_x addMagazine "30Rnd_9x19_MP5";} forEach thislist;  
{_x addMagazine "30Rnd_9x19_MP5";} forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "30Rnd_9x19_MP5";}forEach thislist; 
{_x addMagazine "SmokeShell";}forEach thislist;  ;
{_x addMagazine "SmokeShell";} forEach thislist   ;
{_x addMagazine "SmokeShell";} forEach thislist; 
[color="Blue"]{_x addWeapon "MP5A5";} forEach thislist;  [/color]
[s]{_x selectweapon "MP5A5";} forEach thislist;

[/s]

this addWeapon "NVGoggles";
this addWeapon "Binocular";
[s]this addWeapon "MP5A5";[/s]
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "30Rnd_9x19_MP5";
this addMagazine "SmokeShell";
this addMagazine "SmokeShell";
this addMagazine "SmokeShell";
[color="Blue"]this addWeapon "MP5A5";[/color]
[s]this selectweapon "MP5A5";[/s]

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  

×