I'm working on a mod that updates a train station name using circuit network inputs, to allow stations to 'call' for trains based on conditions. What I've created so far is:
1> Copied and extended the base Train Station to a new item and entity "dynamic-train-station".
2> Set up recipe, research, etc for the Dynamic Station
3> Station will update its name if the name includes a | character. It updates the portion after the |.
4> Dynamic Stations poll their circuit network inputs looking for the "signal-red" and "signal-green" values, and reset their names based on the highest value input on one of those, or clears the name if both are zero or less. Red wins in a tie.
Example of how this works -- name the station "Iron|Whatever" -- at the next polling interval the station will be renamed to "Iron|", "Iron|Red" or "Iron|Green" depending on the circuit network inputs.
The main issue I'm running into is that when I reset the station name via the entity.backer_name property, it changes the name in the schedule of any trains that have that station. Currently, I can work around this by having a separate chunk of rail with a bunch of dummy stations on it matching the potential names that can be set. As long as there is still a station matching the existing name in the schedule, the name in the schedule won't change.
Using the dummy stations, if the dynamic station is changed to a name not in the schedule, the station is marked unreachable and the train stops wherever it is in its current route, usually at the previous station and blinks the "No Route" message.
Ideally, the functionality I'm looking to match is what happens when you pick up a station that's currently routed -- the train marks the name red and skips over it when it comes up in the schedule.
I want to keep this fairly lightweight, not getting deep into the guts of how trains schedule & route, so that managing the logic of the train network uses the in game tools as much as possible (combinators, etc).
Help with renaming train stations in schedules
Place to get help with not working mods / modding interface.
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Implemented in 2.0
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Documentation Improvement Requests
- ↳ Resolved Requests
- ↳ Development tools
- ↳ Tools
- ↳ Mod and installation managers
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development tools
- ↳ Special interest mods and libraries
- ↳ Modding Development
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions