Page 1 of 1
Dynamically change trainstop names richtext icons with circuit signals
Posted: Fri Nov 22, 2024 2:38 pm
by M1k3y
TL;DR
Enable changing a train stop name dynamically from a circuit signal, overriding one (or more) placeholder richtext icons with a circuit signal.
What?
The idea is to use a setup similar to the train schedule interrupts with circuit signal.
The train station name would be set to something like "[virtual-signal=circuit-placeholder] unload", maybe with an additional toggle in the train stop configuration to enable the dynamic renaming feature.
If this placeholder is used (and the function is enabled), the rich-text icon should be replaced with the signal of the highest value (or by a signal with a value specified in the trainstop configuration) that is applied to the trainstop.
The trainstop name should only be considered by a train when planning a new path. Once the station is selected as the next destination, changes to the dynamic part of the name should be ignored to prevent excessive checks and repaths.
Optionally allow for multiple placeholder icons to be defined which will be replaced in order from left to right with the highest signal value first. Though in this case it should also be considered to allow regex-like wildcards in train schedules.
See also:
viewtopic.php?f=6&t=121367
viewtopic.php?f=6&t=119162
Why?
Having this feature alongside the new train interrupt system with parametric stations would allow for much more powerful multi purpose stations to be created.
The setup I'm thinking about allows for generic requester stations, that could dynamically rename themselves to request a specific item from the train network. When combined with a smart dispatching system or appropriately designed train network. one could basically implement a generic unloading station, that will request whatever items are currently needed, like a supersized bot network with requests set by the circuit network.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Fri Nov 22, 2024 6:55 pm
by AileTheAlien
M1k3y wrote: ↑Fri Nov 22, 2024 2:38 pmOptionally allow for multiple placeholder icons to be defined which will be replaced in order from left to right with the highest signal value first.
IMO it should just use any existing (non-zero) signals, in order from left to right.
You can already add, remove, sort, and filter signals with other combinators, so this behavior should be dead simple to explain in a tooltip. (And to implement. Train pathing's already a somewhat costly chunk of code, from what I've read in older Friday blogs.)
M1k3y wrote: ↑Fri Nov 22, 2024 2:38 pmThough in this case it should also be considered to allow regex-like wildcards in train schedules.
What do you mean by "regex-like wildcards" here? That sounds 1) expensive, and 2) complex to explain in a tiny tooltip. IMO, the placeholder icon(s) should just be substituted with the first available signal(s).
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Fri Nov 22, 2024 7:01 pm
by robot256
FYI this has roughly been tried before with the Stringy Train Stops mod. I wonder how that mod would interact with schedule interrupts now...
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Sat Dec 07, 2024 8:20 am
by arl85
or if not any signal, at least the new wildcard ones, so you could have a generic liquid/item unloading station
- immagine.png (50.28 KiB) Viewed 611 times
right now it is considered verbatim and no station is found with that name
- immagine.png (162.89 KiB) Viewed 612 times
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Sat Dec 07, 2024 10:42 am
by mergele
This would be very useful
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Sat Dec 07, 2024 12:52 pm
by Asynchron
+1. Would be quite useful for malls receiving intermediate items through trains.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Sun Dec 08, 2024 12:13 am
by Muche
I think there should be at least two virtual signals - [virtual-signal=circuit-placeholder-1] & [virtual-signal=circuit-placeholder-2].
Then it'll be possible (albeit a little impractical) to use one of the signals as cargo type and the other as operation type, e.g.
and
.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Sun Dec 15, 2024 5:02 pm
by k1ng440
Yes please.
Use the wildcard signal parameter to change the name of the train stop
Posted: Fri Dec 20, 2024 1:20 pm
by Torquai
TL;DR
When a trainstation is connected to a circuit network, let the wildcard signal parameter be replaced by the first circuit input, thereby changing the actual station name.
What?
- Factorio circuit name.png (1.3 MiB) Viewed 406 times
If we send in both 'iron-plate', and 'copper-plate', then only the first input will be taken into consideration.
Or maybe if we use two wildcards, multiple inputs can be taking into consideration? like '<iron-plate><copper-plate>DROPOFF'
Why?
By implementing this change, I can now create a single stop that can handle multiple trains and items.
I am building a city-block pattern and I don't have unlimited space for train stops, and for my shop I need almost every item in the game. By using some combinators I can create a list of items I need more of, and have my station just change name to reflect what I need.
This matches perfectly with the use of train interrupts and the item parameter used in trains.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Mon Dec 23, 2024 3:04 pm
by Koub
[Koub] Merged two threads with the same or very similar suggestions, and removed the posts pointing from each thread to the other + the duplicate thread discussion.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Thu Jan 02, 2025 11:14 am
by arl85
I just found a
mod that implements this.
Re: Dynamically change trainstop names richtext icons with circuit signals
Posted: Thu Jan 02, 2025 12:44 pm
by Yodo
In addition to the aforementioned mod, there's also
Progammable Train Stop Naming which is based on it. I'm not sure what the difference is, except that the "first signal" option is gone.