Pizzicato Posted April 20, 2024 Posted April 20, 2024 Hey all, I was just experimenting with the AI's refuelling behaviour. It turns out that an AI Hornet on CAP will wait until its fuel state is down to 5% (Unit.getFuel() == 0.05) before heading for the tanker. This is fine if the tanker is nearby, but ends in flame-out disaster if the tanker is a little too far away. If it does reach the tanker, though, it happily refuels and then resumes its orbiting CAP. In order to counter this, I wrote a brief script that Pushes a "Refueling" task to the Hornet when it gets to 15% fuel. This works much better in terms of ensuring that the Hornet can safely reach the tanker... but it then RTBs straight afterwards versus returning to its CAP orbit. My understanding was that a PushTask (as opposed to a SetTask) would result in the unit resuming its prior task once the pushed one has been completed. Evidently that's not the case, though. Does anyone know what I'm missing or misunderstanding? i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Exorcet Posted April 20, 2024 Posted April 20, 2024 Typically I set refueling on AI ingress, I've used pushes a couple of times I believe and this seems to work as expected. Is the next waypoint after your CAP a landing? If so maybe the push is making the AI consider the orbit and CAP task ended. What happens if you set up a waypoint with a refueling command and instead of directly ordering refuel tell the AI to switch to that waypoint? Set the waypoint up so it's skipped initially, so WP1 (include switch to WP 3) > WP2 (refueling) WP3 > WP4 (CAP and orbit). This would mean that there is definitely a CAP and orbit task after the refueling. Awaiting: DCS F-15C Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files
Pizzicato Posted April 20, 2024 Author Posted April 20, 2024 Thanks for the suggestions, Exorcet. I'm actually looking for something a little more generic that can be applied to all groups through script, but your solutions are definitely good for "per group" scripting. Thanks for taking the time to reply. i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
toutenglisse Posted April 20, 2024 Posted April 20, 2024 I can confirm that a scripted refueling task using pushtask does work like you describe , and after refueling the AI resumes previous task (in my case a follow task).
Solution Pizzicato Posted April 21, 2024 Author Solution Posted April 21, 2024 Thanks for checking, @toutenglisse. Your confirmation that it does actually work as intended forced me to double-check my scripts. Turns out that I was inadvertently overwriting some AI behaviours with my main script. I forgot to flag the problematic group as mission specific, so it accidentally received the suite of settings that I apply to generic groups in my mission. Thanks for the help. i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Recommended Posts