Open MeSaber opened 3 months ago
this looks like a signal error with the animation script allowing multiple aim commands simultaneously. Might not be. That's my first impression.
I was wrong. It's actually due to something in this wall of text:
`#define MAX_AIMY1_VELOCITY <9.00>
static-var aimy1delta, timetozero, deceleratethreshold, gameFrame;
AimWeapon1(heading, pitch) {
signal SIG_AIM;
set-signal-mask SIG_AIM;
//We can do this any time
turn turret to x-axis <0.000000> - pitch speed <45.000000>;
aimy1target = heading;
aimy1delta = aimy1position - aimy1target;
while( ( get ABS(aimy1delta) > AIMY1_PRECISION ) OR (get ABS(aimy1velocity) > AIMY1_JERK)){
if (gameFrame != get(GAME_FRAME)){ //this is to make sure we dont get double-called, as previous aimweapon thread runs before new aimweaponthread can signal-kill previous one
gameFrame = get(GAME_FRAME);
//Clamp aimy1position and aimy1delta between <-180>;<180>
while (aimy1position > <180>) aimy1position = aimy1position - <360>;
while (aimy1position < <-180>) aimy1position = aimy1position + <360>;
while (aimy1delta > <180>) aimy1delta = aimy1delta - <360>;
while (aimy1delta < <-180>) aimy1delta = aimy1delta + <360>;
//number of frames required to decelerate to 0
timetozero = get ABS(aimy1velocity) / AIMY1_ACCELERATION;
//distance from target where we should start decelerating, always 'positive'
//pos = t * v - (t*(t-1)*a/2)
deceleratethreshold = timetozero * (get ABS(aimy1velocity)) - (timetozero * (timetozero - 1) * AIMY1_ACCELERATION / 2);
//get PRINT ( aimy1delta , deceleratethreshold, aimy1velocity, timetozero );
if (get ABS(aimy1delta) <= deceleratethreshold){ //we need to decelerate
if (aimy1velocity > 0) aimy1velocity = aimy1velocity - AIMY1_ACCELERATION;
else aimy1velocity = aimy1velocity + AIMY1_ACCELERATION;
}
else //we need to accelerate
{
if (aimy1delta > 0) aimy1velocity = get MIN( MAX_AIMY1_VELOCITY, aimy1velocity + AIMY1_ACCELERATION);
else aimy1velocity = get MAX((-1) * MAX_AIMY1_VELOCITY, aimy1velocity - AIMY1_ACCELERATION);
}
//Apply jerk at very low velocities
if (get ABS(aimy1velocity) < AIMY1_JERK){
if ((aimy1delta > AIMY1_JERK)) aimy1velocity = AIMY1_JERK;
if ((aimy1delta < (-1) * AIMY1_JERK)) aimy1velocity = (-1) * AIMY1_JERK;
}
aimy1position = aimy1position + aimy1velocity;
turn turret to y-axis aimy1position now;
aimy1delta = aimy1target - aimy1position ;
if ((aimy1delta < <7>) AND (aimy1delta > <-7>)){
return (1);
}
}
sleep 30;
}
aimy1velocity = 0;
return (1);
}`
@Beherith i checked blame history and looks like you wrote this part of the script 4 years ago. Armada HLT has simple aiming function. What's the purpose of the accelleration thingy? What do you make of the aim jitter that seems to get worse the closer the aim target gets?
Description
https://www.twitch.tv/videos/2227792317
Maybe related to its lagginess in turn rate?
Expected Behaviour
No shake
Actual Behaviour
Shake.
Reproduction steps
No response
Other
No response