Belt Balancer

by asdff45

Adds Balancer Parts, that can be put together, to balance all adjusting lanes.

Content
4 years ago
0.17 - 1.1
50.3K
Logistics

i [Added 1.2.3/2.1.3] Compatibility with Picker belt tools mod

4 years ago

When you reverse the direction of a belt with a mod like Picker Belt Tools, removing a belt adjacent to the balancer causes a crash on the server:

68.854 Error MainLoop.cpp:1202: Exception at tick 14637564: Мод Belt Balancer (2.1.2) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event belt-balancer::on_player_mined_entity (ID 65)
belt-balancer/objects/balancer.lua:140: attempt to index local 'stack_belt' (a nil value)
stack traceback:
belt-balancer/objects/balancer.lua:140: in function 'recalculate_nth_tick'
belt-balancer/objects/belt.lua:329: in function 'remove_belt'
belt-balancer/control.lua:139: in function <belt-balancer/control.lua:124>

The steps to reproduce on the new game are:
- place a balancer part
- draw an incoming and an outgoing belt
- point at a belt and change its direction with the mod hotkey (I think it's ALT+R by default)
- remove a piece of belt, adjacent to the balancer

I have uploaded the crashed save and mods to mega.nz, as you had suggested.
https://mega.nz/#!Cg1zQCQB!t6rznVfejGURgGVjVGc2kzd0X41slZBHKLXBMTtHciI
I am using Factorio 0.18.12 (because some mods don't support the GUI change of 0.18.13+)

4 years ago
(updated 4 years ago)

This is now added with 1.2.3/2.1.3!
Be careful to use it, since it is impossible to detect, that a belts direction was changed by setting the LuaEntity::direction directly. Changes to the changed belt will crash the mod.
Please wait a few seconds, until my logic witnesses, that the Belt is changed, before changing it again.

4 years ago

Tyvm!

New response