Page 1 of 1

Get Player Tint

Posted: Tue Apr 27, 2021 2:06 am
by twu
I'm trying to find information on how to get the players tint, like how when a player enters a car it switches to that color. I've tried looking at the code in the base mod, but it hasn't been very helpful.

Re: Get Player Tint

Posted: Tue Apr 27, 2021 6:24 am
by ickputzdirwech
Have a look at the lua api: https://lua-api.factorio.com/latest.

To change the color of all vehicles the player enters you would have to do the following:

Hook into the event on_player_driving_state_changed
Check if the player is driving
Set the vehicle color equal to the player color

Hope you can figure out the details on your own. You might have to be careful wether the player has a character or not. If you have trouble with it don’t hesitate to ask.