How to check rail bridge length in Lua?

Place to get help with not working mods / modding interface.
Post Reply
smallfly
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

How to check rail bridge length in Lua?

Post by smallfly »

Hey together,

any tipps how to check the rail bridge length during building a rail bridge? I want to limit the maximum bridge length to a certain amount of straight rails (e.g. max 20 straight rails). On building the 21st rail, the rail placement should be inhibited.

How to check the built object right next to the current building position?

Thanks in advance for your tipps!

Pi-C
Smart Inserter
Smart Inserter
Posts: 1643
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: How to check rail bridge length in Lua?

Post by Pi-C »

smallfly wrote:
Sun Jan 09, 2022 7:30 pm
How to check the built object right next to the current building position?
In your case, entity.get_connected_rail should do the trick.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

smallfly
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

Re: How to check rail bridge length in Lua?

Post by smallfly »

I will try that. Thank you so far!

Post Reply

Return to “Modding help”