Prototype/Character: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.18.22: footstep_particle_triggers changes)
(0.18.24: added synced_footstep_particle_triggers, footprint_particles, left_footprint_offset, right_footprint_offset, right_footprint_frames, left_footprint_frames, split footstep_particle_triggers type into own page)
Line 72: Line 72:


{{Prototype property|character_corpse|[[Types/string|string]]|optional=true}}
{{Prototype property|character_corpse|[[Types/string|string]]|optional=true}}
Name of the character corpse that is spawned whend this character dies.
Name of the character corpse that is spawned when this character dies.


{{Prototype property|footstep_particle_triggers|[[Types/table|table]] of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]|optional=true}}
{{Prototype property|footstep_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}}
Array of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]. Each [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]] needs the extra mandatory property <code>tiles</code>, which is a [[Types/table|table]] (array) of [[Types/string|string]] which is the name of a tile.<br>
Triggered every tick of the running animation.
Alternatively, instead of specifying the CreateParticleTriggerEffectItem directly in the table with the <code>tiles</code> property, a <code>actions</code> property that is an array of CreateParticleTriggerEffectItem can be specified in the table with the <code>tiles</code> property.


Examples:
{{Prototype property|synced_footstep_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}}
<syntaxhighlight lang="lua">footstep_particle_triggers =
Triggered when the running animation ([[#animations]]) rolls over the frames defined in <code>right_footprint_frames</code> and <code>left_footprint_frames</code>.
{
 
  {
{{Prototype property|footprint_particles|[[Types/table|table]] of [[Types/FootprintParticle|FootprintParticle]]|optional=true}}
    tiles = { "water", "water-shallow" },
Array of footprint particles. Triggered when the running animation ([[#animations]]) rolls over the frames defined in <code>right_footprint_frames</code> and <code>left_footprint_frames</code>.
    type = "create-particle",
 
    particle_name = "water-particle",
{{Prototype property|left_footprint_offset|[[Types/vector|vector]]|optional=true}}
    ....
Offset from the center of the entity for the left footprint. Used by <code>footprint_particles</code>.
  },
 
  {
{{Prototype property|right_footprint_offset|[[Types/vector|vector]]|optional=true}}
    tiles = { "grass-1", "grass-2" },
Offset from the center of the entity for the right footprint. Used by <code>footprint_particles</code>.
    type = "create-particle",
 
    particle_name = "grass-particle",
{{Prototype property|right_footprint_frames|[[Types/table|table]] of [[Types/float|float]]|optional=true}}
    ....
An array of [[Types/float|float]]. The frames in the running animation ([[#animations]]) where the right foot touches the ground.
  },
 
  ....
{{Prototype property|left_footprint_frames|[[Types/table|table]] of [[Types/float|float]]|optional=true}}
}</syntaxhighlight>
An array of [[Types/float|float]]. The frames in the running animation ([[#animations]]) where the left foot touches the ground.
<syntaxhighlight lang="lua">footstep_particle_triggers =
{
  {
    tiles = { "water", "water-shallow" },
    actions =
    {
      {
        type = "create-particle",
        particle_name = "water-particle-1",
        ....
      },
      {
        type = "create-particle",
        particle_name = "water-particle-2",
        ....
      },
      ....
    }
  },
  {
    tiles = { "grass-1", "grass-2" },
    actions =
    {
      {
        type = "create-particle",
        particle_name = "grass-particle-1",
        ....
      },
      {
        type = "create-particle",
        particle_name = "grass-particle-2",
        ....
      },
      ....
    }
  },
}</syntaxhighlight>


{{Prototype property|tool_attack_result|[[Types/Trigger|Trigger]]|optional=true}}
{{Prototype property|tool_attack_result|[[Types/Trigger|Trigger]]|optional=true}}

Revision as of 11:44, 20 May 2020

Template:Prototype parent Entity that you move around on the screen during the campaign and freeplay.

Template:Prototype TOC

Mandatory properties

Inherits all properties from Prototype/EntityWithHealth.

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property The sound file played when the character's health is low.

Template:Prototype property The sound file played when the character eats (fish for example).

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property List of positions in the running animation when the walking sound is played.

   running_sound_animation_positions = {14, 29}

Template:Prototype property List of positions in the mining with tool animation when the mining sound and mining particles are created.

   mining_with_tool_particles_animation_positions = {28}

Template:Prototype property

Optional properties

Template:Prototype property Names of the crafting categories the character can craft recipes from. The built-in categories can be found here. See also Prototype/RecipeCategory.

Template:Prototype property Names of the resource categories the character can mine resources from.

Template:Prototype property

Template:Prototype property Must be >= 0.

Template:Prototype property

Template:Prototype property Time in seconds. Must be positive

Template:Prototype property Name of the character corpse that is spawned when this character dies.

Template:Prototype property Triggered every tick of the running animation.

Template:Prototype property Triggered when the running animation (#animations) rolls over the frames defined in right_footprint_frames and left_footprint_frames.

Template:Prototype property Array of footprint particles. Triggered when the running animation (#animations) rolls over the frames defined in right_footprint_frames and left_footprint_frames.

Template:Prototype property Offset from the center of the entity for the left footprint. Used by footprint_particles.

Template:Prototype property Offset from the center of the entity for the right footprint. Used by footprint_particles.

Template:Prototype property An array of float. The frames in the running animation (#animations) where the right foot touches the ground.

Template:Prototype property An array of float. The frames in the running animation (#animations) where the left foot touches the ground.

Template:Prototype property