Page MenuHomeFeedback Tracker

Missing UAV terminal scripting commands
Feedback, NormalPublic

Description

After working and figuring out all details about workings of UAV Terminals I figured that they're pretty buggy and hard to be fixed through scripting. Here is collection of missing scripting commands that are needed to make working with terminals much easier.

1. No way to disconnect UAV from terminal if its not equipped by the player
connectTerminalToUAV can only disconnect if terminal is equipped by the player, I originally wanted to suggest extending the command to make objNull connectTerminalToUAV uav disconnect the UAV from whatever it was connected to, but this has a slight potential for backwards compatibility issues.

  • Solution: Introduce new command: BOOL = disconnectUAV ENTITY

ENTITY is UAV vehicle
BOOL returns true if it was connected and disconnected, false if it wasn't connected and disconnection wasn't needed

2. No way to get terminal that UAV is connected to
isUAVConnected only returns a flag but nothing about terminal and where it is.

  • Solution: Introduce new command: ARRAY = getConnectedTerminal ENTITY

ENTITY is UAV that might be connected to some terminal
ARRAY consists of [ENTITY, STRING] with ENTITY being vehicle that holds the terminal: player's backpack, ground weapon holder, a vehicle, player unit (assigned to GPS slot) and STRING is terminal class name.
Return empty array if UAV is not connected anywhere.

3. No way to get which player\unit controls certain UAV unit
Right now there is no easy way to know which player\unit controls certain UAV unit, you can only get a link from unit with getConnectedUAVUnit but this will require you to walk through all units in the game.

  • Solution: Introduce getter commands for remote control: ENTITY = getRemoteControlBy ENTITY, I have a dedicated ticket about this problem: T171207

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
UAV (Unmanned Aerial Vehicle)
Additional Information

Brief of new commands:
BOOL = disconnectUAV ENTITY
ARRAY = getConnectedTerminal ENTITY
ENTITY = getRemoteControlBy ENTITY

If somebody is willing to do this, I'll make repro scripts to quickly test new commands.

Event Timeline

SaMatra created this task.Apr 4 2023, 1:15 PM

have you looked at UAV actions via action command?

SaMatra added a comment.EditedApr 4 2023, 3:42 PM

have you looked at UAV actions via action command?

I did, none work. Typical situation would be: Player connects to UAV with Terminal, then drops the terminal somewhere, until terminal is deleted or equipped and disconnected, you can't connect to the drone anymore with a new terminal. This also creates issues in MP, remote clients can still connect and if hidden terminal is picked up you end up with several players connected to same drone which game supposedly doesn't allow.

SaMatra added a comment.EditedApr 4 2023, 3:49 PM

Also I'd ditch this entire hardcoded UAV Terminal system and written my own with remoteControl but the command is absolutely terrible, my ticket T171207 has an example how player can be put into remote control without a proper way to revert it. And there are no getters for remote control either. Fixing remoteControl will also be appreciated.

BIS_fnc_KK set Ref Ticket to AIII-55853.Aug 2 2023, 12:24 AM
This comment was removed by BIS_fnc_KK.
This comment was removed by BIS_fnc_KK.
  1. is done in T171207

Works great but command 2 is still missing, it is very troublesome to find player that is connected to a UAV, you need to iterate through every unit and check with getConnectedUAV

how do you see this? there could be many players connected but the connection is processed locally so all you can do is check if a particular player is connected to uav where player is local

SaMatra added a comment.EditedDec 17 2023, 12:55 PM

how do you see this? there could be many players connected but the connection is processed locally so all you can do is check if a particular player is connected to uav where player is local

There is isUAVConnected that checks it and it works in multiplayer, remote units get true when somebody is connected, isn't there a link from UAV to whoever is connected to it? Thought it is technically possible to have several players connected through a bug, then this command won't tell the full picture. Is there any other list in the game that could help with this, apart from iterating through every unit? Add an event handler that fires when somebody connects and disconnects their terminal so such list can be tracked by script perhaps?

uav addEventHandler ["TerminalConnected", {params ["_uav", "_unit"]}];

Something like this? Same with TerminalDisconnected. Maybe have similar/same event handler but from unit side?

connection is local so you can have multiple players connected to the same uav but only 2 can be pilot and gunner, the rest are good to receive video feed and take controls once freed

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Wed, Feb 21, 9:50 PM
BIS_fnc_KK changed the task status from New to Feedback.