<?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%3AGameData.GetScenarioPlayerGroups</id>
	<title>API:GameData.GetScenarioPlayerGroups - 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%3AGameData.GetScenarioPlayerGroups"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GameData.GetScenarioPlayerGroups&amp;action=history"/>
	<updated>2026-10-17T15:22:05Z</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:GameData.GetScenarioPlayerGroups&amp;diff=30307&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:GameData.GetScenarioPlayerGroups&amp;diff=30307&amp;oldid=prev"/>
		<updated>2026-10-16T19:42:30Z</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=Scenario}}&lt;br /&gt;
Returns the players of the local player&amp;#039;s realm in the current scenario (or city siege instance), with their scenario group slot and status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
players = GameData.GetScenarioPlayerGroups()&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;
;players : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of player tables, indexed from 1, or nothing if the client has no scenario data.&lt;br /&gt;
&lt;br /&gt;
Each player 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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Character name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;career&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Career name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;careerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Career id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rank&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Character rank.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sgroupindex&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Scenario group the player is in. The stock UI treats &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; as &amp;quot;not in a group&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sgroupslotnum&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Slot within that scenario group.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;health&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Health percentage.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ap&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Action point percentage.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;morale&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;isMainAssist&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for the player the client has stored as the local player&amp;#039;s main assist (see [[API:IsPlayerMainAssist|IsPlayerMainAssist]]).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Only players whose realm matches the local player&amp;#039;s realm are listed. If there is no player object, every entry is listed.&lt;br /&gt;
* Unlike [[API:GameData.GetScenarioPlayers|GameData.GetScenarioPlayers]] there is no &amp;lt;code&amp;gt;realm&amp;lt;/code&amp;gt; field and no stats.&lt;br /&gt;
* When &amp;lt;code&amp;gt;GameData.Player.isInSiege&amp;lt;/code&amp;gt; is true the client reads the city instance&amp;#039;s list; otherwise it reads the scenario&amp;#039;s list. If that list does not exist, the function returns nothing.&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_scenariogroupwindow/source/scenariogroupwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ScenarioGroupWindow.playerGroupData = GameData.GetScenarioPlayerGroups()&lt;br /&gt;
...&lt;br /&gt;
if( player.sgroupindex &amp;gt; 0 ) then&lt;br /&gt;
    local groupIndex = player.sgroupindex&lt;br /&gt;
    local groupSlotNum = player.sgroupslotnum&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GameData.GetScenarioGroupReservations|GameData.GetScenarioGroupReservations]]&lt;br /&gt;
* [[API:JoinScenarioGroup|JoinScenarioGroup]]&lt;br /&gt;
* [[API:LeaveScenarioGroup|LeaveScenarioGroup]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>