Space Engineers

Space Engineers

45 ratings
Themis Stability Script (no longer supported)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
8.677 KB
3 Dec, 2015 @ 10:32am
12 Oct, 2016 @ 7:46pm
4 Change Notes ( view )

Subscribe to download
Themis Stability Script (no longer supported)

Description
== Themis Stability Control Program v1.15 ==
---------------------------------------------------------------

So, planets have finally arrived, and you’re just dying to try out that shiny new hovercraft with the outrigger engines. You climb into your awesome vehicle, fire up the outriggers -and suddenly do an epic backflip into the hillside.

Crap! Unlike normal thrusters which are mounted directly to the grid, outrigger engines (thrusters attached via piston or rotor) apply torque to your ship. If the ship isn’t precisely balanced, at best it will be hard to fly, and at worst, you’ll spiral to your death. And if one of your outriggers gets blasted away, guess what? Spiral of death. Unbalanced cargo? Spiral of death. Yikes!

Wouldn’t it be great if your beautiful craft would take care of this balancing stuff by itself? With a little help from Themis, now it can.

In Greek mythology, Themis was the Goddess of Balance and Justice. In Space Engineers, she’s an active stability control program for hovercraft, lifter/lander vehicles, and anything else that uses outrigger engines for flight in a gravity field.

Themis varies the thrust provided by outrigger engines (sometimes called VTOL engines) in real-time to keep the ship level with respect to local gravity, regardless of any imbalance in the ship's mass or cargo. She can even compensate for engine failures; if you have a standard four-poster design and your ship is naturally well balanced, Themis may be able to maintain stability even if one of your outriggers is completely blown off! Now that’s a true Goddess of Balance!

Themis also allows you to adjust the collective throttle of all your outrigger engines with the press of a button, so you aren’t limited to just On and Off. And newly added in v1.0, now you can control the rotation of your rotor-mounted engines with the press of a button too! Future updates will add advanced autopilot features and safety systems.

So stop backflipping into the dirt. All you need is a programmable block, timer block, remote control, and some outrigger thrusters. No mods required.

Gain the blessing of Themis, and fly hassle-free!


============= Installation Instructions =============
This is a complex program with lots of features, so I strongly recommend you check out the tutorial video above. If you don’t feel like sitting through 50 minutes of me blabbing (and I don’t blame you for that!), the first 20 minutes or so covers all of the basics that you need to get flying. The rest of the video just covers advanced features and limitations, so you only need watch that if you‘re interested. There's also a link below to a demo world that shows off how all of this works.

A quick summary of the major things you need is below.

For basic setup, you will need:
A Programmable Block with Themis loaded;
A Timer Block set to Run Themis (no arguments) and Trigger Now on itself
A Remote Control Block mounted anywhere on the main ship grid and facing forward
At least one matched pair (Forward & Aft / Left & Right, or both) of outrigger thrusters (more on this below)
Optionally: A screen named "Status" for outputting system information

++++ Thruster Control ++++
Themis can control pitch and roll independently, so you don’t need to have thrusters for both. However, Themis does require at least one matched pair of thrusters for a particular axis of rotation. Each thruster needs to belong to a group with the proper tag in its name, or have the tag directly in its Custom Name: [F] for Forward, [A] for Aft, [L] for Left, and [R] for Right.

++++ Rotor Control ++++
Themis also allows you to control the collective angle of your rotor-mounted engines. To do this, you need to properly orient the rotors you want Themis to control and name them.
When you place your rotors, make sure the zero mark points downward. Then, those rotors where the +90 degree mark points toward the rear of your ship should have a “[N]” tag in their Custom Name. Those rotors where the +270 mark points toward the rear should have a “[]” tag in their Custom Name. Usually, [N] rotors will sit on the right of the ship, with [] rotors on the left. It’s very important to get this right, or you’ll get some weird results!

Themis moves all engine rotors in unison, so for now they all have to have the same range-of-motion limits. You can set the limits of your rotors in one of three ways:
+) You can manually set limits for each rotor in the Control Panel, and Themis will read them automatically.
+) You can set global limits inside the script, and Themis will set all rotors to those limits automatically.
+) You can set nothing at all, and Themis will use default values for the limits. Can’t get any easier than that!


If you want to see some examples, check out the demo world here:
http://steamproxy.net/sharedfiles/filedetails/?id=626738985

