Page MenuHomeFeedback Tracker

addMagazineAmmoTurret and magazinesAmmoTurrets commands
New, WishlistPublic

Description

The number of turret commands has increased thanks to vehicle firing, but the game is still missing 2 crucial commands that in my opinion should have been included since Operation Arrowhead:

<b>addMagazineAmmoTurret</b>

<u>Syntax:</u> vehicle addMagazineAmmoTurret [magazineName, turretPath, ammoCount]

<b>magazinesAmmoTurrets</b>

<u>Syntax:</u> magazinesAmmoTurrets vehicle

Example of return value for UH-80 Ghost Hawk:
<pre>[
["168Rnd_CMFlare_Chaff_Magazine", [-1], 168],
["2000Rnd_65x39_Belt_Tracer_Red", [1], 2000],
["2000Rnd_65x39_Belt_Tracer_Red", [2], 2000]
]</pre>

This would make the coding of vehicle persistence a whole lot easier.

In order to get/set turret loadouts, a combination of all the following commands is currently required, which is the cause of many headaches:
magazinesAmmo, allTurrets, magazinesTurret, currentMagazineTurret, currentMagazineDetailTurret, addMagazineTurret, addMagazine, setVehicleAmmo

Details

Legacy ID
1850660151
Severity
None
Resolution
No Bug
Reproducibility
N/A
Category
Feature Request

Event Timeline

AgentRev edited Steps To Reproduce. (Show Details)Nov 15 2014, 4:11 AM
AgentRev edited Additional Information. (Show Details)
AgentRev set Category to Feature Request.
AgentRev set Reproducibility to N/A.
AgentRev set Severity to None.
AgentRev set Resolution to No Bug.
AgentRev set Legacy ID to 1850660151.May 7 2016, 7:50 PM

There are setMagazineTurretAmmo and magazineTurretAmmo commands, at least on dev, don't know if they got fixed, they were added half baked.

No need to make duplicates, this could be simply unresolved :)

I tried to reopen it before making the new one, but it said access denied.

It wasnt closed, strange.

Any chance you can post how your currently doing it AgentRev?

@ozdeadmeat

Get: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/8b5ef5c074f06a121dbef4c8592a1e6fc9f4d52e/persistence/server/world/fn_getVehicleProperties.sqf#L89-L130

Set: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/bea287b258577d4005f8bd89b7f2fc25aa386d25/persistence/server/world/vLoad.sqf#L151-L167

getMagazineDetailAmmo: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/caad218505f736b7e1019a784d3c02a351b43eed/server/functions/getMagazineDetailAmmo.sqf

It's far from perfect, but it gets the job somewhat reasonably done. A couple notes:

  • "_turretMags<b>2</b>" doesn't contain ammo counts, as they can't be retrieved reliably for those mags.
  • "_turretMags<b>3</b>" stuff could be done more easily by using magazineTurretAmmo and setMagazineTurretAmmo
  • "fn_getFromPairs" can be replaced with "BIS_fnc_getFromPairs". Although, I don't really recommend using BIS pair functions on a regular basis, as they are horribly inefficient and unnecessarily restrictive.