Adding Tiles

Place to get help with not working mods / modding interface.
VirBinarus
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Feb 15, 2016 9:44 pm
Contact:

Adding Tiles

Post by VirBinarus »

Hello, I'm relatively new to modding factorio. I'm trying to add another tile, to act like concrete, but is not craftable or destroyable.

mod_name\prototypes\tile\tile.lua:

Code: Select all

data:extend(
  {
    {
      type = "tile",
      name = "New-Concrete-path",
      needs_correction = false,
      minable = {hardness = 0.2, mining_time = 0.5, result = "concrete"},
      mined_sound = { filename = "__base__/sound/deconstruct-bricks.ogg" },
      collision_mask = {"ground-tile"},
      walking_speed_modifier = 1.4,
      layer = 62,
      decorative_removal_probability = 0.9,
      variants =
      {
        main =
        {
          {
            picture = "__base__/graphics/terrain/concrete/concrete1.png",
            count = 16,
            size = 1
          },
          {
            picture = "__base__/graphics/terrain/concrete/concrete2.png",
            count = 4,
            size = 2,
            probability = 0.39,
          },
          {
            picture = "__base__/graphics/terrain/concrete/concrete4.png",
            count = 4,
            size = 4,
            probability = 1,
          },
        },
        inner_corner =
        {
          picture = "__base__/graphics/terrain/concrete/concrete-inner-corner.png",
          count = 8
        },
        outer_corner =
        {
          picture = "__base__/graphics/terrain/concrete/concrete-outer-corner.png",
          count = 8
        },
        side =
        {
          picture = "__base__/graphics/terrain/concrete/concrete-side.png",
          count = 8
        },
        u_transition =
        {
          picture = "__base__/graphics/terrain/concrete/concrete-u.png",
          count = 8
        },
        o_transition =
        {
          picture = "__base__/graphics/terrain/concrete/concrete-o.png",
          count = 1
        }
      },
      walking_sound =
      {
        {
          filename = "__base__/sound/walking/concrete-01.ogg",
          volume = 1.2
        },
        {
          filename = "__base__/sound/walking/concrete-02.ogg",
          volume = 1.2
        },
        {
          filename = "__base__/sound/walking/concrete-03.ogg",
          volume = 1.2
        },
        {
          filename = "__base__/sound/walking/concrete-04.ogg",
          volume = 1.2
        }
      },
      map_color={r=200, g=200, b=200},
      ageing=0,
      vehicle_friction_modifier = concrete_vehicle_speed_modifier
    }
  })
For testing purposes, I am still using the concrete texture, and sounds etc. When I went on to factorio, and opened up the map editor however, there was no second concrete icon there. any help?

EDIT: Just in case it wasn't clear, that is pretty much ALL I've done with this mod (except for info.json) so I bet I probrably missed something out there.
Last edited by VirBinarus on Mon Feb 15, 2016 10:09 pm, edited 1 time in total.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Adding Tiles

Post by Arch666Angel »

You have defined the "tile" that is already on the ground, you need also to create the actual "item" that is held in hand, which has to have a special flag so it can be placed on the ground as a tile.

VirBinarus
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Feb 15, 2016 9:44 pm
Contact:

Re: Adding Tiles

Post by VirBinarus »

Arch666Angel wrote:You have defined the "tile" that is already on the ground, you need also to create the actual "item" that is held in hand, which has to have a special flag so it can be placed on the ground as a tile.
I'm not trying to make something that the player can place in-game, I'm just making a tile, like sand for instance, that I can paint with in the map editor (like below). I don't need it ever held in hand.
Image

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5243
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Adding Tiles

Post by Klonan »

you need a data.lua to define what to require, which is just literally

Code: Select all

require prototypes\tile\tile

Post Reply

Return to “Modding help”