Hi!
I really need outside help to create a simple mod that would replace the sprite of the engineer. There are no problems with sprites (and their parameters like "shift_by_pixel" e.t.c.) and they are almost ready. The problem lies in the replacement itself, i.e. in the code.
What I want:
- This is a "standalone" mod, it does not involve the use of a "character manager". Lightness is a priority, and in general it is more for personal use.
- Simplicity.
What I have already: "date" and "character_animation". The last one is a copy of the standard file, just trying to make it work for start. The first one states the following:
local animations = require("character-animations")
local character = data.raw["character"]["character"]
local characteranimations = animations
character.icon = "__ALGI__/graphics/icons/entity/character.png"
Yes, I was able to successfully replace the engineer icon. I did not understand how to replace animations.
Will be glad of any help, grateful in advance!
Need help with character sprites replacement!
-
Sector_347
- Manual Inserter

- Posts: 2
- Joined: Sat Dec 27, 2025 11:02 am
- Contact:
Re: Need help with character sprites replacement!
Similar to how you changed the icon, you can write to character.animations. However according to the docs it takes an array of animations https://lua-api.factorio.com/latest/pro ... animations.
So assuming animations is in a valid CharacterArmorAnimation format, you can do character.animations = {animations} to make it an array with one element. If you want to keep existing animations for different armors on top of your animation, that's a tiny bit more complex.
So assuming animations is in a valid CharacterArmorAnimation format, you can do character.animations = {animations} to make it an array with one element. If you want to keep existing animations for different armors on top of your animation, that's a tiny bit more complex.
-
Sector_347
- Manual Inserter

- Posts: 2
- Joined: Sat Dec 27, 2025 11:02 am
- Contact:
Re: Need help with character sprites replacement!
Thanks for reply. I tried this and failed. Also I tried approach with BLMs, but not succeed either.Osmo wrote: Sat Dec 27, 2025 2:16 pm Similar to how you changed the icon, you can write to character.animations. However according to the docs it takes an array of animations https://lua-api.factorio.com/latest/pro ... animations.
So assuming animations is in a valid CharacterArmorAnimation format, you can do character.animations = {animations} to make it an array with one element. If you want to keep existing animations for different armors on top of your animation, that's a tiny bit more complex.
Game gives an error: "Error while loading entity prototype "character" (character): Key "idle_with_gun" not found in property tree at ROOT.character.character.animations[0]"
But there is no "idle_with_gun" in the default animations file. It's driving me insane.
Nota bene: If I edit "character-animations.lua" directly, it responds correctly - I can change paths, parameters of the sprite and animation itself (speed, scale, e.t.c.). It's OK method. But I want make it all beautifully, you know? Make it right way, as the modders do.
Re: Need help with character sprites replacement!
It is defined in base/prototypes/entity/entities.lua on line 759. And it uses the fields from character-animations.lua, but the fields are named differently
