Space Engineers

Space Engineers

(Obsolete) Reactors Balancer
30 Comments
Leon 16 Jul, 2020 @ 11:39am 
:steamfacepalm: Okay Thx
Sinus32  [author] 16 Jul, 2020 @ 9:21am 
@Leon: Resource Exchanger 2 has all features of this script and a few more. If you don't want additional functionality you can still use Resource Exchanger 2 and disable unwanted features in PB's custom data (after loading the script).
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/546221822
Leon 14 Jul, 2020 @ 8:24pm 
updat plz
Charles 4 Jun, 2015 @ 3:26pm 
OMG You are awesome. Thank you!
Sinus32  [author] 4 Jun, 2015 @ 2:17pm 
Fixed. Works again.
Sinus32  [author] 4 Jun, 2015 @ 1:05pm 
Unfortunately, but yes, today's update has broken this script and also my other scripts. I need some time to fix it.
Charles 4 Jun, 2015 @ 12:46pm 
First let me say it could very well be something I did wrong. It was working beautifully before I went to lunch. When I got back I had gotten the update. On the program block it said: Assembly not found. Please compile script.
When I try I get a long list of errors.
The first is: Line 269 The type or namespace 'MyObjectBuilderType' does not exist in the namespace 'Sandbox.Common..ObjectBuilders', are you missing an assembly reference
It goes on to list other line numbers with the same error.

If it's working for you after the update then it's obviouly something I did wrong
Sinus32  [author] 4 Jun, 2015 @ 12:27pm 
Why do you think that today's update broke it? Is there something wrong? And it's true that I'm working only on Resource Exchanger now, but if there is a critical error I'll fix it.
Charles 4 Jun, 2015 @ 12:20pm 
I loved this script but, I guess today's update broke it. Are you updating this one or just working on the newer script (Resource Exchanger)?
snellejelle99 28 Apr, 2015 @ 1:26pm 
thank you
Sinus32  [author] 27 Apr, 2015 @ 12:28pm 
My new script Resource Exchanger works with turrets and launchers (and also with refineries, reactors, drills and oxygen generators).
Check it.
Sinus32  [author] 9 Apr, 2015 @ 1:40pm 
Yes, I can ;)
Give me some time.
snellejelle99 9 Apr, 2015 @ 5:43am 
can you make one for guns?
Exelsiar 23 Mar, 2015 @ 9:54am 
Ooo excellent, It'll be interesting to see how it affects my game, thanks sir :D
Sinus32  [author] 22 Mar, 2015 @ 2:03pm 
I've released a new version of Reactors Balancer.

Changes:
- The script works in creative mode now. The bug that Exelsiar reported is fixed.
- Support for arc reactors and arc fuel from Arc Reactor Pack was added as Vell requested.
- Filters are taken into account and they act as networks borders.
- Added the ability to support reactors from other mods. (The reactors are not supported yet, but they can be if you request for that)
Exelsiar 20 Mar, 2015 @ 7:47am 
28 station large reactors, 4 large ship small reactors, 8 small ship large reactors, and 12 or 16 small ship small reactors. 100k uranium spread between them, and creative mode.
Sinus32  [author] 19 Mar, 2015 @ 3:30pm 
That's strange. How many reactors do you have, how much uranium is in them and how big is your inventory size multiplier?
Exelsiar 19 Mar, 2015 @ 3:04pm 
ahh fairynough, no big issue as it started working after a couple of restarts :3
Sinus32  [author] 19 Mar, 2015 @ 1:43pm 
The "Something went wrong" exception is a kind of my "safety valve". I'm throwing it when something goes wrong.
In this case an integer overflow happend. Not a big deal, but I have to fix this.

BTW: I'm still alive and I'm reading comments. Currently I'm working on support for arc reactors and anything else that's implements an IMyReactor interface but doesn't consume uranium.
Exelsiar 18 Mar, 2015 @ 5:12pm 
Hi, I just noticed my programmable block is saying:

