Prototype/Technology: Difference between revisions
(Set prototype parent) |
(Converted to SMW format) |
||
Line 1: | Line 1: | ||
{{Prototype parent|PrototypeBase}} | {{Prototype parent|PrototypeBase}} | ||
A [[technologies|technology]]. | |||
== | <!-- Custom thing for technology data. -->__NOTOC__ | ||
Prototype type | <table class="prototype-toc"> | ||
<tr><td class="caption" colspan="3">{{FULLPAGENAME}} — <code>[[Has prototype type::technology]]</code></td></tr> | |||
{{Prototype TOC/item|Prototype/Technology#icons, icon, icon_size (IconSpecification)|icons, icon, icon_size (IconSpecification)|[[Types/IconSpecification|IconSpecification]]}} | |||
<tr><td colspan="3" class="prototype-toc-item-name">[[#Technology data]]</td></tr> | |||
{{#ask: | |||
[[Prototype property pagename::{{FULLPAGENAME}}]] | |||
[[Prototype property name::icons, icon, icon_size (IconSpecification)]]<!-- update this if there are more non tech data properties in the future --> | |||
|?Prototype property name | |||
|?Prototype property type | |||
|?Prototype property optional | |||
|format=plainlist | |||
|template=Prototype TOC/item | |||
|sort=Prototype property optional,Prototype property name | |||
|link=none | |||
}} | |||
{{#ask: [[Has parent ::+]][[{{FULLPAGENAME}}]] | |||
|?Has parent | |||
|format=plainlist | |||
|mainlabel=- | |||
|template=Prototype TOC/parent | |||
|link=none | |||
}} | |||
</table> | |||
== General properties == | == General properties == | ||
Inherits all properties from [[PrototypeBase]]. | Inherits all properties from [[PrototypeBase]]. | ||
{{Prototype property|icons, icon, icon_size (IconSpecification)|[[Types/IconSpecification|IconSpecification]]}} | |||
=== name === | === name === | ||
Line 20: | Line 40: | ||
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. | 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. | ||
{{Prototype property|upgrade|[[Types/bool|bool]]|false|optional=true}} | |||
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. | ||
<syntaxhighlight lang="lua"> { | <syntaxhighlight lang="lua"> { | ||
Line 33: | Line 49: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
{{Prototype property|enabled|[[Types/bool|bool]]|true|optional=true}} | |||
= | |||
{{Prototype property|hidden|[[Types/bool|bool]]|false|optional=true}} | |||
Hides the technology from the tech screen. | Hides the technology from the tech screen. | ||
{{Prototype property|visible_when_disabled|[[Types/bool|bool]]|false|optional=true}} | |||
Controls whether the technology is shown in the tech GUI when it is disabled (enabled = false). | Controls whether the technology is shown in the tech GUI when it is disabled (enabled = false). | ||
{{Prototype property|unit|[[Types/table|table]]}} | |||
[[Types/table|table]] with the following key/value pairs: | |||
* count — [[Types/double]] — How many units are needed. Must be positive. May not be specified if count_formula is specified. | * count — [[Types/double|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. | * count_formula — [[Types/string|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 & characters: | : Supported operators & characters: | ||
: {| class="wikitable" | : {| class="wikitable" | ||
Line 79: | Line 84: | ||
| SPACE || Space characters are ignored | | SPACE || Space characters are ignored | ||
|} | |} | ||
* time — [[Types/double]] — How much time is needed per one unit, in lab with crafting speed 1 it is the number of seconds. | * time — [[Types/double|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 | * ingredients — [[Types/table|table]] of [[Types/IngredientPrototype|IngredientPrototype]] — list of ingredients needed for one units | ||
:<syntaxhighlight lang="lua"> | :<syntaxhighlight lang="lua"> | ||
Line 98: | Line 103: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
{{Prototype property|max_level|[[Types/uint32|uint32]] or [[Types/string|string]]|Same as the level of the technology, which is 0 for non-upgrades, and the level of the upgrade for upgrades.|optional=true}} | |||
"infinite" for infinite technologies, otherwise uint. | "infinite" for infinite technologies, otherwise uint. | ||
{{Prototype property|prerequisites|[[Types/table|table]] of [[Types/string|string]]|optional=true}} | |||
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. | ||
prerequisites = {"explosives", "military-2"} | prerequisites = {"explosives", "military-2"} | ||
{{Prototype property|effects|[[Types/table|table]] of [http://lua-api.factorio.com/latest/Concepts.html#Modifier Modifier]|optional=true}} | |||
List of effects of the technology (applied when the technology is researched). | List of effects of the technology (applied when the technology is researched). | ||
<syntaxhighlight lang="lua"> | |||
{ | |||
{ | { | ||
type = "unlock-recipe", | |||
recipe = "land-mine" | |||
} | } | ||
} | |||
</syntaxhighlight> |
Revision as of 19:03, 6 August 2019
Template:Prototype parent A technology.
Prototype/Technology — technology | ||
#Technology data |
General properties
Inherits all properties from PrototypeBase.
name
Inherited from PrototypeBase. 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.
Template:Prototype property 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"
}
Template:Prototype property Hides the technology from the tech screen.
Template:Prototype property Controls whether the technology is shown in the tech GUI when it is disabled (enabled = false).
Template:Prototype property table with the following key/value pairs:
- count — double — How many units are needed. Must be positive. May not be specified if count_formula is specified.
- count_formula — 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 & characters:
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 SPACE Space characters are ignored
- time — double — How much time is needed per one unit, in lab with crafting speed 1 it is the number of seconds.
- ingredients — table of IngredientPrototype — list of ingredients needed for one units
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 }
Template:Prototype property "infinite" for infinite technologies, otherwise uint.
Template:Prototype property List of technologies needed to be researched before this one can be researched.
prerequisites = {"explosives", "military-2"}
Template:Prototype property List of effects of the technology (applied when the technology is researched).
{
{
type = "unlock-recipe",
recipe = "land-mine"
}
}