Quantcast
mapIndex of the zone "Fargrave" is nil - ESOUI
Thread Tools Display Modes
11/06/21, 11:45 AM   #1
@DeadSoon
AddOn Author - Click to view addons
Join Date: Sep 2018
Posts: 22
mapIndex of the zone "Fargrave" is nil

A small bug that can potentially be easily fixed:

The mapIndex of the zone "Fargrave" is nil.

This returns nil ...
Lua Code:
  1. GetMapIndexByZoneId(1282)

1282 is the zoneId of "Fargrave". When the character is in the zone, the ID could also be retrieved via:
Lua Code:
  1. local playersZoneIndex = GetUnitZoneIndex("player")
  2. local playersZoneId = GetZoneId(playersZoneIndex)
__________________
Author of the Addons BeamMeUp | Item Cooldown Tracker | Arkays Donation Reminder - feel free to check it out
  Reply With Quote
11/06/21, 02:31 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,503
I don't believe this is a bug. Fargrave (the map in the location list with the mapIndex) behaves like a world map (Blackreach or Tamriel). It doesn't have a single zone inside, but two separate sub maps with their own zone ids (The Shambles and Fargrave City District).
The zoneId you mentioned is for Fargrave City District and not the Fargrave map itself.
__________________
https://www.imperialtradingcompany.eu/ - My Addons - The Vault (Early updates and experimental projects) - My patreon - My blog
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
  Reply With Quote
11/06/21, 03:15 PM   #3
@DeadSoon
AddOn Author - Click to view addons
Join Date: Sep 2018
Posts: 22
Originally Posted by sirinsidiator View Post
I don't believe this is a bug. Fargrave (the map in the location list with the mapIndex) behaves like a world map (Blackreach or Tamriel). It doesn't have a single zone inside, but two separate sub maps with their own zone ids (The Shambles and Fargrave City District).
The zoneId you mentioned is for Fargrave City District and not the Fargrave map itself.
You are right. My fault, I have to clarify that I mean the city district.

However, the city itself is a normal zone where a player can go and walk around. Usually all (main) zones where a player can walk around with the character have a mapIndex (I know only a few exceptions from solo quest subzones). Also the other subzone in Fargrave, "The Shambles" has a correct mapIndex. Fargrave city district should have the same mapIndex as "The Shambles".

EDIT:
I remembered "Clockwork City" and Brass Fortress and tested it. Same issue. So, I really dont know why it is programmed like this (maybe any technical limitation), but there seems to be a pattern behind it. I would like to see this fixed but maybe it is actually not a "bug" and more an annoying issue.
__________________
Author of the Addons BeamMeUp | Item Cooldown Tracker | Arkays Donation Reminder - feel free to check it out

Last edited by @DeadSoon : 11/06/21 at 03:27 PM.
  Reply With Quote
11/06/21, 09:52 PM   #4
Calamath
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 22
Most of you like mapIndex, but in the area of submaps that you call subzones,
you should use mapId instead of mapIndex for the purpose of identifying map data.

Not every mapId will have a corresponding mapIndex.
That is because many submaps are not listed in the Locations section of the map scene.

So the map of ’The Shambles (mapId=2082)’ should not have a mapIndex tied to it either.
Both the Shambles and Fargrave city districts are not on the list of Locations section.
Perhaps you are just a little tired and misunderstood.

Last edited by Calamath : 11/06/21 at 10:05 PM.
  Reply With Quote
11/07/21, 04:15 AM   #5
@DeadSoon
AddOn Author - Click to view addons
Join Date: Sep 2018
Posts: 22
Thanks for these helpful answers and explanations.

Is there any way to retrieve the mapId from a zoneId?
In my individual case I have only a zoneId and from that I can get the mapIndex via
Lua Code:
  1. GetMapIndexByZoneId(number zoneId)

But from that, I find no option/function that gives me the mapId. With the mapId I want set the map via
Lua Code:
  1. SetMapToMapId(number mapId)


Currently, I just use the mapIndex (if it is not nil) to set the map via
Lua Code:
  1. ZO_WorldMap_SetMapByIndex(mapIndex)


If you have any idea how to get the mapId which would be the better choice than mapIndex) from the zoneId, please let me know.

However, while this is not the help forum, this thread can be closed (with or without ideation).

Thanks again to all
__________________
Author of the Addons BeamMeUp | Item Cooldown Tracker | Arkays Donation Reminder - feel free to check it out
  Reply With Quote
11/07/21, 04:29 AM   #6
Scootworks
 
Scootworks's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 312
https://forums.elderscrollsonline.co...change-log-pts

SetMapToMapId(number mapId)
GetCurrentMapId()

You could iterate over all MapIds, set the mapId and read the zone data.... There was a Lib for that already, but it was never official. Sadly I can't find it anymore
__________________
EU Server - SŁĄuGhTerHĜuSe
  Reply With Quote
11/07/21, 05:37 AM   #7
Calamath
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 22
Maybe you can use this one.

* GetMapIdByZoneId(*integer* _zoneId_)
** _Returns:_ *integer* _mapId_
  Reply With Quote
11/10/21, 02:32 PM   #8
@DeadSoon
AddOn Author - Click to view addons
Join Date: Sep 2018
Posts: 22
Originally Posted by Calamath View Post
Maybe you can use this one.

* GetMapIdByZoneId(*integer* _zoneId_)
** _Returns:_ *integer* _mapId_
Awesome! This is working.

I searched a lot in the past and did not find this or a similar function. Now, I started another research and found out it was added in API 100035 (June, this year). So, I am not surprised that I did not find that in the past.

However, thank you so much for serving me my solution.
__________________
Author of the Addons BeamMeUp | Item Cooldown Tracker | Arkays Donation Reminder - feel free to check it out
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » mapIndex of the zone "Fargrave" is nil

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