Types/AmmoType: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (fixed link)
m (link formatting)
 
(7 intermediate revisions by 4 users not shown)
Line 3: Line 3:


== Mandatory properties ==
== Mandatory properties ==
=== category ===
=== category ===
'''Type''': [[Prototype/AmmoCategory]]
'''Type''': [[Types/string]]
Defines whether the attack will be affected by upgrades.
 
Name of a [[Prototype/AmmoCategory]]. Defines whether the attack will be affected by upgrades.


== Optional properties ==
== Optional properties ==
== action ==
 
'''Type''': [[Types/table]] of [[Prototype/Action]]
=== action ===
'''Type''': [[Types/Trigger]]


Describes actions taken upon attack happening.
Describes actions taken upon attack happening.
=== clamp_position ===
'''Type''': [[Types/bool]]
'''Default''': false
When true, the gun will be able to shoot even when the target is out of range. Only applies when target_type is position. The gun will fire at the maximum range in the direction of the target position. Defaults to false.
=== energy_consumption ===
'''Type''': [[Types/Energy]]
Energy consumption of a single shot, if applicable.
=== range_modifier ===
'''Type''': [[Types/double]]
'''Default''': 1
Affects the <code>range</code> value of the shooting gun prototype's [[Types/BaseAttackParameters]] to give a modified maximum range. The <code>min_range</code> value of the gun is unaffected.
This has no effect on artillery turrets and wagons even though the bonus appears in the GUI.[https://forums.factorio.com/103658]
=== cooldown_modifier ===
'''Type''': [[Types/double]]
'''Default''': 1
=== consumption_modifier ===
'''Type''': [[Types/float]]
'''Default''': 1
=== target_type ===
'''Type''': [[Types/string]]
'''Default''': "entity"
Either "entity", "position" or "direction". If this is "entity", <code>clamp_position</code> is forced to be false.
"entity" fires at an entity, "position" fires directly at a position, "direction" fires in a direction.

Latest revision as of 15:15, 21 October 2022

Basics

Definition of actual parameters used in attack.

Mandatory properties

category

Type: Types/string

Name of a Prototype/AmmoCategory. Defines whether the attack will be affected by upgrades.

Optional properties

action

Type: Types/Trigger

Describes actions taken upon attack happening.

clamp_position

Type: Types/bool

Default: false

When true, the gun will be able to shoot even when the target is out of range. Only applies when target_type is position. The gun will fire at the maximum range in the direction of the target position. Defaults to false.

energy_consumption

Type: Types/Energy

Energy consumption of a single shot, if applicable.

range_modifier

Type: Types/double

Default: 1

Affects the range value of the shooting gun prototype's Types/BaseAttackParameters to give a modified maximum range. The min_range value of the gun is unaffected.

This has no effect on artillery turrets and wagons even though the bonus appears in the GUI.[1]

cooldown_modifier

Type: Types/double

Default: 1

consumption_modifier

Type: Types/float

Default: 1

target_type

Type: Types/string

Default: "entity"

Either "entity", "position" or "direction". If this is "entity", clamp_position is forced to be false. "entity" fires at an entity, "position" fires directly at a position, "direction" fires in a direction.