Demo: Projectile Aimbot for Target with Velocity
This code is over 6 months old. The code may have expired and might no longer function.
Solves the X and Z axis for a projectile aimbot, though the Y axis is only correct for projectiles that are linear. For Projectiles with an arc the solution is good at ranges <20m. Beyond that I would recommend manually adjusting the aim spot to compensate for the equation underpredicting.
The way the projectile data is stored is kinda ugly since I had to optimize for element count. Also there are subroutines that only get called once, you can probably squash them into their respective rules.
To update which ability to aimbot for edit the rule "Set player projectile data". Set projtype to: 1 = primary, 2 = secondary, 3 = ability1, 4 = ability_2, 5 = ultimate.
It will populate the projectile data based on the hero you select. In the demo it is set to primary fire, for my usecase I update the projectile data just before firing, and then add a small wait.
See https://workshop.codes/QKQ8G for a implementional that calculates for projectile arc, but not target velocity. This code also attempts to solve for the delta vector.
I wrote the code in overpy, see https://github.com/a-bella-ciao/OW2-Workshop-Projectile-Aimbot for the source.
Applies to Version 1.0 (2G6XE)
Also includes a cubic and quartic equation solver because I was silly and did not understand the code I was trying to convert.
A recreation of the first half of the logic of 'solve_ballistic_arc_lateral' from the source code of https://www.forrestthewoods.com/blog/solving_ballistic_trajectories/