PDA

View Full Version : selecting weapons? how?



topeira
Jun 5 2009, 10:00
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

DaveP
Jun 5 2009, 10:02
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)

topeira
Jun 5 2009, 14:40
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 :)

CarlGustaffa
Jun 5 2009, 14:43
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.

suveraan
Jun 5 2009, 15:02
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";

])rStrangelove
Jun 5 2009, 15:37
1. Place your soldier
2. Look up the weapon name (middle one) and the magazine name (right ones) you want to use >> here (http://forums.bistudio.com/showpost.php?p=1292940&postcount=8) <<
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.

Manzilla
Jun 5 2009, 16:38
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

topeira
Jun 7 2009, 08:50
thank you VERY much guys. i think this will be very helpful! :)

will try that soon.

thanks for the help.

anc
Jun 13 2009, 15:46
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

Alex72
Jun 13 2009, 16:15
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 (http://www.armaholic.com/page.php?id=1455) (remember i dont know if this works in ARMA2).

Alex

CarlGustaffa
Jun 13 2009, 20:35
@<hidden>: 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.

anc
Jun 14 2009, 02:32
It worked!!!!
Thx a lot CarlGustaffa!!!! =D
Kudos for you mate!!!

IndeedPete
Jun 15 2009, 15:44
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

SiC-Disaster
Jun 15 2009, 18:09
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?

Junker
Jun 15 2009, 18:13
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

IndeedPete
Jun 15 2009, 21:53
Well that's great news! I'll try it in a second... :D

AnimalMother92
Jul 13 2009, 08:33
)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 (http://forums.bistudio.com/showpost.php?p=1292940&postcount=8) <<
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.

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:

Papua
Jul 13 2009, 09:28
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?

John_P
Jul 18 2009, 19:17
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.

kylania
Jul 18 2009, 23:04
[QUOTE=Papua;1361573]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.

Cellus
Jul 19 2009, 02:51
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?

Eclipse4349
Jul 20 2009, 13:17
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.

abdecken
Jul 25 2009, 18:01
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

Taurus
Jul 25 2009, 18:31
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;
{_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 addWeapon "MP5A5";} forEach thislist;
{_x selectweapon "MP5A5";} forEach thislist;


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 addWeapon "MP5A5";
this selectweapon "MP5A5";

abdecken
Jul 25 2009, 19:17
thankyou very much Taurus, I must of missed that!

Lowe
Aug 23 2009, 15:41
Just adding to this post having done a bit of a search, I'm coming across an issue with this.

I've got a mission where I've got two sides attacking/defending an object and they can only blow it with satchels. I've given the squads loadouts and satchels, however when you die you respawn back with the squad class loadout rather than my own.

I see above that you've created a trigger to rearm anyone who respawns with the loadout of your choosing rather than the class loadout. I've tried creating this, but can't get it to work.

Exactly how do I do this please guys? I create a trigger with a 40x40 circle, repeatedly triggered, activation BLUFOR present, and then in the On Act I've pasted:


{removeAllWeapons _x;} forEach thislist;
{_x addWeapon "NVGoggles";} forEach thislist;
{_x addWeapon "Binocular";} forEach thislist;
{_x addMagazine "30Rnd_9x19_MP5";} 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 "30Rnd_9x19_MP5";}forEach thislist;
{_x addMagazine "SmokeShell";} forEach thislist;
{_x selectweapon "MP5A5";} forEach thislist;

When I respawn I don't get my loadout. :(


/edit - I don't suppose the above "x" has to be a name does it? But if so how do I do it for lots of people (it's 16 per side)

Lowe
Aug 23 2009, 20:18
Fixed it, used this:

http://forums.bistudio.com/showpost.php?p=1334119&postcount=3

Lowe
Aug 28 2009, 13:05
Right - slight problem now. :)

