Today, using a different approach, I have succeeded in (For my testing at least) disabling the ability to hoverbomb without affecting any of the rest of a bomber's behavior. Now... Zock plans to poll the community on this topic in 6 months or so, once the currently developing balance patch is well deployed. However, I appreciate that some people will want this as a mod, so, if demand is high enough, that's what I'll do.
THIS POLL IS NOT OFFICIAL
http://strawpoll.me/6347415
I recognise some will also be curious, so I'll just post the actual code here too:
- Code: Select all
OnGotTarget = function(self, Weapon)
local x, y, z = self:GetVelocity()
-- Get speed per second
x = x * 10
z = z * 10
-- Square them. Don't use x ^ 2, it returns some really odd numbers...
x = math.pow(x, 2)
z = math.pow(z, 2)
-- Find the resultant speed
local vel = math.sqrt(x + z)
-- If the plane is too slow, disable the weapon
if vel < (self:GetBlueprint().Air.MinAirspeed / 2) then
ForkThread(self.BombTimer, self, Weapon)
end
end,
BombTimer = function(self, Weapon)
Weapon:SetWeaponEnabled(false)
WaitTicks(20)
Weapon:SetWeaponEnabled(true)
end,