Skip to content
RecursiveVision edited this page Aug 19, 2021 · 8 revisions

A

Return Method (arguments) Description
bool AnyoneHasAnyNaturalWonder()
bool AnyoneHasAnyReligion() Has anyone founded a religion?
bool AnyoneHasAnyWonder()
bool AnyoneHasBelief(BeliefType iBeliefType) Does anyone's majority religion contain the specified belief?
bool AnyoneHasBuilding(BuildingType iBuildingType)
bool AnyoneHasBuildingClass(BuildingClassType iBuildingClassType)
bool AnyoneHasIdeology(PolicyBranchType iPolicyBranchType) Contrary to the name, can be used to check for any policy branch.
bool AnyoneHasNaturalWonder(FeatureType iFeatureType) Contrary to the name, can also be used to check for regular features.
bool AnyoneHasPantheon()
bool AnyoneHasPolicy(PolicyType iPolicyType)
bool AnyoneHasPolicyBranch(PolicyBranchType iPolicyBranchType)
bool AnyoneHasProject(ProjectType iProjectType)
bool AnyoneHasReachedEra(EraType iEraType)
bool AnyoneHasReligion(ReligionType iReligionType) Is the specified religion anyone's current religion?
bool AnyoneHasTech(TechType iTechType)
bool AnyoneHasTenet(PolicyType iPolicyType) Contrary to the name, can be used to check for any policy.
bool AnyoneHasUnit(UnitType iUnitType)
bool AnyoneHasUnitClass(UnitClassType iUnitClassType)
bool AnyoneHasWonder(BuildingType iBuildingType) Contrary to the name, can be used to check for regular buildings.
bool AnyoneIsInEra(EraType iEraType)

B

Return Method (arguments) Description
bool BeliefIsInReligion(ReligionType iReligion, BeliefType iBelief) Does the specified belief belong to the specified religion?

C

