Changing Item Picture

Place to get help with not working mods / modding interface.
KTobias
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Nov 27, 2015 5:03 am
Contact:

Changing Item Picture

Post by KTobias »

I'd like to change the default base item picture (icon) to one that i have created without removing the original base picture. Is it possible to have a mod do so and if so, how?
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Changing Item Picture

Post by prg »

In data-updates.lua:

Code: Select all

data.raw.item["iron-plate"].icon = "__yourmod__/graphics/new.png"
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
KTobias
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Nov 27, 2015 5:03 am
Contact:

Re: Changing Item Picture

Post by KTobias »

So here's what i have for the code to change the icon picture of the iron-axe. This is in the data-updates.lua.

data.raw.mining-tools["iron-axe"].icon = "__DSD__/graphics/axes/iron-axe.png"

But I get this error.

__DSD__/data-updates.lua:1: syntax error near '-'

Any ideas?
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Changing Item Picture

Post by prg »

You need to use the square bracket syntax for element names containing punctuation and such. Also, it's just mining-tool.

Code: Select all

data.raw["mining-tool"]["iron-axe"].icon = "__DSD__/graphics/axes/iron-axe.png"
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
KTobias
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Nov 27, 2015 5:03 am
Contact:

Re: Changing Item Picture

Post by KTobias »

Yes,

That worked.

Thanks prg
Post Reply

Return to “Modding help”