Improve landing code.
This commit is contained in:
parent
6d9b8fc554
commit
448eebdbd9
|
@ -1,3 +1,8 @@
|
|||
// assumptions about helicopter builds:
|
||||
// * AG10 toggles the rotor engine power. (with appropriate RPM set by default)
|
||||
// * AG9 is unmapped.
|
||||
// * Main throttle controls collective.
|
||||
|
||||
runoncepath("lib/control").
|
||||
|
||||
global done is false.
|
||||
|
@ -16,7 +21,15 @@ set x:AddButton("HOVER"):onClick to {
|
|||
}.
|
||||
|
||||
set x:AddButton("LAND"):onClick to {
|
||||
Stabilize(-2).
|
||||
// todo: consider a more elaborate landing script that adjusts
|
||||
// velocity as a function of altitude.
|
||||
when SHIP:STATUS = "LANDED" then {
|
||||
set done to true.
|
||||
set SHIP:CONTROL:PILOTMAINTHROTTLE to 0.5.
|
||||
toggle AG10.
|
||||
BRAKES on.
|
||||
}
|
||||
Stabilize(-5).
|
||||
}.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user