Prototype/ResourceEntity: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Removed old prototype docs)
Tag: Replaced
 
(25 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/ResourceEntityPrototype.html https://lua-api.factorio.com/latest/prototypes/ResourceEntityPrototype.html]
A mineable/gatherable entity. An extension of [[Prototype/Entity]].
==Properties==
===category===
'''Type''': [[Types/string]]


The category for the resource.
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
  category = "basic-fluid"
===infinite===
'''Type''': [[Types/bool]]
 
If the ore is infinitely minable, or if it will eventually run out of resource.
===highlight===
'''Type''': [[Types/bool]]
 
If the ore appears on the map overview separately from large ore veins, or not. Default is False.
===infinite_depletion_amount===
'''Type''': [[Types/unsigned]]
 
''Every time an infinite-type resource "ticks" lower it's lowered by that amount. If not given, it defaults to 1.'' -- [https://forums.factorio.com/viewtopic.php?t=47093&p=271243#p271115 Rsending 91]
 
===resource_patch_search_radius===
'''Type''': [[Types/unsigned]]
===autoplace===
'''Type''': [[Types/AutoplaceSpecification]]
 
If -and how- the ore spawns automatically, and randomly.
===map_color===
'''Type''': [[Types/color]]
 
The color of the ore, on the map.
 
  map_color = {r=0, g=1, b=1} --This is Cyan.
===map_grid===
'''Type''': [[Types/bool]]
 
===stage_counts===
'''Type''': [[Types/table]]
 
see: [[Types/Stages]]
===stages===
'''Type''': [[Types/Stages]]
 
Entity's graphics, using a graphic sheet, with variation and depletion.
 
==example==
  {
    {
    type = "resource",
    name = "crude-oil",
    icon = "__base__/graphics/icons/crude-oil.png",
    flags = {"placeable-neutral"},
    category = "basic-fluid",
    order="a-b-a",
    infinite = true,
    highlight = true,
    minimum = 60000,
    normal = 300000,
    infinite_depletion_amount = 10,
    resource_patch_search_radius = 12,
    minable =
    {
      hardness = 1,
      mining_time = 1,
      results =
      {
        {
          type = "fluid",
          name = "crude-oil",
          amount_min = 10,
          amount_max = 10,
          probability = 1
        }
      }
    },
    collision_box = {{ -1.4, -1.4}, {1.4, 1.4}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace =
    {
      control = "crude-oil",
      sharpness = 0.99,
      max_probability = 0.02,
      richness_base = 240000,
      richness_multiplier = 300000,
      richness_multiplier_distance_bonus = 3000,
      coverage = 0.02, -- Cover on average 2% of surface area.
      peaks =
      {
        {
          noise_layer = "crude-oil",
          noise_octaves_difference = -1,
          noise_persistence = 0.4,
        }
      }
    },
    stage_counts = {0},
    stages =
    {
      sheet =
      {
        filename = "__base__/graphics/entity/crude-oil/crude-oil.png",
        priority = "extra-high",
        width = 75,
        height = 61,
        frame_count = 4,
        variation_count = 1
      }
    },
    map_color = {r=0.78, g=0.2, b=0.77},
    map_grid = false
  },

Latest revision as of 14:33, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/ResourceEntityPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.