WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Get Map ID after loading (https://www.wowinterface.com/forums/showthread.php?t=54016)

maqjav 07-25-16 12:21 AM

Get Map ID after loading
 
Hello.

I'm trying to find out how to get the correct map ID after a loading screen (after using the hearthstone).

Right now I'm trying with the next code:

Code:

addon:RegisterEvent("PLAYER_ENTERING_WORLD")

addon:SetScript("OnEvent", function(self, event)

        if event == "PLAYER_ENTERING_WORLD" then
                SetMapToCurrentZone()
                local zone_id, boolean = GetCurrentMapAreaID()
                print("ZONE_ID "..zone_id)
        else
end)

ZONE_ID will get the ID of the map where I was when I used the hearthstone.
I cannot find which is the event that fires once the game is fully loaded (so GetCurrentMapAreaID returns the current map ID and not the previous)

Thanks.

Layback_ 07-25-16 01:05 AM

Quote:

Originally Posted by maqjav (Post 316935)
Hello.

I'm trying to find out how to get the correct map ID after a loading screen (after using the hearthstone).

Right now I'm trying with the next code:

Code:

addon:RegisterEvent("PLAYER_ENTERING_WORLD")

addon:SetScript("OnEvent", function(self, event)

        if event == "PLAYER_ENTERING_WORLD" then
                SetMapToCurrentZone()
                local zone_id, boolean = GetCurrentMapAreaID()
                print("ZONE_ID "..zone_id)
        else
end)

ZONE_ID will get the ID of the map where I was when I used the hearthstone.
I cannot find which is the event that fires once the game is fully loaded (so GetCurrentMapAreaID returns the current map ID and not the previous)

Thanks.

I can't give you the definite answer as I am a newbie developer, but why don't you try use '/eventtrace'?

Pretty sure this is going to work for you to find which event has been fired as well as the variables.

sezz 07-25-16 01:14 AM

Use ZONE_CHANGED events in addition to PLAYER_ENTERING_WORLD:
- ZONE_CHANGED
- ZONE_CHANGED_INDOORS
- ZONE_CHANGED_NEW_AREA

maqjav 07-25-16 01:20 AM

Thank you both.

I didn't know about the command eventtrace, very handy!
I'm going to make some tests with those events sezz, and check what's going on with the trace.


All times are GMT -6. The time now is 04:37 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI