Accepts cargo error.

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

Moderator: Graphics Moderators

Post Reply
temporal8
Route Supervisor
Route Supervisor
Posts: 429
Joined: 17 May 2019 14:15

Accepts cargo error.

Post by temporal8 »

I am having an error when I create a station, it does not accept any cargo despite being attached to the university. (In this case must accept students and produce workers)

Code: Select all

switch (FEAT_INDUSTRIES, SELF, switch_check_road_university, nearby_tile_class(6,0) == TILE_CLASS_ROAD
   ) {
  1: CB_RESULT_LOCATION_ALLOW;
  return CB_RESULT_LOCATION_DISALLOW;
}
        item(FEAT_INDUSTRIES, university, 73) {
                property {
                substitute: 0;
                life_type: IND_LIFE_TYPE_PROCESSING;
                closure_msg: TTD_STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS;
                prod_increase_msg: TTD_STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL;
                prod_decrease_msg: TTD_STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL;
                new_ind_msg: TTD_STR_NEWS_INDUSTRY_CONSTRUCTION;
                min_cargo_distr: 5;
                map_colour: 169;
               spec_flags: bitmask(IND_FLAG_LONG_CARGO_TYPE_LISTS, IND_FLAG_ONLY_IN_LARGE_TOWNS);
                layouts:
[
    university_industry_layout_1_tilelayout,

];
                name: string(STR_IND_university);
                nearby_station_name: string(STR_STATION, string(STR_TOWN));
                prob_map_gen: 5;
                prob_random: 13;
                prob_in_game: 6;
                prospect_chance: 0.75;
                fund_cost_multiplier: 140;
                remove_cost_multiplier: 0;
                cargo_types:[accept_cargo("STUD", produce_cargo("WORK",1))];
                }
            }
      item(FEAT_INDUSTRIES, university, 73) {
 	graphics {
		location_check: switch_check_road_university;
  		extra_text_industry: return string(STR_EXTRA_university);
  }
}
industry-error2.png
industry-error2.png (874.52 KiB) Viewed 712 times

Any idea?
Real Projects 32bpp releases:

Real Semi Trucks 32bpp: viewtopic.php?t=90996
Real Houses Eyecandy Objects 32bp: viewtopic.php?t=90767
Real Ships 32bpp: viewtopic.php?t=90733
Real Industries 32bpp: viewtopic.php?t=90183
Real Houses Townset 32bp: viewtopic.php?p=1254605
Real Stations 32bpp: viewtopic.php?p=1255635
Real Cars 32bpp: viewtopic.php?p=1249244
Real Vehicles 32bpp: viewtopic.php?p=1253581
Real Bus 32bpp: viewtopic.php?p=1249245
Real Trucks 32bpp: viewtopic.php?p=1254468
Real Parks 32bpp: viewtopic.php?p=1250255
Argentina World Cup 2022 Champions Bus 32bpp viewtopic.php?p=1257026
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Accepts cargo error.

Post by PikkaBird »

It's also necessary for tiles in the coverage area to accept >8/8 of the cargo, in order for the station to accept it. Have you set acceptance for the industry tiles?
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Accepts cargo error.

Post by jfs »

There is also a flag on the industry you can set that automatically makes all tiles of the industry accept all the cargo types the industry requires.
temporal8
Route Supervisor
Route Supervisor
Posts: 429
Joined: 17 May 2019 14:15

Re: Accepts cargo error.

Post by temporal8 »

Thanks to both of you, I added this line and now it works correctly: special_flags: bitmask(INDTILE_FLAG_ACCEPT_ALL);

Have a good sunday. :bow:
Real Projects 32bpp releases:

Real Semi Trucks 32bpp: viewtopic.php?t=90996
Real Houses Eyecandy Objects 32bp: viewtopic.php?t=90767
Real Ships 32bpp: viewtopic.php?t=90733
Real Industries 32bpp: viewtopic.php?t=90183
Real Houses Townset 32bp: viewtopic.php?p=1254605
Real Stations 32bpp: viewtopic.php?p=1255635
Real Cars 32bpp: viewtopic.php?p=1249244
Real Vehicles 32bpp: viewtopic.php?p=1253581
Real Bus 32bpp: viewtopic.php?p=1249245
Real Trucks 32bpp: viewtopic.php?p=1254468
Real Parks 32bpp: viewtopic.php?p=1250255
Argentina World Cup 2022 Champions Bus 32bpp viewtopic.php?p=1257026
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 5 guests