Skip to content

Commit

Permalink
Change: add an on/off parameter for 'Build some vehicles reversed'
Browse files Browse the repository at this point in the history
  • Loading branch information
andythenorth committed May 28, 2024
1 parent ed55b69 commit 9fb24f0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/lang/english.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ base = "Wagon colour fading"
[STR_PARAM_WAGON_COLOUR_RANDOMISATION_STRATEGY_DESC]
base = "Faded freight wagon colours add variety to trains (random chance each wagon is faded)."

[STR_PARAM_VEHICLE_RANDOM_REVERSE_ON_BUILD]
base = "Build some vehicles reversed"

[STR_PARAM_VEHICLE_RANDOM_REVERSE_ON_BUILD_DESC]
base = "Iron Horse will randomly build some vehicles as reversed, for example steam tank engines or diesel engines that have cabs at both ends. This feature can be turned off with this parameter setting."

[STR_ERROR_INFLATION_INCOMPATIBLE]
base = "Iron Horse is not compatible with OpenTTD Inflation. Please turn Inflation off in OpenTTD settings."
# substrings of the grf name _could_ be used here
Expand Down
11 changes: 9 additions & 2 deletions src/templates/header.pynml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ grf {
};
}
}
<!--! param 3 deleted -->
<!--! param 4 deleted -->
param 1 {
param_vehicle_random_reverse_on_build {
name: string(STR_PARAM_VEHICLE_RANDOM_REVERSE_ON_BUILD);
desc: string(STR_PARAM_VEHICLE_RANDOM_REVERSE_ON_BUILD_DESC);
type: bool;
def_value: 1;
bit: 1;
}
}
param 5 {
param_wagon_colour_randomisation {
name: string(STR_PARAM_WAGON_COLOUR_RANDOMISATION);
Expand Down
4 changes: 2 additions & 2 deletions src/templates/properties.pynml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
create_effect: ${vehicle.id}_switch_create_effect_check_railtype;
</tal:create_effect>
<tal:random_reverse_on_build condition="consist.random_reverse">
<!--! 50% chance of being reversed when built, if this property is set -->
reverse_build_probability: return 50;
<!--! 50% chance of being reversed when built, if this property is set (player bool parameter can turn this off) -->
reverse_build_probability: return 50 * param_vehicle_random_reverse_on_build;
</tal:random_reverse_on_build>
}
}
Expand Down

0 comments on commit 9fb24f0

Please sign in to comment.