Prototype/Lamp: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(A page for the Lamp Prototype Definition.)
 
(Removed old prototype docs)
Tag: Replaced
 
(16 intermediate revisions by 3 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/LampPrototype.html https://lua-api.factorio.com/latest/prototypes/LampPrototype.html]
A lamp to provide light, using energy. Based on [[Prototype/EntityWithHealth]].


== Usage in base ==
</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>
* [[Lamp]]
 
== Properties ==
 
=== energy_source ===
Type: [[Types/EnergySource]]
 
The type of energy the lamp uses.
 
=== energy_usage ===
Type: [[Types/EnergyUsage]]
 
The amount of energy the lamp uses.
 
=== light ===
Type: [[Types/Light]]
 
What color the lamp will be when it is on, and receiving power.
 
=== light_when_colored ===
Type: [[Types/Light]]
 
This refers to when the light is in a Circuit Network, and is lit a certain color based on a Circuit value.
 
=== picture_on ===
Type: [[Types/Sprite]]
 
The lamp's entity if it's on.
 
=== picture_off ===
Type: [[Types/Sprite]]
 
The lamp's entity if it's off.
 
==Example==
  {
    type = "lamp",
    name = "small-lamp",
    icon = "__base__/graphics/icons/small-lamp.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "small-lamp"},
    max_health = 100,
    corpse = "small-remnants",
    collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    energy_source =
    {
      type = "electric",
      usage_priority = "secondary-input"
    },
    energy_usage_per_tick = "5KW",
    light = {intensity = 0.9, size = 40, color = {r=1.0, g=1.0, b=1.0}},
    light_when_colored = {intensity = 1, size = 6, color = {r=1.0, g=1.0, b=1.0}},
    glow_size = 6,
    glow_color_intensity = 0.135,
    picture_off =
    {
      filename = "__base__/graphics/entity/small-lamp/light-off.png",
      priority = "high",
      width = 67,
      height = 58,
      frame_count = 1,
      axially_symmetrical = false,
      direction_count = 1,
      shift = {-0.015625, 0.15625},
    },
    picture_on =
    {
      filename = "__base__/graphics/entity/small-lamp/light-on-patch.png",
      priority = "high",
      width = 62,
      height = 62,
      frame_count = 1,
      axially_symmetrical = false,
      direction_count = 1,
      shift = {-0.03125, -0.03125},
    },

Latest revision as of 14:32, 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/LampPrototype.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.