Page 1 of 1

Add wildcards for train composition, bidirectionality and wagon count

Posted: Mon Oct 28, 2024 12:39 pm
by mrvn
TL;DR
For interrupts add wildcards that are replaced by the train composition, bidirectionality or wagon count.

What?
Add three new wildcards for interrupts:

Train composition
For use in station names this gets replaced by the composition of the train, e.g. [item=locomotive][item=cargo-wagon][item=cargo-wagon][item=cargo-wagon][item=locomotive].

There should be 2 extra flavors for this: Replace any wagon with [virtual-signal=any-wagon] and replace any locomotive with [virtual-signal=any-locomotive] for use with mods that define new locomotives. This would be useful for refueling stops as they only care about where the locomotives are.

Note: If there can't be 3 flavors of this then use the last one, with everything mapped to the virtual signals. It's the most useful for refueling.

Train bidirectionality
For use in stations names this gets replaced by [virtual-signal=signal-train-bidirectional] if the train has locomotives facing both ways.

The use case for this is when both through stations and end stations are being used. Only bidirectional trains can go to end stations but both types can go to through stations. This symbol would be included in the station name and interrupt to filter out the right stations.

Train wagon count
For use in station names this gets replaced by the number of wagons in the train, not counting locomotives, e.g. for the above train: [virtual-signal=signal-4].
The reason why locomotives are excluded is so that an LCCCC and LCCCCL train can use the same through station.
Why?
Writing interrupts to fetch items for trains with one wagon, two wagons, 4 wagons, 8 wagons,.. and all their refuel interrupts becomes repetitive. The above would allow more universal interrupts that automatically adjust to the train the interrupt is used on.

Re: Add wildcards for train composition, bidirectionality and wagon count

Posted: Tue Nov 05, 2024 6:40 am
by AileTheAlien
I'm still building out my 1-1 trains, but once I getback to 2-4 trains, this seems like I'll want it! :)