|
TTDPatch Site |
ActionB
Action BGenerate error messages.With this action, you can alert the user to problems in the way the grf file is loaded, e.g. not in the right order, not the right patch version, or wrong parameters. The data looks as follows: <Sprite-number> * <Length> 0B <severity> <language-id> <message-id> [<message>] [<data> [<parnum> [<parnum>]]]
Sprite-numberThis is just the number you are at.LengthCount the number of bytes in this action.severityThis sets how severe the message is.
Normally Action B is ignored during initialization. If the severity has bit 7 set, a fatal action B will be applied even during initialization. This can be useful to prevent errors due to invalid sprites during initialization. Note that this only works properly since 2.0.1 alpha 66, for earlier versions the error popup that is shown is corrupted if bit 7 is set. Messages are shown with a "/!\" sign in the GRF Status window. The first fatal message during each activation is shown as a red popup box as well. language-idThis has the same format as the language-id in action 4. Use 7F (all languages) for built-in messages, because they are automatically using the right language. message-idSet what kind of message to show. You have the following options:
Message IDs 04 and 05 are available since TTDPatch 2.6 alpha 1 (r858). Message ID 06 is available since OpenTTD r11330. This message should only be used when Action 7/9 variable 9D is 1 (OpenTTD). messageCustom message text to show.parnumParameter numbers (up to two) to display instead of 7B in the message text.In all messages (built-in and custom), the first 80 is replaced by the filename of the grf file, the second 80 is replaced by the content of <data>. After the two 80 bytes, you may have one or two 7B bytes that are replaced by the value of the parameter(s) specified by <parnum>. Note that it is invalid to have a 7B before exactly two 80 bytes were encountered. This means the following combinations of special bytes are allowed: (none) 80 80 80 80 80 7B 80 80 7B 7B Before, after, or in-between the bytes you may have arbitrary characters. The advantage of the built-in messages is that they can be translated using the mkpttxt mechanism, whereas custom messages will only be available in the languages that come with the grf file. Note that if several grf files attempt to show fatal error messages, only the first message is actually shown at the moment since TTD does not have a queue for the red error popups. All others will however be shown in the GRF Status window. Also note that since this action has only been introduced in 2.0.1 alpha 13, it makes no sense to check whether the version is at least alpha 13 if you want to use the error message 00. In earlier versions, the patch will display the "invalid sprite" error message anyway because the action is unknown. Below is an example of what a real Action B pseudo-sprite could look like, along with the Action 7 required to skip it under the appropriate circumstances. 2 * 6 07 85 01 01 37 01 3 * 17 0B 03 7F 02 "newtrains on" 00
Created by: system last modification: Saturday 12 of December, 2009 [15:29:55 UTC] by planetmaker |
Login Search
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||