Types/AttackReaction: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(notes on attack_reaction/triggers)
 
(Updated styling of prototype doc migration note)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
quick paste from notes by [[User:FreeER|~FreeER]] ([[User talk:FreeER|talk]]), yes I know this is not a proper wiki page lol.
<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/EntityWithHealthPrototype.html#attack_reaction https://lua-api.factorio.com/latest/prototypes/EntityWithHealthPrototype.html#attack_reaction]
Property names for various items/entities
    Entities (generic): created_effect
        Entity with Health (generic): attack_reaction
        Combat Robot: destroy_action
        Land Mine: action
        Projectile: action
        Smoke: action
    items:
        ammo_type (on ammo items): action
        mining-tool: action
        repair-tool: repair_result


= Trigger Definition =
</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>
=== type ===
"direct"/"area"/"line"
=== entity_flags ===
only targets entities with given flags? default is all, see [[Entityflags]]
=== repeat_count ===
uint32_t, default=1
=== collision_mask ===
see [[Types/CollisionMask]]
=== source_effects ===
[[Types/AttackReaction#TriggerEffect Definition|TriggerEffect]]
=== action_delivery ===
[[Types/AttackReaction#TriggerDelivery Definition|TriggerDelivery]]
=== force ===
"all" / "enemy" / "ally"




= TriggerEffect Definition =
=== type ===
"damage"/ "create-entity" / "create-smoke" / "create-particle" / "create-sticker" / "nested-result" / "play-sound"
=== repeat_count ===
see Trigger Def
=== affects_target ===
bool (default = false)


== Type Requirements ==
An array of [[Types/AttackReactionItem]].
=== damage ===
damage = float
=== create-entity ===
entity_name
offset = Vector offset (default = {0,0})
offset_deviation = BoundingBox
=== create-smoke (inherits create-entity) ===
initial_height = float (default = 0)
speed = Vector (default = {0,0})
speed_multiplier = float (default = 0)
starting_frame = float (default = 0)
starting_frame_speed = float (default = 0)
speed_from_center = float (default = 0)
=== create-particle (inherits create-entity) ===
initial_height = double (default = 0)
initial_vertical_speed = float (default = 0)
speed_from_center = float (default = 0)
=== create-sticker ===
sticker = EntityID? entity name?
=== play-sound ===
sound = [[Types/AttackReaction#Sound Definition|Sound]]
=== nested-result ===
action = Trigger
 
= Sound Definition =
== filename ==
"__mod__/filepath/filename.ext"
== volume ==
float (default = 1)
== preload ==
bool (default = true)
 
= TriggerDelivery Definition =
== type ==
"instant" / "projectile" / "flame-thrower"
== Type Requirements ==
=== instant ===
target_effects?
=== projectile ===
projectile = projectile name?
starting_speed = float (default = 0)
direction_deviation = float (default = 0)
range_deviation = float (default = 0)
max_range = double (defualt = double max)
=== flame-thrower ===
explosion = explosion name?
direction_deviation = float (default = 0)
speedDeviation = double (default = 0)
startingFrameFractionDeviation = double (default = 0)
projectileStartingSpeed = double (default = 1)
startingDistance = double
damage = float

Latest revision as of 10:42, 21 September 2023

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/EntityWithHealthPrototype.html#attack_reaction

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.


An array of Types/AttackReactionItem.