How to color train wagons?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

How to color train wagons?

Post by Usul »

Hi!

I loaded my 1.1.110 factorio with 2.0 Base Game and 2.0 Space Age and noticed that some of my trains have colored wagons.

How do I color trains in a new factory started in 2.0 Base Game and 2.0 Space Age? There is no color picker in the train wagon UI.

Thanks!
robot256
Smart Inserter
Smart Inserter
Posts: 1127
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: How to color train wagons?

Post by robot256 »

Try copying them from a colored locomotive and pasting into a cargo wagon (with shift-right/left click). I forget if that actually worked but the only other way I know is with console command/mods.
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

Re: How to color train wagons?

Post by Usul »

I tried copying to color from loco to wagon, but it doesn't work.
yrogerg77
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Jul 04, 2016 1:07 am
Contact:

Re: How to color train wagons?

Post by yrogerg77 »

I am also curious about this feature... the game does not seem to apply these wagon colors automatically, so I'm not sure where they came from. Placing a new train or even adding a car to an existing train does not inherit the color of the locomotive at all. Only the pre-existing trains from the converted pre-2.0 save have colors on the wagons.
Attachments
20241120165201_1.jpg
20241120165201_1.jpg (1.22 MiB) Viewed 1840 times
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

Re: How to color train wagons?

Post by Usul »

No, I have seen train colors in post-2.0 games. It works mostly for long trains when "use destination train stop color" is checked in the loco color picker. the color is applied to the train once it cycles to the next station in it's schedule. However coloring wagons does not work for trains with only 1 wagon. Strange. This is probably a bug.

Yeah, I know what you mean. I have loaded my 1.1 base with over 100 trains into 2.0 and randomly some trains turned out colored and some did not. Its really weird.
yrogerg77
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Jul 04, 2016 1:07 am
Contact:

Re: How to color train wagons?

Post by yrogerg77 »

Yeah, I made a train on Vulcanus with 3 wagons... but the colors did not apply to the wagon. Maybe I need to do things in a specific order for it to work? I am not sure what the problem is, but it could very well be a bug.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

This sounds like you're using a mod, or some custom lua. Or maybe even a bug in the save migration?
Because they definitely don't get coloured in my version of factorio.
Paper02
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Nov 10, 2024 5:34 pm
Contact:

Re: How to color train wagons?

Post by Paper02 »

IsaacOscar wrote: Tue Dec 03, 2024 9:30 am This sounds like you're using a mod, or some custom lua. Or maybe even a bug in the save migration?
Because they definitely don't get coloured in my version of factorio.
It could be some shenanigans with the save migration, and it can blueprinted!

this is a white cargo wagon, and it will not inherit the locomotive's right away color but it will change if the train's color is set to be the same as the next station. You can later use shift left/right click to copy and paste it onto other cargo wagons.

User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Paper02 wrote: Tue Dec 03, 2024 9:46 pm
IsaacOscar wrote: Tue Dec 03, 2024 9:30 am This sounds like you're using a mod, or some custom lua. Or maybe even a bug in the save migration?
Because they definitely don't get coloured in my version of factorio.
It could be some shenanigans with the save migration, and it can blueprinted!

this is a white cargo wagon, and it will not inherit the locomotive's right away color but it will change if the train's color is set to be the same as the next station. You can later use shift left/right click to copy and paste it onto other cargo wagons.

Wow, awesome thank you!
By using this site, https://factorio.tmin10.ru/, I can see the cargo wagon has th efollowing:

Code: Select all

                "copy_color_from_train_stop": true,
                "color": {
                    "r": 1,
                    "g": 1,
                    "b": 1,
                    "a": 0.49803921580314636
                },
