Types/AttackReaction

From Official Factorio Wiki
Revision as of 19:28, 2 August 2014 by FreeER (talk | contribs) (notes on attack_reaction/triggers)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

quick paste from notes by ~FreeER (talk), yes I know this is not a proper wiki page lol. 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

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

TriggerEffect

action_delivery

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

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 = 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