Addon Help - Getting Arena Team Information During Match
Currently I am creating an addon and I am trying to figure out how to get the opposing arena teams information in the middle of the match. I know that I can get their information at the end of the match when UPDATE_BATTLEFIELD_STATUS fires and you can get the information from the scoreboard, but that is not my issue. My issue is when a player leaves the arena, and that event/scoreboard is never seen. I know I can get the names of the enemy arena player during the match, but is there any way to get the team name as well?
Unfortunately that works similar to the other event and the information is not available to me until after the arena has ended and you have seen the scoreboard. That is fine, though, as I will most likely just ignore the Arena Team Name. I am having an issue with another function they seemed to have changed, though.
status, mapName, instanceID, lowestlevel, highestlevel, teamSize, registeredMatch = GetBattlefieldStatus(i); Does not seem to be returning the values for teamSize anymore. I looked into the BattlegroundTargets code and when he uses this function he only uses status, mapName = GetBattlefieldStatus(i). I am assuming they removed the other returns on the function, but if anyone has recently used this function and got the teamSize return to work I'd love to know.
It is returning values in arenas, it is just not returning teamSize anymore. Maybe my code was off as I moved away from GetBattlefieldStatus soon after my posts last night, but I was running the event to GetBattlefieldStatus off of UPDATE_WORLD_STATE, UPDATE_BATTLEFIELD_STATUS, and ARENA_OPPONENT_UPDATE and every time it ran the function it would return nil for everything but status, mapName, and one other value (which returned 0 every time). I found a work around, but was confused as to why this wasn't working.
Instead of trying to get the team size of the other team I use the ARENA_OPPONENT_UPDATE event to gather the other enemies team every single time they have an update. However, I put in if-statements so if the player is "Unknown" (which it returns when a player is stealthed) then it won't bother attaching that name to a variable. Then when I want to create a new class I just check to see how many arena opponents I've gathered. If arena4 and arena are empty but arena1-3 aren't then it is a 3's team, if arena3-5 are empty but arena1-2 aren't then it's a 2's team. More code but works nonetheless.
Hmm, I'll have to check that out. I'd assume it returns "Unknown" just like the others if it is a stealth player though. I know back in Burning Crusade there were addons that allowed you to figure out the names of your opponents during the prep area, so I assume they removed all types of detection through API to prevent that. Probably a bit outdated now that they allow you to see class/spec before the gates even open, though.