[SOLVED]Assign entity ID error

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

[SOLVED]Assign entity ID error

Post by Brownie »

I can't find where iv'e gone wrong :/

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

          }

        }

      }

    }

  }
  
)
Last edited by Brownie on Thu Mar 31, 2016 6:58 pm, edited 1 time in total.
Hello, Thanks, Goodbye

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Assign entity ID error

Post by prg »

Just throwing that code into a data.lua does not cause an error. What's the problem?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

This is my entity.lua (this is my first mod so i'm not 100% sure of what i'm doing).
Hello, Thanks, Goodbye

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: Assign entity ID error

Post by Factorio2016 »

You need to put the whole mod! There must be a recipe, Item, entity!
Check you have it all? Attach the file.
Last edited by Factorio2016 on Thu Mar 31, 2016 4:34 pm, edited 2 times in total.
English is not my native language. Translator.

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

Yes, I have it all, i've checked all the names in all the files and they all match.
Attachments
IronWall_0.1.zip
(75.56 KiB) Downloaded 96 times
Hello, Thanks, Goodbye

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: Assign entity ID error

Post by Factorio2016 »

sorry, can't find why wrong
I'm also new to lua
:(
English is not my native language. Translator.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Assign entity ID error

Post by prg »

You're missing a pair of curly braces around the entity definition.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

Don't worry, thanks for trying at least :P
Hello, Thanks, Goodbye

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

Could you please elaborate at where I should be putting these curly braces, i'm not sure.
Hello, Thanks, Goodbye

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Assign entity ID error

Post by prg »

entity.lua, around the argument to the data:extend() call.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: Assign entity ID error

Post by Factorio2016 »

entity.lua
(
add { at the beginning
and } in the end
)
2)the technology is stone-wall does not exist!
Last edited by Factorio2016 on Thu Mar 31, 2016 5:09 pm, edited 1 time in total.
English is not my native language. Translator.

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

Do you mean like this?

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,
  }

   
Hello, Thanks, Goodbye

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

What should the technology be than, "wall"?
Hello, Thanks, Goodbye

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

Ok, thanks for the help, I just need the technology now, i fixed the other bit.
Hello, Thanks, Goodbye

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: Assign entity ID error

Post by Factorio2016 »

stone-walls
Next you have a problem with graphics! Not enough file!
English is not my native language. Translator.

Brownie
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Mar 30, 2016 8:27 pm
Contact:

Re: Assign entity ID error

Post by Brownie »

It's ok, i've got it, it's stone-walls
Hello, Thanks, Goodbye

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: Assign entity ID error

Post by Factorio2016 »

viewtopic.php?f=25&t=22778
this is not the first attempt :)
difficult Yes? :)
English is not my native language. Translator.

Post Reply

Return to “Modding help”