Action0/Industries

From GRFSpecs

Jump to: navigation, search

Contents

Introduction

Industries work similarly to town buildings as well, except that the maximum number of possible industries is 37 in TTDPatch and 64 in OpenTTD. The non-overridden original types count towards this limit. Industries don't have a climate mask; you should simply not define an industry if it would be for the wrong climate.

Defining industries follows the same schema as houses do: to start using an ID, you first need to define it by setting property 8 for it. If you try to reference an ID (either via action0 or via action3) that isn't defined, your request is ignored, but not reported as an error, either. This means that if you want to conditionally define an ID, all you need to do is skipping the action0 that sets property8, and everything else gets skipped automatically.

Properties

Property Size Version Description
08BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Substitute industry type
09BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Industry type override
0AVSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Set industry layout(s)
0BBSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Industry production flags
0CWSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Industry closure message
0DWSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Production increase message
0EWSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Production decrease message
0FBSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Fund cost multiplier
10WSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Production cargo types
11DSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Acceptance cargo types
12,13BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Production multipliers
14BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Minimal amount of cargo distributed
15VSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Random sound effects
163*BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Conflicting industry types
17BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Probability in random game
18BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Probability during gameplay
19BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Map color
1ADSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Special industry flags to define special behavior
1BWSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5New industry text ID
1C,1D,1EDSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 45)2.5Input cargo multipliers for the three input cargo types
1FWSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 49)2.5Industry name
20DSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 49)2.5Prospecting success chance
21,22BSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 49)2.5Callback flags
23DSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 73)2.5Destruction cost multiplier
24WSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.6 (r1782)2.6Default text for nearby station

Description

Substitute industry type (08)

Substitute industry type. The first assignment of this property copies all properties of the old type to this new type. Unlike for houses, the substitute type won't replace this new type if the definition becomes unavailable. List of valid industry types

There's a special use of this property beginning from alpha 70: if you set it to FFh, you can disable an original industry. In this case, the ID used must be the number of industry you want to disable. Disable requests are ignored for industries not present on the current climate and industries already overridden.

Supported by OpenTTD 1.1 (r20108)1.1 Not supported by TTDPatch AIs can use the substitute type to make decisions about station graphics and vehicle choice via callback 18.

Industry type override (09)

Industry type override. The overridden industry type won't be built in new random games. If the GRF file becomes active after the game was started, industries of the overridden new type won't be replaced by the new type. List of valid industry types

By overriding an old type, you're saying "my type is a substitute for that old type". When GRFs ask information about the old type you've overridden (via industry variable 67, for example), they will get information about your type instead. If you want to replace an old industry type with something completely different, use the "disable" function of property 08 (see above), then define the new industry type without using property 09. A rule of thumb: if your industry accepts or produces different cargoes than the original one, it should not override the original one.

For example, if you want to replace the old coal mine with something that changes its coal production more dynamically, use property 09 to override industry 00. This way, other industries that want to be far from coal mines will stay far from your industry type too. If, however, you want to replace the coal mine with a potash mine, do not use property 09. This will ensure that other industries don't consider your type as a coal mine.

Please note, however, that only one new industry can override an old type. If two new types want to override the same old type, the first one wins, and the second is added normally, ignoring its property 09.

Set industry layout(s) (0A)

Format of industry layout tables:

SizeVariableMeaning
BnumlayoutsThe total number of layouts following
DsizeThe size of the whole definition, excluding numlayouts and size
Vlayoutsnumlayout layouts, see format below

Format of an industry layout:

As a special case, if the first byte of a new industry layout is FEh, then only two bytes follow: the industry number and the layout number. The specified layout of the specified old industry type will be added to the layout list of the current industry. The following applies only if the first byte wasn't FEh

SizeVariableMeaning
Bxoffs
ByoffsOffsets counted from the northernmost tile of the industry, specifying the position of the current tile. Both are taken as signed integers, but cannot go negative except the special case mentioned below.
BoldtileAn old tile type to be put on the given tile
--or--
0xFE,WnewtileThe ID of an already defined industry tile, padded with 0 to create a word value. This tile type will be placed on the given tile.
--or--
0xFF The given tile is checked for clearance, but nothing will be placed on it. Useful to ensure some free space around your industry. This is the only case where xoffs and yoffs can be negative. If xoffs is negative, yoffs must be one lower than the wanted value.

The layout consists of a list of the above tile definitions, terminated by two bytes: 0,80h

Industry production type (0B)

