ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   Draw weapon while out of combat, if reticle sits on a hostile enemy (https://www.esoui.com/forums/showthread.php?t=7947)

SlippyCheeze 07/23/18 09:17 AM

Draw weapon while out of combat, if reticle sits on a hostile enemy
 
I keep finding myself in the annoying "git gud" position of forgetting to draw my staff before I attack a hostile, so my first light/ability combo only fires off the later since the click pulls out the staff but doesn't attack.

I've had a look around, but can't find anything that delivers what I would prefer, which is:

While out of combat, if my reticle sits on a hostile target for a reasonable time (thinking 0.5 to 1 second) then I will automatically draw my weapon, if it is not already out.

Is there an addon that does this already, which I have missed?

Baertram 07/23/18 10:30 AM

Nope, I'm not aware of an addon doing this.
And to be true: This maybe doable but would need to check mouse movement and reticle over functions that heavy (on each reticle name change) that you won't want an addon do this and slow your CPU down :p

Maybe just bind a key to draw weapon and press this constantly if you look at enemies :D

SlippyCheeze 07/23/18 01:52 PM

Quote:

Originally Posted by Baertram (Post 35404)
Nope, I'm not aware of an addon doing this.
And to be true: This maybe doable but would need to check mouse movement and reticle over functions that heavy (on each reticle name change) that you won't want an addon do this and slow your CPU down :p

Maybe just bind a key to draw weapon and press this constantly if you look at enemies :D

Hrm. I figured it couldn't be that costly, because the existing reticle and/or the "combat reticle" and "rainbow reticle" mods changed color based on target. Thank you for the feedback, however. I'll have more of a think about it... and try out "git gud" ;)

SDPhantom 07/26/18 05:14 AM

Here's a drycoded example of how I can see this working. Without access to unique mob IDs, this can run into problems of false triggering.

Lua Code:
  1. local TargetTimeout=5000;
  2.  
  3. local function OnTimeout()
  4.     if DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE and ArePlayerWeaponsSheathed() then
  5.         TogglePlayerWield();
  6.     end
  7.     EVENT_MANAGER:UnregisterForUpdate("AutoDraw");
  8. end
  9.  
  10. EVENT_MANAGER:RegisterForEvent("AutoDraw",EVENT_RETICLE_TARGET_CHANGED,function()
  11.     EVENT_MANAGER[(DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE) and "RegisterForUpdate" or "UnregisterForUpdate"](EVENT_MANAGER,"AutoDraw",TargetTimeout,OnTimeout);
  12. end);

SlippyCheeze 07/30/18 01:38 PM

Quote:

Originally Posted by SDPhantom (Post 35435)
Here's a drycoded example of how I can see this working. Without access to unique mob IDs, this can run into problems of false triggering.

Lua Code:
  1. local TargetTimeout=5000;
  2.  
  3. local function OnTimeout()
  4.     if DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE and ArePlayerWeaponsSheathed() then
  5.         TogglePlayerWield();
  6.     end
  7.     EVENT_MANAGER:UnregisterForUpdate("AutoDraw");
  8. end
  9.  
  10. EVENT_MANAGER:RegisterForEvent("AutoDraw",EVENT_RETICLE_TARGET_CHANGED,function()
  11.     EVENT_MANAGER[(DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE) and "RegisterForUpdate" or "UnregisterForUpdate"](EVENT_MANAGER,"AutoDraw",TargetTimeout,OnTimeout);
  12. end);

Sorry for not getting back to you sooner, thank you very much! I'll be honest, I don't really care too much about false positives in this, because drawing my weapon is never really much of an inconvenience (that I know of, anyway), compared to not drawing it when [s]I'm stupid[/s] I forget, so don't get that first light attack, and then screw up the flow of weaving for a few more.

Drummerx04 08/01/18 05:55 AM

A much easier option is to disable the auto-sheath feature so your character will never put away his/her weapon unless you specifically press the button to do so. (I think it's in settings->gameplay)

Maybe that doesn't answer the question, but it may be an acceptable alternative for you.

SDPhantom 08/04/18 09:08 AM

Quote:

Originally Posted by Drummerx04 (Post 35467)
A much easier option is to disable the auto-sheath feature so your character will never put away his/her weapon unless you specifically press the button to do so. (I think it's in settings->gameplay)

I'm guessing you have an addon for this. I'm not seeing the option anywhere in the default UI.


All times are GMT -6. The time now is 05:59 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI