ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Any event difference between cancel and confirm for ground abilities (https://www.esoui.com/forums/showthread.php?t=6659)

cloudor 11/29/16 12:14 PM

Any event difference between cancel and confirm for ground abilities
 
I use EVENT_ACTION_SLOT_ABILITY_USED and EVENT_ACTION_UPDATE_COOLDOWNS to track ground abilities. When using another ability to cancel the ground ability, it fires same events as confirm.

Diesosoon 11/29/16 07:20 PM

Unsure
 
I know little to nothing but looked up something that may be of assistance. Just looking at some of the example code I thought it may be similar.

http://www.esoui.com/forums/showthread.php?t=5576

cloudor 11/30/16 02:22 AM

Quote:

Originally Posted by Diesosoon (Post 29041)
I know little to nothing but looked up something that may be of assistance. Just looking at some of the example code I thought it may be similar.

http://www.esoui.com/forums/showthread.php?t=5576

Thanks for your reply, but I didn't figur out any solutions after read this.

Diesosoon 11/30/16 07:14 PM

Ifnot
 
Quote:

Originally Posted by cloudor (Post 29042)
Thanks for your reply, but I didn't figur out any solutions after read this.

I was talking about this:
Code:

    if (not isDamage and not isHeal) or abilityId == 41467 or abilityId == 57466 or abilityId == 57468 or hitValue < 2 then return end
    local isCrit = result==ACTION_RESULT_CRITICAL_DAMAGE or result==ACTION_RESULT_CRITICAL_HEAL or result==ACTION_RESULT_DOT_TICK_CRITICAL or result==ACTION_RESULT_HOT_TICK_CRITICAL 
    local hit = {
        ["sourceId"]    = sourceUnitId,
        ["targetId"]    = targetUnitId,
        ["hitValue"]    = hitValue,
        ["abilityId"]  = abilityId,
        ["crit"]        = isCrit,
        ["heal"]        = isHeal,
        ["timeMs"]      = GetGameTimeMilliseconds()

Potential ifnotthan statement that could possible be included to correct the problem

Baertram 12/02/16 02:37 AM

@cloudor
Maybe built an internal table with unique "groundtarget eventid = ability's id" when the event gets first fired. Insert a boolean value into the table like

local myAddon.activeGroundTargetAbilities = {
[abilityid of ground target here] = boolean value,
}

Set it to true if the ability is not in the table yet and the events fires the 1st time.
Check if it's in the table by "if myAddon.activeGroundTargetAbilities[ability id] then" and remove it if the event fires the 2nd time.
You're able to react on the ground target ability ids this way at the 2nd time if the event callback function parameters are always the same :(

Be sure to clear the table at realoadui (maybe inside callback function of player activated event) and where needed in between.

cloudor 12/06/16 07:32 PM

@Diesosoon @Baertram Thank you, I found a easy way to judge whether a ground ability is confirmed or canceled. If the ground ability is canceled by performing another ability, then the EVENT_ACTION_SLOT_ABILITY_USED will be immediately fired after EVENT_ACTION_UPDATE_COOLDOWNS within 1 millisecond. So I can solve this problem by doing a 2-staged lazy check.

Arterion 01/05/17 10:09 PM

Random thought: If the ground target is canceled, no resources will be consumed. Could you watch the resource (magicka, stamina, ultimate) and check to see if they decrease by the amount the ability costs? That would let you know when to start the timer.

Baertram 01/06/17 04:12 AM

The ground ability gets canceldd by "using" another ability and thus the ressources for the ground ability got used AND the new ressources for the canceling ability.


All times are GMT -6. The time now is 03:13 PM.

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