Change color on runtime

Place to get help with not working mods / modding interface.
Post Reply
Spekkio
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Feb 18, 2024 1:01 am
Contact:

Change color on runtime

Post by Spekkio »

Hello,

I have been learning modding and lua by replacing the construction and logistics robots with units from Starcraft 1 and i would like to color them the same as the player like the vanilla turrets do.

It seems the robots lack the atribute turrets have to do this, so i have been trying to draw an animation on top of each robot. However searching every robot to draw the mask is very resource intensive and i can´t get the animation to align with the floating movement neither wont follow the robot entering roboports.
example1.png
example1.png (1.39 MiB) Viewed 383 times
example2.png
example2.png (1.91 MiB) Viewed 383 times
I have run out of ideas, is there a better way to do this?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Change color on runtime

Post by DaveMcW »

If you have a limited set of colors, you could create a unique robot entity for each color. Then assign each force a recipe that gives their color robot.

Post Reply

Return to “Modding help”