Page 1 of 1

spaced railsignal placer

Posted: Thu Jun 06, 2019 5:34 pm
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:)

Re: spaced railsignal placer

Posted: Thu Jun 06, 2019 6:12 pm
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....

Re: spaced railsignal placer

Posted: Thu Jun 06, 2019 8:44 pm
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.