Thread Tools Display Modes
07-25-16, 12:21 AM   #1
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
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.
  Reply With Quote
07-25-16, 01:05 AM   #2
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by maqjav View Post
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.
  Reply With Quote
07-25-16, 01:14 AM   #3
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Use ZONE_CHANGED events in addition to PLAYER_ENTERING_WORLD:
- ZONE_CHANGED
- ZONE_CHANGED_INDOORS
- ZONE_CHANGED_NEW_AREA
  Reply With Quote
07-25-16, 01:20 AM   #4
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Get Map ID after loading

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off