Reactor Interface Tweaked


Provides a less-laggy interface for reactors to connect to the circuit network.

Content
2 months ago
1.1
4.77K
Circuit network

b Crash with SE

1 year, 7 months ago

Crash when placing SE energy receiver by robot:

Error while running event Reactor_Interface_Tweaked::on_tick (ID 0)
Reactor_Interface_Tweaked/control.lua:306: attempt to index local 'burner' (a nil value)
stack traceback: Reactor_Interface_Tweaked/control.lua:306 in function
<Reactor_Interface_Tweaked/control.lua:290>

Placing them by hand doesn't cause this crash.

6 months ago

Damn. Still no fix for this after 1 year? :(
I just ran into this issue and reproduced it on the original Reactor Interface mod.
I was hoping this updated fork would resolve my issues.

6 months ago

That particular crash was fixed in 2.2.2. If you have another bug, post the full error message.

6 months ago

Okay, good to know! Thank you. I'll update and report any new issues.

3 months ago
(updated 3 months ago)

If you add "se-energy-receiver" to the list of allowed reactor prototypes, it will not add the interface automatically but you can still use the manual command. Then it crashes in the on_tick function when the burner is not found. This can be easily fixed by moving the check for burner from the reactor_built() function to the tick_interfaces() function:

    local parameters = v.signals.parameters
    parameters.temp.count = reactor.temperature
    local burner = reactor.burner
    if burner then
      local cell_type, cell_count = next(burner.inventory.get_contents(), nil)
      local spent_type, spent_count = next(burner.burnt_result_inventory.get_contents(), nil)
      parameters.fuel.count = math.ceil(100 * burner.remaining_burning_fuel / (burner.currently_burning and burner.currently_burning.fuel_value or 1))
      if cell_type then
        parameters.cells.signal.name = cell_type
        parameters.cells.count = cell_count
      else
        parameters.cells.count = 0
      end
      if spent_type then
        parameters.spent.signal.name = spent_type
        parameters.spent.count = spent_count
      else
        parameters.spent.count = 0
      end
    end
    v.control.parameters = parameters
3 months ago

Well no, the se-energy-receiver isn't a nuclear burner reactor, it wouldn't make sense to have a reactor control interface attached to it at all. Why would you even want to? Any control logic for the SE Energy Receiver should be done at the transmitting end.

3 months ago

The main thing it provides is temperature, which is important amd not available anywhere else. You could use it to trigger alarms and backup power before steam production completely stops in case the transmitter got hit by a meteor, for example.

I'm using it with the liquid antimatter reactor (a 3rd party mod for SE) to control the fuel pump and to start and stop the reaction. It's a lot more space efficient than adding a steam buffer tank and measuring the steam level.

Maybe some entities would make sense to add to a blacklist (I use a string setting for this in my mod so it's easy to change), but I don't see a reason to exclude every reactor prototype without a burner by default.

3 months ago

Hello, I just posted two pull requests with the modifications I made. I have been testing this version for 50-100 hours in my Space Exploration game and had no issues. Hope this helps! Thanks.

New response