Many NML questions

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 24 Jun 2018 11:56

Yes, I understand - sprites are orphaned if it is on spriteset image but not used.
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 28 Jun 2018 15:51

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.
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 421
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Many NML questions

Post by Erato » 28 Jun 2018 16:16

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
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 28 Jun 2018 16:34

Ok, will try.
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 30 Jun 2018 05:37

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!
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 30 Jun 2018 13:49

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;                                                       
    }
}
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 03 Oct 2019 08:16

By returning this thread back from the dead, I want to understand how to use Composing vehicles from multiple sprites. Can someone explain it?
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Tony Pixel
Route Supervisor
Route Supervisor
Posts: 419
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel » 03 Oct 2019 10:20

Well, I learned it by myself, so no need to help me already :)
Image
Sprite artist and NewGRF developer, NML coder. My projects:
Screenshots: New York City Subway Episodes
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Over-sized Train Set | Tony Pixel's Subway Equipment Set

I use GPLv2+ license.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests