LuaEntity.belt_to_ground_type works on ghosts

Place to report issues and suggest improvements to the API documentation.
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

LuaEntity.belt_to_ground_type works on ghosts

Post by sparr »

Thanks to https://www.reddit.com/r/factorio/comme ... y_operate/ I have just learned that I need to be checking for ghost belts and splitters and undergrounds in my "does this real belt curve" code. That means I need to know whether a ghost underground belt is an input or an output. I started writing this request for LuaEntity.ghost_belt_to_ground_type but then discovered the new(ish) Linked Belt entity and the docs saying that LuaEntity.linked_belt_type works directly on ghosts. So I tried LuaEntity.belt_to_ground_type on a ghost... and it works!

So, this request is just to note that in the docs, like it's noted for linked_belt_type, e.g. "Can also be used on entity ghost if it contains linked-belt."

PS: While we're at it, LuaEntity.ghost_loader_type probably deserves this treatment as well.

PPS: It would be great if this was a json field, not just description text. Like `subclasses`, but this field might be called something like `ghost_passthrough`?

PPPS: I started writing this in the interface request forum when I thought it would require an interface change. I guess this is just a doc request now. I'd appreciate if a forum mod would move this over there.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaEntity.belt_to_ground_type works on ghosts

Post by Bilka »

As stated at the top of the page most functions of LuaEntity work on ghosts. So we're unlikely to note this on every single thing.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: LuaEntity.belt_to_ground_type works on ghosts

Post by sparr »

It seems like just a few more recent additions (belt_shape and all the linked_belt fields and methods) got a comment in the description like "Can also be used on entity ghost if it contains [some subclass]". The presence of those feels misleading and is what suggested to me that it didn't apply to some others similar fields. Would it be possible to remove those, for consistency? I suspect some new dev thought, as I did, that this was less reliable/universal than it is.
Post Reply

Return to “Documentation Improvement Requests”