i made a rifleman.
The problem is, some animations got cut off and i think it got something to do with the shifting in the animations.
Is there a formula one could use?
I based him off the small biter.
Here you got the animation:
Code: Select all
function rus_rifleman_1_runanimation(scale)
return
{
layers=
{
{
width = 190,
height = 125,
frame_count = 8,
direction_count = 16,
shift = { 0.0, 0.0},
scale = scale,
stripes =
{
{
filename = "__robotarmy__/graphics/entity/rus_rifleman_1/rus_rifleman_1_run.png",
width_in_frames = 8,
height_in_frames = 16,
},
{
filename = "__robotarmy__/graphics/entity/rus_rifleman_1/rus_rifleman_1_run.png",
width_in_frames = 8,
height_in_frames = 16,
}
}
}
}
}
end
Code: Select all
data:extend(
{
{
type = "unit",
name = "rus_rifleman_1",
icon = "__base__/graphics/icons/small-biter.png",
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 15,
order = "b-b-a",
subgroup="creatures",
minable = {hardness = 0.1, mining_time = 0.1, result = "rus_rifleman_1_item"},
healing_per_tick = 0.01,
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
attack_parameters =
{
type = "projectile",
range = 12.5,
cooldown = 35,
ammo_category = "melee",
ammo_type = make_unit_melee_ammo_type(6),
sound = make_biter_roars(0.5),
animation = rus_rifleman_1_attackanimation(riflemanscale)
},
vision_distance = 30,
movement_speed = 0.1,
distance_per_frame = 0.4,
pollution_to_join_attack = 200,
distraction_cooldown = 300,
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = rus_rifleman_1_runanimation(riflemanscale)
}
}
)