Default cargoes always replaced.

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 405
Joined: 25 May 2015 09:09
Location: The Netherlands

Default cargoes always replaced.

Post by Erato » 13 Jul 2019 11:19

Hey!

I'm working on a small industry set that I want to work as an addon to the basegame, but it seems to replace default cargoes, no matter what I do. I have the cargoes coded as:

Code: Select all

item(FEAT_CARGOS, CARGO_ELEC, ITEM_ELEC) {
	property {
        number: 26;
        type_name: string(STR_ELEC_TYPE_NAME);
        unit_name: string(STR_ELEC_UNIT_NAME);
        units_of_cargo: string(STR_ELEC_UNITS_CARGO);
        items_of_cargo: string(STR_ELEC_LONG_CARGO);
        type_abbreviation: string(STR_ELEC_ABBREVIATION);
        sprite: NEW_CARGO_SPRITE;
        weight: 1; // tonnes
        penalty_lowerbound: 200;
        single_penalty_length: 200;
        price_factor: 180.0;
        is_freight: 1;
        cargo_classes: bitmask(CC_PIECE_GOODS);
        cargo_label: "ELEC";
        town_growth_effect: TOWNGROWTH_NONE;
        town_growth_multiplier: 0.0;
        capacity_multiplier: 1.0;
	}
	graphics {
		default: SPRITESET_ELEC;
	}
}
I thought the "number" property was responsible for replacing cargoes, but it replaces them even if I choose the numbers to not overlap, but alas:
Image
Does anyone know what causes this and how to fix this?
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

User avatar
jfs
Director
Director
Posts: 538
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Default cargoes always replaced.

Post by jfs » 13 Jul 2019 15:39

In the definition line:

Code: Select all

item(FEAT_CARGOS, CARGO_ELEC, ITEM_ELEC)
The CARGO_ELEC part is the name you give the cargo within your NML file, but the thing you pur ITEM_ELEC for should as far as I know be the cargo number you base your new cargo on.
You don't actually need the number property at all. Try leaving it out.

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 405
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Default cargoes always replaced.

Post by Erato » 13 Jul 2019 15:46

jfs wrote:
13 Jul 2019 15:39
In the definition line:

Code: Select all

item(FEAT_CARGOS, CARGO_ELEC, ITEM_ELEC)
The CARGO_ELEC part is the name you give the cargo within your NML file, but the thing you pur ITEM_ELEC for should as far as I know be the cargo number you base your new cargo on.
You don't actually need the number property at all. Try leaving it out.
Thanks! The ID's did indeed overlap. I thought the ID's were local, like they are for trains. Guess not :\
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest