Difference between revisions of "Types/AttackReaction"

From Official Factorio Wiki
Jump to: navigation, search
(notes on attack_reaction/triggers)
 
m
Line 22: Line 22:
 
see [[Types/CollisionMask]]
 
see [[Types/CollisionMask]]
 
=== source_effects ===
 
=== source_effects ===
  [[Types/AttackReaction#TriggerEffect Definition|TriggerEffect]]
+
  [[#TriggerEffect Definition]]
 
=== action_delivery ===
 
=== action_delivery ===
  [[Types/AttackReaction#TriggerDelivery Definition|TriggerDelivery]]
+
  [[#TriggerDelivery Definition]]
 
=== force ===
 
=== force ===
 
  "all" / "enemy" / "ally"
 
  "all" / "enemy" / "ally"
Line 58: Line 58:
 
  sticker = EntityID? entity name?
 
  sticker = EntityID? entity name?
 
=== play-sound ===
 
=== play-sound ===
  sound = [[Types/AttackReaction#Sound Definition|Sound]]
+
  sound = [[#Sound Definition]]
 
=== nested-result ===
 
=== nested-result ===
 
  action = Trigger
 
  action = Trigger

Revision as of 19:32, 2 August 2014

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 Definition

action_delivery

#TriggerDelivery Definition

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 Definition

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