Talent Loadout Manager

Talent Loadout Manager

83.4k Downloads

Getting nil when querying loadout infos by ID

Closed this issue ยท 2 comments

commented

If I try to invoke GlobalAPI:GetLoadoutInfoByID the parameter is always set to nil.

Example code:

local gAPI = TalentLoadoutManagerAPI.GlobalAPI;
local loadouts = gAPI.GetLoadoutIDs();
print(loadouts[1]); -- here I get proper value like "C_1" or some numeric value corresponding to blizzard talents
local info = gAPI.GetLoadoutInfoByID(loadouts[1]);
print(info); --info is nil

I tried to "debug" it like that:

--in ManagerApi.lua file

function GlobalAPI:GetLoadoutInfoByID(loadoutID)
    print(loadoutID); -- it prints nil
    local displayInfo = TLM:GetLoadoutByID(loadoutID);
    
    return displayInfo and CreateLoadoutInfoFromDisplayInfo(displayInfo);
end
commented

use a : instead of a .
e.g.

local gAPI = TalentLoadoutManagerAPI.GlobalAPI;
local loadouts = gAPI:GetLoadoutIDs();
print(loadouts[1]); -- here I get proper value like "C_1" or some numeric value corresponding to blizzard talents
local info = gAPI:GetLoadoutInfoByID(loadouts[1]);
print(info); -- table
commented

In this case works as intended. Sorry for commotion.