Rename Trains

This mod adds a small GUI that lets you easily rename trains and other buildings with backer names.
1 year, 4 months ago
0.13 - 0.16
2688
Owner: madmaster5000
Source: N/A
Homepage: https://forums.factorio.com/viewtopic...
License: MIT
Created: 2 years ago
Latest Version: 0.4.0 (1 year, 4 months ago)
Factorio version: 0.13 - 0.16
Downloaded: 2688 times

I've been playing Factorio since way back when train stops couldn't be given custom names. Being able to rename your train stops with custom names was a big help for train users to organize their rail networks. One thing that was missing though was custom names for the trains themselves. I use different trains for different purposes like Iron, Oil, Copper and PAX, and being able to rename your trains according to their purpose is another step for organization. I've been using the command line to rename locomotives for a while, but I decided to make this mod to make renaming trains more accessible for everyone else.

The Rename Trains mod adds a simple GUI in the top left corner with a textbox and a SET button. To use the mod, type in the new name you want for your train, click on any locomotive or cargo wagon in the train you want to rename (which opens that locomotive's or cargo wagon's inventory or schedule), and click the SET button. This will rename every locomotive in that train's rolling stock to the custom name you chose.

You can also use the text box to rename labs, train stops or roboports. Radars do not have an openable GUI so they can't be renamed using this mod.

The Rename Trains text box can be expanded or minimized by clicking on the RT button in the top left.

IF YOU WANT TO RENAME THINGS WITHOUT DOWNLOADING A MOD

Just hover your mouse over the locomotive or building you want to rename and type this in the the console:
/c game.player.selected.backer_name = "NEW_TRAIN_NAME"

Or to rename all locomotives in a train at once, hover over any locomotive or cargo wagon in the train and copy/paste this into the console:
/c
local nam = "NEW_TRAIN_NAME"
local seletran = game.player.selected.train.locomotives
for nothing, tran in pairs(seletran.front_movers) do
tran.backer_name = nam
end
for nothing, tran in pairs(seletran.back_movers) do
tran.backer_name = nam
end

Changelog:
June 30, 2016: Published v0.2.0 to Factorio mods

August 26, 2016: Updated to v0.3.0 to work with Factorio 0.14.

February 4, 2018: Updated to v0.4.0 to work with Factorio 0.16. Man it's been a while since I worked on my mods.
- Assembly machines, furnaces, and rocket silos can no longer be renamed because they no longer display backer names.
- Added a new custom style for the "Set" button.