Space Engineers

Space Engineers

Large Grid Lander Script
 This topic has been pinned, so it's probably important
ZerothAngel  [developer] 16 Apr, 2016 @ 9:59am
Vertical Takeoff, Vertical Landing Module
Many commands take a "thruster specification" which is an optional string that specifies which thrusters to operate on. If omitted, all thruster types will be used.
  • i -- Ion thrusters
  • a -- Atmospheric thrusters
  • h -- Hydrogen thrusters
So "ia" would operate on ion and atmo thrusters. The order doesn't matter, nor does letter case.

Drop/re-entry commands:
  • drop start <thruster-spec> -- If not in natural gravity: start cruising in the configured "BURN" direction. Upon hitting natural gravity, script takes over orientation of the ship and aligns the "BRAKE" direction downward toward the planet. Shuts off associated thrusters so ship will begin falling. All other thrusters remain active so you can still make corrections.

  • drop brake <thruster-spec> -- Does nothing if not in natural gravity. Otherwise, (continues) to keep ship aligned so "BRAKE" direction is downward. Attempts to slow ship down to the configured speed. If you aren't slowing down, it means your thrusters aren't strong enough (yet, hopefully) or you need to activate a different set of thrusters!

  • drop stop -- Stops/resets the drop procedure, giving you back full control. Any affected thrusters are re-enabled, so essentially this slows you down to 0 and keeps you hovering.

  • drop auto <stopping-elevation> <thruster-spec> <braking-elevation> <thruster-spec> <minimum-speed> -- The semi-automatic version of the start & brake commands. The stopping elevation is the elevation at which to fully stop. It defaults to 1km. The first thruster-spec is used for the "BURN" phase. The braking elevation is the elevation in which to start braking, something that probably needs to be tuned for your ship (defaults to stopping-elevation). The last thruster-spec is used for braking/stopping. The minimum-speed is the minimum speed at which to approach the stopping-elevation. It defaults to 5 m/s and can be lowered to allow safe(r) touch down.
Launch commands:
  • launch start <thruster-spec> -- Aligns the "LAUNCH" direction upward and then boosts up to the configured speed. Continues until the ship leaves natural gravity. Does nothing (aside from re-setting thrusters) if no natural gravity is detected.

  • launch stop -- Ends/aborts the launch, giving you back full control. Thrusters are reset and reenabled.
Orbit commands:
  • orbit start -- Starts "orbiting", that is, it will attempt to periodically keep the configured facing (see VTVLHELPER_ORBIT_DIRECTION) aligned downward toward the center of the planet. Does nothing if not in natural gravity.

    Currently, it will attempt to align the ship every 3 seconds for 1/6th of a second.

    This allows you to make course corrections, and of course, use the cruise control module (as well as manual thrusting) as normal.

    Automatically disengages upon leaving natural gravity.

  • orbit stop -- This disables the orbit feature and returns full control of the ship.
Special Timer Blocks
  • When using the "launch start" command, upon leaving natural gravity, the script will "start" the timer block named "Launch Done" if found. Letter case doesn't matter and the name of the timer block may be changed by modifying VTVLHELPER_LAUNCH_DONE.

    Note that aborting the launch sequence with "launch stop" will not start the timer block.

    However, attempting "launch start" while outside of natural gravity will start the timer block.

  • When using the "drop auto" command, upon reaching the stopping altitude, the script will "start" the timer block named "Drop Done" if found. Letter case doesn't matter and the name of the timer block may be changed by modifying VTVLHELPER_DROP_DONE.

    Note that aborting the auto-drop sequence with "drop stop" will not start the timer block.
Automated Touch-Down

The key to actually touching down safely is to lower the minimum speed (which defaults to 5 m/s). Typically a minimum speed of 1 m/s is pretty safe. This can be done in two ways:
  • Editing VTVLHELPER_MINIMUM_SPEED. Do this if you only ever intend to use auto-drop to touch down on the ground, or if you don't mind it going very slow when approaching a higher stopping elevation.

  • Specifying it as the 5th argument to the "drop auto" command, e.g.
    drop auto 0 ia 1000 ia 1
You then have two options for selecting the stopping elevation, depending on whether or not you want to use the "Drop Done" timer block (see previous).
  • If you don't use or care for the "Drop Done" timer block, simply set the stopping-elevation to 0, i.e.
    drop auto 0 ia 1000 ia 1
    Once your ship touches down (hopefully it has landing gear to absorb the 1 m/s impact), it will hold position. Note that in all likelihood, the VTVL module is still active. So you will have to "drop stop" eventually to regain full control of the ship. This is because your ship most likely sits a few meters above elevation 0.

  • The other option is to first determine your ship's landed elevation, i.e. by manually landing it on a flat surface (like an ice lake).

    Then sit in a chair and look at the current elevation. Add 1 or 2 meters to this value and use that as your stopping elevation.

    Doing it this way will properly end the drop sequence and start the "Drop Done" timer block in most cases.
Automated Alignment

This is still experimental.

The script can also align the ship to a specified GPS coordinate. Simply specify the X, Y, Z values at the end of the full "drop auto" command, e.g.:
drop auto 0 ia 1000 ia 1 -199302.64 -185264.80 69890.80

During the drop, the script will aim to move your ship directly underneath (or over) the GPS coordinate. (Think of a line running from the center of the planet through the GPS coordinate -- it will try to get your ship on that line at whatever stopping elevation you specified.)

Your ship should have pretty decent forward/reverse/lateral thrusters.

A few things to help improve the alignment:
  • Try to re-enter in the general vicinity of the GPS coordinate.

  • Lower the configured VTVLHELPER_BRAKING_SPEED -- this will give you more time.

  • Increase the braking elevation in the "drop auto" command -- this will also give you more time.

  • Experiment with increasing or lowering VTVLHELPER_MAXIMUM_SPEED. This is the maximum longitudinal/lateral speed that the ship will undergo. Though if you set it too high, you may overshoot.
Generally, the ship will be most maneuverable when its downward speed is less than the maximum (typically 100 m/s unmodded), so increasing the braking phase is the usually the best option.

Note that the script uses the prog block that it is running on as its frame of reference. So in actuality, it is the prog block that is being aligned along the GPS coordinate.
Last edited by ZerothAngel; 19 Oct, 2016 @ 10:53pm