template template_train20px(x,y){ //left_x, upper_y, width, height, offset_x, offset_y [ x, y, 8, 17, -3, -9] [ x+10, y, 15, 15, -8, -8] [ x+27, y, 20, 12, -5, -7] [ x+49, y, 15, 15, -2, -6] [ x+66, y, 8, 17, -3, -6] [ x+76, y, 15, 15, -15, -5] [ x+93, y, 20, 12, -15, -7] [ x+115, y, 15, 15, -10, -9] } template template_train32px(x,y){ //left_x, upper_y, width, height, offset_x, offset_y [ x, y, 8, 24, -3, -9] [ x+10, y, 21, 17, -13, -7] [ x+33, y, 32, 12, -17, -7] [ x+67, y, 21, 17, -5, -7] [ x+91, y, 8, 24, -3, -11] [ x+101, y, 21, 17, -16, -7] [ x+124, y, 32, 12, -15, -7] [ x+158, y, 21, 17, -10, -8] } template template_purchase(x,y){ //xpos, ypos, width, height, xoffset, yoffset [x,y,50,12,-25,-6] } spriteset(spriteset_GNRA1_Purchase, "gfx/GNRA1.png") { template_purchase(0, 0) } spriteset(spriteset_GNRA1, "gfx/GNRA1.png") { template_train32px(0, 13) } spriteset(spriteset_GNRA1T_GNR, "gfx/GNRA1T.png") { template_train20px(0, 13) } spriteset(spriteset_GNRA1T_LNER, "gfx/GNRA1T.png") { template_train20px(0, 31) } switch(FEAT_TRAINS,SELF, sw_GNRA1,cargo_subtype){ 0: spriteset_GNRA1T_GNR; 1: spriteset_GNRA1T_LNER; } switch (FEAT_TRAINS, SELF, switch_articulated_GNRA1, extra_callback_info1) { 1: return item_GNRA1; //use same vehicle for all parts return CB_RESULT_NO_MORE_ARTICULATED_PARTS; //stop adding vehicle parts } switch (FEAT_TRAINS, SELF, switch_spriteset_GNRA1, position_in_consist ) { 1: sw_GNRA1; spriteset_GNRA1; //default } switch (FEAT_TRAINS, SELF, switch_length_GNRA1, position_in_consist) { 1: return 5; return 8; } switch(FEAT_TRAINS,SELF,sw_GNRA1_cargo_subtype_text,cargo_subtype){ 0: return string(str_GNRGreen); 1: return string(str_LNERGreen); return CB_RESULT_NO_TEXT; } item (FEAT_TRAINS, item_GNRA1) { property { name: string(STR_NAME_GNRA1); climates_available: ALL_CLIMATES; introduction_date: date(1922,4,21); model_life: 5; retire_early: 1; vehicle_life: 10; reliability_decay: 20; refittable_cargo_classes: 0; cargo_allow_refit: [GOOD]; loading_speed: 3; cost_factor: 1; running_cost_factor: 1; sprite_id: SPRITE_ID_NEW_TRAIN; speed: 174 km/h; misc_flags: TRAIN_FLAG_NO_BREAKDOWN_SMOKE; refit_cost: 0; track_type: RAIL; ai_special_flag: AI_FLAG_CARGO; power: 1463 hp; running_cost_base: RUNNING_COST_STEAM; dual_headed: 0; default_cargo_type: GOOD; cargo_capacity: 1; weight: 93 ton; engine_class: ENGINE_CLASS_STEAM; tractive_effort_coefficient: 0.15; air_drag_coefficient: 0.25; effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_STEAM; extra_weight_per_wagon: 0; bitmask_vehicle_info: 0; } graphics { additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_steam),string(str_route_9),string(str_GNRA1_usage),string(str_GNRA1_eos),string(str_GNRA1_liveries))); can_attach_wagon: CB_RESULT_ATTACH_ALLOW; cargo_capacity: return 0; cargo_subtype_text: sw_GNRA1_cargo_subtype_text; articulated_part: switch_articulated_GNRA1; length: switch_length_GNRA1; default: switch_spriteset_GNRA1; purchase: spriteset_GNRA1_Purchase; colour_mapping: return PALETTE_CC_FIRST; } }