Filter Combinator (Reimagined)


A combinator that allows the filtering of values. Reimagined version of the original filter combinator by Sil3ntSt0rm.

Content
23 days ago
1.1 - 2.0
800
Circuit network

b Error

25 days ago

The mod Filter Combinator (Reimagined) (3.2.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event filter-combinator-improved::on_nth_tick(1)
Filter conflicts with filter in slot 5.
stack traceback:
[C]: in function 'set_slot'
...lter-combinator-improved__/scripts/filter-combinator.lua:135: in function 'assign_filters'
...lter-combinator-improved__/scripts/filter-combinator.lua:422: in function 'reconfigure'
filter-combinator-improved/scripts/gui.lua:447: in function 'handler'
filter-combinator-improved/stdlib/event/event.lua:337: in function 'pcall'
filter-combinator-improved/stdlib/event/event.lua:357: in function 'dispatch_event'
filter-combinator-improved/stdlib/event/event.lua:433: in function <filter-combinator-improved/stdlib/event/event.lua:391>

25 days ago

thanks. This can happen if a specific signal shows up twice (which it should never but I guess you never know). Do you happen to have a save that I can use to reproduce this?

I do have a fix but I would like to see how that condition occured.

24 days ago

https://wormhole.app/d3RqK#cWtDaS5gZeBgRrtUN8f-kg
(link valid for 24h)

  1. load save
  2. open filter combinator
  3. try to set any slot to "stone" or "steel"

Somehow, the internal combinators of the placed filter combinator are already set to a specific configuration; this also caused some other strange behavior prior to the crash.
Since 2.0 combinators are able to filter natively (either by each(red) * each(green) -> each in an arithmetic combinator, or each(red)>0 -> each input count(green) in a decider - both ways with only 1 tick delay), there is an argument for simply discontinuing this mod...

24 days ago

Thanks. I could reproduce this and it is fixed for 3.2.1 (the problem was a misunderstanding of what "section.group" means for a logistic section.

If you feel that this mod is redundant. you can always stop using it. I assume that other people (similar to me) have massive games that use a lot of those entities, so abandoning the mod would leave them in the lurch. Also, I enjoy writing code and I write mods to learn and exercise some muscle around game coding. I am perfectly fine having one user or 100,000 users, I am not in this for the fame. ;-) I will look into your suggestions to see if I can reduce the tick count (it has already dropped to two from the original code which needed three).

24 days ago

I already meant to edit the last part to "discontinuing the mod or switching to using vanilla single-combinator filters internally"; obviously there is nothing wrong with keeping this mod online for compatibility or even just a configuration shortcut.

If you didn't have fun doing this, you could technically make a "final version" that replaces all filter combinators with correctly configured vanilla combinators and can then be removed, to avoid leaving users hanging.

Just one other thing, if you do switch over to 1-tick filters, you should prominently mark that in the changelog, since some circuit builds are very sensitive to such changes (eg. time-division multiplexing circuits).

New response