How to make a ballistic weapon arc just a little
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to make a ballistic weapon arc just a little
Something not mentioned previously... If you want a weapon with fast velocity but an arc, you can do it pretty effectively with gravity. Problem is (unless I'm mistaken), the arc can get pretty jagged and unrealistic if you overdo it.
- Deadnight Warrior
- Posts: 183
- Joined: 08 Jun 2009, 17:59
Re: How to make a ballistic weapon arc just a little
I use something simmilar for XTA but a bit more accurate formulaFLOZi wrote:Getting ballistic weapons to fire exactly (well, so long as map gravity is ~120) at 45 degrees at their maximum range is easy btw.
Code: Select all
local GRAVITY = 120 for weapName in pairs(WeaponDefs) do if WeaponDefs[weapName].customparams then if WeaponDefs[weapName].customparams.howitzer then WeaponDefs[weapName].weaponvelocity = math.sqrt(WeaponDefs[weapName].range * GRAVITY) end end end
Code: Select all
local customGravity = 1.0
local velGravFactor = customGravity * 900
for id in pairs(WeaponDefs) do
if WeaponDefs[id].weapontype == "Cannon" and WeaponDefs[id].range and not WeaponDefs[id].mygravity and not WeaponDefs[id].cylindertargetting then
WeaponDefs[id].mygravity = customGravity
WeaponDefs[id].weaponvelocity = math.sqrt(WeaponDefs[id].range * velGravFactor)
end
end
Re: How to make a ballistic weapon arc just a little
no, iirc the projectile does follow a smooth flightpath. Just the smoketrail=true effect looks jagged on tight turns.Forboding Angel wrote:If you want a weapon with fast velocity but an arc, you can do it pretty effectively with gravity. Problem is (unless I'm mistaken), the arc can get pretty jagged and unrealistic if you overdo it.