Types/AttackParameters: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(proper doc)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Basics==
A [[types/table]]. The table is loaded as one of the extensions of [[Types/BaseAttackParameters]], depending on the value of the <code>type</code> key.
Definition of combat actions performed by combat robots, units, turrets and weapons.


 
== type ==
== Mandatory properties ==
=== type ===
'''Type''': [[Types/string]]
'''Type''': [[Types/string]]


Specification of the type. Values are:
Mandatory member. Either "projectile", "beam" or "stream".
    "projectile"
* If this is <code>"projectile"</code>, this table is loaded as a [[Types/ProjectileAttackParameters]],
    "beam"
* if this is <code>"beam"</code>, this table is loaded as a [[Types/BeamAttackParameters]],
    "stream"
* if this is <code>"stream"</code>, this table is loaded as a [[Types/StreamAttackParameters]].
 
===cooldown===
'''Type''': [[Types/int]]
 
Interval between consecutive attacks.
 
=== range ===
'''Type''': [[Types/double]]
 
Distance of attack. Overrides one defined in ammo.
 
== Semi-mandatory properties ==
Depending on actual type of entity the following might or might not be needed.
 
=== ammo_category ===
'''Type''': [[Prototype/AmmoCategory]]
 
Mandatory for [[Prototype/Gun]] and [[Prototype/AmmoTurret]].
Describes which ammo should be used in attack.
 
=== ammo_type ===
'''Type''': [[Types/AmmoType]]
 
Mandatory for [[Prototype/ElectricTurret]], [[Prototype/CombatRobot]] and [[Prototype/Unit]].
Defines the ammo entities of those types use when attacking.
 
== Optional properties ==
=== projectile_center ===
'''Type''': [[Types/Position]]
 
=== projectile_creation_distance ===
'''Type''': [[Types/double]]
 
Distance from the attacking entity, at which effects of ammo are applied (source_effects).
 
=== damage_modifier ===
'''Type''': [[Types/double]]
 
Provides damage multiplier for[[Prototype/Gun]] and [[Prototype/AmmoTurret]].
 
=== sound ===
'''Type''': [[Lua/table]]
 
Sound the entity emits when it attacks.
Table fields:
Filename [[Types/FileName]]
volume [[Types/double]]

Latest revision as of 10:30, 11 February 2019

A types/table. The table is loaded as one of the extensions of Types/BaseAttackParameters, depending on the value of the type key.

type

Type: Types/string

Mandatory member. Either "projectile", "beam" or "stream".