Moving the parameter to the place I suggested seems to have worked!
Good to know.
The main issue there was, was that there were some references to certain pieces of the code within the parameter remaining when you used a parameter.
The code itself had no errors as code-language alone, that is why there were no warnings when you compiled the GRF.
However, when you use the parameter (which means you skip/remove certain parts of the code), then errors appeared.
A way to test it then, is what happens if you remove a certain piece code
The part between
Code: Select all
if (param[0] == 0) {
. . . . . . .
} else { }
And then compile the GRF, then you should get an error if something is wrong.
Curiosity I wonder if the idea moving the parameter would affect if I added a few vehicles to the AuzFarmRoads.
So I added a tractor and some horses and change the position of the parameter and tested games by turning roads on and off and had no issues.
Anything added before or after:
Code: Select all
if (param[0] == 0) {
. . . . . . .
} else { }
Is not affected by that specific parameter, only parts of the code inbetween (as indicated by the dots).
There is a typo with one of those vehicles by the way:

- Example805.png (3.61 KiB) Viewed 3973 times
Also, there is a very easy way to also use a parameter to choose between UK or US.
The parameter I have shown you is an If-Else parameter, meaning that if it is inactive, you get the part between the first set of { } (the If-part)
If it is active, you get the part between the second set of { } (the Else-part)
So for example, this:
Code: Select all
//tractor01
spriteset (spriteset_eyecandy_tractor01, "gfx/tractor01.png") {
tmpl_widelivestock(0)
}
item(FEAT_ROADVEHS, item_tractor01) {
property {
name: string(STR_NAME_tractor01);
climates_available: ALL_CLIMATES;
introduction_date: date(01,01,01);
vehicle_life: 45;
road_type: ROAD;
model_life: VEHICLE_NEVER_EXPIRES;
cost_factor: 1;
running_cost_factor: 2;
sprite_id: SPRITE_ID_NEW_ROADVEH;
speed: 25 km/h;
cargo_capacity: 0;
cargo_age_period: 0; // ageing disabled
running_cost_base: RUNNING_COST_ROADVEH;
misc_flags: bitmask(ROADVEH_FLAG_2CC);
power: 100;
weight: 1;
sound_effect: SOUND_COMEDY_CAR_2;
length: 8;
cargo_allow_refit: [];
}
graphics {
default: spriteset_eyecandy_tractor01;
}
}
//tractor02
item(FEAT_ROADVEHS, item_tractor02) {
property {
name: string(STR_NAME_tractor02);
climates_available: ALL_CLIMATES;
introduction_date: date(01,01,01);
vehicle_life: 45;
road_type: ROAD;
model_life: VEHICLE_NEVER_EXPIRES;
cost_factor: 1;
running_cost_factor: 2;
sprite_id: SPRITE_ID_NEW_ROADVEH;
speed: 25 km/h;
cargo_capacity: 0;
cargo_age_period: 0; // ageing disabled
running_cost_base: RUNNING_COST_ROADVEH;
misc_flags: bitmask(ROADVEH_FLAG_2CC);
power: 100;
weight: 1;
sound_effect: SOUND_COMEDY_CAR_2;
length: 8;
cargo_allow_refit: [];
}
graphics {
default: spriteset_eyecandy_tractor02;
}
}
Should become this:
Code: Select all
//Spritesets for tractor UK/US
spriteset (spriteset_eyecandy_tractor01, "gfx/tractor01.png") {
tmpl_widelivestock(0)
}
spriteset (spriteset_eyecandy_tractor02, "gfx/tractor01.png") {
tmpl_widelivestockUS(0)
}
if (param[XXX] == 0) {
item(FEAT_ROADVEHS, item_tractor01) {
property {
name: string(STR_NAME_tractor01);
climates_available: ALL_CLIMATES;
introduction_date: date(01,01,01);
vehicle_life: 45;
road_type: ROAD;
model_life: VEHICLE_NEVER_EXPIRES;
cost_factor: 1;
running_cost_factor: 2;
sprite_id: SPRITE_ID_NEW_ROADVEH;
speed: 25 km/h;
cargo_capacity: 0;
cargo_age_period: 0; // ageing disabled
running_cost_base: RUNNING_COST_ROADVEH;
misc_flags: bitmask(ROADVEH_FLAG_2CC);
power: 100;
weight: 1;
sound_effect: SOUND_COMEDY_CAR_2;
length: 8;
cargo_allow_refit: [];
}
graphics {
default: spriteset_eyecandy_tractor01;
}
}
} else {
item(FEAT_ROADVEHS, item_tractor02) {
property {
name: string(STR_NAME_tractor02);
climates_available: ALL_CLIMATES;
introduction_date: date(01,01,01);
vehicle_life: 45;
road_type: ROAD;
model_life: VEHICLE_NEVER_EXPIRES;
cost_factor: 1;
running_cost_factor: 2;
sprite_id: SPRITE_ID_NEW_ROADVEH;
speed: 25 km/h;
cargo_capacity: 0;
cargo_age_period: 0; // ageing disabled
running_cost_base: RUNNING_COST_ROADVEH;
misc_flags: bitmask(ROADVEH_FLAG_2CC);
power: 100;
weight: 1;
sound_effect: SOUND_COMEDY_CAR_2;
length: 8;
cargo_allow_refit: [];
}
graphics {
default: spriteset_eyecandy_tractor02;
}
}
}
maybe some one will see in the source what I should add to the tractor and horses to make them only go on the farm roads.
I already explained that here:
viewtopic.php?p=1260947#p1260947