Had 15 guys playtest my mission last night and it was good fun, but we came across an issue. When we respawn we're given the correct loadout, however the gun doesn't work. The MP5 is showing, but it doesn't work. We found that by cycling through the weapons it solved the problem, but you need to do this each time you die.

Having just read above do I need to 'select' the weapon on the end of my script?

i.e. {_x selectweapon "MP5A5";} forEach thislist;

kampfgeist
Oct 29 2009, 11:47
So I will try to take advantage of this thread too...
Didn't really find anything in the forums so far and thing it kinda fits in here too..

I got 8 playable characters in my coop map named "P1 - p8" they are /in two fireteams.
Each team has more or less the same layout..

1 soldier with a grenadelauncher (p1/p5)
1 demoman (p2/p6)
1 medic (p3/p7)
1 Light MG (vs the other team a sniper) (p4/p8)

Now I would like to be every "class" be able to pick from a different set of weapons in the beginning of the mission..

So there will still just be one LMG and one sniper.. and the medic can't choose a GL weapon but the Solder with the gerenadelauncher can...

I think you know what I mean... :)

I got the weapons to chose from ready... but everybody can choose every single weapon...

So I'm looking for a ways to give every player different weapons to choose from in the grear section befor you start the mission.

IndeedPete
Oct 29 2009, 12:14
I think that's impossible. You could only try it in the mission with dialogs but since i never worked with them i can't help you much...

kampfgeist
Oct 30 2009, 11:09
me neither.. damn :)

gnarly_rider
Nov 13 2009, 00:28
I'll also borrow this thread; I'm designing a civilian ambush that gets activated by a trigger.

Civilians are grouped to various non-presnet OPFOR so they become hostile to BLUFOR.

Now obviously on trigger activation I need to arm them so they can mow us down. I can do this easily on an individual basis (name each civi a1, a2, etc, then in trigger put: a1 exec "civigear.sqf";a2 exec "civigear.sqf" etc, where the script is just a simple addweapan/addammo deal).

BUT how do I apply this en amsse without having to name each civi, and explicitly reference each civi in the trigger? Note also that a thislist area trigger is no good, as i only want say 30 civilians in a town of 70 to be armed, not the whole lot....

3inar
Nov 13 2009, 23:16
OK hello all :) so I got this mission I am working on and where the player will start without any weapon, now I hav read thrue this thread but It seem every line I try seeme to fail game say "missing ;" and then nothing more hapeneds...
this is the line ive ben trying to figure out

removeAllWeapons this;
removeAllMagazines this;

and yes I put it in the Iniziation..or whatever it is caled in the Unit info but still I get the missing messege

am I missing something or ´shold I not be able to do this with just copying the line removeAllWeapons this;
removeAllMagazines this;

to start without weapons.

Also my game is armA 2 if it has any meaning..

Thanks in advance :)

kampfgeist
Nov 14 2009, 12:10
BUT how do I apply this en amsse without having to name each civi

