Animation Confusion [Resolved]

Place to get help with not working mods / modding interface.
User avatar
Zombiee
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon Nov 07, 2016 8:50 pm
Contact:

Animation Confusion [Resolved]

Post by Zombiee »

I'm attempting make add a tinted layer for mining drills and run into this error:
Error while loading entity prototype "electric-mining-drill" (mining-drill): Frame count in hr_version doesn't match normal frame count in property tree at ROOT.mining-drill.electric-mining-drill.animations.north.hr_version
Using the HR code but not flagging it as 'hr_version' works fine but has a high res image by default. Ditching the layer thing makes no difference. Looking in data/base/prototypes/entity, it appears that both the std and HR versions of the mining drill are both listed as 64 frames there so I'm at a loss.

I wasn't able to find anything helpful via searching and browsing, but I may be lacking the vocabulary to make good searches. I'm very much a novice at every facet of what I'm trying to do, so hopefully it's something stupidly simple. Any help would be greatly appreciated.

Code I'm using:

Code: Select all

data.raw["mining-drill"]["electric-mining-drill"]["animations"]["north"] = {
						priority = "extra-high",
						width = 110,
						height = 114,
						line_length = 8,
						shift = {0.2, -0.2},
						filename = "__ShinyBobGFX__/graphics/entity/drills/north-0.png",
						frame_count = 64,
						animation_speed = 0.75,
						run_mode = "forward-then-backward",
					    hr_version = {
							layers = {
							{
							priority = "extra-high",
							width = 196,
							height = 226,
							line_length = 8,
							shift = {0, -0.2},
							filename = "__ShinyBobGFX__/graphics/entity/drills/hr-electric-mining-drill-N.png",
							frame_count = 64,
							animation_speed = 0.75,
							scale = 0.5,
							run_mode = "forward-then-backward",
							},
							{
							priority = "extra-high",
							width = 196,
							height = 226,
							line_length = 8,
							shift = {0, -0.2},
							filename = "__ShinyBobGFX__/graphics/entity/drills/hr-electric-mining-drill-N-tint.png",
							frame_count = 64,
							animation_speed = 0.75,
							scale = 0.5,
							run_mode = "forward-then-backward",
							tint = addon_blue
							}}}}
User avatar
Zombiee
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon Nov 07, 2016 8:50 pm
Contact:

Re: Animation Confusion [Resolved]

Post by Zombiee »

Ok, I figured out how I'm an idiot this time. I'll leave the solution and forum post up rather than deleting, hopefully someone else screws up the same thing and then thinks I'm smart someday.

It seems if you are defining layers AND highres/std images you have to do them in the correct order which I was not. You also have to define the same number of layers for highres as for standard. I think the error of frame count had nothing to do with frame_count but more to do with the count of items between { }.

The following works, what I did above did not.

Code: Select all

data.raw["mining-drill"]["electric-mining-drill"]["animations"]["north"] = {
layers = {
{"Std res layer 1 info"
hr_version={"HR layer 1 info"}
},
{
"Std res layer 2 info"
hr_version={HR layer 2 info"}
}}}
Post Reply

Return to “Modding help”