Power on a Belt deprecated


Adds a new type of accumulator with two parts, the charging station and the discharging station. Move power into batteries and transport them far away. Graphics courtesy of kaueNP. Supports batteries from bobsmods.

Content
6 years ago
0.16
9
Power

b Crash Mod

6 years ago

Crash with mod: "Omnifluid"
Error while running event PowerBelt::on_tick (ID 0)
Passed index is out of range.
stack traceback:
PowerBelt__/control.lua:42: in function <PowerBelt/control.lua:38>
I also warned the creator of the other mod.

6 years ago
(updated 6 years ago)

I guess this makes sense, my mod adds a fluid that you can't actually obtain, because it's used for a "smoke and mirrors" UPS optimization. I guess Omnifluid wasn't set up correctly to handle such a fluid. I should probably change mine to be more friendly or ping Zelos. Thanks for the report.

6 years ago
(updated 6 years ago)

Given you're doing stuff on_tick to move power from battery to steam engine, could you not instead add MJ from battery to an internal accumulator instead? I believe that this is how https://mods.factorio.com/mod/Factorissimo2 moves power from outside a building to inside a building.
Logically, you're unplugging the empty battery from the accumulator, and plugging in the freshly charged battery.

I believe that you can set a maximum discharge rate on the accumulator interface, which will limit throughput. Alternatively, with on_tick, perhaps have a queue that sets the next time to touch a given discharger to set the next time to move charge across? Edit: I believe that there's an API function specifically to request a timed callback in 'n' ticks for just this sort of purpose.

Alternatively, if you used steam as your working fluid, I believe that it would just work with Omnifluid.

6 years ago

Thinking about things, a vanilla accumulator takes 17 seconds to discharge, and consists of 5 batteries. Or, alternatively, it discharges the capacity of one battery over 204 ticks. If you touch a discharger once every 204 ticks, calculate the number of batteries you could discharge, change up to that number of batteries from charged to discharged, and dump the charge into the accumulator, it should all work out, I think?

It should also be less total CPU cycles spent than the current method.

New response