Space Engineers

Space Engineers

45 ratings
Gravity Flight System
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
21.268 KB
2 Oct, 2019 @ 11:55am
13 Sep, 2020 @ 5:23am
5 Change Notes ( view )

Subscribe to download
Gravity Flight System

Description
This script is in Beta, some features are lacking like compensation for off-center thruster and proper compensation for natural gravity fields.

**Update**
You can exclude gravity gens from being used by the script, by adding "gravex" to the generators custom data.
**\Update**

Script for easily building a 100% gravity driven space craft.

With this, you can quickly make, or retrofit, a craft to be flown solely using gravity generators and mass blocks, no gyros or thrusters required.

The benefit of this is that, a single massblock with a Grav gen will generate 1.5x the thrust of a small Ion thruster, 2 grav gens and a single mass block will generate the power of 3 thrusters and so on, all with extremely small power usage compared to conventional thrusters.

Keep in mind though, gravity generators does not work in 0.5G or stronger natural gravity and thus this script won't either.

A Demo craft using the system is available here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1878735651


Video showing usage:
https://www.youtube.com/watch?v=IF1UbncIwEo
80 Comments
OCD Insomniac 5 Apr, 2024 @ 5:58pm 
I added an event controller that switches the Artifical Mass and Gravity Gens off when Thrust% is <= 99 and this allows for use of Inertial Dampeners...but I have to have at least 6 thrusters to make use of it. I'd love to see a runable commands in the script that will enable/disable the dampeners..would be good for pwr efficiency and useful in other autopilot applications too.

Just finished a grav-drive build and I always use this script...but strangely, when I re-enable the dampeners, my ship turns around (torques) exactly 180 degrees...perfectly even. Weird but cool.

I've also noticed that the grav gens seem to cap at about 0.5G...not making full use of the available power. No idea if that is due to my build or if it's script related...I just noticed it. First time trying it on a build with a small grid grav gens mod.

I really hope you continue working on this script..I really do think it's the best I've found on the workshop. Thanks for this and I'll keep watch for updates!
Mata52 8 Jul, 2022 @ 5:06pm 
Then I am looking forward to any updates. Good luck and thank you for good content. :)
Tekk  [author] 8 Jul, 2022 @ 2:08pm 
First off: Thanks for the comment Mata52!
Secondly, from a recent project i did, I actually have some thoughts on fixing the offset forces, hovering in (moon) gravity and reducing the game workload, just need some free time to get into the project again (which i should have soon!)

If my ideas don't pan out, I will definitely look at what you mentioned, appreciate it :)
Mata52 8 Jul, 2022 @ 9:20am 
The script works flawlessly. The lack of the compensation feature is a drawback, though. I noticed that you said you might update the script, so maybe you will be interested in checking the "Jerry Rigged Torque Canceling Gravity Drive" that can be found on the workshop. The author retired but said that he would be happy if somebody continued his work and gave him credits for his contribution. He even claimed he would be glad to help with maths, if needed. In general, his script allows to completely nullify the unwanted torque generated by grav drives and allows to use that torque generation for turning your ship like with a gyroscope. The only problem is that his script for some reason impacts sim speed when used with very large ships, although I doubt its a matter of mass alone, after my multiple tests. Either way, you might want to give it a look. Maybe it could help you in figuring out the compensation mechanism, if you ever happen to want to improve this script.
Judge Kronos 17 Apr, 2022 @ 5:18pm 
This is my favorite Gravity script. I really like the PID that is at work ;)
Tekk  [author] 17 Apr, 2022 @ 3:44pm 
Cheers :)
Wouldn't say that I have gotten good, but i have gotten better and I am (slowly) updating my old scripts, so will get this fixed up eventually!
Judge Kronos 17 Apr, 2022 @ 3:15pm 
Thank you Tekk. If this was when you were worse looking forward to the one when you are good :p
Tekk  [author] 17 Apr, 2022 @ 1:54pm 
That's a warning, not an error; Unused variables don't really matter, apart from a warning message (and a couple of bytes of memory).

The script is super beta, and from when I was worse at C#, it grabs hold of the first IMyShipController it can find, so if you have multiple cockpit/seat/remote it may be selecting another. IIRC, Passenger Seats may also be picked up as IMyShipController.

A temp fix could be to replace:
GridTerminalSystem.GetBlocksOfType(cockpits);
on line 31
with:
cockpits.Add(GridTerminalSystem.GetBlockWithName("INSERT HELM NAME HERE") as IMyShipController;

That'll force it to use a specific controller.
Judge Kronos 17 Apr, 2022 @ 11:56am 
Your code has a compile error. It has 2 variables it does not use. so they need to be either deleted or commented out.

Vector3D LinVel, AngVel;

LinVel, AngVel are not used so you have to comment out as follows to use atm;

//Vector3D LinVel, AngVel;

Also I could not get the script to work with the Helm. Does the script search for Control blocks?
Tekk  [author] 7 Feb, 2022 @ 9:09am 
Ah yeah, totally forgot about adding that! IIRC, it is a bit janky, it gives a proportional response that will stop a vessel, but it will drift inside a planet/moon gravity. Building up the will (and look for the time) to go over my scripts and iron out the kinks haha