Alright, if I understood well, you could do this in many ways, but two in particular come to mind. First one would be the simplest, which would be giving a script to the rocket that would change it's RotAngle by the factor you want if it's RotAngle is different than Pi/2 or Pi*3/2 (don't remember if it's measured in radians or not, I think it is).
So the code would basically look like this:
Code:
function Create(self)
local pi = 3.14159265
if self.HFlipped == false then
self.reverseCheckNum = 1
else
self.reverseCheckNum = -1
end
if self.RotAngle ~= pi/2 or self.RotAngle ~= pi*3/2 then
self.RotAngle = self.RotAngle + factor*self.reverseCheckNum
end
end
The other one would be attaching the script to the gun and make it create the missile with your preferential angles/speeds and other things based on the gun's RotAngle and what not.
Something like:
Code:
function Update(self)
local pi = 3.14159265
if self.HFlipped == false then
self.reverseCheckNum = 1
else
self.reverseCheckNum = -1
end
if self.lastRound == 0 then
self.lastRound = self.Magazine.Capacity
end
if self:IsActivated() and not self:IsReloading() and self.Magazine.RoundCount ~= self.lastRound then
self.missile = CreateAEmitter("My missile goes here","HereGoesMod.rte")
if self.RotAngle ~= pi/2 or self.RotAngle ~= pi*3/2 then
self.missile.Vel = self.Vel+Vector(10*self.reverseCheckNum,0)
self.missile.Pos = self.MuzzlePos
MovableMan:AddParticle(self.missile)
else
self.missile.Vel = self.Vel+Vector(10*self.reverseCheckNum,0):RadRotate(self.RotAngle+(factor*self.reverseCheckNum))
self.missile.Pos = self.MuzzlePos
MovableMan:AddParticle(self.missile)
end
self.lastRound = self.Magazine.RoundCount
end
end
Then you make a little formula for factor, something like local factor = self.RotAngle/10 or something among those lines. The last one basically makes the gun shoot almost completely thanks to lua, and whatever the weapon fires should be a null particle or some invisible pixel with 0.00000001 mass and 0 sharpness with X velocity in order to simulate the actual round shot, so that the AI can fire it properly.
Now, I don't think I might have understood your idea completely or if my code is completely right (though it should, since most are parts ripped from my own little personal mods that work), but