Types/LineTriggerItem: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Extends Types/TriggerItem. == Mandatory properties == Inherits all properties from Types/TriggerItem. === range === '''Type''': Types/double === width === '''Ty...")
 
(1.1: Renamed "source_effects" property of line trigger item to "range_effects", due to ambiguity with source_effects on action delivery; added example)
Line 9: Line 9:
=== width ===
=== width ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]
== Optional properties ==
=== range_effects ===
'''Type''': [[Types/TriggerEffect]]
== Example ==
<syntaxhighlight lang="lua">action =
{
  type = "line",
  range = 25,
  width = 0.5,
  range_effects =
  {
    type = "create-explosion",
    entity_name = "railgun-beam"
  },
  action_delivery =
  {
    type = "instant",
    target_effects =
    {
      type = "damage",
      damage = { amount = 100, type = "physical"}
    }
  }
}</syntaxhighlight>

Revision as of 14:16, 26 March 2021

Extends Types/TriggerItem.

Mandatory properties

Inherits all properties from Types/TriggerItem.

range

Type: Types/double

width

Type: Types/double

Optional properties

range_effects

Type: Types/TriggerEffect

Example

action =
{
  type = "line",
  range = 25,
  width = 0.5,

  range_effects =
  {
    type = "create-explosion",
    entity_name = "railgun-beam"
  },

  action_delivery =
  {
    type = "instant",
    target_effects =
    {
      type = "damage",
      damage = { amount = 100, type = "physical"}
    }
  }
}