-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautostaging.ks
More file actions
34 lines (31 loc) · 814 Bytes
/
autostaging.ks
File metadata and controls
34 lines (31 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// autostaging functions
function check_stage_thrust
{
// compares old max thrust to current max thrust
// stages if current less than old
if not (defined old_thrust) declare global old_thrust to ship:availablethrust.
if (old_thrust = 0) set old_thrust to ship:availablethrust.
if (ship:availablethrust < old_thrust - 2)
{
print "Flameout".
set old_thrust to 0.
return false.
}
return true.
}
function autostage
{
// function to complete interstages
// stages once for decoupler, then waits 0.5, then stages to ignite next stage
print "Staging: Decoupler".
resetOSS().
WAIT 1.
stage.
if (ship:availablethrust < 0.01)
{
set throttle_pid to 1.
print "Staging: Ignition".
WAIT 2.
stage.
}
}