is cargo_input only called at gamestart?
Code: Select all
//Decide construction material acceptance depending on a variable
switch(FEAT_INDUSTRIES, SELF, NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_DECIDECARGOACCEPTANCECMAT, UCMP(last_month_production("COAL"), 20)) { 1..2: CMAT; }
//DummyCall
switch(FEAT_INDUSTRIES, SELF, NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_DUMMY, UCMP(0, 1)) { 0: CMAT; }
//Iterate through different cargotypes and decide in the next call
switch(FEAT_INDUSTRIES, SELF, NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_ITERATECARGOACCEPTANCE, extra_callback_info1)
{
0: PASS;
1: NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_DECIDECARGOACCEPTANCECMAT;
}
//Define the actual industry item
item(FEAT_INDUSTRIES, NCBI_INDUSTRY_COALMINE, -1)
{
property
{
substitute: 0;
override: 0;
map_colour: 160;
life_type: IND_LIFE_TYPE_EXTRACTIVE;
min_cargo_distr: 5;
layouts: [NCBI_TILELAYOUT_COALMINE];
name: string(NCBI_INDUSTRY_COALMINE_NAME);
cargo_types: [accept_cargo("PASS"), accept_cargo("MAIL"), accept_cargo("CMAT"), produce_cargo("COAL", 0)];
prob_map_gen: 14;
prob_in_game: 14;
prospect_chance: 1;
fund_cost_multiplier: 1;
nearby_station_name: string(NCBI_STRINGTEMPLATE_STATION_NAME, string(NCBI_STRINGTEMPLATE_TOWN_NAME), string(NCBI_INDUSTRY_COALMINE_STATIONNAME));
}
graphics
{
produce_256_ticks: NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_CHECKPRODUCTIONREQUIREMENTS;
cargo_input: NCBI_SWITCH_PRODUCTIONMECHANICS_COALMINE_ITERATECARGOACCEPTANCE;
}
}
So to clarify what i want to do is have the industry accept new types of cargo depending on various factors, id also like to use LOAD_PERM() as a factor to decide.
Also i can see this question coming up, so ill preemptively answer it: have i tried using "stop_accept_cargo" ?
Yes i have, but what that callback actually does, is stopping additional delivered cargo from entering the industry stockpile, it DOES NOT stop the cargo from showing up in the industry window.
If i synchronize it with the industrytile "cargo_amount_accept" and "cargo_type_accept", it will indeed completely stop it from accepting that cargo, even the station nearby, BUT it will still show up in the industry window.
Thats hella confusing for players! Also since i want to use the indication what cargos are accepted in the industry window to telegraph to my players: now this industry can be upgraded since it accepts construction materials, this is not an option.
If "cargo_input" would work dynamically depending on variables, i could also get rid of the "stop_accept_cargo" and "cargo_amount_accept" callbacks! IndustryTile could use the property "special_flags: bitmask(INDTILE_FLAG_ACCEPT_ALL)" and id be done with it.
Also, the industry callback "cargo_subtype_display" will edit text AFTER a cargo indicator in the industry window, so setting that to an empty string is also NOT a solution.
So as you can see ive already tried a couple of things here, maybe someone has an idea how to do it differently, or can just correct me if i made a mistake, or know how this callback actually functions. thanks in advance
as a sidenote, if it really only gets called at gamestart, someone should explicitly mentiont hat in the nml wiki
also this forum wasnt able to let me search for cargo_input, it coulnt handle the underscore, instead it will split the search query to cargo and input