NML:Industries

From GRFSpecs
Jump to navigationJump to search

Industry properties

Industry properties. Default industry type numbers can be found at default industries.

property value range comment
substitute industry type Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). This property must be set first, before any other properties or graphics. All properties of the old type are copied to your new industry.
override industry type Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.
layouts Array of tilelayouts

See Tilelayout syntax.

life_type One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE | EXTRACTIVE | ORGANIC | PROCESSING The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.
closure_msg string

Message displayed when the industry announces closure. Use a custom string or one of the default TTD strings.

prod_increase_msg string

Message displayed when industry increases production. Use a custom string or one of the default TTD strings.

prod_decrease_msg string

Message displayed when industry decreases production. Use a custom string or one of the default TTD strings.

fund_cost_multiplier 0..255 Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.
cargo_types array of up to 16 accept_cargo("ACME") and up to 16 produce_cargo("ACME", 0) NML 0.5 Supported by OpenTTD 1.91.9 Types of cargo (1) accepted, using a label from the cargotable (2) produced, using a label from the cargo table, and an amount which will be produced 8 or 9 times per month.
prod_cargo_types array of up to 2 ints Types of cargo produced. Use the cargotype(<label>) built-in function to specify a label from the cargotable.
accept_cargo_types array of up to 3 ints Types of cargo accepted. Use the cargotype(<label>) built-in function to specify a label from the cargotable
prod_multiplier array of up to 2 ints (0..255) Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)
min_cargo_distr 0..255 Minimal amount of cargo before transporting to stations.
random_sound_effects array of ints Sound effect numbers that are played some times.
conflicting_ind_types array of up to 3x industry_type(IND_TYPE_OLD | IND_TYPE_NEW, id)

Three industry types that should not be nearby. Use the builtin function industry_type(..) to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).

prob_random 0..255 (up to NML v5796-418, use prob_map_gen otherwise) Probability of occurring while generating initial industries. If the random game probability value is nonzero and IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION is not set, at least one instance of this type is guaranteed to appear on the map.
prob_map_gen 0..255 (NML v5796-418 or newer) Probability of occurring while generating initial industries. If the random game probability value is nonzero and IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION is not set, at least one instance of this type is guaranteed to appear on the map.
prob_in_game 0..255 Probability of occurring while creating industries during the game.
map_colour 0..255

Colour index from the DOS palette to use on the minimap for this industry.

spec_flags bitmask(flags)

for flag values see Industry special flags

new_ind_msg string Message displayed when industry gets built during game play.
input_multiplier_1 array of up to 2 floats (0..255) Output cargo multiplication factors for getting a unit of the first accepted cargo.
input_multiplier_2 array of up to 2 floats (0..255) Output cargo multiplication factors for getting a unit of the second accepted cargo.
input_multiplier_3 array of up to 2 floats (0..255) Output cargo multiplication factors for getting a unit of the third accepted cargo.
name string

Name of the industry, use a custom string or one of the default TTD strings.

prospect_chance 0 .. 1 (float) Chance of successful prospecting.
callback_flags bitmask(flags)

Do not set this, unless you use old-style callbacks.

remove_cost_multiplier int Cost multiplier for removing the industry (currently only possible with magic bulldozer).
nearby_station_name string Default additional name for a nearby station

Industry special flags

flag meaning
IND_FLAG_PLANT_FIELDS_PERIODICALLY The industry periodically plants fields around itself (temperate and arctic farms)
IND_FLAG_CUT_TREES The industry cuts trees around itself and produces its first output cargo from them (lumber mill)
IND_FLAG_BUILT_ON_WATER The industry is built on water (oil rig)
IND_FLAG_ONLY_IN_LARGE_TOWNS The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)
IND_FLAG_ONLY_IN_TOWNS The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)
IND_FLAG_BUILT_NEAR_TOWN The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)
IND_FLAG_PLANT_FIELDS_WHEN_BUILT Fields are planted around the industry when it's built (all farms)
IND_FLAG_NO_PRODUCTION_INCREASE The industry cannot increase its production on the temperate climate (oil wells)
IND_FLAG_BUILT_ONLY_BEFORE_1950 The industry is built only before 1950 (oil wells)
IND_FLAG_BUILT_ONLY_AFTER_1960 The industry is built only after 1960 (oil rig)
IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES AI players will attempt to establish air and ship routes going to this industry (oil rig)
IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE The industry can be exploded by a military airplane (oil refinery)
IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE The industry can be exploded by a military helicopter (factory)
IND_FLAG_CAN_CAUSE_SUBSIDENCE The industry can cause a subsidence (coal mine)
IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER Automatic production multiplier handing (No industry has this bit set by default.).
IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK The production callback needs random bits in var. 10 (No industry has this bit set by default.)
IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)
IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE Allow closing down the last instance of this type (No industry has this bit set by default.)

Common variables

The following variables are available to both industries and industry tiles. All of them require an x, y offset. For industries, this offset is unsigned and relative to the northernmost tile. For industry tiles, it is signed and relative to the current tile.

name value range comment
nearby_tile_slope SLOPE_XXX

See tile slopes for an overview of possible values

nearby_tile_is_water 1 if the tile is water, 0 otherwise
nearby_tile_terrain_type TILETYPE_XX TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW
nearby_tile_water_class WATER_CLASS_XXX XXX = [NONE | SEA | CANAL | RIVER] Note that tiles for which nearby_tile_is_water is 0 may still have a water class, e.g. industry tiles with water beneath them.
nearby_tile_height 0..120 The height of the lowest corner of the given tile.
nearby_tile_class

Tile class

nearby_tile_animation_frame 0..255 Animation frame of the given tile
nearby_tile_industrytile_id 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF 0x00aa: The tile is an industry tile defined in this GRF with tile id aa.
0xFFbb: The tile is an original industry tile with id bb.
0xFFFE: The tile is an industry tile defined in another GRF.
0xFFFF: The tile is not an industry tile or it belongs to another industry.