Space Engineers

Space Engineers

Not enough ratings
(Obsolete) Resource Exchanger
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
11.325 KB
26 Apr, 2015 @ 5:32am
1 Nov, 2015 @ 11:27am
10 Change Notes ( view )

Subscribe to download
(Obsolete) Resource Exchanger

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



Outdated since 11/01/2015
Please, use
Resource Exchanger 2
instead




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 ores in drills when all cargo containers are full (read more below).
6. Indicates how much free space left in a mining ship.
7. Allows to set top and lowest priority for refineries and arc furnaces.
8. Customizable, but doesn't require configuration.

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 arc furnaces because arc furnaces cannot process all ores that refineries can
- the script will not move ore from arc furnaces into refineries because arc furnaces process ores more efficiently than refineries
- 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 oxygen bottles. It's ok to keep oxygen bottles in oxygen generators - the script will be aware of that and will adjust calculations to handle this situation properly.

The script also avoids turrets and launchers from running out of ammunition, as long as the last bullet has not been fired. It will distribute ammunition across turrets/launchers 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".
(you can change the group name in the script's configuration section)
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).
(you can also change colors in configuration section)

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 section.

Note about my older scripts:

This script contains full functionality of my older scripts: Reactors Balancer and Drills Balancer, so if you are using them you don't have to any more. Resource Exchanger is better.

Configuration:

1. Limiting blocks that are processed:
By default the script processes all blocks connected to grid. If you want to limit it only to certain blocks you have to create a group, name it as you wish and add all blocks you want process to it. Then you have to tell the script how your group is called by changing variable:
public const string MANAGED_BLOCKS_GROUP = null;
into
public const string MANAGED_BLOCKS_GROUP = "The group";
You would use this to prevent balancing uranium between station and ships connected by connectors blocks.

2. Disabling some functionality:
If you want to disable some features change any variables of ENABLE_<STH> into false depending of which feature you want to disable.

3. Setting up top and lowest priority for refineries and arc furnaces:
The script moves the top priority item to first, and lowest priority item to last slot of refinery or arc furnace.
By default iron has top priority and stone has lowest priority.
You can change that by changing variables TopRefineryPriority and LowestRefineryPriority for example into LowestRefineryPriority = new ItemType(OreType, SCRAP);
supported names are: ARC_FUEL, COBALT, DENSE_STEEL_PLATE, GOLD, ICE, IRON, MAGNESIUM, NICKEL, PLATINUM, SCRAP, SILICON, SILVER, STONE and URANIUM.
If you want to disable this feature set one or both variables to null.

4. Changing name of debuggers screens LCDs
To change a name of group of LCDs that shows debugger information you have to change variable called DISPLAY_LCD_GROUP (read more below about setting up debugger screens)

Setup:

1. Setup for stations and ships except mining ships:
1. Place a Programmable Block
2. Load Resource Exchanger into the Programmable Block
3. Place a Timer Block and setup two actions:
- Programming Block - Run
- Timer Block - Start
4. Set the delay of the Timer Block to 10 seconds
5. Run the Timer Block

2. Setup for mining ships:
1. Place a Programmable Block
2. Load Resource Exchanger into the Programmable Block
3. Place a Timer Block and setup two actions:
- Programming Block - Run
- Timer Block - Start
4. Set the delay of the Timer Block to one seconds (not ten)
5. Place some interior lights and/or spotlight
6. Add the interior lights and/or spotlight into group called like value of DRILLS_PAYLOAD_LIGHTS_GROUP variable (by default "Payload indicators") (the name is case-sensitive)
7. Run the Timer Block

3. (Optional) Setup of debugger screens:
- Applies to both stations and ships
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 (by default) exactly 17 lines of text.
- First panel 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 tells what the script does at the moment.

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)
28
27 Sep, 2015 @ 8:39am
PINNED: Modded blocks compatibility requests
Sinus32
23
1 Nov, 2015 @ 11:43am
PINNED: Bugs and suggestions
Sinus32
0
10 May, 2015 @ 4:14am
PINNED: Balancing algorithm's details
Sinus32
54 Comments
Sinus32  [author] 1 Nov, 2015 @ 11:36am 
Version 2.0.0 is out
You can find it here: Resource Exchanger 2

Features:
- Update for especially supported mods
- Update for compatibility with current version of SE
- Support for all reactors, refineries, and other blocks from mods
- Added possibility to create custom groups of blocks
Professor Nipples 27 Sep, 2015 @ 12:56pm 
Well that didn't take you long! Fantastic update to an already great script!
Sinus32  [author] 27 Sep, 2015 @ 8:34am 
Version 1.3.4 is out

Added support for mods:
- [SEI] Weapon Pack DX11
- [VisSE] [DX11] Hydrogen Reactors & Ice to Oxygen Hydrogen Gasses
- ISM Mega Mod Pack [DX11 -WIP]
Added possibility to configure colors of drills payload indicator lights. Also a default color when drills are empty is white instead of green now.
Sinus32  [author] 26 Sep, 2015 @ 12:04pm 
Ok, in that case I'm going to add possibility to change lights colors in configuration section in next version.
Professor Nipples 24 Sep, 2015 @ 1:18pm 
Hi Sinus, thanks for this. I tried it, got an error (sorry don't remember what it said). I am a bit of a scirpt dummy...so it may be me
Sinus32  [author] 17 Sep, 2015 @ 12:03pm 
Hello, I prepared the following version of ProcessDrillsLights method:
http://pastebin.com/S6WCqLzR
Just replace the original method with this one.
Professor Nipples 16 Sep, 2015 @ 5:26pm 
Hi there, I love this thing. I had successfully modded thescript to make the mining indicator light off white (the green is too much)...however in the DS I play on the script keeps changing back to green. How can I modify it correctly? Just want it all white until it reaches the first check point..then the script can start to colour it
Sinus32  [author] 24 Aug, 2015 @ 9:51am 
You're right. Even if it tries, it'll fail. But pay attention that the script cannot read filters applied on sorter blocks. Also the script doesn't know if the items movement was successful, or not, so in rare situations it may looks like it's not working at all. In this case you have to limit affected blocks using MANAGED_BLOCKS_GROUP variable.

Keep in mind that you can have more than one instance of Resource Exchanger on the same grid and each of these instances can have different value of MANAGED_BLOCKS_GROUP.
Captain_Crooked 23 Aug, 2015 @ 7:06pm 
I presume this script won't over-ride any sorting done by sorter blocks right?

(example, lets i have particular refineries that the only ore that can get in/out is uranium using sorter blocks for the input/output of them)
Sinus32  [author] 21 Aug, 2015 @ 1:00pm 
Version 1.3.3 is out
Support for OKI Weapons Collection (DX11) was added.