Skip to content

Instantly share code, notes, and snippets.

@KSAMissionCtrl
Created August 1, 2018 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KSAMissionCtrl/55c59e7ea9aa9bd1d0746324b0ab659d to your computer and use it in GitHub Desktop.
Save KSAMissionCtrl/55c59e7ea9aa9bd1d0746324b0ab659d to your computer and use it in GitHub Desktop.
Release a rocket from the aircraft if certain conditions are met
function pitch_for {
parameter ves.
return 90 - vang(ves:up:vector, ves:facing:forevector).
}
when ship:altitude < 6700 then set release to true.
set release to false.
set pitch to 0.
until false {
clearscreen.
print pitch_for(ship).
if pitch_for(ship) > pitch set pitch to pitch_for(ship).
if release = true and ship:altitude >= 7000 and pitch_for(ship) >= 63 and ship:velocity:surface:mag > 70 {
stage.
set release to false.
}
print pitch.
wait 0.1.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment