Thread Tools Display Modes
12/17/15, 05:10 AM   #1
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Battleground Context

Can someone explain the battleground query context to me better? This is what I found out so far:

Corresponding campaigns:
Code:
Player in AvA Zone (Home)
	BGQUERY_UNKNOWN:            -
	BGQUERY_LOCAL:              Home
	BGQUERY_ASSIGNED_CAMPAIGN:  Home
	BGQUERY_ASSIGNED_AND_LOCAL: Home
	GetCurrentCampaignId():     Home
	
Player in AvA Zone (Guest)
	BGQUERY_UNKNOWN:            -
	BGQUERY_LOCAL:              Guest
	BGQUERY_ASSIGNED_CAMPAIGN:  Guest
	BGQUERY_ASSIGNED_AND_LOCAL: Guest
	GetCurrentCampaignId():     Guest
	
Player in PvE Zone (Map displaying Home)
	BGQUERY_UNKNOWN:            -
	BGQUERY_LOCAL:              -
	BGQUERY_ASSIGNED_CAMPAIGN:  Home
	BGQUERY_ASSIGNED_AND_LOCAL: -
	GetCurrentCampaignId():     -
	
Player in PvE Zone (All keeps white on map)
	BGQUERY_UNKNOWN:            -
	BGQUERY_LOCAL:              -
	BGQUERY_ASSIGNED_CAMPAIGN:  -
	BGQUERY_ASSIGNED_AND_LOCAL: -
	GetCurrentCampaignId():     -
	
Player in PvE Zone (Map displaying no keeps because no home/guest campaign set yet)
	BGQUERY_UNKNOWN:            -
	BGQUERY_LOCAL:              -
	BGQUERY_ASSIGNED_CAMPAIGN:  -
	BGQUERY_ASSIGNED_AND_LOCAL: -
	GetCurrentCampaignId():     -
(Tested with GetKeepAlliance(keepId, bgContext) in API 100013; keepId being a keep that belongs to a different alliance in home/guest campaign, bgContext being the listed BattlegroundQueryContextType number)

So I have 2 (actually 3) concrete questions:
  1. What is BGQUERY_ASSIGNED_AND_LOCAL? It doesn't seem to be different from BGQUERY_LOCAL
  2. When does the map display white keeps (instead of the home campaign), and how can I detect it in lua?

With question 2 I'd like to complete this function:
Lua Code:
  1. -- Get the battleground context that matches the displayed AvA map
  2. local function GetDisplayedBattlegroundContext()
  3.     local bgQuery = BGQUERY_UNKNOWN
  4.     if IsPlayerInAvAWorld() then
  5.         bgQuery = BGQUERY_LOCAL
  6.     elseif false then  -- TODO: Is map displaying white keeps
  7.         bgQuery = BGQUERY_UNKNOWN
  8.     elseif GetAssignedCampaignId() ~= NONE then
  9.         bgQuery = BGQUERY_ASSIGNED_CAMPAIGN
  10.     end
  11.     return bgQuery
  12. end

Last edited by CaptainBlagbird : 12/17/15 at 05:29 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Battleground Context


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off