<?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%3AWindowSetGameActionData</id>
	<title>API:WindowSetGameActionData - 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%3AWindowSetGameActionData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowSetGameActionData&amp;action=history"/>
	<updated>2026-10-18T04:52:46Z</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:WindowSetGameActionData&amp;diff=30896&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:WindowSetGameActionData&amp;diff=30896&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:52Z</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=Window}}&lt;br /&gt;
Attaches a game action, such as targeting a player or using an ability, to a window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetGameActionData(windowName, actionType, actionId, actionText)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window.&lt;br /&gt;
;actionType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The kind of action, a &amp;lt;code&amp;gt;GameData.PlayerActions.*&amp;lt;/code&amp;gt; value. 0 removes the action.&lt;br /&gt;
;actionId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The action&amp;#039;s id, for example an ability id. Use 0 if the action does not need one.&lt;br /&gt;
;actionText : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Text for the action, for example the name of the player to target. Use &amp;lt;code&amp;gt;L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; if not needed. It must be a wide string.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Any action the window already has is removed first. If &amp;lt;code&amp;gt;actionType&amp;lt;/code&amp;gt; is 0, no new action is attached, so &amp;lt;code&amp;gt;WindowSetGameActionData(name, 0, 0, L&amp;quot;&amp;quot;)&amp;lt;/code&amp;gt; clears the window.&lt;br /&gt;
* &amp;lt;code&amp;gt;actionType&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;actionId&amp;lt;/code&amp;gt; are truncated to whole numbers.&lt;br /&gt;
* The stock UI relies on the client to carry out the action when the window is clicked. Its comments say so, for example &amp;#039;&amp;#039;&amp;quot;Targeting is handled by the WindowSetGameActionData() call.&amp;quot;&amp;#039;&amp;#039; in &amp;lt;code&amp;gt;ea_battlegrouphud/source/battlegrouphud.lua&amp;lt;/code&amp;gt;.&lt;br /&gt;
* [[API:WindowGetGameActionData|WindowGetGameActionData]] reads the values back.&lt;br /&gt;
* Passing a plain Lua string as &amp;lt;code&amp;gt;actionText&amp;lt;/code&amp;gt; raises an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
* The &amp;#039;&amp;#039;No window specified&amp;#039;&amp;#039; error exists in the client but cannot be raised: a missing name is replaced by an empty string first, which gives the &amp;#039;&amp;#039;does not exist&amp;#039;&amp;#039; error.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetGameActionData&amp;#039;: Window %s does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetGameActionData&amp;#039;: Window %s is currently locked and may not be modified from lua. ...&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This check never triggers in the current client. See [[API:WindowSetShowing|WindowSetShowing]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Clicking a group member&amp;#039;s row targets that player, from &amp;lt;code&amp;gt;eatemplate_unitframes/source/groupmemberunitframe.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetGameActionData( self:GetName(), GameData.PlayerActions.SET_TARGET, 0, groupMemberName )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting and clearing an action button, from &amp;lt;code&amp;gt;ea_actionbars/source/actionbutton.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetGameActionData (actionName, actionType, actionId, L&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if (actionType == 0 and actionId == 0)&lt;br /&gt;
then&lt;br /&gt;
    WindowSetGameActionData (actionName, 0, 0, L&amp;quot;&amp;quot;)&lt;br /&gt;
    -- ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowSetGameActionTrigger|WindowSetGameActionTrigger]]&lt;br /&gt;
* [[API:WindowGetGameActionData|WindowGetGameActionData]]&lt;br /&gt;
* [[API:WindowIsGameActionLocked|WindowIsGameActionLocked]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>