Animation request
Posted: Mon May 26, 2014 12:12 am
Hi I would like to request the ability to set a variable to the the animation type pictures = So I could animate a car prototype under certain condition. The way I see the variable being set is from a control.lua and it updates the variable in the entity.lua. You see I am making a mod https://forums.factorio.com/forum/vie ... =14&t=3450 And would like the ability to animate my Harvester vehicle when it is mining or when it goes to dump off its cargo.
something along the lines of
something like that I guess.
something along the lines of
Code: Select all
harv_entity : pictures = "animation_state"
controle.lua:
if havrester(car) is on ore then
get direction(?)
if harvester(car).direction = North then
animation_state = "N_mining"
N_mining=
{
filename = "__mod__/graphics/entity/vehicle/north-sheet.png",
line_length = 5
frame_width = 140,
frame_height = 110,
shift={0.5, 0},
axially_symmetrical = false,
direction_count = 64
},
if harvester.direction = south then
animation_state = "S_mining"
S_mining=
{
filename = "__mod__/graphics/entity/vehicle/south-sheet.png",
line_length = 5
frame_width = 140,
frame_height = 110,
shift={0.5, 0},
axially_symmetrical = false,
direction_count = 64
},
and so on
then else if its not on ore or dumping cargo revert back to the original sprite sheet.
else if harvester. not on ore
animation_state = "normal"
normal =
{
filename = "__mod__/graphics/entity/vehicle/normal-sheet.png",
line_length = 8,
frame_width = 140,
frame_height = 110,
shift={0.5, 0},
axially_symmetrical = false,
direction_count = 64
},
If harvester is "dumping cargo"
animation_state ="dump_cargo"
dump_cargo =
{
filename = "__mod__/graphics/entity/vehicle/dump-cargo-sheet.png",
line_length = 4,
frame_width = 140,
frame_height = 110,
shift={0.5, 0},
axially_symmetrical = false,
direction_count = 64
},