Profile image

Any funky trees experts here? I need your help [solved] [problem identified, solution yet to be found]

7,586 overlord5453  17 days ago
So I posted a video showing a ft guided glide bomb. But soon after I ran into a problem.
I tested it with the flight computer that's supposed to be it's brain as the main cockpit. I did assign it custom variables so it doesn't need to depend on the main cockpit. But as soon as I added a different flight computer as the main cockpit and detached it while testing, it stopped guiding. Vertical guidance is working just fine. The proproblem is with horizontal guidance. The code for it is
deltaangle(ha, TargetHeading) /35
ha is the heading of the flight computer on the bomb. 35 is the max deflection angle of the control surfaces. It works fine as long as the main cockpit is still attached to the bomb or the flight computer (the brain of the bomb) is the main cockpit. Doesdeltaangle function depend on the main cockpit somehow despite not using any data from it?
How can i fix this? Is there code that i can replace this with?

please I need your help. I thought I figured it out only to get hit in face with this.

  • Log in to leave a comment
  • Profile image
    13.3k Grob0s0VBRa

    You need to use auto-aim code for that.

    Set names for Latitude, Longitude, Altitude, Pitch and Roll angles (you already have heading angle; set them with sometthing short like Zbomb - Latitude, Xbomb - Longtude, Ybomb - Altitude and so on) in variable output of bomb-mounted computer.
    Then you set variables
    TgtposX

     sin(TargetHeading)*abs(cos(TargetElevation))*TargetDistance+Xbomb
    

    TgtposZ

     cos(TargetHeading)*abs(cos(TargetElevation))*TargetDistance+Zbomb
    

    TgtposY

     sin(TargetElevation)*TargetDistance+Ybomb
    

    HbombX

     cos(-Rbomb)*(cos(-Hbomb)*((TgtPosX-Xbomb))+sin(-Hbomb)*((TgtPosZ- 
     Zbomb)))+-sin(-Rbomb)*(cos(Pbomb)*((TgtPosY-Ybomb))+-sin(Pbomb)*(-sin(- 
     Hbomb)*((TgtPosX-Xbomb))+cos(-Hbomb)*((TgtPosZ-Zbomb))))
    

    HbombZ

    sin(Pbomb)*((TgtPosY-Ybomb))+cos(Pbomb)*(-sin(-Hbomb)*((TgtPosX- 
    Xbomb))+cos(-Hbomb)*((TgtPosZ-Zbomb)))
    

    HbombY

     sin(-Rbomb)*(cos(-Hbomb)*((TgtPosX-Xbomb))+sin(-Hbomb)*((TgtPosZ-Zbomb)))+cos(-Rbomb)*(cos(Pbomb)*((TgtPosY-Ybomb))+-sin(Pbomb)*(-sin(-Hbomb)*((TgtPosX-Xbomb))+cos(-Hbomb)*((TgtPosZ-Zbomb))))
    

    And the last one:
    Hbomb

     ((TargetSelected)?clamp(repeat(atan(HbombX/HbombZ)+(sign(HbombZ)? 
     0:180)+180,360)-180,-180,180)/1:0) 
    

    Should work.

    Pinned 16 days ago
  • Profile image
    7,586 overlord5453

    Never mind, TargetHeading is the problem. It depends on the main cockpit's position. Now I have to find a solution. I have target coordinates and bomb coordinates. I have to use these to get a bearing to target. Thanks for stopping by by the way.

    Pinned 17 days ago
  • Profile image
    7,586 overlord5453

    @Grob0s0VBRa

    finally, thank you :D

    Already had target position. But again, thanks.

    +1 16 days ago
  • Profile image
    7,586 overlord5453

    @Graingy [insert gibberish here]

    16 days ago
  • Profile image
    35.8k Graingy

    I like your funny words magic man

    +1 16 days ago