Prototype/Unit: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Set prototype parent)
(Converted to SMW format)
Line 1: Line 1:
{{Prototype parent|Prototype/EntityWithHealth}}
{{Prototype parent|Prototype/EntityWithHealth}}
Entity that attacks players.


==Basics==
{{Prototype TOC|unit}}
Prototype type: '''unit'''
 
Entity that attacks player based on pollution value. Extends the [[Prototype/EntityWithHealth]]


== Usage in base==
== Usage in base==
Line 12: Line 10:
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].


=== run_animation ===
{{Prototype property|run_animation|[[Types/RotatedAnimation|RotatedAnimation]]}}
'''Type''': [[Types/RotatedAnimation]]
 
=== attack_parameters ===
'''Type''': [[Types/AttackParameters]]


{{Prototype property|attack_parameters|[[Types/AttackParameters|AttackParameters]]}}
Requires animation in attack_parameters. Requires ammo_type in attack_parameters.
Requires animation in attack_parameters. Requires ammo_type in attack_parameters.


=== movement_speed ===
{{Prototype property|movement_speed|[[Types/float|float]]}}
'''Type''': [[Types/float]]
 
Must be equal to or greater than 0.
Must be equal to or greater than 0.


=== distance_per_frame ===
{{Prototype property|distance_per_frame|[[Types/float|float]]}}
'''Type''': [[Types/float]]
 
=== pollution_to_join_attack ===
'''Type''': [[Types/float]]


{{Prototype property|pollution_to_join_attack|[[Types/float|float]]}}
The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.
The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.


=== distraction_cooldown ===
{{Prototype property|distraction_cooldown|[[Types/uint32|uint32]]}}
'''Type''': [[Types/uint32]]
 
=== vision_distance ===
'''Type''': [[Types/double]]


{{Prototype property|vision_distance|[[Types/double|double]]}}
Max is 100.
Max is 100.


Note: Setting to 50 or above can lead to undocumented behavior of individual units creating groups on their own when attacking or being attacked.
Note: Setting to 50 or above can lead to undocumented behavior of individual units creating groups on their own when attacking or being attacked.


=== ai_settings ===
{{Prototype property|ai_settings|[[Types/UnitAISettings|UnitAISettings]]}}
'''Type''': [[Types/UnitAISettings]]


== Optional properties ==
== Optional properties ==


=== rotation_speed ===
{{Prototype property|rotation_speed|[[Types/double|double]]|0.025|optional=true}}
'''Type''': [[Types/double]]
 
'''Default''': 0.025
 
=== dying_sound ===
'''Type''': [[Types/Sound]]


{{Prototype property|dying_sound|[[Types/Sound|Sound]]|optional=true}}
The sound file to play when entity dies.
The sound file to play when entity dies.


=== min_pursue_time ===
{{Prototype property|min_pursue_time|[[Types/uint32|uint32]]|10 * 60|optional=true}}
'''Type''': [[Types/uint32]]
 
'''Default''': 10 * 60
 
=== has_belt_immunity ===
'''Type''': [[Types/bool]]
 
'''Default''': false


{{Prototype property|has_belt_immunity|[[Types/bool|bool]]|false|optional=true}}
If the unit is immune to movement by belts.
If the unit is immune to movement by belts.


=== spawning_time_modifier ===
{{Prototype property|spawning_time_modifier|[[Types/double|double]]|1|optional=true}}
'''Type''': [[Types/double]]
 
'''Default''': 1
 
=== max_pursue_distance ===
'''Type''': [[Types/double]]
 
'''Default''': 50
 
=== radar_range ===
'''Type''': [[Types/uint32]]
 
'''Default''': 0
 
=== move_while_shooting ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== can_open_gates ===
'''Type''': [[Types/bool]]


'''Default''': false
{{Prototype property|max_pursue_distance|[[Types/double|double]]|50|optional=true}}


=== affected_by_tiles ===
{{Prototype property|radar_range|[[Types/uint32|uint32]]|0|optional=true}}
'''Type''': [[Types/bool]]


'''Default''': false
{{Prototype property|move_while_shooting|[[Types/bool|bool]]|false|optional=true}}


=== render_layer ===
{{Prototype property|can_open_gates|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/RenderLayer]]


'''Default''': "object"
{{Prototype property|affected_by_tiles|[[Types/bool|bool]]|false|optional=true}}


=== alternative_attacking_frame_sequence ===
{{Prototype property|render_layer|[[Types/RenderLayer|RenderLayer]]|"object"|optional=true}}
'''Type''': [[Types/table]]


{{Prototype property|alternative_attacking_frame_sequence|[[Types/table|table]]|optional=true}}
Table with the following mandatory properties:
Table with the following mandatory properties:


* warmup_frame_sequence - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* warmup_frame_sequence - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* warmup2_frame_sequence - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* warmup2_frame_sequence - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* attacking_frame_sequence  - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* attacking_frame_sequence  - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* cooldown_frame_sequence - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* cooldown_frame_sequence - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* prepared_frame_sequence - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* prepared_frame_sequence - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* back_to_walk_frame_sequence - Array of [[Types/float]] - Indices of frames from the attack parameter animation.
* back_to_walk_frame_sequence - Array of [[Types/float|float]] - Indices of frames from the attack parameter animation.
* warmup_animation_speed - [[Types/float]]
* warmup_animation_speed - [[Types/float|float]]
* attacking_animation_speed - [[Types/float]]
* attacking_animation_speed - [[Types/float|float]]
* cooldown_animation_speed - [[Types/float]]
* cooldown_animation_speed - [[Types/float|float]]
* prepared_animation_speed - [[Types/float]]
* prepared_animation_speed - [[Types/float|float]]
* back_to_walk_animation_speed - [[Types/float]]
* back_to_walk_animation_speed - [[Types/float|float]]

Revision as of 20:54, 5 August 2019

Template:Prototype parent Entity that attacks players.

Template:Prototype TOC

Usage in base

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithHealth.

Template:Prototype property

Template:Prototype property Requires animation in attack_parameters. Requires ammo_type in attack_parameters.

Template:Prototype property Must be equal to or greater than 0.

Template:Prototype property

Template:Prototype property The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.

Template:Prototype property

Template:Prototype property Max is 100.

Note: Setting to 50 or above can lead to undocumented behavior of individual units creating groups on their own when attacking or being attacked.

Template:Prototype property

Optional properties

Template:Prototype property

Template:Prototype property The sound file to play when entity dies.

Template:Prototype property

Template:Prototype property If the unit is immune to movement by belts.

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property Table with the following mandatory properties:

  • warmup_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • warmup2_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • attacking_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • cooldown_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • prepared_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • back_to_walk_frame_sequence - Array of float - Indices of frames from the attack parameter animation.
  • warmup_animation_speed - float
  • attacking_animation_speed - float
  • cooldown_animation_speed - float
  • prepared_animation_speed - float
  • back_to_walk_animation_speed - float