ID Type | Purpose |
Vehicle ID | A generic vehicle/station/building slot whose properties can be defined using an Action 0. A Cargo ID can be associated with this using Action 3. |
set ID (called cargo ID for vehicles) | A ID asociated with one or more Spritesets using an Action 2. Can be asociated with a Vehicle ID using Action 3. |
Spriteset | A value unique to each Action 1. Defines a set of 8/4 views i.e. a set of sprites. Is in an action 2 |
GRFID | A word value used to differentiate between different grf files. This should be globally unique! |
ID 类型 | 目的 |
运输工具 ID | 通过使用脚本0来定义运输工具/站台/建筑的统一接口。货物ID通过使用脚本3来产生联系 |
固定ID (运输货物类型的ID) | 一个ID通过使用脚本2来与一个或多个sprites产生联系。通过使用脚本3来与运输工具的ID产生联系。 |
Spriteset | 对应脚本1中的一个唯一值 A value unique to each Action 1. Defines a set of 8/4 views i.e. a set of sprites. Is in an action 2 |
GRFID | 一个唯一值用来区别不同的grf文件。 |
Code | Meaning |
01 | Action 1 |
00 | Feature 0, meaning trains |
01 | One set of graphics |
08 | Each set has eight views |
代码 | 意义 |
01 | 脚本1 |
00 | 特征 0, 代表火车 |
01 | 一个系列的图片 |
08 | 每个系列有8个视角 |
Codes | Meaning |
02 | Action 2 |
00 | Feature 00, meaning trains |
00 | We define Cargo ID 0 (the first number available) |
01 | There is only one set of graphics we have while in motion |
01 | And also only one set while loading |
00 00 | Use the first set while in motion |
00 00 | And also while loading/unloading |
代码 | 含义 |
02 | 脚本2 |
00 | 特征00 ,代表火车 |
00 | 我们定义货物 ID 0 (第一个可用的数字) |
01 | 在运行中,我们只有一个系列的图形 |
01 | 在装载时也只有一个系列的图形 |
00 00 | 在运行中,使用第一个系列 |
00 00 | 在装/卸载中也使用第一个系列 |
代码 | 含义 |
03 | 脚本 3 |
00 | 特征 00, 代表火车 |
01 | 对一个运输工具附加以下图片 |
16 | 运输工具的 ID是 16 (十六进制) |
00 | 没有定义特殊的货物图形 |
00 00 | 在任何情况下都使用货物ID为0 |
Code | Meaning |
00 | Action 0 |
00 | Feature 0, meaning trains |
01 | We set one property |
01 | For one vehicle |
16 | Starting at vehicle 16 |
12 | We set property 12 (sprite type) |
FD | And we set it to FD |
代码 | 含义 |
00 | 脚本0 |
00 | 特征0, 代表火车 |
01 | 定义一个属性 |
01 | 对一个运输工具 |
16 | 从运输工具ID 16开始 |
12 | 设置属性12 (sprite 类型) |
FD | 属性参数设置为 FD |
Element | Size | Description |
<Sprite-number> | dec | A sequential sprite number |
<Length> | dec | The total number of bytes in the action |
00 | B | Action type. In this case, 00 |
<Feature> | B | Which type of feature you would like to change |
<Num-props> | B | How many properties you would like to change per vehicle or station |
<Num-info> | B | How many vehicles/stations you would like to change |
<Id> | B* | The ID of the first vehicle/station to change |
<Property> | B | What property to change for each vehicle/station |
<New-info> | V | The new value of the property |
代码 | 数据类型 | 描述 |
<Sprite-number> | dec | sprite编号 |
<Length> | dec | 在这个脚本的数据总量 |
00 | B | 在本例中,定义为脚本0 |
<Feature> | B | 你想要修改哪类特征 |
<Num-props> | B | 你想要修改一个站台/运输工具的多少个属性 |
<Num-info> | B | 你想要修改多少个站台/运输工具 |
<Id> | B* | 第一个要修改的站台/运输工具的ID |
<Property> | B | 每个站台/运输工具的哪一个属性需要修改 |
<New-info> | V | 修改后的属性值 |
Number | Version | Size | Description |
00 | W | date of introduction | |
02 | B | reliability decay speed | |
03 | B | vehicle life in years | |
04 | B | model life in years | |
06 | B | climate availability | |
07 | 2 | B | load amount |
序号 | 版本 | 大小 | 描述 |
00 | W | 引入日期(感觉像是提前通知的试用时间) | |
02 | B | 可靠性的衰减速度 | |
03 | B | 寿命 | |
04 | B | (好像是制造日期) | |
06 | B | 适用的气候类型 | |
07 | 2 | B | 装载量 |
Phase | Duration | Reliability | |
1 | 7 to 38 months | increases from 48-73% to 75-100% | |
2 | prop. 04 less 8 years | stays constant at peak, 75-100% | |
3 | 10 to 20.5 years | decreases from peak to 25-50% |
阶段 | 持续时间 | 可靠性 | |
1 | 7 -38月 | 由 48-73% 增加到 75-100% | |
2 | 4- 8年 | 保持在 75-100% | |
3 | 10 -20.5年 | 衰减到 25-50% |
Bit | Value | Climate | |
0 | 1 | Temperate | |
1 | 2 | Arctic | |
2 | 4 | Tropical | |
3 | 8 | Toyland |
位 | 值 | 气候 | |
0 | 1 | 温带 | |
1 | 2 | 寒带 | |
2 | 4 | 沙漠 | |
3 | 8 | 玩具 |
Action 0 - Properties for train vehicles脚本0-火车属性 Defining properties of train vehicles. 定义了火车的属性
Properties 属性
Version codes: 版本代号
Comments 注释: Speed (09) 速度(09) Train speed is in units of mph*1.6, i.e. approximately km/h. 火车速度的单位是mph*1.6,也就是接近于公里/小时 For wagons, this value is only used if the "wagonspeedlimit" switch is on, and it limits the speed of the train to that of the lowest wagon speed. This limit is ignored for wagons with a livery override for the current train, so that train sets always get their max speed from the engine's max speed. 对车厢来说,这个值只在“车厢限速”为开时,才有用。这个值限定了火车速度为整趟列车中最低速度车厢的速度。 For wagons, a value of 0 means "default" (which depends on cargo type and date of introduction), and FFFF means no limit. 对车厢来讲,“0”为默认值(引进日期和货物类型决定的)FFFF为无限制 Power (0B) 动力(0B) The power of the engine, in HP. 引擎动力,单位:马力。 A value of 0 means that the vehicle will be a wagon, otherwise it will be an engine. 0代表着这个运输工具为车厢,否则将是一个车头。 Running cost base (0E) and factor (0D) 运营基本费用(0E)和因子(0D) TTD calculates all costs by multiplying a 32-bit base amount with an 8-bit factor. The base amount is changed according to inflation, whereas the factor remains constant. ttd通过一个32位的基本费用和8位的因子来计算所有的费用。基本费用由通货膨胀决定,而因子却保持不变。 For the running costs of train vehicles, the following base amounts are available depending on the vehicle type (the value here is a pointer into TTD's memory where the actual amount is stored): 对运营费用来讲,下列的基本费用将由运输工具类型来决定(这个值是一个指针来指向实际存储的费用)
Theoretically, you could use pointers to other base amounts available in TTD, but these are the numbers TTD uses for train vehicles. 理论上讲,你可以使用指针来指向ttd中其它基本可用的费用,但这些是ttd中用于火车的基本数字。 The following are some real values for maintenance costs depending on the setting of the above two factors. This value is correct for medium difficulty, but increases and decreases for hard and easy difficulties respectively. These are the costs of a new game starting in 1921, because they obviously increase with inflation over time (unless noinflation is turned on). 下面就是以上两个因素设置后,会影响到的一些真实的保养成本。这个值是以中等难度为校正的,而困难/简单条件下时将会增加/或减少。这些是一个开始于1921年的新游戏时的成本,因为它们受到通货膨胀的影响(除非禁止通货膨胀) Running cost base 4C30 (steam) 基本运行成本 4C30(蒸汽)
Running cost base 4C36 (diesel) 基本运行成本 4C36(内燃)
Running cost base 4C3C (electric) 基本运行成本 4C36(电气)
Cost factor (17) 购买成本因子 The cost factor is a bit-coded value which determines how expensive an engine is. There is no distinction between steam, diesel or electric engines, they all use the same cost factor. The table below gives you some values to use for finding the right price for your engines. 购买成本因子是决定车头的购买成本的。该因子不受到车型的影响,蒸汽、内燃及电力车头都受同一个因子影响。下面的列表给出的值将让你决定你所设计的车头的正确价格 Cost factor 购买因子
Engine traction type (19) 引擎动力类型 This sets the traction type of a train engine, i.e. whether it is powered by steam, diesel, electric, monorail or maglev technology. It also sets the corresponding sound effect of the engine, and if property 22 is not set, the visual effect as well. 这个值设置了火车动力类型,也就是蒸汽、内燃、电力、单轨或者磁悬浮。同时也设置了相对应的音效,如果属性22没有设置,动画效果也将是相对应的。 The following ranges are available (and it does not matter which value you pick): 下表中的范围是可用参数(你在范围内所挑选的值不影响效果)
The default if this property is not set is 00, i.e. steam. 默认值为00,也就是蒸汽 Sort vehicle list (1A) 索引车辆列表(1A) This is not a property as such, but an action. It forces TTDPatch to shuffle the vehicle this "property" is being set for in front of the vehicle with the given value of the property. The order of this list is only used in the train purchase window. 这个值不是一个属性值,而是一个脚本,仅在车辆购买列表中使用,用来靠前显示给定值的车辆。 For example, setting prop. 1A for vehicle 09 to a value of 07 would lead to the following internal list: ... 05 06 09 07 08 0A 0B ... This property can not simply be overwritten, because the list is already shuffled when trying to do so. It is possible to reset the list to its original order with a special action 0 that has num-info set to 0, and only sets property 1A for trains: 00 00 01 00 00 1A Resetting the list should however only be done by sets that contain replacements for all train vehicles. Powered train wagons (1B and 23, see also 22) Normally, train wagons are unpowered in TTD, and if you set property 0B to a non-zero value, they become engines instead. Therefore, to model real-life trains where wagons have power, a different mechanism is needed. To make train wagons powered, you set property 1B of the engine instead of the wagon. This determines how much power each wagon adds to the train when attached to this engine. This only applies to wagons with a graphics override for this engine as well. This means that for example passenger wagons (with an override) will add power, but coal wagons (with no override) will not. In addition to adding power, these wagons are also heavier by the amount set in property 23. Callbacks (1E) For trains, the following callbacks have to be enabled by setting the corresponding bit in property 1E (certain other, not as frequently used callbacks are available without setting a bit here):
Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the variational action 2 for callbacks. Callbacks 1D (Can wagon be attached?), 23 (Additional text in purchase screen), 31 (Start/stop check), 32 (32-day callback), 34 (Autoreplace vehicle selection) and 36 (Change Vehicle Properties) do not need a bit to activate them, they are always active and will be used if defined in the action 3/action 2 chain. Coefficient of tractive effort (1F) This cofficient sets what fraction of the vehicle weight is equal to the maximum tractive effort. This includes the effect of having some unpowered axles, as well as the coefficient of friction that is available. Theoretically, this value should be calculated by taking the ratio of adhesive weight Wadh (i.e. the vehicle weight that rests on powered axles) times the coefficient of friction µ between the wheels and the rails to the total vehicle weight W, times 255, and convert to hex: prop. 1F = HEX ((Wadh * µ / W) * 255) With prop. 1F having a value of FF, the tractive effort is equal to the vehicle weight, for 80, it is half, and so on. If not set, a default of 4C is used, for a fraction of 0.30, corresponding to Wadh=W and a coefficient of friction of 0.30, which is the value used by the patch before 2.0.1 alpha 19. Sometimes you know the real-life tractive effort instead of adhesive weight and coefficient of friction. To help calculating prop. 1F in that case, here's a small example using the NS 1600 (Electric) with a mass of 84 tons and real-life tractive effort (TEreal) of 259 kN. To quickly find the value for property 1F you fill in the following formula: prop. 1F = HEX ((TEreal / (Mass * g) * 255) That may look confusing but you already know all variables: prop. 1F = HEX ((259 / (84 * 9.8) * 255) prop. 1F = HEX (0.3146 *255) = HEX(80.229) HEX calculations only work with figures in the natural domain: each figure has to be a positive and round figure. Therefore the value you convert to HEX isn't 80.229 but 80: HEX 80 = 50 Property 1F for the NS 1600 (Electric) would then be: 1F 50. Coefficient of air drag (20) This property sets the air drag coefficient c2 used for the realistic acceleration model, from 01 (no airdrag) to FF (most air drag) in arbitrary units. 00 means to use the default value that depends on the top speed (to simulate the fact that high-speed engines are more streamlined). The default values are the following:
For higher speeds, the series is continued in the same manner. Air drag in Newtons will then be c2*v*v with v in m/s, although it is probably futile to attempt to make c2 a realistic number due to the lack of TTd's consistent scaling. If a train doesn't reach its historical top speed, you might try setting the value of prop. 20 one or two steps lower than the default above, otherwise it's probably a good idea to leave it at the default. Shorter train vehicles (21) This property reduces the length of train vehicles, in units of 1/8th (12.5%). The value 00 means the vehicle has the full length, 01 means shorter by 1/8th (12.5%), up to 05=shorter by 5/8ths (62.5%). Larger numbers will not work properly, except at the end of the train*. The vehicle length is set whenever it leaves a depot. This property does not work for the first vehicle in a train (i.e. the engine). * This means that it is only safe to use values larger than 05 in the length callback making sure that they are only returned for the very last vehicle in the train. Otherwise the train will occasionally fall apart, with the wagons after the shortest one stopping to move. Visual effects and wagon power (22) By default, the visual effect of train engines is determined by the traction type (property 19). With this option you can change the type of effect as well as the position of it relative to the vehicle. (Note, currently only the positioning of steam actually works.) The position of the effect provides a range from 0 to F that is added to the type of the effect. Position 0 corresponds to a point half a vehicle length ahead of the vehicle, 4 is the front of the vehicle, 8 the middle, C the end and F is a half length behind the vehicle. Intermediate values are in-between. Additionally, this property can be used to disable powered wagons of this type, although that is usually done with callback 10 instead (which has the same meaning as prop. 22, but is more flexible).
For example, 28 would make the wagon powered and emit diesel fumes, but 80+28 = A8 would only emit the diesel fumes without adding power. Miscellaneous flags (27) This is a bit mask, with the following bits:
The tilting speed bonus only applies if all vehicles in the train have this bit set, and only if the "curves" switch is on. For realistic curves, it gives the train two free curving pieces with no speed decrease, and for other settings, it increases the curves setting by one (0->1, 1->2, 2->2). Cargo classes (28, 29) To make vehicle sets more compatible with future new cargo definitions, these two properties allow vehicles to define what type of cargo they should be refittable to. A wagon will be refittable to all cargo types that match the classes set in prop. 28 except for the ones that match the classes set in prop. 29. In addition, afterwards those cargo types listed in prop. 1D will be toggled. In terms of logic, it is Refit list = (cargos from prop. 28 AND NOT cargos from prop. 29) XOR cargos from prop. 1D This means, if a cargo type is in the list because it matches prop. 28 but not prop 29, having the respective bit set in prop. 1D will disable it again. Conversely, if the cargo type is not in the list, the bit in prop. 1D will add it. This way, if props. 28/29 are unset, prop. 1D will retain the original meaning, but it is still able to selectively add or remove certain cargo types even if props. 28/29 are used. As a consequence, you have both full control over the cargo types that you know of (using prop. 1D), and those you don't know of yet (using props. 28/29). Leave the bits for cargos that you don't know of unset in prop. 1D, and set/clear the bits for known cargos to add/remove them from the list as appropriate. The class list is a bit mask, with the following bits defined so far:
Note that cargo types may belong to several classes. This is the reason for making two properties, an additive and a subtractive one, because this way a vehicle can be specified to be refittable to, for example, all express cargo that does not require refrigeration (i.e., from the default cargos, no food). For the cargo types added in this way, the vehicle will probably have no specific graphics (in action 3) to show the cargo load. In this case, the default will be used, which should therefore be sufficiently generic-looking if possible. However, using vehicle variable 47 you can at least select the graphics most appropriate for the cargo type's class. Long format introduction date (2A) Set the vehicle introduction date, in days since the year 0. This takes account of leap years; dividable by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). This property must be set after property 00 to take effect. In TTDPatch, dates after 2044 will be limited to 2044. Example Below is an example of what a real Action 0 pseudo-sprite could look like for a train engine. (A basic version) 10 * 14 00 00 03 01 02 09 C0 00 0B D8 0E 12 FD
|
欢迎光临 嗨皮网 (http://d2.shuimeng.net/) | Powered by Discuz! X3.3 |