Aircraft - Drone "Follow Unit" Waypoint Action
When merged this pull request will:
- Add a "Follow Unit" Waypoint Action to Drones, to emulate the vanilla "Follow Unit" behaviour from the UAV Terminal, which is unfortunately only available on other drones unless "friendly map content" is enabled;
- [x] Follow action is available when pointing at a man/vehicle (currently via
cursorTarget) and creates a persistent "follow" type waypoint;- [x] Works from UAVs;
- [x] Works from UGVs;
- [x] Follow action permits selecting a min distance to follow to, just like the vanilla interface (unclear how that logic works);
- [x] Follow action is available when pointing at a man/vehicle (currently via
- Fix the "recharge" action being shown on destroyed drones;
Looks like UGV Follow code is broken and a known issue. I guess an all-round solution will require some sort of follow-mode PFH that updates a move/hold waypoint, which should also allow scripting a "min distance to follow" behaviour, though a native scripting method would be preferable.
Ended up implementing the selectable follow distance via a simple distance check in the PFH, should be pretty efficient already but could be optimized further. I guess the interaction to set follow distance could be more user friendly too.
Feedback appreciated.
I guess the current implementation of a separate "Follow Distance" interaction (just like for Loiter Altitude) is best.
It still needs a stringtable entry for localization, Loiter Altitude uses the vanilla $STR_3den_waypoint_attribute_loiteraltitude_displayname, so far I haven't found anything similar for Follow Distance. I doubt there is though, so it will probably need to be added.
I think this is pretty much complete. Maybe some Air vehicles should also be followable, might be useful when tracking other small drones with a drone 🤔
Looks like UGV Follow code is broken and a known issue. [...]
I want to see that ticket be included in the code, explaining why a PFH even needs to be added.
I think this is pretty much complete. Maybe some Air vehicles should also be followable, might be useful when tracking other small drones with a drone 🤔
I really don't know: I don't use drones at all and frankly I don't care for them. We need other opinions here.
I'll test later this week. Code looks good at a glance post-changes, but I haven't looked too hard.
I could see someone saying this is too strong because the drone will continue to follow even if it doesn't have line of sight
e.g. vehicle in forest or human inside of a building
but there is always a way to disable with getVariable [QGVAR(droneWaypoints)
and I think most use of this will be perfectly fine
The vanilla following was similarly OP, it would get stuck sometimes if the drone's turret wasn't looking at the target, but once you'd lock it with Ctrl+T and "revealed it" with T, the AI would know about it even when in buildings and follow with few interruptions. Also I think most use-cases (especially with UGV) will be following of the drone operator, which the drone should always know where to find due to the terminal's DL.
@johnb432 Unfortunately maintainer edits cannot be enabled for organization PRs. https://github.com/orgs/community/discussions/5634
Running git merge --squash master to merge while keeping linear history caused the PR to show with 731 files modified. Fixed by rebasing and force pushing.
I guess the "best" way would be running git merge master to not break any history, but it makes commit history messy IMO.