Jump to content

Creating KOS for engine failure to shutdown engine and fuel empty ready to stage. (solved 1 part. Still working on the other.)


Recommended Posts

There's plenty of extra here. It's mostly notes to see what's going on while the code runs. Find out where the code is at.
I'm still trying to understand code structure.
I'm trying to figure out how to shutdown the engine and stop the launch if the engine fails in any way.

I can't find an example of how to activate or shutdown an engine

 

global function shut {
 
    SET voice to getVoice(0).
    SET voiceTickNote to NOTE(480, 0.1).
    SET voiceTakeOffNote to NOTE(720, 0.5).
clearScreen.
list engines.
print " ".
list Resources.
//set engine:35451629920 a4.
print "locking throttle".
    lock throttle to 1.
    wait 1.
print "locking attitde control".
  SAS off.
  LOCK STEERING to UP + R(0, 0, 180).
  wait 1.
print "5".
  voice:PLAY(voiceTickNote).
  wait 1.
print "Ignition" at (5,3).
  stage.
print "4".
PRINT "Thrust 1 " + round (ship:maxthrust, 3).
print "Avail th " + round (ship:AVAILABLETHRUST, 3).
  voice:PLAY(voiceTickNote).
  wait 1.
print "3".
PRINT "Thrust 2 " + round (ship:thrust, 3).
  voice:PLAY(voiceTickNote).
  wait 1.
print "2".
PRINT "Thrust 3 " + round (ship:maxthrust, 3).
  voice:PLAY(voiceTickNote).
  wait 1.
print "1".
 PRINT "Thrust 4 " + round (ship:thrust, 3).
shu().
function shu {
 if ship:maxthrust * 0.9 > AVAILABLETHRUST * 0.8 {
  PRINT "Thrust not achived to launch".
  Print "Shutting down engine".
  }
 
 //else {
 //print "Go for launch".
 // }
//}
//  voice:PLAY(voiceTakeOffNote).
//  stage.
print "Launch" at (5,6).
 wait 1.
PRINT "Thrust 3 ".
 wait 1.
PRINT "Thrust 2 ".
 wait 1.
PRINT "Thrust 1 ".
 wait 1.
 }
 
}

 

Edited by LTL King
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...