Rockets go sideways when strafing

Ask questions, discuss ideas, get answers
Post Reply
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Rockets go sideways when strafing

Post by Swaffy »

How can I make a rocket go perfectly straight when I fire it instead of it flying sideways from the direction I'm strafing?


For example, the Bazooka rocket will angle to the right when strafing to the right. Another is the Hydra [small] rocket on the Mi24D Hind in Desert Combat; the rockets will angle to the left when the helicopter is strafing to the left (it works for any direction the movement is going). I don't want my rocket to do this.

But when I fire the Hellfire rocket from the Mi24D Hind or the Katyusha rocket from a WWII vehicle (such as the Katyusha), the rocket flies perfectly straight, hitting the spot where the player was aiming at from the time the rocket was fired.
Last edited by Swaffy on Thu Oct 27, 2011 9:36 pm, edited 1 time in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Rockets go sideways when strafing

Post by Apache Thunder »

I think this code line may be responsible. Set this to zero on the firearms object that fires your projectile:

Code: Select all

ObjectTemplate.addRootSpeed 0
The command tells the game whether the direction or speed affects the projectile at launch. For example a grenade will go a bit faster when walking foward then when standing still.

Setting it to zero will make it fire at the same velocity and angle no matter the speed of the host vehicle/soldier. ;)
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Rockets go sideways when strafing

Post by Swaffy »

It works, thank you. Now I just need to edit the projectile position.

My Mi24D's rocket kept blowing the helo up since the projectile was only going at the velocity speed instead of the velocity+vehicle speed.

This gives me a few ideas. Thank you again, AT!
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Rockets go sideways when strafing

Post by Apache Thunder »

Sure no problem. Glad I could help. :D
ImageImageImage
I have cameras in your head!
Post Reply