So I made a blueprint of my own train, added a color section to the wagons, and I got this:
Screenshot 2024-12-04 120336.png
Screenshot 2024-12-04 120336.png (1.27 MiB) Viewed 1626 times
(So the fluid wagons sadly don't change colour).
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Oh just a warning, but https://factorio.tmin10.ru/ seems to be corrupting my train stop names,
(and this mod here https://mods.factorio.com/mod/FluidWagonColorMask fixes the problem with fluid wagons)
Last edited by IsaacOscar on Tue Dec 17, 2024 3:54 am, edited 1 time in total.
yrogerg77
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Jul 04, 2016 1:07 am
Contact:

Re: How to color train wagons?

Post by yrogerg77 »

No mods here... my game has been 100% vanilla. It certainly could have been something with the save migration though, not sure.

I appreciate the blueprint, but unfortunately it did not work for me. When I tried to import it into my game, it gave me an error: "invalid base64 padding"
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

yrogerg77 wrote: Wed Dec 04, 2024 1:18 pm No mods here... my game has been 100% vanilla. It certainly could have been something with the save migration though, not sure.

I appreciate the blueprint, but unfortunately it did not work for me. When I tried to import it into my game, it gave me an error: "invalid base64 padding"
There seems to be something wrong with the forum and/or that post, try copying this:

Code: Select all

0eNptUdtuwyAM/Rc/0yohl5X8SjUhwmhmjeAISLuqyr/PpJO2h74Y25hzjg8PGP3qloghw/AAtBQSDOcHJJyC8aUXzOxggGjQwyYAw4f7hqHexIsha+JEh5uZKPybldu7ABcyZnRP9L2467DOo4sMJl4BCFgo8RtOmYFxDrVUAu6cyFoeq6pRVS+7rWCb0TvtacKU0SZ9+0SuZ7pimGC4GJ+cAIrIvOYJWAmwtNy1JU9RXyLNOvOKQadMCww5rq5M8GUhf2qc9jju0TDEsVUnFiHrjo+67ZteNlXbn966ffcrs1FkuWH1vljA0PaLGUNwtqj4dbp0i6E8gdnN7MLfnwi4uph2xV0vVatU1yp56ttq234AdraQ/Q==
yrogerg77
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Jul 04, 2016 1:07 am
Contact:

Re: How to color train wagons?

Post by yrogerg77 »

IsaacOscar wrote: Wed Dec 04, 2024 1:23 pm
yrogerg77 wrote: Wed Dec 04, 2024 1:18 pm No mods here... my game has been 100% vanilla. It certainly could have been something with the save migration though, not sure.

I appreciate the blueprint, but unfortunately it did not work for me. When I tried to import it into my game, it gave me an error: "invalid base64 padding"
There seems to be something wrong with the forum and/or that post, try copying this:

Code: Select all

0eNptUdtuwyAM/Rc/0yohl5X8SjUhwmhmjeAISLuqyr/PpJO2h74Y25hzjg8PGP3qloghw/AAtBQSDOcHJJyC8aUXzOxggGjQwyYAw4f7hqHexIsha+JEh5uZKPybldu7ABcyZnRP9L2467DOo4sMJl4BCFgo8RtOmYFxDrVUAu6cyFoeq6pRVS+7rWCb0TvtacKU0SZ9+0SuZ7pimGC4GJ+cAIrIvOYJWAmwtNy1JU9RXyLNOvOKQadMCww5rq5M8GUhf2qc9jju0TDEsVUnFiHrjo+67ZteNlXbn966ffcrs1FkuWH1vljA0PaLGUNwtqj4dbp0i6E8gdnN7MLfnwi4uph2xV0vVatU1yp56ttq234AdraQ/Q==
Thanks! This totally worked! Weird note, however... when I pasted the blueprint for the cargo wagon attached to a nearby locomotive, the bots placed it way off-center. Not sure why that happened, as I've never seen it before. The game corrected it when the train began moving though, and the wagons changed color to match the locomotive as they should! Amazing!
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

Re: How to color train wagons?

Post by Usul »

Topic is "How to color train wagons?"

Award for anyone who succeeds in coloring a 1-1 (one wagon) train wagon in Vanilla 2.0 and describing the exact steps.

I have suceeded in coloring trains with more than one wagon.

I think it's a bug that it doesnt work for 1-1- trains., but I'm a bit tired of reporting many bugs since 2.0 launch, that I have not had much time to actually play the game. I've collected lots of bug points. Several of my reports were fixed but some ignored as "not a bug" which is demotivating. Please someone else report this bug. Thanks!
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Usul wrote: Tue Dec 10, 2024 9:26 am Topic is "How to color train wagons?"

Award for anyone who succeeds in coloring a 1-1 (one wagon) train wagon in Vanilla 2.0 and describing the exact steps.

I have suceeded in coloring trains with more than one wagon.

I think it's a bug that it doesnt work for 1-1- trains., but I'm a bit tired of reporting many bugs since 2.0 launch, that I have not had much time to actually play the game. I've collected lots of bug points. Several of my reports were fixed but some ignored as "not a bug" which is demotivating. Please someone else report this bug. Thanks!
As I explained above, this can be done by manually editing blueprint strings:
For example:
Screenshot 2024-12-10 194722.png
Screenshot 2024-12-10 194722.png (360.4 KiB) Viewed 1389 times
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

Re: How to color train wagons?

Post by Usul »

Thanks! But: Checking "Use train stop color" in loco color picker updates color of wagons only if train has more than one wagon. ->Bug
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Usul wrote: Tue Dec 10, 2024 10:06 am Thanks! But: Checking "Use train stop color" in loco color picker updates color of wagons only if train has more than one wagon. ->Bug
It works for me.
before moving:
Screenshot 2024-12-10 201723.png
Screenshot 2024-12-10 201723.png (334.66 KiB) Viewed 1375 times
once moving:
Screenshot 2024-12-10 201729.png
Screenshot 2024-12-10 201729.png (305.27 KiB) Viewed 1375 times
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Also, in case anyone else comes to this thread and doesn't like manually editing blueprint strings, I made a lua snippet:
  1. Load the map editor
  2. Make a locomotive with the colour settings you want (a custom colour and/or colour from destination)
  3. Click the bottom on the top-left with the scroll and </>
  4. pase in the following lua code:

    Code: Select all

    for _, e in pairs(game.player.surface.find_entities_filtered{area=area,type='locomotive'}) do
          local data = { name = 'cargo-wagon', player = game.player }
          for _, field in pairs({'position', 'direction', 'quality', 'force', 'orientation', 'color', 'copy_color_from_train_stop'}) do
                data[field] = e[field] end
          e.destroy{player=game.player}
          game.player.surface.create_entity(data) end
  5. Drag your cursor into an area selecting the locomotive
  6. It should now have turned into a cargo wagon
  7. You can then make a blueprint of it and save it to your library, and use it in a normal save
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How to color train wagons?

Post by IsaacOscar »

Usul wrote: Tue Dec 10, 2024 10:06 am Thanks! But: Checking "Use train stop color" in loco color picker updates color of wagons only if train has more than one wagon. ->Bug
Wait, are you talking about a train you've edited via lua commands or the blueprint string, or one you obtained through normal gameplay?
If you have steps to create a two-wagon train that gets coloured, and the same steps on a one-wagon train does not, then definitely file a bug report.
(Although the "bug" is probably going to be the fact you can colour wagons at all).
User avatar
Usul
Fast Inserter
Fast Inserter
Posts: 247
Joined: Mon Oct 31, 2016 5:05 pm
Contact:

Re: How to color train wagons?

Post by Usul »

Yes, I mean without using coding/lua. Just normally acquired.
Post Reply

Return to “Gameplay Help”