Page 1 of 1

Mail service disappears after installing Real Industries newgrf. (code)

Posted: 15 Apr 2023 10:47
by temporal8
Hello, yesterday a user reported to me that when installing Real Industries the mail service disappears and it is true, I checked it myself.

I have gone through my code and found nothing to make that happen, Do I need to add some line of code so that newgrf does not remove the mail production from the houses?

Before installing Real Industries newgrf:
before real industries.png
before real industries.png (58.55 KiB) Viewed 3773 times
After installing Real Industries newgrf:
after real industries.png
after real industries.png (57.69 KiB) Viewed 3773 times
These are the only Real Industries code lines where the Mail cargo appears:

Code: Select all

/********************************************
 * CARGO TABLES
*********************************************/
cargotable {
COAL,
GOOD,
GRAI,
IORE,
MAIL,
LVST,
OIL_,
PASS,
STEL,
VALU,
WOOD,
MAIZ,
WDPR,
WORK,	
STUD,
OTI2,
TRSH,
VEHI,
PRIS,
FOOD,
PLAY,
PETR,
RUBR,
PLAS,
TYRE,
HVEH,
}

Code: Select all

   spriteset(cargoicon_mail) { [10 + 20 * 2, 10 + 20 * 0, 10, 10, 0, 0, "gfx/other/cargoicons.png"] }

    item(FEAT_CARGOS, mail, 5) {
        property {
            number: 5;
            type_name: TTD_STR_CARGO_PLURAL_MAIL;
            unit_name: TTD_STR_CARGO_SINGULAR_MAIL;
            type_abbreviation: TTD_STR_ABBREV_MAIL;
            sprite: NEW_CARGO_SPRITE;
            weight: 0.25;
            station_list_colour: 15;
            cargo_payment_list_colour: 15;
            is_freight: 1;
            cargo_classes: bitmask(CC_MAIL);
            cargo_label: "MAIL";
            town_growth_effect: TOWNGROWTH_MAIL;
            town_growth_multiplier: 1.0;
            units_of_cargo: TTD_STR_BAGS;
            items_of_cargo: TTD_STR_QUANTITY_MAIL;
            penalty_lowerbound: 6;
            single_penalty_length: 24;
            price_factor: 156;
            capacity_multiplier: 2;
        }
        graphics {
            cargoicon_mail;
        }
    }
Thanks in advance.

Re: Mail service disappears after installing Real Industries newgrf. (code)

Posted: 15 Apr 2023 11:47
by Brickblock1
I believe your problem comes from mail having id and number 5. In order for it to work correctly you should use id and number 2. This is because houses don't use labels for mail but rather id/number. This same issue also breaks some old airplane sets.

Re: Mail service disappears after installing Real Industries newgrf. (code)

Posted: 15 Apr 2023 21:34
by Eddi
while here, you should probably also make sure that GOOD and FOOD are in the same places as the original cargos.

compare with the "Slot (ID)" column here

Re: Mail service disappears after installing Real Industries newgrf. (code)

Posted: 16 Apr 2023 21:52
by andythenorth

Re: Mail service disappears after installing Real Industries newgrf. (code)

Posted: 17 Apr 2023 01:58
by temporal8
Thanks A LOT guys! :bow: