Need help with custom animation

Place to get help with not working mods / modding interface.
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Need help with custom animation

Post 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?
Image

Aligning and placing 74 induvidual pictures is kind of a pain in the ass XD any quick way to do it?
Thanks in advance :)
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Need help with custom animation

Post by daniel34 »

YuokiTani posted a few tools here:
Sprite-Sheet-Tools
quick links: log file | graphical issues | wiki
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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)
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Need help with custom animation

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post by YoloJoe »

Someone heeeelp meeee :( :cry: 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...
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Need help with custom animation

Post 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
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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.
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Need help with custom animation

Post 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.
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Need help with custom animation

Post by Arch666Angel »

how big is the actual sprite you are using?

like I said delete the crop cache
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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.
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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...
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

Re: Need help with custom animation

Post 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"
Post Reply

Return to “Modding help”