<?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%3AGetSiegeWeaponControlData</id>
	<title>API:GetSiegeWeaponControlData - 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%3AGetSiegeWeaponControlData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetSiegeWeaponControlData&amp;action=history"/>
	<updated>2026-10-17T16:47:45Z</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:GetSiegeWeaponControlData&amp;diff=30464&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:GetSiegeWeaponControlData&amp;diff=30464&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:59Z</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=RvR}}&lt;br /&gt;
Returns the definition of the siege weapon the client currently has as its active siege weapon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
controlData = GetSiegeWeaponControlData()&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;
;controlData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – A table with one field, &amp;lt;code&amp;gt;weaponDef&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt;), the weapon definition described below.&lt;br /&gt;
&lt;br /&gt;
=== Siege weapon table ===&lt;br /&gt;
The same table format is used for each entry of [[API:GetSiegePadBuildData|GetSiegePadBuildData]].&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;id&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Siege weapon id. [[API:BuildSiegeWeapon|BuildSiegeWeapon]] takes this value.&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; || Weapon name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Weapon level.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;hitPoints&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Hit points.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxBuilders&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Maximum number of players building it. The stock UI uses it as the user limit while the weapon is being built.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxUsers&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Maximum number of players using it.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;buildTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Filled from the same stored value as &amp;lt;code&amp;gt;maxUsers&amp;lt;/code&amp;gt;, see Details.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;repairTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Filled from the same stored value as &amp;lt;code&amp;gt;maxUsers&amp;lt;/code&amp;gt;, see Details.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;decayTime&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;decayPerFire&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;fireMode&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;fireAbility&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || The weapon&amp;#039;s fire ability, in the format of [[API:GetAbilityData#Ability data table|GetAbilityData]]. Only present when there is a player object.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;requiredItems&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of item tables, indexed from 1, in the format of [[API:GetInventoryItemData#Item data table|GetInventoryItemData]]. Empty if no items are needed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Client bug:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;maxUsers&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;buildTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;repairTime&amp;lt;/code&amp;gt; are all filled from the same stored byte, so &amp;lt;code&amp;gt;buildTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;repairTime&amp;lt;/code&amp;gt; always equal &amp;lt;code&amp;gt;maxUsers&amp;lt;/code&amp;gt;. Do not rely on them.&lt;br /&gt;
* The function always returns a table; it does not check whether the player is using a siege weapon. The stock UI treats &amp;lt;code&amp;gt;weaponDef.name == L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as &amp;quot;no weapon&amp;quot; and hides its window.&lt;br /&gt;
* A new table is built on every call.&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_siegeweaponwindow/source/siegeweaponcontrolwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SiegeWeaponControlWindow.controlData = GetSiegeWeaponControlData()&lt;br /&gt;
&lt;br /&gt;
local weaponName = SiegeWeaponControlWindow.controlData.weaponDef.name&lt;br /&gt;
...&lt;br /&gt;
local showWindow = SiegeWeaponControlWindow.controlData.weaponDef.name ~= L&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Picking the user limit, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
maxUsers = SiegeWeaponControlWindow.controlData.weaponDef.maxBuilders&lt;br /&gt;
...&lt;br /&gt;
maxUsers = SiegeWeaponControlWindow.controlData.weaponDef.maxUsers&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetSiegeWeaponUsersData|GetSiegeWeaponUsersData]]&lt;br /&gt;
* [[API:RepairSiegeWeapon|RepairSiegeWeapon]]&lt;br /&gt;
* [[API:GetSiegePadBuildData|GetSiegePadBuildData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>