|
TTDPatch Site |
Action3
Action 3Associate feature IDs with graphics sets.Action 3 assigns graphics sets (referenced to by (chains of) action 2(s) to feature IDs (vehicles, stations, houses, industries, ...). The format of the data is feature-dependent. The data is: <Sprite-number> * <Length> 03 <feature> <n-id> <ids...> <num-cid> (<cargo-type> <cid>)... <def-cid>
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/rivers 07 for houses 09 for industry tiles 0A for industries 0B for cargos 0F for Objects 10 for Railtypes n-idHow many items (vehicles, stations,...) this action 3 defines new graphics for. If this is more than one, all items listed will get the same graphics. If this value has bit 7 set (i.e. 80 added), it is a wagon override. See Action 3 - Livery Override for more info on this feature.You can make a definition with n-id equal to zero (and thus no ids that follow). This creates a generic feature-specific definition not associated with any particular vehicle. At the moment, this is used for generic callbacks, but might be extended to other functions eventually. idsVehicle or stations IDs to use this action 3 for. All IDs are counted from the first of their class, i.e. the first road vehicle has 00, as does the first plane, the first ship, and the first train vehicle.In OpenTTD since r13482, each ID is an extended byte for vehicles, otherwise the ID is a regular byte. For feature 05 (canals/rivers):
Note: The Number of sprites for feature 05 canals/rivers may change via a graphics flag set in Action0Canals For town buildings, the IDs are the house IDs, and specifying a house ID that haven't been defined before (by setting its property 08) doesn't do anything, but doesn't cause an error, either. Note that you don't necessarily have to assign a cargo ID to a house ID, the old TTD sprite of the substitute type will be used if you don't do so. Industry tile IDs work in the same manner. num-cidNumber of cargo type definitions that follow. Can be zero if only the default follows.For features 05 (canals/rivers), 07 (houses), 09 (industry tiles), 0A (industries), and 0B (cargoes) this must always be zero. cargo-type and cidFor vehicles (features 00 .. 03) and stations (feature 04) The cargo-type for which the cid applies. If the vehicle is built to use this type of cargo, or if it is refitted for it, the given cargo ID (from action 2) is used as its graphics. See column "type A" in the table at CargoTypes for a list of cargo-type values. If the grf file has installed a cargo translation table, the cargo type here refers to the cargo with the label in the given slot of the translation table, e.g. if you use cargo-type=08, it refers to the cargo that has the label in the ninth slot (numbered 08) in the translation table. If defined, cargo-type FF is used for graphics shown in the purchase or construction window. For stations, you can additionally define a special cargo-type of FE which prevents the default from being used (which would show the sum of all cargo). Instead, the given cid is displayed with no cargo at all. For railtypes (feature 10) Railtypes are available only in OpenTTD > r19056 and its action 3 re-uses the 'cargo' type definition in order to assign the type of graphics defined by the associated action 2 (chain):
(a) These sprites must be provided, the others may be left out, if not needed. (b) Level crossing sprites:
(c)Depot sprites:
For canals/rivers, houses, industry tiles, industries and cargoes (features 05, 07, 09, 0A and 0B) As <num-cid> is zero for features 05 (canals/rivers), 07 (houses), 09 (industry tiles), 0A (industries), and 0B (cargoes), <cargo-type> and <cid> need to be skipped and you only have to set <def-cid>.For objects (feature 0F) Objects support a buy menu sprite, similar to vehicles (cargo-type FF). This menu action2 chain is used in preference to the default action2 chain for callback 149. def-cidDefault cargo ID if no entry from the cargo-type list above matches, or if there are no special cargo-types listed at all.Below is an example of what a real action 3 pseudo-sprite could look like for a train engine. 13 * 7 03 00 01 02 00 00 00
Created by: system last modification: Thursday 26 of August, 2010 [19:18:36 UTC] by mb |
Login Search
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||