Space Engineers

Space Engineers

129 ratings
Landing Gear Balancer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
18.164 KB
21 Dec, 2024 @ 7:51am
6 Jul @ 4:24am
3 Change Notes ( view )

Subscribe to download
Landing Gear Balancer

Description
Adjustable landing gear pistons to compensate for uneven terrain and land with your ship horizontal.

Version 1.0 - 2024-12-21 - First public release
Version 1.1 - 2025-01-03 - Added a timer before turning off, for commands "retract" and "extend"
Version 1.2 - 2025-07-06 - Supports up to 100 landing gear kits !
Detects and warns about obstructed cameras
Shows on screen if in long legs or short legs mode

Designed for use with:
- Up to 100 landing gear kits (1 kit = piston+landingpad+camera)

Functions
- use one downward-facing camera on each landing kit to measure distance from ground
- adjust the lenght of all landing gear pistons to compensate
- provide warning if the terrain is too uneven
- in long legs mode, all pistons are extended by default, and they retract if needed due to uneven terrain
- in short legs mode, all pistons are retracted by default, and they extend if needed due to uneven terrain
- the script activates autolock on each leg, and turns itself off when one has locked

Installation
- Set up to 100 landing kits, with a magnetic plate on a piston, and a downward facing camera as close as possible (but with a direct, unobstructed view of the ground)
- Create groups for each landing kit, named LGB_kit1, LGB_kit2 etc. with the 3 items in each
- The names must be continuous, starting at 1 and going up to 100 (LGB_kit1, LGB_kit2, ..., LGB_kit100).
If there is one missing (ex: LGB_kit1, LGB_kit2, LGB_kit4), the script will stop at LGB_kit2
- (optional) Install an LCD screen with the proper name (see below) to see what the script does
- install the script in a programmable block
- recompile the script if needed to let it autoconfigure itself

Usage
- When close the the ground, activate the script in long legs or short legs mode
- Keep the ship horizontal yourself, or use another script (ex: Flight Assist) to do it
- The script start to check the ground below an altitude of 100m (configurable)
- If the ground is too uneven, thescript does it best and the LCD turns red.

Command line arguments
- off: turns the script off (ex : when already landed, etc.) without moving the pistons
- on: activate the leg balancer, preferring long legs
- on_longlegs: activate the leg balancer, preferring long legs
- on_shortlegs: activate the leg balancer, short long legs
- retract: retract all legs, and turn the script off
- extend: extend all legs, and turn the script off

More info
On Github : https://github.com/silverbluemx/SE_LandingGearBalancer

FAQ/Issues
A few troubleshooting suggestions :
- Look at what the programming block says when you compile the script. It should say "Group +name+ found !" and "Group +name+ has the correct setup (1 camera, 1 piston, 1 gear)" for each of the landing kits
- Look at what the display screen say ? If "ground uneveness" is always 0 when above rugged terrain, it's the sign that the cameras can't measure distance properly.
- Switch between on_longlegs and on_shortlegs. Do the pistons move ?
- If the displays says "Obstructed camera on kit#" it means the camera points at the ship instead of the ground. Activate the view from the camera to see what blocks are blocking the view (only the exact center of the view needs to be clear)
21 Comments
silverbluemx  [author] 6 Jul @ 4:33am 
New update today !
-Supports up to 100 landing gear kits
-Detects and warns about obstructed cameras (the screen says "Obstructed camera on kit#" when this happens)
-Shows on screen if in long legs or short legs mode
silverbluemx  [author] 15 Apr @ 9:57am 
@Vaygrim : strange.
Can you share pictures of how your ship is built, or share it on the workshop ?
A few troubleshooting suggestions :
- Is it large grid or small grid ? It should work for both but I did more testing with small grids
- What does the programming block says when you compile the script ? It should say "Group +name+ found !" and "Group +name+ has the correct setup (1 camera, 1 piston, 1 gear)" for each of your landing kits
- What does the display screen say ? Is "ground uneveness" always 0 or something else ?
- Does each landing kit have a dedicated camera ?
- Does each camera have a direct line of sight to the ground ? (if you display the view from each of them, do you see the ground right in the middle of the screen, and not a part of the ship ?) For example, with the ship in the pictures, if I use a Large Magnetic Plate (round one from Heavy Industry DLC) on the legs then it would block the view, and I'd need to offset the camera more.
Vaygrim 11 Apr @ 8:13am 
Setup and implemented script as instructed above, end result was all four piston 'legs' always extending to the exact same length collectively. No real 'balancing' for uneven terrain to speak of.

Would love to get this working, please advise.
XzOmBieKiLla6X 20 Mar @ 12:35pm 
Absolutely love this! Thank you!
Space_Captainface 16 Mar @ 8:38pm 
@RYGUY27 Under Installation >> "- install the script in a programmable block"
RYGUY27 15 Mar @ 8:51pm 
does it need a pb? id doesn't say in the description
silverbluemx  [author] 21 Feb @ 11:23pm 
@GoldMiner177.
Probably yes although leveling would be more approximate (cameras may end up further away from the landing gear/magplate). There's also more variety in the hinges arrangements. Do you have a specific setup in mind ?
GoldMiner177 16 Feb @ 10:29am 
@silverbluemx
have a question, could this be updated for hinges too? if you're up to the challenge that is
TheKeixs 17 Jan @ 8:03pm 
el diavlo que genialida
Invention64 7 Jan @ 6:15am 
@silverbluemx technically you could use a PID to achieve this, as it doesn't need to know which direction a control will move it, just that there is controls and a measurable goal.

But like you said definitely overcomplicated for a script like this.