LuaEntityPrototype - max_underground_distance

Post Reply
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

LuaEntityPrototype - max_underground_distance

Post by aubergine18 »

When looking at pipe-to-ground ("p-t-g") LuaEntityPrototype in control.lua, the `max_underground_distance` doesn't seem to be exposed - any chance it could be added?

Context: I'm using these entities for bridges, and when a segment (simple-entity) between two p-t-g's gets destroyed I search X tiles along relevant axis to find the "parent" p-t-g. To keep that search area small as possible, I've currently hard-coded the distance, but am at a point (remote interface) where it would really be better to pull it from LuaEntityPrototype rather than have two definitions of the value which could go out of sync.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaEntityPrototype - max_underground_distance

Post by aubergine18 »

bumping for great justice

if there's any way this could be added to LuaFluidBox, or LuaEntity or LuaEntityPrototype, etc., it would be really, really useful.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: LuaEntityPrototype - max_underground_distance

Post by orzelek »

Take a look at DistancePlus mod. It adds longer pipes and has underground distance tag in fluid boxes.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaEntityPrototype - max_underground_distance

Post by aubergine18 »

orzelek wrote:Take a look at DistancePlus mod. It adds longer pipes and has underground distance tag in fluid boxes.
Accessing the value from data.lua is trivial, it's accessing it from control.lua where I am having problem.

There are some workarounds, like I could iterate all the pipe-to-ground in data.lua, create a new fake entity and dump the underground lengths of all the p-t-g's in to it's .order property, but that's really hacky way to do things, hence wanting the max_underground_distance to be available in native Lua API via control.lua.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

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

Re: LuaEntityPrototype - max_underground_distance

Post by Rseding91 »

The property already exists for underground belts but I added support for underground pipes in 0.15.
If you want to get ahold of me I'm almost always on Discord.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaEntityPrototype - max_underground_distance

Post by aubergine18 »

<3 Thank you!!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Post Reply

Return to “Implemented mod requests”