Prototype/Unit: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
(0.16)
Line 3: Line 3:


== Usage in base==
== Usage in base==
*[[Enemies|small, medium, and big biters]]
*[[Enemies|biters/spitters]]
== Properties ==
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
 
=== run_animation ===
=== run_animation ===
'''Type''': [[Types/RotatedAnimation]]
'''Type''': [[Types/RotatedAnimation]]
Line 10: Line 12:
=== attack_parameters ===
=== attack_parameters ===
'''Type''': [[Types/AttackParameters]]
'''Type''': [[Types/AttackParameters]]
Requires animation in attack_parameters. Requires ammo_type in attack_parameters.


=== movement_speed ===
=== movement_speed ===
'''Type''': [[Types/double]]
'''Type''': [[Types/float]]


=== distance_per_frame ===
=== distance_per_frame ===
'''Type''': [[Types/float]]
=== pollution_to_join_attack ===
'''Type''': [[Types/float]]
Pollution level required before entity will leave it's spawner and attack the source of the pollution.
=== distraction_cooldown ===
'''Type''': [[Types/uint32]]
=== vision_distance ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]
Max is 100.
== Optional properties ==


=== dying_sound ===
=== dying_sound ===
'''Type''': [[Types/FileName]]
'''Type''': [[Types/Sound]]
The sound file to play when entity dies


=== pollution_to_join_attack ===
The sound file to play when entity dies.
 
=== min_persue_time ===
'''Type''': [[Types/uint32]]
 
'''Default''': 10 * 60
 
=== has_belt_immunity ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
If the unit is immune to movement by belts.
 
=== spawning_time_modifier ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]
Pollution level required before entity will leave it's spawner and attack the source of the pollution.


=== distraction_cooldown ===
'''Default''': 1
'''Type''': [[Types/Tick]]
 
=== max_pursue_distance ===
'''Type''': [[Types/double]]


== Example ==
'''Default''': 50
    {
    type = "unit",
    name = "small-biter",
    icon = "__base__/graphics/icons/creeper.png",
    flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
    max_health = 15,
    healing_per_tick = 0.01,
    collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
    selection_box = {{-0.4, -0.7}, {0.7, 0.4}},
    attack_parameters =
    {
      range = 0.5,
      cooldown = 35,
      ammo_category = "melee",
      ammo_type = make_unit_melee_ammo_type(6),
      animation =
      {
        filename = "__base__/graphics/entity/small-biter/small-biter-attack.png",
        frame_width = 139,
        frame_height = 93,
        frame_count = 11,
        direction_count = 16,
        axially_symmetrical = false,
        shift = {0.84375, -0.3125}
      }
    },
    movement_speed = 0.2,
    distance_per_frame = 0.1,
    pollution_to_join_attack = 200,
    distraction_cooldown = 300,
    corpse = "small-biter-corpse",
    dying_sound =
    {
      {
        filename = "__base__/sound/creeper-death-1.wav",
        volume = 0.7
      },
      {
        filename = "__base__/sound/creeper-death-2.wav",
        volume = 0.7
      },
      {
        filename = "__base__/sound/creeper-death-3.wav",
        volume = 0.7
      },
      {
        filename = "__base__/sound/creeper-death-4.wav",
        volume = 0.7
      }
    },
    run_animation =
    {
      filename = "__base__/graphics/entity/small-biter/small-biter-run.png",
      still_frame = 4,
      frame_width = 86,
      frame_height = 59,
      frame_count = 16,
      direction_count = 16,
      shift = {0.359375, -0.15625},
      axially_symmetrical = false
    }
  }

Revision as of 09:20, 22 May 2018

Basics

Entity that attacks player based on pollution value. Extends the Prototype/EntityWithHealth

Usage in base

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithHealth.

run_animation

Type: Types/RotatedAnimation

attack_parameters

Type: Types/AttackParameters

Requires animation in attack_parameters. Requires ammo_type in attack_parameters.

movement_speed

Type: Types/float

distance_per_frame

Type: Types/float

pollution_to_join_attack

Type: Types/float

Pollution level required before entity will leave it's spawner and attack the source of the pollution.

distraction_cooldown

Type: Types/uint32

vision_distance

Type: Types/double

Max is 100.

Optional properties

dying_sound

Type: Types/Sound

The sound file to play when entity dies.

min_persue_time

Type: Types/uint32

Default: 10 * 60

has_belt_immunity

Type: Types/bool

Default: false

If the unit is immune to movement by belts.

spawning_time_modifier

Type: Types/double

Default: 1

max_pursue_distance

Type: Types/double

Default: 50