Road and TramTypes and available vehicles

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

Moderator: Graphics Moderators

Post Reply
User avatar
GuilhermeJK
Engineer
Engineer
Posts: 53
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

Road and TramTypes and available vehicles

Post by GuilhermeJK »

Hello there,

I've experimenting with a RoadType and TramType grf, coding in NML 0.5.2 and I have sorted nearly all the graphics but almost all my defined types end up with empty buy new vehicle lists at the depots. I have looked at RattRoads and Unspooled nml and replicated what they have done with roadtypetable and powered_roadtype_list but it doesn't work for me. What am I missing?

Here is an example of two roadtypes that should have all the vehicles active. The first one is the only roadtype with actual vechicles to be purchased. The second one (and all the others) have none.

Code: Select all

roadtypetable{
	ROAD, TRAI, MUD0, DIRT, COBB, SETT, FSET, BASP, MASP, EXPR, HWAY
}
// THIS ONE WORKS, HAS VEHICLES TO BE PURCHASED
item (FEAT_ROADTYPES, town_road, 0){
	property{
		label: "ROAD";
		introduction_date:     date(0001,01,01);
		name:                  string(STR_ROAD_TOWN);
		toolbar_caption:       string(STR_ROAD_TOWN_TOOLBAR);
		menu_text:             string(STR_ROAD_TOWN_MENU);
		// powered_roadtype_list: ["ROAD", "TRAI", "MUD0", "DIRT", "COBB", "SETT", "FSET", "BASP", "MASP", "EXPR", "HWAY", "HAUL"];
		//introduces_roadtype_list: ["ROAD", "TRAI"];
		//alternative_roadtype_list: ?;
		roadtype_flags:        bitmask(ROADTYPE_FLAG_TOWN_BUILD);
		construction_cost: 8; //Default
		maintenance_cost:  16; //Default
		speed_limit:       81 km/h; //Maximum of 100 km/h
		build_window_caption:  string(STR_GENERIC_BUILD_VEHICLE);
		autoreplace_text:      string(STR_GENERIC_AUTOREPLACE);
		new_engine_text:       string(STR_GENERIC_NEW_ENGINE);
		sort_order:            0;
	}
	graphics{
		underlay: sw_town_road_zone;
		depots: sw_town_depot_zone;
		bridge_surfaces: spset_susp_mono_bridge;
	}
}


// THIS ONE DOESN'T, AS ALL THE OTHERS HAVE NO VEHICLES
item (FEAT_ROADTYPES, modern_asphalt_road, 8){
	property{
		label: "MASP";
		introduction_date:     date(1960,01,01);
		name:                  string(STR_ROAD_MODERN_ASPHALT);
		toolbar_caption:       string(STR_ROAD_MODERN_ASPHALT_TOOLBAR);
		menu_text:             string(STR_ROAD_MODERN_ASPHALT_MENU);
		// powered_roadtype_list: ["ROAD", "TRAI", "MUD0", "DIRT", "COBB", "SETT", "FSET", "BASP", "MASP", "EXPR", "HWAY"];
		roadtype_flags:        bitmask(ROADTYPE_FLAG_TOWN_BUILD);
		construction_cost: 12;
		maintenance_cost:  16;
		speed_limit:       81 km/h;
		build_window_caption:  string(STR_GENERIC_BUILD_VEHICLE);
		autoreplace_text:      string(STR_GENERIC_AUTOREPLACE);
		new_engine_text:       string(STR_GENERIC_NEW_ENGINE);
		sort_order:            8;
	}
	graphics{
		underlay: spset_road_modern_asphalt;
		depots: spset_depot_modern_asphalt;
		gui: spset_gui_modern_asphalt;
		bridge_surfaces: spset_bridge_modern_asphalt;
		roadstops: spset_roadstop_modern_asphalt;
	}
}

User avatar
Andrew350
Director
Director
Posts: 594
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Road and TramTypes and available vehicles

Post by Andrew350 »

You have these lines commented out...I think if you remove the comment characters ("//") your set will work fine :)

Code: Select all

// powered_roadtype_list: ["ROAD", "TRAI", "MUD0", "DIRT", "COBB", "SETT", "FSET", "BASP", "MASP", "EXPR", "HWAY", "HAUL"];
// introduces_roadtype_list: ["ROAD", "TRAI"];

User avatar
GuilhermeJK
Engineer
Engineer
Posts: 53
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

Re: Road and TramTypes and available vehicles

Post by GuilhermeJK »

Silly me, I put the wrong the example with the commented lines.

But then, it worked when I used this same table on all of them. And I think I know why. Whenever I change some sprites, I compile the NML again and update the GRF midgame to see if the sprites are aligned and such.

I did the same when modifying the code... (and apparently I forgot that changing GRFs midgame may induce silly effects that wouldn't if I had started a new game). :facepalm:

I'll get back to this post if any other roadtype label issue appears.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: Google Adsense [Bot], temporal8 and 1 guest