<?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%3AGetLocationsForTrophies</id>
	<title>API:GetLocationsForTrophies - 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%3AGetLocationsForTrophies"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetLocationsForTrophies&amp;action=history"/>
	<updated>2026-10-17T13:13:30Z</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:GetLocationsForTrophies&amp;diff=30424&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:GetLocationsForTrophies&amp;diff=30424&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:22Z</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=Item}}&lt;br /&gt;
Returns the points on the player&amp;#039;s character where trophies can be attached.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
attachPoints = GetLocationsForTrophies()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;attachPoints : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of attachment point tables, indexed from 1. May be empty.&lt;br /&gt;
&lt;br /&gt;
Each attachment point table has these fields:&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;trophyLocation&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Location id of the point. Pass it to [[API:AttachTrophyToLocation|AttachTrophyToLocation]] or [[API:RequestEquipTrophy|RequestEquipTrophy]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;trophyLocIndex&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Index of the point within its location, starting at 1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;inventorySlotNum&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Equipment slot the point belongs to: 10 (&amp;lt;code&amp;gt;GameData.EquipSlots.SHOULDERS&amp;lt;/code&amp;gt;) or 14 (&amp;lt;code&amp;gt;GameData.EquipSlots.BELT&amp;lt;/code&amp;gt;), depending on the location.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The list comes from the client&amp;#039;s data for the player&amp;#039;s character model, not from the equipped items.&lt;br /&gt;
* If the client cannot find that data, or there is no player object, the function returns nothing. The stock UI works around this with &amp;lt;code&amp;gt;CharacterWindow.RerequestTrophyLocData()&amp;lt;/code&amp;gt;, which calls the function again when the cached value is &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The stock UI compares &amp;lt;code&amp;gt;inventorySlotNum&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;slots&amp;lt;/code&amp;gt; array of a trophy&amp;#039;s item data to decide whether the trophy may go there. It also adds its own &amp;lt;code&amp;gt;inUse&amp;lt;/code&amp;gt; field to the tables; the client does not set it.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_characterwindow/source/characterwindowtrophies.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CharacterWindow.trophyLocData = GetLocationsForTrophies()   -- provides list of available attachment points&lt;br /&gt;
CharacterWindow.trophyData = DataUtils.GetTrophyData()      -- provides item info for all trophy slots (may be blank data)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finding an attachment point, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for apIndex, attachPoint in pairs( CharacterWindow.trophyLocData ) do&lt;br /&gt;
    if attachPoint.trophyLocation == location and attachPoint.trophyLocIndex == index then&lt;br /&gt;
        return apIndex, attachPoint&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetTrophyData|GetTrophyData]]&lt;br /&gt;
* [[API:AttachTrophyToLocation|AttachTrophyToLocation]]&lt;br /&gt;
* [[API:RequestEquipTrophy|RequestEquipTrophy]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>