Lua Game Objects/Player: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 2: Line 2:




==Methods==
List on the official wiki: http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/Player (parameters are listed for many methods).
*[[AcquireCity]]
 
*[[AddCityName]]
 
*[[AddFreeUnit]]
==Player Info==
*[[AddNotification]]
===Self===
*[[AI_foundValue]]
*[[GetCivilizationType]]() - returns a civilization type value for a major civ player.
*[[AI_updateFoundValues]]
*[[GetID]]
*[[CalculateGoldRate]]
*[[GetLeaderType]]
*[[CalculateGoldRateTimes100]]
*[[GetPersonality]]
*[[CalculateGrossGold]]
*[[GetPersonalityType]]
*[[CalculateGrossGoldTimes100]]
*[[GetQueuePosition]]
*[[CalculateInflatedCosts]]
*[[GetTeam]]
*[[CalculateResearchModifier]]
*[[IsAlive]]
*[[CalculateTotalYield]]
*[[IsBarbarian]]
*[[CalculateUnitCost]]
*[[IsEverAlive]]
*[[CalculateUnitSupply]]
*[[IsHuman]]
*[[CanAdoptPolicy]]
*[[IsMinorCiv]]() - returns true if this is a ciy-state.
*[[CanBuild]]
*[[IsPlayable]]
*[[CanConstruct]]
*[[SetPersonalityType]]
*[[SetPlayable]]
===Misc===
*[[GetCurrentEra]]
*[[GetTotalTimePlayed]]
*[[GetWorkerSpeedModifier]]
*[[IsFoundedFirstCity]]
*[[IsHasLostCapital]]
===Yields===
*[[CalculateTotalYield]](eYield)
*[[GetExtraYieldThreshold]](YieldTypes eIndex)
*[[GetSpecialistExtraYield]]
*[[GetYieldRateModifier]](YieldTypes eIndex)
*[[SpecialistYield]](eSpecialist, eYield)
===Combat Experience===
*[[ChangeCombatExperience]]
*[[GetCombatExperience]]
*[[SetCombatExperience]](int iExperience)
===Score===
*[[GetLandScore]]
*[[GetPopScore]]
*[[GetScore]]
*[[GetScoreFromCities]]
*[[GetScoreFromFutureTech]]
*[[GetScoreFromLand]]
*[[GetScoreFromPopulation]]
*[[GetScoreFromTechs]]
*[[GetScoreFromWonders]]
*[[GetScoreHistory]]
*[[GetTechScore]]
*[[GetTotalLandScored]]
*[[GetWondersScore]]
===Demographics===
*[[GetEconomyHistory]]
*[[GetIndustryHistory]]
*[[GetMilitaryMight]]
*[[GetPower]]
*[[GetPowerHistory]]
*[[GetTotalLand]]
===Script Data===
*[[GetScriptData]]
*[[SetScriptData]]
 
==Other Players / Diplomacy==
===City States===
*[[ChangeJONSCulturePerTurnFromMinorCivs]]
*[[ChangeMinorCivFriendshipWithMajor]]
*[[DoMinorLiberationByMajor]]
*[[GetAlly]]
*[[GetCurrentSpawnEstimate]] - military units spawning.
*[[GetFriendshipChangePerTurnTimes100]]
*[[GetFriendshipFromGoldGift]]
*[[GetFriendshipNeededForNextLevel]]
*[[GetHappinessFromMinor]]
*[[GetMinorCivCultureFriendshipBonus]]
*[[GetMinorCivFavoriteMajor]]
*[[GetMinorCivFriendshipLevelWithMajor]]
*[[GetMinorCivFriendshipWithMajor]]
*[[GetMinorCivHappinessFriendshipBonus]]
*[[GetMinorCivScienceFriendshipBonus]]
*[[GetMinorCivTrait]]
*[[GetMinorCivType]]() - returns a civilization type value for a city-state civ player.
*[[GetMinorWarQuestWithMajorRemainingCount]]
*[[GetNumMinorCivsMet]]
*[[GetOtherPlayerNumProtectedMinorsKilled]]
*[[GetQuestData1]]
*[[GetQuestData2]]
*[[GetResourceFromMinors]]
*[[IsAllies]]
*[[IsFriends]]
*[[IsMinorCiv]]() - returns true if this is a city-state.
*[[IsMinorCivRouteEstablishedWithMajor]]
*[[IsMinorCivUnitSpawningDisabled]]
*[[IsMinorPermanentWar]]
*[[IsMinorWarQuestWithMajorActive]]
*[[IsPlayerBrokenCityStatePromise]]
*[[IsPlayerIgnoredCityStatePromise]]
*[[IsProtectingMinor]]
===Dispute level===
*[[GetLandDisputeLevel]]
*[[GetMinorCivDisputeLevel]]
*[[GetVictoryDisputeLevel]]
*[[GetWonderDisputeLevel]]
===Get===
*[[CanContact]]
*[[CanContact]]
*[[CanCreate]]
*[[CanEverResearch]]
*[[CanFound]]
*[[CanMaintain]]
*[[CanPrepare]]
*[[CanRaze]]
*[[CanReceiveGoody]]
*[[CanResearch]]
*[[CanStopTradingWithTeam]]
*[[CanStopTradingWithTeam]]
*[[CanTradeWith]]
*[[CanTradeWith]]
*[[CanTrain]]
*[[GetApproachTowardsUsGuess]](PlayerTypes ePlayer)
*[[CanUnlockPolicyBranch]]
*[[GetCoopWarAcceptedState]]
*[[ChangeAdvancedStartPoints]]
*[[GetNumCiviliansReturned]]
*[[ChangeAlwaysSeeBarbCampsCount]]
*[[GetProximityToPlayer]]
*[[ChangeAnarchyNumTurns]]
*[[GetVotes]]
*[[ChangeBarbarianCombatBonus]]
*[[GetWarmongerThreat]]
*[[ChangeBaseBuildingGoldMaintenance]]
*[[GetWorstEnemyName]]
*[[ChangeCombatExperience]]
*[[IsDemandEverMade]]
*[[ChangeConscriptCount]]
*[[IsDenouncedPlayer]]
*[[ChangeExtraHappinessPerCity]]
*[[IsDontSettleMessageTooSoon]]
*[[ChangeGold]]
*[[IsPeaceBlocked]]
*[[ChangeGoldenAgeProgressMeter]]
*[[IsPlayerBrokenBorderPromise]]
*[[ChangeGoldenAgeTurns]]
*[[IsPlayerBrokenCityStatePromise]]
*[[ChangeGoldPerUnitTimes100]]
*[[IsPlayerBrokenCoopWarPromise]]
*[[ChangeHappinessFromBuildings]]
*[[IsPlayerBrokenExpansionPromise]]
*[[ChangeHappinessFromGarrisonedUnits]]
*[[IsPlayerBrokenMilitaryPromise]]
*[[ChangeHappinessPerGarrisonedUnit]]
*[[IsPlayerHasOpenBorders]]
*[[ChangeHappinessPerTradeRoute]]
*[[IsPlayerHasOpenBordersAutomatically]]
*[[ChangeJONSCulture]]
*[[IsPlayerIgnoredBorderPromise]]
*[[ChangeJONSCulturePerTurnForFree]]
*[[IsPlayerIgnoredCityStatePromise]]
*[[ChangeJONSCulturePerTurnFromMinorCivs]]
*[[IsPlayerIgnoredExpansionPromise]]
*[[ChangeMinorCivFriendshipWithMajor]]
*[[IsPlayerIgnoredMilitaryPromise]]
*[[ChangeNumFreePolicies]]
*[[IsPlayerNoSettleRequestEverAsked]]
*[[ChangeNumGoldenAges]]
*[[IsPlayerRecklessExpander]]
*[[ChangeNumPlotsBought]]
*[[IsWhiteFlag]]
*[[ChangeNumResourceTotal]]
*[[IsWillAcceptPeaceWithPlayer]]
*[[ChangeNumUnitGoldenAges]]
*[[IsWorkingAgainstPlayerAccepted]]
*[[ChangeUnhappinessFromUnits]]
*[[IsWorkingWithPlayer]]
*[[ChooseTech]]
*[[IsWorkingWithPlayerMessageTooSoon]]
*[[Cities]]
===Set===
*[[ClearResearchQueue]]
*[[Contact]]
*[[Contact]]
*[[CountCityFeatures]]
*[[CountNumBuildings]]
*[[CreateGreatGeneral]]
*[[Disband]]
*[[DisbandUnit]]
*[[DoAdoptPolicy]]
*[[DoBeginDiploWithHuman]]
*[[DoBeginDiploWithHuman]]
*[[DoForceDenounce]]
*[[DoForceDenounce]]
*[[DoForceDoF]]
*[[DoForceDoF]]
*[[DoGoody]]
*[[DoGreatPersonChoice]]
*[[DoMinorLiberationByMajor]]
*[[DoTradeScreenClosed]]
*[[DoTradeScreenClosed]]
*[[DoTradeScreenOpened]]
*[[DoTradeScreenOpened]]
*[[DoUpdateProximityToPlayer]]
*[[ForcePeace]](int iPlayer)
*[[FindNewCapital]]
*[[StopTradingWithTeam]]
*[[FindPathLength]]
 
*[[ForcePeace]]
==Units==
*[[Found]]
*[[CanTrain]](eUnit, boolean bContinue, boolean bTestVisible)
*[[GetActiveQuestForPlayer]]
===Experience===
*[[GetAdvancedStartBuildingCost]]
*[[GetExpInBorderModifier]]
*[[GetAdvancedStartCityCost]]
*[[GetFreeExperience]]
*[[GetAdvancedStartImprovementCost]]
*[[GetHighestUnitLevel]]
*[[GetAdvancedStartPoints]]
===Cost/Supply===
*[[GetAdvancedStartPopCost]]
*[[CalculateUnitCost]]
*[[GetAdvancedStartRouteCost]]
*[[CalculateUnitSupply]]
*[[GetAdvancedStartTechCost]]
*[[GetExtraUnitCost]]
*[[GetAdvancedStartUnitCost]]
*[[GetNumMaintenanceFreeUnits]]
*[[GetAdvancedStartVisibilityCost]]
*[[GetNumUnitsOutOfSupply]]
*[[GetAgricultureHistory]]
*[[GetNumUnitsSupplied]]
*[[GetAlly]]
*[[GetNumUnitsSuppliedByCities]]
*[[GetAnarchyNumTurns]]
*[[GetNumUnitsSuppliedByHandicap]]
*[[GetAnyUnitHasOrderToGoody]]
*[[GetNumUnitsSuppliedByPopulation]]
*[[GetApproachTowardsUsGuess]]
*[[GetUnitProductionMaintenanceMod]]
*[[GetArtStyleType]]
===Combat===
*[[GetAttackBonusTurns]]
*[[GetAttackBonusTurns]]
*[[GetAveragePopulation]]
*[[GetBarbarianCombatBonus]]
*[[GetBarbarianCombatBonus]]
*[[GetBestRoute]]
*[[GetTraitCityStateCombatModifier]]
*[[GetBranchPicked1]]
*[[GetTraitGoldenAgeCombatModifier]]
*[[GetBranchPicked2]]
*[[SetBarbarianCombatBonus]]
*[[GetBranchPicked3]]
===Numbers===
*[[GetBuildingClassCount]]
*[[GetNumMilitaryUnits]]
*[[GetBuildingClassCountPlusMaking]]
*[[GetNumNukeUnits]]
*[[GetBuildingClassMaking]]
*[[GetNumOutsideUnits]]
*[[GetBuildingClassPrereqBuilding]]
*[[GetNumUnitGoldenAges]]
*[[GetBuildingGoldMaintenance]]
*[[GetNumUnits]]
*[[GetBuildingProductionNeeded]]
*[[GetUnitClassCount]]
*[[GetBuyPlotCost]]
*[[GetUnitClassCountPlusMaking]]
*[[GetUnitClassMaking]]
*[[UnitsGoldenAgeCapable]]
*[[UnitsGoldenAgeReady]]
===Get===
*[[GetFirstReadyUnit]]
*[[GetFirstReadyUnitPlot]]
*[[GetUnitByID]]
*[[GetUnitProductionNeeded]](iUnitTypeUpgrade)
*[[HasBusyMovingUnit]]
*[[HasBusyUnit]]
*[[HasReadyUnit]]
*[[IsProductionMaxedUnitClass]]
*[[IsUnitClassMaxedOut]]
*[[Units]]
*[[UnitsRequiredForGoldenAge]]
===Set===
*[[AddFreeUnit]]
*[[ChangeNumUnitGoldenAges]]
*[[DisbandUnit]]
*[[InitUnit]]
*[[KillUnits]]
 
==Cities==
*[[CanMaintain]](eProcess, boolean bContinue)
*[[CanPrepare]](eSpecialist, boolean bContinue)
===Get===
*[[CanFound]](int iX, int iY)
*[[CanRaze]](pCity)
*[[Cities]]
*[[CountCityFeatures]]
*[[GetCapitalCity]]
*[[GetCapitalCity]]
*[[GetCapitalUnhappinessMod]]
*[[GetCapitalYieldRateModifier]](YieldTypes eIndex)
*[[GetCapitalYieldRateModifier]]
*[[GetCitiesLost]]
*[[GetCitiesLost]]
*[[GetCityByID]]
*[[GetCityByID]]
Line 123: Line 216:
*[[GetCityDefenseModifier]]
*[[GetCityDefenseModifier]]
*[[GetCityName]]
*[[GetCityName]]
*[[GetCivilizationAdjective]]
*[[GetCivilizationAdjectiveKey]]
*[[GetCivilizationDescription]]
*[[GetCivilizationDescriptionKey]]
*[[GetCivilizationShortDescription]]
*[[GetCivilizationShortDescriptionKey]]
*[[GetCivilizationType]]
*[[GetClosestGoodyPlot]]
*[[GetCombatExperience]]
*[[GetConscriptCount]]
*[[GetConversionTimer]]
*[[GetCoopWarAcceptedState]]
*[[GetCultureBombTimer]]
*[[GetCultureCityModifier]]
*[[GetCultureCityModifier]]
*[[GetCultureWonderMultiplier]]
*[[GetCurrentOtherCityFoodBonus]]
*[[GetNewCityName]]
*[[GetNextCity]]
*[[GetNumCities]]
*[[GetNumCityNames]]
*[[GetPrevCity]]
*[[IsCapitalConnectedToCity]]
===Set===
*[[AcquireCity]]
*[[AddCityName]]
*[[Disband]](pCity)
*[[FindNewCapital]]
*[[InitCity]]
*[[KillCities]]
*[[Raze]](pCity)
 
==Population==
*[[GetAveragePopulation]]
*[[GetRealPopulation]]
*[[GetTotalPopulation]]
 
==Buildings==
*[[CanBuild]]
*[[CanConstruct]](BuildingTypes eBuilding, boolean bContinue, boolean bTestVisible, boolean bIgnoreCost)
===Get===
*[[CountNumBuildings]](eBuilding)
*[[GetAdvancedStartBuildingCost]]
*[[GetBuildingClassCount]]
*[[GetBuildingClassCountPlusMaking]]
*[[GetBuildingClassMaking]]
*[[GetBuildingClassPrereqBuilding]]
*[[GetBuildingGoldMaintenance]]
*[[GetBuildingProductionNeeded]]
*[[GetEverTrainedBuilder]]
*[[GetHappinessFromBuildings]]
*[[GetMaxGlobalBuildingProductionModifier]]
*[[GetMaxPlayerBuildingProductionModifier]]
*[[GetMaxTeamBuildingProductionModifier]]
*[[GetNumWorldWonders]]
*[[IsBuildBlockedByFeature]](eBuild, FeatureTypes eFeature)
*[[IsBuildingClassMaxedOut]]
*[[IsBuildingFree]]
*[[IsProductionMaxedBuildingClass]]
===Set===
*[[ChangeBaseBuildingGoldMaintenance]]
*[[RemoveBuildingClass]]
*[[SetBaseBuildingGoldMaintenance]]
 
==Food==
*[[GetCurrentCapitalFoodBonus]]
*[[GetCurrentCapitalFoodBonus]]
*[[GetCurrentCultureBonus]]
*[[GetCurrentEra]]
*[[GetCurrentOtherCityFoodBonus]]
*[[GetCurrentOtherCityFoodBonus]]
*[[GetCurrentResearch]]
*[[IsMilitaryFoodProduction]]
*[[GetCurrentScienceFriendshipBonusTimes100]]
 
*[[GetCurrentSpawnEstimate]]
==Production==
*[[GetDomesticGreatGeneralRateModifier]]
*[[GetBuildingProductionNeeded]]
*[[GetDominantPolicyBranchForTitle]]
*[[GetEconomyHistory]]
*[[GetEndTurnBlockingNotificationIndex]]
*[[GetEndTurnBlockingType]]
*[[GetEverPoppedGoody]]
*[[GetEverTrainedBuilder]]
*[[GetExcessHappiness]]
*[[GetExpInBorderModifier]]
*[[GetExtraHappinessPerCity]]
*[[GetExtraHappinessPerLuxury]]
*[[GetExtraUnitCost]]
*[[GetExtraYieldThreshold]]
*[[GetFeatureProductionModifier]]
*[[GetFeatureProductionModifier]]
*[[GetFirstReadyUnit]]
*[[GetMaxGlobalBuildingProductionModifier]]
*[[GetFirstReadyUnitPlot]]
*[[GetMaxPlayerBuildingProductionModifier]]
*[[GetFreeExperience]]
*[[GetMaxTeamBuildingProductionModifier]]
*[[GetFriendshipChangePerTurnTimes100]]
*[[GetMilitaryProductionModifier]]
*[[GetFriendshipFromGoldGift]]
*[[GetProductionModifier]]
*[[GetFriendshipNeededForNextLevel]]
*[[GetProjectProductionNeeded]]
*[[GetSettlerProductionModifier]]
*[[GetSpaceProductionModifier]]
*[[GetUnitProductionMaintenanceMod]]
*[[GetUnitProductionNeeded]]
*[[GetWonderProductionModifier]]
*[[IsMilitaryFoodProduction]]
*[[IsProductionMaxedBuildingClass]]
*[[IsProductionMaxedProject]]
*[[IsProductionMaxedUnitClass]]
 
==Gold==
===Get===
*[[CalculateGoldRate]]
*[[CalculateGoldRateTimes100]]
*[[CalculateGrossGold]]
*[[CalculateGrossGoldTimes100]]
*[[GetBuildingGoldMaintenance]]
*[[GetCityConnectionGold]]
*[[GetCityConnectionGoldTimes100]]
*[[GetGold]]
*[[GetGold]]
*[[GetGoldenAgeLength]]
*[[GetGoldenAgeModifier]]
*[[GetGoldenAgeProgressMeter]]
*[[GetGoldenAgeProgressThreshold]]
*[[GetGoldenAgeTurns]]
*[[GetGoldFromCitiesTimes100]]
*[[GetGoldFromCitiesTimes100]]
*[[GetGoldPerMilitaryUnit]]
*[[GetGoldPerMilitaryUnit]]
*[[GetGoldPerTurnFromDiplomacy]]
*[[GetGoldPerTurnFromDiplomacy]]
*[[GetGoldPerUnit]]
*[[GetGoldPerUnit]]
*[[GetGreatGeneralRateModifier]]
*[[GetHurryGoldCost]]
*[[GetGreatGeneralsCreated]]
*[[GetImprovementGoldMaintenance]]
*[[GetGreatGeneralsThresholdModifier]]
*[[GetRouteGoldTimes100]]
*[[GetGreatPeopleCreated]]
===Set===
*[[GetGreatPeopleRateModifier]]
*[[ChangeBaseBuildingGoldMaintenance]]
*[[GetGreatPeopleThresholdModifier]]
*[[ChangeGold]]
*[[GetHandicapType]]
*[[ChangeGoldPerUnitTimes100]]
*[[SetBaseBuildingGoldMaintenance]]
*[[SetGold]]
 
==Science==
===Get===
*[[CalculateResearchModifier]]
*[[CanEverResearch]]
*[[CanResearch]]
*[[FindPathLength]](eTech, boolean bCost)
*[[GetCurrentResearch]]
*[[GetCurrentScienceFriendshipBonusTimes100]] - science from city states.
*[[GetLengthResearchQueue]]
*[[GetMinorCivScienceFriendshipBonus]]
*[[GetNumFreeTechs]]
*[[GetOverflowResearch]]
*[[GetResearchTurnsLeft]]
*[[GetScience]]
*[[GetScienceFromBudgetDeficitTimes100]]
*[[GetScienceFromCitiesTimes100]]
*[[GetScienceFromHappinessTimes100]]
*[[GetScienceFromOtherPlayersTimes100]]
*[[GetScienceFromResearchAgreementsTimes100]]
*[[GetScienceTimes100]]
*[[GetTraitGreatScientistRateModifier]]
*[[IsCurrentResearchRepeat]]
*[[IsNoResearchAvailable]]
*[[IsResearch]]
*[[IsResearchingTech]]
===Set===
*[[ChooseTech]]
*[[ClearResearchQueue]]
*[[PopResearch]]
*[[PushResearch]]
*[[SetNumFreeTechs]]
*[[SetResearchingTech]]
 
==Culture==
===Get===
*[[GetCultureBombTimer]]
*[[GetCultureCityModifier]]
*[[GetCultureWonderMultiplier]]
*[[GetCurrentCultureBonus]]
*[[GetJONSCulture]]
*[[GetJONSCulturePerTurnForFree]]
*[[GetJONSCulturePerTurnFromCities]]
*[[GetJONSCulturePerTurnFromExcessHappiness]]
*[[GetJONSCulturePerTurnFromMinorCivs]]
*[[GetMinorCivCultureFriendshipBonus]]
*[[GetNumTimesCultureBombed]]
*[[GetTotalJONSCulturePerTurn]]
===Set===
*[[ChangeJONSCulture]]
*[[ChangeJONSCulturePerTurnForFree]]
*[[ChangeJONSCulturePerTurnFromMinorCivs]]
*[[SetJONSCulture]]
 
==Policies==
===Get===
*[[CanAdoptPolicy]]
*[[CanUnlockPolicyBranch]]
*[[ChangeNumFreePolicies]]
*[[GetHappinessFromPolicies]]
*[[GetNextPolicyCost]]
*[[GetNumFreePolicies]]
*[[GetNumPolicies]]
*[[GetNumPolicyBranchesAllowed]]
*[[GetNumPolicyBranchesFinished]]
*[[GetNumPolicyBranchesUnlocked]]
*[[GetPolicyBranchChosen]]
*[[HasPolicy]](policyID) - returns true if a player has a specified policy.
*[[IsPolicyBlocked]]
*[[IsPolicyBranchBlocked]]
*[[IsPolicyBranchFinished]]
*[[IsPolicyBranchUnlocked]]
===Set===
*[[DoAdoptPolicy]]
*[[SetHasPolicy]](policyID, bNewValue) - sets player having a specified policy. Increases next policy cost.
*[[SetNumFreePolicies]]
*[[SetPolicyBranchUnlocked]]
 
==Happiness==
===Get===
*[[GetCapitalUnhappinessMod]]
*[[GetCityCountUnhappinessMod]]
*[[GetExcessHappiness]]() - returns happiness minus unhappiness (whats shown to player on the top panel). If empire is unhappy, it will return a negative value. Otherwise positive or zero.
*[[GetExtraHappinessPerCity]]
*[[GetExtraHappinessPerLuxury]]
*[[GetHappiness]]
*[[GetHappiness]]
*[[GetHappinessFromBuildings]]
*[[GetHappinessFromBuildings]]
Line 195: Line 410:
*[[GetHappinessPerTradeRoute]]
*[[GetHappinessPerTradeRoute]]
*[[GetHappyPerMilitaryUnit]]
*[[GetHappyPerMilitaryUnit]]
*[[GetHighestUnitLevel]]
*[[GetHurryCount]]
*[[GetHurryGoldCost]]
*[[GetHurryModifier]]
*[[GetID]]
*[[GetImprovementCount]]
*[[GetImprovementGoldMaintenance]]
*[[GetImprovementUpgradeRate]]
*[[GetImprovementUpgradeRateModifier]]
*[[GetIndustryHistory]]
*[[GetJONSCulture]]
*[[GetJONSCulturePerTurnForFree]]
*[[GetJONSCulturePerTurnFromCities]]
*[[GetJONSCulturePerTurnFromExcessHappiness]]
*[[GetJONSCulturePerTurnFromMinorCivs]]
*[[GetLandDisputeLevel]]
*[[GetLandScore]]
*[[GetLeaderType]]
*[[GetLengthResearchQueue]]
*[[GetLevelExperienceModifier]]
*[[GetMaxConscript]]
*[[GetMaxGlobalBuildingProductionModifier]]
*[[GetMaxPlayerBuildingProductionModifier]]
*[[GetMaxTeamBuildingProductionModifier]]
*[[GetMilitaryMight]]
*[[GetMilitaryProductionModifier]]
*[[GetMinorCivCultureFriendshipBonus]]
*[[GetMinorCivDisputeLevel]]
*[[GetMinorCivFavoriteMajor]]
*[[GetMinorCivFriendshipLevelWithMajor]]
*[[GetMinorCivFriendshipWithMajor]]
*[[GetMinorCivHappinessFriendshipBonus]]
*[[GetMinorCivHappinessFriendshipBonus]]
*[[GetMinorCivScienceFriendshipBonus]]
*[[GetMinorCivTrait]]
*[[GetMinorCivType]]
*[[GetMinorWarQuestWithMajorRemainingCount]]
*[[GetName]]
*[[GetNameKey]]
*[[GetNewCityName]]
*[[GetNextCity]]
*[[GetNextPolicyCost]]
*[[GetNickName]]
*[[GetNotificationDismissed]]
*[[GetNotificationIndex]]
*[[GetNotificationStr]]
*[[GetNotificationSummaryStr]]
*[[GetNotificationTurn]]
*[[GetNumCities]] - returns number of cities
*[[GetNumCityNames]]
*[[GetNumCiviliansReturned]]
*[[GetNumFreePolicies]]
*[[GetNumFreeTechs]]
*[[GetNumGoldenAges]]
*[[GetNumMaintenanceFreeUnits]]
*[[GetNumMilitaryUnits]]
*[[GetNumMinorCivsMet]]
*[[GetNumNotifications]]
*[[GetNumNukeUnits]]
*[[GetNumOutsideUnits]]
*[[GetNumPlots]]
*[[GetNumPlotsBought]]
*[[GetNumPolicies]]
*[[GetNumPolicyBranchesAllowed]]
*[[GetNumPolicyBranchesFinished]]
*[[GetNumPolicyBranchesUnlocked]]
*[[GetNumResourceAvailable]]
*[[GetNumResourceTotal]]
*[[GetNumResourceUsed]]
*[[GetNumTimesCultureBombed]]
*[[GetNumTradeResourceImports]]
*[[GetNumUnitGoldenAges]]
*[[GetNumUnits]]
*[[GetNumUnitsOutOfSupply]]
*[[GetNumUnitsSupplied]]
*[[GetNumUnitsSuppliedByCities]]
*[[GetNumUnitsSuppliedByHandicap]]
*[[GetNumUnitsSuppliedByPopulation]]
*[[GetNumWorldWonders]]
*[[GetOccupiedPopulationUnhappinessMod]]
*[[GetOccupiedPopulationUnhappinessMod]]
*[[GetOtherPlayerNumProtectedMinorsKilled]]
*[[GetOverflowResearch]]
*[[GetPersonality]]
*[[GetPersonalityType]]
*[[GetPlayerColor]]
*[[GetPlayerColors]]
*[[GetPlayerVisiblePlot]]
*[[GetPlotDanger]]
*[[GetPlotHasOrder]]
*[[GetPolicyBranchChosen]]
*[[GetPopScore]]
*[[GetPower]]
*[[GetPowerHistory]]
*[[GetPrevCity]]
*[[GetProductionModifier]]
*[[GetProjectProductionNeeded]]
*[[GetProximityToPlayer]]
*[[GetQuestData1]]
*[[GetQuestData2]]
*[[GetQueuePosition]]
*[[GetRealPopulation]]
*[[GetRecommendedFoundCityPlots]]
*[[GetRecommendedWorkerPlots]]
*[[GetResearchTurnsLeft]]
*[[GetResourceExport]]
*[[GetResourceFromMinors]]
*[[GetResourceImport]]
*[[GetRouteGoldTimes100]]
*[[GetScience]]
*[[GetScienceFromBudgetDeficitTimes100]]
*[[GetScienceFromCitiesTimes100]]
*[[GetScienceFromHappinessTimes100]]
*[[GetScienceFromOtherPlayersTimes100]]
*[[GetScienceFromResearchAgreementsTimes100]]
*[[GetScienceTimes100]]
*[[GetScore]]
*[[GetScoreFromCities]]
*[[GetScoreFromFutureTech]]
*[[GetScoreFromLand]]
*[[GetScoreFromPopulation]]
*[[GetScoreFromTechs]]
*[[GetScoreFromWonders]]
*[[GetScoreHistory]]
*[[GetScriptData]]
*[[GetSeaPlotYield]]
*[[GetSettlerProductionModifier]]
*[[GetSpaceProductionModifier]]
*[[GetSpecialistExtraYield]]
*[[GetStartingPlot]]
*[[GetStateReligionKey]]
*[[GetStateReligionName]]
*[[GetStrikeTurns]]
*[[GetTeam]]
*[[GetTechScore]]
*[[GetTotalJONSCulturePerTurn]]
*[[GetTotalLand]]
*[[GetTotalLandScored]]
*[[GetTotalPopulation]]
*[[GetTotalTimePlayed]]
*[[GetTraitCityStateCombatModifier]]
*[[GetTraitCityUnhappinessMod]]
*[[GetTraitCityUnhappinessMod]]
*[[GetTraitGoldenAgeCombatModifier]]
*[[GetTraitGreatGeneralExtraBonus]]
*[[GetTraitGreatScientistRateModifier]]
*[[GetTraitPopUnhappinessMod]]
*[[GetTraitPopUnhappinessMod]]
*[[GetTurnsSinceThreatenedByBarbarians]]
*[[GetUnhappiness]]
*[[GetUnhappiness]]
*[[GetUnhappinessForecast]]
*[[GetUnhappinessForecast]]
Line 350: Line 423:
*[[GetUnhappinessFromUnits]]
*[[GetUnhappinessFromUnits]]
*[[GetUnhappinessMod]]
*[[GetUnhappinessMod]]
*[[GetUnimprovedAvailableLuxuryResource]]
*[[GetUnitByID]]
*[[GetUnitClassCount]]
*[[GetUnitClassCountPlusMaking]]
*[[GetUnitClassMaking]]
*[[GetUnitProductionMaintenanceMod]]
*[[GetUnitProductionNeeded]]
*[[GetVictoryDisputeLevel]]
*[[GetVotes]]
*[[GetWarmongerThreat]]
*[[GetWonderDisputeLevel]]
*[[GetWonderProductionModifier]]
*[[GetWondersScore]]
*[[GetWorkerSpeedModifier]]
*[[GetWorstEnemyName]]
*[[GetYieldRateModifier]]
*[[GreatGeneralThreshold]]
*[[HasBusyMovingUnit]]
*[[HasBusyUnit]]
*[[HasPolicy]]
*[[HasReadyUnit]]
*[[HasReceivedNetTurnComplete]]
*[[InitCity]]
*[[InitUnit]]
*[[IsAlive]]
*[[IsAllies]]
*[[IsAlwaysSeeBarbCamps]]
*[[IsAnarchy]]
*[[IsAnyGoodyPlotAccessible]]
*[[IsAnyPlotImproved]]
*[[IsBarbarian]]
*[[IsBuildBlockedByFeature]]
*[[IsBuildingClassMaxedOut]]
*[[IsBuildingFree]]
*[[IsCanHurry]]
*[[IsCapitalConnectedToCity]]
*[[IsCurrentResearchRepeat]]
*[[IsDemandEverMade]]
*[[IsDenouncedPlayer]]
*[[IsDontSettleMessageTooSoon]]
*[[IsEmpireUnhappy]]
*[[IsEmpireUnhappy]]
*[[IsEmpireVeryUnhappy]]
*[[IsEmpireVeryUnhappy]]
*[[IsEverAlive]]
*[[IsExtendedGame]]
*[[IsFoundedFirstCity]]
*[[IsFriends]]
*[[IsFullMember]]
*[[IsGoldenAge]]
*[[IsHalfSpecialistUnhappiness]]
*[[IsHalfSpecialistUnhappiness]]
*[[IsHasAccessToHurry]]
===Set===
*[[IsHasLostCapital]]
*[[ChangeExtraHappinessPerCity]]
*[[IsHuman]]
*[[ChangeHappinessFromBuildings]]
*[[IsLoyalMember]]
*[[ChangeHappinessFromGarrisonedUnits]]
*[[IsMilitaryFoodProduction]]
*[[ChangeHappinessPerGarrisonedUnit]]
*[[IsMinorCiv]] - returns true if this player is a city-state.
*[[ChangeHappinessPerTradeRoute]]
*[[IsMinorCivRouteEstablishedWithMajor]]
*[[ChangeUnhappinessFromUnits]]
*[[IsMinorCivUnitSpawningDisabled]]
*[[SetHappiness]](iHappiness) - supposed to set player's happiness, but '''does not work'''
*[[IsMinorPermanentWar]]
*[[IsMinorWarQuestWithMajorActive]]
*[[IsNoResearchAvailable]]
*[[IsOption]]
*[[IsPeaceBlocked]]
*[[IsPlayable]]
*[[IsPlayerBrokenBorderPromise]]
*[[IsPlayerBrokenCityStatePromise]]
*[[IsPlayerBrokenCoopWarPromise]]
*[[IsPlayerBrokenExpansionPromise]]
*[[IsPlayerBrokenMilitaryPromise]]
*[[IsPlayerHasOpenBorders]]
*[[IsPlayerHasOpenBordersAutomatically]]
*[[IsPlayerIgnoredBorderPromise]]
*[[IsPlayerIgnoredCityStatePromise]]
*[[IsPlayerIgnoredExpansionPromise]]
*[[IsPlayerIgnoredMilitaryPromise]]
*[[IsPlayerNoSettleRequestEverAsked]]
*[[IsPlayerRecklessExpander]]
*[[IsPolicyBlocked]]
*[[IsPolicyBranchBlocked]]
*[[IsPolicyBranchFinished]]
*[[IsPolicyBranchUnlocked]]
*[[IsProductionMaxedBuildingClass]]
*[[IsProductionMaxedProject]]
*[[IsProductionMaxedUnitClass]]
*[[IsProtectingMinor]]
*[[IsResearch]]
*[[IsResearchingTech]]
*[[IsStrike]]
*[[IsTurnActive]]
*[[IsUnitClassMaxedOut]]
*[[IsVotingMember]]
*[[IsWhiteFlag]]
*[[IsWillAcceptPeaceWithPlayer]]
*[[IsWorkingAgainstPlayerAccepted]]
*[[IsWorkingWithPlayer]]
*[[IsWorkingWithPlayerMessageTooSoon]]
*[[KillCities]]
*[[KillUnits]]
*[[PopResearch]]
*[[PushResearch]]
*[[Raze]]
*[[ReceiveGoody]]
*[[RemoveBuildingClass]]
*[[SetAdvancedStartPoints]]
*[[SetAlwaysSeeBarbCampsCount]]
*[[SetAnarchyNumTurns]]
*[[SetBarbarianCombatBonus]]
*[[SetBaseBuildingGoldMaintenance]]
*[[SetCombatExperience]]
*[[SetConscriptCount]]
*[[SetGold]]
*[[SetGoldenAgeProgressMeter]]
*[[SetHappiness|SetHappiness ( iHappiness )]] - supposed to set player's happiness, '''does not work'''
*[[SetHappinessPerGarrisonedUnit]]
*[[SetHappinessPerGarrisonedUnit]]
*[[SetHappinessPerTradeRoute]]
*[[SetHappinessPerTradeRoute]]
*[[SetHasPolicy]]
 
*[[SetJONSCulture]]
==GoldenAge==
*[[SetLoyalMember]]
===Get===
*[[SetNumFreePolicies]]
*[[GetGoldenAgeLength]]
*[[SetNumFreeTechs]]
*[[GetGoldenAgeModifier]]
*[[GetGoldenAgeProgressMeter]]
*[[GetGoldenAgeProgressThreshold]]
*[[GetGoldenAgeTurns]]
*[[GetNumGoldenAges]]
*[[GetNumUnitGoldenAges]]
*[[GetTraitGoldenAgeCombatModifier]]
*[[IsGoldenAge]]
*[[UnitsGoldenAgeCapable]]
*[[UnitsGoldenAgeReady]]
*[[UnitsRequiredForGoldenAge]]
===Set===
*[[ChangeGoldenAgeProgressMeter]]
*[[ChangeGoldenAgeTurns]]
*[[ChangeNumGoldenAges]]
*[[ChangeNumUnitGoldenAges]]
*[[SetGoldenAgeProgressMeter]]
*[[SetNumGoldenAges]]
*[[SetNumGoldenAges]]
==Great People==
===Great General===
*[[GetDomesticGreatGeneralRateModifier]]
*[[GetGreatGeneralRateModifier]]
*[[GetGreatGeneralsCreated]]
*[[GetGreatGeneralsThresholdModifier]]
*[[GetTraitGreatGeneralExtraBonus]]
*[[GreatGeneralThreshold]]
===Get===
*[[GetGreatPeopleCreated]]
*[[GetGreatPeopleRateModifier]]
*[[GetGreatPeopleThresholdModifier]]
*[[GetTraitGreatScientistRateModifier]]
===Set===
*[[CreateGreatGeneral]]
*[[DoGreatPersonChoice]]
==Resources==
===Get===
*[[GetHappinessFromResources]]
*[[GetHappinessFromResourceVariety]]
*[[GetNumResourceAvailable]]
*[[GetNumResourceTotal]]
*[[GetNumResourceUsed]]
*[[GetNumTradeResourceImports]]
*[[GetResourceExport]]
*[[GetResourceFromMinors]]
*[[GetResourceImport]]
*[[GetUnimprovedAvailableLuxuryResource]]
===Set===
*[[ChangeNumResourceTotal]]
==Improvements==
*[[GetImprovementCount]]
*[[GetImprovementGoldMaintenance]]
*[[GetImprovementUpgradeRate]]
*[[GetImprovementUpgradeRateModifier]]
*[[GetUnimprovedAvailableLuxuryResource]]
*[[GetWorkerSpeedModifier]]
*[[IsAnyPlotImproved]]
==Plots==
===Get===
*[[GetBuyPlotCost]]
*[[GetNumPlots]]
*[[GetNumPlotsBought]]
*[[GetPlotDanger]]
*[[GetPlotHasOrder]]
*[[GetRecommendedFoundCityPlots]]
*[[GetRecommendedWorkerPlots]]
*[[GetSeaPlotYield]]
*[[GetStartingPlot]]
===Set===
*[[ChangeNumPlotsBought]]
*[[SetNumPlotsBought]]
*[[SetNumPlotsBought]]
*[[SetOption]]
*[[SetPersonalityType]]
*[[SetPlayable]]
*[[SetPolicyBranchUnlocked]]
*[[SetResearchingTech]]
*[[SetScriptData]]
*[[SetStartingPlot]]
*[[SetStartingPlot]]
*[[SpecialistYield]]
*[[StopTradingWithTeam]]
*[[Units]]
*[[UnitsGoldenAgeCapable]]
*[[UnitsGoldenAgeReady]]
*[[UnitsRequiredForGoldenAge]]


==Barbarians==
===Get===
*[[GetBarbarianCombatBonus]]
*[[GetTurnsSinceThreatenedByBarbarians]]
*[[IsAlwaysSeeBarbCamps]]
*[[IsBarbarian]]
===Set===
*[[ChangeAlwaysSeeBarbCampsCount]]
*[[ChangeBarbarianCombatBonus]]
*[[SetAlwaysSeeBarbCampsCount]]
*[[SetBarbarianCombatBonus]]
==Goodies==
*[[CanReceiveGoody]]
*[[DoGoody]](pPlot, pUnit)
*[[GetClosestGoodyPlot]]
*[[GetEverPoppedGoody]]
*[[IsAnyGoodyPlotAccessible]]
*[[ReceiveGoody]]
==UI==
===Text===
*[[GetCivilizationAdjective]]
*[[GetCivilizationAdjectiveKey]]
*[[GetCivilizationDescription]]
*[[GetCivilizationDescriptionKey]]
*[[GetCivilizationShortDescription]]
*[[GetCivilizationShortDescriptionKey]]
*[[GetDominantPolicyBranchForTitle]]
*[[GetName]]
*[[GetNameKey]]
*[[GetNickName]]
===Get===
*[[GetArtStyleType]]
*[[GetEndTurnBlockingNotificationIndex]]
*[[GetEndTurnBlockingType]]
*[[GetNotificationDismissed]]
*[[GetNotificationIndex]]
*[[GetNotificationStr]]
*[[GetNotificationSummaryStr]]
*[[GetNotificationTurn]]
*[[GetNumNotifications]]
===Set===
*[[AddNotification]]
==AI==
*[[AI_foundValue]]
*[[AI_updateFoundValues]]
==AdvancedStart==
===Get===
*[[GetAdvancedStartBuildingCost]]
*[[GetAdvancedStartCityCost]]
*[[GetAdvancedStartPoints]]
*[[GetAdvancedStartPopCost]]
*[[GetAdvancedStartRouteCost]]
*[[GetAdvancedStartTechCost]]
*[[GetAdvancedStartUnitCost]]
*[[GetAdvancedStartVisibilityCost]]
===Set===
*[[ChangeAdvancedStartPoints]]
*[[SetAdvancedStartPoints]]


Complete list in official wiki: http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/Player
==Unsorted==
*[[CalculateInflatedCosts]]
*[[CanBuild]]
*[[CanCreate]]
*[[Found]](int iX, int iY)
*[[GetBestRoute]](pPlot)
*[[GetBranchPicked1]]
*[[GetBranchPicked2]]
*[[GetBranchPicked3]]
*[[GetConversionTimer]]
*[[GetEverTrainedBuilder]]
*[[GetHandicapType]]
*[[HasReceivedNetTurnComplete]]
*[[IsExtendedGame]]
*[[IsOption]]
*[[IsTurnActive]]
*[[SetOption]]
 
==Unused==
===Conscription===
*[[ChangeConscriptCount]]
*[[GetConscriptCount]]
*[[GetMaxConscript]]
*[[SetConscriptCount]]
===Hurry===
*[[GetHurryCount]](eIndex)
*[[GetHurryModifier]]
*[[IsCanHurry]]
*[[IsHasAccessToHurry]]
===Anarchy===
*[[ChangeAnarchyNumTurns]]
*[[GetAnarchyNumTurns]]
*[[IsAnarchy]]
*[[SetAnarchyNumTurns]]
===Religion===
*[[GetStateReligionKey]]
*[[GetStateReligionName]]
===Strike===
*[[GetStrikeTurns]]
*[[IsStrike]]
===UN/AP Resolutions===
*[[IsFullMember]]
*[[IsLoyalMember]]
*[[IsVotingMember]]
*[[SetLoyalMember]]




==Related Events==
==Related Events==


*[[ActivePlayerTurnEnd]]
See [[Lua Game Events#Player|Lua Game Events (Player)]]
*[[ActivePlayerTurnStart]] - fired on the start of the human player's turn (not fired for AIs).
*[[EventPoliciesDirty]]
*[[GameplaySetActivePlayer]]
*[[SerialEventEraChanged]]
*[[SerialEventResearchDirty]]
*[[SerialEventScoreDirty]]
*[[TeamMet]]
*[[TechAcquired]]
*[[WarStateChanged]]

Latest revision as of 04:45, 18 February 2012

Up: Lua Game Objects


List on the official wiki: http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/Player (parameters are listed for many methods).


Player Info

Self

Misc

Yields

Combat Experience

Score

Demographics

Script Data

Other Players / Diplomacy

City States

Dispute level

Get

Set

Units

  • CanTrain(eUnit, boolean bContinue, boolean bTestVisible)

Experience

Cost/Supply

Combat

Numbers

Get

Set

Cities

Get

Set

Population

Buildings

  • CanBuild
  • CanConstruct(BuildingTypes eBuilding, boolean bContinue, boolean bTestVisible, boolean bIgnoreCost)

Get

Set

Food

Production

Gold

Get

Set

Science

Get

Set

Culture

Get

Set

Policies

Get

Set

Happiness

Get

Set

GoldenAge

Get

Set

Great People

Great General

Get

Set

Resources

Get

Set

Improvements

Plots

Get

Set

Barbarians

Get

Set

Goodies

UI

Text

Get

Set

AI

AdvancedStart

Get

Set

Unsorted

Unused

Conscription

Hurry

Anarchy

Religion

Strike

UN/AP Resolutions


Related Events

See Lua Game Events (Player)