There is an armed civilian (http://www.armaholic.com/page.php?id=7951) addon, that should do the job :)


@<hidden>

I'm not sure if get whatyour probem is...but try just


removeAllWeapons this;

should remove the magazines too..

gnarly_rider
Nov 15 2009, 08:31
There is an armed civilian (http://www.armaholic.com/page.php?id=7951) addon, that should do the job :)

.

My bad for not amplifying, yes I have found that, but I'm actually doing an ambush, so the civis have 'hidden' weapons, that then appear (aka are drawn via add Weapon) upon activating a trigger. So need to use default unarmed civis, then force them to be armed upon actiavtion, which is easy, just en-masse is not so easy....

Frosties
Nov 15 2009, 22:35
I´ve found a M249 weapon in the armory that you can try out, but havent been able to find it in the class list.
Its a M249 Para with Eotech and forward grip, called M249 SPW in the armory.
Anybody knows how to get a hold of that one?

H3NRY
Nov 16 2009, 00:00
I´ve found a M249 weapon in the armory that you can try out, but havent been able to find it in the class list.
Its a M249 Para with Eotech and forward grip, called M249 SPW in the armory.
Anybody knows how to get a hold of that one?
that sounds like the one from the bink us army ones.. i think i have a list of them.. one minute


VIL_M4_grip_aim
VIL_M4_grip_eot
VIL_M249_ELCAN
VIL_M240B_ELCAN
VIL_M240B
VIL_M249_PARA
VIL_M4_grip_eot_camo

pretty self explanatory names

Frosties
Nov 16 2009, 15:36
Thanks for classnames!

Have tried adding them to a weapon crate and was going to try it on my dedicated server, but this error keeps popping up:

No entry 'bin\config.bin/CfgWeapons.VIL_M249_PARA '.

Do i have to add more information anywhere else?

H3NRY
Nov 16 2009, 17:15
Thanks for classnames!

Have tried adding them to a weapon crate and was going to try it on my dedicated server, but this error keeps popping up:

No entry 'bin\config.bin/CfgWeapons.VIL_M249_PARA '.

Do i have to add more information anywhere else?


hmm.. those are the specific ones for the weapons in the bink skin replacements/addon units.. i had them working but i had the replacements and the addon units. if you can use the para in the armory then it should work in a mission. i know there is a way to get the classname of a weapon in your hand.. dont know how to tho :)

kampfgeist
Nov 17 2009, 07:17
which is easy, just en-masse is not so easy....

Oh, I think you have to do it that way then.. but I'm not a that good with the editor(skripting)..

Maybe some of the good has an idea?!

Sir Beaver
Nov 17 2009, 10:57
Hey all!
I have a small problem with this weapon choosing thing at the start of the missions. I know the code which makes the right weapons available for the players, but I couldn't find anything about how to make the briefing appear when I launch the mission. I mean I have the briefing itself on the map, but it doesn't show up automatically at start.
Thanks for the help...:)

[EDIT:] I managed to sort out the problem:
I just needed a "briefing.html" file beside the "briefing.sqf", and the briefing had to be turned on in the description... like this:

disabledAI=FALSE;
ShowGPS=1;
showCompass=1;
showWatch=1;
showMap=1;
showNotePad=1;
briefing=1;
debriefing=1;
ausome! :yay:

3inar
Dec 10 2009, 16:24
There is an armed civilian (http://www.armaholic.com/page.php?id=7951) addon, that should do the job :)


@<hidden>

I'm not sure if get whatyour probem is...but try just


removeAllWeapons this;

should remove the magazines too..

finaly worked, werry strange I wrote the exact same thing before but only after I copied your text it workt. anyways thanks man! mutch apritiated :)

3inar
Jan 19 2010, 14:48
Ok hello again all! It has ben a while :P

ok so I was wondering how I can make a wepon lie on the ground without in a wepon carate or droping it on the ground, (basicaly starting with...lets say an ak lying on the ground just infront of you when you start) justlike when you drop your weapon on the ground. And also do I use the same method when/if I whant to place a weapon/object on a table or higher ground?

thanks in advance :)

/// best wishes 3inar!

Taurus
Jan 19 2010, 15:54
3inar
What you need is a weapon holder, check this thread out on how to do this.
http://forums.bistudio.com/showthread.php?t=79309&highlight=WeaponHolder

3inar
Jan 20 2010, 09:53
Thanks alot :) ++ to you!

MangoForLife
Feb 10 2010, 15:01
When I start adding weapons and mags to my units in the Init box, do I have to Manually add Weapons & Mags to each unit 1 by 1?? Or is there a quicker way to add the same weapon loadout to a bunch of units all at once?

cianw1
May 23 2010, 18:39
i know the command to add new weapons in the editor (i copyed and pasted bout 3 that ppl have posted) and when i press ok it says "missing ;" and there arent any missing ones? any help?

Cyborg11
May 23 2010, 19:19
Post your code please.

cianw1
May 23 2010, 19:39
ok so now when i put a weapon in it works, but when i go into it my hands are empty but when i shoot it makes noise (basically everything is ok except the gun im holding isnt there and the bullets dont do any damage) please help?!?!

Militantsausage
May 23 2010, 21:21
When I start adding weapons and mags to my units in the Init box, do I have to Manually add Weapons & Mags to each unit 1 by 1?? Or is there a quicker way to add the same weapon loadout to a bunch of units all at once?

you can do this


{this addMagazine "30rnd_556x45_STANAG"} foreach [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

this will give a soldier 10 M16 mags


ok so now when i put a weapon in it works, but when i go into it my hands are empty but when i shoot it makes noise (basically everything is ok except the gun im holding isnt there and the bullets dont do any damage) please help?!?!

i think that's just a bug, or a faulty addon, but it's never happened to me.

cianw1
May 26 2010, 08:47
k ty ill try with a different gun

ProfTournesol
May 26 2010, 09:46
you can do this

Quote:
{this addMagazine "30rnd_556x45_STANAG"} foreach [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
this will give a soldier 10 M16 mags

Absolutely not, i'm afraid. This will give one magazine of "30rnd_556x45_STANAG" type to the units named "1" to "10".

CarlGustaffa
May 26 2010, 11:43
Actually it works. "This" is used instead of "_x", meaning the counter is just increased by one then the command is repeated that many times.

ProfTournesol
May 26 2010, 12:37
Actually it works. "This" is used instead of "_x", meaning the counter is just increased by one then the command is repeated that many times.

:icon_ohmygod: Oops, ok, just tested it, didn't notice the lack of _x. Very nice find actually. Sorry for sounding so self-conceited :lookaround:

meade95
May 26 2010, 15:14
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

This is very helpful / thanks.

And the word "this" needs to be in there as shown??? When entering the script?

cianw1
May 26 2010, 22:44
ummm, can someone post a link for the wepons list? the one with weapon name, code, and ammo type. i know its here somewhere bu i cant find it. sorry for lazieness xD

---------- Post added at 11:44 PM ---------- Previous post was at 11:28 PM ----------

found wep list, when i put a thing in to remove wepons and add a new one, it says something like "invalid sentence, expect nothing" any ideas? :(

Militantsausage
May 27 2010, 05:31
ummm, can someone post a link for the wepons list? the one with weapon name, code, and ammo type. i know its here somewhere bu i cant find it. sorry for lazieness xD

---------- Post added at 11:44 PM ---------- Previous post was at 11:28 PM ----------

found wep list, when i put a thing in to remove wepons and add a new one, it says something like "invalid sentence, expect nothing" any ideas? :(

i don't know exactly what you mean:confused:, but make sure that you have quotation marks around the magazine names and the weapon names.:pistols:

cianw1
May 27 2010, 21:19
sometimes i can get it to work, but when i go into the preview, the gun isnt there, its like im holding it but its invisible. it can even shoot but bullets do no damage. maybe i have to install something. btw this is the demo of arma 2 so maybe thats why?

meade95
May 27 2010, 21:21
sometimes i can get it to work, but when i go into the preview, the gun isnt there, its like im holding it but its invisible. it can even shoot but bullets do no damage. maybe i have to install something. btw this is the demo of arma 2 so maybe thats why?

Ditto this for me, when using the RH_M4/M16 addon ...right now

Militantsausage
May 27 2010, 21:34
sometimes i can get it to work, but when i go into the preview, the gun isnt there, its like im holding it but its invisible. it can even shoot but bullets do no damage. maybe i have to install something. btw this is the demo of arma 2 so maybe thats why?

that is probably why, because the ArmA 2 demo is not complete and is missing alot of things. You should buy full ArmA 2, the money is definetly worth it, i've had it for 5 months and it's still my favourite game.

cianw1
May 27 2010, 21:42
if i had a high end gaming pc it would be the first thing id buy for it xD but i have a macbook pro running bootcamp, and the graphics arent particulary good. is the campaign any good? i mean, i might consider buying the game just for the editor anyway but campaign would be good too. also howmuch is it now? (UK)

Militantsausage
May 28 2010, 06:12
if i had a high end gaming pc it would be the first thing id buy for it xD but i have a macbook pro running bootcamp, and the graphics arent particulary good. is the campaign any good? i mean, i might consider buying the game just for the editor anyway but campaign would be good too. also howmuch is it now? (UK)

My PC isn't that good (3 years old) but i can easily run this game on normal with at the very least 30 fps on most maps (not Razoreniya, for that is was about 3 fps in jungle)

The campaign's alright but the editor is where it's at, alot of possibilities there, plus all the addons and mods there are there is usually at least 1 addon every day.

For your second question, i don't know howmany pounds it would cost but in Australia i got it for $90, but our Dollar is pretty weak, it's like half as much as a pound, so i'm guessing it would cost 45 pounds, but i got it pretty cheap compared to normal.:pistols::yay::yay::yay::681:

F2k Sel
May 28 2010, 09:28
It's around £15 give or take including delivery. I've had the game since day one and not even played any of the campaign.

Militantsausage
May 28 2010, 10:54
It's around £15 give or take including delivery. I've had the game since day one and not even played any of the campaign.

For both answers i must say WoW:eek::eek::smiley-aloof:

mcvittees
May 28 2010, 14:40
{removeAllWeapons _x;} forEach thislist;
{_x addWeapon "NVGoggles";} forEach thislist;
{_x addWeapon "Binocular";} forEach thislist;
{_x addMagazine "30Rnd_9x19_MP5";} 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 "30Rnd_9x19_MP5";}forEach thislist;
{_x addMagazine "SmokeShell";} forEach thislist;
{_x selectweapon "MP5A5";} forEach thislist;



One reason why the code above may not have worked is because in each line you needed to add 'units' and remove the semicolon ';' in the curly brackets. e.g.





{_x addWeapon "NVGoggles"} forEach units thislist;



I know you got it sorted but it might help your knowledge.

A-SUICIDAL
Jul 18 2010, 21:59
I have a Operation Arrowhead stand alone. Can anybody give me an example of how to replace a player loadout for OA? It apparently doesn't work the same way as it did for regular Arma 2. I've tried a bunch of different ways and nothing seems to work except for removing all weapons. Please do not explain to me how to add an mp5 for Arma 2. As far as i can tell, there is no Mp5 in OA. I do not have Arma 2. I have Arma 2 Operation Arrowhead.

I am trying to do this as described earlier in this thread. but it does not work in OA.


removeAllWeapons this;
removeAllAmmo this;
this addMagazine "30Rnd_762x39_SA58";
this addWeapon "Sa58V_RCO_EP1";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "17Rnd_9x19_g17";
this addWeapon "M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";

Any help from somebody that knows how to do this in Arrowhead would be much appreciated.

kylania
Jul 18 2010, 23:43
Pretty angry and confrontational for your first post there.. :confused:

Try this instead:



removeAllWeapons this;
this addMagazine "30Rnd_762x39_SA58";
this addWeapon "Sa58V_RCO_EP1";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addWeapon "M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";


The two problems were 1) there's no such thing as "removeAllAmmo", removeAllWeapons does that for you (it also removes things like Binoculars and NVG) and 2) you had an incorrect magazine name for a G17. You had 17Rnd_9x19_g17 when the correct class name is 17Rnd_9x19_glock17. But you didn't have a G17 anyway, so I just removed it. :)

CarlGustaffa
Jul 19 2010, 00:49
I always use addWeapon at the very last, to ensure magazines are loaded. Another thing to consider are "items"; removeAllItems (http://community.bistudio.com/wiki/removeAllItems) then add them back if you want consistency among your troops rather than realism. Then there is backpack considerations as well depending on where you want to go.

And, uhm, yeah, what happened to SMGs? Would love to have some flashlight and laser equipped SMG for SF use. Maybe the MP7 (http://en.wikipedia.org/wiki/MP7)?

kylania
Jul 19 2010, 01:01
Yeah, I finally loaded up CO last night and surely did miss the MP5SD and M16A2 :)

A-SUICIDAL
Jul 19 2010, 04:15
Thank you kylania, that did the trick. Sorry I sounded a bit unpleasant, but omg I stressed myself out in the editor over the last 2 days. I used to make tones of cold crisis missions, yeah, like ten years ago, and I just started poking around with the editor for arrow head 2 days ago and I'm so upset that I cannot remember how to script the simplest little things. I figured it would all come back to me, but not much of it has. I feel like I'm repeating the 3rd grade all over again. Anyway. thanks for the help, it really cheered me up to see it working correctly. Thanks ;)

---------- Post added at 12:15 AM ---------- Previous post was at 12:11 AM ----------

Oh, what about removing the gear from ammo crates, like the smoke grenades, watch, gps, bino's etc? Is there a way to do that? I know how to add the weapons and ammo I want, but I don't know how to remove the extra gear stuff.

kylania
Jul 19 2010, 04:18
One trick you might look into is using foreach to add multiple weapons at a time, like this:



{this addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5,6,7,8];
this addWeapon "M110_NVG_EP1";
{this addMagazine "HandGrenade_West";} forEach [1,2];


That will add 8 mags of ammo and a M110 w/NV scope and 2 hand grenades, instead of typing out each addMagazine command.

For ammocrates use:

clearWeaponCargo (http://community.bistudio.com/wiki/clearWeaponCargo) and clearMagazineCargo (http://community.bistudio.com/wiki/clearMagazineCargo)

Dogmeat of Finland
Jul 19 2010, 06:18
Just download RTE for Arma II. I don't really know how to use all of its features properly but I use it all the time to create complex custom loadouts. It's a great tool when for example you want to fill a car with supplies without spending more than a minute. I made a special forces squad in OA and every member had all kinds of ACE gadgets and custom weaponry and it took like five minutes when using RTE. Just install the addon, start up the editor, preview, press esc and click the editor and create a guy or an ammo box or something. After that just add the weapons you want and copy paste the lines back in the real editor. I know that the maker of RTE probably didn't intend RTE to be used this way but it works and sure beats manually punching in all those lines.

Real Time Editor - Armaholic (http://www.armaholic.com/page.php?id=7263)

Breeze
Jul 19 2010, 16:40
That Real time editor has plagued me I just said screw it I hate even installing it, drives me crzy I would love to have it for placement of walls and such but omg i hate the bullshit errors I get makes me nuts, and once you get one crate theres always copy and paste from one mission to another.

---------- Post added at 04:40 PM ---------- Previous post was at 02:56 PM ----------

OK can I take kylanias code here and make this a script?

removeAllWeapons this;
this addMagazine "30Rnd_762x39_SA58";
this addWeapon "Sa58V_RCO_EP1";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addMagazine "30Rnd_762x39_SA58";
this addWeapon "M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";
this addMagazine "15Rnd_9x19_M9";


Well forget the 20 lines mags

{this addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5,6,7,8];
this addWeapon "M110_NVG_EP1";
{this addMagazine "HandGrenade_West";} forEach [1,2];

If so and it was efficient for lag I wouldn't mind making a couple load out scripts for people they would be handy and good practice.


Take it just like that only to replace weapon names and mag names add in any other things I want such as NVG etc and call it loadout_MP5.sqf, Loadout_M107TWS.sqf

Then in a players init line just add "player execvm load out_M107TWS.sqf;

Would that work and If I made a smaller groups and loaded them out like that would it cause less lag if I were able to make it a group command using the _x parameter?