y-shin 13 Posted April 13, 2024 Hi everyone, I've been making sandbox missions (for my units) with ACE Arsenal boxes on the ground for the guys to use, and for the last several months my ACE Arsenal is acting weird. I've tried googling for a fair amount of time but couldn't find anyone having the same problem, so as a last resort I am posting here to seek help. Here are the situation. I have 3 boxes on the ground and any player can open ACE Arsenal via addAction from the boxes. Let's say I have Player A here and he opens Box1 arsenal. Here's another player called Player B and he also opens the same Box1 arsenal. When Player B opens, the arsenal screen of Player A gets reset. By reset I mean, for example, the Player A is scrolling down the list of rifles or pistols, and the scroll is reset to the top. At the same time, I have some removed items from my Arsenal but those removed items become available. Here are my codes: arsenal.sqf // Adding virtual items to ACE Arsenal [(_this select 0), true, true] call ace_arsenal_fnc_addVirtualItems; // Removing virtual items from ACE Arsenal [(_this select 0), [ "ItemRadio", "rhs_radio_R169P1", "rhs_radio_R187P1", "rhsusf_radio_anprc152" ], true] call ace_arsenal_fnc_removeVirtualItems; // Opening ACE Arsenal [(_this select 0), player] call ace_arsenal_fnc_openBox; And the init of my arsenal boxes call{this addAction ["ACE Arsenal","arsenal.sqf"];} The reason why I'm doing this way and not the way where I put ace_arsenal_fnc_addVirtualItems into the box's init is because I want Zeus to be able to copy and paste the box anywhere he wants and the box would still work. (because when Zeus copies the box it'd mess up the variable name of the box and didn't work) If anyone could identify what I did wrong and maybe guide me to the right direction, I'd appreciate it very much! Share this post Link to post Share on other sites
y-shin 13 Posted April 14, 2024 An update: I'm guessing the whole cause is locality thing and I failed to set up the code properly. What I think I'm doing, with that code above, is that every time a player opens the box, the whole script is called again for him and any other player who already opened and is using the same arsenal box. I came up with a fixed code. Here is the arsenal.sqf _box = (_this select 0); if (local _box) then { // Adding virtual items to ACE Arsenal [_box, true, true] call ace_arsenal_fnc_addVirtualItems; // Removing virtual items from ACE Arsenal [_box, [ "BWA3_ItemNaviPad", "MCC_itemConsole", "ItemRadio", "rhs_radio_R169P1", "rhs_radio_R187P1", "rhsusf_radio_anprc152" ], true] call ace_arsenal_fnc_removeVirtualItems; // Opening ACE Arsenal [_box, player] call ace_arsenal_fnc_openBox; }; and I don't feel the need to call{} so to simplify I removed it from arsenal.sqf: this addAction ["ACE Arsenal","arsenal.sqf"]; I've only tested this locally (in Eden editor) and is waiting for the occasion to test it on dedicated server. I'll come back with another update when I test it on dedi. And if I'm wrong on any part of this, please correct me (I'm still kinda noob on scripting 🤣). Share this post Link to post Share on other sites