changing a texture of a wall

Place to get help with not working mods / modding interface.
Post Reply
tadpolefeet
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Jan 13, 2020 5:06 pm
Contact:

changing a texture of a wall

Post by tadpolefeet »

I thought walls looked too boring, and made a few textures for single walls that make them decorations. how can i replace the textures of hr-wall-single.png and hr-wall-single-shadow.png to custom ones

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

Re: changing a texture of a wall

Post by darkfrei »

It's a file

Code: Select all

Factorio_0.17\data\core\graphics\background-image.jpg
but it seems that's impossible to change the background via mod.

asdff45
Inserter
Inserter
Posts: 33
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: changing a texture of a wall

Post by asdff45 »

THis should be possible, with overriding the default texture with your own texture in the data stage:

Code: Select all

data.raw.wall["stone-wall"].pictures.single.layers[0].filename = "your-sd-sprite"
data.raw.wall["stone-wall"].pictures.single.layers[0].hr_version.filename = "your-hr-sprite"
data.raw.wall["stone-wall"].pictures.single.layers[1].filename = "your-sd-shadow"
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.filename = "your-hr-shadow"
Stone-Wall Prototype definition: https://github.com/wube/factorio-data/b ... .lua#L4465
Prototype of Walls: https://wiki.factorio.com/Prototype/Wall#pictures

Dont forget to override also the other Parts of the `pictures` table

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

Re: changing a texture of a wall

Post by darkfrei »

My bad, the wall sprites are defined as

Code: Select all

data.raw.wall["stone-wall"].pictures.single.layers[1].filename = "__base__/graphics/entity/wall/wall-single.png" 
data.raw.wall["stone-wall"].pictures.single.layers[1].priority = "extra-high" 
data.raw.wall["stone-wall"].pictures.single.layers[1].width = 32 
data.raw.wall["stone-wall"].pictures.single.layers[1].height = 46 
data.raw.wall["stone-wall"].pictures.single.layers[1].variation_count = 2 
data.raw.wall["stone-wall"].pictures.single.layers[1].line_length = 2 
data.raw.wall["stone-wall"].pictures.single.layers[1].shift[1] = 0 
data.raw.wall["stone-wall"].pictures.single.layers[1].shift[2] = -0.1875 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.filename = "__base__/graphics/entity/wall/hr-wall-single.png" 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.priority = "extra-high" 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.width = 64 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.height = 86 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.variation_count = 2 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.line_length = 2 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.shift[1] = 0 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.shift[2] = -0.15625 
data.raw.wall["stone-wall"].pictures.single.layers[1].hr_version.scale = 0.5 
data.raw.wall["stone-wall"].pictures.single.layers[2].filename = "__base__/graphics/entity/wall/wall-single-shadow.png" 
data.raw.wall["stone-wall"].pictures.single.layers[2].priority = "extra-high" 
data.raw.wall["stone-wall"].pictures.single.layers[2].width = 50 
data.raw.wall["stone-wall"].pictures.single.layers[2].height = 32 
data.raw.wall["stone-wall"].pictures.single.layers[2].repeat_count = 2 
data.raw.wall["stone-wall"].pictures.single.layers[2].shift[1] = 0.3125 
data.raw.wall["stone-wall"].pictures.single.layers[2].shift[2] = 0.5 
data.raw.wall["stone-wall"].pictures.single.layers[2].draw_as_shadow = true 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.filename = "__base__/graphics/entity/wall/hr-wall-single-shadow.png" 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.priority = "extra-high" 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.width = 98 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.height = 60 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.repeat_count = 2 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.shift[1] = 0.3125 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.shift[2] = 0.53125 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.draw_as_shadow = true 
data.raw.wall["stone-wall"].pictures.single.layers[2].hr_version.scale = 0.5 
The same for

Code: Select all

data.raw.wall["stone-wall"].pictures.straight_vertical
data.raw.wall["stone-wall"].pictures.straight_horizontal
data.raw.wall["stone-wall"].pictures.corner_right_down
data.raw.wall["stone-wall"].pictures.corner_left_down
data.raw.wall["stone-wall"].pictures.t_up
data.raw.wall["stone-wall"].pictures.ending_right
data.raw.wall["stone-wall"].pictures.ending_left
data.raw.wall["stone-wall"].pictures.filling
data.raw.wall["stone-wall"].pictures.water_connection_patch
data.raw.wall["stone-wall"].pictures.gate_connection_patch

Hiladdar
Fast Inserter
Fast Inserter
Posts: 125
Joined: Mon May 14, 2018 6:47 pm
Contact:

Re: changing a texture of a wall

Post by Hiladdar »

What the others wrote before me is spot on.

Only thing I would like to add, is this: If all you are modifying is the skin, then there is no need to edit the ...shadow.png files. If you want, you can improve on the resolution of the graphic, then you will need to edit some of the attributes which define your graphic file within .lua. If you want to change the shape, height or width of a wall, then you will need to come up with a new ...shadow.png files.

Hiladdar

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users