IRONFRONT FANS FORUM
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
santiagojamesaea

Sergeant
Registered:
Posts: 106
Reply with quote  #1 
I have tried..i have read arma 2 manuals and have tried to adapt scripts put in by other members on the forum but i can't get it to get "there".All codes/scripts were all put in the "init"box of the object.These are for SP missions.

Firstly i would like to say what i am trying to do.

1. Add extra magazines to a soldier (usually me!)
2.Add an extra weapon to a soldier,this would be a pistol.
3.Add binoculars to a soldier.
4.Add grenades to a soldier.
5.Add an ammo box or weapons crate to a car.
6.Unlimited ammunition.
7.US smoke grenade codes/scripts

Ok, here is what i did for each point.I looked at the "game class list"here on this forum for the details of the objects.A great help by the way.

1, extra magazines.I like the russian machine gunner with the DP machine gun.(The one with the big round magazine on the top.)The code i used was this

this addMagazines ["lib_47Rnd_762x54",2];

2 being the number of magazines .I know with this loadout there is no room for grenades.For the "x" or multiplication sign i was using the letter"x".I do not know if this is correct.

2.Extra weapon.A tokarov in this case.The code i used was this.

this addWeapon ["LIB_TT33_lib_8Rnd_762x25"];

Again for the multiplication sign i was using the letter"x".I do not know if this would give me magazines or not,and if not how to add say 6 magazines for it.

3.Add binoculars.The code i used was this.

this addBinoculars ["LIB_Binocular_su"];


4.Add grenades.Again i was using the russian type.I could not find the codes for the grenades but imagined it would be their name "RG42".The code i used was.

this addGrenade ["LIB_RG42_su",2];

2 being the number of grenades i wanted to add.



5.Add an ammo or weapons crate to a car.In this case German.The code i used was

this addBasicAmmunitionBoxCargo ["BasicAmmunitionBox_GER"];


6.Unlimited ammunition.The idea is to have static troops firing from a trench system.Logic says they would be well supplied,hence unlimited ammo.I have them positioned in the trench and have disabled(it was on youtube)their ability to move.But NO idea on unlimited ammo code...any help?

7.Does anyone know the code for the US smoke grenades,their multi colours are great!

Thank you.







0
BRS

Captain
Registered:
Posts: 197
Reply with quote  #2 
I hope I understand well what you want. Please place this into your soldier INI line:
removeAllWeapons this; this addMagazine "lib_47Rnd_762x54"; this addMagazine "lib_47Rnd_762x54"; this addMagazine "lib_47Rnd_762x54"; this addMagazine "lib_47Rnd_762x54"; this addWeapon "LIB_DP28"; this addMagazine "lib_8Rnd_762x25"; this addMagazine "lib_8Rnd_762x25"; this addMagazine "lib_8Rnd_762x25"; this addMagazine "lib_8Rnd_762x25"; this addMagazine "lib_8Rnd_762x25"; this addMagazine "lib_8Rnd_762x25"; this addWeapon "LIB_TT33"; this addMagazine"lib_rg42"; this addMagazine"lib_rg42";  this addMagazine"lib_rg42"; this addMagazine"lib_rg42"; this addWeapon "LIB_Binocular_SU";
I think this is what you needed for the weapon layout.

For point 5,6,7 I must have a look if time.
0
Tayuk

Avatar / Picture

RM Team
Registered:
Posts: 456
Reply with quote  #3 
To add an individual magazine to a player you would use this command
this addMagazine "lib_47Rnd_762x54";


If you want more than 1, you just use same command twice (maybe a quicker method to get more, but this is the one I know ).

To add a weapon, use this
this addWeapon "LIB_TT33";

Please note that say you were giving your unit a new main weapon using the above method, the original weapon would need to be removed 1st, to do that you would use this command
this removeWeapon "whatever the weapon class name is in here";

and this to remove a single magazines, repeat code for the number of magazines you want to remove. I am sure there is a quicker code to remove all, but I haven't used it. maybe someone else could post it
this removemagazine "the magazine class name in here";


And to add individual magazines for this pistol
this addMagazine "lib_8Rnd_762x25"; 


Note that if adding a new weapon, always add at least one magazine for that weapon before adding the weapon, this way the weapon will be loaded when you first use it. If you add weapon first the weapon is unloaded when you use it and you have to use the reload button (not a major issue until you need it fast ).

The add binoculars
this addWeapon "Binocular";


To add grenades
this addmagazine "LIB_RG42";


To add smoke grenades, just change the colour to the one you want, smokeshell on its own is the white
this addmagazine "smokeshellGreen";


You cant physically add an ammo crate to a vehicle. But all vehicles have cargo space, so you can add various weapons and magazines in the same way we do for units as shown above.

An ammo crate can be made to look like its been added to a vehicle using scripts. I just so happen to have one such script here
Create ammo box next to vehicle and put camo net over vehicle script

To find the correct class names for all the items in the game see here
Class list

Lets get editing

0
BRS

Captain
Registered:
Posts: 197
Reply with quote  #4 
unimited ammo..
I wouldn't like it because it's like arcade gaming. I would try to write a script to let the soldiers run to crate and resuply themselves.
Nevertheless this should do the trick in soldiers Ini-line:
Quote:
this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];
0
BRS

Captain
Registered:
Posts: 197
Reply with quote  #5 
You really want a new sightable ammo crate
or just add extra ammo and weapons into the existing cargo space?

for the last : put into the cars ini-line i.e.:
this addmagazinecargo ["LIB_1Rnd_RPzB",24]; this addmagazinecargo ["lib_30Rnd_792x33",12]; this addweaponcargo ["lib_G43",50];
0
santiagojamesaea

Sergeant
Registered:
Posts: 106
Reply with quote  #6 
Wow, thank you BS and Tay_uk,

unbeleivably helpful,and for the mail too.It hadn't occured to me for troops to run to an ammo dump to resupply,quite frankly i didn't know that sort of realism could be scripted.Of course you would then have to have it defended,and the attacker would have to take out the defenders, and then hold it against anyone coming back to rearm.Thus suppporting the attack...Hero stuff!wow! I had just thought of a trench full of ammo...This game rocks!!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.