Fixing the Concrete Lamppost

Place to get help with not working mods / modding interface.
Post Reply
AgnotSeeker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat May 16, 2020 4:08 pm
Contact:

Fixing the Concrete Lamppost

Post by AgnotSeeker »

Hey all. I'm trying to fix the Concrete Lamppost. It's been easy up until now. I get the error "/lamppost.lua:19: '}' expected to (close '{' at the line 12) near 'order' stack traceback: ...

This is the code from the control.lua file.

Code: Select all

blank =
 {
      filename = "__Concrete_Lamppost__/graphics/concrete_lamp-sheet.png",
      priority = "extra-high",
      width = 1,
      height = 1
 }


data:extend({

{
    type = "item",
    name = "concrete-lamppost",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    icon_size = 32
    --flags = {"goes-to-quickbar"},
    --subgroup = "energy-pipe-distribution",
    order = "a[energy]-d[concrete-lamp]",
    place_result = "concrete-lamppost",
    stack_size = 50
  },

  {
    type = "item",
    name = "concrete-lamp",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    icon_size = 32
    flags = {"hidden"},
    subgroup = "energy-pipe-distribution",
    order = "a[energy]-d[concrete-lamp]",
    place_result = "concrete-lamp",
    stack_size = 50
  },

  {
    type = "recipe",
    name = "concrete-lamppost",
    enabled = false,
    ingredients =
    {
      {"concrete", 6},
      {"iron-stick", 8},
      {"small-lamp", 1},
      {"copper-cable", 4}
    },
    result = "concrete-lamppost",
    result_count = 1
  },

{
    type = "electric-pole",
    name = "concrete-lamppost",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    flags = {"placeable-neutral", "player-creation"},
    friendly_map_color = {r = 0.4, g = 0.4, b = 0.4, a = 1},
    minable = {hardness = 0.2, mining_time = 0.5, result = "concrete-lamppost"},
    max_health = 180,
    corpse = "small-remnants",
    resistances = 
    {
      {
        type = "impact",
        percent = 90
      },
      {
        type = "fire",
        percent = 100
      },
    },
    collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
    selection_box = {{-0.4, -0.4}, {0.4, 0.4}},
    drawing_box = {{-0.5, -4.0}, {1.5, 0.5}},
    maximum_wire_distance = 16,
    supply_area_distance = 0.5,
    mined_sound = {filename = "__base__/sound/deconstruct-bricks.ogg" },
    vehicle_impact_sound =  {filename = "__base__/sound/car-stone-impact.ogg", volume = 1.0 },
    pictures =
    {
      filename = "__Concrete_Lamppost__/graphics/concrete_lamp-sheet.png",
      priority = "extra-high",
      width = 160,
      height = 160,
      direction_count = 4,
      shift = {0.95, -2.1}
    },
    connection_points =
    {
      {
        shadow =
        {
          copper = {2.7, 0.8},
          red = {2.3, 0.2},
          green = {2.5, 0.2}
        },
        wire =
        {
          copper = {0.3, -3.4},
          red = {-0.2,-2.8},
          green = {0.2,-2.6}
        }
      },
      {
        shadow =
        {
          copper = {2.7, 0.35},
          red = {2.2, -0.0},
          green = {2.4, 0.0}
        },
        wire =
        {
          copper = {0.28, -3.1},
          red = {0.1, -2.8},
          green = {-0.3, -2.6}
        }
      },
      {
        shadow =
        {
          copper = {2.4, 0.1},
          red = {2.3, -0.1},
          green = {2.2, 0.0}
        },
        wire =
        {
          copper = {-0.3, -3.0},
          red = {0.2, -2.6},
          green = {-0.2, -2.8}
        }
      },
      {
        shadow =
        {
          copper = {2.2, -0.1},
          red = {2.2, -0.0},
          green = {2.4, 0.0}
        },
        wire =
        {
          copper = {-0.3, -3.4},
          red = {-0.2, -2.6},
          green = {0.2, -2.8}
        }
      }
    },
    radius_visualisation_picture = blank
  },

  {
    type = "lamp",
    name = "concrete-lamp",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    flags = {"placeable-off-grid", "not-on-map"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "stone-brick"},
    selectable_in_game = false,
    max_health = 55,
    corpse = "small-remnants",
    collision_box = {{-0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{-0.4, -0.4}, {0.4, 0.4}},
    vehicle_impact_sound =  {filename = "__base__/sound/car-stone-impact.ogg", volume = 1.0 },
    energy_source =
    {
      type = "electric",
      usage_priority = "secondary-input"
    },
    energy_usage_per_tick = "5KW",
    light = {intensity = 0.75, size = 35},
    picture_off = blank,    
    picture_on = blank,
    circuit_wire_connection_point =
    {
      shadow =
      {
        red = {0.759375, -0.096875},
        green = {0.759375, -0.096875},
      },
      wire =
      {
        red = {0.30625, -0.39375},
        green = {0.30625, -0.39375},
      }
    },

    circuit_wire_max_distance = 0
  },

{
    type = "technology",
    name = "concrete-lamppost",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp-tech.png",
    icon_size = 128,
    prerequisites = {"optics", "electric-energy-distribution-1", "concrete"},
    effects =
    {
      {
        type = "unlock-recipe",
        recipe = "concrete-lamppost"
      }
    },
    unit =
    {
      count = 100,
      ingredients = {{"science-pack-1", 2},{"science-pack-2", 1}},
      time = 30
    },
    order = "a-h-b"
  },

  })
I'm still new to all this. What is the error here? Thanks for any help in advance!
Last edited by AgnotSeeker on Mon Mar 01, 2021 8:26 pm, edited 1 time in total.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Fixing the Concrete Lamppost

Post by Xorimuth »

Your error and your posted code do not match up. It is complaining about lamppost.lua not control.lua.

The error means that you are missing a '}' in lamppost.lua.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

AgnotSeeker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat May 16, 2020 4:08 pm
Contact:

Re: Fixing the Concrete Lamppost

Post by AgnotSeeker »

My mistake. I've updated the post.

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: Fixing the Concrete Lamppost

Post by DaleStan »

There's a missing comma at the end of lines 16 and 28.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Fixing the Concrete Lamppost

Post by Pi-C »

Code: Select all

data:extend({
{
    type = "item",
    name = "concrete-lamppost",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    icon_size = 32     -- MISSING COMMA!
…
  },

  {
    type = "item",
    name = "concrete-lamp",
    icon = "__Concrete_Lamppost__/graphics/concrete_lamp_icon.png",
    icon_size = 32     -- MISSING COMMA!
…
  },
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

User avatar
jamiechi1
Fast Inserter
Fast Inserter
Posts: 196
Joined: Wed Jan 03, 2018 10:12 pm

Re: Fixing the Concrete Lamppost

Post by jamiechi1 »

I find that using VSCODE for stuff like this is very helpful.

Here are a couple of extensions for Lua:
required: vscode-lua
Optional: Factorio Lua API autocomplete

AgnotSeeker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat May 16, 2020 4:08 pm
Contact:

Re: Fixing the Concrete Lamppost

Post by AgnotSeeker »

For anyone that is interested, teemu has updated and ported this mod to Factorio 1.0. It can be used in 1.1 simply by updating the info.json file to Factorio 1.1.

Here's the link to the updated mod of Concrete Lamppost: https://mods.factorio.com/mod/Concrete_Lamppost_updated

Post Reply

Return to “Modding help”