Railroad Track Icons

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

Moderator: Graphics Moderators

Post Reply
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Railroad Track Icons

Post by Digitalfox »

Hi :)

I have a small NML with 5 Railroad track types.

First track:

Code: Select all

item(FEAT_RAILTYPES, rail, 0) {
 property {
         label: "RAIL";
  introduction_date: date(1800,1,1);
  name: string(STR_TRACK_TYPE_VLST);
  toolbar_caption: string(STR_CONSTRUCTION_VLST);
  menu_text: string(STR_CONSTRUCTION_VLST);
  build_window_caption: string(STR_VEHICLE_CONSTRUCTION_VLST);
  autoreplace_text: string(STR_AUTOREPLACE_VLST);
  new_engine_text: string(STR_NEW_ENGINE_VLST);
  compatible_railtype_list: ["RAIL", "ELRL", "MSTR", "HSTR", "VHST"];
  powered_railtype_list: ["ELRL", "MSTR", "HSTR", "VHST"];
  construction_cost: 56;
  maintenance_cost: 56 / 4;
  speed_limit: param_speed_very_low km/h;
  acceleration_model: ACC_MODEL_RAIL;
  sort_order: 00;
  }
 }
On the toolbar shows like this:
Non Electric
Non Electric
1.png (20.14 KiB) Viewed 1798 times
Great!


Then I have a Electric Track:

Code: Select all

item(FEAT_RAILTYPES, elrl, 1) {
 property {
         label: "ELRL";
  introduction_date: date(1900,1,1);
  name: string(STR_TRACK_TYPE_LSTR);
  toolbar_caption: string(STR_CONSTRUCTION_LSTR);
  menu_text: string(STR_CONSTRUCTION_LSTR);
  build_window_caption: string(STR_VEHICLE_CONSTRUCTION_LSTR);
  autoreplace_text: string(STR_AUTOREPLACE_LSTR);
  new_engine_text: string(STR_NEW_ENGINE_LSTR);
  compatible_railtype_list: ["RAIL", "ELRL", "MSTR", "HSTR", "VHST"];
  powered_railtype_list: ["ELRL", "MSTR", "HSTR", "VHST"];
  construction_cost: 2.75 * 56;
  maintenance_cost: 2.75 * 56 / 4;
  railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY);
  speed_limit: param_speed_low km/h;
  acceleration_model: ACC_MODEL_RAIL;
  sort_order: 01;
 }
}
On the toolbar shows like this:
Electric
Electric
2.png (19.49 KiB) Viewed 1798 times
Awesome.



Then I have a new electric Rail Type:

Code: Select all

item(FEAT_RAILTYPES, mstr, 2) {
 property {
         label: "MSTR";
  introduction_date: date(1918,1,1);
  name: string(STR_TRACK_TYPE_MSTR);
  toolbar_caption: string(STR_CONSTRUCTION_MSTR);
  menu_text: string(STR_CONSTRUCTION_MSTR);
  build_window_caption: string(STR_VEHICLE_CONSTRUCTION_MSTR);
  autoreplace_text: string(STR_AUTOREPLACE_MSTR);
  new_engine_text: string(STR_NEW_ENGINE_MSTR);
  compatible_railtype_list: ["RAIL", "ELRL", "MSTR", "HSTR", "VHST"];
  powered_railtype_list: ["ELRL", "MSTR", "HSTR", "VHST"];  
  construction_cost: 2.75 * 2.75 * 56 + 2.75 * 2.75 * 1 * 56;
  maintenance_cost: 2.5 * 2.75 * 56 / 4 + 2.75 * 2.75 * 1 * 56 / 4;
  railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY);
  speed_limit: param_speed_medium km/h;
  acceleration_model: ACC_MODEL_RAIL;
  sort_order: 02;
 }
}
Shows up like this:
Electric
Electric
3.png (16.98 KiB) Viewed 1798 times

STOP... So why since it's also electric doesn't it show the electric icons, just like the below picture:
Electric
Electric
2.png (19.49 KiB) Viewed 1798 times

Am I missing the code or is it a limitation?


Once again, many thanks for your help :bow:
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Railroad Track Icons

Post by michael blunck »

Digitalfox wrote: So why since it's also electric doesn't it show the electric icons [?]
Because "ELRL" is a default rail type, but "MSTR" isn´t. Hence you´ll have to supply the needed icons yourself.

regards
Michael
Image
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: Railroad Track Icons

Post by Digitalfox »

Thank you Michael :)

Following your advice I'm now using custom sprites.

But OMG positioning sprites is such a nightmare even using GIMP coordinates to help me , and I just had two hands of them. I've got even more respect for GRF artists and coders who spend hours on this. :bow:
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Railroad Track Icons

Post by Eddi »

use the in-game sprite aligner (?-menu if you enabled newgrf developer tools)
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: Railroad Track Icons

Post by Supercheese »

Eddi wrote:use the in-game sprite aligner (?-menu if you enabled newgrf developer tools)
Even with this, it's still a pain... :rolleyes: But it's work that must be done.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 19 guests