|
TTDPatch Site |
Action4
Action 4Define vehicle names or other textsWhen making new vehicle graphics, you also need to name the new vehicles, or they'll show up with their original name from TTD. In addition, you can change most of TTD's text strings. Note that changes of vehicles names can be overridden by using TTD's vehicle.dat custom vehicle names. There is no way to bypass the custom vehicle names, other than turning them off or deleting vehicle.dat. The data looks as follows: <Sprite-number> * <Length> 04 <feature> <language-id> <num-ent> <offset> <text>
Whether <offset> is a BYTE or a WORD is decided by bit 7 of <language-id>, see below. Sprite-numberThis is just the number you are at.LengthCount the number of bytes in this action.featureThis sets the type of feature that you wish to change. Set it to:00 for trains 01 for road vehicles 02 for ships 03 for planes 04 for stations 05 for canals 06 for bridges 07 for houses 0A for industries 0B for cargos 48 for original strings; see TextIDs for a list of TTD's text IDs. language-idThe meaning of this byte depends on the GRF version of the .grf file as set in action 8.Up to version 6, this is a bit mask of the following bits:
Add the bits of all languages for which the following strings apply. Bit 7 controls, whether the following string ID consists of 16 or 8 bit. Since TTDPatch now supports languages other than the standard ones, unknown languages will use the American strings as fallback. Otherwise the string would remain undefined for these languages. To actually define strings for any new language, you must use grf version 7. For version 7 and higher, it is a simple language ID from the list below. (This has changed with 2.5 beta 4). Bit 7 has the same meaning as in the earlier versions above. In either scheme, you can use the value 7F or FF, respectively, to define strings shown for languages that you do not provide translation for. First set all strings to a default value using this, and later override the language specific ones if they exist. Currently, the scheme is to use international phone codes as language IDs, unless they're out of range, in which case pick a number vaguely related in some way. Or something else.
When translating for a new language, please simply edit this document and add the new definition here. num-entHow many consecutive entries to change.offsetThe ID of the first string to change.When language-id bit 7 is clear, this is a byte value; except for OpenTTD since r13482, where it is an extended byte value for vehicles. When language-id bit 7 is set, this is a word value in little endian notation, e.g. 8134 becomes 34 81. The 8 bit version is only allowed for vehicles to set their name, in which case the text ID is just the vehicle ID. To replace original texts, or to define texts for usage in callbacks or properties of vehicles, stations, houses or industries you have to use the 16 bit version. However, town names are changed with Action F. For the usable 16 bit text IDs see the table below, resp. for feature 48 see TextIDs. Though these ranges are shared across all features, you should still set the proper feature you are using them for.
The DCxx IDs are allocated internally when defined, and are persistent in the savegame data. Each .grf file gets its own separate map of these internal IDs and thus may set all 256 of them. However, only 1024 IDs are available in total, to be shared by all .grf files ever activated in the savegame. This means these IDs should be used as sparingly as possible. But use them when they are useful! textThis is a list of zero-terminated strings, there must be as many strings as num-ent specifies.You can use the str2hex converter to generate the proper hex values. Alternatively, use grfcodec version 0.9.6 or later, which accepts literal strings in the .nfo. These are encoded exactly as written, in whatever encoding your text editor uses; if you need a 00, put it immediately after the literal string. For the supported encodings, format, and restrictions on what characters you may use, please see GRFActionsDetailed and StringCodes. A large number of original TTD strings require a colour code in front of the actual string. You can also use these colour codes in most of your custom strings. Use them wisely! In case a string requires a colour code, the string will have the code displayed in front of the default text as listed in TextIDs.Typically, a colour coded string starts with the escape character (backslash), followed by hex byte and then the actual text string itself. I.e. string 0001 ("\94Off edge of map") has colour code 0x94 in front of the text string, which will colour it white. You can also put the plain hex byte outside the quoted string without having to escape it. 94 "Off edge of map" would be the same as "\94Off edge of map" The following 16 colour codes are available for use:
Something to go here Created by: system last modification: Wednesday 04 of August, 2010 [08:49:36 UTC] by Rubidium |
Login Search
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||