[2.0.28] Blueprint previews of cars/tanks are incorrectly coloured

Bugs that are actually features.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

[2.0.28] Blueprint previews of cars/tanks are incorrectly coloured

Post by IsaacOscar »

Consider the following trivial blueprint (it's just a car):
Screenshot 2024-12-31 143441.png
Screenshot 2024-12-31 143441.png (286.75 KiB) Viewed 268 times
Notice how it appears blue, which is the colour I set my player too. By using this great tool at https://factorio.tmin10.ru/, I can see that the blueprint does *not* actually store the colour of the player. In particular, if I change my player's colour, or change to a different player, the blueprint preview updates.

Unfortunately, when placing the blueprint, and filling it with either a bot or the player, there is no colour:
Screenshot 2024-12-31 143644.png
Screenshot 2024-12-31 143644.png (60.48 KiB) Viewed 269 times
I first have to enter the car for it to change colour, but then it will change to the colour of the driver (which might not be the same as the colour of whoever placed the blueprint).

Bassically, I expect the colour in the blueprint preview to match the colour of the placed entity, as it does with other coloured entities.

Note that the above happens regardless of what colour the car I made the blueprint from had. It also happens with Tanks (which are internally just a "car" variant).

This can be done in several ways:
  1. (my prefered option) When you place the car, it uses the current players colour, and doesn't wait for you to drive it (this is what my mod https://mods.factorio.com/mod/colour-on-place does)
  2. The blueprint preview shows the white/uncoloured appearance
  3. Make cars/tanks work like spidertrons: you get a colour selector GUI when you click them, and blueprints preserve the colour. (Except that having the colour default to the players if you haven't previously configured it, which is also what my mod does for spidertrons).
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3455
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.28] Blueprint previews of cars/tanks are incorrectly coloured

Post by boskid »

Actually looking at the code this is a feature. BlueprintWidget is specifically implemented to use your force's color as a color for mask override. Color of the force at one of the steps is resolved as a color of force's first player and since you are the only player, your color gets used.

If you make your force to have a custom color by running "/c game.player.force.custom_color={0,0,0}", now that blueprint will use a different color than yours.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.28] Blueprint previews of cars/tanks are incorrectly coloured

Post by IsaacOscar »

boskid wrote: Mon Jan 13, 2025 7:45 pm Actually looking at the code this is a feature. BlueprintWidget is specifically implemented to use your force's color as a color for mask override.
In that case, shouldn't the placed result have the force's colour? Otherwise the blueprint preview is incorrect...
Post Reply

Return to “Not a bug”