acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
1.01k stars 737 forks source link

ace_arsenal_fnc_getVirtualItems not working in multiplayer initialization #10491

Closed L-McKendrick closed 2 weeks ago

L-McKendrick commented 2 weeks ago

This is my first bug report so I apologize for any mistakes. Thank you!

Mods (complete and add to the following information): CBA and ACE3 only

Arma 3: 2.18 Stable CBA: 3.18.1 ACE3: 3.18.1 Description: Using ace_arsenal_fnc_getVirtualItems in an init environment behaves differently between singleplayer and multiplayer. In multiplayer, ace_arsenal_fnc_getVirtualItems returns an empty hash in an init environment.

Steps to reproduce:

  1. In the editor, place a supply box.
  2. Enable an item in the Object: ACE Arsenal attributes of the supply box.
  3. In the object init, put hint str (this call ace_arsenal_fnc_getVirtualItems) (or any similar diagnostic code)
  4. Preview the mission in singleplayer, note the hint.
  5. Preview the mission in multiplayer, note the hint.

While singleplayer will correctly display what you added in step 2, multiplayer will only return an empty hash. Ideally, the function ace_arsenal_fnc_getVirtualItems should also work correctly in multiplayer.

Where did the issue occur? Experienced on: Self-Hosted Multiplayer, Singleplayer

johnb432 commented 2 weeks ago

Ideally, the function ace_arsenal_fnc_getVirtualItems should also work correctly in multiplayer.

It does, you just need to add a delay - the arsenal isn't immediately available in MP. See if adding a delay to your ace_arsenal_fnc_getVirtualItems call makes a difference.

L-McKendrick commented 2 weeks ago

Thank you