Thread Tools Display Modes
12/03/15, 04:54 PM   #1
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Non-functional Campaign Functions

Why do functions like GetCampaignAllianceScore(campaignId, alliance) and GetTotalCampaignHoldings(campaignId, holdingType, alliance) not work for any campaign other than your Home Campaign?
  Reply With Quote
12/04/15, 07:25 AM   #2
LoveMusique
Join Date: Dec 2015
Posts: 2
I think it's isn't the good function !
  Reply With Quote
12/04/15, 07:26 AM   #3
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Working as intended no ?

leaderboards are only available for your home campaign...

Last edited by Ayantir : 12/04/15 at 07:49 AM.
  Reply With Quote
12/04/15, 05:00 PM   #4
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Originally Posted by Ayantir View Post
Working as intended no ?

leaderboards are only available for your home campaign...
Leaderboards yes, but they are personal to you, and are for your score, so that makes sense. Every campaign also has a score, and that's the global score of the alliance in that campaign, which is dependent on objective control, not AP. I don't see why you can only see the score of your home campaign; the campaign score has nothing to do with the leaderboards.
  Reply With Quote
01/26/16, 05:40 AM   #5
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Has anyone else got any comments on this? Are there any devs that frequent these forums who may be able to help explain the reasoning behind these functions not working?

Here's an example of what I would like to be able to do using GetCampaignAllianceScore(campaignId, alliance) and GetTotalCampaignHoldings(campaignId, holdingType, alliance):

(in this example, ZO_ColorDefs are assumed pre-defined, also assume campaignId for Chillrend is 15 and campaignId for Azura's Star is 12):

Lua Code:
  1. d(GetCampaignName(15))
  2. d(AD_ColorDef:Colorize("Aldmeri Dominion") .. ": " .. GetCampaignAllianceScore(15, ALLIANCE_ALDMERI_DOMINION))
  3. d("Keeps: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_KEEP, ALLIANCE_ALDMERI_DOMINION) .. "Outposts: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_OUTPOST, ALLIANCE_ALDMERI_DOMINION) .. "Resources: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_RESOURCE, ALLIANCE_ALDMERI_DOMINION) .. "Scrolls: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_DEFENSIVE_ARTIFACT, ALLIANCE_ALDMERI_DOMINION) + GetTotalCampaignHoldings(15, HOLDINGTYPE_OFFENSIVE_ARTIFACT, ALLIANCE_ALDMERI_DOMINION))
  4. d(EP_ColorDef:Colorize("Ebonheart Pact") .. ": " .. GetCampaignAllianceScore(15, ALLIANCE_EBONHEART_PACT))
  5. d("Keeps: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_KEEP, ALLIANCE_EBONHEART_PACT) .. "Outposts: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_OUTPOST, ALLIANCE_EBONHEART_PACT) .. "Resources: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_RESOURCE, ALLIANCE_EBONHEART_PACT) .. "Scrolls: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_DEFENSIVE_ARTIFACT, ALLIANCE_EBONHEART_PACT) + GetTotalCampaignHoldings(15, HOLDINGTYPE_OFFENSIVE_ARTIFACT, ALLIANCE_EBONHEART_PACT))
  6. d(DC_ColorDef:Colorize("Daggerfall Covenant") .. ": " .. GetCampaignAllianceScore(15, ALLIANCE_DAGGERFALL_COVENANT))
  7. d("Keeps: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_KEEP, ALLIANCE_DAGGERFALL_COVENANT) .. "Outposts: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_OUTPOST, ALLIANCE_DAGGERFALL_COVENANT) .. "Resources: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_RESOURCE, ALLIANCE_DAGGERFALL_COVENANT) .. "Scrolls: " .. GetTotalCampaignHoldings(15, HOLDINGTYPE_DEFENSIVE_ARTIFACT, ALLIANCE_DAGGERFALL_COVENANT) + GetTotalCampaignHoldings(15, HOLDINGTYPE_OFFENSIVE_ARTIFACT, ALLIANCE_DAGGERFALL_COVENANT))
  8. d("")
  9. d(GetCampaignName(12))
  10. d(AD_ColorDef:Colorize("Aldmeri Dominion") .. ": " .. GetCampaignAllianceScore(12, ALLIANCE_ALDMERI_DOMINION))
  11. d("[...]")
  12. d(DC_ColorDef:Colorize("Daggerfall Covenant") .. ": " .. GetCampaignAllianceScore(12, ALLIANCE_DAGGERFALL_COVENANT))
  13. d("Keeps: " .. GetTotalCampaignHoldings(12, HOLDINGTYPE_KEEP, ALLIANCE_DAGGERFALL_COVENANT) .. "Outposts: " .. GetTotalCampaignHoldings(12, HOLDINGTYPE_OUTPOST, ALLIANCE_DAGGERFALL_COVENANT) .. "Resources: " .. GetTotalCampaignHoldings(12, HOLDINGTYPE_RESOURCE, ALLIANCE_DAGGERFALL_COVENANT) .. "Scrolls: " .. GetTotalCampaignHoldings(12, HOLDINGTYPE_DEFENSIVE_ARTIFACT, ALLIANCE_DAGGERFALL_COVENANT) + GetTotalCampaignHoldings(12, HOLDINGTYPE_OFFENSIVE_ARTIFACT, ALLIANCE_DAGGERFALL_COVENANT))

