Player.GetScore (Civ5 API)

From Civilization Modding Wiki
Jump to: navigation, search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Player.

This is an instance method, invoke it with a colon.


Usage

int Player:GetScore(bool arg0 = nil, bool winner = nil)


Returned Value

No description available.

Parameters

arg0: No description available.
winner: No description available.


Source code samples

Redundant occurences have been removed.

DiploList.lua

UI/InGame/DiploList.lua
0186
local strMyScore = g_pPlayer:GetScore();
0339
controlTable.Score:SetText( pOtherPlayer:GetScore() );


DiploRelationships.lua

UI/InGame/Popups/DiploRelationships.lua
0193
local strScore = pOtherPlayer:GetScore();


MPList.lua

UI/InGame/WorldView/MPList.lua
0175
controlTable.Score:SetText( pPlayer:GetScore() );
0176
g_SortTable[ tostring( controlTable.Root ) ] = pPlayer:GetScore();


Ranking.lua

UI/InGame/Popups/Ranking.lua
0023
local pPlayerScore = pPlayer:GetScore(true, bWinner);


TurnsRemaining.lua - DLC_02 DLC

DLC/DLC_02/Scenarios/NewWorldScenario/TurnsRemaining.lua
0018
if (player:GetScore() >= 1000) then
0019
print(string.format("Player %i has won w/ a score of %i", iPlayerLoop, player:GetScore()));


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua
0032
if (player:GetScore() > iHighestScore) then
0033
iHighestScore = player:GetScore();


VictoryProgress.lua

UI/InGame/Popups/VictoryProgress.lua
0184
Controls.Score:SetText(pPlayer:GetScore());
0517
table.sort(sortedPlayerList, function(a, b) return Players[b]:GetScore() < Players[a]:GetScore() end);
0538
controlTable.Score:SetText(pPlayer:GetScore());



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.