Prototype/Character

From Official Factorio Wiki
Revision as of 19:44, 12 November 2013 by FreeER (talk | contribs) (Created page with "==Basics== Entity that you move around on the screen during the campaign and freeplay. Extends the Prototype/EntityWithHealth == Properties == === crafting_categories === '''T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Basics

Entity that you move around on the screen during the campaign and freeplay. Extends the Prototype/EntityWithHealth

Properties

crafting_categories

Type: Types/CraftingCategory

idle_animation

Type: Types/Animation

idle_with_gun_animation

Type: Types/Animation

running_animation

Type: Types/Animation

running_mask_animation

Type: Types/Animation?

mining_with_hands_animation

Type: Types/Animation

mining_with_tool_animation

Type: Types/Animation

running_aim

Type: Types/Animation

mining_speed

Type: Types/double?

running_speed

Type: Types/double?

distance_per_frame

Type: Types/double?

maximum_corner_sliding_distance

Type: Types/double?

mine_with_hands_frames_per_tick

Type: Types/double?

mine_with_tool_frames_per_tick

Type: Types/double?

idle_frames_per_tick

Type: Types/double?

idle_with_gun_frames_per_tick

Type: Types/double?

heartbeat

Type: Types/FileName The sound file played when the character's health is low

eat

Type: Types/FileName The sound file played when the character eats (fish for example)

light

Type: Types/LightDefinition

inventory_size

Type: Types/InventorySize The size of the character's inventory

mining_with_hands_particles_animation_positions

Type: ?

mining_with_tool_particles_animation_positions

Type: ?

Count of ticks to preserve the animation even when the discharging ends.

Example

   {
   type = "player",
   name = "player",
   icon = "__base__/graphics/icons/player.png",
   flags = {"pushable", "placeable-player", "placeable-off-grid", "breaths-air"},
   max_health = 100,
   healing_per_tick = 0.01,
   collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
   selection_box = {{-0.2, -0.2}, {0.2, 0.2}},
   crafting_categories = {"crafting"},
   inventory_size = 60,
   running_speed = 0.15,
   distance_per_frame = 0.13,
   maximum_corner_sliding_distance = 0.7,
   eat =
   {
     {
       filename = "__base__/sound/eat.wav",
       volume = 1
     }
   },
   heartbeat =
   {
     {
       filename = "__base__/sound/heartbeat.ogg",
       volume = 1.5
     }
   },
   idle_animation =
   {
     priority = "medium",
     frame_width = 48,
     frame_height = 66,
     direction_count = 5,
     frame_count = 120,
     stripes =
     {
       {
         filename = "__base__/graphics/entity/player/character-idle-1.png",
         width_in_frames = 40
       },
       {
         filename = "__base__/graphics/entity/player/character-idle-2.png",
         width_in_frames = 40
       },
       {
         filename = "__base__/graphics/entity/player/character-idle-3.png",
         width_in_frames = 40
       }
     },
     shift = {0, -0.6}
   },
   idle_frames_per_tick = 1,
   idle_with_gun_animation =
   {
     priority = "medium",
     frame_width = 48,
     frame_height = 66,
     direction_count = 5,
     frame_count = 120,
     stripes =
     {
       {
         filename = "__base__/graphics/entity/player/character-idle-with-gun-1.png",
         width_in_frames = 40
       },
       {
         filename = "__base__/graphics/entity/player/character-idle-with-gun-2.png",
         width_in_frames = 40
       },
       {
         filename = "__base__/graphics/entity/player/character-idle-with-gun-3.png",
         width_in_frames = 40
       }
     },
     shift = {0, -0.6}
   },
   idle_with_gun_frames_per_tick = 1,
   light = {intensity = 0.4, size = 25},
   mine_with_hands_frames_per_tick = 1,
   mine_with_tool_frames_per_tick = 1,
   mining_speed = 0.01,
   mining_with_hands_animation =
   {
     priority = "medium",
     frame_width = 48,
     frame_height = 66,
     direction_count = 5,
     frame_count = 80,
     stripes =
     {
       {
         filename = "__base__/graphics/entity/player/character-mine-with-hands-1.png",
         width_in_frames = 40
       },
       {
         filename = "__base__/graphics/entity/player/character-mine-with-hands-2.png",
         width_in_frames = 40
       }
     },
     shift = {0, -0.6}
   },
   mining_with_hands_particles_animation_positions = {29, 63},
   mining_with_tool_animation =
   {
     priority = "medium",
     frame_width = 64,
     frame_height = 88,
     direction_count = 5,
     frame_count = 48,
     stripes =
     {
       {
         filename = "__base__/graphics/entity/player/character-mine-with-tool-1.png",
         width_in_frames = 24
       },
       {
         filename = "__base__/graphics/entity/player/character-mine-with-tool-2.png",
         width_in_frames = 24
       }
     },
     shift = {0, -0.6}
   },
   mining_with_tool_particles_animation_positions = {28},
   running_aim =
   {
     filename = "__base__/graphics/entity/player/character-clothes-run-aim.png",
     priority = "medium",
     frame_width = 58,
     frame_height = 72,
     frame_count = 30,
     direction_count = 18,
     shift = {0, -0.6}
   },
   running_animation =
   {
     filename = "__base__/graphics/entity/player/character-clothes-run.png",
     priority = "medium",
     frame_width = 48,
     frame_height = 66,
     frame_count = 30,
     direction_count = 5,
     shift = {0, -0.6}
   },
   running_mask_animation =
   {
     filename = "__base__/graphics/entity/player/character-clothes-run-mask.png",
     priority = "medium",
     frame_width = 48,
     frame_height = 66,
     frame_count = 30,
     direction_count = 5,
     shift = {0, -0.6}
   },
 },