Space Engineers

Space Engineers

Not enough ratings
Grav Drive Space Efficient
   
Award
Favorite
Favorited
Unfavorite
Type: Blueprint
File Size
Posted
777.060 KB
24 Jun, 2016 @ 6:41pm
1 Change Note ( view )

Subscribe to download
Grav Drive Space Efficient

Description
Example ship using 3-Axis gravity drive script located
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=709442667

This is a more space efficient example of gravity generator placement.

Note that there is no "forward" to this ship. If flight seats are added in any orientation, manually run the programmable block with the argument of "Reset", then any flight seat can pilot the ship as one would expect.
7 Comments
FPC 1 Jul, 2016 @ 5:39pm 
That makes sense
BurninSun  [author] 1 Jul, 2016 @ 5:14pm 
The link posted below that added .CurrentThrust which would have completely simplified this code... only applies to the mod API - not the in game API. Was worth a look but that doesn't help me much here.

With the sphericals, I would assume just leave the sphericals on at full power all the time, then group mass blocks by direction and turn them on/off based on the direction needed. Shouldn't be too bad to make that work.
FPC 1 Jul, 2016 @ 10:22am 
Ahhh I understand!! Yea, I dont script so been working on finding something like this, to tie the spherical grav drive to WASD for combat maneuvers.

The other trick- making it work when more than one thruster is used at once. Should work equally easily w/ spherical I suppose.

So long as its built right no crazy calculations should be needed.
BurninSun  [author] 1 Jul, 2016 @ 10:18am 
Figures. Wait over a year for them to update the API before giving up and coding this anyhow, then they update the API 2 weeks later. Thanks for the heads up on that link, it'll simplify the code a lot. Strictly sticking to the setup you described, the code should be pretty simple especially now. Check each thruster and if it is on, activate the corresponding mass blocks. The complexity comes from arbitrarily placed blocks that may or may not result in a gravity vector matching the thrust vector and having to adjust which generators and blocks are enabled and at what strength. Doable, but tons of math.
FPC 30 Jun, 2016 @ 11:20pm 
Bummer! I cant code sadly. I was hoping it would work with spherical. Far less parts, 10x smaller and more efficient, and then they do triple duty - grav shield in all directions, can be used for forward or rear facing gravity weapons, and work for the 6D grav drive as well. I was thinking you just turn all the grav spheres on, and only worry about the mass blocks being named in groups based on their direction. I did 3x3x3x3; 9 to a side with grav gens in middle. So your script would just control when the mass blocks were on/off. BTW: Take a look at this; should be of great interest. https://github.com/KeenSoftwareHouse/SpaceEngineers/pull/497
BurninSun  [author] 30 Jun, 2016 @ 11:13pm 
It wasn't built with spherical generators in mind. That would require a lot more setup in detecting angles of every combination of generators and mass blocks and turning off specific mass blocks and/or generators to get the desired direction. With the math down, it wouldn't take much to group mass blocks by which axis they are useful to similar to how the generators are handled, then enable/disable each axes worth of mass blocks along with the gravity generators when it detects flight.
Basically, more math than what I want to deal with, but coding up the result would be easy enough.
FPC 29 Jun, 2016 @ 3:24pm 
Does this work with spherical? Spherical in the middle, mass blocks wrapped around them is most space efficient, and doubles as grav shield.