<?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%3ASetPlayerVariation</id>
	<title>API:SetPlayerVariation - 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%3ASetPlayerVariation"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SetPlayerVariation&amp;action=history"/>
	<updated>2026-10-17T17:53:55Z</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:SetPlayerVariation&amp;diff=30734&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:SetPlayerVariation&amp;diff=30734&amp;oldid=prev"/>
		<updated>2026-10-16T19:49:15Z</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=Appearance}}&lt;br /&gt;
Shows the player character with the appearance that a marketing reward item in the inventory would give, without applying it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetPlayerVariation(slot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Inventory slot of the item, as used to index &amp;lt;code&amp;gt;DataUtils.GetItems()&amp;lt;/code&amp;gt;. The stock UI passes &amp;lt;code&amp;gt;Cursor.Data.SourceSlot&amp;lt;/code&amp;gt; for an item picked up from the inventory.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Nothing happens unless the slot holds an item whose type is &amp;lt;code&amp;gt;GameData.ItemTypes.MARKETING&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The item carries an appearance slot number and a variation value. The client writes that value into the player&amp;#039;s appearance data for that slot (only for slot numbers below 15) and updates the character&amp;#039;s look.&lt;br /&gt;
* This is a local preview only. Nothing is sent to the server. Use [[API:ApplyPlayerVariation|ApplyPlayerVariation]] to apply the item, or [[API:RevertPlayerVariation|RevertPlayerVariation]] to undo the preview.&lt;br /&gt;
* The client remembers the slot and its previous value for [[API:RevertPlayerVariation|RevertPlayerVariation]]. Only one previous value is kept, so a second call replaces it.&lt;br /&gt;
* The function returns nothing if there is no player.&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 not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_characterwindow/source/characterwindow.lua&amp;lt;/code&amp;gt;, when a marketing item is dropped on the character window:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local itemData = DataUtils.GetItems()[Cursor.Data.SourceSlot]&lt;br /&gt;
if( Cursor.Data.Source == Cursor.SOURCE_INVENTORY and itemData.type == GameData.ItemTypes.MARKETING) then&lt;br /&gt;
    local slot = Cursor.Data.SourceSlot&lt;br /&gt;
    CharacterWindow.marketItemData = itemData&lt;br /&gt;
    CharacterWindow.marketItemDataSlot = slot&lt;br /&gt;
    -- ...&lt;br /&gt;
    SetPlayerVariation(slot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:RevertPlayerVariation|RevertPlayerVariation]]&lt;br /&gt;
* [[API:ApplyPlayerVariation|ApplyPlayerVariation]]&lt;br /&gt;
* [[API:GetPlayerVariation|GetPlayerVariation]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>