Lua Game Objects/Player: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Up: [[Lua Game Objects]]
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==
==Player Info==
===Self===
===Self===
*[[GetCivilizationType]]
*[[GetCivilizationType]]() - returns a civilization type value for a major civ player.
*[[GetID]]
*[[GetID]]
*[[GetLeaderType]]
*[[GetLeaderType]]
Line 15: Line 18:
*[[IsEverAlive]]
*[[IsEverAlive]]
*[[IsHuman]]
*[[IsHuman]]
*[[IsMinorCiv]]() - returns true if this is a ciy-state.
*[[IsPlayable]]
*[[IsPlayable]]
*[[SetPersonalityType]]
*[[SetPersonalityType]]
*[[SetPlayable]]
*[[SetPlayable]]
===Misc===
===Misc===
*[[CalculateTotalYield]](eYield)
*[[GetCurrentEra]]
*[[GetCurrentEra]]
*[[GetTotalTimePlayed]]
*[[GetTotalTimePlayed]]
*[[GetWorkerSpeedModifier]]
*[[IsFoundedFirstCity]]
*[[IsFoundedFirstCity]]
*[[IsHasLostCapital]]
*[[IsHasLostCapital]]
===Modifiers/Yields===
===Yields===
*[[CalculateTotalYield]](eYield)
*[[GetExtraYieldThreshold]](YieldTypes eIndex)
*[[GetExtraYieldThreshold]](YieldTypes eIndex)
*[[GetSpecialistExtraYield]]
*[[GetSpecialistExtraYield]]
*[[GetWorkerSpeedModifier]]
*[[GetYieldRateModifier]](YieldTypes eIndex)
*[[GetYieldRateModifier]](YieldTypes eIndex)
*[[SpecialistYield]](eSpecialist, eYield)
*[[SpecialistYield]](eSpecialist, eYield)
Line 77: Line 81:
*[[GetMinorCivScienceFriendshipBonus]]
*[[GetMinorCivScienceFriendshipBonus]]
*[[GetMinorCivTrait]]
*[[GetMinorCivTrait]]
*[[GetMinorCivType]]
*[[GetMinorCivType]]() - returns a civilization type value for a city-state civ player.
*[[GetMinorWarQuestWithMajorRemainingCount]]
*[[GetMinorWarQuestWithMajorRemainingCount]]
*[[GetNumMinorCivsMet]]
*[[GetNumMinorCivsMet]]
Line 86: Line 90:
*[[IsAllies]]
*[[IsAllies]]
*[[IsFriends]]
*[[IsFriends]]
*[[IsMinorCiv]]
*[[IsMinorCiv]]() - returns true if this is a city-state.
*[[IsMinorCivRouteEstablishedWithMajor]]
*[[IsMinorCivRouteEstablishedWithMajor]]
*[[IsMinorCivUnitSpawningDisabled]]
*[[IsMinorCivUnitSpawningDisabled]]
Line 375: Line 379:
*[[GetNumPolicyBranchesUnlocked]]
*[[GetNumPolicyBranchesUnlocked]]
*[[GetPolicyBranchChosen]]
*[[GetPolicyBranchChosen]]
*[[HasPolicy]]
*[[HasPolicy]](policyID) - returns true if a player has a specified policy.
*[[IsPolicyBlocked]]
*[[IsPolicyBlocked]]
*[[IsPolicyBranchBlocked]]
*[[IsPolicyBranchBlocked]]
Line 382: Line 386:
===Set===
===Set===
*[[DoAdoptPolicy]]
*[[DoAdoptPolicy]]
*[[SetHasPolicy]]
*[[SetHasPolicy]](policyID, bNewValue) - sets player having a specified policy. Increases next policy cost.
*[[SetNumFreePolicies]]
*[[SetNumFreePolicies]]
*[[SetPolicyBranchUnlocked]]
*[[SetPolicyBranchUnlocked]]
Line 390: Line 394:
*[[GetCapitalUnhappinessMod]]
*[[GetCapitalUnhappinessMod]]
*[[GetCityCountUnhappinessMod]]
*[[GetCityCountUnhappinessMod]]
*[[GetExcessHappiness]]
*[[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]]
*[[GetExtraHappinessPerCity]]
*[[GetExtraHappinessPerLuxury]]
*[[GetExtraHappinessPerLuxury]]
Line 493: Line 497:
*[[GetImprovementUpgradeRateModifier]]
*[[GetImprovementUpgradeRateModifier]]
*[[GetUnimprovedAvailableLuxuryResource]]
*[[GetUnimprovedAvailableLuxuryResource]]
*[[GetWorkerSpeedModifier]]
*[[IsAnyPlotImproved]]
*[[IsAnyPlotImproved]]


Line 619: Line 624:
*[[IsVotingMember]]
*[[IsVotingMember]]
*[[SetLoyalMember]]
*[[SetLoyalMember]]
List on the official wiki: http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/Player (parameters are listed for many methods).





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)