<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Player.GetUnitByID_%28Civ5_API%29</id>
	<title>Player.GetUnitByID (Civ5 API) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Player.GetUnitByID_%28Civ5_API%29"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Player.GetUnitByID_(Civ5_API)&amp;action=history"/>
	<updated>2026-04-11T05:26:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Player.GetUnitByID_(Civ5_API)&amp;diff=12056&amp;oldid=prev</id>
		<title>DonQuich: Bot update</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Player.GetUnitByID_(Civ5_API)&amp;diff=12056&amp;oldid=prev"/>
		<updated>2012-09-20T08:48:09Z</updated>

		<summary type="html">&lt;p&gt;Bot update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Civ5 API Beta Banner}}&lt;br /&gt;
&amp;#039;&amp;#039;This page is a part of the [[Lua and UI Reference (Civ5)]].&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TypeInfos5|Function.png|This function is a member of {{Type5|Player}}.&amp;lt;br/&amp;gt;&lt;br /&gt;
This is an instance method, invoke it with a colon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&amp;lt;code&amp;gt;{{Type5|Unit}} Player:GetUnitByID&amp;lt;b&amp;gt;(&amp;lt;/b&amp;gt;{{Type5|UnitID}} unit&amp;lt;b&amp;gt;)&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returned Value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:{{Type5|Unit}} object&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|unit:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;unit ID&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Source code samples=&lt;br /&gt;
&amp;#039;&amp;#039;Redundant occurences have been removed.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|BarbarianRansomPopup.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/PopupsGeneric/BarbarianRansomPopup.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0008}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local pUnit = pPlayer:GetUnitByID(iUnitID);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CityBannerManager.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/CityBannerManager.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1142}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local unit = player:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|ConfirmGiftPopup.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/PopupsGeneric/ConfirmGiftPopup.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0017}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;pUnit = pGiftingPlayer:GetUnitByID(iUnitIndex);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua - DLC_02 DLC}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/DLC_02/Scenarios/NewWorldScenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0134}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local unit = player:GetUnitByID(iUnitID);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1023}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;pUnit = Players[iPlayer]:GetUnitByID(iUnitID);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|UnitFlagManager.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/UnitFlagManager.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0078}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local pUnit = Players[ playerID ]:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0306}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local unit = Players[ self.m_PlayerID ]:GetUnitByID( self.m_UnitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0372}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local pUnit = Players[ self.m_PlayerID ]:GetUnitByID( self.m_UnitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0884}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Players[ playerID ]:GetUnitByID( unitID ) == nil or&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0885}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Players[ playerID ]:GetUnitByID( unitID ):IsDead() )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0973}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local thisUnit = Players[ playerID ]:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1578}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local pUnit = pPlayer:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|UnitMemberOverlay.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/UnitMemberOverlay.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0251}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local unit = playerUnitList:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0539}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local unit = playersUnitList:GetUnitByID( unitID );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Civ5 API Footer}}&lt;br /&gt;
[[Category:Civ5 Methods and Functions|GetUnitByID]]&lt;br /&gt;
[[Category:Civ5 Units API|GetUnitByID]]&lt;/div&gt;</summary>
		<author><name>DonQuich</name></author>
	</entry>
</feed>