Page MenuHomeFeedback Tracker

[BROKEN] New scripting commands addMagazineGlobal and removeMagazineGlobal are messed up
Closed, ResolvedPublic



b:OBJECT addmagazineglobal STRING
b:OBJECT removemagazineglobal ARRAY,STRING


b:OBJECT addmagazineglobal ARRAY,STRING
b:OBJECT removemagazineglobal STRING
{F21275} {F21276}


Legacy ID
Steps To Reproduce

player addmagazineglobal [currentMagazine player, 1] <- ERROR
player removemagazineglobal [currentMagazine player, 1] <- DOESN'T DO ANYTHING

Additional Information

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Fixed.
Killzone_Kid set Legacy ID to 2633565530.May 7 2016, 3:52 PM

This is pretty obvious bug so please if you upvote, comment as well to bump this so that it will be fixed while it is still warm :)

"Mea culpa" removeMagazineGlobal really has wrong syntax, and will be fixed soon.
But addmagazineglobal STRING is fine for me, no one ask me about fully re-implementation from addMagazine, so I did a variant with one STRING only. going to see how many work would take ARRAY modification.

stay tuned ;-)

removeMagazineGlobal (ArrayOrString) has been changed into (String) only

addMagazineGlobal (Array) - I have to consult this modification with our security experts because within a concrete circumstances I see a potential security bottle neck :-\

so you have to use addMagazineGlobal in a FOR cycle(for example) instead

Ho ho mister Bond, we meet again!

Seriously though, it is expected this to be a "global" version of addMagazine. Besides think about it, if you want to add 10 magazines to remote unit you can either make 1 network call or 10 because array command is not available. It is worth the effort.

yep.. I know, it is quite overkill to send two,five,ten.. a million single commands instead of a the complex one. As I said, will discuss some issues with the strange guy from security department and then will see what we can do for you ;-) but today is a sunday and yes, I am at work(which is so sad) but the rest of BI have enjoyed weekend.

You should know, you're doing great job, making us, script fiddlers, very happy and making ArmA 3 so much more accessible!

Instead of addMagazineGlobal array, addMagazinesGlobal command needs to be added to complement addMagazines command to make multiple magazine add on remote unit possible. Not related to this ticket so it could be closed as fixed.

We need addMagazineGlobal [_magazine, _ammocount]

addMagazineGlobal "HandGrenade" does not work, it adds a handgrenade to the player object on the server, but not on the client.

addMagazine "HandGrenade" does work, adds a handgrenade on the client, but not on the server

Tupolov: what does [addMagazineGlobal "HandGrenade" does not work] mean?

addMagazineGlobal "HandGrenade" DOES work. Seriously, check your game integrity, I cannot reproduce any of the bugs you posted here or in the other ticket.

updated. It does not add a Handgrenade to the player when run on the client. It does add the handgrenade to the player object on the server. The expected behaviour is to add a grenade to both client and server player objects.

Please run player addMagazineGlobal "Handgrenade" on client and tell me if it adds a handgrenade to your inventory.

it does on mine.

Apologies, I should clarify. This command fails for a JIP player.

What does this mean? Any steps to repro exactly this?

  1. Start a dedicated server session and ensure the session is set to persistent = 1 and ensure DisableAI is set.
  2. Disconnect from the server
  3. Reconnect to the server
  4. Run the addMagazineGlobal command on the client and no grenade is added to the inventory.

Nope works as intended. Are you sure you have place in your inventory for handgrenade?

ok, I see you can't reproduce my addItemToUniform bug either, clearly I've got some issue with my script on reconnect. Will double check. Sorry to waste your time. Its not working for me, so must be something other than these commands..

Are you trying it with clean mission or in existing mission? Have you got any mods enabled?

no mods. I'm writing my own persistence mission, so storing player state on server and restoring the state to the client on reconnect. Also written a JSON extension to push state out to CouchDB, but that's another story! Its all working other than vest/uniform state and being able to restore globally ammo count on mags.

Obviously somewhere I'm doing something wrong with vest/uniform as backpack restore works fine.

I still need addMagazineGlobal [_mag,_ammocount] though :)

Repro mission attached.

Run mission on dedicated server.

The mission has an init entry for the player.

During player init the script (both client and server) removes and adds a uniform, removes and adds a vest. On client, Adds handgrenade to uniform and vest using addItemToXXX, adds a smokeshellgreen using addmagazineglobal. Logs uniform/vest state to rpt before and after additions on both client and server.

Check the server and client logs to see uniform/vest state during init.

Press Radio Alpha to get uniform/vest state post init.
Press Radio Bravo to add items.


On Client - handgrenade added to vest and uniform, no smokeshell added
On Server - only smokeshell added (post init)


On Client - handgrenade added to vest and uniform, smokeshell added to uniform
On Server - handgrenade added to vest and uniform, smokeshell added to uniform

Killzone_Kid: thanks for nice spreadsheet. Now I'm working on a big task with a priority, but after that(let's say in a week) I will switch back to bugfixing mode ;-)

Can't wait! :-)

Ok ignore above figured this out. This is how it doesn't work

player addMagazine "Laserbatteries"; works
player addMagazineGlobal "Laserbatteries";

but when together with addweapon

player addMagazine "Laserbatteries"; DOESN'T WORK
player addWeapon "Laserdesignator";

player addMagazineGlobal "Laserbatteries"; works
player addWeapon "Laserdesignator";


So is it broken or not?

It is broken until proven fixed, your honor :-)

now I'm waiting for feedback on this issue and meanwhile I'm working on some minor(as I hope) gameplay issues

Poor japapatramtara, you probably are having dreams about all inventory issues by now :)


I have updated the spreadshit with all addItem and addMagazine commands, have fun :)

Oh and you might want to look at this invisible uniform issue

Ok retested and now both addMagazine s don't work if weapon added immediately after

player addMagazine "Laserbatteries"; DOESN'T ADD
player addWeapon "Laserdesignator";

player addMagazineGlobal "Laserbatteries"; DOESN'T ADD
player addWeapon "Laserdesignator";

Mostly resolved. Few things that need to be looked at moved here #20713

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums ( if you feel your bug was closed in error.