Page MenuHomeFeedback Tracker

setUnitLoadout can't set UAV terminal in the editor
Closed, ResolvedPublic

Description

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).

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Operating System Version
22631.3155
Category
General
Steps To Reproduce
  1. Create a mission, place down a unit (without a UAV terminal), then select said unit.
  2. 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.

Additional Information

See https://discord.com/channels/976165959041679380/1212011948896423936.

This bug currently breaks ACE' ability to set terminals in the editor.

Event Timeline

johnb43 created this task.Mar 3 2024, 12:03 PM

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.

dedmen added a subscriber: dedmen.EditedMar 4 2024, 5:53 PM

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

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.

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?

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

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

dedmen closed this task as Resolved.Mar 6 2024, 11:01 AM
BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Mar 6 2024, 8:22 PM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.