Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Orbiter Lua Scripting
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter Lua Scripting Find support, share snippets and general discussion around using the Lua engine in Orbiter.

Reply
 
Thread Tools
Old 07-19-2019, 05:09 PM   #1
dmurley
Orbinaut
Default Lua call to open retro engine doors?

Is there a Lua call to open retro engine doors? I have not been able to find one.
dmurley is offline   Reply With Quote
Old 07-19-2019, 06:09 PM   #2
kuddel
Donator
Default

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")
-- make sure we've got a Delta Glider
class = v:get_classname()
if (class ~= 'DeltaGlider') and (class ~= 'DG-S') then
    term.out('Warning: Designed for use with DeltaGlider.')
    -- exit ?!?
end

v:Retro(0) -- Close Retro Cover
v:Retro(1) -- Open Retro Cover
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 by kuddel; 07-19-2019 at 06:14 PM.
kuddel is offline   Reply With Quote
Thanked by:
Old 07-19-2019, 09:31 PM   #3
dmurley
Orbinaut
Default

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?
dmurley is offline   Reply With Quote
Old 07-19-2019, 10:23 PM   #4
kuddel
Donator
Default

Quote:
Originally Posted by dmurley View Post
 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).
kuddel is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Orbiter Lua Scripting


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 02:53 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.