Page 2 of 2

Re: Many NML questions

Posted: 24 Jun 2018 11:56
by Tony Pixel
Yes, I understand - sprites are orphaned if it is on spriteset image but not used.

Re: Many NML questions

Posted: 28 Jun 2018 15:51
by Tony Pixel
For NAPR I want to make what last and first cars in consist change sprites when train is flipping, but I can't find the solution. I asked Pikka for code from NARS v2.03, but he didn't answer.

Re: Many NML questions

Posted: 28 Jun 2018 16:16
by Erato
try making a switch with the

Code: Select all

vehicle_is_reversed
variable.

For more variables, check this: https://newgrf-specs.tt-wiki.net/wiki/N ... _parameter

Re: Many NML questions

Posted: 28 Jun 2018 16:34
by Tony Pixel
Ok, will try.

Re: Many NML questions

Posted: 30 Jun 2018 05:37
by Tony Pixel
Ok, It work, but not all. Is there a way to check for the vehicle_type_id of the vehicle at the rear of train? If It is, today (or tomorrow) in NAPR will be real push-pull trains!

Re: Many NML questions

Posted: 30 Jun 2018 13:49
by Tony Pixel
Hmm, It works, but I can't find a variable, which I can use to detect the id of first carriage in train, and, as I understand, I can't make it with default switch.
Here is the part of code, with which I have these questions. Comet II detects P32AC-DM well, but P32AC-DM can't detect no cab, no car.

Code: Select all

switch(FEAT_TRAINS, PARENT, sw_P32AC_DM_general, vehicle_type_id) {
  item_Comet_II_Car:  sw_push_pull_P32AC_DM_Comet_II;
  sw_P32AC_DM_gui; 
} 

switch(FEAT_TRAINS, PARENT, sw_push_pull_Comet_II, vehicle_type_id) {
  item_P32AC_DM:  sw_push_pull_Comet_II_P32AC_DM;
  sw_Comet_II_Cab_gui;
}

item (FEAT_TRAINS, item_Comet_II_Cab) {                                                                      
    ...
    }
    graphics {
        ...
        default:                 sw_push_pull_Comet_II;                                                       
    }
}

item (FEAT_TRAINS, item_Comet_II_Car) {                                                                      
    ...
}


item (FEAT_TRAINS, item_P32AC_DM) {                                                                      
    ...
    graphics {
                  ...
                  default:                  sw_P32AC_DM_general;                                                       
    }
}

Re: Many NML questions

Posted: 03 Oct 2019 08:16
by Tony Pixel
By returning this thread back from the dead, I want to understand how to use Composing vehicles from multiple sprites. Can someone explain it?

Re: Many NML questions

Posted: 03 Oct 2019 10:20
by Tony Pixel
Well, I learned it by myself, so no need to help me already :)