MODの作り方/壁の作り方

Last-modified: 2016-05-31 (火) 19:57:33
このページは編集中です。情報が間違っている可能性があります
Version0.12.34現在の情報です

ソース

data:extend({
{
   type = "wall",
   name = "fence",
   icon = "__testmod__/graphics/icons/fence.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 = 0.5, result = "fence"},
   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" },
   resistances =
   {
     {
       type = "physical",
       decrease = 5,
       percent = 50
     },
     {
       type = "impact",
       decrease = 45,
       percent = 60
     },
     {
       type = "explosion",
       decrease = 8,
       percent = 20
     },
     {
       type = "fire",
       percent = 90
     },
     {
       type = "laser",
       percent = 70
     }
   },
   pictures =
   {
     single =
     {
       layers =
       {
         {
           filename = "__testmod__/graphics/entity/fence/single.png",
           priority = "extra-high",
           width = 22,
           height = 42,
           shift = {0, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/single-shadow.png",
           priority = "extra-high",
           width = 47,
           height = 32,
           shift = {0.359375, 0.5},
           draw_as_shadow = true
         }
       }
     },
     straight_vertical =
     {
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-1.png",
             priority = "extra-high",
             width = 22,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-shadow.png",
             priority = "extra-high",
             width = 47,
             height = 60,
             shift = {0.390625, 0.625},
             draw_as_shadow = true
           }
         }
       },
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-2.png",
             priority = "extra-high",
             width = 22,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-shadow.png",
             priority = "extra-high",
             width = 47,
             height = 60,
             shift = {0.390625, 0.625},
             draw_as_shadow = true
           }
         }
       },
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-3.png",
             priority = "extra-high",
             width = 22,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/straight-vertical-shadow.png",
             priority = "extra-high",
             width = 47,
             height = 60,
             shift = {0.390625, 0.625},
             draw_as_shadow = true
           }
         }
       }
     },
     straight_horizontal =
     {
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-horizontal-1.png",
             priority = "extra-high",
             width = 32,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/straight-horizontal-shadow.png",
             priority = "extra-high",
             width = 59,
             height = 32,
             shift = {0.421875, 0.5},
             draw_as_shadow = true
           }
         }
       },
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-horizontal-2.png",
             priority = "extra-high",
             width = 32,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/straight-horizontal-shadow.png",
             priority = "extra-high",
             width = 59,
             height = 32,
             shift = {0.421875, 0.5},
             draw_as_shadow = true
           }
         }
       },
       {
         layers =
         {
           {
             filename = "__testmod__/graphics/entity/fence/straight-horizontal-3.png",
             priority = "extra-high",
             width = 32,
             height = 42,
             shift = {0, -0.15625}
           },
           {
             filename = "__testmod__/graphics/entity/fence/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 = "__testmod__/graphics/entity/fence/corner-right-down.png",
           priority = "extra-high",
           width = 27,
           height = 42,
           shift = {0.078125, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/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 = "__testmod__/graphics/entity/fence/corner-left-down.png",
           priority = "extra-high",
           width = 27,
           height = 42,
           shift = {-0.078125, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/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 = "__testmod__/graphics/entity/fence/t-down.png",
           priority = "extra-high",
           width = 32,
           height = 42,
           shift = {0, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/t-down-shadow.png",
           priority = "extra-high",
           width = 71,
           height = 61,
           shift = {0.546875, 0.640625},
           draw_as_shadow = true
         }
       }
     },
     ending_right =
     {
       layers =
       {
         {
           filename = "__testmod__/graphics/entity/fence/ending-right.png",
           priority = "extra-high",
           width = 27,
           height = 42,
           shift = {0.078125, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/ending-right-shadow.png",
           priority = "extra-high",
           width = 53,
           height = 32,
           shift = {0.484375, 0.5},
           draw_as_shadow = true
         }
       }
     },
     ending_left =
     {
       layers =
       {
         {
           filename = "__testmod__/graphics/entity/fence/ending-left.png",
           priority = "extra-high",
           width = 27,
           height = 42,
           shift = {-0.078125, -0.15625}
         },
         {
           filename = "__testmod__/graphics/entity/fence/ending-left-shadow.png",
           priority = "extra-high",
           width = 53,
           height = 32,
           shift = {0.328125, 0.5},
           draw_as_shadow = true
         }
       }
     }
   }
 }
})

解説

Entity

  • type
  • name
  • icon
  • flags
    • placeable-neutral
    • player-creation
  • collision_box
  • selection_box
  • minable
    • mining_time
    • result
  • fast_replaceable_group