NML: Generate town names according to parameter
Posted: 05 Aug 2021 10:24
I'm trying to change the town names generator's behaviour according to parameter.
I've added a parameter in the `grf` block like this:
and tried to add an `if` like this:
I also tried to relocate the `if` in various ways. But I only get errors such as:
Is there a way around these errors, so I could use parameter with town name generator? If not, is it an inherent (and wanted?) limitation? Or maybe it just wasn't implemented (yet) in the nml compiler, and maybe I could try sending a PR to change this?
I've added a parameter in the `grf` block like this:
Code: Select all
param 1 {
use_real_names { // 1st boolean value
name: string(STR_PARAM_NAME_USE_REAL_NAMES);
desc: string(STR_PARAM_DESC_USE_REAL_NAMES);
type: bool;
bit: 1; // uses 1st bit
}
}
Code: Select all
if (param[1]) {
town_names {
styles : string(STR_STYLES);
{
town_names(real, 1)
}
}
}
ornmlc ERROR: "israel.nml", line 1192: town_names-block may not appear inside a conditional block.
Of course, I can just create another NewGRF file, thus one file will be for `false` value, and other one for `true` value. But I'd really prefer to keep just one file, and let the user configure it.nmlc ERROR: "israel.nml", line 1192: Syntax error, unexpected token "if"
Is there a way around these errors, so I could use parameter with town name generator? If not, is it an inherent (and wanted?) limitation? Or maybe it just wasn't implemented (yet) in the nml compiler, and maybe I could try sending a PR to change this?