1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. We have selected the winners of the Old World random draw and competition. For the winning entries, please check this thread.
    Dismiss Notice

DLL - Lua API requests

Discussion in 'Community Patch Project' started by whoward69, Jun 12, 2014.

  1. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    Any and all requests for Lua API extensions.

    The API methods added by the DLL are given below, the format is method_name, return_type, parameter(s)

    Game.
    - see post #2

    pCity:
    - see post #3

    pLeague:
    - see post #2

    pPlayer:
    • AddMessage, void, sMessage
    • CanAdoptIdeology, bool, iIdeologyBranch
    • CanAdoptTenet, bool, iTenetPolicy, bIgnoreCost
    • ChangeCityWorkingChange, void, iChange
    • DismissNotification, void, iIndex, bUserInvoked
    • DoForceDefPact, void, iOtherPlayer
    • DoSwapGreatWorks, void, iFocusYield
    • EspionageCreateSpy, void
    • EspionagePromoteSpy, void, iSpyIndex
    • EspionageSetOutcome, void, iSpyIndex, iSpyResult, bAffectsDiplomacy
    • EspionageSetPassive, void, iSpyIndex, bPassive
    • GetBeliefsInPantheon, table
    • GetBuyPlotDistance, int
    • GetCityWorkingChange, int
    • GetGreatDiplomatRateModifier, int
    • GetHappinessFromVassals, int
    • GetJerk, int
    • GetJONSCulturePerTurnFromVassals, int
    • GetLeagueCultureCityModifier, int
    • GetMaxStockpile, int
    • GetMilitaryAggressivePosture, int, iOtherPlayer
    • GetNumDenouncements, int
    • GetNumDenouncementsofPlayer, int
    • GetPlayerMoveTroopsRequestCounter, int, iOtherPlayer
    • GetPolicyConversionModifier, int, iPolicyType
    • GetPolicyGreatDiplomatRateModifier, int
    • GetPotentialInternationalTradeRouteDestinationsFro m, table, pUnit, pCity
    • GetScienceFromVassalTimes100, int
    • GetScienceRateFromLeagueAid, int
    • GetScienceRateFromMinorAllies, int
    • GetScoreFromVassals, int
    • GetSpecificBuildingType, int, sBuildingClass
    • GetSpecificUnitType, int, sUnitClass
    • GetVassalGoldMaintenance, int
    • GetWorkPlotDistance, int
    • HasAnyDomesticTradeRoute, bool
    • HasAnyHolyCity, bool
    • HasAnyInternationalTradeRoute, bool
    • HasAnyNaturalWonder, bool
    • HasAnyReligion, bool
    • HasAnyTradeRoute, bool
    • HasAnyTradeRouteWith, bool, iPlayer
    • HasAnyWonder, bool
    • HasBuilding, bool, iBuildingType
    • HasBuildingClass, bool, iBuildingClassType
    • HasBelief, bool, iBeliefType
    • HasCapturedHolyCity, bool, iReligionType
    • HasEmbassyWith, bool, iOtherPlayer
    • HasEnhancedReligion, bool
    • HasHolyCity, bool, iReligionType
    • HasIdeology, bool, iPolicyBranchType
    • HasNaturalWonder, bool, iFeatureType
    • HasPantheon, bool
    • HasPolicyBranch, bool, iPolicyBranchType
    • HasProject, bool, iProjectType
    • HasReachedEra, bool, iEraType
    • HasReligion, bool, iReligionType
    • HasSpecialist, bool, iSpecialistType
    • HasSpecialistSlot, bool, iSpecialistType
    • HasTech, bool, iTechType
    • HasTenet, bool, iPolicyType
    • HasTrait, bool, iTraitType
    • HasUnit, bool, iUnitType
    • HasUnitClass, bool, iUnitClassTypeHasWonder, bool, iBuildingType
    • IsAtPeace, bool [1]
    • IsAtPeaceAllMajors, bool
    • IsAtPeaceAllMinors, bool [1]
    • IsAtPeaceWith, bool, iPlayer
    • IsAtWar, bool [1]
    • IsAtWarAnyMajor, bool
    • IsAtWarAnyMinor, bool [1]
    • IsAtWarWith, bool, iPlayer
    • IsCityNameValid, bool, sName, bTestDestroyed
    • IsCivilization, bool, iCivilizationType
    • IsConnectedTo, bool, iPlayer
    • IsInEra, bool, iEraType
    • IsPlotConnectedToPlot, bool, pFromPlot, pToPlot
    • IsTraitAnyBelief, bool
    • IsVassalageAcceptable, bool, iOtherPlayer
    • MoveRequestTooSoon, bool, iOtherPlayer
    • SetPersonality, void, iPersonality

    pPlot:
    - see post #3

    pTeam:
    • CanBecomeVassal, bool, iTeam
    • CanEndVassal, bool, iTeam
    • ChangeCityWorkingChange, void, iChange
    • DoBecomeVassal, void, iTeam, bVoluntary
    • DoEndVassal, void, iTeam, bPeaceful, bSuppressNotification
    • GetCityWorkingChange, int
    • GetMaster, int
    • GetNumTurnsIsVassal, int, iTeam
    • GetNumTurnsSinceVassalEnded, int, iTeam
    • HasSpyAtTeam, bool, iTeam
    • IsCityWorkingChange, bool
    • IsTooSoonForVassal, bool, iTeam
    • IsVassal, bool, iteam
    • IsVassalLockedIntoWar, bool, iTeam
    • IsVassalOfSomeone, bool
    • IsVassalageTradingAllowed, bool
    • IsVoluntaryVassal, bool, iTeam

    pUnit:
    - see post #3

    [1] - excludes Barbarians

    At some point I may get around to reformatting these lists and sorting them into function groups
    Alphabetical order provided by JFD :)
     
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    The API methods added by the DLL are given below, the format is method_name, return_type, parameter(s)

    Game.
    • AnyoneHasAnyNaturalWonder, bool
    • AnyoneHasAnyReligion, bool
    • AnyoneHasAnyWonder, bool
    • AnyoneHasBelief, bool, iBeliefType
    • AnyoneHasBuilding, bool, iBuildingType
    • AnyoneHasBuildingClass, bool, iBuildingClassType
    • AnyoneHasIdeology, bool, iPolicyBranchType
    • AnyoneHasNaturalWonder, bool, iFeatureType
    • AnyoneHasPantheon, bool
    • AnyoneHasPolicy, bool, iPolicyType
    • AnyoneHasPolicyBranch, bool, iPolicyBranchType
    • AnyoneHasProject, bool, iProjectType
    • AnyoneHasReachedEra, bool, iEraType
    • AnyoneHasReligion, bool, iReligionType
    • AnyoneHasTech, bool, iTechType
    • AnyoneHasTenet, bool, iPolicyType
    • AnyoneHasUnit, bool, iUnitType
    • AnyoneHasUnitClass, bool, iUnitClassType
    • AnyoneHasWonder, bool, iBuildingType
    • AnyoneIsInEra, bool, iEraType
    • CreateGreatWork, int, iGreatWorkType, iOwningPlayer, iEra, sCreator
    • EnhancePantheon, void, iPlayer, iBelief
    • GetCivilizationPlayer, int, iCivilizationType
    • GetMinimumVassalTurns, int
    • GetMinimumVoluntaryVassalTurns, int
    • GetNumTurnsBetweenVassals, int
    • GetSteamStat, int, iSteamStat
    • GetTradeRoute, table, iRouteIndex
    • IsAchievementUnlocked, bool, iAchievement
    • IsInSomeReligion, bool, iBelief, iPlayer
    • IsResolutionPassed, bool, iResolutionType, iChoice
    • ReloadGameDataDefines, void
    • ReloadCustomModOptions, void

    pLeague:
    • GetSpaceShipProductionMod, int
    • GetSpaceShipPurchaseMod, int
     
  3. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    The API methods added by the DLL are given below, the format is method_name, return_type, parameter(s)

    pCity:
    • AddMessage, void, sMessage, iNotifyPlayer
    • ChangeCityWorkingChange, void, iChange
    • ChangeTourismRateModifier, void, iChange
    • GetBaseYieldRateFromGreatWorks, int, iYield
    • GetBaseYieldRateFromLeague, int, iYield
    • GetBombardRange, int -- returns iRange, bIndirectFire
    • GetBuildingConversionModifier, int, iBuildingType
    • GetBuildingGlobalConversionModifier, int, iBuildingType
    • GetBuyPlotDistance, int
    • GetCityWorkingChange, int
    • GetCounterSpy, int
    • GetNumBuildingClass, int, iBuildingClassType
    • GetProcessProductionTurnsLeft, int
    • GetTourismRateModifier, int
    • GetWorkPlotDistance, int
    • HasAnyDomesticTradeRoute, bool
    • HasAnyInternationalTradeRoute, bool
    • HasAnyNaturalWonder, bool
    • HasAnyReligion, bool
    • HasAnyWonder, bool
    • HasBelief, bool, iBeliefType
    • HasBuilding, bool, iBuildingType
    • HasBuildingClass, bool, iBuildingClassType
    • HasCounterSpy, bool
    • HasDiplomat, bool, iPlayer
    • HasFeature, bool, iFeatureType
    • HasImprovement, bool, iImprovementType
    • HasNaturalWonder, bool, iFeatureType
    • HasPlotType, bool, iPlotType
    • HasReligion, bool, iReligionType
    • HasResource, bool, iResourceType
    • HasSpecialist, bool, iSpecialistType
    • HasSpecialistSlot, bool, iSpecialistType
    • HasSpy, bool, iPlayer
    • HasTerrain, bool, iTerrainType
    • HasTradeRouteFrom, bool, pCity
    • HasTradeRouteFromAnyCity, bool
    • HasTradeRouteTo, bool, pCity
    • HasTradeRouteToAnyCity, bool
    • HasWonder, bool, iBuildingType
    • HasWorkedFeature, bool, iFeatureType
    • HasWorkedImprovement, bool, iImprovementType
    • HasWorkedPlotType, bool, iPlotType
    • HasWorkedResource, bool, iResourceType
    • HasWorkedTerrain, bool, iTerrainType
    • IsAddsFreshWater, bool
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsCivilization, bool, iCivilizationType
    • IsConnectedTo, bool, pCity
    • IsConnectedToCapital, bool
    • IsHasBuildingClass, bool, iBuildingClassType
    • IsOnFeature, bool, iFeatureType
    • IsOnImprovement, bool, iImprovementType
    • IsOnPlotType, bool, iPlotType
    • IsOnResource, bool, iResourceType
    • IsOnTerrain, bool, iTerrainType
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • Purchase, void, iUnitType, iBuildingType, iProjectType, iYieldType
    • SetNumFreeBuilding, void, iBuildingType, iCount

    pPlot:
    • AddArchaeologicalRecord, void, iArtifactClass, iEra, iPlayer1, iPlayer2
    • AddMessage, void, sMessage, iNotifyPlayer
    • AddPopupMessage, void, sMessage, fDelay, iNotifyPlayer
    • GetIndex, int
    • GetPlayerResponsibleForImprovement, int
    • GetPlayerThatBuiltImprovement, int
    • GetPlayerResponsibleForRoute, int
    • GetPlayerThatClearedBarbCampHere, int
    • GetTurnDamage, int, bIgnoreTerrainDamage, bIgnoreFeatureDamage, bExtraTerrainDamage, bExtraFeatureDamage
    • GetUnitLimit, int
    • HasImprovement, bool, iImprovementType
    • HasPlotType, bool, iPlotType
    • HasResource, bool, iResourceType
    • HasRoute, bool, iRouteType
    • HasTerrain, bool, iTerrainType
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToIce, bool
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsBlockaded, bool, iPlayer
    • IsCivilization, bool, iCivilizationType
    • IsFeatureAtoll, bool
    • IsFeatureFallout, bool
    • IsFeatureFloodPlains, bool
    • IsFeatureForest, bool
    • IsFeatureJungle, bool
    • IsFeatureLake, bool
    • IsFeatureIce, bool
    • IsFeatureMarsh, bool
    • IsFeatureOasis, bool
    • IsFeatureRiver, bool
    • IsFriendlyCityOrPassableImprovement, bool, pUnit, bCheckImprovement
    • IsImprovementEmbassy, bool
    • IsNaturalWonder, bool
    • IsPlotHill, bool
    • IsPlotHills, bool
    • IsPlotLand, bool
    • IsPlotMountain, bool
    • IsPlotMountains, bool
    • IsPlotOcean, bool
    • IsRouteRailroad, bool
    • IsRouteRoad, bool
    • IsTerraFirma, bool, pUnit
    • IsTerrainCoast, bool
    • IsTerrainDesert, bool
    • IsTerrainGrass, bool
    • IsTerrainHill, bool
    • IsTerrainHills, bool
    • IsTerrainMountain, bool
    • IsTerrainMountains, bool
    • IsTerrainOcean, bool
    • IsTerrainPlains, bool
    • IsTerrainSnow, bool
    • IsTerrainTundra, bool
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • HasAnyNaturalWonder, bool
    • HasDig, bool
    • HasFeature, bool, iFeatureType
    • HasNaturalWonder, bool, iFeatureType
    • SetPlayerThatBuiltImprovement, void, iPlayer
    • SetPlayerResponsibleForImprovement, void, iPlayer
    • SetPlayerResponsibleForRoute, void, iPlayer
    • SetPlayerThatClearedBarbCampHere, void, iPlayer

    pUnit:
    • AddMessage, void, sMessage, iNotifyPlayer
    • CanCreateGreatWork, bool, pPlot
    • CanCrossIce, bool
    • CanCrossMountains, bool
    • CanCrossOceans, bool
    • CanPlunderTradeRoute, bool, pPlot
    • CanUpgradeTo, bool, iUpgradeUnitType, bTestVisible
    • CanUpgradeInTerritory, bool, bTestVisible
    • CreateGreatWork, bool
    • EndTrader, void
    • ExtraFeatureDamage, bool
    • ExtraTerrainDamage, bool
    • GetCombatBonusImprovement, int
    • GetExtraReconRange, int
    • GetNearbyImprovementBonusRange, int
    • GetNearbyImprovementCombatBonus, int
    • GetUnitPromotionType, int
    • GetTradeRouteIndex, int
    • HasPromotion, bool, iPromotionType
    • IgnoreFeatureDamage, bool
    • IgnoreTerrainDamage, bool
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsCivilization, bool, iCivilizationType
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsFeatureHalfMove, bool, iFeatureType
    • IsFoundAbroad, bool
    • IsHoveringUnit, bool
    • IsOnFeature, bool, iFeatureType
    • IsOnImprovement, bool, iImprovementType
    • IsOnPlotType, bool, iPlotType
    • IsOnResource, bool, iResourceType
    • IsOnTerrain, bool, iTerrainType
    • IsRecalledTrader, bool
    • IsTerrainHalfMove, bool, iTerrainType
    • IsUnit, bool, iUnitType
    • IsUnitClass, bool, iUnitClassType
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • RebaseAt, void, iPlotX, iPlotY
    • RecallTrader, void, bImmediate
    • PlunderTradeRoute, bool
    • SetActivityType, void, iActivityType, bClearFortify
    • SetConversionStrength, void, iStrength
    • SetReligion, void, iReligion
    • SetSpreadsLeft, void, iSpreads
    • Upgrade, pUnit, bIsFree
    • UpgradeTo, pUnit, iUpgradeUnitType, bIsFree
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    From post #339 in the original CP thread

    player:GetLeaderTrait() or player:GetTraitInfo()
     
  5. Vicevirtuoso

    Vicevirtuoso The Modetta Man

    Joined:
    May 14, 2013
    Messages:
    775
    Location:
    The Wreckage, Brother
    I'm assuming that, since this is a pUnit function, that it just forces the pUnit to plunder a trade route on the plot on which it is currently located?

    What I'd like is something like a GameEvent hook which fires when a trade route is plundered, passing the unit which did the plundering, the owner of the unit which did the plundering, and the owner of the trade route which got plundered.

    Thanks in advance!
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    Correct.

    Moved to it's own request thread
     
  7. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    Given you've taken the time to compile - and create in the first place - this list, the least I can do is alphabetise it:

    Spoiler :

    Game.
    • AnyoneHasAnyNaturalWonder, bool
    • AnyoneHasAnyReligion, bool
    • AnyoneHasAnyWonder, bool
    • AnyoneHasBelief, bool, iBeliefType
    • AnyoneHasBuilding, bool, iBuildingType
    • AnyoneHasBuildingClass, bool, iBuildingClassType
    • AnyoneHasIdeology, bool, iPolicyBranchType
    • AnyoneHasNaturalWonder, bool, iFeatureType
    • AnyoneHasPantheon, bool
    • AnyoneHasPolicy, bool, iPolicyType
    • AnyoneHasPolicyBranch, bool, iPolicyBranchType
    • AnyoneHasProject, bool, iProjectType
    • AnyoneHasReachedEra, bool, iEraType
    • AnyoneHasReligion, bool, iReligionType
    • AnyoneHasTech, bool, iTechType
    • AnyoneHasTenet, bool, iPolicyType
    • AnyoneHasUnit, bool, iUnitType
    • AnyoneHasUnitClass, bool, iUnitClassType
    • AnyoneHasWonder, bool, iBuildingType
    • AnyoneIsInEra, bool, iEraType
    • CreateGreatWork, int, iGreatWorkType, iOwningPlayer, iEra, sCreator
    • EnhancePantheon, void, iPlayer, iBelief
    • GetCivilizationPlayer, int, iCivilizationType
    • GetMinimumVassalTurns, int
    • GetMinimumVoluntaryVassalTurns, int
    • GetNumTurnsBetweenVassals, int
    • GetSteamStat, int, iSteamStat
    • GetTradeRoute, table, iRouteIndex
    • IsAchievementUnlocked, bool, iAchievement
    • IsInSomeReligion, bool, iBelief, iPlayer
    • IsResolutionPassed, bool, iResolutionType, iChoice
    • ReloadGameDataDefines, void
    • ReloadCustomModOptions, void

    pCity:
    • AddMessage, void, sMessage, iNotifyPlayer
    • ChangeCityWorkingChange, void, iChange
    • ChangeTourismRateModifier, void, iChange
    • GetBaseYieldRateFromGreatWorks, int, iYield
    • GetBaseYieldRateFromLeague, int, iYield
    • GetBombardRange, int -- returns iRange, bIndirectFire
    • GetBuildingConversionModifier, int, iBuildingType
    • GetBuildingGlobalConversionModifier, int, iBuildingType
    • GetBuyPlotDistance, int
    • GetCityWorkingChange, int
    • GetCounterSpy, int
    • GetNumBuildingClass, int, iBuildingClassType
    • GetProcessProductionTurnsLeft, int
    • GetTourismRateModifier, int
    • GetWorkPlotDistance, int
    • HasAnyDomesticTradeRoute, bool
    • HasAnyInternationalTradeRoute, bool
    • HasAnyNaturalWonder, bool
    • HasAnyReligion, bool
    • HasAnyWonder, bool
    • HasBelief, bool, iBeliefType
    • HasBuilding, bool, iBuildingType
    • HasBuildingClass, bool, iBuildingClassType
    • HasCounterSpy, bool
    • HasDiplomat, bool, iPlayer
    • HasFeature, bool, iFeatureType
    • HasImprovement, bool, iImprovementType
    • HasNaturalWonder, bool, iFeatureType
    • HasPlotType, bool, iPlotType
    • HasReligion, bool, iReligionType
    • HasResource, bool, iResourceType
    • HasSpecialist, bool, iSpecialistType
    • HasSpecialistSlot, bool, iSpecialistType
    • HasSpy, bool, iPlayer
    • HasTerrain, bool, iTerrainType
    • HasTradeRouteFrom, bool, pCity
    • HasTradeRouteFromAnyCity, bool
    • HasTradeRouteTo, bool, pCity
    • HasTradeRouteToAnyCity, bool
    • HasWonder, bool, iBuildingType
    • HasWorkedFeature, bool, iFeatureType
    • HasWorkedImprovement, bool, iImprovementType
    • HasWorkedPlotType, bool, iPlotType
    • HasWorkedResource, bool, iResourceType
    • HasWorkedTerrain, bool, iTerrainType
    • IsAddsFreshWater, bool
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsCivilization, bool, iCivilizationType
    • IsConnectedTo, bool, pCity
    • IsConnectedToCapital, bool
    • IsHasBuildingClass, bool, iBuildingClassType
    • IsOnFeature, bool, iFeatureType
    • IsOnImprovement, bool, iImprovementType
    • IsOnPlotType, bool, iPlotType
    • IsOnResource, bool, iResourceType
    • IsOnTerrain, bool, iTerrainType
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • SetNumFreeBuilding, void, iBuildingType, iCount

    pLeague:
    • GetSpaceShipProductionMod, int
    • GetSpaceShipPurchaseMod, int

    pPlayer:
    • AddMessage, void, sMessage
    • CanAdoptIdeology, bool, iIdeologyBranch
    • CanAdoptTenet, bool, iTenetPolicy, bIgnoreCost
    • ChangeCityWorkingChange, void, iChange
    • DismissNotification, void, iIndex, bUserInvoked
    • DoSwapGreatWorks, void, iFocusYield
    • EspionageCreateSpy, void
    • EspionagePromoteSpy, void, iSpyIndex
    • EspionageSetOutcome, void, iSpyIndex, iSpyResult, bAffectsDiplomacy
    • EspionageSetPassive, void, iSpyIndex, bPassive
    • GetBeliefsInPantheon, table
    • GetBuyPlotDistance, int
    • GetCityWorkingChange, int
    • GetGreatDiplomatRateModifier, int
    • GetHappinessFromVassals, int
    • GetJONSCulturePerTurnFromVassals, int
    • GetLeagueCultureCityModifier, int
    • GetMaxStockpile, int
    • GetMilitaryAggressivePosture, int, iOtherPlayer
    • GetPlayerMoveTroopsRequestCounter, int, iOtherPlayer
    • GetPolicyConversionModifier, int, iPolicyType
    • GetPolicyGreatDiplomatRateModifier, int
    • GetPotentialInternationalTradeRouteDestinationsFro m, table, pUnit, pCity
    • GetScienceFromVassalTimes100, int
    • GetScienceRateFromLeagueAid, int
    • GetScienceRateFromMinorAllies, int
    • GetScoreFromVassals, int
    • GetSpecificBuildingType, int, sBuildingClass
    • GetSpecificUnitType, int, sUnitClass
    • GetVassalGoldMaintenance, int
    • GetWorkPlotDistance, int
    • HasAnyDomesticTradeRoute, bool
    • HasAnyInternationalTradeRoute, bool
    • HasAnyNaturalWonder, bool
    • HasAnyReligion, bool
    • HasAnyTradeRoute, bool
    • HasAnyTradeRouteWith, bool, iPlayer
    • HasAnyWonder, bool
    • HasBuilding, bool, iBuildingType
    • HasBuildingClass, bool, iBuildingClassType
    • HasBelief, bool, iBeliefType
    • HasEnhancedReligion, bool
    • HasIdeology, bool, iPolicyBranchType
    • HasNaturalWonder, bool, iFeatureType
    • HasPantheon, bool
    • HasPolicyBranch, bool, iPolicyBranchType
    • HasProject, bool, iProjectType
    • HasReachedEra, bool, iEraType
    • HasReligion, bool, iReligionType
    • HasSpecialist, bool, iSpecialistType
    • HasSpecialistSlot, bool, iSpecialistType
    • HasTech, bool, iTechType
    • HasTenet, bool, iPolicyType
    • HasUnit, bool, iUnitType
    • HasUnitClass, bool, iUnitClassTypeHasWonder, bool, iBuildingType
    • IsAtPeace, bool
    • IsAtPeaceWith, bool, iPlayer
    • IsAtWar, bool
    • IsAtWarWith, bool, iPlayer
    • IsCityNameValid, bool, sName, bTestDestroyed
    • IsCivilization, bool, iCivilizationType
    • IsConnectedTo, bool, iPlayer
    • IsInEra, bool, iEraType
    • IsPlotConnectedToPlot, bool, pFromPlot, pToPlot
    • IsTraitAnyBelief, bool
    • IsVassalageAcceptable, bool, iOtherPlayer
    • MoveRequestTooSoon, bool, iOtherPlayer
    • SetPersonality, void, iPersonality

    pPlot:
    • AddArchaeologicalRecord, void, iArtifactClass, iEra, iPlayer1, iPlayer2
    • AddMessage, void, sMessage, iNotifyPlayer
    • AddPopupMessage, void, sMessage, fDelay, iNotifyPlayer
    • GetIndex, int
    • GetPlayerResponsibleForImprovement, int
    • GetPlayerThatBuiltImprovement, int
    • GetPlayerResponsibleForRoute, int
    • GetPlayerThatClearedBarbCampHere, int
    • GetTurnDamage, int, bIgnoreTerrainDamage, bIgnoreFeatureDamage, bExtraTerrainDamage, bExtraFeatureDamage
    • GetUnitLimit, int
    • HasImprovement, bool, iImprovementType
    • HasPlotType, bool, iPlotType
    • HasResource, bool, iResourceType
    • HasRoute, bool, iRouteType
    • HasTerrain, bool, iTerrainType
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToIce, bool
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsBlockaded, bool, iPlayer
    • IsCivilization, bool, iCivilizationType
    • IsFeatureAtoll, bool
    • IsFeatureFallout, bool
    • IsFeatureFloodPlains, bool
    • IsFeatureForest, bool
    • IsFeatureJungle, bool
    • IsFeatureLake, bool
    • IsFeatureIce, bool
    • IsFeatureMarsh, bool
    • IsFeatureOasis, bool
    • IsFeatureRiver, bool
    • IsFriendlyCityOrPassableImprovement, bool, pUnit, bCheckImprovement
    • IsImprovementEmbassy, bool
    • IsNaturalWonder, bool
    • IsPlotHill, bool
    • IsPlotHills, bool
    • IsPlotLand, bool
    • IsPlotMountain, bool
    • IsPlotMountains, bool
    • IsPlotOcean, bool
    • IsRouteRailroad, bool
    • IsRouteRoad, bool
    • IsTerraFirma, bool, pUnit
    • IsTerrainCoast, bool
    • IsTerrainDesert, bool
    • IsTerrainGrass, bool
    • IsTerrainHill, bool
    • IsTerrainHills, bool
    • IsTerrainMountain, bool
    • IsTerrainMountains, bool
    • IsTerrainOcean, bool
    • IsTerrainPlains, bool
    • IsTerrainSnow, bool
    • IsTerrainTundra, bool
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • HasAnyNaturalWonder, bool
    • HasDig, bool
    • HasFeature, bool, iFeatureType
    • HasNaturalWonder, bool, iFeatureType
    • SetPlayerThatBuiltImprovement, void, iPlayer
    • SetPlayerResponsibleForImprovement, void, iPlayer
    • SetPlayerResponsibleForRoute, void, iPlayer
    • SetPlayerThatClearedBarbCampHere, void, iPlayer

    pTeam:
    • CanBecomeVassal, bool, iTeam
    • CanEndVassal, bool, iTeam
    • ChangeCityWorkingChange, void, iChange
    • DoBecomeVassal, void, iTeam, bVoluntary
    • DoEndVassal, void, iTeam, bPeaceful, bSuppressNotification
    • GetCityWorkingChange, int
    • GetMaster, int
    • GetNumTurnsIsVassal, int, iTeam
    • GetNumTurnsSinceVassalEnded, int, iTeam
    • HasSpyAtTeam, bool, iTeam
    • IsCityWorkingChange, bool
    • IsTooSoonForVassal, bool, iTeam
    • IsVassal, bool, iteam
    • IsVassalLockedIntoWar, bool, iTeam
    • IsVassalOfSomeone, bool
    • IsVassalageTradingAllowed, bool
    • IsVoluntaryVassal, bool, iTeam

    pUnit:
    • AddMessage, void, sMessage, iNotifyPlayer
    • CanCreateGreatWork, bool, pPlot
    • CanCrossIce, bool
    • CanCrossMountains, bool
    • CanCrossOceans, bool
    • CanPlunderTradeRoute, bool, pPlot
    • CanUpgradeTo, bool, iUpgradeUnitType, bTestVisible
    • CanUpgradeInTerritory, bool, bTestVisible
    • CreateGreatWork, bool
    • EndTrader, void
    • ExtraFeatureDamage, bool
    • ExtraTerrainDamage, bool
    • GetCombatBonusImprovement, int
    • GetExtraReconRange, int
    • GetNearbyImprovementBonusRange, int
    • GetNearbyImprovementCombatBonus, int
    • GetUnitPromotionType, int
    • GetTradeRouteIndex, int
    • HasPromotion, bool, iPromotionType
    • IgnoreFeatureDamage, bool
    • IgnoreTerrainDamage, bool
    • IsAdjacentToFeature, bool, iFeatureType
    • IsAdjacentToImprovement, bool, iImprovementType
    • IsAdjacentToPlotType, bool, iPlotType
    • IsAdjacentToResource, bool, iResourceType
    • IsAdjacentToTerrain, bool, iTerrainType
    • IsCivilization, bool, iCivilizationType
    • IsWithinDistanceOfResource, bool, iResourceType, iDistance
    • IsFeatureHalfMove, bool, iFeatureType
    • IsHoveringUnit, bool
    • IsOnFeature, bool, iFeatureType
    • IsOnImprovement, bool, iImprovementType
    • IsOnPlotType, bool, iPlotType
    • IsOnResource, bool, iResourceType
    • IsOnTerrain, bool, iTerrainType
    • IsRecalledTrader, bool
    • IsTerrainHalfMove, bool, iTerrainType
    • IsUnit, bool, iUnitType
    • IsUnitClass, bool, iUnitClassType
    • IsWithinDistanceOfFeature, bool, iFeatureType, iDistance
    • IsWithinDistanceOfImprovement, bool, iImprovementType, iDistance
    • IsWithinDistanceOfPlotType, bool, iPlotType, iDistance
    • IsWithinDistanceOfTerrain, bool, iTerrainType, iDistance
    • RebaseAt, void, iPlotX, iPlotY
    • RecallTrader, void, bImmediate
    • PlunderTradeRoute, bool
    • SetActivityType, void, iActivityType, bClearFortify
    • SetConversionStrength, void, iStrength
    • SetReligion, void, iReligion
    • SetSpreadsLeft, void, iSpreads
    • Upgrade, pUnit, bIsFree
    • UpgradeTo, pUnit, iUpgradeUnitType, bIsFree



    In addition, I would say "IsWithinDistanceOfCity, bool, iCity, iDistance" would be useful for Unit and Plot (maybe even City, though I can't think of how atm). I've used a roundabout method in Lua to check this before, so I imagine others would find use in it too.
     
  8. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    Another two suggestions:

    pPlayer:HasAnyHolyCity()
    Player:HasHolyCity(eReligion, bFounder)

    The first parameter would be the religion you're checking for, and the second would be for if it should only return true if you are the founder of the religion in the first parameter.
     
  9. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    I'm all for adding API short-hands (as they cost nothing but the time to implement them), can I just double check the functionality

    Code:
    function HasAnyHolyCity(pPlayer)
      for pCity in pPlayer:Cities() do
        if (pCity:IsHolyCityAnyReligion()) then
          return true
        end
      end
      
      return false
    end
    
    Code:
    function HasHolyCity(pPlayer, iReligion, bFounder)
      local pHolyCity = Game.GetHolyCityForReligion(iReligion, -1)
      
      return (pHolyCity and pHolyCity:GetOwner() == pPlayer:GetID())
    end
    
    Unsure as to what bFounder would be used for
     
  10. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    I just wondered if it would be possible to condense this kind of condition:

    Code:
    if player:HasHolyCity(iReligion) and (not) player:GetReligionCreatedByPlayer(iReligion) then
    To check if the player owns a holy city that they didn't create, for instance. However, that might be a superfluous thing to ask. Otherwise, everything looks exactly as I intended.

    I also noticed there is no way to check if a player has an embassy with another player. Like with checking if a player is at war, it's just down to teams. I don't know if it would be redundant, but perhaps, akin to pPlayer:IsAtWarWith(iPlayer), you could add:

    pPlayer:HasEmbassyWith(iPlayer)
     
  11. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    The problem with the bFounder parameter (as I see it), is that it needs to represent three states

    Do I have the holy city for Xyz and
    1. I don't care who founded that religion
    2. I founded that religion
    3. I didn't found that religion
     
  12. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    Slight issue in that a civ/leader can have more than one trait. Presumably this is to avoid the ugly/complex database joins Civilizations -> Leaders -> Traits

    pPlayer:HasTrait(iTrait) would be easy to implement, but not sure it get you any benefit over the database joins
     
  13. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    Yes, it would be to avoid that, but if it's simply not possible, then the current means to retrieving that information will suffice.

    That's interesting that a leader can have more than one trait; I may experiment with this as it might be of some use to me, such as in assigning secondary traits to groups of leaders. With this in mind, pPlayer:HasTrait(iTrait) would certainly be of use.

    Ah, and to my surprise, the UI accommodates secondary traits without complaint. This is quite a useful discovery. Thank you.
     
  14. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    Would it be possible for you to add to the PlayerCanFoundReligion event the parameter of iReligion? To allow one to block off particular religions from being chosen by a player.
     
  15. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    Short answer: no.

    Longer answer: the event isn't asking "can the player found a specific religion" but "can the player found any religion in the city" (ie can that city become a holy city). At the point the event is being called, no religion has been chosen - either by the AI or a human player.

    You can use the GetReligionToFound event to control the AI, but the way the UI is coded no events are triggered by it (it doesn't loop the religions and "ask" if each is available, but it loops the majors and builds a list of what, if any, religion they have founded, and then filters the list of all religions based on the taken list)
     
  16. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,131
    Location:
    The Kingdom of New Zealand
    Okay, thanks for the information. I can make the necessary adjustments to the UI, and I presume GetReligionToFound just overrides the decision that the AI would otherwise make.
     
  17. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,357
    Gender:
    Male
    Location:
    Little Rock
    Other additions to the list:

    Player:

    GetJerk(int) (returns the CS 'forced peace' duration if you attack a CS without provocation)

    GetNumDenouncements(int) (returns number of denouncements of other civs by player)

    GetNumDenouncementsofPlayer(int) (returns number of denouncements of player by other civs)

    I'll have more once I toss relevant functions to the lua grinder.
    G
     
  18. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    Please go easy on my question, but, are these hooks also present in your DLL (Various Mod Components)?
     
  19. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,587
    Location:
    Near Portsmouth, UK
    All but the three in post #17
     
  20. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559

Share This Page