How to properly add and reference modded graphics?

Place to get help with not working mods / modding interface.
Post Reply
VBMeireles
Inserter
Inserter
Posts: 23
Joined: Mon Aug 11, 2014 1:34 pm
Contact:

How to properly add and reference modded graphics?

Post by VBMeireles »

Code: Select all

data:extend(
{
  {
    type = "mining-tool",
    name = "power-axe",
    icon = "__base__/graphics/icons/power-axe.png",
    flags = {"goes-to-main-inventory"},
    action =
    {
      type="direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
            type = "damage",
            damage = { amount = 20 , type = "physical"}
        }
      }
    },
    durability = 20000,
    subgroup = "tool",
    order = "a[mining]-a[power-axe]",
    speed = 8,
    stack_size = 50
  }
}
)
Where should I put my power-axe.png file (somewhere in my mod folder I suppose?) and how should I reference it in the code to make it a properly modded graphic (and not a hack)?

FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: How to properly add and reference modded graphics?

Post by FishSandwich »

Let's say for example your mod is called Poweraxe. So make a folder called Poweaxe in your mod folder. Inside that folder you'll want a folder called graphics. Inside the graphics folder another folder called icons. Inside that folder put your power-axe.png

Then edit one line like this:
icon = "__Poweraxe__/graphics/icons/power-axe.png",

Obviously there are more steps than that, but I'm not sure how much help you need.

VBMeireles
Inserter
Inserter
Posts: 23
Joined: Mon Aug 11, 2014 1:34 pm
Contact:

Re: How to properly add and reference modded graphics?

Post by VBMeireles »

Thanks! That's what I needed to know.

I had some trouble using capitalized words for my mod's name but then I got it to work after switching back to lower case letters only.

Post Reply

Return to “Modding help”