Factorio Prototype DocsVersion 1.1.107

TechnologyPrototype - 'technology' Example code

A technology.

This prototype has two different formats that can be specified. If both normal and expensive are not defined, the standard properties define this technology. Otherwise, they are ignored, and the normal and expensive properties are used exclusively to define this technology.

Inherits from PrototypeBase

Properties

icons optional :: array[IconData]

Can't be an empty array.

Can't be an empty array.

icon optional :: FileName

Path to the icon file. [...]

Path to the icon file. [...]

icon_size optional :: SpriteSizeType

The size of the square icon, in pixels. [...]

The size of the square icon, in pixels. [...]

icon_mipmaps optional :: IconMipMapType

Icons of reduced size will be used at decreased scale.

Icons of reduced size will be used at decreased scale.

normal optional :: TechnologyData or false

Can be set to false if the expensive property is defined. [...]

Can be set to false if the expensive property is defined. [...]

expensive optional :: TechnologyData or false

Can be set to false if the normal property is defined. [...]

Can be set to false if the normal property is defined. [...]

upgrade optional :: bool

When set to true, and the technology contains several levels, only the relevant one is displayed in the technology screen. [...]

When set to true, and the technology contains several levels, only the relevant one is displayed in the technology screen. [...]

enabled optional :: bool

Only loaded if neither normal nor expensive are defined.

Only loaded if neither normal nor expensive are defined.

hidden optional :: bool

Hides the technology from the tech screen. [...]

Hides the technology from the tech screen. [...]

visible_when_disabled optional :: bool

Controls whether the technology is shown in the tech GUI when it is not enabled. [...]

Controls whether the technology is shown in the tech GUI when it is not enabled. [...]

ignore_tech_cost_multiplier optional :: bool

Controls whether the technology cost ignores the tech cost multiplier set in the DifficultySettings. [...]

Controls whether the technology cost ignores the tech cost multiplier set in the DifficultySettings. [...]

unit optional :: TechnologyUnit

Determines the cost in items and time of the technology. [...]

Determines the cost in items and time of the technology. [...]

max_level optional :: uint32 or "infinite"

"infinite" for infinite technologies, otherwise uint32. [...]

"infinite" for infinite technologies, otherwise uint32. [...]

prerequisites optional :: array[TechnologyID]

List of technologies needed to be researched before this one can be researched. [...]

List of technologies needed to be researched before this one can be researched. [...]

effects optional :: array[Modifier]

List of effects of the technology (applied when the technology is researched). [...]

List of effects of the technology (applied when the technology is researched). [...]

Inherited from PrototypeBase
type :: string

Specifies the kind of prototype this is. [...]

Specifies the kind of prototype this is. [...]

name[overridden] :: string

Unique textual identification of the prototype. [...]

Unique textual identification of the prototype. [...]

order optional :: Order

Used to order prototypes in inventory, recipes and GUIs. [...]

Used to order prototypes in inventory, recipes and GUIs. [...]

localised_name optional :: LocalisedString

Overwrites the name set in the locale file. [...]

Overwrites the name set in the locale file. [...]

localised_description optional :: LocalisedString

Overwrites the description set in the locale file. [...]

Overwrites the description set in the locale file. [...]

Properties

icons :: array[IconData] optional

Can't be an empty array.

icon :: FileName optional

Path to the icon file.

Mandatory if icons is not defined.

icon_size :: SpriteSizeType optional

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon.

Mandatory if icons is not defined, or if icon_size is not specified for all instances of icons.

icon_mipmaps :: IconMipMapType optional

Default: 0

Icons of reduced size will be used at decreased scale.

normal :: TechnologyData or false optional

Can be set to false if the expensive property is defined. This will disable this difficulty, same as setting enabled to false would. If it's later manually enabled by script, it will use the data from expensive.

If this property is not defined while expensive is, it will mirror its data.

expensive :: TechnologyData or false optional

Can be set to false if the normal property is defined. This will disable this difficulty, same as setting enabled to false would. If it's later manually enabled by script, it will use the data from normal.

If this property is not defined while normal is, it will mirror its data.

upgrade :: bool optional

Default: false

When set to true, and the technology contains several levels, only the relevant one is displayed in the technology screen.

Only loaded if neither normal nor expensive are defined.

Example

{
  type = "technology",
  name = "physical-projectile-damage-2",
  [...]
  upgrade = "true"
}

enabled :: bool optional

Default: true

Only loaded if neither normal nor expensive are defined.

hidden :: bool optional

Default: false

Hides the technology from the tech screen.

Only loaded if neither normal nor expensive are defined.

visible_when_disabled :: bool optional

Default: false

Controls whether the technology is shown in the tech GUI when it is not enabled.

Only loaded if neither normal nor expensive are defined.

ignore_tech_cost_multiplier :: bool optional

Default: false

Controls whether the technology cost ignores the tech cost multiplier set in the DifficultySettings. E.g. 4 for the default expensive difficulty.

Only loaded if neither normal nor expensive are defined.

unit :: TechnologyUnit optional

Determines the cost in items and time of the technology.

Mandatory if neither normal nor expensive are defined.

max_level :: uint32 or "infinite" optional

"infinite" for infinite technologies, otherwise uint32.

Defaults to the same level as the technology, which is 0 for non-upgrades, and the level of the upgrade for upgrades.

Only loaded if neither normal nor expensive are defined.

prerequisites :: array[TechnologyID] optional

List of technologies needed to be researched before this one can be researched.

Only loaded if neither normal nor expensive are defined.

Example

prerequisites = {"explosives", "military-2"}

effects :: array[Modifier] optional

List of effects of the technology (applied when the technology is researched).

Only loaded if neither normal nor expensive are defined.

Example

{
  {
    type  = "unlock-recipe",
    recipe = "land-mine"
  }
}

Overridden Properties

name :: string

If this name ends with -<number>, that number is ignored for localization purposes. E.g. if the name is technology-3, the game looks for the technology-name.technology localization. The technology tree will also show the number on the technology icon.

Example

{
  type = "technology",
  name = "steel-processing",
  icon_size = 256,
  icon_mipmaps = 4,
  icon = "__base__/graphics/technology/steel-processing.png",
  effects =
  {
    {
      type = "unlock-recipe",
      recipe = "steel-plate"
    },
    {
      type = "unlock-recipe",
      recipe = "steel-chest"
    }
  },
  unit =
  {
    count = 50,
    ingredients = {{"automation-science-pack", 1}},
    time = 5
  },
  order = "c-a"
}

Prototypes

Types