Missile weapons and unerring accuracy.
Moderator: Moderators
Most likely. Spring doesn't have an abstract weapon class. So several cases are made where by it determines behavoir.
The problem comes in with the:
Trajectoryheight=1;
Making the weapon a missile.
This is the only way to get arced fire outside of high trajectory. The funny thing is acurracy offsets the target location a little behind the actuall target. However, the other weapons get a nice sorta random spread.
I am not really sure what to say because I didn't look at the code back when I was looking at writing a few patches.
The problem comes in with the:
Trajectoryheight=1;
Making the weapon a missile.
This is the only way to get arced fire outside of high trajectory. The funny thing is acurracy offsets the target location a little behind the actuall target. However, the other weapons get a nice sorta random spread.
I am not really sure what to say because I didn't look at the code back when I was looking at writing a few patches.
I've only used that trajectoryheight for guided weapons. I was under the impression a 1 value was perpindicularly straight up and not necessary aimed at the target. If you use an unguided rocket does that make it shoot straight up?
Can't test until this weekend. My windows pc is waiting parts and this linux machien has only 800mb left on the hard drive. Don't want to get greedy and screw up the only working machine I got to install it on.
edit - I bet the trajectoryheight patch was written with missiles in mind and that is where its broken. It probably supercedes the code for computing trajectory. The author probably didn't put in code for alternatives to missiles when using the tag. By default it probably assumes the guidance tag is on when computing trajectory and that is why it has perfect aim linearly speaking.
Can't test until this weekend. My windows pc is waiting parts and this linux machien has only 800mb left on the hard drive. Don't want to get greedy and screw up the only working machine I got to install it on.
edit - I bet the trajectoryheight patch was written with missiles in mind and that is where its broken. It probably supercedes the code for computing trajectory. The author probably didn't put in code for alternatives to missiles when using the tag. By default it probably assumes the guidance tag is on when computing trajectory and that is why it has perfect aim linearly speaking.
on a non guided weapon it arcs a shot. it was meant for balistics.

I think there was another tag for vertical launch(I do not use it so I cannot remember it
)

I think there was another tag for vertical launch(I do not use it so I cannot remember it

changelog wrote:Added missile tdf tag trajectoryHeight, this sets in how high an arc the missile will move toward the target,0 = straight, 1=45 degree above, can be anything>=0, default 0
Actually, from the description it sounds like TrajectoryHeight is the tangent of the firing angle. So TrajectoryHeight=1 equals a 45 degrees angle, and 90 deg. angle would require TrajectoryHeight=infinity. Values less then 1.0 should give angles lower than 45 degrees (TrajectoryHeight=0.5 should give approx. 27 degrees).
Code: Select all
Index: MissileLauncher.cpp
===================================================================
--- MissileLauncher.cpp (revision 3404)
+++ MissileLauncher.cpp (working copy)
@@ -52,6 +52,11 @@
dir.Normalize();
}
}
+
+ dir+=(gs->randVector()*sprayangle+salvoError)*(1-owner->limExperience*0.5f); //Applies the weapon's
+ //inaccuracy to the projectile
+ dir.Normalize();
+
float3 startSpeed=dir*weaponDef->startvelocity;
if(onlyForward && dynamic_cast<CAirMoveType*>(owner->moveType))
startSpeed+=owner->speed;