Could someone tell me what this error means?

Place to get help with not working mods / modding interface.
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Could someone tell me what this error means?

Post by YoloJoe »

I'm trying to make my own walls and I used the stone-wall code and replaced the textures. I have put it in item.lua and made a recipe for it. Its a huge ass error, but I guess there is just one small thing that could fix it.. :?:

Image

I'll post the code to just in case:

Code: Select all

data:extend({
  {

{
    type = "wall",
    name = "wooden-wall",
    icon = "__Zofg-Mod__/graphics/WoodenWall/woodenwall-icon.png",
    flags = {"placeable-neutral", "player-creation"},
    collision_box = {{-0.29, -0.29}, {0.29, 0.29}},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    minable = {mining_time = 1, result = "wooden-wall"},
    fast_replaceable_group = "wall",
    max_health = 350,
    repair_speed_modifier = 2,
    corpse = "wall-remnants",
    repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
    mined_sound = { filename = "__base__/sound/deconstruct-bricks.ogg" },
    vehicle_impact_sound =  { filename = "__base__/sound/car-stone-impact.ogg", volume = 1.0 },
    
    resistances =
    {
      {
        type = "physical",
        decrease = 3,
        percent = 20
      },
      {
        type = "impact",
        decrease = 45,
        percent = 60
      },
      {
        type = "explosion",
        decrease = 10,
        percent = 30
      },
      {
        type = "fire",
        percent = 100
      },
      {
        type = "laser",
        percent = 70
      }
    },
    pictures =
    {
      single =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wood-single.png",
            priority = "extra-high",
            width = 22,
            height = 42,
            shift = {0, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-single-shadow.png",
            priority = "extra-high",
            width = 47,
            height = 32,
            shift = {0.359375, 0.5},
            draw_as_shadow = true
          }
        }
      },
      straight_vertical =
      {
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-single.png",
              priority = "extra-high",
              width = 22,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-vertical-shadow.png",
              priority = "extra-high",
              width = 47,
              height = 60,
              shift = {0.390625, 0.625},
              draw_as_shadow = true
            }
          }
        },
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-single.png",
              priority = "extra-high",
              width = 22,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-vertical-shadow.png",
              priority = "extra-high",
              width = 47,
              height = 60,
              shift = {0.390625, 0.625},
              draw_as_shadow = true
            }
          }
        },
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-single.png",
              priority = "extra-high",
              width = 22,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-vertical-shadow.png",
              priority = "extra-high",
              width = 47,
              height = 60,
              shift = {0.390625, 0.625},
              draw_as_shadow = true
            }
          }
        }
      },
      straight_horizontal =
      {
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-wall01.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-horizontal-shadow.png",
              priority = "extra-high",
              width = 59,
              height = 32,
              shift = {0.421875, 0.5},
              draw_as_shadow = true
            }
          }
        },
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-wall02.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-horizontal-shadow.png",
              priority = "extra-high",
              width = 59,
              height = 32,
              shift = {0.421875, 0.5},
              draw_as_shadow = true
            }
          }
        },
        {
          layers =
          {
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wood-wall02.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}
            },
            {
              filename = "__Zofg-Mod__/graphics/WoodenWall/wall-straight-horizontal-shadow.png",
              priority = "extra-high",
              width = 59,
              height = 32,
              shift = {0.421875, 0.5},
              draw_as_shadow = true
            }
          }
        }
      },
      corner_right_down =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/woodenwall-corner-right-down.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {0.078125, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-corner-right-down-shadow.png",
            priority = "extra-high",
            width = 53,
            height = 61,
            shift = {0.484375, 0.640625},
            draw_as_shadow = true
          }
        }
      },
      corner_left_down =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/woodenwall-corner-left-down.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {-0.078125, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-corner-left-down-shadow.png",
            priority = "extra-high",
            width = 53,
            height = 60,
            shift = {0.328125, 0.640625},
            draw_as_shadow = true
          }
        }
      },
      t_up =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wood-wall-T.png",
            priority = "extra-high",
            width = 32,
            height = 42,
            shift = {0, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-t-down-shadow.png",
            priority = "extra-high",
            width = 71,
            height = 61,
            shift = {0.546875, 0.640625},
            draw_as_shadow = true
          }
        }
      },
      ending_right =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/woodenwall-ending-right.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {0.078125, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-ending-right-shadow.png",
            priority = "extra-high",
            width = 53,
            height = 32,
            shift = {0.484375, 0.5},
            draw_as_shadow = true
          }
        }
      },
      ending_left =
      {
        layers =
        {
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/woodenwall-ending-left.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {-0.078125, -0.15625}
          },
          {
            filename = "__Zofg-Mod__/graphics/WoodenWall/wall-ending-left-shadow.png",
            priority = "extra-high",
            width = 53,
            height = 32,
            shift = {0.328125, 0.5},
            draw_as_shadow = true
          }
        }
      }
    }
  },
}
})
Any help would be appreciated as always :)
slindenau
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Fri Mar 25, 2016 1:46 pm
Contact:

Re: Could someone tell me what this error means?

Post by slindenau »

The function "data:extend" requires a table of prototypes (1..n).

So something like this:

Code: Select all

data:extend (
 {
   {proto1},
   {proto2}
 }
)
Or just 1 prototype:

Code: Select all

data:extend (
 {
   {proto1}
 }
)
What you have right now:

Code: Select all

data:extend(
 {
  {
    {proto},
  }
 }
)
You need to clean up your code structure. Using something like Notepad++ which has code highlighting and block folding support for LUA can help with this.
My mod: "Auto Deploy Destroyers" (follower robots) viewtopic.php?f=97&t=24545
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Could someone tell me what this error means?

Post by YoloJoe »

Wow that was embarrassingly easy :shock: Thanks a lot! I'm already using notepad ++, but I never noticed I had an extra set of useless { }... Thanks again man
Post Reply

Return to “Modding help”