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: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel »

Yes, I understand - sprites are orphaned if it is on spriteset image but not used.
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post 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.
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Many NML questions

Post 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
No pics no clicks. Seriously.
ImageImageImageImageImageImage
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel »

Ok, will try.
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post 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!
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post 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;                                                       
    }
}
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post 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?
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Many NML questions

Post by Tony Pixel »

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

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 4 guests