Results 1 to 10 of 1109

Thread: WeakAuras Tutoring Thread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11

    Default

    Deadly Boss Mods Timer Trigger

    Purpose: This is really just a skeleton trigger to use in conjunction with other triggers for alerts based on DBM timers. By default it's created within a Progress Bar alert, but you can easily convert this skeleton into another type (right-click > Convert To) then add your extra stuff, such as Text, Icon, etc.

    The identifier of the DBM timer is created using a combination of values concatenated into the following form:
    Code:
    [TimerType][SpellId][ModBossId][TimerCount]
    This allows DBM to auto-generate localized timer names for the majority of timers.

    Therefore, first check the DBM .lua file, as described below, to determine what type of timer you're working with and locate the spell ID (if available) or partial localized text ID.

    Spell Id Timer

    DBM Skeleton Import String


    Open the .lua file for the encounter in question (e.g. Atramedes is in Addons/DBM-BlackwingDescent/Atramedes.lua).

    There will be a list of local variables and a section generally for timers, such as:
    Code:
    local timerSearingFlame        = mod:NewNextTimer(46.5, 77840)
    If the creation of the timer (the function after the equals sign, such as NewNextTimer or NewTimer) contains non-string values, it's probably a Spell Id Timer and is using the spell ID. In the case of Searing Flame, we see the first number is the seconds of the timer, and the second number if the ID of the spell to track.

    Therefore, we want to import a DBM Skeleton Trigger and change the "id" variable to the spell Id found in the DBM lua file, so in this case the ID for Searing Flame is 77840.
    Code:
        -- === CONFIG SETTINGS BEGIN ===
        -- id: Exact spellId used by the DBM timer creation code
        local id = 12345;
        [...]
        -- === CONFIG SETTINGS END ===
    On the other hand, some timers are not based on a spell or otherwise auto-generated, and instead are manually named by the author of the mod. For example, the timer for the next Air Phase in Atramedes is in the code as:
    Code:
    local timerAirphase        = mod:NewTimer(85, "TimerAirphase")
    In this case, because there is a string value in the timer creation function, we know it uses a localized string to get the timer ID, so we must refer to the localization file for this zone. These are found in Addons/DBM-ZoneName/localization.en.lua, so for Atramedes, we look in Addons/DBM-BlackwingDescent/localization.en.lua.

    Then find the section of this file for the encounter in question, under which there will be a table function of "L:SetTimerLocalization" with a few values in it. For Atramedes, we have:
    Code:
    L:SetTimerLocalization({
        TimerAirphase        = "Airphase",
        TimerGroundphase    = "Groundphase"
    })
    Within this list of values, find the value that matches the key from the timer creation code -- in this case, NewTimer(85, "TimerAirphase") tells DBM to create a timer and name it the localized string value of whatever "TimerAirphase" is set to, which is "Airphase".

    Thus, we know the ID for our DBM airphase timer on an EN client is "Airphase".
    Code:
        -- id: Exact spellId used by the DBM timer creation code
        --    Can also be partially matched string contained in the localized
        --    bar title within DBM .lua (if no spell ID exists).
        local id = "Airphase";
    Time
    Code:
        -- time: Time remaining at which to trigger (in seconds), can be decimal.
        --    If checkTimeElapsed = true, this is time elapsed at which to trigger instead.
        --    If set to zero or negative, time is set to start the same moment as the DBM bar.
        config.time = 5;
    Pretty simple: set this to the number of seconds at which you want the trigger to fire. By default, triggers will fire based on how much time is remaining before the timer ends, so if I want my WeakAuras trigger to fire when the DBM timer has 4.5 seconds left, I would change "time" to 4.5. If you don't know when you want the trigger to fire, or you want the maximum time of the DBM bar, set time = 0.

    Check Time Elapsed
    Code:
        -- checkTimeElapsed: Default checks against time remaining before the timer ends.
        --    If you want to check against time elapsed instead, change to "true".
        config.checkTimeElapsed = false;
    This is a boolean value, and setting it to true changes the behavior to instead check how much time has elapsed on a given DBM timer against your "Time" settings, rather than the default of how much time is remaining.

    Duration (NEW)
    Code:
        -- duration: Duration the trigger should remain active before untrigger, can be decimal.
        --    If set to default of 0 (zero), trigger expires when timer expires.
        --    If set to a positive value of say 5, trigger will expire 5 seconds after
        --    trigger started, as specified by "time" above.
        config.duration = 5;
    Duration allows you to specify how long the display should remain triggered before it untriggers. This is most useful for creating events midway through a DBM timer, such as a trigger that starts 7 seconds before the timer expires, and lasts 5 seconds total (untriggering at the 2 second mark) as seen in the code example. If duration is set to a value of 0, it is simply ignored and the trigger behaves normally, triggering at the "time" specified and untriggering when the timer expires naturally.

    Sub-ID (NEW)
    Code:
        -- subId: Additional identifier to prevent timer corruption if multiple triggers exist
        --    with the same "id" value.
        local subId = 0;
    This field can be ignored for most triggers, but was added as a necessity to distinguish between simultaneous custom DBM triggers that may be running based on the same spell ID. In such situations, the subId should be altered within each display to any unused integer.

    For example, if I have a "Pre-Breath" warning setup to give me a countdown leading up to 5 seconds before the Breath timer expires, and I have a second display of "Breath" that warns me 2 seconds prior to Breath timer expiring, they will use the same "id" (of the Breath spell in question). Therefore, one display should have a subId unique from the other display, such as subId = 0 for "Pre-Breath" and subId = 1 for "Breath", for example.

    Duration Info (NEW)

    The biggest change to the DBM Skeleton trigger is the addition of custom code to display Duration information about the trigger. Note: This means you must edit the CONFIG DATA in the Custom Trigger code and also set the matching ID value in all three fields of Custom Trigger, Custom Untrigger, and Duration Info.

    The advantage of passing Duration Info to the display is that now the DBM displays can utilize countdowns and progress bar-styles, even if the timings do not match that of the DBM timer itself.

    For example, in the default import, there is a DBM timer with a total duration of 10 seconds. The configuration's "Time" to trigger is specified as the 7 second mark, meaning the trigger will go off at 7 seconds remaining. However, the "Duration" is set to 5 seconds, which causes the display to untrigger after 5 seconds, or when the DBM timer in question has 2 seconds left. This info is passed to the Display section of the trigger, allowing one to use %p and %t custom text values to see the exact time remaining on the trigger before it expires at the 2 second mark.

    Just like the rest of the display, the Duration Info detects the rest of the settings, so if no Duration is specified, one can still see the countdown progress if necessary.

    Adding Additional Triggers

    Once you've configured this DBM trigger to match your settings, it can be used in conjunction with any other set of triggers. Simply add a trigger (such as an aura check, cooldown, etc.) and WeakAuras will only produce a warning if both triggers are firing at the same time!
    Last edited by Kulldam; 06-24-2011 at 12:48 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •