From 86ad0d3d82673f0abf7d9ea1ab3ea15591546eef Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 30 Mar 2024 02:45:00 +0000 Subject: [PATCH] More push pull combinations (47+Mk3, 68+Mk3, 68+Mk4, 86+Mk3, 87+Mk3), Updated changelog --- docs/Push Pull.txt | 2 +- docs/changelog.txt | 5 ++++ src/trains/_spriteset/PushPull.pnml | 29 ++++++++++++++++++- .../Rolling Stock_Sprites/Mk3DVT.pnml | 8 +++-- .../Rolling Stock_Sprites/Mk4DVT.pnml | 1 + src/trains/diesel/BR047.pnml | 1 + src/trains/diesel/BR068.pnml | 21 +++++++++++++- src/trains/electric/BR86.pnml | 20 ++++++++++++- src/trains/electric/BR87.pnml | 20 ++++++++++++- src/trains/rollingstock/RM_TPO.pnml | 2 +- 10 files changed, 101 insertions(+), 8 deletions(-) diff --git a/docs/Push Pull.txt b/docs/Push Pull.txt index 571ba005..049dabe4 100644 --- a/docs/Push Pull.txt +++ b/docs/Push Pull.txt @@ -8,7 +8,7 @@ TPO PCV: 47, 57? Mk2 DBSO: 47, 57?, 37 -Mk3 DVT: 86, 87, *90, *67, 68, 47, 57?, 69? +Mk3 DVT: *86, *87, *90, *67, *68, 47*, 57?, 69? Mk4 DVT: *67, *89, *90, 91 diff --git a/docs/changelog.txt b/docs/changelog.txt index ee170803..45cb9096 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,8 +1,13 @@ # v2.7 - Added Mk3 DVT - Added Mk4 DVT as standalone (non-IC225) unit +- Added push-pull for Class 47 / Mk3 DVT - Added push-pull for Class 67 / Mk3 DVT - Added push-pull for Class 67 / Mk4 DVT +- Added push-pull for Class 68 / Mk4 DVT +- Added push-pull for Class 68 / Mk3 DVT +- Added push-pull for Class 86 / Mk3 DVT +- Added push-pull for Class 87 / Mk3 DVT - Added push-pull for Class 90 / Mk3 DVT - Added push-pull for Class 90 / Mk4 DVT - Added push-pull for Class 89 / Mk4 DVT diff --git a/src/trains/_spriteset/PushPull.pnml b/src/trains/_spriteset/PushPull.pnml index 5f7973c6..52895030 100644 --- a/src/trains/_spriteset/PushPull.pnml +++ b/src/trains/_spriteset/PushPull.pnml @@ -36,7 +36,7 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsRMTPO, [STORE_TEMP(num_vehs_ } // Mirror of BR47 -switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DMSOasBR47,cargo_subtype){ +switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR47,cargo_subtype){ 0: spriteset_BR47_BRGreen; 1: spriteset_BR47_BRBlue; 2: spriteset_BR47_Porterbrook; @@ -54,6 +54,14 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DMSOasBR47,cargo_subtype){ return CB_RESULT_NO_TEXT; } +// Mirror of BR68 +switch(FEAT_TRAINS, SELF, sw_PUSHPULL_DVTasBR68,cargo_subtype){ + 0: spriteset_BR68_DRS; + 1: spriteset_BR68_ScotRail; + 2: spriteset_BR68_Chiltern; + 3: spriteset_BR68_TPE; +} + // Mirror of BR67 switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR67,cargo_subtype){ 0: spriteset_BR67_EWS; @@ -67,6 +75,25 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR67,cargo_subtype){ 8: spriteset_BR67_DBCompany; } +// Mirror of 86 +switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR86, cargo_subtype){ + 0: spriteset_BR86_BRBlue; + 1: spriteset_BR86_IntercityExecutive; + 2: spriteset_BR86_IntercitySwallow; + 3: spriteset_BR86_RailfreightDistribution; + 4: spriteset_BR86_RailExpress; + 5: spriteset_BR86_EWS; + return CB_RESULT_NO_TEXT; +} + +// Mirror of 87 +switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR87, cargo_subtype){ + 0: spriteset_BR87_BRBlue; + 1: spriteset_BR87_IntercitySwallow; + 2: spriteset_BR87_Virgin; + return CB_RESULT_NO_TEXT; +} + // Mirror of BR89 switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR89, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){ 0: spriteset_BR89_IntercitySwallow; diff --git a/src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml b/src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml index 6d7ced0f..f89659d9 100644 --- a/src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml +++ b/src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml @@ -96,12 +96,16 @@ switch(FEAT_TRAINS,SELF, sw_BRMk3DVT,cargo_subtype){ // If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch switch(FEAT_TRAINS, PARENT, sw_BRMk3DVT_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { - 151: sw_PUSHPULL_DVTasBR67; // Class 67 + 440: sw_PUSHPULL_DVTasBR47; // Class 47 + 151: sw_PUSHPULL_DVTasBR67; // Class 67 + 196: sw_PUSHPULL_DVTasBR68; // Class 68 + 566: sw_PUSHPULL_DVTasBR86; // Class 86 + 567: sw_PUSHPULL_DVTasBR87; // Class 87 543: sw_PUSHPULL_DVTasBR90; // Class 90 sw_BRMk3DVT; // No compatible locomotive found, show normal sprites } -switch(FEAT_TRAINS,PARENT,sw_Mk3DVT_CheckPosition, position_in_articulated_veh_from_end){ +switch(FEAT_TRAINS, SELF,sw_Mk3DVT_CheckPosition, position_in_articulated_veh_from_end){ 0: sw_BRMk3DVT_PushPUll; // Attempt push pull sw_BRMk3DVT; // We aren't at the back of theconsist, show normal sprites } diff --git a/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml b/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml index 8f7c0542..535fe7a7 100644 --- a/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml +++ b/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml @@ -58,6 +58,7 @@ switch(FEAT_TRAINS,SELF, sw_BRMk4DVT,cargo_subtype){ // If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch switch(FEAT_TRAINS, PARENT, sw_BRMk4DVT_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { 151: sw_PUSHPULL_DVTasBR67; // Class 67 + 196: sw_PUSHPULL_DVTasBR68; // Class 68 418: sw_PUSHPULL_DVTasBR89; // Class 89 543: sw_PUSHPULL_DVTasBR90; // Class 90 sw_BRMk4DVT; // No compatible locomotive found, show normal sprites diff --git a/src/trains/diesel/BR047.pnml b/src/trains/diesel/BR047.pnml index e50fe309..223bab15 100644 --- a/src/trains/diesel/BR047.pnml +++ b/src/trains/diesel/BR047.pnml @@ -1,6 +1,7 @@ // If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch switch(FEAT_TRAINS, PARENT, sw_BR47_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { //483: sw_PUSHPULL_LocomotiveAsRMTPO; // Royal Mail TPO, uncommen this line when RMTPO has been changed to length 8 + 586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT sw_BR47; // No compatible locomotive found, show normal sprites } diff --git a/src/trains/diesel/BR068.pnml b/src/trains/diesel/BR068.pnml index b127adbc..022f1646 100644 --- a/src/trains/diesel/BR068.pnml +++ b/src/trains/diesel/BR068.pnml @@ -18,6 +18,8 @@ spriteset(spriteset_BR68_TPE, "gfx/BR68_v2.png") { template_train32px(0, 38) } +// This switch called when displaying as this locomotive +// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder switch(FEAT_TRAINS,SELF, sw_BR68,cargo_subtype){ 0: spriteset_BR68_DRS; 1: spriteset_BR68_ScotRail; @@ -33,6 +35,23 @@ switch(FEAT_TRAINS,SELF,sw_BR68_cargo_subtype_text,cargo_subtype){ return CB_RESULT_NO_TEXT; } +// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch +switch(FEAT_TRAINS, PARENT, sw_BR68_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { + 586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT + 585: sw_PUSHPULL_LocomotiveAsMk4DVT; // Mk4 DVT + sw_BR68; // No compatible locomotive found, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR68_CheckPosition, position_in_consist){ + 0: sw_BR68_PushPUll; // Attempt push pull + sw_BR68; // We aren't at the front of the consist, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR68_Sprites ,vehicle_is_reversed){ + 0: sw_BR68; // We're heading foward, show normal sprites + 1: sw_BR68_CheckPosition; // Attempt push pull +} + item (FEAT_TRAINS, item_BR68, 196) { property { name: string(STR_NAME_BR68); @@ -72,7 +91,7 @@ item (FEAT_TRAINS, item_BR68, 196) { can_attach_wagon: CB_RESULT_ATTACH_ALLOW; cargo_capacity: return 0; cargo_subtype_text: sw_BR68_cargo_subtype_text; - default: sw_BR68; + default: sw_BR68_Sprites; purchase: spriteset_BR68_Purchase; colour_mapping: return PALETTE_CC_FIRST; create_effect: diesel_create_visual_effect; diff --git a/src/trains/electric/BR86.pnml b/src/trains/electric/BR86.pnml index 8c5af07a..23337039 100644 --- a/src/trains/electric/BR86.pnml +++ b/src/trains/electric/BR86.pnml @@ -26,6 +26,8 @@ spriteset(spriteset_BR86_EWS, "gfx/electric/BR8X.png") { template_train32px(0, 163) } +// This switch called when displaying as this locomotive +// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder switch(FEAT_TRAINS,SELF, sw_BR86, cargo_subtype){ 0: spriteset_BR86_BRBlue; 1: spriteset_BR86_IntercityExecutive; @@ -46,6 +48,22 @@ switch(FEAT_TRAINS,SELF,sw_BR86_cargo_subtype_text,cargo_subtype){ return CB_RESULT_NO_TEXT; } +// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch +switch(FEAT_TRAINS, PARENT, sw_BR86_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { + 586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT + sw_BR86; // No compatible locomotive found, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR86_CheckPosition, position_in_consist){ + 0: sw_BR86_PushPUll; // Attempt push pull + sw_BR86; // We aren't at the front of the consist, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR86_Sprites ,vehicle_is_reversed){ + 0: sw_BR86; // We're heading foward, show normal sprites + 1: sw_BR86_CheckPosition; // Attempt push pull +} + item (FEAT_TRAINS, item_BR86, 566) { property { name: string(STR_NAME_BR86); @@ -85,7 +103,7 @@ item (FEAT_TRAINS, item_BR86, 566) { can_attach_wagon: CB_RESULT_ATTACH_ALLOW; cargo_capacity: return 0; cargo_subtype_text: sw_BR86_cargo_subtype_text; - default: sw_BR86; + default: sw_BR86_Sprites; purchase: spriteset_BR86_Purchase; colour_mapping: return PALETTE_CC_FIRST; cost_factor: return(GetAdjustedCost(40)); diff --git a/src/trains/electric/BR87.pnml b/src/trains/electric/BR87.pnml index 7e62fd83..604f2d61 100644 --- a/src/trains/electric/BR87.pnml +++ b/src/trains/electric/BR87.pnml @@ -14,6 +14,8 @@ spriteset(spriteset_BR87_BRBlue, "gfx/electric/BR8X.png") { template_train32px(0, 263) } +// This switch called when displaying as this locomotive +// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder switch(FEAT_TRAINS,SELF, sw_BR87, cargo_subtype){ 0: spriteset_BR87_BRBlue; 1: spriteset_BR87_IntercitySwallow; @@ -28,6 +30,22 @@ switch(FEAT_TRAINS,SELF,sw_BR87_cargo_subtype_text,cargo_subtype){ return CB_RESULT_NO_TEXT; } +// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch +switch(FEAT_TRAINS, PARENT, sw_BR87_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { + 586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT + sw_BR87; // No compatible locomotive found, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR87_CheckPosition, position_in_consist){ + 0: sw_BR87_PushPUll; // Attempt push pull + sw_BR87; // We aren't at the front of the consist, show normal sprites +} + +switch(FEAT_TRAINS,PARENT,sw_BR87_Sprites ,vehicle_is_reversed){ + 0: sw_BR87; // We're heading foward, show normal sprites + 1: sw_BR87_CheckPosition; // Attempt push pull +} + item (FEAT_TRAINS, item_BR87, 567) { property { name: string(STR_NAME_BR87); @@ -67,7 +85,7 @@ item (FEAT_TRAINS, item_BR87, 567) { can_attach_wagon: CB_RESULT_ATTACH_ALLOW; cargo_capacity: return 0; cargo_subtype_text: sw_BR87_cargo_subtype_text; - default: sw_BR87; + default: sw_BR87_Sprites; purchase: spriteset_BR87_Purchase; colour_mapping: return PALETTE_CC_FIRST; cost_factor: return(GetAdjustedCost(40)); diff --git a/src/trains/rollingstock/RM_TPO.pnml b/src/trains/rollingstock/RM_TPO.pnml index 220bc79c..1ea9a170 100644 --- a/src/trains/rollingstock/RM_TPO.pnml +++ b/src/trains/rollingstock/RM_TPO.pnml @@ -1,6 +1,6 @@ // If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch switch(FEAT_TRAINS, PARENT, sw_RMTPO_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { - 440: sw_PUSHPULL_DMSOasBR47; // Class 47 + 440: sw_PUSHPULL_DVTasBR47; // Class 47 sw_RMTPO; // No compatible locomotive found, show normal sprites }