============= Operator Manual =============

No scripting experience? No problem! Themis will begin controlling your ship’s outrigger engines automatically. If you’d like finer control, some variables can be adjusted to tune Themis to your specific needs. Themis will also accept the following arguments (without the “” quotation marks):

1) “throttle +” -- Increases the collective throttle setting
2) “throttle -” -- Decreases the collective throttle setting
3) “sweep aft” -- Sweeps your outrigger engines toward the rear of your ship
4) “sweep fwd” -- Sweeps your outrigger engines toward the front of your ship
5) “initialize” -- Causes Themis to reload all her control groups; a quick alternative to recompiling

============= Current Features =============
+) Hands-free stability control in any planetary gravity field
+) Collective outrigger throttle control
+) Collective nacelle angle control
+) System status reported to screen (optional)
+) Gradual blending of control laws as gravity gets stronger
+) Balance control override (gives the pilot additional thrust at the expense of balance)
+) Automatically transitions from planet flight to spaceflight when gravity is < 0.08g, and vice-versa
+) Automatically transitions from planet flight to spaceflight when nacelle sweep is greater than +/- 20 degrees, and vice-versa
(Themis will not perform balancing in spaceflight mode, but will still provide throttle and sweep control)

============= Planned Features =============
+) Control power deficit warning (alert the pilot if Themis doesn’t have enough thrust to stabilize the ship)
+) Altitude Hold (maintain specific altitude above a planet’s surface)
+) Thrust split indicators??
+) Combine Nacelle Sweep with pitch control target to let pilot adjust what is “level” WRT gravity


================= Known Issues/Bugs =================
-) Indicated Rotation and Pitch angles are not correct for angles > 50 degrees
-) Group Name verification not currently performed *Partially fixed in v1.1.…
-) The Rate Limiter sometimes chokes the engines too hard


If there is a feature you’d like to see that isn’t on the Features List, let me know in the comments and I’ll see if it’s something I can do. If you find a bug that isn‘t on the Bug List, report it, with as much detail as possible.

And lastly, if you like this script, please remember to rate it! It really helps me reach a broader audience!
Popular Discussions View All (1)
0
7 Oct, 2017 @ 12:04am
Help
MzEvilCanadian
65 Comments
DaMightyMage  [author] 16 Apr, 2018 @ 6:37pm 
That'd be because Space Engineers development has been going downhill for a few years now, and because Keen gave me a giant F*%& You when I complained about the removal of the GetFreeDestination function. Just tired of having to abandon projects and fix bugs every update.
Tactical Femboy 14 Apr, 2018 @ 1:08pm 
Whyyyy
DaMightyMage  [author] 26 Nov, 2017 @ 2:38pm 
I'm no longer supporting my Space Engineers scripts. Anyone who wishes to keep them going is welcome to use/modify the source code.
HighScorz 24 Nov, 2017 @ 3:32pm 
does this script still work? im getting compilation errors and it doesnt seem to recognise the remote control block
DaMightyMage  [author] 1 Jan, 2017 @ 3:37pm 
The script is in working order last time I checked, Saki. I don't plan to make any updates to it for a while, though.
Saki 22 Dec, 2016 @ 9:30pm 
any word on this awsome script
Shameless Gamer 17 Oct, 2016 @ 3:47pm 
THANK YOU FOR FIXING THIS MANY OF MY FAVORITE CRAFTS USE THIS.
DaMightyMage  [author] 12 Oct, 2016 @ 8:05pm 
I've also updated the Demo World, so all of the example ships on there should work once more. The new version of Themis also (hopefully) removes the need to manually set status logging to True or False. Themis will now search for an appropriately named textpanel and, if one is available, she'll log her status information to it automatically. Enjoy!
DaMightyMage  [author] 12 Oct, 2016 @ 7:51pm 
Sorry for the wait, everyone! I had hoped to incorporate the scripting API fix and some new features at the same time, but the API change proved to be a bit more complicated than I thought, and I've been really strapped for time. So until I get a handle on this, I've uploaded a temporary patch which makes Themis work again. See the changelog for more details. Stay tuned for a proper update... sometime in the next couple months. =P
DeathsEye 7 Oct, 2016 @ 12:59pm 
any news on this script working again? :) this was and still is one of my favorite scripts!~