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.
LuaEntityPrototype - max_underground_distance
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
LuaEntityPrototype - max_underground_distance
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.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaEntityPrototype - max_underground_distance
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.
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.
Re: LuaEntityPrototype - max_underground_distance
Take a look at DistancePlus mod. It adds longer pipes and has underground distance tag in fluid boxes.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaEntityPrototype - max_underground_distance
Accessing the value from data.lua is trivial, it's accessing it from control.lua where I am having problem.orzelek wrote:Take a look at DistancePlus mod. It adds longer pipes and has underground distance tag in fluid boxes.
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.
Re: LuaEntityPrototype - max_underground_distance
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.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaEntityPrototype - max_underground_distance
<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.