hm ich wäre für ein neues unter forum kOS
der herr @käsekuchen hat mich drauf gebracht und ich habs mal einfach geschrieben
ist noch ungetestet es müssen ggf noch syntax fehler raus gehauen werden
dieses script zählt von 10 bis 0
ab 6 startet es die triebwerke bei 30% und regelt diese bei 1 auf 100%
die Parameter lassen sich aber auch beliebig anpassen
das script geht davon aus das stage 1 die triebwerke sind, die hoch gefahren werden, und in stage 2 die klammern stecken
edit:
getestet und lauffähig
edit2:
den part vom käsekuchen ist mit eingebaut
Code
- SET TERMINAL:WIDTH to 80.
- SET TERMINAL:HEIGHT to 40.
- clearscreen.
- PARAMETER TAp. //Target Ap
- PARAMETER TPe. //Target Pe
- PARAMETER TIn. //Target Inclination
- SET t to 0.
- SET pitch TO 90.
- SET LOOPCONTROLL to false.
- SET COUNTER to 10.
- SET LASTPRINTTIMER to -1.
- SET MINTHROTTLE to 0.3.
- SET THROTTLESTART to 4. //start COUNTER -> throttle = THROTTLE
- SET THROTTLEEND to 2. //END COUNTER -> throttle = 100
- SET ENGINESTARTED to false.
- LOCK Throttle to 0.
- PRINT "start counter".
- UNTIL LOOPCONTROLL{
- //print the T-xxx
- if(LASTPRINTTIMER <> CEILING(COUNTER)){
- SET LASTPRINTTIMER to CEILING(COUNTER).
- print "T-" + LASTPRINTTIMER.
- }
- if(COUNTER <= THROTTLESTART){
- if(ENGINESTARTED = false){
- //start engines
- SET ENGINESTARTED to true.
- STAGE.
- print "Ignition! Throttling up.".
- HUDTEXT ("Ignition! Throttling up.", 5, 2, 30, green, false). //Text der im Bild angezeigt wird. Message, Delay, Position, Farbe, doEcho
- }
- Lock Throttle to calc_throttle(THROTTLESTART , THROTTLEEND , COUNTER , MINTHROTTLE).
- }
- SET COUNTER to COUNTER - 0.1.
- // abbruch fuer die schleife
- IF COUNTER <= 0{
- SET LOOPCONTROLL to true.
- }
- wait 0.1.
- }
- //Staging Solidfuel
- when stage:solidfuel <= 0.01 then {
- stage. //Ignition Main Engine
- set t to 1.
- print "T+"+round(missiontime)+" Seconds. Separate Booster".
- }
- STAGE.
- PRINT "Take off".
- when ALT:RADAR >= 50 then {
- print "T+"+round(missiontime)+" Seconds. Tower Cleared".
- }
- //Rollprogram
- when ALT:RADAR >= 100 then {
- print "T+"+round(missiontime)+" Seconds. Starting Rollprogram".
- set mysteer to heading(TIn,90).
- LOCK steering TO mysteer.
- }
- //Gravityturn
- wait until ALT:RADAR > 1000.
- print "T+"+round(missiontime)+" Seconds. Starting Gravityturn".
- until apoapsis >= TAp{
- if pitch <= 60 and pitch > 40 {
- lock throttle to 1.
- }
- if pitch <= 40 and pitch > 20 {
- lock throttle to 0.7.
- }
- if pitch <= 20 and pitch > 0 {
- lock throttle to 1.
- }
- if eta:apoapsis < 30 {
- lock throttle to 1.
- }
- if t = 1 and stage:liquidfuel <= 0.02 {
- LFStaging().
- }
- until pitch <= 15
- {
- set mysteer to heading(TIn,pitch).
- set pitch to -.0000000125*(ship:apoapsis*ship:apoapsis)+87.
- print "pitching to " + pitch + " degrees" at (40,0).
- }
- }
- lock throttle to 0.
- IF t = 1 {
- LFStaging().
- }
- //Warp
- WAIT UNTIL ETA:APOAPSIS <= 200.
- SET warp to 3.
- WAIT UNTIL ETA:APOAPSIS <= 140.
- SET warp to 0.
- WAIT 10.
- SET mysteer to heading(TIn,0).
- WAIT UNTIL ETA:APOAPSIS < 90.
- //Circularizing
- until periapsis >= TPe {
- set mysteer to heading(TIn,0).
- if eta:apoapsis < 70 and eta:apoapsis >= 30 {
- lock throttle to 1.
- set mysteer to heading(TIn,0).
- }
- print "circularizing..." at (40,2).
- }
- lock throttle to 0.
- print "apoapsis at " + round(ship:apoapsis,0).
- print "periapsis at " + round(ship:periapsis,0).
- //Warp
- WAIT UNTIL ETA:PERIAPSIS <= 200.
- SET warp to 3.
- WAIT UNTIL ETA:PERIAPSIS <= 140.
- SET warp to 0.
- WAIT UNTIL ETA:PERIAPSIS < 60.
- //KEO-Transferbahn
- UNTIL VESSEL:PERIOD = 14400{
- set mysteer to heading(TIn,0).
- lock throttle to 1.
- }
- //functions
- //start count , end counter , current counter , min throttle
- function calc_throttle{
- parameter start.
- parameter end.
- parameter counter.
- parameter minThrottle.
- SET tmp1 TO start - end.
- SET tmp2 TO start - counter.
- SET tmp3 TO (tmp2 / tmp1).
- return (minThrottle + ((1 - minThrottle) * tmp3)).
- }
- //Staging Liquidfuel
- function LFStaging{
- print "T+"+round(missiontime)+" Seconds. MECO".
- wait 3.
- print "T+"+round(missiontime)+" Seconds. Separate Main Stage".
- stage.
- wait 3.
- print "T+"+round(missiontime)+" Seconds. Activate Upper Stage".
- stage.
- //set mysteer to heading(TIn,15).
- set t to 2.
- }