Download
(3 Kb)
Download
Updated: 04/28/21 04:06 PM
Compatibility:
Flames of Ambition (6.3.5)
Updated:04/28/21 04:06 PM
Created:02/26/20 04:13 PM
Monthly downloads:34
Total downloads:4,951
Favorites:9
MD5:
ExoYs Auto Sheathe
Version: 4.0
by: ExoY [More]
This Addon automatically sheathes your weapon, if they are not needed.

What is different about this Addon compared to other sheathe weapon addons?
  • It can be set to automatically deactivate when in PvE or PvP content.
  • It also sheath weapon after using a skill or la when not in combat (e.g. Speedbuff while collection crafting materials)
  • Minimized performance impact, by avoiding continuous loops and only by activated when acutally needed. (It is a very small addon, but everyone has to do their part )
Version 4.0
*Updated for FlamesOfAmbition
*Decreased performance impact
*Fixed some issues, where weapons where sheathed right after drawing them

Version 2.3
*Fixed, that is was still listed as "out of date"

Version 2.2
*Updated for Stonethorn DLC

Version 2.1
*Option added to automatically deactivate addon when entering PvP Content and associated customizability.


Version 2.0
+Remodelled the addons entire internal logic.
The old one was not able to handle the in 'Version 1.6' newly intruduced functions properly.

-------------------------------------------------------------------------------------------

Version 1.6
*Option added to automatically deactivate addon when entering dungoen/raids and associated customizability.

Version 1.5
*Delay after using a skill in non-combat now gets reset when casting another skill.

Version 1.4
*Improved performance while in combat
*included debug mode
*more realistic behaviour through:
+integrated a delay after exiting combat
+integrated a delay after using a skill or weapon attack in non-combat

Version 1.3
*Removed a function which constantly spamed "hier" in the chat.
*This function was created to test a functionality and embarrassingly i forgot to deactivated it afterwards.

Version 1.2
*It will now also automatically sheathe your weapon while not beeing in combat after using a skill or the *weapon itself.
Archived Files (5)
File Name
Version
Size
Uploader
Date
3.0
3kB
ExoY
12/11/20 04:59 AM
2.3
2kB
ExoY
08/26/20 03:50 AM
2.2
2kB
ExoY
08/25/20 06:41 AM
2.1
2kB
ExoY
05/07/20 10:47 AM
2.0
2kB
ExoY
03/29/20 03:54 PM


Post A Reply Comment Options
Unread 03/29/20, 02:48 PM  
ExoY
 
ExoY's Avatar
AddOn Author - Click to view AddOns

Forum posts: 87
File comments: 134
Uploads: 12
Originally Posted by Laren
after the newest update in dungeons it is constantly sheathing my weapon. constantly as in after every light attack. had to disable the addon so I can play.
Thanks for your feedback. Apparently there is something weird happening with the internal logic of my addon, because sometimes it seems to work just fine and sometimes i get the same problem with you.

I have therefore remodelled the entire addon.

The fix has just been released.
Last edited by ExoY : 07/05/20 at 04:06 AM.
Report comment to moderator  
Reply With Quote
Unread 03/29/20, 12:05 PM  
Laren

Forum posts: 3
File comments: 30
Uploads: 0
after the newest update in dungeons it is constantly sheathing my weapon. constantly as in after every light attack. had to disable the addon so I can play.
Last edited by Laren : 03/29/20 at 12:05 PM.
Report comment to moderator  
Reply With Quote
Unread 02/28/20, 05:55 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
You should use the following event then:
EVENT_PLAYER_ACTIVATED

Register it in your event_add_on_loaded and do the checks for the inCombat and registering the updater function there instead of in event_add_on_loaded.

Event_player_activated gets fired each time after login/reloadui/zone change with loading screens.

Originally Posted by ExoY
Originally Posted by Baertram
Your function EAS:Initialize() should be written like this: EAS.Initialize()
Else you tell the game to look for an object (like a class) which could be referenced via the self variable.

