Question Lua call to open retro engine doors?

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Hasn't the Delta Glider its own Lua interface?
I think you can use the overloaded method 'Retro' for that.
Code:
v = vessel.get_interface("GL-01")
[COLOR="Green"]-- make sure we've got a Delta Glider[/COLOR]
class = v:get_classname()
if (class ~= 'DeltaGlider') and (class ~= 'DG-S') then
    term.out('Warning: Designed for use with DeltaGlider.')
    [COLOR="Green"]-- exit ?!?[/COLOR]
end

v:Retro(0) [COLOR="Green"]-- Close Retro Cover[/COLOR]
v:Retro(1) [COLOR="Green"]-- Open Retro Cover[/COLOR]
This is untested code however.

The additional methods for the DG are:
"Gear", "Nosecone", "Hatch", "Retro", "OLock", "ILock", "Radiator" and "ABrake"

---------- Post added at 18:09 ---------- Previous post was at 17:56 ----------

Here's the parameters for those:

v:Gear(action)
-- (action & 1) -> Lower Gear
-- else -> Raise Gear

v:Nosecone(action)
-- (action == 0) -> Close Nosecone
-- else -> Open Nosecone

v:Hatch(action)
-- (action == 0) -> Close Hatch
-- else -> Open Hatch

v:Retro(action)
-- (action == 0) -> Close Retro Cover
-- else -> Open Retro Cover

v:OLock(action)
-- (action == 0) -> Close Outer Airlock
-- (action == 1) -> Open Outer Airlock

v:ILock(action)
-- (action == 0) -> Close Inner Airlock
-- (action == 1) -> Open Inner Airlock

v:Radiator(action)
-- (action == 0) -> Close Radiator
-- (action == 1) -> Open Radiator

v:ABrake(action)
-- (action == 0) -> Retract Airbrake
-- (action == 1) -> Extend Airbrake
 
Last edited:

dmurley

New member
Joined
Dec 11, 2017
Messages
37
Reaction score
0
Points
0
Location
Hill country (near San Antonio
This is fantastic. Thanks. I've tried the Retro() function and it works just fine. Is there anyway I could have found out about these functions without asking?
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Is there anyway I could have found out about these functions without asking?
Probably. I must admit that this information was very well "hidden" :)
I got it from the source code of the Delta Glider (Orbitersdk\samples\Vessel\DeltaGlider\DGLua.cpp to be precise).
 
Top