Prototype/Technology: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎unit: added count_formula operators table, added misc other details and fuller unit example using existing format)
(→‎unit: correct current technology characters)
Line 62: Line 62:
| () || Brackets for order, supported nested brackets
| () || Brackets for order, supported nested brackets
|-
|-
| a-z A-Z || The current level of the technology, any characters within the range can be used
| l or L || The current level of the technology
|-
|-
| Digits || Are treated as numbers
| Digits || Are treated as numbers

Revision as of 23:00, 3 May 2019

Basics

Prototype type: technology

More in Research

General properties

Inherits all properties from Prototype.

icons, icon, icon_size (IconSpecification)

Type: Types/IconSpecification

name

See Prototype#name

Inherited from Prototype. If the name ends with -number, the number is ignored for localization purposes. E. g. if the name is whatever-name-3, the game looks for the technology-name.whatever-name localization. The technology tree will also show the number on the technology icon.

Technology data

If the technology does not have a difficulty, this is located directly in the prototype. Otherwise, if the "normal" or "expensive" property exists, the technology has difficulty. Then, the technology data has to be specified for each difficulty instead of directly in the prototype. If at least one difficulty has technology data defined, the other difficulty can be set to false. This will give it the exact same properties as the difficulty that is defined.

upgrade

Type: Types/bool

Default: false

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

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

enabled

Type: Types/bool

Default: true

hidden

Type: Types/bool

Default: false

Hides the technology from the tech screen.

unit

Type: Types/table of properties:

  • count — Types/double — How many units are needed. Must be positive. May not be specified if count_formula is specified.
  • count_formula — Types/string — Formula that specifies how many units are needed per level of the infinite technology. May not be specified if count is specified. The formula is executed following the BODMAS order.
Supported operators:
Operator meaning
+ Addition
- Subtraction
* Multiplication
^ Power, raise the preceding base number by the following exponent number
() Brackets for order, supported nested brackets
l or L The current level of the technology
Digits Are treated as numbers
. Decimal point in number
unit =
{
  count_formula = "2^(L-6)*1000",
  ingredients =
  {
    {"automation-science-pack", 1},
    {"logistic-science-pack", 1},
    {"chemical-science-pack", 1},
    {"production-science-pack", 1},
    {"utility-science-pack", 1},
    {"space-science-pack", 1}
  },
  time = 60
}

max_level

Type: Types/uint32 or Types/string

Default: Same as the level of the technology, which is 0 for non-upgrades, and the level of the upgrade for upgrades.

"infinite" for infinite technologies, otherwise uint.

prerequisites

Type: Types/table of Types/string

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

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

effects

Type: Types/table of Modifier

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

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