Prototype/Character: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Removed some animation frame speed modifiers (will be removed in 0.8), comments about the mining/running animation position lists.)
Line 126: Line 126:
       shift = {0, -0.6}
       shift = {0, -0.6}
     },
     },
    idle_frames_per_tick = 1,
     idle_with_gun_animation =
     idle_with_gun_animation =
     {
     {
Line 151: Line 150:
       shift = {0, -0.6}
       shift = {0, -0.6}
     },
     },
    idle_with_gun_frames_per_tick = 1,
     light = {intensity = 0.4, size = 25},
     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_speed = 0.01,
     mining_with_hands_animation =
     mining_with_hands_animation =
Line 228: Line 224:
       shift = {0, -0.6}
       shift = {0, -0.6}
     },
     },
    running_sound_animation_positions = {14, 29}
   },
   },

Revision as of 22:32, 14 November 2013

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/RotatedAnimation

idle_with_gun_animation

Type: Types/RotatedAnimation

running_animation

Type: Types/RotatedAnimation

running_sound_animation_positions (Since 0.8)

Type: List of Types/float

List of positions in the running animation when the walking sound is played.

   running_sound_animation_positions = {14, 29}

running_mask_animation

Type: Types/RotatedAnimation

Currently not used.

mining_with_hands_animation

Type: Types/RotatedAnimation

mining_with_hands_particles_animation_positions

Type: List of Types/float

List of positions in the mining with hand animation when the mining sound and mining particles are created.

   mining_with_hands_particles_animation_positions = {29, 63}

mining_with_tool_animation

Type: Types/RotatedAnimation

mining_with_tool_particles_animation_positions

Type: List of Types/float

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

running_aim

Type: Types/RotatedAnimation

mining_speed

Type: Types/double

running_speed

Type: Types/double

distance_per_frame

Type: Types/double

maximum_corner_sliding_distance

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

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_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}
   },
   light = {intensity = 0.4, size = 25},
   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}
   },
   running_sound_animation_positions = {14, 29}
 },