I am trying to fix the 2 torpedo bombers projectiles mentioned in the title to perform in line with those of UEF and cybran. Essentially what happens when Seraphim and Aeon torp bombers fire their weapon is that the projectile flies ahead from the torpedo bomber whereas UEF and Cybran drop the torpedoes vertically down from their underside for a distance of x then the torpedo flips 90° and goes parallel to the torpedo bomber. As a result UEF and cybran hit their target whereas Seraphim and Aeon overshoot it and then the torpedo does a 180° flip and comes back to its target.
This is obviously undesirable for many reasons but as a lua noob I am not able to figure out how the projectile script works to make these 4 torpedo bombers projectile behave differently, so I dont know how to make changes to fix the script of the projectile to make the torpedo hit its target.
I believe the following in the projectiles script may help the cybran torpedo projectile (CANTorpedoNanite03_script), f.ex. hit its target:
GetDistanceToTarget = function(self)
local tpos = self:GetCurrentTargetPosition()
local mpos = self:GetPosition()
local dist = VDist2(mpos[1], mpos[3], tpos[1], tpos[3])
return dist
end,
Seraphim doesnt have it in its projectile script (SANHeavyCavitationTorpedo01_script), but of course, I am noob at this so I dont know whether this missing for seraphim really is the cause for it to fail to hit its target.