Difference between revisions of "NML:Testing for other NewGRFs"
From GRFSpecs
Jump to navigationJump to search (content of nml r1625)  | 
				Planetmaker (talk | contribs)   (Mention special parameter 254)  | 
				||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
| + | {{NMLNavBlocksyntax}}  | 
||
| + | |||
See the [[NML:Builtin functions|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  | 
  See the [[NML:Builtin functions|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#>]  | 
   identifier = param[<grfID>, <param#>]  | 
||
| + | |||
For example  | 
  For example  | 
||
| Line 11: | Line 14: | ||
reads parameter 1 (the first one, counting starts at 0) from the NewGRF with the grfID "NML\01".  | 
  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 [[NML:GRF| grf block]])  | 
||
Latest revision as of 09:48, 2 February 2013
Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Roadstops, Terrain
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)