Page 1 of 1

Adding Tiles

Posted: Mon Feb 15, 2016 9:49 pm
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.

Re: Adding Tiles

Posted: Mon Feb 15, 2016 10:09 pm
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.

Re: Adding Tiles

Posted: Mon Feb 15, 2016 10:12 pm
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

Re: Adding Tiles

Posted: Tue Feb 16, 2016 12:24 am
by Klonan
you need a data.lua to define what to require, which is just literally

Code: Select all

require prototypes\tile\tile