Page MenuHomeFeedback Tracker

[Feature Request] Getters for situations regarded to controlling units
New, NormalPublic

Description

I've found out that there are some commands I want to have.

  • Camera getter
    • If a camera is taking the main screen
    • Basically getter for cameraEffect
    • Should return objNull if no camera is taking the screen
  • remoteControl getter
    • I know Zeus' Remote Control has a variable to get it, but I want more generic command to get
    • Maybe I'm missing some command but it is also nice to have ability to get controlling UAV (opposite to UAVControl)
  • Mouse getter
    • If a mouse is shown, true, otherwise false
    • Basically a getter for controllable Displays/Dialogs
  • Control getter
    • If the game has a control of “player” unit, true, otherwise false
    • Sometimes it does not allow us to control the entire player controls like when we use switchCamera... or, is it some kind of bug? It feels very inconsistent

It is nice to have a function to get the true player unit once we got such commands.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Additional Information

Some ideas actually:

mouseShown // boolean
remoteControlling player // object
effectiveCamera // object, maybe [object, [string, string]] where those strings represents the cameraEffect effects
haveControl // boolean, if the player have the full control of the "player" unit
private _return = objNull;

// if no camera takes the screen
if (isNull (effectiveCamera#0)) then {
	// if you have the control of the unit
	if (haveControl) then {
		// if the player is remotecontrolling nobody
		if (isNull (remoteControlling player)) then {
			// return player
			_return = player;
		} else {
			// return controlled unit
			_return = remoteControlling player;
		};
	};
};
_return

Could be a handy thing to detect what's the current actual player unit.

Event Timeline

POLPOX created this task.Jul 16 2023, 10:11 PM

focusOn that is introduced in 2.15 solved this ticket partially, but I'd like to see more commands for such things.

Oh yeah, I literally forgot that, yeah that would "fix" this too.