Global Functions (Civ5): Difference between revisions
(Bot update) |
(Bot update) |
||
Line 8: | Line 8: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
ADDRESOURCETYPE | ADDRESOURCETYPE | ||
Line 282: | Line 282: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
COLOR | COLOR | ||
Line 332: | Line 332: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
GETDATESTRING | GETDATESTRING | ||
Line 361: | Line 361: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
CIVICONHOOKUP | CIVICONHOOKUP | ||
Line 404: | Line 404: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
GETCITYSTATESTATUS | GETCITYSTATESTATUS | ||
Line 517: | Line 517: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
ADDFEATURES | ADDFEATURES | ||
Line 658: | Line 658: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
ADJACENTTOSALTWATER | ADJACENTTOSALTWATER | ||
Line 785: | Line 785: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
GETCIVSTATEQUESTSTRING | GETCIVSTATEQUESTSTRING | ||
Line 849: | Line 849: | ||
{|cellspacing="4" cellpadding="0" width="100%" | {|cellspacing="4" cellpadding="0" width="100%" | ||
|- | |- | ||
| [[File: | | [[File:Civ5-16.png|Base game]] || [[File:GK.png|Gods & Kings]] || || || <code style="visibility:hidden;">___________________________</code> | ||
<!-- | <!-- | ||
TRUNCATESTRING | TRUNCATESTRING |
Latest revision as of 15:10, 19 September 2012
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")
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")
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")
|
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")
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")
|
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")
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")
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")
|
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.