Global Functions (Civ5)
This page is a part of the Lua and UI Reference (Civ5).
Built-in functions
FLuaVector.lua
Those functions are declared in FLuaVector.lua. Use: include("FLuaVector")
Gods & Kings | |||||
Vector4
|
Color(float r, float g, float b, float a)
| ||||
unknown
|
VecAdd(unknown v1, unknown v2)
| ||||
unknown
|
VecSubtract(unknown v1, unknown v2)
| ||||
Vector2
|
Vector2(float i, float j)
| ||||
Vector3
|
Vector3(float i, float j, float k)
| ||||
Vector4
|
Vector4(float i, float j = nil, float k = nil, float l = nil)
|
GameCalendarUtilities.lua
Those functions are declared in GameCalendarUtilities.lua. Use: include("GameCalendarUtilities")
Gods & Kings | |||||
string
|
GetDateString(int gameTurn, unknown calendarType, unknown gameSpeedType, int startYear)
| ||||
string
|
GetDefaultYearString(int year)
| ||||
string
|
GetShortDateString(int gameTurn, unknown calendarType, unknown gameSpeedType, int startYear)
|
IconSupport.lua
Those functions are declared in IconSupport.lua. Use: include("IconSupport")
Gods & Kings | |||||
|
CivIconHookup(PlayerID player, int iconSize, Image iconControl, Image teamColorControl, int shadowIconControl, int alwaysUseComposite, int shadowed)
| ||||
bool
|
IconHookup(int offset, float iconSize, string atlas, Image imageControl, unknown debugPrint = nil)
| ||||
Vector2, string
|
IconLookup(int offset, int iconSize, string atlas)
| ||||
|
PopulateIconAtlases()
| ||||
bool
|
SimpleCivIconHookup(PlayerID player, int iconSize, Image iconControl)
|
InfoTooltipInclude.lua
Those functions are declared in InfoTooltipInclude.lua. Use: include("InfoTooltipInclude")
Gods & Kings | |||||
string
|
GetCityStateStatus(Player player, PlayerID forPlayer, int war)
| ||||
string
|
GetCultureTooltip(City city)
| ||||
string
|
GetFaithTooltip(City city)
| ||||
string
|
GetFoodTooltip(City city)
| ||||
string
|
GetGoldTooltip(City city)
| ||||
string
|
GetHelpTextForBuilding(BuildingType building, bool excludeName, bool excludeHeader, bool noMaintenance)
| ||||
string
|
GetHelpTextForImprovement(ImprovementType improvement, bool excludeName, bool excludeHeader, bool noMaintenance)
| ||||
string
|
GetHelpTextForProject(ProjectType project, bool includeRequirementsInfo)
| ||||
string
|
GetHelpTextForUnit(UnitType unit, bool includeRequirementsInfo)
| ||||
string
|
GetMoodInfo(PlayerID otherPlayer)
| ||||
string
|
GetProductionTooltip(City city)
| ||||
string
|
GetReligionTooltip(City city)
| ||||
string
|
GetScienceTooltip(City city)
| ||||
string
|
GetYieldTooltip(City city, YieldType yieldType, int base, int total, string iconString, string modifiersString)
| ||||
string
|
GetYieldTooltipHelper(City city, YieldType yieldType, string icon)
|
MapGenerator.lua
Those functions are declared in MapGenerator.lua. Use: include("MapGenerator")
Gods & Kings | |||||
|
AddFeatures()
| ||||
bool
|
AddGoodies()
| ||||
|
AddLakes()
| ||||
bool
|
AddRivers()
| ||||
bool
|
CanPlaceGoodyAt(ImprovementType improvement, Plot plot)
| ||||
|
DetermineContinents()
| ||||
|
DoRiver(Plot startPlot, FlowDirectionType thisFlowDirection = nil, FlowDirectionType originalFlowDirection = nil, int riverID = nil)
| ||||
|
GenerateCoasts(int args = nil)
| ||||
|
GenerateMap()
| ||||
|
GeneratePlotTypes()
| ||||
|
GenerateTerrain()
| ||||
...
|
GetCoreMapOptions()
| ||||
FlowDirectionType
|
GetOppositeFlowDirection(FlowDirectionType dir)
| ||||
int
|
GetRiverValueAtPlot(Plot plot)
| ||||
iterator()
|
Plots((void func(table(int => int) t)) sort = nil)
| ||||
|
SetPlotTypes(table(int => PlotType) plotTypes)
| ||||
|
SetTerrainTypes(table(int => TerrainType) terrainTypes)
| ||||
|
func(table(int => int) t)
| ||||
|
StartPlotSystem()
|
MapmakerUtilities.lua
Those functions are declared in MapmakerUtilities.lua. Use: include("MapmakerUtilities")
Gods & Kings | |||||
int
|
AdjacentToSaltWater(int x, int y)
| ||||
bool
|
CivNeedsCoastalStart(string civType)
| ||||
bool
|
CivNeedsRiverStart(string civType)
| ||||
table(int => bool)
|
GenerateCoastalLandDataTable()
| ||||
table(int => bool), table(int => int)
|
GenerateNextToCoastalLandDataTables()
| ||||
int
|
GetNumStartRegionAvoidForCiv(string civType)
| ||||
int
|
GetNumStartRegionPriorityForCiv(string civType)
| ||||
int, int, table(int => PlayerID), bool, table(int => int), table
|
GetPlayerAndTeamInfo()
| ||||
table(int => PlayerID)
|
GetShuffledCopyOfTable(table(int => int) incoming_table)
| ||||
table(int => int)
|
GetStartRegionAvoidListForCiv_GetIDs(string civType)
| ||||
|
GetStartRegionAvoidListForCiv_GetTypes(unknown civType)
| ||||
table(int => int)
|
GetStartRegionPriorityListForCiv_GetIDs(string civType)
| ||||
|
GetStartRegionPriorityListForCiv_GetTypes(unknown civType)
| ||||
bool, int, table(int => int)
|
IdentifyTableIndex(table(int => PlayerID) incoming_table, PlayerID value)
| ||||
table(int => int)
|
ObtainLandmassBoundaries(AreaID areaID)
| ||||
|
PrintContentsOfTable(table(int => int) incoming_table)
| ||||
int
|
TestMembership(table(int => PlayerID) table, PlayerID value)
|
PlotMouseoverInclude.lua
Those functions are declared in PlotMouseoverInclude.lua. Use: include("PlotMouseoverInclude")
Gods & Kings | |||||
string
|
GetCivStateQuestString(Plot plot, bool shortVersion)
| ||||
string
|
GetImprovementString(Plot plot)
| ||||
string
|
GetNatureString(Plot plot)
| ||||
string
|
GetOwnerString(Plot plot)
| ||||
string
|
GetResourceString(Plot plot, bool longForm)
| ||||
string
|
GetUnitsString(Plot plot)
| ||||
string
|
GetYieldString(Plot plot)
| ||||
bool
|
IsFeatureSpecial(FeatureType feature)
|
SupportFunctions.lua
Those functions are declared in SupportFunctions.lua. Use: include("SupportFunctions")
Gods & Kings | |||||
|
TruncateString(Label control, int resultSize, string longStr, string trailingText = nil)
|
The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.