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}
}
},
Player/Unit animations issue
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Player/Unit animations issue
IIRC it's this line that tells the game the East sprite should be the West sprite flipped horizontally:
In theory, if you set that false, then you get the extra East sprite that you're after.
Code: Select all
axially_symmetrical = true,
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Player/Unit animations issue
I was gonna say the same thing but mine would have been a total guess
Re: Player/Unit animations issue
I think I tried setting it to false, and just removing it totally... I don't think it helped. I did some image editing and just made my own west sprite.
The sprites still don't look correct when the critter is walking around "idle" it is usually looking the wrong way when it's walking around
The sprites still don't look correct when the critter is walking around "idle" it is usually looking the wrong way when it's walking around
Re: Player/Unit animations issue
I edited the sprite sheets and added the new directions and in the correct order ( i had the west-facing order reversed) so now the animation is fine. still annoying though, i'd like to know what the correct lua code is to make it correctly replicate east-west animations.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Player/Unit animations issue
It might be worth asking Teralink to see if he(?) knows as he recently did a detailed camper van vehicle animation link
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Player/Unit animations issue
maybe i need to set the direction number to 16 even though there are only 9 sprites, because the missing 7 are just the mirrored east/west animations?