[*Back to Index*](index.md.html)
Technology
===============
This mod item allows you to define a new technology that can be researched to affect the game. [Here](LuaFunctionDoc_Gameplay.md.html) can be found some useful functions for creating gameplay effects. Information about existing technologies can be found [here](LuaFunctionDoc_TechnologyNames.md.html).
Properties
----------
Name (self.name)
: This is the internal unique name of Technology Mod item. It is not visible by users.
Display Name (self.display_name)
: This is the user-visible name of technology.
ID (self.id)
: Internal game id for that technology, used in various functions that work over it.
Icon (self.icon)
: File path to technology image that is used in the research dialogue.
Required DLC (self.dlc)
: The DLC that is required to be installed if any. Leave blank if no DLC dependence is needed.
Description (self.description)
: Short, user-visible description of that technology and its effects.
Unlock position (self.position)
: Range for position in tech tree for technology field.
Research repeatable (self.repeatable)
: Can be researched multiple times.
Research Cost (self.cost)
: Research points cost for that technology. Depends on the technology field costs table and the position in the tech tree.
Tech Field (self.field)
: Technology field in research dialogue.
From Mystery (self.mystery)
: Add to tech tree only in games that the mystery is self.mystery. Leave blank if no mystery dependence is needed.
OnGameInit (function self:OnGameInit(city))
: Code that is executed at game start. Use for initialization of technology effects.
OnResearchComplete (function self:OnResearchComplete(city))
: Code that is executed just after the research of that technology is completed. Here is an appropriate place for technology effects implementation.
~~~~
OnGameInit = function (self, city)
LockCrop("Algae", self.id)
end,
OnResearchComplete = function (self, city)
UnlockCrop("Algae", self.id)
end
~~~~
Parameters (self.param1, self.param2, self.param3, self.param4, self.param5)
: Properties that contain number values. Can be used in OnResearch and OnGameInit functions.
Parameters comment (self.param1comment, self.param2comment, self.param3comment, self.param4comment, self.param5comment)
: Add any comment for the property's value and its usage.
Functions
----------
IsTechResearched(tech_id)
: Check if technology is researched.
IsTechDiscovered(tech_id)
: Check if technology is discovered.
IsTechRepeatable(tech_id)
: Check if technology can be researched multiple times.
Globals
----------
TechDef
: List of all technologies by name.
TechTree
: Array of all tech fields. Each tech field objects array part is a list of all techs in that field.
(insert footer.md.html here)