Maximum number of frames

Place to get help with not working mods / modding interface.
User avatar
ThaPear
Fast Inserter
Fast Inserter
Posts: 226
Joined: Fri May 30, 2014 8:05 am
Contact:

Maximum number of frames

Post by ThaPear »

Is there a maximum number of frames I can specify for a single car-type prototype?

Whenever I try to specify more than 64 frames the game fails to load with the error message "Error while loading entity prototype "name" (car): Invalid StripeIterator"
My layer definition is shown below.
When I change the direction-count to 64 and comment the bottom two image definitions, it works.

Code: Select all

{
          width = 48,
          height = 48,
          frame_count = 2,
          axially_symmetrical = false,
          direction_count = 128,
          shift = {0, -0.1875},
          animation_speed = 8,
          max_advance = 0.2,
          stripes = util.multiplystripes(2,
          {
            {
             filename = "__Mod__/image-1.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-2.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-3.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-4.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
          })
        },
Last edited by ThaPear on Thu Jun 04, 2015 1:12 pm, edited 1 time in total.
jorgenRe
Filter Inserter
Filter Inserter
Posts: 535
Joined: Wed Apr 09, 2014 3:32 pm
Contact:

Re: Maximum number of frames

Post by jorgenRe »

Direction count have to be all height in frames added together so:
32 + 32 + 32 = 96 so for you:
direction_count = 96
THat is what i think is the way to fix it as i see in vanilla the car has
direction_count = 64
When the combined height in frames = 64 (22 + 22 + 20 = 64)
Logo
Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces
User avatar
ThaPear
Fast Inserter
Fast Inserter
Posts: 226
Joined: Fri May 30, 2014 8:05 am
Contact:

Re: Maximum number of frames

Post by ThaPear »

jorgenRe wrote:Direction count have to be all height in frames added together so:
32 + 32 + 32 = 96 so for you:
direction_count = 96
THat is what i think is the way to fix it as i see in vanilla the car has
direction_count = 64
When the combined height in frames = 64 (22 + 22 + 20 = 64)
Nope, that doesn't work, that gives the same error. With 96 and with 128, depending on if I comment one image out.

Any number 64 and below works, and none above 64 work. So I guess the answer to my question is clear.
jorgenRe
Filter Inserter
Filter Inserter
Posts: 535
Joined: Wed Apr 09, 2014 3:32 pm
Contact:

Re: Maximum number of frames

Post by jorgenRe »

Hmmm when looking in the entities.lua file i found that:
util.multiplystripes(2
is only present at the mask section, however in the section that looks to be the same as you (except the files used) does not, so i wonder if removing util.multiplystripes(2
and just having:
stripes =
Might be the soloution :)
BTW could you include the whole folder of your mod as two heads are prob better than just 1 :D!

Edit also remember to remove the " ) " from the " }) " nearly at the bottom.
Logo
Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces
YuokiTani
Smart Inserter
Smart Inserter
Posts: 1037
Joined: Thu May 08, 2014 7:57 pm
Contact:

Re: Maximum number of frames

Post by YuokiTani »

i think you don't need the stripe if you can make all into 1 sheet as in the factorio-versions before.
your sheet needs to be only smaller then 2048x2048.

the mess with sheet-splits, separate shadow-sheets comes from multiplayer and the color-overlay. same to tanks, player-graphics.
player-sheet contains 22 x 8 = 176 single frames ... in 1 sheet.

unfortunately all changes undocumented and uncommented.
User avatar
ThaPear
Fast Inserter
Fast Inserter
Posts: 226
Joined: Fri May 30, 2014 8:05 am
Contact:

Re: Maximum number of frames

Post by ThaPear »

I revisited the problem today and I have successfully gotten it to work with the following code:
You'll notice the stripe is gone and the frame count is now 1.
It now only fails when using more than 128 frames. So I guess that's the real limit.
Thanks for the help guys.

Code: Select all

{
					width = 144,
					height = 144,
					frame_count = 1,
					axially_symmetrical = false,
					direction_count = 117,
					shift = {0, -0.1875},
					animation_speed = 8,
					max_advance = 0.2,
					stripes =
					{
						{
							filename = "__Mod__/image-1.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-2.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-3.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-4.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-5.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-6.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-7.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-8.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-9.png",
							width_in_frames = 1,
							height_in_frames = 5,
						},
					}
				},
I'm still using separate spritesheets because I do not know an easy way to change a spritesheet from:
1
2
3
4
5
to:
1 2 3 4
5 6 7 8
Post Reply

Return to “Modding help”