Difference between revisions of "Action13"
From GRFSpecs
Jump to navigationJump to searchm (3 revisions)  | 
				 (Updated table syntax)  | 
				||
| Line 6: | Line 6: | ||
Translate GRF-specific strings  | 
  Translate GRF-specific strings  | 
||
| − | + | ==Description==  | 
|
Translating regular strings is easy by just overwriting them with an [[Action4|action 4]], however this is not possible for translating GRF-specific strings in the D000 or DC00 range of IDs. Instead, these must be translated with this action 13.  | 
  Translating regular strings is easy by just overwriting them with an [[Action4|action 4]], however this is not possible for translating GRF-specific strings in the D000 or DC00 range of IDs. Instead, these must be translated with this action 13.  | 
||
| Line 12: | Line 12: | ||
Available since 2.6 alpha 1 (r857).  | 
  Available since 2.6 alpha 1 (r857).  | 
||
| − | + | ==Format==  | 
|
The data looks as follows:  | 
  The data looks as follows:  | 
||
| Line 18: | Line 18: | ||
<pre>-+<sprite-number> * <length> 13 <feature> <grfid> <num-ent> <offset> <text...>+-</pre>  | 
  <pre>-+<sprite-number> * <length> 13 <feature> <grfid> <num-ent> <offset> <text...>+-</pre>  | 
||
| + | {| class="wikitable"  | 
||
| ⚫ | |||
| + | |-  | 
||
| + | !'''Element'''  | 
||
| ⚫ | |||
| + | !'''Description'''  | 
||
| + | |-  | 
||
| + | |<sprite-number>  | 
||
| + | |dec  | 
||
| ⚫ | |||
| + | |-  | 
||
| + | |<length>  | 
||
| + | |dec  | 
||
| ⚫ | |||
| + | |-  | 
||
| + | |13  | 
||
| + | |B  | 
||
| ⚫ | |||
| + | |-  | 
||
| + | |<grfid>  | 
||
| + | |4*B  | 
||
| ⚫ | |||
| + | |-  | 
||
| ⚫ | |||
| + | |B  | 
||
| + | |Number of strings  | 
||
| + | |-  | 
||
| ⚫ | |||
| + | |W  | 
||
| + | |First text ID  | 
||
| + | |-  | 
||
| + | |<text...>  | 
||
| + | |S  | 
||
| ⚫ | |||
| + | |}  | 
||
| ⚫ | |||
| − | |||
| ⚫ | |||
| − | |||
| ⚫ | |||
| − | |||
| ⚫ | |||
| − | |||
| ⚫ | |||
| − | |||
| ⚫ | |||
| − | |||
| ⚫ | |||
For action 13, <num-ent>, <offset> and <text...> work exactly as for [[Action4|action 4]], but the offset may only refer to a text ID in the D000 or DC00 range of IDs.  | 
  For action 13, <num-ent>, <offset> and <text...> work exactly as for [[Action4|action 4]], but the offset may only refer to a text ID in the D000 or DC00 range of IDs.  | 
||
Revision as of 15:51, 13 June 2011
Translate GRF-specific strings
Action 13
Translate GRF-specific strings
Description
Translating regular strings is easy by just overwriting them with an action 4, however this is not possible for translating GRF-specific strings in the D000 or DC00 range of IDs. Instead, these must be translated with this action 13.
Available since 2.6 alpha 1 (r857).
Format
The data looks as follows:
-+<sprite-number> * <length> 13 <feature> <grfid> <num-ent> <offset> <text...>+-
| Element | Size | Description | 
|---|---|---|
| <sprite-number> | dec | A sequential sprite number | 
| <length> | dec | The total number of bytes in the action | 
| 13 | B | Action 13 | 
| <grfid> | 4*B | The GRFID of the file whose texts are to be translated | 
| <num-ent> | B | Number of strings | 
| <offset> | W | First text ID | 
| <text...> | S | Zero-terminated strings | 
For action 13, <num-ent>, <offset> and <text...> work exactly as for action 4, but the offset may only refer to a text ID in the D000 or DC00 range of IDs.
Action 13 is skipped if the given GRFID cannot be found or if the file is inactive; action 13 generates an error message and disables the current file if it appears before the GRF that it is translating.