<?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%3AInteractGetBaseInteractionData</id>
	<title>API:InteractGetBaseInteractionData - 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%3AInteractGetBaseInteractionData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:InteractGetBaseInteractionData&amp;action=history"/>
	<updated>2026-10-17T14:22:03Z</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:InteractGetBaseInteractionData&amp;diff=30511&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:InteractGetBaseInteractionData&amp;diff=30511&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:43Z</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=Interact}}&lt;br /&gt;
Returns the main menu of the NPC or object the player is interacting with: its name, greeting text, interaction options and quests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
menuData = InteractGetBaseInteractionData(interactionId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;interactionId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the current interaction, as passed to handlers of &amp;lt;code&amp;gt;SystemData.Events.INTERACT_DEFAULT&amp;lt;/code&amp;gt;. Only its low 16 bits are compared.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;menuData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – The menu, or nothing if &amp;lt;code&amp;gt;interactionId&amp;lt;/code&amp;gt; does not match the current interaction.&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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the interaction target.&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; || Greeting text.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;options&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of option tables (see below).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;quests&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of quest tables (see below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each table in &amp;lt;code&amp;gt;options&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;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Interaction type, compared by the stock UI with &amp;lt;code&amp;gt;GameData.InteractType&amp;lt;/code&amp;gt; values. Pass it to [[API:InteractSelect|InteractSelect]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;trainType&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Only on options with &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 0: the trainer type, one of 1, 2, 4, 8 or 16. The stock UI compares it with &amp;lt;code&amp;gt;GameData.InteractTrainerType&amp;lt;/code&amp;gt; values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each table in &amp;lt;code&amp;gt;quests&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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Quest name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Always &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;. Pass it to [[API:InteractSelect|InteractSelect]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;completion&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Quest state; the stock UI compares it with &amp;lt;code&amp;gt;GameData.QuestCompletion.OFFER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;REPEATABLE_OFFER&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PENDING&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Position of the quest in the list, starting at 0. Pass it as the third argument of [[API:InteractSelect|InteractSelect]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The options list is built from the target&amp;#039;s interaction flags, types 0 to 23. Type 6 never appears in &amp;lt;code&amp;gt;options&amp;lt;/code&amp;gt;; quests are listed in &amp;lt;code&amp;gt;quests&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
* A trainer can offer several trainer types. Each one gets its own option with &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 0 and a different &amp;lt;code&amp;gt;trainType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The stock UI treats a &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; result as &amp;quot;nothing to show&amp;quot; and closes the window.&lt;br /&gt;
* The function needs at least one argument and only reads the last one.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when the argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_interactionwindow/source/interactionbase.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local menuData = InteractGetBaseInteractionData( interactionTargetID )&lt;br /&gt;
&lt;br /&gt;
if (menuData == nil)&lt;br /&gt;
then&lt;br /&gt;
    EA_Window_InteractionBase.Done()&lt;br /&gt;
    return&lt;br /&gt;
else&lt;br /&gt;
    LabelSetText( &amp;quot;EA_Window_InteractionBaseTargetName&amp;quot;,    menuData.name )&lt;br /&gt;
    LabelSetText( &amp;quot;EA_Window_InteractionBaseText&amp;quot;,          menuData.text )&lt;br /&gt;
    &lt;br /&gt;
    EA_Window_InteractionBase.optionListData = menuData.options&lt;br /&gt;
    EA_Window_InteractionBase.questListData  = menuData.quests&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:InteractSelect|InteractSelect]]&lt;br /&gt;
* [[API:GetDesiredInteractAction|GetDesiredInteractAction]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>