Jump to content
Sign in to follow this  
rekrul

Adding equipment to barrels?

Recommended Posts

I read in the Editing Guide (for ArmA1) by Mr. Murray that this is possible, but I can't get it to work. I've tried both addWeapon and addWeaponCargo. Anyone done this?

I could also go with cargo containers if possible, or any other "civilian" item. I'd rather not go with a car/vehicle though.

Share this post


Link to post
Share on other sites

Edit:

Thought I had an answer for you, but after testing it it looks like I hit a dead end there.. Sorry mate :(

The non-noobs (unlike me) will probably have more luck though :D

Edited by Flightster

Share this post


Link to post
Share on other sites

Just tried what you posted above and it doesnt work, and it does say in the guide that this should work, but that was for ARMA.

What about putting it ontop of the barrel.

Name the barrel "bar1"

weapon1 = "weaponHolder" createVehicle position this; Weapon1 addMagazineCargo ["10Rnd_127x99_M107",1];  Weapon1 addWeaponCargo ["m107",1]; weapon1 setpos [(getpos bar1 select 0), (getpos bar1 select 1), .85]

Share this post


Link to post
Share on other sites

This is what I used in a mission for QG...

Empty/Object/Barrels

this addMagazineCargo ["15Rnd_9x19_M9SD",7]; this addWeaponCargo ["M9SD",1]; this addMagazineCargo ["30Rnd_556x45_StanagSD",10]; this addWeaponCargo ["M4A1SD",1]; this addWeaponCargo ["Binocular",1];

So it may well be something that closely resembles.

Hope that helps...

Share this post


Link to post
Share on other sites

You would need some kind of script that opens the ammo screen (like you would get when selecting the "gear" option from any standard ammo box).

If you can find one, the scripting for placing weapons inside of that barrel would be (worked for my ammo box, so I'm GUESSING it would be the same thing):

Create a barrelweapons.sqf":

while {alive _this} do
{
clearweaponcargo _this;
clearmagazinecargo _this;

//BIS WEAPONS//

_this addWeaponCargo ["weaponclassname",numberofweapons];

//BIS AMMO//

_this addMagazineCargo ["magazineclassname",numberofclips];


sleep 1800;
};

In the main mission folder's init.sqf:

_barrel1 addAction ["Gear", "barrelweapons.sqf", 1, false, true,""];

In the box's init (call it barrel1) space you'd then put:

null0 = this execVM "barrelweapons.sqf"; null0 = barrel1 addaction ["gear", "barrelweapons.sqf"];

PS: Cobra's script works perfectly aswel, but you wouldn't have it INSIDE of the barrel (if that's really something you want..)

Edited by Flightster

Share this post


Link to post
Share on other sites

ah no, it isn't important that it's actually inside so your method is fine, thanks!

Share this post


Link to post
Share on other sites

There's some syntax errors in that scample Flightster, also why are you adding an action that runs a repeating script on the object that already has the repeating script running? :)

barrellweapons.sqf is a loop, no need for actions as well. Also you're using _barrell1 in init, but not letting the script know what _barrell1 actually is. Leave out the actions and the init.sqf and do this instead:

Make the script as you have it in and the items init simply put the:

null0 = this execVM "barrellweapons.sqf";

Edit: Fixed :)

Edited by kylania
Deadfast's fix :)

Share this post


Link to post
Share on other sites

That code you posted kylania is incorrect, the squared brackets wrapping this are obsolete (the script works with _this, not _this select 0) :)

null0 = this execVM "barrellweapons.sqf";

Share this post


Link to post
Share on other sites
There's some syntax errors in that scample Flightster, also why are you adding an action that runs a repeating script on the object that already has the repeating script running? :)

barrellweapons.sqf is a loop, no need for actions as well. Also you're using _barrell1 in init, but not letting the script know what _barrell1 actually is. Leave out the actions and the init.sqf and do this instead:

Make the script as you have it in and the items init simply put the:

null0 = this execVM "barrellweapons.sqf";

Edit: Fixed :)

Because I'm a noob :D ;)

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  

×