Factorio Prototype DocsVersion 2.0.19

LightDefinition :: struct or array[struct] Example code

Specifies a light source. This is loaded either as a single light source or as an array of light sources.

Properties

type optional :: "basic" or "oriented"
picture optional :: Sprite

Only loaded, and mandatory if type is "oriented".

Only loaded, and mandatory if type is "oriented".

rotation_shift optional :: RealOrientation

Only loaded if type is "oriented".

Only loaded if type is "oriented".

intensity :: float

Brightness of the light in the range [0, 1], where 0 is no light and 1 is the maximum light.

Brightness of the light in the range [0, 1], where 0 is no light and 1 is the maximum light.

size :: float

The radius of the light in tiles. [...]

The radius of the light in tiles. [...]

source_orientation_offset optional :: RealOrientation
add_perspective optional :: bool
flicker_interval optional :: uint8
flicker_min_modifier optional :: float
flicker_max_modifier optional :: float
offset_flicker optional :: bool

Offsets tick used to calculate flicker by position hash. [...]

Offsets tick used to calculate flicker by position hash. [...]

shift optional :: Vector
color optional :: Color

Color of the light.

Color of the light.

minimum_darkness optional :: float

Properties

type :: "basic" or "oriented" optional

Default: "basic"

picture :: Sprite optional

Only loaded, and mandatory if type is "oriented".

rotation_shift :: RealOrientation optional

Default: 0

Only loaded if type is "oriented".

intensity :: float

Brightness of the light in the range [0, 1], where 0 is no light and 1 is the maximum light.

size :: float

The radius of the light in tiles. Note that the light gets darker near the edges, so the effective size of the light will appear to be smaller.

source_orientation_offset :: RealOrientation optional

Default: 0

add_perspective :: bool optional

Default: false

flicker_interval :: uint8 optional

Default: 0

flicker_min_modifier :: float optional

Default: 1.0

flicker_max_modifier :: float optional

Default: Value of flicker_min_modifier

offset_flicker :: bool optional

Default: false

Offsets tick used to calculate flicker by position hash. Useful to desynchronize flickering of multiple stationary lights.

shift :: Vector optional

color :: Color optional

Default: {r=1, g=1, b=1}

Color of the light.

minimum_darkness :: float optional

Default: 0

Examples

-- The light of the orange state of the rail signal
orange_light = {intensity = 0.2, size = 4, color={r=1, g=0.5}}
-- The front lights of the car
light =
{
  {
    type = "oriented",
    minimum_darkness = 0.3,
    picture =
    {
      filename = "__core__/graphics/light-cone.png",
      priority = "extra-high",
      flags = { "light" },
      scale = 2,
      width = 200,
      height = 200
    },
    shift = {-0.6, -14},
    size = 2,
    intensity = 0.6,
    color = {r = 0.92, g = 0.77, b = 0.3}
  },
  {
    type = "oriented",
    minimum_darkness = 0.3,
    picture =
    {
      filename = "__core__/graphics/light-cone.png",
      priority = "extra-high",
      flags = { "light" },
      scale = 2,
      width = 200,
      height = 200
    },
    shift = {0.6, -14},
    size = 2,
    intensity = 0.6,
    color = {r = 0.92, g = 0.77, b = 0.3}
  }
}

Type used in

Prototypes

Types

Defines