-
Notifications
You must be signed in to change notification settings - Fork 148
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
CBA_fnc_currentUnit report UAV entity when controlling UAV #1005
Conversation
This will have massive effects in ace because ace_player will be the uav robot |
Maybe use ace's uav eh https://github.com/acemod/ACE3/blob/master/addons/common/XEH_postInit.sqf#L285-L327 and then we could set |
Hmm, one alternative would be to only use the UAV entity to read the visionMode, and keep currentUnit the way it is. Then one could additionally add an event whenever the controlledUnit changes. |
I'm a bit hesitant to use |
Is there any practical reason why we need this? Opposed to Zeus Remote Control. You aren't actually really inside the drone when you're controlling it. You are controlling it via a little tablet in your hand. |
True. The only reason one would the need the UAV entity is to read the night vision mode from. I'll change the PR to do that instead. |
What about this? |
|
||
GVAR(playerEHInfo) pushBack addMissionEventHandler ["EachFrame", {call FUNC(playerEH_EachFrame)}]; | ||
[QFUNC(playerEH_EachFrame), { | ||
private _player = call CBA_fnc_currentUnit; | ||
private _player = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change still necessary? I mean.. I like the performance gain..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it just to compensate for the loss due to this.
Is it good? |
if !(_data isEqualTo GVAR(oldUAVControl)) then { | ||
GVAR(oldUAVControl) = _data; | ||
|
||
private _role = _data param [(_data find _player) + 1, ""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the wiki page wrong?
https://community.bistudio.com/wiki/UAVControl
_data should be 2 element array. find _player should always return 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the wiki page wrong?
Always.
Drone with turret + driver/pilot looks like this:
[object1, "DRIVER", object2, "GUNNER"]
In MP, it can be controlled by multiple people. Therefore #0 is not necessarily the local player.
We could optimize for common case, which would be no UAV connected
https://github.com/CBATeam/CBA_A3/compare/currentUnit-UAV...uavPossibleOpti?expand=1 |
Don't think that's worth it. Merge? |
When merged this pull request will:
This is more complex than the original, and this is a function called every frame in ACE.
Thoughts?