I want to limit the production of a cargo in the sense that if a certain amount of it is already waiting to be transported, no more is produced until the amount waiting has dropped again below some value, in order to avoid the sometimes ridiculously high amounts of cargo around at certain stations, in particular for the primary industries.
I'm trying to use the code fragment below, but nothing is produced at all
My problem is that I am not even sure if the problem is from the produce() function or the switch block, so that produce is never even reached?!?
Or is it already the produce_cargo_arrival function, since I also want to produce MILK also with no other cargo arriving, maybe just FMSP later to boost production.
(There is additional code in the property and graphics sections but I believe that is irrelevant here)
Code: Select all
produce(Cow_Farm_prod_cb1, [], [MILK: 16;])
produce(Cow_Farm_empty_prod, [], [])
switch(FEAT_INDUSTRIES, SELF, Cow_Farm_prod_cb0, produced_cargo_waiting("MILK"))
{
0..10000: Cow_Farm_prod_cb1;
Cow_Farm_empty_prod;
}
item(FEAT_INDUSTRIES, Cow_Farm, 21) {
property {
cargo_types: [accept_cargo("FMSP"), produce_cargo("MILK",0), produce_cargo("LVST",0)];
}
graphics {
produce_cargo_arrival: Cow_Farm_prod_cb0;
}
}