I'm playing with NML and trying to code a few cargos and industries and ran into a problem producing cargo.
I implemented the produce_256_ticks callback where I produce the same amount from the amount of input cargo, however a single train and a single station is usually loaded between 30-36 items out of 50.
It looks like Pasture will indeed produce 50 units (5 units was produced in 2 months ago), but only a portion is loaded onto the train. Does this affect any game settings?
What is the problem?
Thanks for the tips.
Code: Select all
produce(empty_prod, [], [])
produce(pasture_prod256_prod,
[LAMB: LOAD_TEMP(4);],
[SHEP: LOAD_TEMP(4);],
0
)
switch(FEAT_INDUSTRIES, SELF, pasture_256_prod_cb0, [
STORE_TEMP(min(incoming_cargo_waiting("LAMB"), 5), 4),
incoming_cargo_waiting("LAMB")
]) {
0: empty_prod;
pasture_prod256_prod;
}
switch(FEAT_INDUSTRIES, SELF, pasture_extra_text, [
STORE_TEMP(this_month_production("SHEP") |
production_rate("SHEP") << 16, 0x100)
]) {
return string(STR_IND_EXTRA_PASTURE);
}
item(FEAT_INDUSTRIES, pasture, 125) {
property {
substitute: INDUSTRYTYPE_TROPICAL_FACTORY;
layouts: [pasture_industry_layout_tilelayout];
life_type: IND_LIFE_TYPE_PROCESSING;
cargo_types: [accept_cargo("LAMB"), produce_cargo("SHEP", 0)];
min_cargo_distr: 1;
spec_flags: bitmask(IND_FLAG_LONG_CARGO_TYPE_LISTS,
IND_FLAG_BUILT_ONLY_BEFORE_1950);
name: string(STR_IND_PASTURE);
}
graphics {
produce_256_ticks: pasture_256_prod_cb0;
extra_text_industry: pasture_extra_text;
}
}