Page MenuHomeFeedback Tracker

addMagazineTurretAmmo & removeMagazineTurretAmmo commands
New, WishlistPublic

Description

Request for implementation of simple commands that should have been in the game for a long time but are still missing:

----------

<b><u>addMagazineTurretAmmo</u></b>

Description:

    Adds a magazine to a turret, with a specific ammo count.

Syntax:

    vehicle addMagazineTurretAmmo [magazineClass, ammoCount, turretPath]

Parameters:

    vehicle: Object
    magazineClass: String
    ammoCount: Number
    turretPath: Array

<b><u>removeMagazineTurretAmmo</u></b>

Description:

    Removes a magazine with a specific ammo count from a turret.

Syntax:

    vehicle removeMagazineTurretAmmo [magazineClass, ammoCount, turretPath]

Parameters:

    vehicle: Object
    magazineClass: String
    ammoCount: Number
    turretPath: Array

Please do NOT reply with "setMagazineTurretAmmo", that thing is badly coded and does not cover all possibilities for which the above commands would be used for. I'm looking at you, Killzone Kid.

Details

Legacy ID
3293209808
Severity
None
Resolution
Open
Reproducibility
N/A
Category
Scripting

Event Timeline

AgentRev set Category to Scripting.Jan 1 2016, 3:56 AM
AgentRev set Reproducibility to N/A.
AgentRev set Severity to None.
AgentRev set Resolution to Open.
AgentRev set Legacy ID to 3293209808.May 8 2016, 1:24 PM
AgentRev edited a custom field.

addMagazineTurret command will be extended to take additional argument with ammo count, this is in the works since last year. However removeMagazineAmmoCount is not going to work as you suggested, as this will most definitely require magazine id to identify the specific magazine, since more than one magazine can have the same amount of ammo.

I don't care if more than one magazine can have the same amount of ammo, I just want to remove <b>at least one</b> of the magazines that contain a specific quantity of ammo (e.g. the youngest one / highest ID if there are many of them)

Let me explain. Let's say I have a vanilla static weapon with 3 full magazines containing 500 ammo. With my persistence system, saved data for this static weapon shows that in the previous session, there were 2 magazines left, each with 300 and 400 ammo. Now, I want to restore those magazines with their specific ammo count, but I would like to keep the static weapon's max resupply capability at 3 mags with 500 ammo. With those commands implemented, here's what I'd do:

<pre>
// set the ammo for the 3 initial mags at 0, then:

{

    _mag = _x select 0;
    _ammo = _x select 1;
    _path = _x select 2;

    _staticWeapon removeMagazineTurretAmmo [_mag, 0, _path]; // remove one empty mag
    _staticWeapon addMagazineTurretAmmo [_mag, _ammo, _path]; // restore one saved mag

} forEach _savedMags;

reload _staticWeapon;
</pre>

And there ya go, now you have one 300-ammo mag, one 400-ammo mag, and one empty mag. So, if you bring an ammo truck near it, it will resupply it to the default 3 mags with 500 ammo. All is good, no id needed. Simple, clean, and effective. In the end, it's just about flexibility.

@<b>BIS_fnc_KK</b>: On a different note, I'm wondering - are you Killzone Kid? or a completely different guy?

<vehicle> addMagazineTurret [<magazine>, <turretpath>, <ammocount>]
Should be added in 1.55.133817

johnb43 added a subscriber: johnb43.EditedMay 6 2024, 12:09 PM

Any chance to see removeMagazineTurret get the same treatment as addMagazineTurret did (i.e. getting a third optional parameter specifying the ammo count)?

Having the command use additional magazine and creator IDs parameters would be even better.

E.g.:
vehicle removeMagazineTurret [magazineName, turretPath, ammoCount, id, creator]