[SOLVED] Missing name or type

Place to get help with not working mods / modding interface.
Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

[SOLVED] Missing name or type

Post by Brownie »

I am trying to make a simple mod that adds in new wall types, starting with iron walls. For some reason my game can't seem to be able to use decrease and percent in the resistances. this is my first mod and the code is taken from other game files with a few of my own bits of work.

Here is my enity.lua.

Code: Select all

data:extend(
 {  
   
    type = "wall",
    name = "iron-wall",
    icon = "__IronWall__/graphics/iron-wall-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 = "iron-wall"},
    fast_replaceable_group = "wall",
    max_health = 500,
    repair_speed_modifier = 4,
    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 = "__IronWall__/graphics/entity/iron-wall/wall-single.png",
         priority = "extra-high",
         width = 22,   
         height = 42,  
         shift = {0, -0.15625}
       }
,   
       {
     
         filename = "__IronWall__/graphics/entity/iron-wall/wall-single-shadow.png",   
         priority = "extra-high",     
         width = 47,     
         height = 32,   
         shift = {0.359375, 0.5},
         draw_as_shadow = true
       }

     }

   },

   straight_vertical =

   {

     {

       layers =
     
       {

         {
 
           filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-vertical-1.png",
           priority = "extra-high",
           width = 22,
           height = 42,
           shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-vertical-shadow.png",
              priority = "extra-high",
              width = 47,
              height = 60,
              shift = {0.390625, 0.625},
              draw_as_shadow = true

            }

          }

        },

        {

          layers =

          {

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-vertical-2.png",
              priority = "extra-high",
              width = 22,
              height = 42,
              shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-vertical-shadow.png",
              priority = "extra-high",
              width = 47,
              height = 60,
              shift = {0.390625, 0.625},
              draw_as_shadow = true

            }
          }

        },

        {

          layers =

         {

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-vertical-3.png",
              priority = "extra-high",
              width = 22,
              height = 42,
              shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-straight-horizontal-1.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-horizontal-shadow.png",
              priority = "extra-high",
              width = 59,
              height = 32,
              shift = {0.421875, 0.5},
              draw_as_shadow = true

            }

          }

        },

        {

          layers =

          {

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-horizontal-2.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-horizontal-shadow.png",
              priority = "extra-high",
              width = 59,
              height = 32,
              shift = {0.421875, 0.5},
              draw_as_shadow = true

            }

          }

        },

        {

          layers =

          {

            {

              filename = "__IronWall__/graphics/entity/iron-wall/wall-straight-horizontal-3.png",
              priority = "extra-high",
              width = 32,
              height = 42,
              shift = {0, -0.15625}

            },

            {

              filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-corner-right-down.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {0.078125, -0.15625}

          },

          {

            filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-corner-left-down.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {-0.078125, -0.15625}

          },

          {

            filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-t-down.png",
            priority = "extra-high",
            width = 32,
            height = 42,
            shift = {0, -0.15625}

          },

          {

            filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-ending-right.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {0.078125, -0.15625}

          },
          {

            filename = "__IronWall__/graphics/entity/iron-wall/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 = "__IronWall__/graphics/entity/iron-wall/wall-ending-left.png",
            priority = "extra-high",
            width = 27,
            height = 42,
            shift = {-0.078125, -0.15625}

          },

          {

            filename = "__IronWall__/graphics/entity/iron-wall/wall-ending-left-shadow.png",
            priority = "extra-high",
            width = 53,
            height = 32,
            shift = {0.328125, 0.5},
            draw_as_shadow = true

          }

        }

      }

    }

  }
)
full error:
Image
Last edited by Brownie on Thu Mar 31, 2016 8:06 pm, edited 1 time in total.
Hello, Thanks, Goodbye
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Missing name or type in the following prototype definition.

Post by DaveMcW »

Code: Select all

    volume = 1.0 },
Delete the extra }
Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Missing name or type in the following prototype definition.

Post by Brownie »

Wow, I can't believe I missed that, oh well, thanks for the help. :D
Hello, Thanks, Goodbye
Post Reply

Return to “Modding help”