nml icon indicating copy to clipboard operation
nml copied to clipboard

A named parameter cannot be used for a house ID

Open zephyris opened this issue 1 year ago • 1 comments

A named parameter cannot be used for a house ID, instead throwing a Unrecognised identifier for the parameter name, for example:

house_id_1=5;
item(FEAT_HOUSES, item_house_1, house_id_1) {
    ...
}

Gives Unrecognised identifier for house_id_1. This seems like a bug:

"in theory it's supposed to work (https://github.com/OpenTTD/nml/blob/master/nml/ast/item.py#L55 looks for named params via https://github.com/OpenTTD/nml/blob/master/nml/global_constants.py#L1415), so it looks like a bug (but a hard to fix one I think"

"I guess it's similar to https://github.com/OpenTTD/nml/issues/299 check happens at parsing but the registration of house_id_1 is during preprocess step"

zephyris avatar Jul 31 '23 14:07 zephyris

A possible solution/workaround could be #302

glx22 avatar Aug 04 '23 20:08 glx22