setUnitLoadout is broken on 2.14.151459 profiling - it does not set UAV terminals when used in the editor (GPS is mostly fine; UAV terminals are fine when set in missions).
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 11 x64
- Operating System Version
- 22631.3155
- Category
- General
- Create a mission, place down a unit (without a UAV terminal), then select said unit.
- Execute the following code (I used the Advanced Developer Tools mod for this):
((get3DENSelected "object") param [0, objNull]) setUnitLoadout [ nil, nil, nil, nil, nil, nil, nil, nil, nil, [nil, "B_UavTerminal", nil, nil, nil, nil] ];
The unit does not have its terminal changed or added.
Whilst testing this again when writing this ticket, I found further odd behaviour, at least in regards to the comment https://community.bistudio.com/wiki?title=setUnitLoadout&diff=prev&oldid=330138.
((get3DENSelected "object") param [0, objNull]) setUnitLoadout [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ["", "ItemGPS", "ItemRadio"] ]
does not set the GPS or radio.
This code works however:
((get3DENSelected "object") param [0, objNull]) setUnitLoadout [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ["", "ItemGPS", "ItemRadio", "", "", ""] ];
All "" can be replaced by nil in both scenarios. However, you need 6 entries, otherwise the assigned items will not be assigned. It would be nice to see this info be added to the wiki page or have the command adjusted so that you don't need to specify all 6 entries.
See https://discord.com/channels/976165959041679380/1212011948896423936.
This bug currently breaks ACE' ability to set terminals in the editor.
Event Timeline
There is no designed support for nils or other missing params, the fact that it worked is a coïncidence. I will have a look if this could be turned into feature.
This bug currently breaks ACE' ability to set terminals in the editor.
UavTerminals in setUnitLoadout were broken. Thats not related to this nil stuff and missing parameters stuff.
We were checking that the item in GPS Slot, is a GPS item. But UavTerminals are actually of type "UavTerminal", not "GPS". That made this fail.
Fixed next prof
I included the nil stuff because it was only briefly mentioned on the wiki, but in an incomplete manner.
Whatever you decide to do, can it be documented in a bit more detail than what is currently there?
Excellent, thank you very much.
can it be documented in a bit more detail than what is currently there?
I'll let Lou decide that