WoW:UnitId: Difference between revisions
Jump to navigation
Jump to search
m
→Targets
m (→Targets) |
|||
| Line 8: | Line 8: | ||
; <tt>"player"</tt> : The current player. | ; <tt>"player"</tt> : The current player. | ||
; <tt>"pet"</tt> : The current player's pet | ; <tt>"pet"</tt> : The current player's pet | ||
| Line 26: | Line 25: | ||
; <tt>"mouseover"</tt> : The unit which the mouse is currently (or was most recently) hovering over | ; <tt>"mouseover"</tt> : The unit which the mouse is currently (or was most recently) hovering over | ||
; <tt>"none"</tt>: A valid unit token that always refers to no unit. | ; <tt>"none"</tt>: A valid unit token that always refers to no unit. [[API_UnitName|UnitName]] will return "Unknown, nil" for this UnitID. | ||
==Others== | ==Others== | ||
The following value also appears in some very specific places (Vendor interactions, for example) or functions. | The following value also appears in some very specific places (Vendor interactions, for example) or functions. | ||
; <tt>"npc"</tt> : The NPC with which the player is currently interacting. | ; <tt>"npc"</tt> : The NPC with which the player is currently interacting. You '''must''' be interacting with the NPC for this to work (e.g. the quest, flight path, merchant, gossip, or bank frame is open). | ||
; <tt>player name</tt> : As returned by [[API_UnitName|UnitName]], [[API_GetGuildRosterInfo|GetGuildRosterInfo]], [[API_GetFriendInfo|GetFriendInfo]], [[API COMBAT LOG EVENT|COMBAT LOG EVENT]], etc. This must be spelled exactly and will be invalid if the named player is not a part of your party or raid. As with all other UnitIDs, it is not case sensitive. | |||
; <tt> | |||
== Targets == | == Targets == | ||
| Line 42: | Line 39: | ||
If you are using a party or raid member's name as a unit, you need to use hyphens to separate the target chain (e.g. <tt>"Cogwheel-target-target"</tt>). | If you are using a party or raid member's name as a unit, you need to use hyphens to separate the target chain (e.g. <tt>"Cogwheel-target-target"</tt>). | ||
You can have a seemingly endless string of chained units (e.g. <tt>target-target-target-target-target-target-target-target-target-target-target-target-target-target-target-target-...</tt>). | |||
== Notes == | == Notes == | ||
| Line 47: | Line 46: | ||
Many of the functions which take a UnitId only provide useful results for a subset of ID's. Other functions will only provide information for friendly targets (or those upon which a power is active). | Many of the functions which take a UnitId only provide useful results for a subset of ID's. Other functions will only provide information for friendly targets (or those upon which a power is active). | ||
Also, some functions return different values if the target is close enough to be 'visible' to your client (not necessarily in line of sight), as can be determined with [[API UnitIsVisible|UnitIsVisible("unit")]], versus | Also, some functions return different values if the target is close enough to be 'visible' to your client (not necessarily in line of sight), as can be determined with [[API UnitIsVisible|UnitIsVisible("unit")]], versus farther away. | ||