Automatic Train Station Names


Automatically set names of newly built train stations

Utilities
3 years ago
0.16 - 1.1
1.92K

b Bugs ish .17

5 years ago

.17 added in so you could add [item=(item-label-here)] and then it would show an item icon like on the players toolbar. But I'm pretty sure there is a conflict with the "Stations []" addition in your mod.

I was just wondering if there is a way to fix this, or if its even your mod causing this conflict?

4 years ago

I had no issues using any of the item=, img=, or recipe= text templates in station names. For example, name a station "Iron Processing [img=item.iron-plate] []" correctly shows both the icon and increments the station number when shift-left+shift right copy/pasting, using ctrl c + ctrl v, and when using full blueprints. The mod seems to do it right in each case.

4 years ago

Actually I did eventually reproduce this. If you name a station e.g. "[item=rocket-control-unit] Lubricant Dropoff" the mod will rename it "[1] Lubricant Dropoff". After more experimenting I think the mod picks up the last [*] pattern in the string and assumes that is its numeric placeholder. You can work around it by not making the item= marker the last bracket pair in the string.

This could probably work without conflict if the placeholders were changed to something like %n and %p.

4 years ago
(updated 4 years ago)

I also confirm that I too am having this issue. A fix would be greatly appreciated as of right now you can't have an item label on its own at a train stop without the mod highjacking it and converting it to a number.

@netherous, that's not a great work around as when I use item labels they are always first at the front before any text. The best solution I feel though as you say would be to change the placeholders.

As there has been no changes or updates to this mod in 9months and no response as yet from the author I had a peak at the code and can't see an easy way or where to change the [] place holders. Any ideas?

4 years ago

I took a go at changing some code..
Take a look at the pull request.
https://github.com/steffen-kiess/factorio-AutomaticStationNames/pull/1
There are plus and minus of this method..
Plus side is that you can now use icons in stations that do not need numbers.
Minus side is that you MUST leave the string between the brackets empty or as a number.. So at least you can copy paste.

example.
[item=iron-plate] should just show the iron plate icon
[item=iron-plate][] should show iron plate icon [1]
[item=iron-plate][ ] should just show iron plate icon [ ] ... because it has a space between the brackets
[] should show [1]
[asdfasdf] should show [asdfasdf]
[][asdf] should show [1][asdf]

4 years ago

I've merged the pull request, so the new icons should work now.

4 years ago

I've merged the pull request, so the new icons should work now.

Thank you!

4 years ago

Outstanding work guys, thanks very much πŸ‘

New response