Jump to content

Need Help on kOS Autopilot Script


Azerty

Recommended Posts

Hello, I'm trying to improve an old SSTO autopilot but it doesn't work and i can't figure it out why.

Here is my script :

CLEARSCREEN.

BRAKES ON.
SET LOOP TO TRUE.
SET THROT TO 0.
SET Y TO 0.
SAS OFF.
RCS OFF.
CLEARSCREEN.

SET STEP TO "Ignition".

function display
{
    PRINT "Altitude: " + SHIP:ALTITUDE AT (15,4).
    PRINT "Speed: " + VELOCITY:SURFACE:MAG AT (15,5).
    PRINT "Apoapsis " + APOAPSIS AT (15,6).
    PRINT "Periapsis " + PERIAPSIS AT (15,7).
    PRINT "Time to Apoapsis: " + ETA:APOAPSIS AT (15,8).
    PRINT STEP AT (15,9).
    PRINT Y AT (15,10).
    PRINT SHIP:BEARING AT (15,11).
}

UNTIL LOOP=false
{
    display().
    LOCK THROTTLE TO THROT.
    LOCK STEERING TO HEADING(90,Y).
    IF STEP="Ignition"

    {
        SET AG1 TO TRUE.
        SET THROT TO 1.
        BRAKES OFF.
        SET STEP TO "TakeOff".
        CLEARSCREEN.
    }

    IF STEP="TakeOff"
    {
        SET Y TO 7.
    }
}

Actually my problem is the LOCK STEERING. It lock the steering indeed but not at the right pitch. I made another script in which it works so i don't understand what is happening.

Thanks for your help.

Edited by Azerty
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...