As you did not define EAS as ZO_Object:Subclass(), but only as table EAS = {} the entries of variables and functions should be just attched with the ., same for the function definiton: function EAS.Initialize()
Thanks for that input. The tutorials i used to get started writing addons didnt really cover the difference between eas.initialize() and eas:initialize. So I wasnt really sure when to use which one.

Originally Posted by Baertram
And you definately should unregister the update function via EVENT_MANAGER:UnregisterForUpdate(EAS.name)
if you get into combat!
That is my intention for the exact same reasoning as yours.
I had disabled it for the last relase, because it caused a bug. After reload or login you needed to enter and exit one combat before it started sheathing the weapon. Which I did not fully understood. But this will be dealed with in the next update.
Report comment to moderator  
Reply With Quote
Unread 02/28/20, 02:51 AM  
ExoY
 
ExoY's Avatar
AddOn Author - Click to view AddOns

Forum posts: 87
File comments: 134
Uploads: 12
Originally Posted by Baertram
Your function EAS:Initialize() should be written like this: EAS.Initialize()
Else you tell the game to look for an object (like a class) which could be referenced via the self variable.

As you did not define EAS as ZO_Object:Subclass(), but only as table EAS = {} the entries of variables and functions should be just attched with the ., same for the function definiton: function EAS.Initialize()
Thanks for that input. The tutorials i used to get started writing addons didnt really cover the difference between eas.initialize() and eas:initialize. So I wasnt really sure when to use which one.

Originally Posted by Baertram
And you definately should unregister the update function via EVENT_MANAGER:UnregisterForUpdate(EAS.name)
if you get into combat!
That is my intention for the exact same reasoning as yours.
I had disabled it for the last relase, because it caused a bug. After reload or login you needed to enter and exit one combat before it started sheathing the weapon. Which I did not fully understood. But this will be dealed with in the next update.
Last edited by ExoY : 02/28/20 at 02:51 AM.
Report comment to moderator  
Reply With Quote
Unread 02/27/20, 08:34 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Welcome to addon coding.

Your function EAS:Initialize() should be written like this: EAS.Initialize()
Else you tell the game to look for an object (like a class) which could be referenced via the self variable.

As you did not define EAS as ZO_Object:Subclass(), but only as table EAS = {} the entries of variables and functions should be just attched with the ., same for the function definiton: function EAS.Initialize()

And you definately should unregister the update function via EVENT_MANAGER:UnregisterForUpdate(EAS.name)
if you get into combat!

Why should it check every 1500ms if it can sheathe your weapons if you are in combat?
Makes only sense if you left combat.
So it should look something like this:

Lua Code:
  1. EAS = {}
  2. EAS.name = "ExoYsAutoSheathe"
  3.  
  4. function EAS.OnAddOnLoaded(event, addonName)
  5.   if addonName == EAS.name then
  6.     EAS.Initialize()
  7.   end
  8. end
  9.  
  10. EVENT_MANAGER:RegisterForEvent(EAS.name, EVENT_ADD_ON_LOADED, EAS.OnAddOnLoaded)
  11.  
  12. function EAS.Initialize()
  13.   EAS.inCombat = IsUnitInCombat("player")
  14.   EVENT_MANAGER:RegisterForEvent(EAS.name, EVENT_PLAYER_COMBAT_STATE, EAS.CombatToggle)
  15.   if EAS.inCombat then return end
  16.   EVENT_MANAGER:RegisterForUpdate(EAS.name, 1500, EAS.SheatheWeapon)
  17. end
  18.  
  19. function EAS.CombatToggle(event, inCombat)
  20.    EAS.inCombat = inCombat
  21.    if inCombat then
  22.      EVENT_MANAGER:UnregisterForUpdate(EAS.name)
  23.    else
  24.      EAS.SheatheWeapon()
  25.      EVENT_MANAGER:RegisterForUpdate(EAS.name, 2000, EAS.SheatheWeapon)
  26.    end
  27. end
  28.  
  29. function EAS.SheatheWeapon()
  30.   if EAS.inCombat or ArePlayerWeaponsSheathed() then return end
  31.   TogglePlayerWield()
  32. end
Last edited by Baertram : 02/27/20 at 08:39 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: