Think about supporting soft targets
emptyrivers opened this issue ยท 11 comments
There's a new feature in dragonflight which is alternately called 'soft' or 'action' targetting (presumably the developers did the same thing I did with custom options and changed their minds on what to call it halfway thru development...), which allows the user to have more than one target unit.
With soft targets enabled (there are a bunch of Cvars which control the precise behavior), the game will automatically select a soft target in a manner similar to tab targetting. The traditional target is known as the 'locked' target internally.
Accompanying this change are 6 new possible unitId tokens:
- anyenemy
- Resolves to either the "target" unit or "softenemy" target, with "target" being higher priority.
- anyfriend
- Resolves to either the "target" unit or "softfriend" target, with "target" being higher priority.
- anyinteract
- Resolves to either the "target" unit or "softinteract" target, with "target" being higher priority.
- softenemy
- The current soft target that is hostile towards the player.
- softfriend
- The current soft target that is friendly towards the player.
- softinteract
The current soft target that can be interacted with. This may be an NPC such as a questgiver or merchant, or a game object like a mailbox or a gathering node.
So, with this, there are a few things we might want to adopt:
- prompt the user (when selecting the target unit) to specify if they want to only use soft targets, or want to avoid the soft target for e.g. aura scan?
- extend 'has target' global condition to understand soft targets?
some events associated with soft targeting:
PLAYER_SOFT_ENEMY_CHANGED
PLAYER_SOFT_FRIEND_CHANGED
PLAYER_SOFT_INTERACT_CHANGED
(though, i haven't been able to see this one fire in the wild)
For an example use case, here is an aura which should glow when anyfriend
has a curse I can remove, but unfortunately it doesn't work, because BT2 doesn't think that anyfriend
is a trackable unit:
!WA:2!Dvv3UTrru4AzQaTxanM2abrLmbiIYfvOu1QkUZRRDtqo2M1BibUGSZU7z9onRNzzMzTJRexudQKR9JGVMRSq8a4NGrwiEa6JqEc4mJTtBjxS(mN5833z(oNuQzLbvIReF5NpJgXz94fIi4tVH4IojjsqvsmETWCclkLl6YPmvy9gT9B4TmIZZI5Jy9grZHGfBo2iUpK6AcxWeLG2VpiK)8EI1IxU1RkKWzKqjxeEepgcw2hyGGg1lLpQdBMe)Pw2iYy5RKfHWqGP6kGe6fE962OvRzXqyrsI)4CqCqJwDBEClxfEWtMdzz5vEDWpaiz2eCDC6HosVy(z1R1Z)SE(1889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SN(LbtYfCS5PgRFWE6Fd98M6F318)g0VSS(pSMOV0Si5(p4(Mh)jBEUcwIZYiy6KBZTtf5(pbgwz4)C6)b
Did a bit more digging around:
- the softX unit tokens seems totally normal - appear in events, regitering unit events to them works as expected, etc.
- anyX unit ids are more abstract - they don't show up in events, registering unit events to anyenemy behaves as if you used a nonsense unit token (i.e. every event is passed to event handler regardless of unit id). Using an
any
unit token in the API works fine, however.
If the user has the cvar softTargetForce set, then often the distinction between locked & soft target is moot, as unless the user actually locks a target thru a hardware interaction, target
will resolve to its soft variant if it exists.
Amusingly, the soft target feature does seem to be available in wotlk (at least, on the PTR - i'm not going to go thru the bother of setting up on wotlk live). So much for #nochanges, i guess.
if you have both friendly and enemy soft targeting enabled, then enemy takes precedence, and both take precedence over interact targeting AFAICT.
If your locked target dies, then it becomes a neutral interact target, and frees up that reaction type for soft targeting.
I have not had the opportunity to see what happens if a locker target changes reaction (eg mind control), though i imagine the rule of "only one GUID can be targeted per reaction type" continues to hold.
Fast replies..
So you are both right, I was able to get it to work using the Custom Event and adding the event myself, it was just missing from the default builtin dropdown event lists. I'm fine using it under custom, and doubt it warrants enough people using the event to include it in a dropdown. Thanks both for replying.
Was there a reason this was marked as completed, but not implemented?
I do not see for example the PLAYER_SOFT_INTERACT_CHANGED anywhere in the code.
Thanks!