Jump to content
Sign in to follow this  
giallustio

Count rounds left

Recommended Posts

Hey!

I'm trying to use the new command addMagazine array but i can't find a good way to count the rounds left in a mag. I tried with the ammo command but it doesn't work very well...Any idea?

Share this post


Link to post
Share on other sites

I made a script that displays in the form of a hint that does just this for you.

/*
Written by Horner for Giallustio
Displays current rounds out of max number of rounds
*/

private["_mag","_maxRnd","_curRnd"];

_mag = currentMagazine player;
_maxRnd = getNumber (configFile >> "CfgMagazines" >> _mag >> "count");
_curRnd = (player ammo (currentWeapon player));
hintSilent format ["%1/%2", _curRnd, _maxRnd];

Untested, let me know if it works.

Share this post


Link to post
Share on other sites

Thank you for your time! I really appreciate it!

i don't wanna know just the currentMagazine rounds left...

I'm trying to get all rounds left in each mag that i have

Share this post


Link to post
Share on other sites

Do you want it as a whole number? Like the number of rounds left for each magazine? If that's so I can whip that up in a couple seconds.

Share this post


Link to post
Share on other sites

Impossible, this functionality is missing in ArmA 2 unfortunately.

Share this post


Link to post
Share on other sites

Silly response of me if you saw it :P Yeah for some reason you can't check the ammo of a certain magazine.

Share this post


Link to post
Share on other sites

There's the new ammo count bar on magazines, that's getting the number from somewhere isn't it? Do we not have access to whatever function is doing that or is it some kind of in-engine thing?

Share this post


Link to post
Share on other sites

Yet since 1.62, there are those green bars that indicate how full is each magazine in the inventory. So there should be a way to do that since 1.62, right?

Edit. Yup, what kylania said, actually.

Share this post


Link to post
Share on other sites

It's with the gear system, so my guess it's hard coded.

BIS give us this function please :3

Share this post


Link to post
Share on other sites
Yeah! It's what i thought...But how :P

Fired Eventhandler and lots of looping doFire and reload commands, counting how many times you fired. That's how many rounds were in each mag, then use the addMagazine array to add back the mags with proper count! Brilliant!

Share this post


Link to post
Share on other sites
There's the new ammo count bar on magazines, that's getting the number from somewhere isn't it? Do we not have access to whatever function is doing that or is it some kind of in-engine thing?

setGearSlotAmmoCount, setIDCAmmoCount, gearIDCAmmoCount, gearSlotAmmoCount gear commands...

But, they do only work with IDCs/controls and only when the gear dialog is open. So they are pretty much useless.

There is a way to get the exact ammo count of all magazines a unit has but that's not easy and can have its own problems (and therefore I do not write how :), and no, it's not using a fired EH as you don't know which magazine a unit is using or if he has reloaded the weapon).

What's missing in ArmA are all the VBS2 EX commands like magazinesEX.

Xeno

Share this post


Link to post
Share on other sites

It seems with Xeno's comment you could like have the gear dialog open (not even sure if there's a scripting command for doing so), compile all the info into an array using the gear commands he mentioned, then close the dialog. A very jerry rigged way of doing it, lol.

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  

×