GetCivilizationType: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
(Created page with "==Description== Returns true if this is a city-state. ==Example== (from Emigration v.2 mod) function GetPlayerName(player) if player:IsMinorCiv() then local minorCivTyp...")
 
No edit summary
 
Line 1: Line 1:
==Description==
==Description==
Returns true if this is a city-state.
Returns a civilization type value for a major civ player.
==Example==
==Example==
(from Emigration v.2 mod)
(from Emigration v.2 mod)

Latest revision as of 04:41, 17 February 2012

Description

Returns a civilization type value for a major civ player.

Example

(from Emigration v.2 mod)

 function GetPlayerName(player)	
 	if player:IsMinorCiv() then
 		local minorCivType = player:GetMinorCivType();
 		local minorCivInfo = GameInfo.MinorCivilizations[minorCivType];
 		return Locale.ConvertTextKey(minorCivInfo.Description);
 	end
 	local iCivType = player:GetCivilizationType();
 	local civInfo = GameInfo.Civilizations[iCivType];			
 	return Locale.ConvertTextKey(civInfo.Description);	
 end