<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATomeGetCardData</id>
	<title>API:TomeGetCardData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATomeGetCardData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TomeGetCardData&amp;action=history"/>
	<updated>2026-10-17T22:57:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:TomeGetCardData&amp;diff=30801&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TomeGetCardData&amp;diff=30801&amp;oldid=prev"/>
		<updated>2026-10-16T19:50:20Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Tome}}&lt;br /&gt;
Returns the data of a Tome of Knowledge card, including where it is unlocked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cardData = TomeGetCardData(cardId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;cardId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Card id, for example the &amp;lt;code&amp;gt;cardId&amp;lt;/code&amp;gt; field of entries from [[API:TomeGetAchievementsSubTypeData|TomeGetAchievementsSubTypeData]] or [[API:TomeGetCardList|TomeGetCardList]].&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;cardData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – The card&amp;#039;s data. For an unknown id an error is logged and an empty table is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;cardId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Card id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;valueName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the card&amp;#039;s value. &amp;lt;code&amp;gt;L&amp;quot;???&amp;quot;&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suitName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the card&amp;#039;s suit. &amp;lt;code&amp;gt;L&amp;quot;???&amp;quot;&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;iconNum&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Icon id for [[API:GetIconData|GetIconData]]. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suit&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Suit number. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Value number. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rarity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Rarity number. &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for a locked card.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;unlockInfo&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Where the card is unlocked (see below). Filled for locked cards too.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Fields of &amp;lt;code&amp;gt;unlockInfo&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Tome section of the unlocking entry, a &amp;lt;code&amp;gt;GameData.Tome.SECTION_*&amp;lt;/code&amp;gt; value; &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if none.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;entry&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the unlocking entry in that section; &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if none.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the unlocking entry.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The stock UI opens the Tome at &amp;lt;code&amp;gt;unlockInfo.section&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;unlockInfo.entry&amp;lt;/code&amp;gt; when a card is clicked, unless both are &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Exactly one argument must be passed.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
Written to the UI log; the function still returns a table.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;TomeGetCardData&amp;#039;: %d is not a valid card id.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_tomeofknowledge/source/tomewindow_rewards.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cardData = TomeGetCardData( cardId )&lt;br /&gt;
...&lt;br /&gt;
if( cardData.unlockInfo.section == 0 and cardData.unlockInfo.entry == 0 ) then&lt;br /&gt;
    ...&lt;br /&gt;
TomeWindow.OpenTomeToEntry( cardData.unlockInfo.section, cardData.unlockInfo.entry )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_tomeofknowledge/source/tomewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local texture, x, y = GetIconData( cardData.iconNum )&lt;br /&gt;
...&lt;br /&gt;
local cardName = GetFormatStringFromTable( &amp;quot;Default&amp;quot;, StringTables.Default.TEXT_CARD_NAME, { cardData.valueName, cardData.suitName } )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:TomeGetCardList|TomeGetCardList]]&lt;br /&gt;
* [[API:TomeGetAchievementsSubTypeData|TomeGetAchievementsSubTypeData]]&lt;br /&gt;
* [[API:TomeGetBestiarySpeciesData|TomeGetBestiarySpeciesData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>