Quantcast
Download
(2 Kb)
Download
Updated: 05/07/20 10:47 AM
Compatibility:
Harrowstorm (5.3.4)
Updated:05/07/20 10:47 AM
Created:02/26/20 04:13 PM
Monthly downloads:59
Total downloads:863
Favorites:4
MD5:
ExoYs Auto Sheathe
Version: 2.1
by: ExoY [More]
Automatically sheath your Weapon when not in Combat.
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' intruduced functionality 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 (1)
File Name
Version
Size
Uploader
Date
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: 10
File comments: 12
Uploads: 2
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: 28
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
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2979
File comments: 3596
Uploads: 62
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: 10
File comments: 12
Uploads: 2
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
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2979
File comments: 3596
Uploads: 62
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: