NML:Testing for other NewGRFs

From GRFSpecs
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Block Syntax

See the builtin functions for the functions grf_XXX. Additionally - when the presence of a NewGRF is established - their parameters can be of interest and queried. The general syntax is

identifier = param[<grfID>, <param#>]


For example

 other_newgrfs_param0 = param["NML\01", 0];
 other_newgrf_no_high_cost = param["NML\01", 1] < 5;

reads parameter 1 (the first one, counting starts at 0) from the NewGRF with the grfID "NML\01".

There's a special parameter, 254: That reports back the version of that NewGRF as set in its grf definition (e.g. via the version property in the grf block)