How to add chest?

Place to get help with not working mods / modding interface.
Post Reply
SPolygon
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jan 02, 2016 8:22 pm
Contact:

How to add chest?

Post by SPolygon »

OK, so I was looking for some tutorials on how to make mods, add entities etc etc, but, well, either I am idiot or theese tutorials are too complicated. They tell me how to make cars, entities, something that change game mechanics, but I want to do only one thing; add CHEST. Yea, nothing complicated. So please, can anyone post me some sort of code or simple tut how to add new chest with custom amount of inventory slots? You don't have to explain it too much, my methods of reverse engineering are good enough.
Thanks.

EDIT: I know there are tutorials, but I don't need that many knowledge, I just want chest :(

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

Re: How to add chest?

Post by Klonan »

You'll need a lua definition that looks something like this:

Code: Select all

data:extend({

{
    type = "item",
    name = "your-chest",
    icon = "__base__/graphics/icons/steel-chest.png",
    flags = {"goes-to-quickbar"},
    subgroup = "storage",
    order = "a[items]-g[your-chest]",
    place_result = "your-chest",
    stack_size = 50
  },

  {
    type = "recipe",
    name = "your-chest",
    enabled = true,
    ingredients = {{"plastic-bar", 8}},
    result = "your-chest"
  },

{
    type = "container",
    name = "your-chest",
    icon = "__base__/graphics/icons/steel-chest.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 1, result = "your-chest"},
    max_health = 200,
    corpse = "small-remnants",
    open_sound = { filename = "__base__/sound/metallic-chest-open.ogg", volume=0.65 },
    close_sound = { filename = "__base__/sound/metallic-chest-close.ogg", volume = 0.7 },
    resistances =
    {
      {
        type = "fire",
        percent = 90
      }
    },
    collision_box = {{-0.35, -0.35}, {0.35, 0.35}},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    fast_replaceable_group = "container",
    inventory_size = 48,
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    picture =
    {
      filename = "__base__/graphics/entity/steel-chest/steel-chest.png",
      priority = "extra-high",
      width = 48,
      height = 34,
      shift = {0.2, 0}
    }
  }

})
I'll leave adding technology as an exercise for the reader ;)

SPolygon
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jan 02, 2016 8:22 pm
Contact:

Re: How to add chest?

Post by SPolygon »

Oh thanks, I'll build you memorial in my living room ad I'll pray to it every day. ;)

EDIT: sounds more creepy than I planned

Post Reply

Return to “Modding help”