Does anyone have a code snippet, or the GRFmaker way of doing it, to alter the capacity text in the new vehicle screen please?
Articulated vehicles only show the capacity of the front part by default

Thanks
Bob
Moderator: Graphics Moderators
As a user of GRFmaker that, unfortunately, didn't make a great deal of sense to me sorryMost likely you handle the articulated vehicle callback only in the default action3-chain, not in the purchase-list chain (cargotype 0xFF).
It happens if the refittability is the same and the front part has capacity zeroYou might also get a red error popup in OpenTTD everytime you build an engine claiming that the NewGRF provides inconsistent information (though that only happens if the articulated parts have different refittability).
And you have discovered why no-one uses GRFmaker. It's no substitute for knowing what you're doing, especially if you're trying to do something complex.Bob_Mackenzie wrote:As a user of GRFmaker that, unfortunately, didn't make a great deal of sense to me sorry
Unfortunately I don't have the hobby time to invest in learning to code properly.PikkaBird wrote:And you have discovered why no-one uses GRFmaker. It's no substitute for knowing what you're doing, especially if you're trying to do something complex.Bob_Mackenzie wrote:As a user of GRFmaker that, unfortunately, didn't make a great deal of sense to me sorry
Perhaps its simple enough for me to understand? care to share?DJ Nekkid wrote:@foorbar: I did provide you with a simple solution a year or two agoQuite nifty one also iirc
Only 2 years ago? Wasn't that in 2008 or something?DJ Nekkid wrote:@foorbar: I did provide you with a simple solution a year or two agoQuite nifty one also iirc
Code: Select all
-1 * 0 02 01 A1 81 10 00 FF 01 \b<new capacity> 80 0F 0F FF FF
-1 * 0 02 01 A2 81 0C 00 FF 01 A1 00 36 36 A0 00 // Lets say purchaselist sprite is A0
Code: Select all
/////////////////////
//vehicle callbacks//
/////////////////////
//set number of articulated parts
switch (FEAT_ROADVEHS, SELF, switch_cbarticulated_htm_21, extra_callback_info1) {
0..7: return tram_htm_21; //use same vehicle for all parts
CB_FAILED;
}
//set length of each part
switch (FEAT_ROADVEHS, SELF, switch_length_htm_21, position_in_consist ) {
0: return 0;
1: return 1;
2: return 2;
3: return 3;
4: return 4;
5: return 5;
6: return 6;
7: return 7;
CB_FAILED;
}
//set capacity of each part
switch (FEAT_ROADVEHS, SELF, switch_capacity_htm_21, position_in_consist ) {
0: return 10;
1: return 20;
2: return 30;
3: return 40;
4: return 50;
5: return 60;
6: return 70;
7: return 80;
CB_FAILED;
}
switch (FEAT_ROADVEHS, SELF, switch_properties_htm_21, extra_callback_info1) {
PROP_ROADVEHS_CARGO_CAPACITY: switch_capacity_htm_21;
CB_FAILED;
}
switch (FEAT_ROADVEHS, SELF, switch_tram_htm_21, current_callback) {
VEH_CB_ARTICULATED_PARTS: switch_cbarticulated_htm_21;
VEH_CB_WAGON_LENGTH: switch_length_htm_21;
VEH_CB_VEHICLE_PROPERTIES: switch_properties_htm_21;
switch_livery_htm_21;
}
Code: Select all
// Add P-list-sprite
-1 * 0 02 00 CID_GFX 82 41 10 FF 01 // Check number of parts in consist (with same ID)
F0 00 00 00 // P-list-sprite if 0
A0 00 // Use gfx if not
Users browsing this forum: No registered users and 21 guests