Skip to content

Instantly share code, notes, and snippets.

@Penguin-Spy
Last active October 22, 2024 08:19
Show Gist options
  • Save Penguin-Spy/ab9c81511791bb90243d3e8bec2dcbd5 to your computer and use it in GitHub Desktop.
Save Penguin-Spy/ab9c81511791bb90243d3e8bec2dcbd5 to your computer and use it in GitHub Desktop.
Example of what data should be passed to !skins when registering a skin's animations.
--[[
This is an example of what data should be passed in the "animations" field when registering a skin with the !skins Factorio mod.
It is the same data that you would otherwise overwrite data.raw["character"]["character"].animations with.
]]
animations = { -- table of CharacterArmorAnimations
{ -- a specific CharacterArmorAnimation
idle = { -- RotatedAnimation
layers = {
{ -- a specific RotatedAnimation layer
filename = "path/to/image.png",
width = 46,
height = 58,
shift = util.by_pixel(0.0,-21.0),
frame_count = 22,
direction_count = 8,
animation_speed = 0.15
},
{
-- another RotatedAnimation layer, etc...
}
}
},
idle_with_gun = RotatedAnimation,
running = RotatedAnimation,
running_with_gun = RotatedAnimation,
mining_with_tool = RotatedAnimation,
flipped_shadow_running_with_gun = RotatedAnimation, -- this one is optional, don't worry if you don't have it.
armors = {"light-armor", "another-mods-armor-name"} -- Don't define this if you want these animations to be used for the player without armor.
},
{
-- another CharacterArmorAnimation, etc...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment