Prototype/Projectile: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Updated styling of prototype doc migration note)
(Removed old prototype docs)
 
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/Entity}}
Entity with limited lifetime that can hit other entities and has triggers when this happens.
{{Prototype TOC|projectile}}
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/Entity]].
{{Prototype property|acceleration|[[Types/double|double]]}}
Must be != 0 if turning_speed_increases_exponentially_with_projectile_speed is true.
== Optional properties ==
{{Prototype property|animation|[[Types/Animation|Animation]]|optional=true}}
{{Prototype property|rotatable|[[Types/bool|bool]]|true|optional=true}}
Whether the animation of the projectile is rotated to match the direction of travel.
{{Prototype property|enable_drawing_with_mask|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|direction_only|[[Types/bool|bool]]|false|optional=true}}
Setting this to true can be used to disable projectile homing behaviour.
{{Prototype property|hit_at_collision_position|[[Types/bool|bool]]|false|optional=true}}
When true the entity is hit at the position on its collision box the projectile first collides with. When false the entity is hit at its own position.
{{Prototype property|force_condition|[[Types/ForceCondition|ForceCondition]]|"all"|optional=true}}
{{Prototype property|piercing_damage|[[Types/float|float]]|0|optional=true}}
Whenever an entity is hit by the projectile, this number gets reduced by the health of the entity. If the number is then below 0, the <code>final_action</code> is applied and the projectile destroyed. Otherwise, the projectile simply continues to its destination.
{{Prototype property|max_speed|[[Types/double|double]]|MAX_DOUBLE|optional=true}}
Must be greater than or equal to 0.
{{Prototype property|turn_speed|[[Types/float|float]]|1|optional=true}}
Must be greater than or equal to 0.
{{Prototype property|speed_modifier|[[Types/vector|vector]]|<nowiki>{1, 1}</nowiki>|optional=true}}
{{Prototype property|height|[[Types/double|double]]|1|optional=true}}
{{Prototype property|action|[[Types/Trigger|Trigger]]|optional=true}}
Executed when the projectile hits something.
{{Prototype property|final_action|[[Types/Trigger|Trigger]]|optional=true}}
Executed when the projectile hits something, after <code>action</code> and only if the entity that was hit was destroyed. The projectile is destroyed right after the final_action.
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
{{Prototype property|smoke|Array of [[Types/SmokeSource|SmokeSource]]|optional=true}}
{{Prototype property|hit_collision_mask|[[Types/CollisionMask|CollisionMask]]|<nowiki>{"player-layer", "train-layer"}</nowiki>|optional=true}}
{{Prototype property|turning_speed_increases_exponentially_with_projectile_speed|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|shadow|[[Types/Animation|Animation]]|optional=true}}

Latest revision as of 14:32, 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/ProjectilePrototype.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.