Prototype/Unit: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added prototype type to page)
(Removed old prototype docs)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''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/UnitPrototype.html https://lua-api.factorio.com/latest/prototypes/UnitPrototype.html]
Prototype type: '''unit'''


Entity that attacks player based on pollution value. Extends the [[Prototype/EntityWithHealth]]
</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>
 
== Usage in base==
*[[Enemies|biters/spitters]]
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
 
=== run_animation ===
'''Type''': [[Types/RotatedAnimation]]
 
=== attack_parameters ===
'''Type''': [[Types/AttackParameters]]
 
Requires animation in attack_parameters. Requires ammo_type in attack_parameters.
 
=== movement_speed ===
'''Type''': [[Types/float]]
 
=== distance_per_frame ===
'''Type''': [[Types/float]]
 
=== pollution_to_join_attack ===
'''Type''': [[Types/float]]
 
Pollution level required before entity will leave it's spawner and attack the source of the pollution.
 
=== distraction_cooldown ===
'''Type''': [[Types/uint32]]
 
=== vision_distance ===
'''Type''': [[Types/double]]
 
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.
 
== Optional properties ==
 
=== dying_sound ===
'''Type''': [[Types/Sound]]
 
The sound file to play when entity dies.
 
=== min_persue_time ===
'''Type''': [[Types/uint32]]
 
'''Default''': 10 * 60
 
=== has_belt_immunity ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
If the unit is immune to movement by belts.
 
=== spawning_time_modifier ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
=== max_pursue_distance ===
'''Type''': [[Types/double]]
 
'''Default''': 50

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