These forums are in read-only mode. Please see this news post for more information.
New forums can be found here
|Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding].|
Join Date: Nov 2010
How do I figure out what size raid group I am in?
Alright, I'm in a forming raid group and there GetNumRaidMembers() returns 7.
How do I know if that's 7/10, 7/25 or even possibly 7/40?
I see no way to get the M part of n/M where n is how many members are now present, but M is what "Raid Difficulty" is set to under the leaders drop down menu.
Surely this should be easy, but I'm missing it completely.
Thanks for any help,
Seal Cub Clubbing Club
Join Date: May 2005
Re: How do I figure out what size raid group I am in?
GetInstanceInfo will only work if you're already inside the target instance.
To get the currently selected raid difficulty before you enter the instance, use GetRaidDifficulty (return values match passable parameters for SetRaidDifficulty). You may also wish to check whether you are in a battleground or outdoor combat zone (usually treated as a 40-player raid), a battleground, etc. Here is the relevant code from Grid that determines which group type the player is currently in:
local function GetPartyState() local _, instance_type = IsInInstance() if instance_type == "arena" then return "arena" end if instance_type == "pvp" then return "bg" end if GetNumRaidMembers() > 0 then if instance_type == "none" and GetZonePVPInfo() == "combat" then return "bg" end if instance_type == "raid" then local _, _, _, _, max_players = GetInstanceInfo() return max_players > 10 and "raid_25" or "raid_10" else local raid_difficulty = GetRaidDifficulty() return (raid_difficulty == 2 or raid_difficulty == 4) and "raid_25" or "raid_10" end end if GetNumPartyMembers() > 0 then return "party" end return "solo" end
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
All times are GMT. The time now is 03:29 PM.