Player/Unit animations issue
Posted: Fri Sep 09, 2016 4:06 am
I am having issues with animation sprite sheets which only have north-east-south sprites, and west is omitted.
West is just a mirror of East, and i'm pretty sure there is a line of lua code i can put in the definition of the entity prototype in the run_animation table, to specify that east-west animations are symmetrical and it's okay to do this.
here is my unit prototype, what can I change to make it NOT look like the unit is "facing east and moon-walking" when moving to the west.
{
type = "unit",
name = "small-creeper",
icon = "__base__/graphics/icons/small-biter.png",
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 25,
order = "b-s-c",
subgroup="enemies",
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 =
{
type = "projectile",
range = 0.5,
cooldown = 35,
ammo_category = "melee",
ammo_type = make_unit_melee_ammo_type(6),
sound = make_biter_roars(0.5),
animation =
{
filename = "__zombies__/graphics/creeper-attack.png",
priority = "high",
width = 63,
height = 96,
direction_count = 9,
frame_count = 15,
axially_symmetrical = true,
animation_speed = 2,
shift = {0, 0}
},
},
vision_distance = 30,
movement_speed = 0.2,
distance_per_frame = 0.1,
pollution_to_join_attack = 200,
distraction_cooldown = 300,
corpse = "",
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = {
filename = "__zombies__/graphics/creeper-run.png",
priority = "high",
width = 48,
height = 68,
direction_count = 9,
frame_count = 30,
axially_symmetrical = true,
animation_speed = 2,
shift = {0, 0}
}
},
West is just a mirror of East, and i'm pretty sure there is a line of lua code i can put in the definition of the entity prototype in the run_animation table, to specify that east-west animations are symmetrical and it's okay to do this.
here is my unit prototype, what can I change to make it NOT look like the unit is "facing east and moon-walking" when moving to the west.
{
type = "unit",
name = "small-creeper",
icon = "__base__/graphics/icons/small-biter.png",
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 25,
order = "b-s-c",
subgroup="enemies",
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 =
{
type = "projectile",
range = 0.5,
cooldown = 35,
ammo_category = "melee",
ammo_type = make_unit_melee_ammo_type(6),
sound = make_biter_roars(0.5),
animation =
{
filename = "__zombies__/graphics/creeper-attack.png",
priority = "high",
width = 63,
height = 96,
direction_count = 9,
frame_count = 15,
axially_symmetrical = true,
animation_speed = 2,
shift = {0, 0}
},
},
vision_distance = 30,
movement_speed = 0.2,
distance_per_frame = 0.1,
pollution_to_join_attack = 200,
distraction_cooldown = 300,
corpse = "",
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = {
filename = "__zombies__/graphics/creeper-run.png",
priority = "high",
width = 48,
height = 68,
direction_count = 9,
frame_count = 30,
axially_symmetrical = true,
animation_speed = 2,
shift = {0, 0}
}
},