Page 1 of 1

LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Thu Jan 09, 2020 3:01 am
by jan1i3
  • LuaEntityPrototype :: pickup_position [R] -> Vector … Default position offset where the entity puts its stuff. (see LuaEntity :: pickup_position)
  • LuaEntityPrototype :: drop_position [R] -> Vector … Default position offset where the inserter will pick up items from. (see LuaEntity :: drop_position)
Usecase
I want to estimate the inserter speed (items/s) and present these numbers to the user, through tooltips (if possible/reasonable) and a gui. Basically calculate these numbers.

Yes this is doable, I have already done my testing to make sure it is.
Though of course picking up from belts will always be inaccurate - too many factors.
Side Notes
Currently this is doable by going through every inserter prototype, checking on what it is place able, placing tiles (most likely on a new, temp surface), placing the inserter, reading and storing it's positions and storing them, and destroying it.

The process of creating, using and deleting the surface would be the most annoying part (possibly even cause performance issues, and may break poorly (or even well?) written mods), though I'm pretty sure it's doable.

But still, that just feels wrong. But for now, it will have to do.

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Sat Jan 18, 2020 2:15 pm
by Honktown
The entityprototypes have

Code: Select all

inserter_extension_speed :: double [R]	The extension speed of this inserter or nil.
inserter_rotation_speed :: double [R]	The rotation speed of this inserter or nil.
Not sure what the double is supposed to mean (tiles/tick and degrees/s?). It is strange the entities have the positions and not the prototypes... like collision box is accessible in the prototypes.

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Sun Jan 19, 2020 10:11 pm
by jan1i3
Honktown wrote:
Sat Jan 18, 2020 2:15 pm
Not sure what the double is supposed to mean (tiles/tick and degrees/s?).
The units are the ones used here https://wiki.factorio.com/Inserters#Inserter_speed

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Sun Jan 19, 2020 10:44 pm
by Honktown
Thanks. Don't know if those were any use to you, compared to experiment/checking the entity.

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Sun Jan 19, 2020 11:50 pm
by jan1i3
Well, yes I need them too, but positions are just as important. Basically I need everything :P

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Fri Jan 24, 2020 3:18 am
by Rseding91
I've added these for the next release.

Re: LuaEntityPrototype :: pickup_position [R] and drop_position [R]

Posted: Tue Jan 28, 2020 3:40 pm
by jan1i3
Thank you :)