Prototype/Technology: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.17)
(Removed old prototype docs)
Tag: Replaced
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/TechnologyPrototype.html https://lua-api.factorio.com/latest/prototypes/TechnologyPrototype.html]
Prototype type: '''technology'''


More in [[Research]]
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
== 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 <code>-number</code>, the number is ignored for localization purposes. E. g. if the name is <code>whatever-name-3</code>, the game looks for the <code>technology-name.whatever-name</code> 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.
<syntaxhighlight lang="lua">  {
    type = "technology",
    name = "physical-projectile-damage-2",
    ...
    upgrade = "true"
  }</syntaxhighlight>
 
=== enabled ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== hidden ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
Hides the technology from the tech screen.
 
=== unit ===
It contains
* count — [[Types/double]] — How many units are needed. Must be positive.
* 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 speficied.
* time — [[Types/double]] — How much time is needed per one unit, in lab with crafting speed 1 it is the number of seconds.
* ingredients — [[Types/table]] of [[Types/IngredientPrototype]] — list of ingredients needed for one units
:<syntaxhighlight lang="lua">unit =
{
  count = 20,
  time = 5,
  ingredients = {{"automation-science-pack", 1}}
}</syntaxhighlight>
 
=== 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 [http://lua-api.factorio.com/latest/Concepts.html#Modifier Modifier]
 
List of effects of the technology (applied when the technology is researched).
 
  {
    {
      type  = "unlock-recipe",
      recipe = "land-mine"
    }
  }

Latest revision as of 14:33, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/TechnologyPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.