Space Engineers

Space Engineers

88 ratings
Resource Exchanger 2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
370.266 KB
1 Nov, 2015 @ 10:01am
5 Oct, 2023 @ 1:52pm
27 Change Notes ( view )

Subscribe to download
Resource Exchanger 2

Description
Resource Exchanger exchanges available ores, uranium, ice and ammunition between inventories of reactors, refineries and other blocks to keep all of your production blocks running.

Features:
1. Exchanges uranium between reactors.
2. Exchanges ores between refineries and arc furnaces.
3. Exchanges ice between oxygen generators.
4. Exchanges ammunition between turrets and launchers.
5. Exchanges anything between containers in custom groups.
6. Indicates how much free space left in your mining ship.
7. Exchanges ores in drills when all cargo containers of mining ship are full (read more below).
8. Allows to set top and lowest priority for refineries.
9. Plug & Play, but allows for customization.

This script also supports all reactors, refineries, oxygen generators, turrets and drills from other mods.

Installation guide

1. Basic setup for stations:
1. Place a Programmable Block.
2. Load Resource Exchanger 2 into the Programmable Block.
3. Done.
The script runs automatically, timer blocks are not required. If you want to stop it just turn PB off.

2. Setup for mining ships:
1. Place a Programmable Block.
2. Load Resource Exchanger 2 into the Programmable Block.
3. Place some interior lights and/or spotlight.
4. Add the lights into group called "Payload indicators" (the name is case-sensitive).
5. Done.
The lights from the group will change color when drills become full of ores and there will be no more space left in containers.

3. Setting up custom groups:
1. Add a group tag to selected blocks.
2. Done.
- You can create custom groups of blocks to balance. The only thing you have to do is to put a group tag in the name of blocks.
- Cargo containers are also supported.
- Group tag consists of letters "GR" followed by one up to three digits. For eg. GR1, GR123, GR005. Group tag have to be separated from other words, so for eg. a name "CargoGR1" will not work, but "Cargo GR1" and "Cargo [GR1]" will do.
- One block can belong to more than one group, and blocks in a group don't have to be of the same type.
- A block that belong to at least one group is excluded from normal resource balancing, and balances it's resource only within the group or groups.

4. Optional setup of debugger screens:
0. You do not need to set up this. It's only for debugging purposes.
1. Place some wide LCD Panels
2. Add the panels into a group called "Resource exchanger output"
3. Name the panels as you wish.
- Each panel will show exactly 17 lines of text, the first will show first 17 lines, second will show next 17 lines and so on.
- Panels are used in alphabetical order according to their names.
- Displayed text contains mainly debugging information about actions taken by the script.

Details:

The script prevents reactors, refineries, arc furnaces and oxygen generators from becoming idle.
It will distribute available resources across blocks evenly, relative to capacity of their inventories.

The script is able to fully recognize and distinguish different kinds of reactors, refineries, arc furnaces and other blocks, even blocks from mods. So it will not move items to inventories that cannot hold that items.
For example:
- The script will move uranium between small and large reactors because it know that they both can accept uranium.
- The script will move ore between refineries and refineries from mods if it know that they can process the same ores.
- The script will not move ore from refineries into basic refineries, or in the opposite direction, because basic refineries cannot process all ores that refineries can.
- The script will not move stone between refineries and stone crushers (from mods) because stone crushers cannot process all ores that refineries can.

Resource Exchanger will also move ice between oxygen generators, but will not move bottles. Only ice is balanced.

The script also avoids turrets from running out of ammunition, as long as the last bullet has not been fired. It will distribute ammunition across turrets evenly, relative to capacity of their internal inventories. Of course this will happen only if these turrets/launchers can use the same type of ammunition.

Resource Exchanger has two features especially designed for mining ships:
1. Exchanging ores in drills when all cargo containers are full, so you can use whole space in drills inventories.
2. Built-in system that will tell you how much free space remains in the drills by changing color of certain interior lights or spotlights. In order to use it just build some interior lights or spotlight on your ship and add them to a new group called "Payload indicators".
The lights you've set up will change color into one of the following:
White - All drills are connected to each other and they are empty.
Yellow - Drills are full in a half.
Red - Drills are almost (95%) full.
Purple - Less than 5,000 l. of free space left (you can change that amount also in the script's configuration section).
Cyan - Some drills are not connected to each other (this is an error state).

One more thing: Resource Exchanger will move iron to the first slot and stone to the last slot in refineries.
You can change priorities or disable this feature in configuration.

Configuration:

The script's configuration is stored in custom data of the Programmable Block.
You can use it to enable or disable some functionalities of the script.
Just check the PB's custom data after running the script.

Other notes:

Resource Exchanger automatically skips all blocks which are not functional (are incomplete or critical damaged) or have option "Use conveyor system" set to "No", so if you want to remove a block, switch it off first and set option "Use conveyor system" to "No". Then you can successfully remove items from it.
Popular Discussions View All (3)
54
15 Jan, 2021 @ 8:48am
PINNED: Bugs and suggestions
Sinus32
48
6 Oct, 2023 @ 2:22pm
PINNED: Modded blocks compatibility requests
Sinus32
0
1 Nov, 2015 @ 10:47am
PINNED: Balancing algorithm's details
Sinus32
109 Comments
Sinus32  [author] 5 Oct, 2023 @ 2:13pm 
Version 2.6.0 for SE 1.203 is up.
Korny 10 Feb, 2021 @ 6:08pm 
great thanks
Sinus32  [author] 9 Feb, 2021 @ 1:51pm 
@Korny: By default the script affects only blocks directly connected to the grid that have PB attached. In PB's custom data you can set AnyConstruct=true and then any accesible blocks will be affected, but still everything that the script can do is limited by permissions and ownership of the blocks. You can see how many blocks the script "see" in PB's configuration panel.
Korny 8 Feb, 2021 @ 3:37pm 
Um, I have 24 heavy reactors on my ship but the utility only sees 4 of them. The 4 are the ones connected to the conveyor system, the rest are connected to each other., Did you consider the reactors might mostly be connected to each other and not just to the conveyor system?
Sinus32  [author] 3 Jan, 2021 @ 11:23am 
Version 2.5.4 for SE 1.197 is out. Contains only compatibility updates for several mods.
Glytchii 16 Dec, 2020 @ 6:32pm 
This is a beautiful program! I went through ~10 pages of "refinery" searched in-game scripts just to find this one which was exactly what I was looking for! THANK YOU!!!! Works flawlessly!
Sinus32  [author] 26 Aug, 2019 @ 2:11am 
Fixed
Sinus32  [author] 26 Aug, 2019 @ 12:56am 
I'm going to fix them asap.
lonsvghrt 25 Aug, 2019 @ 8:20pm 
Lots of errors when I check code
Screaming Alpha 21 Jun, 2019 @ 1:40pm 
i wouldnt expect you to lol thank you for the quick reply, I have automated inventory sorting and i think this mod was just putting anything into the containers while i had them set up for that mod but I really really like this mod