"Cannot identify image file" -- what's wrong with my sprite?

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
Ben79487
Engineer
Engineer
Posts: 4
Joined: 12 Jul 2019 17:58

"Cannot identify image file" -- what's wrong with my sprite?

Post by Ben79487 »

I was creating a garbage industry tile (you know, the one with Dumpsters) and for some reason, one of my Dumpster sprites (0x01) keeps on throwing the "Cannot identify image file" error. The other two don't.

[viewtopic.php?f=26&t=85439&p=1222625&hi ... e#p1222625][I've read this thread.]

However, all files are saved under the DOS palette in GIMP, and exported to PNG. I checked and unchecked the "Save color profile" option.

Can somebody please tell me what I'm doing wrong?
Attachments
The one that causes the error
The one that causes the error
IndTile_0x01.png (4.02 KiB) Viewed 1267 times
Okay
Okay
IndTile_0x00.png (4.64 KiB) Viewed 1267 times
Okay
Okay
IndTile_0x02.png (4.39 KiB) Viewed 1267 times
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: "Cannot identify image file" -- what's wrong with my sprite?

Post by Gwyd »

Could you also post the source code, as the issue may lay there
Ben79487
Engineer
Engineer
Posts: 4
Joined: 12 Jul 2019 17:58

Re: "Cannot identify image file" -- what's wrong with my sprite?

Post by Ben79487 »

Here's the code:

Code: Select all

// CARGOS

// Garbage

spriteset (spriteset_garbage, "gfx/Cargo_Garbage.png") {
	[0, 0, 16, 16, 0, 0]
}
item (FEAT_CARGOS, item_cargo_garbage, 12) {
	property {
		number: 12;
		type_name: string(STR_NAME_GARBAGE);
		unit_name: string(STR_NAME_GARBAGE);
		units_of_cargo: TTD_STR_BAGS;
		items_of_cargo: string(STR_LONG_NAME_GARBAGE);
		type_abbreviation: string(STR_ABBR_NAME_GARBAGE);
		sprite: NEW_CARGO_SPRITE;
		weight: 0.3;
		penalty_lowerbound: 17;
		single_penalty_length: 10;
		price_factor: 199;
		station_list_colour: 44;
		cargo_payment_list_colour: 44;
		is_freight: 1;
		cargo_classes: bitmask(CC_EXPRESS, CC_BULK, CC_COVERED);
		cargo_label: "GARB";
		town_growth_effect: TOWNGROWTH_GOODS;
		town_growth_multiplier: 0.5;
		capacity_multiplier: 2.5;
	}
	graphics {
		default: spriteset_garbage;
	}
}

spriteset (spriteset_waste, "gfx/Cargo_Waste.png") {
	[0, 0, 16, 16, 0, 0]
}
item (FEAT_CARGOS, item_cargo_waste, 13) {
	property {
		number: 13;
		type_name: string(STR_NAME_WASTE);
		unit_name: string(STR_NAME_WASTE);
		units_of_cargo: TTD_STR_LITERS;
		items_of_cargo: string(STR_LONG_NAME_WASTE);
		type_abbreviation: string(STR_ABBR_NAME_WASTE);
		sprite: NEW_CARGO_SPRITE;
		weight: 0.5;
		penalty_lowerbound: 17;
		single_penalty_length: 10;
		price_factor: 199;
		station_list_colour: 34;
		cargo_payment_list_colour: 34;
		is_freight: 1;
		cargo_classes: bitmask(CC_EXPRESS, CC_LIQUID, CC_COVERED);
		cargo_label: "WSTE";
		town_growth_effect: TOWNGROWTH_GOODS;
		town_growth_multiplier: 0.5;
		capacity_multiplier: 1;
	}
	graphics {
		default: spriteset_waste;
	}
}

cargotable {
	PASS, COAL, MAIL, OIL_,
	LVST, GOOD, GRAI, WOOD,
	IORE, STEL, VALU, PAPR,
	WHEA, FOOD, GOLD, RUBR,
	FRUT, MAIZ, CORE, WATR,
	DIAM, BATT, BUBL, COLA,
	CTCD, FZDR, PLST, SUGR,
	SWET, TOFF, TOYS,
	GARB, WSTE
}

// INDUSTRIES

// Garbage Collection Center

spriteset (spriteset_indtile_0x00, "gfx/IndTile_0x00.png") {
	[0, 86, 64, 44, 0, 0]
}
spritelayout spritelayout_indtile_0x00 {
	ground {
		sprite: GROUNDSPRITE_CONCRETE;
	}
	building {
		sprite: spriteset_indtile_0x00;
		zextent: 14;
	}
}
item (FEAT_INDUSTRYTILES, item_indtile_0x00, 0x00) {
	property {
		substitute: 0x78;
		accepted_cargos: [];
		land_shape_flags: bitmask(LSF_CANNOT_LOWER_SE_EDGE);
	}
	graphics {
		default: spritelayout_indtile_0x00;
	}
}

spriteset (spriteset_indtile_0x01, "gfx/IndTile_0x01.png") {
	[0, 86, 64, 44, 0, 0]
}
spritelayout spritelayout_indtile_0x01 {
	ground {
		sprite: GROUNDSPRITE_CONCRETE;
	}
	building {
		sprite: spriteset_indtile_0x01;
		zextent: 16;
	}
}
item (FEAT_INDUSTRYTILES, item_indtile_0x01, 0x01) {
	property {
		substitute: 0x78;
		accepted_cargos: [];
		land_shape_flags: bitmask(LSF_CANNOT_LOWER_SE_EDGE, LSF_CANNOT_LOWER_NW_EDGE);
	}
	graphics {
		default: spritelayout_indtile_0x01;
	}
}

spriteset (spriteset_indtile_0x02, "gfx/IndTile_0x02.png") {
	[0, 86, 64, 44, 0, 0]
}
spritelayout spritelayout_indtile_0x02 {
	ground {
		sprite: GROUNDSPRITE_CONCRETE;
	}
	building {
		sprite: spriteset_indtile_0x02;
		zextent: 14;
	}
}
item (FEAT_INDUSTRYTILES, item_indtile_0x02, 0x02) {
	property {
		substitute: 0x78;
		accepted_cargos: [];
		land_shape_flags: bitmask(LSF_CANNOT_LOWER_NW_EDGE);
	}
	graphics {
		default: spritelayout_indtile_0x02;
	}
}

tilelayout garbage_collection_layout_1 {
	0, 0: item_indtile_0x00;
	0, 1: item_indtile_0x01;
	0, 2: item_indtile_0x02;
}

tilelayout garbage_collection_layout_2 {
	0, 0: item_indtile_0x00;
	0, 1: item_indtile_0x01;
	0, 2: item_indtile_0x01;
	0, 3: item_indtile_0x02;
}
item (FEAT_INDUSTRIES, item_ind_garbage_collection, 0x02) {
	property {
		substitute: 0x00;
		layouts: [garbage_collection_layout_1, garbage_collection_layout_2];
		life_type: IND_LIFE_TYPE_ORGANIC;
		closure_msg: TTD_STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS;
		fund_cost_multiplier: 45;
		prod_cargo_types: [cargotype("GARB")];
		prod_multiplier: [8];
		min_cargo_distr: 5;
		conflicting_ind_types: [industry_type(IND_TYPE_NEW, 0x02)]; //do when landfill's done
		prob_random: 159;
		prob_in_game: 189;
		map_colour: 44;
		spec_flags: bitmask(IND_FLAG_ONLY_IN_TOWNS);
		new_ind_msg: TTD_STR_NEWS_INDUSTRY_CONSTRUCTION;
		name: string(STR_NAME_GARB_COLLECT);
		prospect_chance: 1;
		remove_cost_multiplier: 255;
	}
}

Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 24 guests