Page 2 of 2

Re: How to make a ballistic weapon arc just a little

Posted: 16 Feb 2012, 10:22
by Forboding Angel
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.

Re: How to make a ballistic weapon arc just a little

Posted: 17 Feb 2012, 21:27
by Deadnight Warrior
FLOZi 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
I use something simmilar for XTA but a bit more accurate formula

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
You can fiddle with the customGravity variable to set the projectile speed. All affected weapons will fire at 45° when engaging at max range.

Re: How to make a ballistic weapon arc just a little

Posted: 18 Feb 2012, 01:26
by knorke
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.
no, iirc the projectile does follow a smooth flightpath. Just the smoketrail=true effect looks jagged on tight turns.