Page MenuHomeFeedback Tracker

setMagazineTurretAmmo does not work depending on turret and vehicle localities
New, WishlistPublic


Run a test mission on a dedicated server with debug console enabled (I attached the repro mission I used).

To summarize, setMagazineTurretAmmo has no effect if:

  1. the vehicle is not local (eg: another player is driving my vehicle, eg 2: my vehicle is local to server)


  1. if the turret is not local (eg: another player is inside the turret) {F25327}


Legacy ID
Steps To Reproduce

By using the repro mission on a dedicated server, jump in the M4 Scorcher artillery tank as gunner (don't get inside as driver otherwise test will not be good => locality of vehicle goes from server to player computer).

Execute the following command on server and player computer and notice it fails on both cases (ammo count stays at 32 instead of going to 10):
vehicle player setMagazineTurretAmmo ["32rnd_155mm_mo_shells", 10, [0]]

Note: for execution on server you must first run: myv = vehicle player; publicVariableServer "myv"
myv setMagazineTurretAmmo ["32rnd_155mm_mo_shells", 10, [0]]

Event Timeline

d3nn16 edited Steps To Reproduce. (Show Details)Dec 30 2014, 5:13 PM
d3nn16 edited Additional Information. (Show Details)
d3nn16 set Category to Scripting.
d3nn16 set Reproducibility to Always.
d3nn16 set Severity to None.
d3nn16 set Resolution to Open.
d3nn16 set Legacy ID to 1496027515.May 7 2016, 8:02 PM

setMagazineTurretAmmo takes local argument just like many other turret commands. you can check turret locality with turretLocal and set ammo from that location or can just spam it on every computer, only one will work.

Also the command is broken, personally I did not want to add it to biki until it is fixed, but someone already did.

d3nn16 added a subscriber: d3nn16.May 7 2016, 8:02 PM

I tried what you suggest Kid but it didn't work. I was on dedicated server with another player. I went in driver seat of Scorcher. He went in gunner seat. I executed the command on my computer and on his computer without any effect (I don't remember executing on server side but I don't think that would have worked either). The only way it works is when both turret and vehicle are local, so it will never work when the locality of turret and vehicle is different.

Just checked, and yes you are right this is the case. I will add this broken locality to my ticket too.

By the way, I checked addMagazineTurret under same condition and it worked as intended. setMagazineTurretAmmo has been broken since it was introduced, now we also know how much :)

Just retested today and issue is still there in v1.44

PiepMGI added a subscriber: PiepMGI.May 7 2016, 8:02 PM

It was already the case for setAmmo (for a vehicle).