Data Realms Fan Forums
http://45.55.195.193/

Rockets are affected by the actor's current vector
http://45.55.195.193/viewtopic.php?f=1&t=31663
Page 1 of 1

Author:  AndyChanglee [ Tue Sep 04, 2012 1:37 pm ]
Post subject:  Rockets are affected by the actor's current vector

So if you're full throttle on that jetpack, or in a quick decent, rockets fired from RPG-7s, or missile launchers, or the Halo Rocket Launcher, or rockets in general (I believe) are affected by that vector, and either curve upwards or downwards dramatically, usually nowhere near the target you're aiming for.

With some skill, you could aim a bit differently to compensate for that, but I was just wondering if there was a way to prevent or reduce the amount the actor's vector affects the rocket's.

Author:  Jobee88 [ Tue Sep 04, 2012 2:07 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

I'm not sure how to do that but please PM me when you find out because it happens with most big weapons like lazer canons as well not just rocket weapons.
It is very anoying when you are flying because even if you are only moving the slightest little bit it shoots way off.

Author:  Shook [ Tue Sep 04, 2012 4:02 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

Well, the thing is that shots fired inherit the actors velocity, which could become problematic with the rocket launcher, since it has the following two properties:
1. It turns to orient itself to its velocity vector.
2. It accelerates towards where it's facing.

Thus, if you're flying backwards faster than the rocket is initially launched, it will actually fly backwards (and if it didn't have the neat property of not hitting its wielder, your face would explode). The easiest way around this is to set OrientToVel = 0, since that'll make it keep the direction it was fired in, regardless of its actual velocity. This also makes for some totally badass curving shots if you know what you're doing.

if you ask me then OrientToVel should only ever be used for inert projectiles

Author:  p3lb0x [ Tue Sep 04, 2012 4:42 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

While the orient to velocity variable is the culprit of problem with rotating rockets. The rockets inheriting your velocity is the only realistic approach to this problem and you will have to compensate for this.

Author:  Gotcha! [ Tue Sep 04, 2012 7:55 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

Whether meant as a feature or not, I like it. A nice way to stop people from making cheap shots.

Author:  AndyChanglee [ Tue Sep 04, 2012 10:07 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

Hmm, it would be great if there was a way to turn down the inheritance instead of just turning it off (cause I agree with Gotcha).

Thanks for answering!

Author:  Abdul Alhazred [ Wed Sep 05, 2012 8:53 am ]
Post subject:  Re: Rockets are affected by the actor's current vector

AndyChanglee wrote:
Hmm, it would be great if there was a way to turn down the inheritance instead of just turning it off (cause I agree with Gotcha).
You can attach a script to the missile that does that. The "inherit" variable in the script below sets how much of the original velocity (actor velocity plus missile velocity) you want to keep.

Code:
function Create(self)
   local inherit = 0.67
   local fireVelocity = 40
   self.Vel = self.Vel*inherit + self:RotateOffset(Vector(fireVelocity, 0))*(1-inherit)
end

Since this essentially circumvents the laws of physics it looks kind of strange IMO.

Author:  AndyChanglee [ Wed Sep 05, 2012 10:20 pm ]
Post subject:  Re: Rockets are affected by the actor's current vector

I guess so, but its definately weird when it happens while you're jetpacking upwards or backwards.

I might just keep things the way it is, thanks for the code, just in case!

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/