StdLib.Data.Technology
Wrapper for Factorio technology prototypes.
Methods17
function Technology.__call(tech: string) -> technology StdLib.Data.Technology
Looks up and wraps a technology by name.
techstringTechnology prototype name
technologyStdLib.Data.Technology
function Technology.add_effect(effect: table | boolean | string | number, effect_type: nil | string) -> self
Adds an effect to a technology.
effecttable | boolean | string | numberEffect target, modifier value, or complete effect definition
effect_typenil | stringTechnology effect type; defaults to
"unlock-recipe"
- self
function Technology.remove_effect(tech_name: nil | string, unlock_type: nil | string, name: nil | string) -> (self, name nil | string, unlock_type nil | string)
Removes an effect from a technology or removes a recipe unlock.
tech_namenil | stringTechnology prototype name
unlock_typenil | stringTechnology effect type
namenil | stringEffect target name
- self
namenil | stringunlock_typenil | string
function Technology.has_pack(pack: string) -> (has_pack boolean, index nil | integer)
Checks whether this technology contains a science pack.
packstringScience-pack item name
has_packbooleanindexnil | integer
function Technology.add_pack(new_pack: table | string, count: nil | number) -> self
Adds a science pack to this technology's research ingredients.
new_packtable | stringScience-pack name or
{name, count}paircountnil | numberIngredient count; defaults to
1
- self
function Technology.remove_pack(pack: string) -> self
Removes a science pack from this technology's research ingredients.
packstringScience-pack item name
- self
function Technology.replace_pack(old_pack: string, new_pack: string, count: nil | number) -> self
Replaces a science pack in this technology's research ingredients.
old_packstringExisting science-pack item name
new_packstringReplacement science-pack item name
countnil | numberReplacement ingredient count
- self
function Technology.set_pack_count(pack: string, count: number) -> self
Sets the amount of an existing science pack.
packstringScience-pack item name
countnumberNew ingredient count
- self
function Technology.set_pack_amount(pack: string, count: number) -> self
packstringScience-pack item name
countnumberNew ingredient count
- self
function Technology.add_prereq(tech_name: string) -> self
Adds a prerequisite technology.
tech_namestringPrerequisite technology name
- self
function Technology.remove_prereq(tech_name: string) -> self
Removes a prerequisite technology.
tech_namestringPrerequisite technology name
- self
function Technology.replace_prereq(old_tech: string, new_tech: string) -> self
Replaces one prerequisite technology with another.
old_techstringExisting prerequisite technology name
new_techstringReplacement prerequisite technology name
- self
function Technology.copy_cost(tech_name: string) -> result self | false
Copies research-unit properties from another technology.
tech_namestringSource technology name
resultself | false
function Technology.multiply_cost(mult: number) -> result self | false
Multiplies this technology's research-unit count.
multnumberCost multiplier
resultself | false
function Technology.add_unlock(recipe: string) -> nil
Adds a recipe-unlock effect to this technology.
recipestringRecipe prototype name
- nil
function Technology.get_recipes() -> recipes {string, true} | nil
Returns the recipes unlocked by this technology.
function Technology.remove_unlock(recipe: string) -> nil
Removes a recipe-unlock effect from this technology.
recipestringRecipe prototype name
- nil
Fields5
Technology.effects : table[] | nil
Technology effects
Technology.prerequisites : string[] | nil
Prerequisite technology names
Technology.unit : nil | table
Technology research-unit properties
Technology.__class: string = "Technology"
Technology.__index : unknown