Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visionmode EH issue with drone, selecting night vision. #1004

Closed
Tommo-S opened this issue Oct 11, 2018 · 8 comments · Fixed by #1005
Closed

Visionmode EH issue with drone, selecting night vision. #1004

Tommo-S opened this issue Oct 11, 2018 · 8 comments · Fixed by #1005
Labels
Milestone

Comments

@Tommo-S
Copy link

Tommo-S commented Oct 11, 2018

Arma 3 Version: 1.84 stable
CBA Version: 3.8.0 stable

Mods:

- CBA_A3

Description:

  • Visionmode player event handler doesn't fire when switching to nightvision while controlling a drone.

Steps to reproduce:

  • Add Visionmode player event handler. Remote control a drone. Switch vision modes. It reports when changing from night vision to thermal, thermal to thermal, and thermal to normal vision, but night vision is never reported.
    Example of the eventhandler code.
    ["visionMode", {systemChat str _this}, false] call CBA_fnc_addPlayerEventHandler;

Where did the issue occur?

  • Editor (Singleplayer) / Editor (Multiplayer)

RPT log file:

@commy2
Copy link
Contributor

commy2 commented Oct 11, 2018

thermal to thermal

Is this referring to the transition "White Hot to Black Hot"? Because that is the change I expected not to trigger the event instead of "Normal -> NVG".

@Tommo-S
Copy link
Author

Tommo-S commented Oct 11, 2018

No, it's referring to normal -> NVG.

White Hot -> Black Hot fires for drones.

@commy2
Copy link
Contributor

commy2 commented Oct 11, 2018

By "this", I meant the part where you said "thermal to thermal". I know that this PR is about "normal to nvg", but it is equally puzzling to me that the event triggers for one thermal mode to another.

@Tommo-S
Copy link
Author

Tommo-S commented Oct 11, 2018

Sorry, yes, that was referring to "thermal to thermal".

@commy2
Copy link
Contributor

commy2 commented Oct 11, 2018

Strange indeed. Which drone did you try this on? Just so I can repro when I'm back at my desktop pc in roughly 9 hours.

@Tommo-S
Copy link
Author

Tommo-S commented Oct 11, 2018

The darter and the jets DLC UAV, I've forgotten it's name.

@commy2
Copy link
Contributor

commy2 commented Oct 11, 2018

The player event handler framework is based on CBA_fnc_currentUnit. That function reports the current avatar, which is not the same as player while remote controlling an AI via Zeus. The function does however not report the UAV entity inside the UAV vehicle as "currentUnit" when controlling a drone.
For some reason, while controlling a UAV and while in night vision mode:

currentVisionMode player // 0
currentVisionMode driver cameraOn // 1

while in thermal mode:

currentVisionMode player // 2
currentVisionMode driver cameraOn // 2

and in normal mode:

currentVisionMode player // 0
currentVisionMode driver cameraOn // 0

I think it would make sense if CBA_fnc_currentUnit reported the UAV entity instead of the player when controlling a UAV. That is the equivalent to Zeus remote control, but apparently not picked up by reading the bis_fnc_moduleRemoteControl_unit variable.
Not exactly sure on how to fix this. getConnectedUAV reports the UAV vehicle, which is not what we want (we want the UAV entity instead, i.e. the driver or gunner of the UAV vehicle).
Changing this core function could break stuff in ACE, but honestly it more likely fixes things :P

@commy2
Copy link
Contributor

commy2 commented Oct 11, 2018

Debug script:

"CBA_Debug" cutRsc ["RscTitleDisplayEmpty", "PLAIN", 0, true];
private _display = uiNamespace getVariable "RscTitleDisplayEmpty";

private _vignette = _display displayCtrl 1202; 
_vignette ctrlShow false; 

private _control = _display ctrlCreate ["RscText", -1];

private _width = safezoneH/5;
private _height = _width/5 * (safezoneW/safezoneH);;
private _left = 0.5 - _width/2;
private _top = 0.5 - _height/2;

_control ctrlSetPosition [_left, _top, _width, _height];
_control ctrlCommit 0;

commy_visionMode = [_control];

["visionMode", {
    params ["_unit", "_mode"];
    (commy_visionMode#0) ctrlSetText str _mode;
}, false] call CBA_fnc_addPlayerEventHandler;

Tommo-S added a commit to Tommo-S/ACE3 that referenced this issue Oct 11, 2018
**When merged this pull request will:**
- Changed hardcoded 0.5 NVG fog modifier for players in "air" type vehicle to CBA option (0.1 to 1.0 range).
- Added CBA options for fog modifier (0.1 to 1.0 ranges) for tank crew, car crew, static weapons and when using NV-capable binoculars.
- These fog modifiers are only applied when in gunner view of a NV-capable seat/turret, otherwise players still use their own NVGs.
- NV-capable binoculars work from FFV seats with binocular modifier.
- Fixed nvg overlay not applying when using FFV seats/ADS from FFV.
- Added ADS blur when using non-NV capable static weapons, technical turrets with NV goggles.

Known issues:
- When coming  out of binos, noticable flash at the corners of the screen before the NVG overlay is applied. Issue present in current ACE release. Wasn't able to resolve.
- UAV cameras are affected by ACE_player's nightvision status. If ACE_player has nightvision on, the NVG effects are overlaid on the UAV camera. Issue present in current ACE release.
- Unable to reliably detect when player controlled UAV is changing vision modes to account for UAVs. Potential bug with CBA Visionmode player EH. The EH doesn't trigger when changing from normal to night vision in when remote controlling drone. Raised issue on CBA github, CBATeam/CBA_A3#1004

First time contributing, let me know if I missed anything.
@commy2 commy2 added the Bug label Oct 12, 2018
@commy2 commy2 added this to the 3.10 milestone Oct 12, 2018
@commy2 commy2 modified the milestones: 3.10, 3.9.1 Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants