Krastorio 2 Inserters

by Toshayo

A mod adding only Krastorio2's possibility to adjust inserters drop lane.

Tweaks
7 days ago
1.1 - 2.0
2.15K
Logistics

b [Fixed] Error with yellow inserters

a month ago

Blue inserters are fine, but yellow inserters cause this error.

The mod Krastorio 2 Inserters (1.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Krastorio2Inserters::kr-inserter-change-lane (ID 218)
Krastorio2Inserters/scripts/inserter.lua:132: attempt to index local 'dpf' (a nil value)
stack traceback:
Krastorio2Inserters/scripts/inserter.lua:132: in function 'change_lane'
Krastorio2Inserters/control.lua:28: in function <Krastorio2Inserters/control.lua:21>

a month ago

I've met a similar error:

Error while running event Krastorio2Inserters::on_gui_switch_state_changed (ID 160)
__Krastorio2Inserters__/scripts/inserter.lua:132: attempt to index local 'dpf' (a nil value)
stack traceback:
    __Krastorio2Inserters__/scripts/inserter.lua:132: in function 'change_lane'
    __Krastorio2Inserters__/scripts/inserter.lua:88: in function 'handler'
    __flib__/gui.lua:177: in function <__flib__/gui.lua:160>
a month ago

My save is new, version 2.0. And the mod still causes an error. It very rarely happens that it is possible to switch sides, but very often an error occurs when switching.
And one more request:
in Factory 2.0 they added the ability to enter the ghost of an object to change the properties of the drawing.
So, you can make your mod also appear in the ghost of the manipulator, so that you can change the side in the drawing.

a month ago

I have the exact same error as AivanF. It happens with all types of inserters when trying to change drop-lane.

a month ago

The new update added more entries to the global directions definition which breaks part of the scripts\inserter.lua file.
https://lua-api.factorio.com/latest/defines.html#defines.direction
I was able to stop the crash by editing the script. I unzipped the mod and changed the inserter_drop_vectors indexes from [0][2][4][6] to [0][4][8][12] on lines 7 and 8.

a month ago

This really works, thanks!

a month ago

The new update added more entries to the global directions definition which breaks part of the scripts\inserter.lua file.
https://lua-api.factorio.com/latest/defines.html#defines.direction
I was able to stop the crash by editing the script. I unzipped the mod and changed the inserter_drop_vectors indexes from [0][2][4][6] to [0][4][8][12] on lines 7 and 8.

Thanks a lot for the suggestion! I've updated the mod and replaced numbers by constants.

New response