Prototype/Turret

From Official Factorio Wiki
Jump to navigation Jump to search

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/TurretPrototype.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.


Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/EntityWithHealth » Prototype/EntityWithOwner » Prototype/Turret


A turret that needs no extra ammunition. See the extensions for turrets that need some kind of ammunition.


Prototype/Turret — turret
attack_parameters::AttackParameters
call_for_help_radius::double
folded_animation::RotatedAnimation4Way
alert_when_attacking::bool (optional)
allow_turning_when_starting_attack::bool (optional)
attack_from_start_frame::bool (optional)
attack_target_mask::TriggerTargetMask (optional)
attacking_animation::RotatedAnimation4Way (optional)
attacking_speed::float (optional)
base_picture::Animation4Way (optional)
base_picture_render_layer::RenderLayer (optional)
base_picture_secondary_draw_order::uint8 (optional)
corpse::string (optional)
dying_sound::Sound (optional)
ending_attack_animation::RotatedAnimation4Way (optional)
ending_attack_speed::float (optional)
energy_glow_animation::RotatedAnimation4Way (optional)
energy_glow_animation_flicker_strength::float (optional)
folded_speed::float (optional)
folded_speed_secondary::float (optional)
folding_animation::RotatedAnimation4Way (optional)
folding_sound::Sound (optional)
folding_speed::float (optional)
glow_light_intensity::float (optional)
gun_animation_render_layer::RenderLayer (optional)
gun_animation_secondary_draw_order::uint8 (optional)
ignore_target_mask::TriggerTargetMask (optional)
integration::Sprite (optional)
prepare_range::double (optional)
prepared_alternative_animation::RotatedAnimation4Way (optional)
prepared_alternative_chance::float (optional)
prepared_alternative_sound::Sound (optional)
prepared_alternative_speed::float (optional)
prepared_alternative_speed_secondary::float (optional)
prepared_animation::RotatedAnimation4Way (optional)
prepared_sound::Sound (optional)
prepared_speed::float (optional)
prepared_speed_secondary::float (optional)
preparing_animation::RotatedAnimation4Way (optional)
preparing_sound::Sound (optional)
preparing_speed::float (optional)
random_animation_offset::bool (optional)
rotation_speed::float (optional)
secondary_animation::bool (optional)
shoot_in_prepare_state::bool (optional)
spawn_decoration::CreateDecorativesTriggerEffectItem or table of CreateDecorativesTriggerEffectItem (optional)
spawn_decorations_on_expansion::bool (optional)
starting_attack_animation::RotatedAnimation4Way (optional)
starting_attack_sound::Sound (optional)
starting_attack_speed::float (optional)
turret_base_has_direction::bool (optional)
Inherited from Prototype/EntityWithOwner
allow_run_time_change_of_is_military_target::bool (optional)
is_military_target::bool (optional)
Inherited from Prototype/EntityWithHealth
alert_when_damaged::bool (optional)
attack_reaction::AttackReaction (optional)
corpse::string or table of strings (optional)
create_ghost_on_death::bool (optional)
damaged_trigger_effect::TriggerEffect (optional)
dying_explosion::ExplosionDefinition or table of ExplosionDefinition (optional)
dying_trigger_effect::TriggerEffect (optional)
healing_per_tick::float (optional)
hide_resistances::bool (optional)
integration_patch::Sprite4Way (optional)
integration_patch_render_layer::RenderLayer (optional)
loot::Loot (optional)
max_health::float (optional)
random_corpse_variation::bool (optional)
repair_sound::Sound (optional)
repair_speed_modifier::float (optional)
resistances::Resistances (optional)
Inherited from Prototype/Entity
icons, icon, icon_size (IconSpecification)::IconSpecification
additional_pastable_entities::table of string (optional)
alert_icon_scale::float (optional)
alert_icon_shift::vector (optional)
allow_copy_paste::bool (optional)
autoplace::AutoplaceSpecification (optional)
build_base_evolution_requirement::double (optional)
build_grid_size::uint8 (optional)
build_sound::Sound (optional)
close_sound::Sound (optional)
collision_box::BoundingBox (optional)
collision_mask::CollisionMask (optional)
created_effect::Trigger (optional)
created_smoke::CreateTrivialSmokeEffectItem (optional)
drawing_box::BoundingBox (optional)
emissions_per_second::double (optional)
enemy_map_color::Color (optional)
fast_replaceable_group::string (optional)
flags::EntityPrototypeFlags (optional)
friendly_map_color::Color (optional)
hit_visualization_box::BoundingBox (optional)
map_color::Color (optional)
map_generator_bounding_box::BoundingBox (optional)
minable::MinableProperties (optional)
mined_sound::Sound (optional)
mining_sound::Sound (optional)
next_upgrade::string (optional)
open_sound::Sound (optional)
placeable_by::ItemToPlace or table of ItemToPlace (optional)
protected_from_tile_building::bool (optional)
radius_visualisation_specification::RadiusVisualisationSpecification (optional)
remains_when_mined::string or table of string (optional)
remove_decoratives::string (optional)
rotated_sound::Sound (optional)
selectable_in_game::bool (optional)
selection_box::BoundingBox (optional)
selection_priority::uint8 (optional)
shooting_cursor_size::double (optional)
sticker_box::BoundingBox (optional)
subgroup::string (optional)
tile_height::uint32 (optional)
tile_width::uint32 (optional)
trigger_target_mask::TriggerTargetMask (optional)
vehicle_impact_sound::Sound (optional)
water_reflection::WaterReflectionDefinition (optional)
working_sound::WorkingSound (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Extensions

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithOwner.

attack_parameters

Type: AttackParameters
Requires ammo_type in attack_parameters unless this is a Prototype/AmmoTurret.

folded_animation

Type: RotatedAnimation4Way

call_for_help_radius

Type: double

Optional properties

corpse

Type: string
The name of an entity. Note that this overrides how EntityWithHealth loads the corpse, forcing it to be a string instead of an array of strings.

attack_target_mask

Type: TriggerTargetMask
Default: all masks

ignore_target_mask

Type: TriggerTargetMask
Default: no masks

shoot_in_prepare_state

Type: bool
Default: false

turret_base_has_direction

Type: bool
Default: false

random_animation_offset

Type: bool
Default: false

secondary_animation

Type: bool
Default: false
Whether the secondary (animation) speeds should always be used.

attack_from_start_frame

Type: bool
Default: false

allow_turning_when_starting_attack

Type: bool
Default: false

base_picture_secondary_draw_order

Type: uint8
Default: 0

gun_animation_secondary_draw_order

Type: uint8
Default: 0

base_picture_render_layer

Type: RenderLayer
Default: "lower-object"

gun_animation_render_layer

Type: RenderLayer
Default: "object"

base_picture

Type: Animation4Way

preparing_animation

Type: RotatedAnimation4Way

prepared_animation

Type: RotatedAnimation4Way

prepared_alternative_animation

Type: RotatedAnimation4Way

starting_attack_animation

Type: RotatedAnimation4Way

attacking_animation

Type: RotatedAnimation4Way

energy_glow_animation

Type: RotatedAnimation4Way

ending_attack_animation

Type: RotatedAnimation4Way

folding_animation

Type: RotatedAnimation4Way

integration

Type: Sprite

glow_light_intensity

Type: float
Default: 0
The intensity of light in the form of energy_glow_animation drawn on top of energy_glow_animation.

energy_glow_animation_flicker_strength

Type: float
Default: 0.2
The range of the flickering of the alpha of energy_glow_animation. Default is range 0.2, so animation alpha can be anywhere between 0.8 and 1.0.

starting_attack_sound

Type: Sound

dying_sound

Type: Sound

preparing_sound

Type: Sound

folding_sound

Type: Sound

prepared_sound

Type: Sound

prepared_alternative_sound

Type: Sound

rotation_speed

Type: float
Default: 1

preparing_speed

Type: float
Default: 1
Controls the speed of the preparing_animation: 1 ÷ preparing_speed = duration of the preparing_animation

folded_speed

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the folded_animation: 1 ÷ folded_speed = duration of the folded_animation

folded_speed_secondary

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the folded_animation: 1 ÷ folded_speed_secondary = duration of the folded_animation

prepared_speed

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the prepared_animation: 1 ÷ prepared_speed = duration of the prepared_animation

prepared_speed_secondary

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the prepared_animation: 1 ÷ prepared_speed_secondary = duration of the prepared_animation

prepared_alternative_speed

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the prepared_alternative_animation: 1 ÷ prepared_alternative_speed = duration of the prepared_alternative_animation

prepared_alternative_speed_secondary

Type: float
Default: 1
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.

Controls the speed of the prepared_alternative_animation: 1 ÷ prepared_alternative_speed_secondary = duration of the prepared_alternative_animation

prepared_alternative_chance

Type: float
Default: 0
The chance for prepared_alternative_animation to be used.

starting_attack_speed

Type: float
Default: 1
Controls the speed of the starting_attack_animation: 1 ÷ starting_attack_speed = duration of the starting_attack_animation

attacking_speed

Type: float
Default: 1
Controls the speed of the attacking_animation: 1 ÷ attacking_speed = duration of the attacking_animation

ending_attack_speed

Type: float
Default: 1
Controls the speed of the ending_attack_animation: 1 ÷ ending_attack_speed = duration of the ending_attack_animation

folding_speed

Type: float
Default: 1
Controls the speed of the folding_animation: 1 ÷ folding_speed = duration of the folding_animation

prepare_range

Type: double
Default: The range defined in the attack_parameters

alert_when_attacking

Type: bool
Default: true

spawn_decorations_on_expansion

Type: bool
Default: false
Whether spawn_decoration should be spawned when enemies expand.

spawn_decoration

Type: CreateDecorativesTriggerEffectItem or table of CreateDecorativesTriggerEffectItem
A single CreateDecorativesTriggerEffectItem or an array of them. Decoratives to be created when the spawner is created by the map generator. Placed when enemies expand if spawn_decorations_on_expansion is set to true.