Stringy Train Stops deprecated


Rename train stations and dispatch trains based on circuit signals

3 years ago
0.14 - 1.1
2.16K

g Changing train stop name?

4 years ago

I noticed that every time you change the name of a train stop, you destroy the old stop and create a new one. It looks like the current API allows you to write directly to the LuaEntity::backer_name property without destroying the entity. Wouldn't that be a better way of changing the name? Or does it mess up other mods that look at station names? (They should be handling the on_entity_renamed event anyways.)

4 years ago

IIRC the issue is related to what happens to that name in trains's schedules - if you rename the only stop of that name, it changes schedules, while deleting/rebuilding does not. I'm planning some pretty significant refactoring work on this one anyway though, so I'll see if this is still needed when I do that...

4 years ago

Ah, I understand now! I was testing it with the Dispatcher mod and found a few issues, but didn't run into that one yet. In my case, I'm having the stop rename itself to match a Dispatcher destination station, so trains usually do not have that stop name directly in their schedules, but I can imagine with multiple trains it might become an issue.

The issues I posted on your GitHub are not directly related. I tried a refactor of my own to fix them, you are welcome to use any part of it.

New response