NML 코딩 질문할께요.

ME Making
질문
2021.04.04 14:26:20
https://telk.kr/tb/free/2617
코딩하고 있는 열차는 전체 도색이 4개가 존재합니다.
물론 열차스타일을 정의해줬는데요.

결과적으로 운전차량의 도색을 변경하면 자동으로 변경되는 것을 확인했습니다.

한열셋처럼 공통객차를 써서 적용을 했습니다.

문제는 열차복제를 누르면, 승객차량의 차량이 도색된 차량의 그래픽으로 변경되지 않고, 해당 운전차량의 승객차량으로 변경됩니다.

구입시 A도색(열차의 기본)
도색변경시 B, C, D도색중 1개 선택)
열차 복제시
운전차량은 B, C, D도색이지만, 승객차량은 해당열차의 기본 A도색으로 변경됨
다시, 도색을 변경하면 원하는 도색스타일로 돌아오고, 복제하면 또 A도색으로 변경됩니다.

스위치부분을 수정해줘야 할까요?

NML 코딩정보입니다
/*
5.3. 신칸센 500계

/*
5.3.1 Graphics

/*
5.3.1.1 500계

spriteset(set_500_purchase, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
tmpl_purchase(0, 0)
}

spriteset(set_500H_purchase, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
tmpl_purchase_for_dualhead(0, 27)
}

spriteset(set_500_engineH, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine(60, 0)
}

spriteset(set_500_wagon_start, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 54)
}

spriteset(set_500_wagon, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F(60, 81)
}

spriteset(set_500_wagon_r, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F_r(60, 81)
}

spriteset(set_500_wagon_end, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 108)
}

spriteset(set_500_engineT, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine_r(60, 27)
}

/*
5.3.1.2. 500계 Cool

spriteset(set_500_Cool_purchase, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
tmpl_purchase_for_dualhead(0, 135)
}

spriteset(set_500_Cool_engineH, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine(60, 135)
}

spriteset(set_500_Cool_wagon_start, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 189)
}

spriteset(set_500_Cool_wagon, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F(60, 216)
}

spriteset(set_500_Cool_wagon_r, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F_r(60, 216)
}

spriteset(set_500_Cool_wagon_end, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 243)
}

spriteset(set_500_Cool_engineT, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine_r(60, 162)
}

/*
5.3.1.3. 500계 산천

spriteset(set_500_Sancheon_purchase, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
tmpl_purchase_for_dualhead(0, 270)
}

spriteset(set_500_Sancheon_engineH, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine(60, 270)
}

spriteset(set_500_Sancheon_wagon_start, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 324)
}

spriteset(set_500_Sancheon_wagon, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F(60, 351)
}

spriteset(set_500_Sancheon_wagon_r, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F_r(60, 351)
}

spriteset(set_500_Sancheon_wagon_end, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 379)
}

spriteset(set_500_Sancheon_engineT, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine_r(60, 297)
}

/*
5.3.1.4 500계 팥죽

spriteset(set_500_Patjug_purchase, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
tmpl_purchase_for_dualhead(0, 406)
}

spriteset(set_500_Patjug_engineH, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine(60, 406)
}

spriteset(set_500_Patjug_wagon_start, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 460)
}

spriteset(set_500_Patjug_wagon, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F(60, 487)
}

spriteset(set_500_Patjug_wagon_r, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png") {
wagon_1F_r(60, 487)
}

spriteset(set_500_Patjug_wagon_end, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
wagon_panto(60, 514)
}

spriteset(set_500_Patjug_engineT, "C:\OpenTTD\NML\YST\src\locomotive\500\500.png"){
engine_r(60, 433)
}

/*
5.3.2. 구매정보

switch(FEAT_TRAINS, SELF, sw_500D_purchase, cargo_subtype) {
set_500_purchase;
}

/*
5.3.3. 스위치

switch(FEAT_TRAINS, SELF, sw_500_cargo_subtype_text, cargo_subtype) {
1: return string(STR_REFIT_LIVERY_500C); // 500계-Cool2: return string(STR_REFIT_LIVERY_500S); // 500계-산천3: return string(STR_REFIT_LIVERY_500P); // 500계-팥죽return string(STR_REFIT_LIVERY_500);
}

switch(FEAT_TRAINS, SELF, sw_500_engineH, cargo_subtype) {
1: set_500_Cool_engineH; // 500계 Cool2: set_500_Sancheon_engineH; // 500계 산천3: set_500_Patjug_engineH; // 500계 팥죽set_500_engineH;
}

switch(FEAT_TRAINS, SELF, sw_500_engineT, cargo_subtype) {
1: set_500_Cool_engineT; // 500계 Cool2: set_500_Sancheon_engineT; // 500계 산천3: set_500_Patjug_engineT; // 500계 팥죽set_500_engineT;
}

switch(FEAT_TRAINS, SELF, sw_500_engine, position_in_consist_from_end == 0 && num_vehs_in_consist > 1){
1: sw_500_engineT;
sw_500_engineH;}

switch(FEAT_TRAINS, SELF, sw_500_wagon_start, cargo_subtype) {
1: set_500_Cool_wagon_start; // 500계 Cool2: set_500_Sancheon_wagon_start; // 500계 산천3: set_500_Patjug_wagon_start; // 500계 팥죽set_500_wagon_start;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_middle_front, cargo_subtype) {
1: set_500_Cool_wagon; // 5oo계 산천2: set_500_Sancheon_wagon; // 5oo계 산천3: set_500_Patjug_wagon; // 500계 팥죽set_500_wagon;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_middle_tail, cargo_subtype) {
1: set_500_Cool_wagon_r; // 5oo계 산천2: set_500_Sancheon_wagon_r; // 5oo계 산천3: set_500_Patjug_wagon_r; // 500계 팥죽set_500_wagon_r;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_end, cargo_subtype) {
1: set_500_Cool_wagon_end; // 500계 Cool2: set_500_Sancheon_wagon_end; // 500계 산천3: set_500_Patjug_wagon_end; // 500계 팥죽set_500_wagon_end;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_middle, (position_in_consist %5) + 1) {
1: sw_500_wagon_middle_front;sw_500_wagon_middle_tail;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_rear, [STORE_TEMP(4, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]){
S500_Driver_Car: sw_500_wagon_end;sw_500_wagon_middle;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon, [STORE_TEMP(-4, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
S500_Driver_Car: sw_500_wagon_start;sw_500_wagon_rear;
}

switch(FEAT_TRAINS, SELF, sw_500_wagon_attach, vehicle_type_id) {
YST_1F_Passinger_Car: return CB_RESULT_ATTACH_ALLOW;return string(STR_ERROR_NO_ATTACH);
}

//5.3.4 열차정보
item(FEAT_TRAINS, S500_Driver_Car){
property {
name: string(STR_500_NAME); climates_available: ALL_CLIMATES;
introduction_date: date(1996, 1, 1);
track_type: RAIL;engine_class: ENGINE_CLASS_ELECTRIC;
sprite_id: SPRITE_ID_NEW_TRAIN;
dual_headed: 1; //spec
speed: 330km/h;
power: 10000 kW;
weight: 35 ton;
tractive_effort_coefficient: 0.3;
air_drag_coefficient: 0.01;//Modelmodel_life: VEHICLE_NEVER_EXPIRES;vehicle_life: 255;retire_early: 0;reliability_decay: 0;//Cargocargo_capacity: 53;refittable_cargo_classes: bitmask(CC_PASSENGERS);non_refittable_cargo_classes: bitmask();//Costsrefit_cost: 0;running_cost_base: RUNNING_COST_ELECTRIC;//Flagsmisc_flags: bitmask(TRAIN_FLAG_FLIP,TRAIN_FLAG_MU, TRAIN_FLAG_AUTOREFIT);extra_weight_per_wagon: 35 ton;}
graphics {
default: sw_500_engine;
purchase: sw_500D_purchase;
loading_speed: 25;
cost_factor: 10;
running_cost_factor: 150;
can_attach_wagon: sw_500_wagon_attach;cargo_subtype_text: sw_500_cargo_subtype_text;start_stop: sw_YST_train_start_stop;
additional_text: string(STR_REFIT_ADDITIONAL_ABLE_UNADDTRAIN);
}

livery_override(YST_1F_Passinger_Car) {
default: sw_500_wagon;cargo_capacity: 100;loading_speed: 25;running_cost_factor: 100;}}

이모지를 이용해서 글에 반응해보세요!

댓글



꼬리표를 선택하세요


↑TOP

신고하기 ×

신고 종류
작성자
내용

신고 사유