I'm trying to code a locomotive with more than one livery option. I know this can be done without too much difficulty for vehicles that carry cargo, but my locomotive does not. Can anyone point me to a code snippet or example of how this could be done? I'm confused about whether I need a cargotable block to define some kind of custom cargo or whether I can use a predefined dummy, and whether I need to implement this using refittable_cargo_classes or cargo_allow_refit. I tried something like
Code: Select all
switch (FEAT_TRAINS, SELF, SWITCH_U4A_RECOLOUR, cargo_subtype) {
0: return string(STR_COLOUR_COMPANY);
1: return string(STR_COLOUR_GREEN);
2: return string(STR_COLOUR_BLUE);
return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}
item (FEAT_TRAINS, ITEM_TRAIN_U4A) {
property {
//normal properties and stuff
refittable_cargo_classes: bitmask(CC_SPECIAL);
//more stuff
}
graphics {
default: SWITCH_U4A_GRAPHICS;
purchase: SPRITESET_U4A_PURCHASE;
articulated_part: SWITCH_U4A_ARTICULATED_PART;
length: SWITCH_U4A_LENGTH;
visual_effect_and_powered: SWITCH_U4A_VISUAL;
cargo_subtype_text: SWITCH_U4A_RECOLOUR;
}
}
Thanks in advance