Smart Inserters


Change pickup/drop position for each inserter, change drop/pickup offet, copy-paste settings, custom inserter lenght and more... Enjoy!

Utilities
a month ago
1.1
2.25K
Logistics

b [DONE] Crash while pasting

6 months ago

The mod crashed when I was copying the set filter option on a filter inserter.

The mod Smart Inserters (1.2.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Smart_Inserters::on_pre_entity_settings_pasted (ID 32)
Passed index is out of range
stack traceback:
[C]: in function 'get_filter'
Smart_Inserters/control.lua:2104: in function <Smart_Inserters/control.lua:2052>

6 months ago

can you send me a bit more information/ send me the save file
so that I can replicate the error

6 months ago
(updated 6 months ago)

Having the same issue after updating to the latest version (1.1.2 was OK, 1.2.1 crashes). Just copying settings using mouse causes crash. Ctrl+C Ctrl+V works fine.

K2SE, Cybersyn and some tweaks

6 months ago

Yeah it's happening when I'm doing Shift + left click on the inserter to paste settings from another inserter.

6 months ago

can you send me the save-file?

https://imgur.com/BF2YNRn

the 1.2.x update added teh ability to control what to paste, from my testing it work fine that's why I want to investigate in an existing save.

6 months ago
(updated 6 months ago)

I have same non-recoverable error. It happened when I paste filter inserter setting using Ctrl+V: https://imgur.com/3hjGta7
I think I will download version 1.1.2, before this selective copy-pasting thingy.

6 months ago

The mod Smart Inserters (1.2.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Smart_Inserters::on_pre_entity_settings_pasted (ID 32)
Passed index is out of range
stack traceback:
[C]: in function 'get_filter'
Smart_Inserters/control.lua:2104: in function <Smart_Inserters/control.lua:2052>

When pasting settings to a stack filter inserter that was connected via green and red wires to others in series

6 months ago
(updated 6 months ago)

at line 2102 you loop from 1 to 5, but event.source.filter_slot_count = 1 and event.destination.filter_slot_count = 1 for <LuaEntity>{name="stack-filter-inserter" }

You should not expect all filterable inserters to have exactly 5 filter slots (in my K2SE game it has 4 slots)

Steps to reproduce:
1. Have only Base and Smart Inserters be installed. Have all checkboxes marked in SI Copy/Paste config
2. Place 2 Stack Filter Inserters
3. Shift-Right click on first inserter
4. Shift-Left click on the second inserter
5. ???
6. Crash :P

Fast inserter and Filter inserter works fine

6 months ago
(updated 6 months ago)

In new beta you added filter_slot_count check so it should no longer cause out of range exception in get_filter.

Though not sure about

local filtered_slot = copy_event.filtered_slots[i]

Is filtered_slots always initialized with size 5? In Lua does indexing out of bounds causes error or just returns nil like in other languages (talking about you, javascript)?

My opinion you did not ask for: You should not loop hardcoded amount of times. For filtered inserter with only one slot you make 4 extra unnecessary loops (with a performance impact of whopping 0ms!!! Oh my god!!! /s). Loop from 1 to max(source.filter_slot_count, destination.filter_slot_count). You do not control all aspects of inserters so there might be a 10 slot filter inserter in the wild.

6 months ago
(updated 6 months ago)

I made a patch to keep in consideration the amount of filters available, I could not reproduce the error but I can imegine why that hapened in the first place, the update will come in an hour

regarding why 5 is the hard-cap
https://wiki.factorio.com/Prototype/Inserter#filter_count to this date the max amount of filters available in an inserter is 5, In the future Ill cahnge this to be dynamic but working with lua tables is a pain so i'm gonna wait till the optimization phase

6 months ago

should be fixed tell me if you still experience this problem

6 months ago
(updated 6 months ago)

tell me if you still experience this problem

Seems to be fixed for my case

Copy pasting filtered inserter in some ases would crash the mod

Some ases :D

6 months ago
(updated 6 months ago)

New error!

The mod Smart Inserters (1.2.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Smart_Inserters::on_entity_settings_pasted (ID 33)
Entity is not inserter.
stack traceback:
[C]: in function 'newindex'
__Smart_Inserters
/control.lua:69: in function <Smart_Inserters/control.lua:57>

Was copying a machine configuration (nothing to do with inserters)
Seems you broke copy-paste again :C

6 months ago

fixed

6 months ago
(updated 6 months ago)

β˜‘ Copy machine configuration
β˜‘ Copy stack filter inserter configuration
β˜‘ Copy non-stack filter inserter configuration

Seems to be fixed. Be right back with new error message :D

P.S. kekw. The following code

if not "a" == "b" then

is interpreted as

if (not "a") == "b" then

well, very obvious (no) <3 Lua

New response