Random Colors

by Silari

Newly placed entities that support color assignment are given a random one when placed, if not preset (setting to change). Also allows changing the color to a random one via hotkey.

Tweaks
2 months ago
0.17 - 2.0
1.23K
Trains

g [DONE]Unable to make it works

5 months ago

Hi, I'm very interested by the mod, to have my AAI vehicles with different colors, but I don't manage to change them, what I'm supposed to do? Hover over a vehicle and then hit the shortcut key? Or select it, inventory opened and hit the key? In both cases, nothing happens...

5 months ago
(updated 5 months ago)

The Factorio engine always colors vehicles based on the color of whatever driver is in them, and it can't be overriden.

In order to do what it does, AAI puts a fake driver into it's ai controlled vehicles. That means the vehicle color comes from that fake driver, and can't be set on the vehicle.

I MIGHT be able to work around it and allow the color to be set if the driver is a character without a player (and is thus likely AAIs fake driver), but that'd need some testing.

5 months ago

Ok, thanks for the answer. If you manage to do that, please post here so I'm notified, much thanks!

5 months ago

The hotkey should now work when highlighting any AAI AI enabled vehicles, unless an actual player is in it, and as long as the vehicle supports coloring at all.

5 months ago

It's working, this is awesome, that's the first mod where you can give a color of your choice* to any vehicle. I can now color my chaingunners in red if they have piercing ammo and green if they are on depleted uranium, as an example.

*: The random cycling is a bit annoying, as setting up specific colors can be a bit tedious. Can an alternate key be used to make it at least deterministic, cycling through all colors, starting with red or blue? Thanks. Or any other idea ... palette button would be great obviously.

5 months ago

Doing the shortcut on a turret crashes the game (not supported entity/vehicle)

5 months ago

Hmm it’s supposed to account for that but probably missed something. I’ll check on it.

5 months ago

Fixed the crash - it now checks the entity supports colors, which only vehicles do.

There are also now per-player settings which when enabled will use a preset color when using the hotkey instead of a random/list color.

5 months ago

I tried the new version, it works nicely, and now (I could swear it was not the case before), I can reset to the default color by boarding the vehicle.
Ideally, the key shortcut could be a toggle (so you would need either a boolean flag 'is the color set' or compare the vehicle color with the one set in settings), so that I can revert a vehicle to the default color at a distance and not only by boarding it.
But already your mod is really great, this is really a premiere since 2017 I believe. I have been playing Factorio on and off since 2017 (I'm a poor player though and I always play it RTS style). I think I'll advert your mod in Reddit!

5 months ago
(updated 5 months ago)

Entering a vehicle always makes it go to the color of the player inside it, not really a default color just whatever you set in your character tab. Been that way since I made the mod at least.

Maybe if I'm bored I'll make a hotkey to set things to the player color, or an option to build things that color instead of random/list.

3 months ago

Hi!
Is it possible to make it so that when you exit a vehicle, the color is assigned again (any).
Now, when you first place a vehicle, the mod assigns a color, but as soon as you get into the vehicle, the color changes to the player's color, and when you exit the vehicle, the color remains as the player's.

New response