Get Player Tint

Place to get help with not working mods / modding interface.
Post Reply
twu
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Apr 23, 2021 11:26 pm
Contact:

Get Player Tint

Post 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.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 768
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Get Player Tint

Post 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.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Post Reply

Return to “Modding help”