Jump to content
Sign in to follow this  
madrussian

Quick static weapon question

Recommended Posts

Simple test mission.  Player and one empty Mk30 HMG .50 (B_HMG_01_F).  Normally when you mount the gun, it's loaded and ready to fire.
 
I want it to have limited ammo, so I remove all but one magazine, like this:

_mags = magazines _weapon;
_mag = "";
if ((count _mags) > 0) then { _mag = _mags select 0 };
{ _weapon removeMagazine _x } foreach _mags;
_weapon addMagazine _mag;

Now when you mount gun, it's not loaded.  Reload command seems not to help.  I also tried this (same result):

_i = 0;
{
    _mag = _x;
    if (_i > 0) then { _weapon removeMagazine _mag };
    _i = _i + 1;
} foreach (magazines _weapon);

 

Any way to have the gun loaded and ready to go with one magazine only?

Share this post


Link to post
Share on other sites

Working fine here with your very first script snippet.

Running current 1.60.136470 stable.

Could try to spawn the function with a small delay, that might be it.

 

Cheers

Share this post


Link to post
Share on other sites

Interesting results, thanks!  Ran some more tests.  It seems that at soon as I run the snippet, the gun begins to automatically reload, whether it's manned or not.

 

So if I run the snippet and immediately jump onto the gun, I experience the reload.  If I run the snippet, wait 5-7 seconds and then man the gun, I don't see the reload at all.  If I jump on half way through, I miss half the reload, etc.  Is this consistent with what you're seeing, GOM?

 

My intent is to have a weapon drop (from heli), weapon disassembled in crate (two backpacks).  So you have to assemble the parts, per usual.  Upon weapon assemble, I run the limited ammo snippet (via "WeaponAssembled" event handler).  Often in my scenario, the player will be assembling the weapon under fire, and thus will want to jump on and man the gun immediately, and obviously in that case seems kind of silly if the gun doesn't come preloaded (ready to fire).

 

Wondering is there a way to "skip" the reload?

Share this post


Link to post
Share on other sites

Nice, sounds like that should work.  Will try it soon!

Share this post


Link to post
Share on other sites

1. Remove all magazines.

2. Add one magazine.

Use the same commands from the Arma2 days.

Share this post


Link to post
Share on other sites

1. Remove all magazines.

2. Add one magazine.

Use the same commands from the Arma2 days.

You did read the first three posts, right?

 

Cheers

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  

×