Thread Tools Display Modes
08-25-21, 12:49 PM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Mananing standing with non-standard factions

Hello,

How could I manage specials factions reputation, those which standing name or reputations not handled by FACTION_STANDING_LABEL, as described here:
https://wowpedia.fandom.com/wiki/StandingId

I currently use GetFactionInfo() to retreive factions standing but results are very strange with non-standard factions.

Thank you.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-25-21, 10:20 PM   #2
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Do you mean 'friendships' with individuals? GetFriendshipReputation()

https://wowpedia.fandom.com/wiki/API...shipReputation
  Reply With Quote
08-26-21, 08:20 AM   #3
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Originally Posted by DahkCeles View Post
Do you mean 'friendships' with individuals? GetFriendshipReputation()

https://wowpedia.fandom.com/wiki/API...shipReputation
Well, I don't understand: GetFriendshipReputation() always returns nil values.

Lua Code:
  1. local numFactions = GetNumFactions()
  2. local factionIndex = 1
  3. while (factionIndex <= numFactions) do
  4.     local name, description, standingId, bottomValue, topValue, earnedValue, atWarWith, canToggleAtWar,
  5.         isHeader, isCollapsed, hasRep, isWatched, isChild, factionID, hasBonusRepGain, canBeLFGBonus = GetFactionInfo(factionIndex)
  6.     if isHeader and isCollapsed then
  7.         ExpandFactionHeader(factionIndex)
  8.         numFactions = GetNumFactions()
  9.     end
  10.     if hasRep or not isHeader then
  11.         DEFAULT_CHAT_FRAME:AddMessage("Faction: " .. name .. " - " .. earnedValue)
  12.         local friendID, friendRep, friendMaxRep, friendName, _, _, friendTextLevel, friendThreshold, nextFriendThreshold = GetFriendshipReputation(factionID)
  13.         print(friendID, friendRep) -- ------> NIL
  14.     end
  15.     factionIndex = factionIndex + 1
  16. end

What I would like to do is just to have correct values from GetFactionInfo() with some specials factions like Venari for instance.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-26-21, 11:37 AM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
When are you running the above code?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-26-21, 12:36 PM   #5
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Normally at LOGIN event.
For testing purpose, I ran the script manually (long time after LOGIN) with the same NIL result.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-31-21, 12:26 AM   #6
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by Zax View Post
Normally at LOGIN event.
For testing purpose, I ran the script manually (long time after LOGIN) with the same NIL result.

Even on a fresh login GetFriendshipReputation() returns valid information for me, without waiting for any events
Lua Code:
  1. local info = {GetFriendshipReputation(1273)}
  2. DevTools_Dump(info)
  Reply With Quote
09-01-21, 08:13 AM   #7
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
GetFriendshipReputation(47) - Stormwind - returns nil, so it seems this function only returns values for "non-standard" factions standing.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
09-02-21, 02:15 AM   #8
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by Zax View Post
GetFriendshipReputation(47) - Stormwind - returns nil, so it seems this function only returns values for "non-standard" factions standing.

That's exactly what DahkCeles is saying.

Originally Posted by DahkCeles View Post
Do you mean 'friendships' with individuals? GetFriendshipReputation()

https://wowpedia.fandom.com/wiki/API...shipReputation
  Reply With Quote
09-02-21, 02:18 AM   #9
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by Zax View Post
I currently use GetFactionInfo() to retreive factions standing but results are very strange with non-standard factions.

Can you elaborate? What in particular is strange about the results?

This looks fine to me.
Lua Code:
  1. for i = 1, GetNumFactions() do
  2.     print(GetFactionInfo(i))
  3. end
Lua Code:
  1. "The Tillers", "The Tillers are peaceful and productive pandaren, working with the land to feed the massive appetites of their people.", 8, 42000, 42000, 42000, false, false, true, false, true, false, true, 1272, false
  2. "Chee Chee", "If you've ever had a question about sheep, Chee Chee will know the answer.", 1, 0, 8400, 2200, false, false, false, false, false, false, true, 1277, false

Last edited by Ketho : 09-02-21 at 02:21 AM.
  Reply With Quote
09-02-21, 06:37 AM   #10
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Originally Posted by Ketho View Post
Can you elaborate? What in particular is strange about the results?
For some factions, like Venari, standingID returned value by GetFactionInfo() doesn't match with FACTION_STANDING_LABEL, as described here:
https://wowpedia.fandom.com/wiki/StandingId

So I now understand these factions have to managed with GetFriendshipReputation(), as DahkCeles said.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
09-03-21, 07:36 AM   #11
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
If I understand the question correctly, FACTION_STANDING_LABEL_n is a 0-8 table. While the names are "Unknown" through "Exalted", the 0-8 should map to friendship levels, even if the text isn't the same. In Ve'nari's case, there should be 9 (0-8) friendship levels, just as Chromie or Jogu the Drunk.

If you want the correct text, because "Unknown" through "Exalted" aren't applicable, you'll need the seventh return of GetFriendShipLevel().

AFAIK, all "friends" have the same 9 faction levels to be compatible with FACTION_STANDING_LABEL_n.

You can also look into https://wowpedia.fandom.com/wiki/API...eputationRanks
  Reply With Quote
09-03-21, 08:22 AM   #12
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Oops, I had told you some incorrect information. Friendships do not have 9 levels; that wouldn't make sense. They have between 6 and 8 ranks of "standingID" just to be confusing.

The "standingID" of friends should map to FACTION_BAR_COLORS, which is what I was thinking about in my first post. Not all the values of FACTION_BAR_COLORS will work obviously.

Update: Blizzard always defines friends as colour index 5, which is green, or FACTION_BAR_COLORS[5]. Look at lines 51-77 of https://www.townlong-yak.com/framexm...utationBar.lua

Last edited by myrroddin : 09-03-21 at 08:26 AM. Reason: how Blizzard defines friendship colours
  Reply With Quote
09-03-21, 01:16 PM   #13
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Originally Posted by myrroddin View Post
If I understand the question correctly, FACTION_STANDING_LABEL_n is a 0-8 table. While the names are "Unknown" through "Exalted", the 0-8 should map to friendship levels, even if the text isn't the same. In Ve'nari's case, there should be 9 (0-8) friendship levels, just as Chromie or Jogu the Drunk.

If you want the correct text, because "Unknown" through "Exalted" aren't applicable, you'll need the seventh return of GetFriendShipLevel().
That's right.

And thank you myrroddin for all these informations. Handling the reputations is not very convenient at this time.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Mananing standing with non-standard factions

Thread Tools
Display Modes

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