ReadingOtherGRFParameters

From GRFSpecs
Revision as of 19:21, 26 September 2007 by dmccoy (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Reading another GRF file's parameters

Reading another GRF file's parameters

-=Introduction=-

Since 2.0.1 alpha 16, it has been possible to use action D to read the parameters of other GRF files. With this, you can try to use the settings for another related GRF before falling back to a hard coded default.

-=Format=-

 -+<Sprite-number> * <Length> 0D <target> <operation> <param> FE <grfid>+-

||Element|Size|Description

0D|B|Defines action 0D

<target>|B|Target parameter

<operation>|B|As for action D, but only assignment is valid.

<param>|B|Parameter number of the other GRF file that you want to read

FE|B|Defines a special variable access

<grfid>|D|The GRFID whose parameter you want to read||

This will store parameter <param> of the GRF file with grfid <grfid> into the <target>

If the GRF ID cannot be found, or if the parameter is not defined, a value of 0 is used instead (no matter whether bit 7 of the operation is set or not).