UAVs - Add Pilot Camera/Sane Solo Use Capability#8454
UAVs - Add Pilot Camera/Sane Solo Use Capability#8454LorenLuke wants to merge 1 commit intoacemod:masterfrom
Conversation
|
Requesting Review. |
|
Testing looks good but I'm really worried about breaking things with this. |
| class ADDON { | ||
| name = COMPONENT_NAME; | ||
| requiredVersion = REQUIRED_VERSION; | ||
| requiredAddons[] = {"ace_interaction"}; |
There was a problem hiding this comment.
Why ace_interaction? Why not ace_common?
| if (isNull _vehicle) exitWith { | ||
| [_pfID] call CBA_fnc_removePerFrameHandler; | ||
| }; | ||
| if (!alive _vehicle) exitWith { | ||
| [_pfID] call CBA_fnc_removePerFrameHandler; | ||
| }; |
There was a problem hiding this comment.
objNull is already dead, no need to check twice.
| 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; | |
| }; |
| 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]]; | ||
| }; |
There was a problem hiding this comment.
| 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]]; |
| params ["_args", "_pfID"]; | ||
| _args params ["_vehicle"]; |
There was a problem hiding this comment.
| params ["_args", "_pfID"]; | |
| _args params ["_vehicle"]; | |
| params ["_vehicle", "_pfhID"]; |
| _vehicle lockCameraTo [objNull, [0]]; | ||
| }; | ||
|
|
||
| }, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler; |
There was a problem hiding this comment.
| }, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler; | |
| }, 0.1, _vehicle] call CBA_fnc_addPerFrameHandler; |
| if (!unitIsUAV _vehicle) exitWith {}; | ||
| if (!hasPilotCamera _vehicle) exitWith {}; | ||
|
|
||
| GVAR(pfehID) = [{ |
There was a problem hiding this comment.
| GVAR(pfehID) = [{ | |
| [{ |
| _vehicle lockCameraTo [objNull, [0]]; | ||
| }; | ||
|
|
||
| }, 0.1, [_vehicle]] call CBA_fnc_addPerFrameHandler; |
There was a problem hiding this comment.
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", { | |||
There was a problem hiding this comment.
This whole bit needs comments.
| initAngleX=0; minAngleX=0; maxAngleX=0; | ||
| initAngleY=0; minAngleY=0; maxAngleY=0; |
There was a problem hiding this comment.
| initAngleX=0; minAngleX=0; maxAngleX=0; | |
| initAngleY=0; minAngleY=0; maxAngleY=0; | |
| initAngleX = 0; | |
| minAngleX = 0; | |
| maxAngleX = 0; | |
| initAngleY = 0; | |
| minAngleY = 0; | |
| maxAngleY = 0; |
| showUAVViewInOptics= false; | ||
| showSlingLoadManagerInOptics= false; |
There was a problem hiding this comment.
| showUAVViewInOptics= false; | |
| showSlingLoadManagerInOptics= false; | |
| showUAVViewInOptics = false; | |
| showSlingLoadManagerInOptics = false; |
| x = "6.0 * (0.01875 * SafezoneH)"; | ||
| y = "1.75 * (0.025 * SafezoneH)"; | ||
| w = "41.3 * (0.01875 * SafezoneH)"; | ||
| h = "1 * (0.025 * SafezoneH)"; |
There was a problem hiding this comment.
| 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"; |
There was a problem hiding this comment.
| //gunnerOpticsModel = "\A3\Weapons_F\Reticle\Optics_Gunship_wide_F.p3d"; |
If it's commented out, It doesn't need to be here.
Ultra-lightweight reimagining of #7485.
When merged this pull request will:
Known Issues: