Prototype/Turret: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Updated styling of prototype doc migration note)
(Removed old prototype docs)
Tag: Replaced
 
Line 2: Line 2:


</p><p>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 [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
</p><p>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 [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
{{Prototype parent|Prototype/EntityWithOwner}}
A turret that needs no extra ammunition. See the extensions for turrets that need some kind of ammunition.
{{Prototype TOC|turret}}
== Extensions ==
* [[Prototype/AmmoTurret]] '''ammo-turret'''
* [[Prototype/ElectricTurret]] '''electric-turret'''
* [[Prototype/FluidTurret]] '''fluid-turret'''
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithOwner]].
{{Prototype property|attack_parameters|[[Types/AttackParameters|AttackParameters]]}}
Requires ammo_type in attack_parameters unless this is a [[Prototype/AmmoTurret]].
{{Prototype property|folded_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]}}
{{Prototype property|call_for_help_radius|[[Types/double|double]]}}
== Optional properties ==
{{Prototype property|corpse|[[Types/string|string]]|optional=true}}
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.
{{Prototype property|attack_target_mask|[[Types/TriggerTargetMask|TriggerTargetMask]]|all masks|optional=true}}
{{Prototype property|ignore_target_mask|[[Types/TriggerTargetMask|TriggerTargetMask]]|no masks|optional=true}}
{{Prototype property|shoot_in_prepare_state|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|turret_base_has_direction|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|random_animation_offset|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|secondary_animation|[[Types/bool|bool]]|false|optional=true}}
Whether the secondary (animation) speeds should always be used.
{{Prototype property|attack_from_start_frame|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|allow_turning_when_starting_attack|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|base_picture_secondary_draw_order|[[Types/uint8|uint8]]|0|optional=true}}
{{Prototype property|gun_animation_secondary_draw_order|[[Types/uint8|uint8]]|0|optional=true}}
{{Prototype property|base_picture_render_layer|[[Types/RenderLayer|RenderLayer]]|"lower-object"|optional=true}}
{{Prototype property|gun_animation_render_layer|[[Types/RenderLayer|RenderLayer]]|"object"|optional=true}}
{{Prototype property|base_picture|[[Types/Animation4Way|Animation4Way]]|optional=true}}
{{Prototype property|preparing_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|prepared_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|prepared_alternative_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|starting_attack_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|attacking_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|energy_glow_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|ending_attack_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|folding_animation|[[Types/RotatedAnimation4Way|RotatedAnimation4Way]]|optional=true}}
{{Prototype property|integration|[[Types/Sprite|Sprite]]|optional=true}}
{{Prototype property|glow_light_intensity|[[Types/float|float]]|0|optional=true}}
The intensity of light in the form of <code>energy_glow_animation</code> drawn on top of <code>energy_glow_animation</code>.
{{Prototype property|energy_glow_animation_flicker_strength|[[Types/float|float]]|0.2|optional=true}}
The range of the flickering of the alpha of <code>energy_glow_animation</code>. Default is range 0.2, so animation alpha can be anywhere between 0.8 and 1.0.
{{Prototype property|starting_attack_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|dying_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|preparing_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|folding_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|prepared_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|prepared_alternative_sound|[[Types/Sound|Sound]]|optional=true}}
{{Prototype property|rotation_speed|[[Types/float|float]]|1|optional=true}}
{{Prototype property|preparing_speed|[[Types/float|float]]|1|optional=true}}
Controls the speed of the preparing_animation:
<code>1 ÷ preparing_speed = duration of the preparing_animation</code>
{{Prototype property|folded_speed|[[Types/float|float]]|1|optional=true}}
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.
Controls the speed of the folded_animation:
<code>1 ÷ folded_speed = duration of the folded_animation</code>
{{Prototype property|folded_speed_secondary|[[Types/float|float]]|1|optional=true}}
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.
Controls the speed of the folded_animation:
<code>1 ÷ folded_speed_secondary = duration of the folded_animation</code>
{{Prototype property|prepared_speed|[[Types/float|float]]|1|optional=true}}
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.
Controls the speed of the prepared_animation:
<code>1 ÷ prepared_speed = duration of the prepared_animation</code>
{{Prototype property|prepared_speed_secondary|[[Types/float|float]]|1|optional=true}}
It's randomized whether a particular turret uses the primary or the secondary speed for its animations.
Controls the speed of the prepared_animation:
<code>1 ÷ prepared_speed_secondary = duration of the prepared_animation</code>
{{Prototype property|prepared_alternative_speed|[[Types/float|float]]|1|optional=true}}
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:
<code>1 ÷ prepared_alternative_speed = duration of the prepared_alternative_animation</code>
{{Prototype property|prepared_alternative_speed_secondary|[[Types/float|float]]|1|optional=true}}
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:
<code>1 ÷ prepared_alternative_speed_secondary = duration of the prepared_alternative_animation</code>
{{Prototype property|prepared_alternative_chance|[[Types/float|float]]|0|optional=true}}
The chance for <code>prepared_alternative_animation</code> to be used.
{{Prototype property|starting_attack_speed|[[Types/float|float]]|1|optional=true}}
Controls the speed of the starting_attack_animation:
<code>1 ÷ starting_attack_speed = duration of the starting_attack_animation</code>
{{Prototype property|attacking_speed|[[Types/float|float]]|1|optional=true}}
Controls the speed of the attacking_animation:
<code>1 ÷ attacking_speed = duration of the attacking_animation</code>
{{Prototype property|ending_attack_speed|[[Types/float|float]]|1|optional=true}}
Controls the speed of the ending_attack_animation:
<code>1 ÷ ending_attack_speed = duration of the ending_attack_animation</code>
{{Prototype property|folding_speed|[[Types/float|float]]|1|optional=true}}
Controls the speed of the folding_animation:
<code>1 ÷ folding_speed = duration of the folding_animation</code>
{{Prototype property|prepare_range|[[Types/double|double]]|The range defined in the <code>attack_parameters</code>|optional=true}}
{{Prototype property|alert_when_attacking|[[Types/bool|bool]]|true|optional=true}}
{{Prototype property|spawn_decorations_on_expansion|[[Types/bool|bool]]|false|optional=true}}
Whether <code>spawn_decoration</code> should be spawned when enemies [[Enemies#Expansions|expand]].
{{Prototype property|spawn_decoration|[[Types/CreateDecorativesTriggerEffectItem|CreateDecorativesTriggerEffectItem]] or [[Types/table|table]] of [[Types/CreateDecorativesTriggerEffectItem|CreateDecorativesTriggerEffectItem]]|optional=true}}
A single [[Types/CreateDecorativesTriggerEffectItem|CreateDecorativesTriggerEffectItem]] or an array of them. Decoratives to be created when the spawner is created by the [[map generator]]. Placed when enemies expand if <code>spawn_decorations_on_expansion</code> is set to true.

Latest revision as of 14:33, 25 October 2024

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.