Example #1:
Articulated vehicle, all parts have the same ID, no refit option, only first part of vehicle can transport cargo:
Code: Select all
switch(FEAT_TRAINS, SELF, switch_v1_capacity, position_in_vehid_chain%2) {
0: return 48;
return 0;
}
Example #2:
Vehicle from example #1, but cargo_subtype refit options are defined:
Code: Select all
switch(FEAT_TRAINS, SELF, switch_v2_capacity, position_in_vehid_chain%2) {
0: return 48;
return 0;
}
switch(FEAT_TRAINS, SELF, switch_v2_subtype_text, cargo_subtype) {
0: return string(STR_SUBTYPE_1);
1: return string(STR_SUBTYPE_2);
return CB_RESULT_NO_TEXT;
}
Code: Select all
empty
N/A
Typically, I use workaround to prevent displaying "N/A". You should leave at least 1 cargo unit in second part to do it:
Code: Select all
switch(FEAT_TRAINS, SELF, switch_v2_capacity, position_in_vehid_chain) {
0: return 48-1;
return 1;
}
But yesterday I tested the new example - articulated vehicle containing a few parts with different IDs and different cargo classes. Additionaly, cargo_subtype refit options are defined for this vehicle.
In this example the information displayed in the train info window looks totally unpredictable...
Where can I find the rules of collecting and displaying such information in train window?