Page 1 of 1

Could the devs implement this "hook"?

Posted: Thu Jun 06, 2019 9:47 pm
by nuhll
So its basically about this question in the LTN forum:

viewtopic.php?p=433638

I dont know the technically correct words... but i try to explain.

I want a way to let inserters swing back if they have something in hand (or if that is not possible, teleport, put into internal inventory or just destroy - what ever is possibel idk)

But at the current state of the game this doenst seem possible.

Is it possible to make a "hook"? inside the game where you could listen for "if filter in filter inserter changes"? - and then read inventory of inserter?

"So basically a hook (?) when a filter in a inserter gets changed (after train leaves, the filter inserters should get their filter settings removed, right?)

So on on_filterinserter_change_filter

1.) If it gets changed from SOMETHING to NOTHING
- If nothing "in hand", do NOTHING
-> check if something "in hand", if so, "swing back" (or if that is not possible, teleport, put into internal inventory or just destroy - what ever is possibel idk)
- That there is space in the inventory is super easy to archive in using wires to only allow something in if its less then X..

2.) If it gets changed from NOTHING to Something
-> do nothing

So it should only be called when filter inserters get filters changed (usually shouldnt hapen often and nroamly only on train stops, right?)"

Re: Could the devs implement this "hook"?

Posted: Fri Jun 07, 2019 5:25 am
by Koub
[Koub] Moved to modding interface requests.