Page 1 of 1
Need help with custom animation
Posted: Tue Apr 19, 2016 2:21 pm
by YoloJoe
Hello everyone!
I am trying to create a new machine for the game and I have made 74 pictures with the animation. Do any one of you know how I can stitch the 74 pictures together like the devs have done here?
Aligning and placing 74 induvidual pictures is kind of a pain in the ass XD any quick way to do it?
Thanks in advance

Re: Need help with custom animation
Posted: Tue Apr 19, 2016 2:31 pm
by daniel34
YuokiTani posted a few tools here:
Sprite-Sheet-Tools
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 5:19 pm
by YoloJoe
Ok, I have made picture now. Its 1729x1517 and each frame is 246x137. Now the game just returns error:
Code: Select all
Sprite outside of "(location)" (at 1967, 136, size 1x1 of 1722x1781)
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 5:28 pm
by Adil
Well last time I've checked it was imposible to tile 1729x1517 with integer number of 246x137 rectangles. Even the area of 1729x1517 is not multiple of individual sprite area.
Also, double check size definitions in prototypes.
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 5:46 pm
by YoloJoe
Someone heeeelp meeee

This shit is twisting my brain way to much xD
It's set to width = 246 and height = 137 in the code, because I started with the steam engine when creating the textures. The steam engine is also set to width = 246 and height = 137, but the only difference is the picture Im using...
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 5:51 pm
by Arch666Angel
OK first of: the max size for sprite sheets is 2048x2048 pixels keep that in mind.
If you set the picture/animation in the entity definition you have to set the size of one frame, then the total amount of frames (frames=x), then the number of frames in one line (line_length=x)
Another issue is that you might have to delete the crop-cache when fumbling around with new graphics/spritesheets.
Next issue is the count of individual frames you have, its an odd number, so either increase or the decrease them so the total frames can be divided by the line_length
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:32 pm
by YoloJoe
Arch666Angel wrote:OK first of: the max size for sprite sheets is 2048x2048 pixels keep that in mind.
If you set the picture/animation in the entity definition you have to set the size of one frame, then the total amount of frames (frames=x), then the number of frames in one line (line_length=x)
Another issue is that you might have to delete the crop-cache when fumbling around with new graphics/spritesheets.
Next issue is the count of individual frames you have, its an odd number, so either increase or the decrease them so the total frames can be divided by the line_length
Thanks for the good info, but I'm still getting an error..
Code: Select all
Sprite outside of (location) at 1721,136, size 1x1 of 1476x1644
Here is my code now:
Code: Select all
horizontal_animation =
{
filename = "location",
width = 246,
height = 137,
frame_count = 72,
line_length = 8,
shift = {1.34, -0.06} (what is this?)
},
I changed the number of frames to 72, so 72/8 = 9.
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:36 pm
by Arch666Angel
8x246=1968 that should be the width of your sprite sheet
9x137=1233 that should be the height of your sprite sheet
at least according to the settings you made, try deleting the crop-cache in the factorio folder
the shift={} lets you shift the picture around = adjust the position of the picture ingame.
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:39 pm
by YoloJoe
Oh, sorry. My picture is 6x12, so
Code: Select all
width = 246,
height = 137,
frame_count = 72,
line_length = 6,
Still getting error
Code: Select all
Sprite outside of (location) at 154,1859, size 1x1 of 1476x1644
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:41 pm
by Arch666Angel
how big is the actual sprite you are using?
like I said delete the crop cache
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:44 pm
by YoloJoe
Arch666Angel wrote:how big is the actual sprite you are using?
like I said delete the crop cache
I just deleted the crop cache, no success.
The entire sprite sheet is now 1476 x 1644
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 6:47 pm
by YoloJoe
YoloJoe wrote:
I just deleted the crop cache, no success.
The entire sprite sheet is now 1476 x 1644
and each sprite is 246x137.
Re: Need help with custom animation
Posted: Tue Apr 19, 2016 7:06 pm
by YoloJoe
Do you know what? Its the vertical texture thats fucking things up. Any way to remove it? I dont need it? Also, the pictures are still out of order...
Re: Need help with custom animation
Posted: Wed Apr 20, 2016 10:33 am
by YoloJoe
Its playing all the frames, but the stitching software is putting the images in the wrong order. I have named them "0001.png,0002.png,0003.png,0004.png.....0031.png.....0072.png"