Change image of tiles

Place to get help with not working mods / modding interface.
Post Reply
patfre
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 15, 2020 1:59 pm
Contact:

Change image of tiles

Post by patfre »

So i know how to change the image of items.

Code: Select all

item.icons = {
    {
        icon=image,
        tint={r=1,g=0,b=0,a=1}
    }
}
What i want to know is how do you do the same to a tile?
I don't know if it is possible so that is why i am asking

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Change image of tiles

Post by darkfrei »

I use the info-mod to find such prototype definitions:

Code: Select all

data.raw.tile.water.variants.main[1].tint={r=1,g=0,b=0,a=1}
data.raw.tile.water.variants.main[1].hr_version.tint={r=1,g=0,b=0,a=1}

data.raw.tile.water.variants.main[2].tint={r=1,g=0,b=0,a=1}
data.raw.tile.water.variants.main[2].hr_version.tint={r=1,g=0,b=0,a=1}

data.raw.tile.water.variants.main[3].tint={r=1,g=0,b=0,a=1}
data.raw.tile.water.variants.main[3].hr_version.tint={r=1,g=0,b=0,a=1}
And all transitions:
Attachments
2020-11-17T21_06_30-D__Factorio_1.0_factorio-current.log - Notepad++.png
2020-11-17T21_06_30-D__Factorio_1.0_factorio-current.log - Notepad++.png (144.33 KiB) Viewed 1109 times

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Change image of tiles

Post by darkfrei »

Actually, it can be tinted as deep tint function:

Code: Select all

function deep_tint (tabl, tint)
	for i,  v in pairs (tabl) do
		if type (v) == "table" then
			deep_tint (v, tint)
		end
	end
	if tabl.picture then 
		tabl.tint = tint
	end
end

-- call the deep tint function:
deep_tint (data.raw.tile.water, {r=1,g=0,b=0,a=1})

patfre
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 15, 2020 1:59 pm
Contact:

Re: Change image of tiles

Post by patfre »

So i just looked the above posts but non of them work.
Also i forgot to mention that i want to change water into the void so that water looks like the void but still functions as water.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Change image of tiles

Post by darkfrei »

patfre wrote:
Tue Nov 17, 2020 8:53 pm
So i just looked the above posts but non of them work.
Also i forgot to mention that i want to change water into the void so that water looks like the void but still functions as water.
It works, but makes no difference. Probably all pictures must be grayscale, not colored before tint.
UPD: data.raw.tile.water.effect = nil


Try to take all graphics from out-of-map tiles, they are pretty void.

Code: Select all

data.raw.tile.water.effect = nil
data.raw.tile.water.variants = data.raw.tile["out-of-map"].variants
data.raw.tile.water.transitions = nil

data.raw.tile.deepwater.effect = nil
data.raw.tile.deepwater.variants = data.raw.tile["out-of-map"].variants
data.raw.tile.deepwater.transitions = nil
Attachments
2020-11-18T18_11_47-Factorio 1.0.0.png
2020-11-18T18_11_47-Factorio 1.0.0.png (633.06 KiB) Viewed 1001 times

Post Reply

Return to “Modding help”