I'm working on a custom auto-turret. It's supposed to act like a manned turret, but for use in singleplayer (so it's not acctually manned). I have most of it working good, except I'm having one problem with it.
I want it to be able to calculate the lead on trajectory, and be able to use that to actually hit the player. This is all good and easy, but then I started to wonder about how well this would work with a rocket turret. Obviously, an intelligently manned turret would be aiming at the targets feet when firing explosive rounds.
Can anyone help me in finding a good method to determine the lead-on distance + the vector of the ground at the projected lead-on position? I've thought of a few ways, and even gotten suggestions on similiar problems, but I'd like to be able to use this without modifying any class cogs. I'd like it to be as standalone as possible.
One idea I have is to create an invisible template (one affected by gravity like a thermdet or seq or shrapnel) at the lead on vector, give it time to drop to the ground, then fire the projectile at the template.
Perhaps creating a ghost, setting it to a high mass/affected by gravity, and using that same method I just posted might work. I predict, though, that there's a better way to do this rather than my quick hack method.
Any Ideas?
I want it to be able to calculate the lead on trajectory, and be able to use that to actually hit the player. This is all good and easy, but then I started to wonder about how well this would work with a rocket turret. Obviously, an intelligently manned turret would be aiming at the targets feet when firing explosive rounds.
Can anyone help me in finding a good method to determine the lead-on distance + the vector of the ground at the projected lead-on position? I've thought of a few ways, and even gotten suggestions on similiar problems, but I'd like to be able to use this without modifying any class cogs. I'd like it to be as standalone as possible.
One idea I have is to create an invisible template (one affected by gravity like a thermdet or seq or shrapnel) at the lead on vector, give it time to drop to the ground, then fire the projectile at the template.
Perhaps creating a ghost, setting it to a high mass/affected by gravity, and using that same method I just posted might work. I predict, though, that there's a better way to do this rather than my quick hack method.
Any Ideas?