Hi,
I am working on non-square assemblers (1x2, 1x3, ..).
When defining a 1x1 assembler, I need only one picture/animation for the entity.
But now I need two pictures, one for horizontal, one for vertical use.
Been checking other mods but can't get the right way to get that done.
Can anyone point me to an example or documentation on this ?
Horizontal and Vertical animation/picture for assembler
Re: Horizontal and Vertical animation/picture for assembler
The oil refinery is a crafting machine, it has animations for all 4 directions: https://github.com/wube/factorio-data/b ... .lua#L9701
(data in json format, without the lua function here: https://my.mixtape.moe/ouqvio.json)
You can find the documentation here: https://wiki.factorio.com/Prototype/Cra ... #animation
(data in json format, without the lua function here: https://my.mixtape.moe/ouqvio.json)
You can find the documentation here: https://wiki.factorio.com/Prototype/Cra ... #animation
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Horizontal and Vertical animation/picture for assembler
Thanks Bilka.
In these and others I checked there are multiple pictures in one png file.
How are the individual pictures placed in the file/referred to in the definition ?
In these and others I checked there are multiple pictures in one png file.
How are the individual pictures placed in the file/referred to in the definition ?
Re: Horizontal and Vertical animation/picture for assembler
The frames are read from left to right, top to bottom (so, in rows). https://wiki.factorio.com/Types/Animation#line_length specifies how long those rows are, https://wiki.factorio.com/Types/Animation#frame_count specifies how many frames there are in total. https://wiki.factorio.com/Types/Animation#width and height determine the size of a single frame of the animation.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Horizontal and Vertical animation/picture for assembler
Thanks again, starting to understand and have first things working.
On make_4way_animation_from_spritesheet (and util.by_pixel), noticed I can use that in my data.lua.
Are there more of these helper functions ?
Do you know where these are defined ?
Any documentation available ?
On make_4way_animation_from_spritesheet (and util.by_pixel), noticed I can use that in my data.lua.
Are there more of these helper functions ?
Do you know where these are defined ?
Any documentation available ?
Re: Horizontal and Vertical animation/picture for assembler
That particular function is defined here: https://github.com/wube/factorio-data/b ... s.lua#L165 No documentation available, sadly.
Util functions are defined here: https://github.com/wube/factorio-data/b ... b/util.lua
Also no documentation available... You can use the functions by using require("util.lua"), the game will load that file (unless you have a file with the same name in your mod).
Util functions are defined here: https://github.com/wube/factorio-data/b ... b/util.lua
Also no documentation available... You can use the functions by using require("util.lua"), the game will load that file (unless you have a file with the same name in your mod).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.