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

Post Reply
User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

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

Post 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.
Also known as JanSharp. jan1i3 was/is my old name ;)

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

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

Post 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.
I have mods! I guess!
Link

User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

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

Post 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
Also known as JanSharp. jan1i3 was/is my old name ;)

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

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

Post by Honktown »

Thanks. Don't know if those were any use to you, compared to experiment/checking the entity.
I have mods! I guess!
Link

User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

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

Post by jan1i3 »

Well, yes I need them too, but positions are just as important. Basically I need everything :P
Also known as JanSharp. jan1i3 was/is my old name ;)

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

I've added these for the next release.
If you want to get ahold of me I'm almost always on Discord.

User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

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

Post by jan1i3 »

Thank you :)
Also known as JanSharp. jan1i3 was/is my old name ;)

Post Reply

Return to “Implemented mod requests”