Buff Monitor System

Discussion in 'Player Created Lua Script Repository' started by Tirrag, Jun 26, 2020.

  1. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    Greetings and welcome to the buff monitor system for SotA! It is very difficult to see the active buffs on your character and presents a problem when they unknowingly expire. This is a lua addon that allows special indicators to be placed for active buffs, providing better visibility to their status as you are playing.

    Buffs Currently Monitored - updated 2023-10-17

    Air's Embrace
    Absorb Impacts
    Aetheric Feedback
    Anthem of Alacrity
    Atonal Aria
    Berserk
    Berserkers Stance
    Bolster Balance
    Celestial Blessing
    Chaotic Feedback
    Dash
    Death Shield
    Defensive Stance
    Deflect
    Dodge
    Douse
    Enlightenment
    Evasion
    Flurry
    Knights Grace
    Earths Embrace
    Elysian Illumination
    Fortify Defenses
    Glancing Blow
    Healing Grace
    Ice Field
    Immolation
    Inner Strength
    Ignite Weapon
    Melody of Mending
    Mesmerizing Melody
    Meteor Shower
    Night Vision
    Parry
    Passive Stance
    Player Health
    Poison Weapon
    Provoking Shout
    Psalm of Stagnation
    Purify
    Purify Burst
    Reckless Stance
    Refrain of Resistance
    Rhapsody of Recovery
    Ring of Fire
    Spellbinder Stance
    Savage Sonata
    Shield of Air
    Shield of Crystal
    Shield of Ice
    Soothing Rain
    Sprint
    Torpor

    Pet Buffs Currently Monitored - updated 2021-08-26

    Health
    Frenzy
    Strength of Earth
    Air's Embrace
    Enlightenment
    Bear Bites
    Dragon Kibbles
    Venison Jerky
    Rabbit Pate'

    Windows of Opportunity Currently Monitored - updated 2022-06-10

    Riposte (upon successful parry)
    Opportunity Strike (upon successful dodge)
    Aetheric Feedback (upon successful spell crit)

    What does it do? - updated 2022-06-10

    This addon will create indicators on your UI that will show when a buff is activated, when there is 1/2 of the buff time remaining the indicator will turn yellow, when 1/4 of the buff time remaining the indicator will turn yellow with red corners, when the buff expires the indicator will turn red, and then 20 seconds after that the buff indicator will disappear (unless the buff is reactivated). Buff indicators can be positioned individually so you may place them where you see fit.

    Examples of the Defensive Stance indicator:

    [​IMG] [​IMG] [​IMG]

    Getting Started

    To get started you will need to download the Buff Monitor System addon at:

    https://shroudoftheavatar.tools/lua/buff_monitor_system_v4.07.zip

    Please extract the files and directories from the zip download into your Lua SotA folder. If you are prompted to overwrite sota_event_system.lua feel free to do so as all updates to that addon are backwards compatible. When installed properly you should see files called:

    buff_monitor_system.lua
    sota_event_system.lua

    in your root Lua folder and a folder called "bms".

    If you cannot find your lua folder, while in-game in the local chat type:

    /datafolder

    This will open up a dialog showing your SotA data folder of which one subdirectory will be the Lua folder.

    If you extracted the files into your Lua folder while in-game they will not be active yet until you either restart the game or in the local chat type:

    /lua reload

    Upon reload, you should see messages in the lua chatbox (be sure lua is checked for that tab) indicating that the addon is active.

    If you did not see those messages, then you will need to enable it through the lua addon menu option within SotA. In the upper-right of the SotA interface click the Window selector icon and select the LUA Add-On(s) Manager option.

    [​IMG]

    In the Lua Add-Ons Manager dialog, find SotA Event System (SES) and ensure it is "On". If it is "Off" then click the "Off" button.

    [​IMG]

    In the Lua Add-Ons Manager dialog, find Buff Monitor System (BMS) and ensure it is "On". If it is "Off" then click the "Off" button.

    [​IMG]

    Updating from an Earlier Version - updated 2022-06-22

    When updating from an earlier version your settings will not be overwritten. Still, it is recommended you backup the user.ini file within the lua/bms folder before updating. Simply overwrite the existing version with the new version. If you are updating to v3.03, you can delete your images folder and replace it with the new one from the zip file. I updated the image format to jpg from png to shave 7MB off the addon size. If you are updating to v3.06, you can delete your images folder and replace it with the new one from the zip file. For this version I have added an overlay system so the amount of images required is much, much less.

    If you are updating to 4.01+, libsota is no longer needed. While it does not affect anything for them to remain, you can remove libsota.lua and libsota.util.lua from your root Lua folder as long as no other addons are using it. If you are not sure, first rename libsota.lua and libsota.util.lua and add ".disabled" to the end of the filenames so you now have libsota.lua.disabled and libsota.util.lua.disabled. Once this is done perform a

    /lua reload

    from the chat or click the reload lua scripts in the lua addon manager screen. If you do not see any errors and all your addons are working correctly feel free to delete the libsota files at your convenience. If you are in any way unsure of this process please do not hesitate to reply here or private message me before you do anything. I am more than happy to assist :)

    First Time In-Game - updated 2022-06-22

    Once you have confirmed via the lua messages that the addon is active it is time to give it a try. All indicators are initially positioned in the upper left of your screen. To activate one, enter combat mode and activate one of the supported buffs. You should see the corresponding indicator in the upper left.

    With the indicator visible you can now relocate it. To relocate an indicator, hold down the Left Control button and you should see the icon change to have arrows. With the Left Control still held, use your mouse to drag the indicator to your desired location. Once you have the indicator located where you desire, release the Left Control button. The new position will be remembered the next time you load the game.

    Activating/Deactivating Monitors - new 2020-07-12

    Holding the RightAlt key and pressing M will bring up the activation/deactivation screen for individual monitors.

    [​IMG]

    To deactivate a monitor click the icon and it will toggle the activation. A red monitor icon indicates that the monitor for that buff is currently deactivated. The settings are saved immediately and will be restored the next time SotA starts. You can use this screen to deactivate any skills that are not needed or conflict with your current deck and equipment. To close the configuration screen either click the X in the upper right or hold RightAlt and press M. NOTE: while in the activation/deactivate screen the icons will not show if you use a skill.

    Stacking UI - new 2023-10-17

    There are now four auto-stacking UI options. When one of these options is enabled, the buff indicators will stack at the location of the stacking UI option. To enable a stacking UI, open the options window and click to enable one of the first four options. The direction of the arrow indicates the direction the indicators will stack. To place the starting point of the stacks, use the same method used to place other indicators. The stacking UI indicator will not show until the left CTRL key is depressed and you will be allowed to move the indicator. Indicators will not have their positions saved when the auto-stacking UI is active so your current settings will not be affected. Once the auto-stacking UI is disabled, the indicators will revert to their saved positions.

    NOTE: Only one of the stacking UI options can be enabled at one time.

    Interface Scaling - updated 2022-06-10

    If the icons are too small there is a configurable option in the montiors.ini file inside the bms folder. Edit the file with a text editor and update the icon scale. 1 is the starting scale so a value of 2 would be double. You can do decimals like 1.25, 1.5, 1.75. Once you update and save the file you will need to perform a lua reload from chat, click the reload scripts button in the lua addon manager, or restart SotA. Please don't hesitate to ask questions if you have an issue.

    Overriding Thresholds - updated 2022-06-10

    Some buffs last a short amount of time and some a long amount of time. Due to this the default thresholds for the warning and severe indicators may not fit your taste to longer lasting buffs. Default thresholds can be overridden by adding values to the bms/users.ini file. Edit the file and find the section for the monitor you wish to override. When you find it, add two new values one for warn_threshold and one for severe_threshold. The values should be percentage of time remaining specified in decimal format. An example of overriding Shield of Air to be warned at 25% remaining and severe at 5% remaining would be:

    [shield_of_air_monitor]
    x=1417
    y=936
    enabled=1
    warn_threshold=.25
    severe_threshold=.05

    Once you update and save the file you will need to perform a lua reload from chat, click the reload scripts button in the lua addons manager, or restart SotA to apply the new thresholds. This is an advanced feature and if you would like this but are not comfortable making the update yourself please post a message or PM me and I will be happy to assist.

    Threshold Sounds - new 2022-06-12

    I have added support for sounds to play as a buff reaches a specific threshold. Currently there is no interface to set a sound for a buff so you will need to do a little editing in the user.ini file. You can set a sound to play for a buff by adding two entries to the monitor setting in the user.ini file. For example, to play a sound when Atonal Aria reaches the 25% remaining threshold the entry in the users.ini file would look something like:

    [atonal_aria_monitor]
    x=1553
    y=653
    enabled=1
    play_threshold=0.25
    play_sound_file=sound_3

    The new entries are play_threshold and play_sound_file. Provided with BMS are 6 sounds (sound_1, sound_2, sound_3, sound_4, sound_5, sound_6) that can be entered into the play_sound_file entry. You can also add your own sounds to play but they must adhere to the following:
    1. They must be MP3 format.
    2. They must be placed in the bms/sounds folder.
    3. They must not have any special characters or spaces in the name.
    4. The file extension must be lowercase (if non-windows)
    5. Please do not call your MP3 "sound_X.mp3" where X is a number to allow for future expansion of included sounds.
    So for example, if you have an MP3 file called "beep-1223.mp3", place the file in the bms/sounds folder and for the play_sound_file entry you would use the name but no extension. So your entry would look like:

    [atonal_aria_monitor]
    x=1553
    y=653
    enabled=1
    play_threshold=0.25
    play_sound_file=beep-1223

    Once you update and save the file you will need to perform a lua reload from chat, click the reload scripts button in the lua addons manager, or restart SotA to apply the new thresholds. This is an advanced feature and if you would like this but are not comfortable making the update yourself please post a message or PM me and I will be happy to assist.

    Whats next?- updated 2020-08-02

    I would like to add support for a lot of the buff potions. I would like to eventually make different layout sets similar to different decks. I have also been thinking about a layout configuration screen where you can place all the skills without needing to cast them first. I would also like to get an interface to the scaling.

    External dependencies - updated 2022-06-10

    This addon makes use of my SotA Event System (SMS) addon. It is included as part of the addon distribution so a separate installation is not required.

    This addon makes use of a modularized version of the libsota library by @CatweazleX . Starting with BMS v4.01, libsota is no longer utilized in its original form and not needed as part of the installation.

    Lua Developers - new 2022-06-10

    The BMS event engine is now a separate component to the UI and provides events via the SotA Event System addon allowing other addons to respond to buff data. If you would like to leverage the BMS event engine please PM me for more details. I will eventually update this section with more information.
     
    Last edited: Oct 17, 2023
  2. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    Update List

    2023-10-17: v4.07 released. Added player health monitor. Added up/down/left/right auto-stacking UI based on recommendation from @Barugon.

    2023-09-18: v4.06 released. Added passive and reckless stance indicators requested by @Barugon . Updated base transparency of overlays to .6. Fixed zindex issue with configuration buttons.

    2023-09-09: v4.05 released. Fixed issue with Riposte window of opportunity indicator not working reported by @Akandriel. Added monitor for lightning storm. Fixed error reported by @FrostII where a function that did not exist was being called causing an error in the log.

    2022-07-08: v4.04 released. Default volume updated to 30 now that volume is working. Fixed issue with latest SotA patch that caused indicators to not be movable.

    2022-06-12: v4.03 released with sound support. Please see the new "Threshold Sounds" section above.

    2022-06-10: v4.01 release is a complete rewrite to be more efficient and leverage the new Lua UI functions. this should significantly increase performance and accuracy of the indicators when experiencing lag. how indicators are moved has slightly changed (see notes above). threshold overriding has been added to user.ini (instead of monitors.ini though that still works) so that the settings stay with the user settings. BMS now utilizes and event based system so other addons can listen for the events and perform code in response. The UI can be completely disabled if just the event engine is to be used. window of opportunity indicators have been added (see notes above).

    2021-11-19: v3.10 release adding support for Absorb Impacts as requested by @Akandriel

    2021-10-22: v3.09 release adding the ability to override the warn and severe thresholds by adding the values in the section for a specific buff.

    2021-10-03: v3.08 release fixing issues with pet food.

    2021-10-01: v3.07 release fixing issue with frenzy.

    2021-09-30: v3.06 release fixing incompatibilities with R94. Update to the overlay system where overlays are now separate from the skill icons.

    2021-09-13: v3.05 release with no fixes, but now including libsota as part of the distribution.

    2021-09-07: v3.04 release fixing a bug with the pet health indicator not flipping to warn.

    2021-08-28: v3.03 release updating the image format to jpg. Before installing the new files you may delete the bms/images folder.

    2021-08-27: v3.01 release fixing bug where the warn color would not trigger

    2021-08-26: v3.01 release updating the core to use the new player and pet buff functions. adding support for player buffs Dash and Sprint plus pet health and buffs Frenzy, Strength of Earth, Air's Embrace, Enlightenment, Bear Bites, Dragon Kibbles, Venison Jerky, Rabbit Pate'

    2021-08-02: v2.05 release adding support for buffs Air's Embrace, Enlightenment, Flurry, Inner Strength, Night Vision, Provoking Shout, Strength of Earth, Torpor

    2021-06-08: New v2.04 released (see ZIP link in initial post). I fixed an issue where the spider attack poison debuff was incorrectly being detected as the poison weapon buff.

    2021-05-30: New v2.03 released (see ZIP link in initial post). I introduced a scale setting in case the icons are too small and added chaotic feedback. See above for details.

    2021-05-29: New v2.02 released (see ZIP link in initial post). There was a bug found where if you let a buff go to red and then recast it, the timer that hides the icon was not getting reset causing the recast icon to hide.

    2021-05-29: New v2.01 released (see ZIP link in initial post). This release is the first based on the new buff lua functions. The core of the functionality has been rewritten and simplified. Due to having direct access to buff information there are no more conflicts between skills, warnings are accurate, and nearly any buff will work with the system.

    2020-07-12: New v1.04 released (see ZIP link in initial post). This release has a slew of new features including many new buffs monitored. Activation/deactivation has been consolidated into a single screen (RightAlt+M). There is a new learning mode to teach the system thresholds related to your specific configurations (RightAlt+L). There is a reset in case the system gets confused (RightAlt+R). You should not lose any settings with this release. Please read the info section above for more details. Please note that there was one restructure performed which relocated all the images into a subfolder. While it will not hurt to have images where they were prior to this revision, if you wish to cleanup the main BMS folder by removing all images please feel free to do so. If you choose to cleanup, please be very careful not to delete the monitors.ini or users.ini file.

    2020-06-28: New v1.01 released (see ZIP link in initial post). This release adds the warning indicator for buffs with two stages (an initial big buff, then a few seconds later it drops). It also breaks the user settings into their own file. This means that with any new release after this one you hopefully will not lose your settings. Unfortunately with this release you will need to reset any activations and reposition your indicators.

    2020-06-26: I noticed the settings for glancing blow were missing from the initial v1.00 release. The ZIP download has been updated but there is an updated ini file available at:

    https://shroudoftheavatar.tools/monitors.ini

    Place this in your lua/bms subfolder. You do not need this if you have updated to a higher version already. NOTE: It will overwrite your current position settings.
     
    Last edited: Oct 17, 2023
    Barugon, Time Lord, FrostII and 3 others like this.
  3. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    Monitor updated. Info above.
     
    Last edited: Jun 28, 2020
    Time Lord and FrostII like this.
  4. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    New version of the buff monitor system has been released. See above for details.
     
    Last edited: Jul 12, 2020
  5. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    great news! buff information is now available via Lua. this means i can finally realize the full potential of this this mod :) please let me know the most important buffs to you that are not already included and i will get to adding them. this includes things like ring of fire, meteor shower, and atonal aria.
     
    Time Lord, FrostII, DavidDC and 2 others like this.
  6. Violet Ronso

    Violet Ronso Avatar

    Messages:
    2,632
    Likes Received:
    5,108
    Trophy Points:
    153
    I would say Bard songs are a SUPER important one for me, Anthem of Alacrity, Savage Sonata, Psalms of Stagnation, Melody of Mending, Rapsody of Recovery and Atonal Aria! As a group buffer I like to know when it's time to recast them (and I wonder if it's possible now to go duration left - cast time = Warning? that could be cool!)
     
    Time Lord likes this.
  7. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    perfect thank you! you will be very happy with this next release as the bard songs are supported :) and yes warnings are now functioning for all current and new monitors. icon will turn yellow with 1/3 of the buff time remaining. the core coding is complete and i am testing it now with the existing buffs. once i feel its solid i will start adding new ones, test again, package, release!
     
    Last edited: Jun 8, 2021
  8. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    coding and testing went well. there are now 39 buffs you can monitor all with warnings to let you know before they are going to expire. plus there are no more conflicts so they all work well together. the new list of buff monitors is below. so happy with the latest lua update. finally realizing the full potential of this mod. i hope to package release this weekend!


    Knights Grace
    Bolster Balance
    Poison Weapon
    Aetheric Feedback
    Spellbinder Stance
    Meteor Shower
    Ring of Fire
    Ignite Weapon
    Healing Grace
    Purify Burst
    Elysian Illumniation
    Earths Embrace
    Ice Field
    Soothing Rain
    Savage Sonata
    Rhapsody of Recovery
    Refrain of Resistance
    Psalm of Stagnation
    Mesmerizing Melody
    Melody of Mending
    Atonal Aria
    Anthem of Alacrity
    Parry
    Shield of Ice
    Glancing Blow
    Deflect
    Shield of Air
    Defensive Stance
    Dodge
    Douse
    Death Shield
    Immolation
    Celestial Blessing
    Purify
    Shield of Crystal
    Berserkers Stance
    Evasion
    Berserk
    Fortify Defenses
     
    Time Lord, Elgarion, FrostII and 2 others like this.
  9. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    @Violet Ronso the new release is available in the initial post. enjoy the visibility to the bard buffs! i know i will :)
     
  10. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    monitor update. info above.
     
  11. Duke Gréagóir

    Duke Gréagóir Legend of the Hearth

    Messages:
    5,676
    Likes Received:
    11,810
    Trophy Points:
    165
    Location:
    Dara Brae
    OM Goodness! THANK YOU for this buff system. The Bard Specialization LOVES this as now I know when my songs are ending. :)
     
    Time Lord, Elgarion, Tirrag and 2 others like this.
  12. Scanphor

    Scanphor Avatar

    Messages:
    553
    Likes Received:
    977
    Trophy Points:
    63
    Thank you so much for this! Its hard to overstate how useful this is :D
     
  13. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    thank you all for the wonderful feedback! very happy folks find it as useful as i do :)

    with that, i released v2.04. the only thing fixed in this version is an issue with the poison weapon monitor. if you dont use it then you will not need the update. see notes above.
     
  14. Xarras

    Xarras Avatar

    Messages:
    83
    Likes Received:
    104
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Wales
    Thank you for this addition to my sota enjoyment. I have long requested something like this.
    But I am disappointed in two ways.
    1 It's taken me till now to find you / it.
    2 I can't make it work.

    I downloaded
    https://www.shroudoftheavatar.com/f...lper-library-in-lua-for-shroud-in-lua.160222/
    and
    https://g2-games.com/sota/buff_monitor_system_v2.04.zip
    and unzipped them in to the lua folder where ocxtools is.

    When starting up I get this notice.

    [31/07/2021 09:48:32] [00:02] (Lua): Loaded Lua file C:\Users\xbox\AppData\Roaming\Portalarium\Shroud of the Avatar\Lua\buff_monitor_system.lua
    [31/07/2021 09:48:32] [00:02] (Lua): Loaded Lua file C:\Users\xbox\AppData\Roaming\Portalarium\Shroud of the Avatar\Lua\ocx-tools.lua
    [31/07/2021 09:48:32] [00:02] (Lua): Lua Error chunk_1:(21,10-443,5): attempt to index a nil value

    oxctools is working fine but there is no Buff Monitor so I guess the "chunk" thingamy is the Buff Monitor problem.
    I am a tech innocent so have most probably done something wrong or not done something I should have and will be embarrassed by the solution. So please accept my apologies for taking up your time in advance.

    Thank you again for this quite important addition to SotA. I look forward to it making a difference to my game play.
     
  15. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    greetings @Xarras! thank you for giving the mod a whirl :) going to take troubleshooting it into private messaging hopefully we can get this resolved for you.
     
    Time Lord likes this.
  16. FrostII

    FrostII Bug Hunter

    Messages:
    5,884
    Likes Received:
    11,033
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    @Tirrag
    Installed BMS with Libsota today and love it ! :)

    Noticed that it does not include Enlightenment or Air's Embrace and hope that you will include them !

    Thank you for your work on this fine Lua app ! ;)

    **Edit** While fighting today, I found a couple more that would also be great to have: Flurry and Night Vision ! :)
     
    Last edited: Aug 1, 2021
    Time Lord, Tirrag and Xarras like this.
  17. Xarras

    Xarras Avatar

    Messages:
    83
    Likes Received:
    104
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Wales
    oh Flurry would be quite important for my Death magery.
     
  18. Scanphor

    Scanphor Avatar

    Messages:
    553
    Likes Received:
    977
    Trophy Points:
    63
    While we're on the subject the one I use the most that isn't covered is inner strength :)
     
    Time Lord, Tirrag and Violet Ronso like this.
  19. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    looks like we got everything worked out. thank you @Xarras for your patience while we worked through the issue :) ultimately it ended up being the libsota library placed in the wrong location.

    thank you all for the recommendations on new skills to be added. look to have these added in the near future :)
     
    Last edited: Aug 2, 2021
    Time Lord, Violet Ronso, Anpu and 2 others like this.
  20. Scanphor

    Scanphor Avatar

    Messages:
    553
    Likes Received:
    977
    Trophy Points:
    63
    Great :)
     
    Time Lord, Tirrag and FrostII like this.