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