Profile image

Parallax angle turrets

2,820 RichardScepton  2.1 years ago

Basically, this is meant for turrets on naval guns where there are stern and bow turrets. They're meant to aim in parallax, meaning that the bow and the stern turrets all converge onto a single target instead of rotating in a V shape as in conventional rotator setups. Setup is fairly straightforward. Set all the rotators to 180 rotation and invert on yes, then set the elevation rotators to 45 elevation and invert on no, then attach the following codes:

For cannons:

Elevation:

clamp((TargetElevation + rate(TargetElevation)(((v * sin(asin((TargetDistance * 9.81)/(pow(v, 2)))/2))/9.81) * 2)) + (asin(((TargetDistance + rate(TargetDistance)(((v * sin(asin((TargetDistance * 9.81)/(pow(v, 2)))/2))/9.81) * 2))* 9.81)/(pow(v, 2)))/2),-10,45)/45

(code is bugged, proper lines here: https://www.reddit.com/user/Any-Condition2313/comments/u5f1vj/parallaxftcode/ )

Please note: The code is rigged for all-round, 180 degree transverse and 45 elevation turrets. The numbers 180 (transverse) and 45 (elevation) mark how much the guns elevate and transverse. Set this number to something that you prefer for your turrets, and set the rotators to the coresponding angle (75 transverse on code=set rotator to 75 degree range)

For guns:

Elevation (set rotator invert to yes):

inverselerp(0,90,TargetElevation + (rate(TargetElevation) * (TargetDistance / v)))

Transverse (works with both cannons and guns)

Transverse (bow turrets):

(((TargetHeading - Heading) + (rate(TargetHeading) * (TargetDistance / v)))/ 180) * clamp01(TargetDistance < 10000) * clamp01(TargetDistance > 2)

Transverse (stern turrets):

floor(0.75 + abs((((TargetHeading - Heading) + (rate(TargetHeading) * (TargetDistance / v)))/ 180) * clamp01(TargetDistance < 10000) * clamp01(TargetDistance > 2))) * sign(-(((TargetHeading - Heading) + (rate(TargetHeading) * (TargetDistance / v)))/ 180) * clamp01(TargetDistance < 10000) * clamp01(TargetDistance > 2)) - (((TargetHeading - Heading) + (rate(TargetHeading) * (TargetDistance / v)))/ 180) * clamp01(TargetDistance < 10000) * clamp01(TargetDistance > 2) * floor(0.25 - abs((((TargetHeading - Heading) + (rate(TargetHeading) * (TargetDistance / v)))/ 180) * clamp01(TargetDistance < 10000) * clamp01(TargetDistance > 2)))

Please note: 'v' is your muzzle velocity. Replace it with the muzzle velocity of your gun in m/s (guns with 1800m/s velocity should have the 'v' in the codes replaced with '1800)

Demonstration video:

https://www.youtube.com/watch?v=TtQO8SW6RzI

IMPORTANT: The code for the cannon elevation is bugged. u/Any-Condition-2313 has archived the proper code here:

https://www.reddit.com/user/Any-Condition2313/comments/u5f1vj/parallaxftcode/

  • Log in to leave a comment
  • Profile image

    @BlackZero I've perfected the code for a much simplified auto-aim system some time ago. It does include port and starboard mounted turrets as well.

    See my FT-rigged IJN Yamato.

    1.7 years ago
  • Profile image
    1,781 BlackZero

    Are there any attempts for starboard and port side auto aim turrets?

    +1 1.7 years ago