Home › Lua API › PlayerStats

Available out of the box. Usable from Lua in the unmodified game.

PlayerStats

26 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: PlayerStats (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
ChangeScienceVictoryPoints PlayerStats:ChangeScienceVictoryPoints(xDelta: number) (or nothing) gameplay yes ↗ 0x745b40 0x7463e0
GetDiplomaticVictoryPoints PlayerStats:GetDiplomaticVictoryPoints() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x742210 0x742b50
GetDiplomaticVictoryPointsTooltip PlayerStats:GetDiplomaticVictoryPointsTooltip() → nil
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x742280 0x742bc0
GetHasRevivedPlayer PlayerStats:GetHasRevivedPlayer(otherPlayer: integer[PlayerTypes]) → boolean
args: otherPlayer — Id of a player (as in Players[id]).
✓ exists at runtime (not called)
ui-cache yes ↗ 0x742370 0x742cb0
GetMilitaryStrength PlayerStats:GetMilitaryStrength() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b4550 0x6b4aa0
GetMilitaryStrengthWithoutTreasury PlayerStats:GetMilitaryStrengthWithoutTreasury() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b45a0 0x6b4af0
GetNumBeliefsInReligion PlayerStats:GetNumBeliefsInReligion() → number gameplay yes ↗ 0x6f5d50 0x6f6490
GetNumBuildingsOfType PlayerStats:GetNumBuildingsOfType(eBuilding: integer[BuildingTypes]) → number
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b45f0 0x6b4b40
GetNumCitiesFollowingReligion UI state: PlayerStats:GetNumCitiesFollowingReligion() → number
gameplay state: PlayerStats:GetNumCitiesFollowingReligion() → number
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b4660 0x6b4bb0
GetNumCitiesFollowingReligionWithWonder PlayerStats:GetNumCitiesFollowingReligionWithWonder() → number gameplay yes ↗ 0x6f5df0 0x6f6530
GetNumCivicsCompleted PlayerStats:GetNumCivicsCompleted() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b46b0 0x6b4c00
GetNumDistrictsFollowingReligion PlayerStats:GetNumDistrictsFollowingReligion(arg1?: number) → number gameplay yes ↗ 0x6f5e40 0x6f6580
GetNumFollowers PlayerStats:GetNumFollowers() → number gameplay yes ↗ 0x6f5ec0 0x6f6600
GetNumForeignCitiesFollowingReligion PlayerStats:GetNumForeignCitiesFollowingReligion() → number
returns: The scripts pass the result to Player.SetScoringScenario2. (inferred)
gameplay yes ↗ 0x6f5f10 0x6f6650
GetNumForeignFollowers PlayerStats:GetNumForeignFollowers() → number gameplay yes ↗ 0x6f5f60 0x6f66a0
GetNumMyCitiesFollowingSpecificReligion PlayerStats:GetNumMyCitiesFollowingSpecificReligion(eReligion: integer[ReligionTypes]) → number
args: eReligion — Index of a row of the Religions table (the value of GameInfo.Religions[...].Index).
gameplay yes ↗ 0x6f5fb0 0x6f66f0
GetNumProjectsAdvanced PlayerStats:GetNumProjectsAdvanced(eProject: integer[ProjectTypes]) → number
args: eProject — Index of a row of the Projects table (the value of GameInfo.Projects[...].Index).
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b4700 0x6b4c50
GetNumTechsResearched PlayerStats:GetNumTechsResearched() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b4770 0x6b4cc0
GetScienceVictoryPoints PlayerStats:GetScienceVictoryPoints() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x7423d0 0x742d10
GetScienceVictoryPointsPerTurn PlayerStats:GetScienceVictoryPointsPerTurn() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x742440 0x742d80
GetScienceVictoryPointsTotalNeeded PlayerStats:GetScienceVictoryPointsTotalNeeded() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x7424b0 0x742df0
GetTourism PlayerStats:GetTourism() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b47c0 0x6b4d10
GetTourismToolTip PlayerStats:GetTourismToolTip(arg1?: any, arg2?: any) → string
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6b4830 —
UpdateMaxBombardStrengthTrained PlayerStats:UpdateMaxBombardStrengthTrained(iNewUnitStrength: integer) (or nothing) gameplay yes ↗ 0x6f6020 0x6f6760
UpdateMaxMeleeStrengthTrained PlayerStats:UpdateMaxMeleeStrengthTrained(iNewUnitStrength: integer) (or nothing) gameplay yes ↗ 0x6f6070 0x6f67b0
UpdateMaxRangedStrengthTrained PlayerStats:UpdateMaxRangedStrengthTrained(iNewUnitStrength: integer) (or nothing) gameplay yes ↗ 0x6f60c0 0x6f6800