Jump to content

kOS script for a shuttle


samsunix

Recommended Posts

Hello and sorry if I post this in wrong place.

I'am working with kOS script to get my shuttle to orbit but I have couple of problems.

First problem is with a stage to separate boosters when they flame out / are empty.

Second Problem is at stage when I should turn off main engine. Here is what I got so far:

CLEARSCREEN.
PRINT "Counting down:".
FROM {local countdown is 10.} UNTIL countdown = 0 STEP {SET countdown to countdown - 1.} DO {
    PRINT "..." + countdown.
    WAIT 1.
    CLEARSCREEN.
}
LOCK THROTTLE TO 0.5.
STAGE.
WAIT 1.
STAGE.
PRINT "LIFT OFF!".
lock steering to lookdirup(heading(90,85):vector, ship:facing:topvector).
WAIT UNTIL SHIP:ALTITUDE > 3000.
PRINT "Adjusting to 80 degree".
lock steering to lookdirup(heading(90,80):vector, ship:facing:topvector).
WAIT UNTIL SHIP:ALTITUDE > 4000.
PRINT "Adjusting to 75 degree".
lock steering to lookdirup(heading(90,75):vector, ship:facing:topvector).
WAIT UNTIL SHIP:ALTITUDE > 5000.
PRINT "Adjusting to 70 degree".
lock steering to lookdirup(heading(90,70):vector, ship:facing:topvector).
WAIT UNTIL SHIP:ALTITUDE > 6000.
PRINT "Adjusting to 65 degree".
lock steering to lookdirup(heading(90,65):vector, ship:facing:topvector).
WAIT 3.
PRINT "Waiting boosters flameout...".

// I have tryed: 

// WHEN STAGE:SOLIDFUEL < 10 THEN {
 // WAIT 2.
 // STAGE.
 // }.

// and another one:

//LIST ENGINES IN elist.

//set seperation to false.

//UNTIL(//don't know what I should but here){
//    if(seperation){
//        LIST ENGINES IN elist.
//        set seperation to false.
//    }
//    FOR e IN elist {
//        if (e:FLAMEOUT and STAGE:READY){
//            STAGE.
//            set seperation to true.
//        }
//    }
//}.
RCS ON.
WHEN SHIP:APOAPSIS > 75000 THEN {
LOCK THROTTLE TO 0.0.
}.
lock steering to prograde.

// something to turn off main engines

WAIT 5.
STAGE.
WHEN SHIP:ALTITUDE > 75000 THEN {
LOCK THROTTLE TO 0.9.
}.
WHEN SHIP:periapsis > 75000 THEN {
LOCK THROTTLE TO 0.0.
}.

Thank you for your help

 

- Sam

 

picture of a shuttle

Link to comment
Share on other sites

If you do:

 

// FLAMEOUT CHECK:

LOCAL FLAMEOUT IS FALSE.
LIST ENGINES IN ENGLIST.
FOR ENG IN ENGLIST {
  IF ENG:FLAMEOUT {
    SET FLAMEOUT TO TRUE.
  }
}
// IF FLAMEOUT IS TRUE NOW, THEN AT LEAST ONE ENGINE HAS FLAMED OUT.

 

Then you can see when any engine has flamed out.

 

If you have other questions, check the Reddit group : https://www.reddit.com/r/kos

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...