Talk:API UnitThreatSituation

From Warcraft Wiki
Jump to navigation Jump to search

The explanation of the return values is remarkably unclear here. Most of this seems to have been cribbed directly from a copyrighted work (which I have a copy of - I came here because the author of that work is unclear and I was hoping for clarification).

To wit:

"Threat information for a pair of units is only returned if the player has threat against the NPC unit in question." - does this mean that ONLY 'player' is allowed as the unit parameter? The sentence following this seems to be saying that you can't test for a pet's aggro by putting the pet in the unit slot (unless the player also has aggro with the same unitmob. If only 'player' is allowed in the unit parm, that needs to be made clear. If this works for UnitThreatSituation('pet', 'target') then the explanatory sentence that follows the sentence I copied here is stunningly unclear - likely a result of just poor technical writing rather than anything else.

The table under "Status" has two columns that are not explained anywhere in the article, even in brief. "Tanking" is a role. "Aggro" is not. What is supposed to be different between the two that there are two columns in that table labeled like this? It's essentially a table with columns for shoe size and sock color when the table is supposed to be describing belt length (so to speak) and at least some text is needed to explain what we're supposed to get from it.

That same table has X and checkmark indicators with no meaning given for what they indicate. Does an X mean that value isn't returned for whatever situation is described by "Aggro" and "Tanking"? That's the first thought I had but the 0 row has X in both the "Aggro" and "Tanking" columns. Since a 0 value can clearly result from this function, that left me unable to decipher the table at all.

If the return values mean different things when Tanking than when NOT Tanking it would be better and certainly more clear to simply have two small tables. Given that it's only 5 rows long, that's not an insane amount of overhead for the page.

The example section SEEMS to be for a Tanking character, but that isn't explicit and there's no parallel example for a non-Tanking character.

Some expansion of this and perhaps some language other than the exact text from the published work (which as I said, is unclear itself) that better explains what the numbers returned MEAN would be very helpful.

If there are return values that differ based on Tanking or not-Tanking, I cannot compare and contrast between them because I do not have a Tanking character to experiment with, nor do I want to create one.Mltco78dhs (talk) 05:04, 3 August 2021 (UTC)

  • I haven't actually tested it with a pet, I indeed just copypasted and referenced that sentence from Wowprogramming.
  • The difference between "aggro" and "tanking" should be already explained in the description column. A player can be highest on threat but there is an apparent delay before the mob actually switches targets to that player. I thought the table with the ❌ and ✔️ would be more visually clear, it otherwise is the same as the description on Wowprogramming.
  • The code example is for any character, unrelated to player class. It should tell the user if they are on the target's or any other threat list.
Anyway I'll gladly invite you to help improve the article.
Ketho (talk) 08:11, 3 August 2021 (UTC)
You can use any UnitId for both parameters. The detail section just explains that you will get a nil return value if unit you are testing for (first parameter) has no (so 0) threat on the mob you are testing on. E.g. if you call UnitThreatSituation(party3, target) and party3 has no threat on your current target, it will return nil. It will also return nil for any pet of that unit (e.g. partypet3) even if that pet already has threat. This is because the API doesn't give you any information for players that haven't generated any threat for that target yet. The use of "player" here refers to a played character, not the unitId player itself. It might be more clear to say "Threat information for a pair of unit and mobUnit is only returned if the unit has threat against the mobUnit in question." to directly refer back to the parameter description.
Your misunderstanding with the table seems to come from a misunderstanding what tanking means. Tanking does not mean you have the role "tank", it literally means the monster in question is currently hitting your face, i.e. you are the active tank. This has absolutely no relation to the role "tank" or class specilizations. If you are aware that a ranged unit can have up to 130% threat before a mob changes it's melee attack target and a melee unit up to 110%, the table makes perfect sense and I don't think your suggestions seem to improve it. There are 4 relevant return values (integers 0 to 4) and the checkmarks/x behind them just explain the matrix of possible situations. However, I agree that aggro is the wrong term here, as it usually means the same thing as tanking. Plainly replacing it with High threat makes more sense.
Ascarx (talk) 10:07, 3 August 2021 (UTC)
"If you are aware that a ranged unit can have up to 130% threat before a mob changes it's [sic] melee attack target and a melee unit up to 110%" - oddly, I was not. 15 years in the game and I never ran into that particular fact. It's useful. Thank you.
While the change from "Aggro" to "High-Threat" does improve the table a bit, I'm still unclear what the check marks mean. I'm neither slow nor unfamiliar with technical writing (I spent 30 years in mainframe IT explaining business systems to bankers, insurance agents, and such through written word and automated presentations). I still don't understand the check marks as shown. If you would please put a text explanation HERE (not there - no need to churn the page) it would help. Assume I am day-one to WoW.
"...I don't think your suggestions seem to improve it." - likely true as I don't understand this table well.
"There are 4 relevant return values (integers 0 to 4)..." - 0 - 4 represents 5 integer values, not 4 and there are 5 (but only 4 are integers) - nil, 0, 1, 2, and 3, not 0, 1, 2, 3, and 4. Confusing! Hahahahah.
"...the checkmarks/x behind them just explain the matrix of possible situations." - I would disagree. There are, for example, X values in both the High Threat and Main Target. Does that mean that you can't get a 0 return value ever? Possibly there are columns missing that would make it more clear. Blizzard has four threat colors. Perhaps if these were mapped to what those colors indicate it would be more clear? In that context, I think it DOES matter whether or not you are Tanking - which makes the use of the term more relevant.
What I'm in need of this data for is for a replacement for the color coding in exactly this situation - the game's colorblind settings are nice for making things brighter, but don't actually help much when trying to decipher color-coded information for meaning. Brighter grey is still grey. The greys of yellow and green are still both grey. The greys of blue and purple are still just grey. I need to know how to interpret the four integer values in the context of "how to do they relate to the color-coded information transmission Blizzard is using now".Mltco78dhs (talk) 15:43, 3 August 2021 (UTC)
If the color indicators are wrong, then fix it ok thx Ketho (talk) 21:15, 5 August 2021 (UTC)