Jump to content
Sign in to follow this  
RANKER

only one part work Why?

Recommended Posts

Hi people

Maybe someone can help me with this, I am not looking for a script

only the part that I have to wright in the AI's initialization box.

n.b this part work perfectly.

After sellecting the AI I wrote in his initialization box...

this removeWeapon "M4A1"; this removeMagazines "30Rnd_556x45_Stanag";

I found out that if I write magazine (without the "S"),only one magazine

is remove.

==========================

Now, I want to replace the M4A1 by an MK17_TWS_SD and all the

magazines the AI can carry, but I am wondering why it doesn't work!?

this AddWeapon "MK17_TWS_SD"; this AddMagazines "MK17_SD_Mag";

do you have any idea where is my mistake??

All the very best

Share this post


Link to post
Share on other sites

simply because there is no command called AddMagazines, you can use

{this addMagazine "MK17_SD_Mag"} foreach [1,2,3,4,5,6];

wich will give the unit 6 magazines.

Share this post


Link to post
Share on other sites

[GLT]Myke

Thank you very much for this link sir, greatly appreciative.

Demonized

quote:..{this addMagazine "MK17_SD_Mag"} foreach [1,2,3,4,5,6];

wich will give the unit 6 magazines. end of quote.

1) When you say for each [1,2,3,4,5,6]; do you mean that I have to

copy & paste 6 times... this addMagazine "MK17_SD_mag" ????

2) If the first part (as I stipulated previously) work perfectly, Am I

oblige to use {"} ??

b.t.w many thanks to have take from your time to answer me sir.

All the very best

Share this post


Link to post
Share on other sites

1) no, that code prevents you from having to copy/paste 6 times, it does it for you. :) Basically it's saying "Do 'this addMagazine "MK17_SD_Mag"' for each of 6 times, 1 through 6".

2) No, the { } is part of the forEach command. Both of these are the same:

{this addMagazine "MK17_SD_Mag";} forEach [1,2,3,4,5,6]; this addWeapon "MK17_TWS_SD";

this addMagazine "MK17_SD_Mag"; this addMagazine "MK17_SD_Mag"; this addMagazine "MK17_SD_Mag"; this addMagazine "MK17_SD_Mag"; this addMagazine "MK17_SD_Mag"; this addMagazine "MK17_SD_Mag"; this addWeapon "MK17_TWS_SD"; 

You can tell though, how one is easier to type and read than the other.

Share this post


Link to post
Share on other sites

Ok good people I have follow Demonized instructions.

In the initialization box I wrote everything to the "T"

{this addMagazine "MK17_SD_Mag"} foreach [1,2,3,4,5,6];

BUT, I received a pop-up message saying...

No Entry 'bin\config.bin/CFGMagazines,MK17_SD_MAG'

Now I am in trouble lol.

[GLT]Myke & kylania thank you very much to help me understand

the meaning of those codes, without you good people, I would be

sooooo lost.

---------- Post added at 01:53 PM ---------- Previous post was at 01:42 PM ----------

Wow, I think I found out the problem, you see Demonized code was for MAGAZINES

but not for the weapon lol. So I will wright...

this addWeaponCargo MK17_TWS_SD; {this addMagazine "MK17_SD_Mag"} foreach [1,2,3,4,5,6];

I will report to you the result.

all the very best

---------- Post added at 02:01 PM ---------- Previous post was at 01:53 PM ----------

Nope no luck :confused:

The same pop-up appears:j:

Am I that dummy?

It would be cool if it it would work dough,

because all AI must have a silent weapon

for this black operation in the darkness of hell :D

Share this post


Link to post
Share on other sites

Wrong classnames.

{this addMagazine "20Rnd_762x51_SB_SCAR"} foreach [1,2,3,4,5,6];this addWeaponCargo "SCAR_H_STD_TWS_SD";

Guessing that this is the weapon you mean: http://browser.dev-heaven.net/cfg_weapons/show/346442

Probably interesting link for you: http://browser.dev-heaven.net/cfg_weapons/classlist?version=37

Please, spend more time digging through the BIWIKI. Both links above i found within minutes through the BIWIKI. Steps: checked command addWeapon -> link Category:Weapons -> ArmA 2 OA: Cfgweapons -> A2 with OA (1.56)

Please don't take offence, this is just a version of "give a man a fish and he have food for a day, teach him how to catch fish and he will have food for the rest of his life".

Share this post


Link to post
Share on other sites

As Myke said, you've got the wrong names for the items. Also removing the weapon first might be pain, so it's usually easier to remove everything and add back what you want. Like this:

removeAllWeapons this; {this addMagazine "20Rnd_762x51_SB_SCAR";} forEach [1,2,3,4,5,6]; this addWeapon "SCAR_H_STD_TWS_SD"; this addWeapon "NVGoggles"; this addWeapon "Binocular"; this addWeapon "ItemGPS";

That will clear all weapons and magazines from the unit, gives it the Scar Heavy TWS SD rifle (Mk 17 TWS SD) and 6 magazines for of SD ammo. It also gives the unit a pair of NV Goggles, Binoculars and a GPS. The clock/watch/radio/map remain even after you removeAllWeapons.

Share this post


Link to post
Share on other sites

Yesssss found it..

this removeWeapon "M4A1"; this removeMagazines "30Rnd_556x45_Stanag";

{this addMagazine "20Rnd_762x51_SB_SCAR"} foreach [1,2,3,4,5,6]; this addWeapon "SCAR_H_STD_TWS_SD";

I went back to the net and searched for class name of things, tried

those and finely it work.

It's seems that I was doing all that while you people were answering back

to my reply lol, I am sorry.

All of you are right I have to use the real CLASS NAME instead of using

the name appearing in the ammo box (while I am reviewing the mission).

To you all good people a thousand thanks for your patience in my regard,

I will try my best not to disturb you again.

BTW, I have bookmark all those links.

kylania

I will use your suggestion to the T, many thanks sir.

Share this post


Link to post
Share on other sites

Ranker, it is okay to ask but you might understand that sometimes (now this is not pointed at you, more generally speaking) it becomes annoying to answer questions that could have been solved by the questioner itself with a little more effort.

But i have to admit that you showed a very good attitude through this thread so it was a pleasure to help. Might it serve as example for other users. ;)

One last thing, please use CODE tags for scripts/scripting commands as it makes the posts better readable.

[ code ]
remove whitespaces between brackets.
[ /code ]

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  

×