Skip to content

Conversation

@LorenLuke
Copy link
Contributor

Ultra-lightweight reimagining of #7485.

When merged this pull request will:

  • Add pilot cameras to vanilla UAVs.
  • Provide additional UI to UAV usage, including horizontal compass
  • Slave UAV turret and designator to tracked pilot camera point when locked (Ctrl+T), as long as its gunner position is not occupied by a player.

Known Issues:

  • UAV Pilot camera shares the same location with the regular internal camera, meaning the UAV body obscures the view when looking backwards. (Solution unknown at this time)

@LorenLuke
Copy link
Contributor Author

Requesting Review.

@jonpas jonpas added kind/feature Release Notes: **ADDED:** status/review-pending labels Nov 16, 2021
@jonpas jonpas added this to the Ongoing milestone Nov 16, 2021
@LinkIsGrim LinkIsGrim self-requested a review July 14, 2023 21:54
@LinkIsGrim
Copy link
Contributor

Testing looks good but I'm really worried about breaking things with this.

@PabstMirror PabstMirror self-requested a review September 7, 2023 04:44
class ADDON {
name = COMPONENT_NAME;
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ace_interaction? Why not ace_common?

Comment on lines +12 to +17
if (isNull _vehicle) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
};
if (!alive _vehicle) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

objNull is already dead, no need to check twice.

Suggested change
if (isNull _vehicle) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
};
if (!alive _vehicle) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
};
if (!alive _vehicle) exitWith {
[_pfhID] call CBA_fnc_removePerFrameHandler;
};

Comment on lines +18 to +25
if ("GUNNER" in (UAVControl _vehicle)) exitWith {
_vehicle lockCameraTo [objNull, [0]];
};
if ((getPilotCameraTarget _vehicle) select 0) then {
_vehicle lockCameraTo [getPilotCameraTarget _vehicle select 1, [0]];
} else {
_vehicle lockCameraTo [objNull, [0]];
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ("GUNNER" in (UAVControl _vehicle)) exitWith {
_vehicle lockCameraTo [objNull, [0]];
};
if ((getPilotCameraTarget _vehicle) select 0) then {
_vehicle lockCameraTo [getPilotCameraTarget _vehicle select 1, [0]];
} else {
_vehicle lockCameraTo [objNull, [0]];
};
private _target = getPilotCameraTarget _vehicle;
if ("GUNNER" in (UAVControl _vehicle) || {!(_target select 0)}) exitWith {
_vehicle lockCameraTo [objNull, [0]];
};
_vehicle lockCameraTo [_target select 1, [0]];

Comment on lines +9 to +10
params ["_args", "_pfID"];
_args params ["_vehicle"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params ["_args", "_pfID"];
_args params ["_vehicle"];
params ["_vehicle", "_pfhID"];

_vehicle lockCameraTo [objNull, [0]];
};

}, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler;
}, 0.1, _vehicle] call CBA_fnc_addPerFrameHandler;

if (!unitIsUAV _vehicle) exitWith {};
if (!hasPilotCamera _vehicle) exitWith {};

GVAR(pfehID) = [{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GVAR(pfehID) = [{
[{

_vehicle lockCameraTo [objNull, [0]];
};

}, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason as to why you are adding a PFH to every single drone in a mission? Imo you need to find a way of adding it to player-controlled drones only.

@@ -0,0 +1,28 @@
#include "script_component.hpp"

["Air", "init", {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole bit needs comments.

Comment on lines +5 to +6
initAngleX=0; minAngleX=0; maxAngleX=0;
initAngleY=0; minAngleY=0; maxAngleY=0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
initAngleX=0; minAngleX=0; maxAngleX=0;
initAngleY=0; minAngleY=0; maxAngleY=0;
initAngleX = 0;
minAngleX = 0;
maxAngleX = 0;
initAngleY = 0;
minAngleY = 0;
maxAngleY = 0;

Comment on lines +36 to +37
showUAVViewInOptics= false;
showSlingLoadManagerInOptics= false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
showUAVViewInOptics= false;
showSlingLoadManagerInOptics= false;
showUAVViewInOptics = false;
showSlingLoadManagerInOptics = false;

Comment on lines +39 to +42
x = "6.0 * (0.01875 * SafezoneH)";
y = "1.75 * (0.025 * SafezoneH)";
w = "41.3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = "6.0 * (0.01875 * SafezoneH)";
y = "1.75 * (0.025 * SafezoneH)";
w = "41.3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
x = "6.0 * (0.01875 * SafezoneH)";
y = "1.75 * (0.025 * SafezoneH)";
w = "41.3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";

visionMode[] = {"Normal","NVG","Ti"};
thermalMode[] = {0,1};
gunnerOpticsModel = "\A3\Drones_F\Weapons_F_Gamma\Reticle\UAV_Optics_Gunner_wide_F.p3d";
//gunnerOpticsModel = "\A3\Weapons_F\Reticle\Optics_Gunship_wide_F.p3d";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//gunnerOpticsModel = "\A3\Weapons_F\Reticle\Optics_Gunship_wide_F.p3d";

If it's commented out, It doesn't need to be here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Release Notes: **ADDED:** status/review-pending

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants