Quantcast
Download
(8 Kb)
Download
Updated: 07/21/21 05:02 PM
Compatibility:
Waking Flame (7.1.5)
Blackwood (7.0.5)
Updated:07/21/21 05:02 PM
Created:10/21/20 02:04 PM
Monthly downloads:5,915
Total downloads:42,790
Favorites:18
MD5:
7.0.5
LibUnitTracker  Updated this week!  Popular! (More than 5000 hits)
Version: 0.1.4
by: zelenin [More]
Library for tracking units in a combat.

Usage:

Install dependency:
- LibDelayedHandler

Add dependency to manifest:


Code:
## DependsOn: LibUnitTracker
Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_COMBAT_EVENT, function(eventCode, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId, overflow)
    local characterName = targetName
    if characterName == "" then
        characterName = LibUnitTracker:GetUnitNameByUnitId(targetUnitId)
    end
    local displayName = LibUnitTracker:GetDisplayNameByUnitName(characterName)
    ...
end)
API:
Code:
LibUnitTracker:GetUnitNameByUnitId(unitId)

LibUnitTracker:GetDisplayNameByUnitName(unitName)

LibUnitTracker:GetDisplayNameByUnitId(unitId)

LibUnitTracker:GetUnitByUnitTag(unitTag)

LibUnitTracker:GetGroup()
Unit:
Code:
{
    index = index,
    tag = unitTag,
    rawName = GetRawUnitName(unitTag),
    name = ZO_CachedStrFormat(SI_UNIT_NAME, GetRawUnitName(unitTag)),
    displayName = GetUnitDisplayName(unitTag),
    classId = GetUnitClassId(unitTag),
    gender = GetUnitGender(unitTag),
    level = GetUnitLevel(unitTag),
    championPoints = GetUnitChampionPoints(unitTag),
    alliance = GetUnitAlliance(unitTag),
    raceId = GetUnitRaceId(unitTag),
    isOnline = IsUnitOnline(unitTag),
    isLeader = IsUnitGroupLeader(unitTag),
    isPlayer = AreUnitsEqual(unitTag, "player"),
}
0.1.4:
- API version bump

0.1.3:
- null unit fix

0.1.2:
- units are cleared on EVENT_PLAYER_ACTIVATED

0.1.1:
- version bump

0.1.0:
- converted to singleton (remove New/Start/Stop). Read description
- added advanced displayName resolver

0.0.1:
- initial release
Archived Files (4)
File Name
Version
Size
Uploader
Date
0.1.3
8kB
zelenin
06/03/21 03:02 PM
0.1.1
8kB
zelenin
04/03/21 06:35 PM
0.1.0
8kB
zelenin
02/02/21 04:25 AM
0.0.1
2kB
zelenin
10/21/20 02:04 PM


Post A Reply Comment Options
Unread 06/03/21, 03:08 PM  
zelenin
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 125
Uploads: 11
Originally Posted by TheYcUtS
Code:
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:53: table index is nil
stack traceback:
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:53: in function 'addon:updateGroup'
|caaaaaa<Locals> self = [table:1]{name = "LibUnitTracker"}, index = 1, unit = [table:2]{rawName = "", classId = 0, level = 0, isPlayer = F, alliance = 0, raceId = 0, isLeader = F, isOnline = T, gender = 2, championPoints = 0, name = "", index = 1} </Locals>|r
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:22: in function 'handler'
user:/AddOns/LibDelayedHandler/LibDelayedHandler.lua:22: in function 'func'
EsoUI/Libraries/Globals/globalapi.lua:227: in function '(anonymous)'
fixed
Report comment to moderator  
Reply With Quote
Unread 06/02/21, 12:07 PM  
TheYcUtS
 
TheYcUtS's Avatar
AddOn Author - Click to view AddOns

Forum posts: 9
File comments: 87
Uploads: 3
Code:
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:53: table index is nil
stack traceback:
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:53: in function 'addon:updateGroup'
|caaaaaa<Locals> self = [table:1]{name = "LibUnitTracker"}, index = 1, unit = [table:2]{rawName = "", classId = 0, level = 0, isPlayer = F, alliance = 0, raceId = 0, isLeader = F, isOnline = T, gender = 2, championPoints = 0, name = "", index = 1} </Locals>|r
user:/AddOns/LibUnitTracker/LibUnitTracker.lua:22: in function 'handler'
user:/AddOns/LibDelayedHandler/LibDelayedHandler.lua:22: in function 'func'
EsoUI/Libraries/Globals/globalapi.lua:227: in function '(anonymous)'
__________________
Last edited by TheYcUtS : 06/02/21 at 12:07 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: