grf { grfid: "frVS"; name: string(STR_GRF_NAME); desc: string(STR_GRF_DESC); version: 1; min_compatible_version: 1; } template templ(row) { [ 128, 128*row, 128, 128, -60, -98] [ 256, 128*row, 128, 128, -72, -89] [ 384, 128*row, 128, 128, -64, -95] [ 512, 128*row, 128, 128, -52, -91] [ 640, 128*row, 128, 128, -60, -98] [ 768, 128*row, 128, 128, -72, -89] [ 896, 128*row, 128, 128, -64, -95] [ 1024, 128*row, 128, 128, -52, -91] } template templ_back(row) { [ 640, 128*row, 128, 128, -60, -98] [ 768, 128*row, 128, 128, -72, -89] [ 896, 128*row, 128, 128, -64, -95] [ 1024, 128*row, 128, 128, -52, -91] [ 128, 128*row, 128, 128, -60, -98] [ 256, 128*row, 128, 128, -72, -89] [ 384, 128*row, 128, 128, -64, -95] [ 512, 128*row, 128, 128, -52, -91] } spriteset(set_empty) { [] [] [] [] [] [] [] [] } spriteset (set_base_front, "dummy.png") { templ( 0) } alternative_sprites(set_base_front, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_base.png") { templ( 0) } spriteset (set_base_back, "dummy.png") { templ_back( 1) } alternative_sprites(set_base_back, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_base.png") { templ_back( 1) } spriteset (set_base_middle, "dummy.png") { templ( 2) } alternative_sprites(set_base_middle, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_base.png") { templ( 2) } spriteset (set_cc_front, "dummy.png") { templ( 0) } alternative_sprites(set_cc_front, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_cc_shading.png", "slug_cc_mask.png") { templ( 0) } spriteset (set_cc_back, "dummy.png") { templ_back( 1) } alternative_sprites(set_cc_back, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_cc_shading.png", "slug_cc_mask.png") { templ_back( 1) } spriteset (set_cc_middle, "dummy.png") { templ( 2) } alternative_sprites(set_cc_middle, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_cc_shading.png", "slug_cc_mask.png") { templ( 2) } spriteset (set_pilot0, "dummy.png") { templ( 4) } alternative_sprites(set_pilot0, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 4) } spriteset (set_pilot1, "dummy.png") { templ( 5) } alternative_sprites(set_pilot1, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 5) } spriteset (set_pilot2, "dummy.png") { templ( 6) } alternative_sprites(set_pilot2, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 6) } spriteset (set_pilot3, "dummy.png") { templ( 7) } alternative_sprites(set_pilot3, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 7) } spriteset (set_pilot4, "dummy.png") { templ( 8) } alternative_sprites(set_pilot4, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 8) } spriteset (set_pilot5, "dummy.png") { templ( 9) } alternative_sprites(set_pilot5, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ( 9) } spriteset (set_pilot6, "dummy.png") { templ(10) } alternative_sprites(set_pilot6, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ(10) } spriteset (set_pilot7, "dummy.png") { templ(11) } alternative_sprites(set_pilot7, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ(11) } spriteset (set_pilot8, "dummy.png") { templ(12) } alternative_sprites(set_pilot8, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ(12) } spriteset (set_pilot9, "dummy.png") { templ(13) } alternative_sprites(set_pilot9, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "slug_pilot.png") { templ(13) } spritegroup group_pilot0 { loading: set_empty; loaded: set_pilot0; } spritegroup group_pilot1 { loading: set_empty; loaded: set_pilot1; } spritegroup group_pilot2 { loading: set_empty; loaded: set_pilot2; } spritegroup group_pilot3 { loading: set_empty; loaded: set_pilot3; } spritegroup group_pilot4 { loading: set_empty; loaded: set_pilot4; } spritegroup group_pilot5 { loading: set_empty; loaded: set_pilot5; } spritegroup group_pilot6 { loading: set_empty; loaded: set_pilot6; } spritegroup group_pilot7 { loading: set_empty; loaded: set_pilot7; } spritegroup group_pilot8 { loading: set_empty; loaded: set_pilot8; } spritegroup group_pilot9 { loading: set_empty; loaded: set_pilot9; } switch(FEAT_TRAINS, SELF, switch_pilot, getbits(random_bits, 4, 4)) { 0: group_pilot0; 1: group_pilot0; 2: group_pilot1; 3: group_pilot2; 4: group_pilot2; 5: group_pilot3; 6: group_pilot4; 7: group_pilot4; 8: group_pilot5; 9: group_pilot6; 10: group_pilot6; 11: group_pilot7; 12: group_pilot7; 13: group_pilot8; 14: group_pilot8; default: group_pilot9; } switch(FEAT_TRAINS, SELF, switch_front, [ STORE_TEMP((getbits(extra_callback_info1, 8, 8) <= 1 ? 0x80000000 : 0x00000000) + PALETTE_CC_FIRST + getbits(random_bits, 0, 4), 0x100), getbits(extra_callback_info1, 8, 8) ]) { 0: set_base_front; 1: set_cc_front; 2: switch_pilot; } switch(FEAT_TRAINS, SELF, switch_middle, [ STORE_TEMP((getbits(extra_callback_info1, 8, 8) == 0 ? 0x80000000 : 0x00000000) + PALETTE_CC_FIRST + getbits(random_bits, 0, 4), 0x100), getbits(extra_callback_info1, 8, 8) ]) { 0: set_base_middle; 1: set_cc_middle; } switch(FEAT_TRAINS, SELF, switch_back, [ STORE_TEMP((getbits(extra_callback_info1, 8, 8) == 0 ? 0x80000000 : 0x00000000) + PALETTE_CC_FIRST + getbits(random_bits, 0, 4), 0x100), getbits(extra_callback_info1, 8, 8) ]) { 0: set_base_back; 1: set_cc_back; } switch(FEAT_TRAINS, SELF, switch_position2, position_in_vehid_chain_from_end) { 0: switch_back; default: switch_middle; } switch(FEAT_TRAINS, SELF, switch_position, position_in_vehid_chain) { 0: switch_front; default: switch_position2; } item(FEAT_TRAINS, test_vehicle, 0) { property { misc_flags: 0x80; // enable sprite stacks sprite_id: SPRITE_ID_NEW_TRAIN; } graphics { default: switch_position; } }