Search results

  1. dgatsoulis

    Question Trying to implement keypress detection in Lua. [SOLVED]

    It was a shot in the dark from me after many unsuccessful attempts to get keypress detection in Lua. It was actually Martin that provided the correct working code. For my small part in this, I am absolutely fine for it to be used in OpenOrbiter.
  2. dgatsoulis

    Software Atmospheric Autopilot for DG

    One solution is to use AutoHotKey. You can write a quick script in a text file and save it as (name of your file).ahk. Then you can run it before running Orbiter and use any combination of keys you want to write anything you want. Here is an example: ^j:: { Send "aap.hdg(200)" } The "^j"...
  3. dgatsoulis

    Problem Script crashes when attempting to access navaid table element in Lua?

    hnav = vi:get_navsource(0) nav_table = oapi.get_navdata(hnav) msg = string.format("%.3f",nav_table.lng) note:set_text(msg) This should work and return the lng table element with 3 decimals. (Not on an Orbiter computer to verify right now).
  4. dgatsoulis

    Orbiter Screenshot Thread

    NASA's solar system treks has a 3d model in a few different resolutions: It is in obj format, but it's not textured: Same link also has the Hayabusa2 global DEM (Digital Elevation Model). One can make "proper" surface elevation tiles for Ryugu with that.
  5. dgatsoulis

    General Question Obtaining MOLA data ...

    Bump this. An in depth tutorial on how to obtain and convert height data from a NASA tiff file to .elv files and create an archive tree file would be great. That said, Orbiter's High-resolution texture packs for Mars, already have the following: The HRSC data have 200m/px coverage (not...
  6. dgatsoulis

    Base Moon Village, partially buried base + Pads

    Here is a nice ESA video showing the lander, habitat deployment and the regolith cover. I think that this would make a really cool addon! About the inflate/deflate animation: I believe that it should be possible to run an "inflate" physics simulation in Blender as an animation, and extract...
  7. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    Activate Good to hear you got it working. I also don't really like popup windows, as I feel that they break the immersion, especially on ships with a nice VC. The method you chose is probably better. Perhaps add a "factor" or "adj" button to change the scale of the increased/decreased value...
  8. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    finally got it to work (in somewhat the intended way). The set button simply sets the airspeed target and then the hold button either holds the set speed or if no set speed exists, holds the current speed. --[[ Name = Airspeed Hold Script = AirspeedHold.cfg Key = 0x1E ; 'A' Persist = vessel...
  9. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    Not an OS thing. Hangs on me too (Windows 10). It appears that the MFD script doesn't like the loop that proc.wait_input creates. I got an input window opening with the code below, but the string is not returned to the airspeed_target variable --[[ Name = Airspeed Hold Script =...
  10. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    Here is a "direct" script for a hold airspeed ap example, with keypress detection. Alt-W to engage/disengage the AP. Alt-S to set the speed. I've commented everything, so it should be clear. Unzip in your Orbiter directory and run the "Airspeed_ap_test" scenario. The keystate.dll in the zip...
  11. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    Just noticed the edited post #5. So you want both a hold and set speed AP. Yes you can with str = proc.wait_input(title). The returned value is a string, but you can convert to a number with hold_vel = tonumber(str). I'll try to post an example with a "direct" script and then we can see how to...
  12. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    If your goal is to set the thrust then you can only do it with the vessel functions in Lua. v:get_thrusterlevel(ht) or v:get_thrustergrouplevel(type) to get the current thrust of a thruster or thruster group and v:set_thrusterlevel(ht,lvl) or v:set_thrustergrouplevel(type,lvl) to set the thrust...
  13. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    Yeah the syntax needs a bit of getting used to it. If you have the vessel interface, you can use the vessel methods instead of the general orbiter API functions. Here is an example: --create annotation on screen note = oapi.create_annotation() note:set_pos (0.7,0.06,0.9,0.95) --(x_start...
  14. dgatsoulis

    Question [SOLVED] oapi.get_airspeedvector(vi, REFFRAME.LOCAL) returning type nil?

    is "vi" the handle of the vessel or is it the interface?. Try oapi.get_airspeedvector(REFFRAME.LOCAL), so it returns the airspeed vector of the focus vessel. If the returned type is "table", the you did not obtain the vessel's handle correctly in your post above. hobj =...
  15. dgatsoulis

    Problem LunarTransferMFD not working on Orbiter 2010

    Weird. This is what I get: Thanks for pointing that out Ripley.. :cheers: Seems the OP got a working link so all is good.
  16. dgatsoulis

    Problem LunarTransferMFD not working on Orbiter 2010

    As the OP mentioned, the Orbiter 2010 version is Not Archived. When you click on the Download 1.4 (~788k) For Orbiter 2010. link, you get a message that says "The Wayback Machine has not archived that URL."
  17. dgatsoulis

    Question Send key combination with Lua [SOLVED]

    Ok, I found a solution that is a bit convoluted, but gets the job done: int Interpreter::v_send_ctrlbufferedkey(lua_State *L) { static char *funcname = "send_ctrlbufferedkey"; AssertMtdMinPrmCount(L, 2, funcname); VESSEL *v = lua_tovessel_safe(L, 1, funcname); int key =...
  18. dgatsoulis

    Question Send key combination with Lua [SOLVED]

    I am writing an ascent autopilot for the XR2 in Lua, and I need a way to send key combinations to the Ravenstar. I tried v:send_bufferedkey, but it takes only one input (keycode). I attempted using nested while loops but I only got one key pressed, not both at the same time: goal = 0 while goal...
  19. dgatsoulis

    General Question Set animation from scenario file

    While it's true that there is no consumebufferedkey implemented in lua, you can detect pressed keys with this. (There is v:send_bufferedkey(keycode) method which is described in the section Orbiter Scripting→Reference→Class methods→Vessel methods in the Orbiter.chm file, but you can only send...
  20. dgatsoulis

    OHM Orbiter addon challenge. The Beacon Project

    Using some online calculators, I find that the diffraction limit for a 6" aperture is about 0.8 arcseconds. The Moon's angular size is 1900 arcseconds, so that translates to objects ~ 1.5 km in size. For double the aperture, we get half the size, so about 750 meters. But what does that mean? If...
Top