I made a FT horizontal stabilizer for my Abrams, but it has this weird flaw I can't seem to fix.
Here's the spaghetti:
sum((Roll*(Activate3=true ? .05 : .75)-clamp((Activate2=true & Roll = 0 ? smooth(YawRate, Activate2=true ? 1 : 0) : 0), -.5, .5))
Activate2 toggles the stabilizer and Activate3 is a slow mode for turret traverse (Activate3 is not really relevant here, though.) It should also be noted that the cockpit is part of the turret. (Ergo, it spins with it.)
The bolded part is where I suspect the problem is, since when I used DebugExpression, it kept increasing/decreasing in the situation described below.
If I turn the hull with the stabilizer OFF, when I the stabilizer ON, the turret starts spinning in the opposite direction. Eventually, it stops spinning and the stabilizer starts working as normal. And the amount it spins seems to be proportional to how fast the hull was turning (YawRate).
But, what's strange is that if I try to repeat this, this spinning problem doesn't happen. If I restart, it will happen again, but if I try again in the same play session, everything works as normal after the spinning.
Can someone tell me what might be going on?
Temporary fix currently is to have Activate2=false, since having the stabilizer on at the start prevents this issue.
@hpgbproductions I would, but I still have no idea how they work :p
Could be because memory functions like smooth() aren't evaluated if the ternary function doesn't reach it
Maybe try using smooth() in a variable
@rexzion yeah thats a good idea actually, rate(Heading) is a thing
you should prob use
Heading
instead ofYawRate
but idk i dint look at your code in detail jus sayig@edensk Now that I think about it, the second Activate2=true is probably unnecessary
this won't fix it, but you can delete the =true bits to make the code simpler