Prototype/Projectile: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added property that I missed)
(Converted to SMW format)
Line 1: Line 1:
{{Prototype parent|Prototype/Entity}}
{{Prototype parent|Prototype/Entity}}
Entity with limited lifetime that can hit other entities and has triggers when this happens.


== Basics ==
{{Prototype TOC|projectile}}
Prototype type: '''projectile'''
 
Extends [[Prototype/Entity]].


== Mandatory properties ==
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/Entity]].
This prototype inherits all the properties from [[Prototype/Entity]].


=== animation ===
{{Prototype property|animation|[[Types/Animation|Animation]]}}
'''Type''': [[Types/Animation]]


=== acceleration ===
{{Prototype property|acceleration|[[Types/double|double]]}}
'''Type''': [[Types/double]]


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


=== rotatable ===
{{Prototype property|rotatable|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== enable_drawing_with_mask ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== direction_only ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== hit_at_collision_position ===
'''Type''': [[Types/bool]]
 
'''Default''': false


=== force_condition ===
{{Prototype property|enable_drawing_with_mask|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/ForceCondition]]


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


=== piercing_damage ===
{{Prototype property|hit_at_collision_position|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/float]]


'''Default''': 0
{{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.  
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.  


=== max_speed ===
{{Prototype property|max_speed|[[Types/double|double]]|MAX_DOUBLE|optional=true}}
'''Type''': [[Types/double]]
 
'''Default''': MAX_DOUBLE
 
Must be greater than or equal to 0.
Must be greater than or equal to 0.


=== height ===
{{Prototype property|height|[[Types/double|double]]|1|optional=true}}
'''Type''': [[Types/double]]
 
'''Default''': 1
 
=== action ===
'''Type''': [[Types/Trigger]]


{{Prototype property|action|[[Types/Trigger|Trigger]]|optional=true}}
Executed when the projectile hits something.
Executed when the projectile hits something.


=== final_action ===
{{Prototype property|final_action|[[Types/Trigger|Trigger]]|optional=true}}
'''Type''': [[Types/Trigger]]
 
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.
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.


=== light ===
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
'''Type''': [[Types/LightDefinition]]
 
=== smoke ===
'''Type''': Array of [[Types/SmokeSource]]


=== hit_collision_mask ===
{{Prototype property|smoke|Array of [[Types/SmokeSource|SmokeSource]]|optional=true}}
'''Type''': [[Types/CollisionMask]]


'''Default''': {"player-layer", "train-layer"}
{{Prototype property|hit_collision_mask|[[Types/CollisionMask|CollisionMask]]|<nowiki>{"player-layer", "train-layer"}</nowiki>|optional=true}}


=== shadow ===
{{Prototype property|shadow|[[Types/Animation|Animation]]|optional=true}}
'''Type''': [[Types/Animation]]

Revision as of 21:19, 5 August 2019

Template:Prototype parent Entity with limited lifetime that can hit other entities and has triggers when this happens.

Template:Prototype TOC

Mandatory properties

This prototype inherits all the properties from Prototype/Entity.

Template:Prototype property

Template:Prototype property

Optional properties

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property 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 final_action is applied and the projectile destroyed. Otherwise, the projectile simply continues to its destination.

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

Template:Prototype property

Template:Prototype property Executed when the projectile hits something.

Template:Prototype property Executed when the projectile hits something, after action and only if the entity that was hit was destroyed. The projectile is destroyed right after the final_action.

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property