I making mod Additional-turret
viewtopic.php?f=93&t=30865
I have question [ending_attack_animation]
It is using folding/ed_animation, preparing/ed_animation ...
and action after shooting.
But Don't have ammo in turret It is only action same mining-drill/animations
action gif
Can I check ammo in turret?? and It creates a variable?- non.gif (195.45 KiB) Viewed 865 times
- ammo.gif (207.01 KiB) Viewed 865 times
Or can I missing something?
code
Thank you for watching this post!!Code: Select all
local artillery_test_shift = {0.5, -2.25}
function artillery_test_sheet(inputs)
return
{
layers =
{
{
filename = "__Additional-Turret__/graphics/entity/artillery-test-sheet.png",
priority = "medium",
width = 260,
height = 295,
direction_count = 1,
frame_count = 42,
line_length = 7,
axially_symmetrical = false,
run_mode = inputs.run_mode and inputs.run_mode or "forward",
shift = artillery_test_shift,
},
}
}
end
function artillery_test_attack_sheet(inputs)
return
{
layers =
{
{
filename = "__Additional-Turret__/graphics/entity/artillery-test-attack-sheet.png",
priority = "medium",
width = 260,
height = 295,
direction_count = 1,
frame_count = 11,
line_length = 7,
axially_symmetrical = false,
-- run_mode = "forward",
shift = artillery_test_shift,
},
}
}
end
function artillery_test_attack(inputs)
return
{
layers =
{
{
filename = "__Additional-Turret__/graphics/entity/artillery-test-attack.png",
priority = "medium",
width = 260,
height = 295,
direction_count = 1,
frame_count = 1,
axially_symmetrical = false,
shift = artillery_test_shift,
}
}
}
end
data:extend({
{
type = "ammo-turret",
name = "artillery-test-turret",
icon = "__Additional-Turret__/graphics/icon/artillery-turret-2.png",
flags = { "placeable-player", "player-creation"},
minable = { mining_time = 10, result = "artillery-test-turret" },
max_health = 3500,
resistances =
{
{ type = "physical", decrease = 20, percent = 60, },
},
corpse = "big-remnants",
collision_box = {{ -3.7, -2.7}, {3.7, 2.7}},
selection_box = {{ -4, -3}, {4, 3}},
rotation_speed = 1,
preparing_speed = 0.004,
folding_speed = 0.004,
attacking_speed = 1,
ending_attack_speed = 0.01,
dying_explosion = "big-explosion",
inventory_size = 1,
automated_ammo_count = 10,
attacking_animation_fade_out = 10,
folded_animation = artillery_test_sheet{},
preparing_animation = artillery_test_sheet{},
prepared_animation = artillery_test_attack{},
attacking_animation = artillery_test_attack{},
ending_attack_animation = artillery_test_attack_sheet{},
folding_animation = artillery_test_sheet{run_mode = "backward"},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
attack_parameters =
{
type = "projectile",
ammo_category = "artillery-test-shell",
cooldown = 360, --3600
projectile_creation_distance = 0,
projectile_center = {0, -5.625}, -- -2.25 -> 3.625
damage_modifier = 1,
range = 500,
min_range = 100,
sound =
{
{
filename = "__base__/sound/fight/tank-cannon.ogg",
volume = 1.0
}
},
},
call_for_help_radius = 1000,
},
})