To give:

Chillrend
Aldmeri Dominion: 434
Keeps: 6; Outposts: 2; Resources: 18; Scrolls: 2
Ebonheart Pact: 232
Keeps: 6; Outposts: 1; Resources: 19; Scrolls: 3
Daggerfall Covenant: 102
Keeps: 6; Outposts: 0; Resources: 17; Scrolls: 1

Azura's Star
Aldmeri Dominion: 1102
[...]
Daggerfall Covenant: 1230
Keeps: 5; Outposts: 1; Resources: 17; Scrolls: 5
  Reply With Quote
01/26/16, 12:22 PM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Those functions only seem to work from inside a campaign.
You might want to use GetNumSelectionCampaigns and GetSelectionCampaignAllianceScore instead to get alliance scores.
I don't think there is a way to get the other information though.
  Reply With Quote
01/26/16, 01:10 PM   #7
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Originally Posted by sirinsidiator View Post
Those functions only seem to work from inside a campaign.
You might want to use GetNumSelectionCampaigns and GetSelectionCampaignAllianceScore instead to get alliance scores.
I don't think there is a way to get the other information though.
Yeah, I came to the same conclusion. They work for the campaign you're in when you're in one, and they work for your home campaign from anywhere, but the question is why don't they work for any campaign anywhere? Or, alternatively (since it's essentially the same question), why is the information they are trying to pull not available outside the campaign?
  Reply With Quote
01/26/16, 02:26 PM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Probably because those functions where not made with the intention to be used outside of the active campaign. If they where to return the values for all campaigns that would mean that the server would need to send the data to all clients all of the time, even when they do not actually need it.
  Reply With Quote
01/26/16, 04:36 PM   #9
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Originally Posted by sirinsidiator View Post
Probably because those functions where not made with the intention to be used outside of the active campaign. If they where to return the values for all campaigns that would mean that the server would need to send the data to all clients all of the time, even when they do not actually need it.
OK so admittedly I don't know how API functions work... does the client not just request the data from the server when the function is actioned?
  Reply With Quote
01/26/16, 05:26 PM   #10
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
If that where the case, every call that requests data internally would stall the UI as it is single threaded.
The functions that do request data from the server are usually split into a query function and an event that receives the result.
  Reply With Quote
01/26/16, 05:46 PM   #11
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Originally Posted by sirinsidiator View Post
If that where the case, every call that requests data internally would stall the UI as it is single threaded.
The functions that do request data from the server are usually split into a query function and an event that receives the result.
Ah okay, so most functions can only read data that's already been sent to the client. I guess "RegisterForAssignedCampaignData()" is one of those query functions, and may be the reason that the two functions in the OP work for your home campaign regardless of where you are?

In that case, I guess I'd like to request from ZOS a query function that will allow these functions to work for all campaigns, let's call it "RegisterForSelectionCampaignData(campaignIndex)".
  Reply With Quote
01/26/16, 06:03 PM   #12
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
That may be right. Some other functions are QueryCampaignSelectionData() and QueryCampaignLeaderboardData().
I suggest you put your request on the wishlist so it does not get lost.
  Reply With Quote
01/26/16, 06:12 PM   #13
Enodoc
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 52
Originally Posted by sirinsidiator View Post
That may be right. Some other functions are QueryCampaignSelectionData() and QueryCampaignLeaderboardData().
I suggest you put your request on the wishlist so it does not get lost.
OK thanks, I'll do that. Out of interest, what do those two functions do?
  Reply With Quote
01/27/16, 05:26 AM   #14
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
As their name says, they query the server for CampaignSelectionData and CampaignLeaderboardData. Before they have been called at least once, the GetSelectionCampaign* and GetCampaignLeaderboard* functions won't return anything.
Once they have been called, the EVENT_CAMPAIGN_SELECTION_DATA_CHANGED and EVENT_CAMPAIGN_LEADERBOARD_DATA_CHANGED will tell you that the data has been received.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Non-functional Campaign Functions


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