MMOMinion
Target not registering - Printable Version

+- MMOMinion (https://www.mmominion.com)
+-- Forum: FFXIVMinion (https://www.mmominion.com/forumdisplay.php?fid=87)
+--- Forum: [DOWNLOADS] Addons, Lua Modules, Navigation Meshes.. (https://www.mmominion.com/forumdisplay.php?fid=90)
+---- Forum: I Need Help with LUA coding! (https://www.mmominion.com/forumdisplay.php?fid=104)
+---- Thread: Target not registering (/showthread.php?tid=16574)



Target not registering - BadGuy - 06-03-2016

Somehow I can't get the player target information to show in my data dump

Code snippets:

Code:
function QDMP.OnUpdateHandler (Event, ticks)
    if ( ticks - QDMP.lastticks > 250 ) then
        local target = Player:GetTarget()
        if ValidTable(target) then
            QDMP.currenttarget = target
        else
            QDMP.currenttarget = nil
        end
    end
end
(I actually used to do Player:GetTarget() in my button press event handler, but it didn't work so I put this in the Gameloop.Update event, it still doesn't work though...)

Here's how I use the current target (Excerpt)

Code:
    local dump = {}
-- [..]

    if QDMP.includetarget then
        
        if QDMP.currenttarget ~= nil then
            dump["taget"] = QDMP.currenttarget
        else
            d("[QDMP] No target found")
        end
    end

-- [..]

    d("[QDMP] Writing data to: "..targetfile)
    if FileSave(targetfile, dump) then
        d("[QDMP] Dump file saved succesfully")
    else
        d("[QDMP] Failed to save file, check permissions and/or for existing files")
    end

The target file output is just target = { },

From the dev monitor this seems to work just fine so I'm wondering if I'm just missing something extremely obvious. I do actually get stuff like Player.pos and that works as expected. :GetTarget() just won't get me a result