ValueMeaningSupported by OpenTTD 0.60.6 Not supported by TTDPatch Effect on nearby stationsEffect if CB 29 is disabled
00consuming industry (e.g. power plant)noneNo production changes; no closure
01extractive industry (e.g. coal mine)suffix 'Mines' if some non-liquid, non-passenger, non-mail cargo is producedStandard primary-industry production change
02organic industry (e.g. forest)suffix 'Forest' or 'Woods' if wood is producedStandard primary-industry production change
04processing industry (e.g. steel mill)noneStandard processing-industry closing-behaviour

Other values are reserved; do not set any other values.

Industry messages (0C..0E), new industry text ID (1B)

The text associated with these textID will be shown if the industry announces closedown, if the industry increases production, if the industry decreases production or when the industry is generated during the game.

For the generation message, by default, all industries have "New xxx is being constructed near yyy", except forests, that have "New Forest is being planted near yyy".

Production cargo types (10)

Two climate-dependent cargo numbers representing the cargo types the industry can produce. Unused slots can be filled with FFh. List of valid types: CargoTypes

Acceptance cargo types (11)

Three climate-dependent cargo numbers representing the cargo types the industry can accept, plus a fourth filler byte which is always ignored. Unused slots can be filled with FFh. List of valid types: CargoTypes

These cargo types will only be really accepted if the according acceptance of the industry tiles adds up to 8/8 or more.

From GRF version 7 and above, the meaning of the above two properties will change: instead of climate-dependent cargo slot numbers, you have to give climate-independent cargo IDs. If your GRF has a cargo translation table, then this ID is the index in that table; otherwise, it's the cargo bit. Cargoes not currently present will be changed to FFh. Please note that TTD stops processing these lists at the first FFh value, so specifying absent cargoes isn't always safe.

Production multipliers (12, 13)

If nonzero, the industry periodically (every 256 ticks, that is 8 or 9 times in a month) produces the given amount from the according cargo type. The properties specify the amount produced at default production level, they are scaled equally on production changes.

Minimal amount of cargo distributed (14)

The produced cargo will be distributed to stations only after it exceeds this amount.

Random sound effects (15)

The data starts with a byte defining the number of available effects, then one byte per effect. TTD periodically picks one of the available effects randomly, and plays it.

Conflicting industry types (16)

3 bytes define 3 types that won't appear in the vicinity of this industry. If a byte has bit 7 set, the bottom 6 bits are the ID of a new type already defined in the current GRF file. If bit 7 is clear, the bottom 6 bits specify an old industry type. FFh can be used to fill unused entries. You shouldn't modify property 9 after the type has been referenced by a property 16. List of valid industry types

Probability in random game (17), Probability during gameplay (18)

Old types have probabilities between 0 and 10. If the random game probability value is nonzero, at least one instance of this type is guaranteed to appear on the map.

These probabilities are "relative probabilities". That is, if you set the probability of industry A to twice the probability of industry B, industry A will appear about twice as often as B. Increasing the probabilities of all industries on the other hand changes nothing. The appearance probabilities have no influence on how many industries are placed in total.

Map colour (19)

The value must be a color index from the DOS pallette. The following values are used by default industries:

NumberColourExample
01BlackCoal mine
0AGraySteel mill
0FWhiteBank
25Dark beigeWater supply
27Light beigeRubber plantation
30PinkFarm
37BrownFood processing plant
56GreenForest
98BlueOil wells/oil rig
AEPurpleFactory
B8RedPower station
BFYellowOil refinery
C2OrangeSaw mill
D0Light greenWater tower

Special industry flags to define special behavior (1A)

BitValueVersionMeaning
01Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry periodically plants fields around itself (temperate and arctic farms)
12Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry cuts trees around itself and produces its first output cargo from them (lumber mill)
24Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry is built on water (oil rig)
38Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)
410Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)
520Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)
640Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5Fields are planted around the industry when it's built (all farms)
780Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry cannot increase its production on the temperate climate (oil wells)
8100Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry is built only before 1950 (oil wells)
9200Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry is built only after 1960 (oil rig)
10400Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5AI players will attempt to establish air and ship routes going to this industry (oil rig)
11800Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry can be exploded by a military airplane (oil refinery)
121000Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry can be exploded by a military helicopter (factory)
132000Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The industry can cause a subsidence (coal mine)
144000Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5Automatic production multiplier handing (No industry has this bit set by default.)[1]
158000Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5The production callback needs random bits in var. 10 (No industry has this bit set by default.)
1610000Supported by OpenTTD 1.01.0 Supported by TTDPatch 2.6 (r1925)2.6Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)
1720000Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.6 (r1925)2.6Allow closing down the last instance of this type (No industry has this bit set by default.)
  1. If bit 14 is set, variables 40..42 will be divided by industry.prodmultiplier (variable 93), and the resulting instructions will be multiplied by the same amount before applying them. If you set this bit, please use small amounts in your instructions, since industry.prodmultiplier is 16 for default production, and can get as high as 128.

By default, TTDPatch tries to ensure that cargo chains don't get broken. To achieve this, TTDPatch always generates at least one instance from every available industry type during random map generation, and prevents the last instance from closing down even when the production change callback says it should. If your industry type isn't essential for gameplay, or you want to handle this situation yourself, you can set bits 16 and/or 17 to turn off the default TTDPatch behavior.

If you supply a lot of industry types but also want to support OpenTTD's small map sizes you should set bit 16 for the less important industry types which can be ommitted (there will likely not be enough space for an industry of every type).

Input cargo multipliers for the three input cargo types (1C..1E)

If the first (low) word of the property is M1 and the second (high) word is M2, and X units of the corresponding cargo is delivered to the industry, the output amounts are calculated this way:

output_type1 = X*M1/256

output_type2 = X*M2/256

The default value for old industry types is 0100h,0000h , so every unit of input cargo produces one unit of output cargo of the first type. Exceptions are temperate banks and oil rigs, that have the default value of 0000h,0000h ,so input cargo doesn't affect output.

Industry name (1F)

This is the text ID that will be attached to the town name when TTD texts refer to the industry.

Prospecting success chance (20)

This value is currently used only for extractive and organic industries (see property 0B for details). The higher this value is, the higher the chance that your industry can be built on a random place after prospecting. 0 means constant failure, while FFFFFFFFh means constant success.

Callback flags (21,22)

Property 21 can have the following bits set:

BitValueVar. 0CVersionCallback
0122Supported by OpenTTD Supported by TTDPatch 2.52.5Determine whether the industry can be built
1200Supported by OpenTTD Supported by TTDPatch 2.52.5Call the production callback when cargo arrives at the industry [1]
2400Supported by OpenTTD Supported by TTDPatch 2.52.5Call the production callback every 256 ticks [1]
3828Supported by OpenTTD Supported by TTDPatch 2.52.5Determine whether the industry can be built on given spot
41029Supported by OpenTTD Supported by TTDPatch 2.52.5Control random production changes
52035Supported by OpenTTD Supported by TTDPatch 2.52.5Monthly random production change
64037Supported by OpenTTD Supported by TTDPatch 2.52.5Cargo sub-type display
78038Supported by OpenTTD Supported by TTDPatch 2.5 (2.0.1 alpha 72)2.5Additional text in industry fund window
  1. 1.0 1.1 Supported by OpenTTD 0.60.6 Not supported by TTDPatch If none of the production change callbacks is activated, OpenTTD will use "smooth economy" if enabled. If any of the callbacks is enabled, "smooth economy" will be disabled for the industry.

Property 22 can have the following bits set:

BitValueVar. 0CVersionCallback
013ASupported by OpenTTD Supported by TTDPatch 2.5 (2.0.1 alpha 72)2.5Show additional text in industry window
123BSupported by OpenTTD Supported by TTDPatch 2.5 (2.0.1 alpha 73)2.5Control special industry effects
243DSupported by OpenTTD Supported by TTDPatch 2.5 (2.5 beta 4)2.5Opt out of accepting cargo
3814ASupported by OpenTTD Supported by TTDPatch 2.6 (r1712)2.6Decide industry color
41014BSupported by OpenTTD Supported by TTDPatch 2.6 (r1718)2.6Decide input cargo types
52014CSupported by OpenTTD Supported by TTDPatch 2.6 (r1718)2.6Decide output cargo types
64015FSupported by OpenTTD 1.3 (r24186)1.3 Not supported by TTDPatchSet initial production level on construction.

Destruction cost multiplier (23)

This value specifies the cost of removing the industry when the ctrl-dynamite function of morebuildoptions.removeindustry is enabled. This value is multiplied by the house removal cost multiplier to get the final cost. The default value is 1000 in TTDPatch, and 0 (zero) in OpenTTD.

Default name for nearby station (24)

If non-zero, this text ID specifies an additional name option for stations built near this industry, which will be used before any of the standard TTD names. The text should contain a \80, which will be the name of the nearby town.

If the newly built station cannot use the specified text (because that name has been used for another station in the same town) the default TTD naming system will be used, but without the names "\80 Oilfield" or "\80 Mines".

Setting this to zero disables "\80 Oilfield" and "\80 Mines" without adding any additional station name options.

Example

Personal tools
advertisement