I could use some help with my kOS script, because I can not find my error. I play 1.2.2 with RO (no remote tech and remote tech.cfg removed from RO) and kOS 1.1.5.1.
My script describes a gravity turn. Steering up until a certain speed, pitching down by 10 degrees and waiting until pitch is aligned with srfprograde pitch.
Then trouble begins: I unlock the steering to avoid the use of SAS with LOCK. I turn on SAS. I wait 0.01. And Im trying to SET SASMODE TO "SRFPROGRADE". But nothing changes. I´m unable to change the SASMODE.
Also I use a function to automatically stage each time the SHIP:MAXTHRUST is less than 0.2. But upon flameout it won`t stage. Could someone please check, if my following script is the problem? The part, where I think the trouble is located is marked by red letters.
Thanks very much!
SET FlexPitch TO 0. // for Periapsis function
LOCK THROTTLE TO 1. SAS OFF. RCS OFF.
LOCK STEERING TO UP.
STAGE. // Main Engine ignition
WAIT 3. // Main Engine run up time
STAGE. // Booster ignition + launch clamps
WAIT UNTIL SHIP:VELOCITY:SURFACE:MAG > 40. // vertical speed for gravity turn
LOCK STEERING TO HEADING (90,80). // Gravity turn pitching down 10 degrees
WAIT UNTIL (90 - VANG(ship:up:vector, ship:srfprograde:vector)) < 80. // wait until sfrprograde pitch is less then 80 degrees.
UNLOCK STEERING. // to prevent use of SAS with LOCK SAS ON. // SAS stability assist mode
WAIT 0.01. // thought this would help with the next line
SET SASMODE TO srfPROGRADE. // supposed to set sas to srfprograde but does not work
UNTIL APOAPSIS { IF SHIP:MAXTHRUST < 0.2 // if the thrust decreases the stage is burnt out
{ STAGE. // decouples empty stage, activates retros, activates next engine
SET SASMODE TO PROGRADE. // switching from surface to orbital prograde
}
ELSE { WAIT 1. }. // to avoid kOS doing too many calculations
SAS off. // because I will use LOCK from now on until circularized
LOCK STEERING TO HEADING(90, FlexPitch). // FlexPitch is 0 for now
UNTIL SHIP:PERIAPSIS > 140000 { // Function pitches up or down, depending on vert speed
IF SHIP:PERIAPSIS > 132000 SET FlexPitch to 0. // to keep vessel at around apoapsis altitude
ELSE IF SHIP:VELOCITY:ORBIT:MAG < -50 SET FlexPitch TO 15.
ELSE IF SHIP:VELOCITY:ORBIT:MAG > -50 SET FlexPitch TO
(SHIP:VELOCITY:ORBIT:MAG / (-4)).
}.
} // no idea why this curly bracket has to be here, but it works only with it
LOCK THROTTLE TO 0. // throttle idle
UNLOCK STEERING. // unlocks the steering
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.
Question
Whateverest
Hey everybody,
I could use some help with my kOS script, because I can not find my error. I play 1.2.2 with RO (no remote tech and remote tech.cfg removed from RO) and kOS 1.1.5.1.
My script describes a gravity turn. Steering up until a certain speed, pitching down by 10 degrees and waiting until pitch is aligned with srfprograde pitch.
Then trouble begins: I unlock the steering to avoid the use of SAS with LOCK. I turn on SAS. I wait 0.01. And Im trying to SET SASMODE TO "SRFPROGRADE". But nothing changes. I´m unable to change the SASMODE.
Also I use a function to automatically stage each time the SHIP:MAXTHRUST is less than 0.2. But upon flameout it won`t stage. Could someone please check, if my following script is the problem? The part, where I think the trouble is located is marked by red letters.
Thanks very much!
SET FlexPitch TO 0. // for Periapsis function
LOCK THROTTLE TO 1.
SAS OFF.
RCS OFF.
LOCK STEERING TO UP.
STAGE. // Main Engine ignition
WAIT 3. // Main Engine run up time
STAGE. // Booster ignition + launch clamps
WAIT UNTIL SHIP:VELOCITY:SURFACE:MAG > 40. // vertical speed for gravity turn
LOCK STEERING TO HEADING (90,80). // Gravity turn pitching down 10 degrees
WAIT UNTIL (90 - VANG(ship:up:vector, ship:srfprograde:vector)) < 80. // wait until sfrprograde pitch is less then 80 degrees.
UNLOCK STEERING. // to prevent use of SAS with LOCK
SAS ON. // SAS stability assist mode
WAIT 0.01. // thought this would help with the next line
SET SASMODE TO srfPROGRADE. // supposed to set sas to srfprograde but does not work
UNTIL APOAPSIS { IF SHIP:MAXTHRUST < 0.2 // if the thrust decreases the stage is burnt out
{ STAGE. // decouples empty stage, activates retros, activates next engine
SET SASMODE TO PROGRADE. // switching from surface to orbital prograde
}
ELSE { WAIT 1. }. // to avoid kOS doing too many calculations
SAS off. // because I will use LOCK from now on until circularized
LOCK STEERING TO HEADING(90, FlexPitch). // FlexPitch is 0 for now
UNTIL SHIP:PERIAPSIS > 140000 { // Function pitches up or down, depending on vert speed
IF SHIP:PERIAPSIS > 132000 SET FlexPitch to 0. // to keep vessel at around apoapsis altitude
ELSE IF SHIP:VELOCITY:ORBIT:MAG < -50 SET FlexPitch TO 15.
ELSE IF SHIP:VELOCITY:ORBIT:MAG > -50 SET FlexPitch TO
(SHIP:VELOCITY:ORBIT:MAG / (-4)).
}.
} // no idea why this curly bracket has to be here, but it works only with it
LOCK THROTTLE TO 0. // throttle idle
UNLOCK STEERING. // unlocks the steering
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
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.