Page 1 of 1

An event to detect the change to an inserter's pickup/drop position

Posted: Tue Oct 12, 2021 7:41 am
by curiosity
Why:

Being able to detect an inserter's target position changing would allow mods to rely on said position instead of obtaining it live every time (possibly every tick if accuracy is needed, even if the mod otherwise doesn't need to run on tick). In the particular case that came up this would allow for optimizations and flexibility in detecting what inserters target a given entity.

What:

The event should contain the following information, either directly or indirectly (can be deduced from the event's other fields):
  • the inserter entity
  • old pickup and/or drop position
  • new pickup and/or drop position
  • what position has changed of the two

Re: An event to detect the change to an inserter's pickup/drop position

Posted: Tue Oct 12, 2021 3:43 pm
by mrvn
By pickup/drop postion do you mean when an inserter is rotated or changing which side of a belt it places items?

Going by other events the new pickup/drop position wouldn't be in the event. You already have the inserter entity which has the new pickup/drop position. Similar why do you need to known which changed? event.pickup != entity.pickup seems simple enough.

Re: An event to detect the change to an inserter's pickup/drop position

Posted: Tue Oct 12, 2021 4:12 pm
by curiosity
mrvn wrote: Tue Oct 12, 2021 3:43 pm By pickup/drop postion do you mean when an inserter is rotated or changing which side of a belt it places items?
I mean exactly the properties of LuaEntity.
mrvn wrote: Tue Oct 12, 2021 3:43 pm Going by other events the new pickup/drop position wouldn't be in the event. You already have the inserter entity which has the new pickup/drop position. Similar why do you need to known which changed? event.pickup != entity.pickup seems simple enough.
Please read:
curiosity wrote: Tue Oct 12, 2021 7:41 am either directly or indirectly