Return Method (arguments) Description
bool CanFoundCorporation(PlayerID iPlayer, CorporationType iCorporation) Can the player found the specified corporation? Checks if the player is alive, the player is a civilization, the corporation type is valid, and the corporation has not already been founded.
int CreateGreatWork(GreatWorkType iGreatWorkType, PlayerID iOwningPlayer, EraType iEra, string sCreator For iGreatWorkType, refer to the database table GreatWorks. Returns the index of the new great work.

D

Return Method (arguments) Description
void DeleteCSV(string sFilename) Deletes the specified CSV log file.
void DoMinorMarriage(PlayerID iMajor, PlayerID iMinor) Perform a diplomatic marriage (no longer loses influence per turn, bonus to great person rate at capital) between the civilization and the city state if valid. Game will attempt to subtract the marriage cost from the civilization.
void DoSpawnFreeCity(City pCity) Attempts to spawn a new city state from the city.
void DoUpdateContracts() Method for JFDLC. Refreshes all unactivated contracts.

E

Return Method (arguments) Description
void EnhancePantheon(PlayerID iPlayer, BeliefType iBelief) Adds a belief to the specified player's pantheon. If the player has already founded a religion, adds the belief to the religion instead.
void ExitLeaderScreen()

F

Return Method (arguments) Description
void FoundCorporation(PlayerID iPlayer, CorporationType iCorporation, City pCity) Founds the specific corporation for the player, with the specified city as the headquarters. The city must be owned by the player, the player must be a civilization, and the corporation must not already be founded.

G

Return Method (arguments) Description
table GetActiveContractUnitList() Method for JFDLC. Lua table column names are 'Contract', 'Unit', 'NumUnits'.
int GetBuildingCorporateGPChange(BuildingType iBuilding) How much great person rate per corporate franchise does the building grant?
PlayerID GetCivilizationPlayer(CivilizationType iCivilizationType) Returns the player ID of the first player which is playing the specified civilization.
int GetContractUnits(ContractType iContract, UnitType iUnit) Method for JFDLC.
PlayerID GetCorporationFounder(CorporationType iCorporation) Which player founded the specified corporation?
City GetCorporationHeadquarters(CorporationType iCorporation) Which city is the corporation headquarters located at?
int GetCustomModOption(string sOption) Returns the Value column for the specific option in CustomModOptions.
string GetDateString(int iTurn) Returns a string of the current in-game date for specified turn.
int GetDefenseHappinessChangeBuilding(BuildingType iBuilding) Returns the local happiness change due to defense needs for the building.
int GetDefenseHappinessChangeBuildingGlobal(BuildingType iBuilding) Returns the global happiness change due to defense needs for the building.
string GetDllGuid()
int GetFoundYear(ReligionType iReligion) Returns the year the religion was founded.
int GetGreatestPlayerResourceMonopoly(ResourceType iResource) Returns the player with the greatest number of copies of a resource type.
int GetIlliteracyHappinessChangeBuilding(BuildingType iBuilding) Returns the local happiness change due to science needs for the building.
int GetIlliteracyHappinessChangeBuildingGlobal(BuildingType iBuilding) Returns the global happiness change due to science needs for the building.
table GetInactiveContractUnitList() Method for JFDLC. Lua table column names are 'Contract', 'Unit', 'NumUnits'.
int GetMaximumVassalTax() The maximum percent a master can tax a vassal.
int GetMinimumVassalLiberateTurns() The minimum number of turns before a master can liberate a vassal, adjusted by game speed.
int GetMinimumVassalTax() The minimum percent a master can tax a vassal.
int GetMinimumVassalTaxTurns() The minimum number of turns a master must tax a vassal before removing it, adjusted by game speed.
int GetMinimumVassalTurns() The minimum number of turns a player must remain a vassal, adjusted by the game speed.
int GetMinimumVoluntaryVassalTurns() The minimum number of turns a player must remain a voluntary vassal, adjusted by game speed.
int GetMinorityHappinessChangeBuilding(BuildingType iBuilding) Returns the local happiness change due to religious conflict for the building.
int GetMinorityHappinessChangeBuildingGlobal(BuildingType iBuilding) Returns the global happiness change due to religious conflict for the building.
int GetNumActiveContracts() Method for JFDLC.
int GetNumAvailableContracts() Method for JFDLC.
int GetNumAvailableCorporations() How many corporations can still be founded?
int GetNumCorporationsFounded() How many corporations have been founded?
int GetNumInactiveContracts() Method for JFDLC.
int GetNumResourceTotalRequiredForUnit(UnitType iUnitType, ResourceType iResource) What is the gross number of resources required for the unit type? Based on the database table Unit_ResourceQuantityTotals.
int GetNumTurnsBetweenVassals() Number of turns before a player can become a vassal again after dissolving the previous vassalage. Related to the game speed.
int GetNumUnavailableContracts() Method for JFDLC.
int GetPovertyHappinessChangeBuilding(BuildingType iBuilding) Returns the local happiness change due to gold needs for the building.
int GetPovertyHappinessChangeBuildingGlobal(BuildingType iBuilding) Returns the global happiness change due to gold needs for the building.
int GetPromiseDuration() Returns the diplomatic promise duration. Based on the define EXPANSION_PROMISE_TURNS_EFFECTIVE and the game speed.
int GetSteamStat(int iSteamStat) Returns stats related to Steam achievements.
string GetTimeStringForYear(int iTurn) Returns a string of the current in-game date for specified turn.
table GetTradeRoute(int iRouteIndex) Returns a table of values related to the specified trade route index. Columns are: TradeConnectionType, Domain, FromCivilizationType, FromID, FromCityName, FromCity, ToCivilizationType, ToID, ToCityName, ToCity, FromGPT, ToGPT, ToFood, ToProduction, FromScience, ToScience, ToReligion, ToPressure, FromReligion, FromPressure, FromTourism, ToTourism, TurnsLeft, UnitID, IsRecalled, CircuitsCompleted, CircuitsToComplete, MovingForward.
void GetUnculturedHappinessChangeBuilding(BuildingType iBuilding) Returns the local happiness change due to culture needs for the building.
void GetUnculturedHappinessChangeBuildingGlobal(BuildingType iBuilding) Returns the global happiness change due to culture needs for the building.
EraType GetVassalageEnabledEra() The era the must be in before unlocking vassalage.

H

Return Method (arguments) Description
void AddReformation(PlayerID iPlayer, ReligionType iReligion, BeliefType iBelief) Reforms a player's religion with a specific belief. Must not have already reformed the religion.

I

Return Method (arguments) Description
bool IsAchievementUnlocked(int iAchievement) Has the specified Steam achievement been unlocked?
bool IsContractActive(ContractType iContract) Method for JFDLC.
bool IsContractAvailable(ContractType iContract) Method for JFDLC.
bool IsCorporationFounded(CorporationType iCorporation) Has the corporation been founded already?
bool IsCustomModOption(string sOption) Is specific option in the database table CustomModOptions activated (Value = 1)?
bool IsHideOpinionTable() Is DIPLOAI_HIDE_OPINION_TABLE enabled (Value = 1) in DiploAIOptions.sql?
bool IsHost() Is the machine this game is running on the host?
bool IsInSomeReligion(opt BeliefType iBelief = -1, opt PlayerID iPlayer = -1) Has some religion already claimed this belief?
bool IsPitbossHost() Is the machine this game is running on the pitboss host?
bool IsResolutionPassed(ResolutionType iResolutionType, int iChoice)
bool IsWorldWonderClass(BuildingClassType) Checks if a building class has a MaxGlobalInstances defined.

R

Return Method (arguments) Description
void ReloadGameDataDefines() Causes the game to read from the database table GameDefines again.
void ReloadCustomModOptions() Causes the game to read from the database table CustomModOptions again.

S

Return Method (arguments) Description
void SetContractUnits(ContractType iContract, UnitType iUnit, int iNum) Method for JFDLC.
void SetFoundYear(ReligionType iReligion, int iFoundYear) Sets the year the religion was founded.

W

Return Method (arguments) Description
void WriteCSV(string sFilename, string sLine) Writes a new line in the specified CSV log file.