spaced railsignal placer

This is the place to request new mods or give ideas about what could be done.
Fahrradkette
Inserter
Inserter
Posts: 45
Joined: Thu Aug 27, 2015 4:37 pm
Contact:

spaced railsignal placer

Post by Fahrradkette »

Would it be possible to have a QoL mod helping with spacing rail signals akin to openttds ctrl+drag functionality?
Also important would be the ability to remove singals along a segment.


Idea

Train lenght (T): number of tracks occupied by the train. 2-4 Train would be 21, 6 for the locs, 12 for the wagons and 5/2 for the couplers, rounded up to the next integer.
Segment (S): chain of tracks from junction to junction. Dead end tracks are not valid for signaling.
Block (B): parts of the segment, at least as long as the pre-set train length.

Cases:
S < T:
chain signal on both ends
S >= T:
block signal on entry, chain signal on exit
S >= 2T:
additional block signals inside the segment to split it into more blocks

First/entry block (in direction of train travel) has the reminder included, i.e. is generally the longest.


In the ingame console I tried to walk tracks but coudn't figure out how to detect attached signals. I also don't know how long a curved or diagonal track piece is. I also don't know if it's possible to have mods use drag events. Would be nice to figure out if such a QoL mod is possible with the current API or how to bribe wube to get it there:)
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: spaced railsignal placer

Post by eradicator »

Fahrradkette wrote: Thu Jun 06, 2019 5:34 pm mods use drag events
Nope. You'd have to link two seperate clicks. You might be able to cheat with an invisible selection tool to get two points in one "drag" but that's about it.

I've thought about this too (OTTD yay!) but as you discovered yourself, walking tracks is a pain if you've never done anything with them D:. I'd be fine even if it only worked on straight tracks....
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: spaced railsignal placer

Post by eduran »

Have a look at https://mods.factorio.com/mod/RailTools. It does a pretty good job of placing evenly spaced signals and creating exit blocks after chain signals.
Post Reply

Return to “Ideas and Requests For Mods”