nml
nml copied to clipboard
Add: 'const' keyword to allow users to define new constants
It's possible to use named parameters as constants, but it doesn't always work and it's not very efficient in the resulting GRF when it does work.
Introduce the const
keyword and const <name> = <value>;
syntax, which will define the constant <name>
to the value <value>
.
Constants should be usable like any of the predefined constants so I delayed some validations for item
and disable_item
as they were happening too early.
Found a perfect use case in 030_house.
Have I understand this correctly? When not marked as const, the named parameter may be allocated a GRF parameter which is then dereferenced when used instead of simply storing the value where used.
Exactly, named parameters are just GRF parameters, with all the implied limitations in usage.