Page 1 of 1

Default cargoes always replaced.

Posted: 13 Jul 2019 11:19
by Erato
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?

Re: Default cargoes always replaced.

Posted: 13 Jul 2019 15:39
by jfs
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.

Re: Default cargoes always replaced.

Posted: 13 Jul 2019 15:46
by Erato
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 :\