Jump to content
Sign in to follow this  
helling3r

M4/203/rco?

Recommended Posts

Hello,

i am searching for the class name of the standard rifle issued to a teamleader placed in OA with the editor. i searched for about 3m hours now but i cant seem to find it in the various lists :(

---------- Post added at 00:20 ---------- Previous post was at 00:20 ----------

And also how do i place items in a backpack in the init line in the editor?

Share this post


Link to post
Share on other sites

http://community.bistudio.com/wiki/ArmA_2_OA:_Backpacks

unitBackpack soldier1 addMagazineCargo ["Y",X];

where Y is the classname of the item you want to place in the backpack and X is the amount.

http://www.armatechsquad.com/ArmA2Class/

This should help you out. If the line of code above doesn't work then you could try sticking it in a script and calling it from there.

Good luck!

Share this post


Link to post
Share on other sites

Hello, regarding the backpacks: i know the site, but it doesn't tell me how i can add custom items to the backpack. How can i do that?

regarding the M4 question: i also know the techsquad site but i cant find the requested rifles class name there, every rifle i tried was not the version i wanted.

Share this post


Link to post
Share on other sites

Glad you got your answer, but all the information is in my post, backed up with Sickboys one. If you remember the name of the rifle then you'll find it and the line of code in my post tells you how to add items.

Share this post


Link to post
Share on other sites

Also, you can use hint str primaryWeapon this; or hint str weapons this; in the unit's init line to see what he has. Often it's faster than browsing through those classlists ;)

Share this post


Link to post
Share on other sites

just a side note:

regarding this "M4A1_RCO_GL" maybe it was the one you were looking for.

i can get its name and such and equip the weapon just fine, but a cfgWeapon check for weapons magazines simply stops and puts out no errors in rpt.

All other weapons works fine just not that one.

It works as normal if taken from a crate or manually added by script, but cfgWepons on this one seem to be messed up or different to all the other A2 and OA vanilla weapons.

Share this post


Link to post
Share on other sites
just a side note:

regarding this "M4A1_RCO_GL" maybe it was the one you were looking for.

i can get its name and such and equip the weapon just fine, but a cfgWeapon check for weapons magazines simply stops and puts out no errors in rpt.

All other weapons works fine just not that one.

It works as normal if taken from a crate or manually added by script, but cfgWepons on this one seem to be messed up or different to all the other A2 and OA vanilla weapons.

Nah, M4A1 RCO GL, has several muzzles, hence you can't get it at the weapon

http://browser.dev-heaven.net/cfg_weapons/config/M4A1_RCO_GL?version=37#L14

need to use >> "CfgWeapons" >> "M4A1_RCO_GL" >> "M4_ACOG_Muzzle" >> "magazines"

Share this post


Link to post
Share on other sites

ok, will try that but getting magazine for any other gl weapon worked and on them i used:

_magazinearray = getArray (configFile >> "CfgWeapons" >> _weaponUsed >> "magazines");

and this to get grenade launcher ammos:

_GL_magazine_array = getArray (configFile >> "CfgWeapons" >> _weaponUsed >> _muzzlearray select 1 >> "magazines");

I did it on every weapon in vanilla, only one sticking out as not working was the "M4A1 RCO GL", wich simply stopped the script at the _magazinearray line with no errors in rpt, simply just stopped.

But what you say is that i need to check its primary muzzle to get its magaxines, and again, only this weapon out of all sides, weapons in vanilla A2 + OA + BAF + PMC

Edit: there was no problems with any of the rifles with GL even though they have multiple muzzles.

Edit2: when i selected muzzle select 0 and then got magazines from that it worked fine on "M4A1 RCO GL" no errors or stops.

Edited by Demonized
added edit:

Share this post


Link to post
Share on other sites

If the weapons are multi muzzle then you need to get the magazines array of the muzzle you are after. Even if the weapon class contains a magazines array.

But if the muzzle[] array contains "this", then the magazines of the rifle class are used.

The RCO has;

muzzles[] = {"M4_ACOG_Muzzle", "M203Muzzle"};

so you need them from the M4_ACOG_Muzzle.

Another weapon like http://browser.dev-heaven.net/cfg_weapons/config/M4A1_HWS_GL_SD_Camo?version=47

has

muzzles[] = {"this", "M203Muzzle", "ACE_M203Muzzle_AI"};

so you can use the rifle class.

Share this post


Link to post
Share on other sites
But if the muzzle[] array contains "this", then the magazines of the rifle class are used
this was true on the other weapons in vanilla, ive simply just adapted my checks to select muzzle select 0 for magazines on all weapons.

That should work even if its [this] right?

Another thing: if above is ok, then that means that my checks will be working on all ACE weapons as well?

making it ACE compatible?

Edited by Demonized

Share this post


Link to post
Share on other sites
this was true on the other weapons in vanilla, ive simply just adapted my checks to select muzzle select 0 for magazines on all weapons.

That should work even if its [this] right?

Nope.

Something like;

_muzzles = getArray(configFile >> "CfgWeapons" >> "weapon" >> "muzzles");
_mags = if ("this" in _muzzles) then { getArray(configFile >> "CfgWeapons" >> "weapon" >> "magazines") } else { getArray(configFile >> "CfgWeapons" >> "weapon" >> _muzzles select 0 >> "magazines") };

Edited by Sickboy

Share this post


Link to post
Share on other sites

right, ok... :) ill keep my if weapon == .... thing then.

Any advice on making a overall weapons check for any ace weapons, or a seperate check if weapon is ACE do sumthing...?

goal is to find any rifle with a gl and get magazines and gl magazines to give to AI in my Ai shoot flare script.

Edit: right if [this] check seems logical :)

Edit:2 maybe this works just fine on any ACE weapon as well.

Edit 3: question, is Any rifle with gl in ACE muzzles like this?

["bullet_muzzle",gl_muzzle"]

Also ive noticed that for the m203 etc there are a muzzlenames with the ai in it... is this for AI only or is it another fucntion?

Edited by Demonized

Share this post


Link to post
Share on other sites
or a seperate check is weapon is ACE do sumthing...?

Iterate over CfgWeapons class, and check for ace prefix;

_tag = "ace_"; _c = count toArray(_tag);
_ar = toArray(configName _entry);
if (count _ar > _c) then {
  _nar = [];
  for "_i" from 0 to (_c - 1) do { _nar set [_i, _ar select _i] };
  if (toLower(toString(_nar)) == _tag) then { /* Do stuff */ };
};

---------- Post added at 23:55 ---------- Previous post was at 23:55 ----------

edit:2 maybe this works just fine on any ACE weapon as well.
Yep should. Edited by Sickboy

Share this post


Link to post
Share on other sites

last question:

question, is Any rifle with gl in ACE muzzles like this?

["bullet_muzzle",gl_muzzle"]

Also ive noticed that for the m203 etc there are a muzzlenames with the ai in it... is this for AI only or is it another function?

Edited by Demonized
fixed typos :)

Share this post


Link to post
Share on other sites

wait, what is the meaning of "_muzzlearray select 1"??

What is this "_muzzlearray"????I didn't see the definition of it.

I still don't know how to find out the array of GP25 and so on.

Share this post


Link to post
Share on other sites
wait, what is the meaning of "_muzzlearray select 1"??

What is this "_muzzlearray"????I didn't see the definition of it.

I still don't know how to find out the array of GP25 and so on.

Look at my AI shoot flares script, in there you will see how i find GL and Ammo for any weapon.

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  

×