0.12.22 change color of poles

Place to get help with not working mods / modding interface.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

0.12.22 change color of poles

Post by osldgoth »

I am attempting to change the color of the electric poles on the map. I am basing this on the visibleBots mod. I have tried:

Code: Select all

for k, v in pairs(data.raw["electric-pole"]) do
	v["small-electric-pole"].map_color = {r=0, g=1, b=0}
end
and

Code: Select all

for k, v in pairs(data.raw["electric-pole"]) do
	v.map_color = {r=0, g=1, b=0}
end
other variations have also been tried. I can't get the poles to change color. is this even possible? has anyone been able to do it? any tips, hits, suggestions?

in the end I don't want all poles to be a different color, I eventually want to change only a few poles that meet specific criteria. I have to be able to change the color of the poles before I get that far...
Last edited by osldgoth on Sat Feb 13, 2016 6:22 pm, edited 1 time in total.
keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: 0.12.22 change color of poles

Post by keyboardhack »

mophydeen wrote:My mod changes the color for the M1-5 versions

eg.
custommep.pictures.tint=Colortint.Tier5
This is about the color shown on the map/minimap.

Have tried to do it myself and it doesn't look like it's possible.
Waste of bytes : P
Rseding91
Factorio Staff
Factorio Staff
Posts: 15912
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 0.12.22 change color of poles

Post by Rseding91 »

map_color, friendly_map_color, and enemy_map_color on the entity prototype will do what you're after. Keep in mind you'll need to trigger a re-chart of the chunk(s) in order to see the changes.
If you want to get ahold of me I'm almost always on Discord.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: 0.12.22 change color of poles

Post by osldgoth »

well I have tried all versions of 'my code' to select the power poles and set the color after which I've run rechart in game several times, the power poles just don't change color. is there anything else I should know about?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15912
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 0.12.22 change color of poles

Post by Rseding91 »

Code: Select all

data.raw["electric-pole"]["small-electric-pole"].friendly_map_color = {r = 1, g = 1, b = 1, a = 1}
Works perfectly for me. Throw it in a mod, start up a game and build some small electric poles. They'll show white on the map.
If you want to get ahold of me I'm almost always on Discord.
keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: 0.12.22 change color of poles

Post by keyboardhack »

Rseding91 wrote:

Code: Select all

data.raw["electric-pole"]["small-electric-pole"].friendly_map_color = {r = 1, g = 1, b = 1, a = 1}
Works perfectly for me. Throw it in a mod, start up a game and build some small electric poles. They'll show white on the map.
Just want to make sure why this works. It works because a small-electric-pole is placed in the neutral force because it has this flag "placeable-neutral" and to get "map_color" to work the flag have to be changed to "placeable-player"? If that's how it works then is it possible to make your own "placeable-force" flags?
Waste of bytes : P
Rseding91
Factorio Staff
Factorio Staff
Posts: 15912
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 0.12.22 change color of poles

Post by Rseding91 »

keyboardhack wrote:
Rseding91 wrote:

Code: Select all

data.raw["electric-pole"]["small-electric-pole"].friendly_map_color = {r = 1, g = 1, b = 1, a = 1}
Works perfectly for me. Throw it in a mod, start up a game and build some small electric poles. They'll show white on the map.
Just want to make sure why this works. It works because a small-electric-pole is placed in the neutral force because it has this flag "placeable-neutral" and to get "map_color" to work the flag have to be changed to "placeable-player"? If that's how it works then is it possible to make your own "placeable-force" flags?
It works because map_color is used first if it exists else friendly_map_color is used for most friendly entities.

small-electric-poles are not placed as neutral. They're placed as the force that builds them.
If you want to get ahold of me I'm almost always on Discord.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: 0.12.22 change color of poles

Post by osldgoth »

Rseding91 wrote:

Code: Select all

data.raw["electric-pole"]["small-electric-pole"].friendly_map_color = {r = 1, g = 1, b = 1, a = 1}
Works perfectly for me. Throw it in a mod, start up a game and build some small electric poles. They'll show white on the map.
Thank you for helping with this. I tried recreating your code to test it, but when that didn't work, I copied your code thinking maybe I was spelling something wrong, or there was some other typing error... still didn't work. ... about an hour later still not working but I managed to figure out the problem: the file name containing the script wasn't named 'data.lua'. :evil: so the game didn't know what to do with it i guess. perhaps I missed the memo which spelled that out.
Post Reply

Return to “Modding help”