"Caught exception during execution of script: Something went wrong with calculations: volumeDiff is -1193439777964750006124457"

No idea why, I've not modified it at all from the steam version, and its running every 10 seconds.
Vellai 18 Mar, 2015 @ 5:50am 
great ingame script! would it be possible to modify for the arc reactors and arc fuel? just change the tags right?
Sinus32  [author] 15 Mar, 2015 @ 12:04pm 
A new version is out.
A message "Cannot balance reactors" was changed to "Cannot balance reactors in conveyor network <n> because there is only one reactor." and "Cannot balance reactors in conveyor network <n> because of lack of uranium in it." depending on situation.
Also now the script can continue processing other networks if this message was shown.
Sinus32  [author] 15 Mar, 2015 @ 10:10am 
If REACTORS_GROUP is null the script tries to balance all reactors regardless of any groups.

I've just looked at code again and now I know what's happend. The one reactor that is not connected is creating a separated conveyor network with itself only. The script tries to balance that network and it cannot, so it writes this message.

BTW: Now i think the message should be "Cannot optimize reactors in conveyor network 2".

Thanks for help :)
I've also found a bug because of this case, so an update will be soon.
SmithTS 15 Mar, 2015 @ 7:52am 
I left the REACTORS_GROUP variable as "null" to manage all connected reactors. I created a group instead, and the screen showed a few movements, but still shows "cannot balance reactors" at the end.

1. I have 39 reactors connected, which is the number displayed on the LCD.
2. Playing survival mode.
3. All but one reactor has uranium. This reactor is not connected, and is excluded from the reactor group.
4. All but one reactor is connected, and it is not in the group to be managed.
5. The name is correct.

The program is balancing the reactors, it just shows the message at the end. Not a complaint, really, just trying to help with debugging.
Sinus32  [author] 14 Mar, 2015 @ 5:27am 
Possible, most common reasons:
1. Less than 2 connected reactors were found
2. Cannot determine maximum capacity of reactors (this may happen if you are playing in creative mode, the script is designed for use in survival mode)
3. Your reactors are empty
4. Your reactors are not connected by conveyor network
5. You have grouped your reactors, but mistakenly entered the name of the group to the script.

Please, tell if none of these causes applies to your case.
SmithTS 14 Mar, 2015 @ 5:04am 
I'm getting a "cannot balance reactors" message. What does this mean?
Sinus32  [author] 13 Mar, 2015 @ 2:58pm 
Good idea DarkUncle.

I'll try to make this script.
><> DarkUncle 13 Mar, 2015 @ 2:50pm 
Great script, thanks for making it!

I was wondering if you might be interested in making something similar, to balance ore amoung drills on a drill ship? (So that when your cargo containers are full and you're just topping off your drill capacity, it gets "evened out" rather than having some drills full and not taking on any more, while others have plenty of capacity left)

I'd imagine it would be more complex since we're not talking only a single type of item involved, but maybe something you'd be interested in taking a crack at?
Sinus32  [author] 13 Mar, 2015 @ 12:41pm 
By default the script balance all reactors on the grid. You can limit it in this way:

You have to create a group of reactors that you want to balance and change the script at line 9:
from
public string REACTORS_GROUP = null;
to
public string REACTORS_GROUP = "the name of your group of reactors here";
Assuming that your group will be named "MyReactors" the whole line should be:
public string REACTORS_GROUP = "MyReactors";
The script and group name are case sensitive, so make sure you typed it well. Also make sure there is a semicolon at the end of the line.
From now the script will take into account only the reactors belonging to this group.

BTW: Current restrictions and limitations imposed on scripts prevents me from checking whether the balanced reactors are located on the same ship.
Geneticus 13 Mar, 2015 @ 11:34am 
"the script can exchange uranium between your station and your ship (if you allow for it)"
So, what is the toggle to disallow/allow it?