Space Engineers

Space Engineers

81 ratings
Space Anchor
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Block
File Size
Posted
Updated
808.516 KB
25 Dec, 2016 @ 5:59pm
30 Dec, 2016 @ 11:43am
4 Change Notes ( view )

Subscribe to download
Space Anchor

Description
[BETA] Have you ever wanted to create a static station which uses power to stay static rather than use the game's built in static grids? Me neither! I'll explain the block first then my reasoning behind making it.

This blocks essentially anchors the grid in space, completely negating linear and angular movement, replicating a static grid almost entirely. In order to do this, it consumes power. The way it consumes power is a little strange, so I'll explain it and why. It first needs to charge up using a higher input rate to a total amount of power, and once it gets there it will reduce the power input and stay like that permanently. If the device is turned off or the power is not completely supplied, then it will lose all charge and will need to start again.

The 'real-world' theory (Torkkar helped with this):
It generates large and very powerful gravitational fields in order to bend spacetime enough to lock itself to the body of mass that it is closest to, and once it has successfully created a field strong enough to lock the grid to the body, it needs much less power to keep the field up. If the power cuts out at all, the field is lost and spacetime quickly returns back to how it should be.

The default values are:
Large grid:
  • Charging input: 300MW
  • Total charge: 25MWh
  • Running input: 50MW

Small grid:
  • Charging input: 100MW
  • Total charge: 16MWh
  • Running input: 20MW

(due to this mod still kind of being in beta, both the building costs and values are subject to change as I find the right balance.)

This equates to a large reactor (large grid) fully charging the large grid version in about 5 minutes. My recommendation would be that any stations used this block to stay static have a large backup of batteries in order to make sure that it A. stay running and B. is able to charge back up if it cuts out. You can also change the power input while charging to accommodate different levels of power production, however if you decide to set this then take note that it will disable thruster controls along that axis of movement. Due to this, I have made both normal blocks only placeable on the bottom, as this stops the up/down axis from being taken over (meaning you shouldn't be able to screw up a station that uses this).

The original block (the 1x1x1 large grid version) is an 'admin' block. It can be placed by anyone in creative, however it cannot be used in survival since it uses a component that doesn't exist. The power consumption maximum on this block is drastically higher than even the large grid normal block, allowing a little bit more freedom. Also, if you set the custom data to 'charge_now' (without quotes and anything else in it), it will immediately charge to full and start working. I will create a proper command line at some point, to allow creative fine-tuning of the block for admins, however I just wanted to get the other blocks out first.

Technical & side notes

This mod is based on a thruster to enable power consumption changing. However, because thrusters only update the detailed info output when you click on the block in the terminal, which I have used to display the current state and charge level, I have made it also dump all of this data into the CustomData field of the block. This data is updated every update, meaning that a programmable block can pull the data from this and display it onto an LCD for constant updates. To makes this easier, it outputs 4 lines of data. The first is the actual text I display in the detailed info output. The second line is the current charge (when disabled outputs 0, when running outputs the maximum charge level), the third line outputs the maximum charge level, and the fourth line just outputs 'MWh' to enable localisation in the future. To split this, just do

<block>.Split('\n')

as I only use the character '\n' (newline) to split the items onto newlines. To only get the string I use in the detailed info, just use:

string info = <block>.Split('\n')[0]

To better show this, I have written a small sample script that displays the charge on some LCD's, yuo can find it over here if you want. You should be able to use in conjunction with Automatic LCD's 2 using the TextLCD command.

(This section doesn't apply to the mod itself, it's just a side note on why I made it)
Now, as to why this isn't actually the mod I wanted to make. My original plan was for a block that completely removes natural gravity in a radius around it, including players and others ships. I actually basically made it, the code to stop the anchored ship from moving, even after setting the linear velocity, in natural gravity is paritially derived from this code (it essentially just applied the same force as gravity is but in the opposite direction). The problem was that the dampeners still think that the ship is under normal gravity, and so continue to push it up (as far as I can tell, it stops pushing until the speed is half of the gravitational acceleration, but I did minimal testing on it and I don't know why this is the value it settles on). My end goal was to make it so that the ship didn't experience the gravity in the first place, but as far as I can tell, the mod API doesn't expose enough to actually enable this.

Lastly, there is a discussion that goes over how the config works. Also, if someone wishes to help with with balancing/model creation, I would be more than happy since I'm not good at either.
Popular Discussions View All (1)
4
31 Dec, 2016 @ 7:31pm
Config Details
moon fangirl
104 Comments
Storm 26 Jun, 2021 @ 3:04am 
Of course a ship need an anchor! Excellent. Another system to add, another button to theoretically push, if I ever stop designing and actually play
Hanadon 14 Feb, 2021 @ 2:02pm 
Yay!:steamthumbsup:
Airomis 12 Feb, 2021 @ 1:26pm 
bunbot could you put up a code so someone can update it if your still off the game?
Weed Dragon 27 Mar, 2020 @ 12:21pm 
which is sad because i really love this concept in the game for energy saving
Weed Dragon 27 Mar, 2020 @ 12:20pm 
yeah its broken
1antonioorlo1 27 Mar, 2020 @ 4:19am 
Mmm, i think it's broken for me
Airomis 5 Jan, 2020 @ 11:24am 
Is there anything like this out there that is working? I would love to use this again
Airomis 25 Aug, 2019 @ 8:54am 
Will this allow for the new safe zone block to work?
M-98 black widow 22 Aug, 2019 @ 2:22am 
heres a crash log for you https://paste.ubuntu.com/p/crfCcdgVKn/ not sure what broke
Weed Dragon 18 Jun, 2019 @ 2:16pm 
I just used it a couple weeks ago. Was there a new update?