Profile image

Auto targeting turret?

879 MausTrap1946  4.2 years ago

So I just recently got into funky trees (new commands looked like fun) and I am having trouble making a turret that will lock onto a targeted opponent. Whenever I try it just spins endlessly. Can anybody help me? This is the commands I currently have

Left/right rotator

Min: 0
Max: 360
Input: TargetHeading

Up/down rotator:

Min:0
Max:1
Input: Target elevation

  • Log in to leave a comment
  • Profile image

    My turrent is just constantly spinning, How do I fix it?

    +3 2.1 years ago
  • Profile image
    825 AceWorks

    @232287168147825 hey man can you help me with my turret? I wasn't really good at funky tree stuff so yeah can you help me making it auto targeting?
    Here's the commands

    Rotation
    Min:-1
    Max:1
    Elevation
    Min:-0.23
    Max:2.05

    Old help

    +1 3.0 years ago
  • Profile image

    thank you for the info

    3.1 years ago
  • Profile image

    @FishyKrebs and your friend burgdorf making mess with fuhrer and making booze are banned, oh ya, fish are banned too

    +1 3.6 years ago
  • Profile image

    @MentallyDistorted oh shit , i Can't use Map pointing of doom now

    3.6 years ago
  • Profile image

    @FishyKrebs kreb, fuhrer eated your map.

    +1 3.6 years ago
  • Profile image

    @MentallyDistorted i had the same problem like you

    +1 3.6 years ago
  • Profile image

    @232287168147825 well, now my PBM 1 Mariner is spinning but i already set it to 30*, how to fix it ?

    +1 3.6 years ago
  • Profile image

    @232287168147825 what if i attach it to a multi turret on a B 17, like front, sides, and rear, is the rotation need to change or no ?

    +3 3.6 years ago
  • Profile image
    5,760 NavalGunnery

    @NumbersNumbersTheMan my mind has opened

    +3 3.9 years ago
  • Profile image
    513 Grey1

    Can this be done via mobile?

    +1 4.0 years ago
  • Profile image

    @NumbersNumbersTheMan thank you.

    4.2 years ago
  • Profile image
    44.3k rexzion

    @NumbersNumbersTheMan doesn't he have to pay you 20$

    4.2 years ago
  • Profile image

    ok, copying is cool, but learning is cooler


    this is a simple one:
    heading:

    this one will point a 180 degree heading rotator at the target

    (TargetHeading - Heading) / 180 
    

    We subtract our heading because TargetHeading is a global value, not in relation to the craft.


    elevation:
    this will point a 90 degree elevation rotator at the target

    (TargetElevation) / 90
    

    you will get this result. it points at the target.



    now let's say you wanted to be a little cooler
    you can add some target leading very easily.
    The idea is that if we know the rate of angle change using rate(), we can predict the next angular position using the time it will take for the bullet to get there.
    https://pastebin.com/jCBzdxRc
    .
    We add (rate(VALUE) * (TargetDistance / SPEED)) to the old one. You can very easily derive this function to realize it does what I've written above, but in FT.


    Take note:
    - these are assuming gravityless projectiles (guns).=
    - if put in rotators these will only work when you're level.
    - the above can be solved by modifying these for gyros, which are global adjusters.
    - the examples I've given you, especially the first one, are quite not complicated and should be easy to understand

    +20 4.2 years ago
  • Profile image

    @Brendorkus thank you!

    4.2 years ago
  • Profile image
    21.7k Brendorkus

    Yoink @MausTrap1946

    +1 4.2 years ago
  • Profile image

    @HawaiiRanger I was not able to find anything by searching for turrets. Any help?

    4.2 years ago
  • Profile image
    6,300 HawaiiRanger

    Look at the ones that have been made already and copy the code. You could also look at it and see how it works and then type it yourself.

    +1 4.2 years ago
  • Profile image

    @ImaCat
    Oh. That makes sense

    4.2 years ago