ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   mapIndex of the zone "Fargrave" is nil (https://www.esoui.com/forums/showthread.php?t=9977)

@DeadSoon 11/06/21 11:45 AM

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)

sirinsidiator 11/06/21 02:31 PM

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.

@DeadSoon 11/06/21 03:15 PM

Quote:

Originally Posted by sirinsidiator (Post 44903)
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.

Calamath 11/06/21 09:52 PM

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. ;)

@DeadSoon 11/07/21 04:15 AM

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 :)

Scootworks 11/07/21 04:29 AM

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

Calamath 11/07/21 05:37 AM

Maybe you can use this one. :banana:

* GetMapIdByZoneId(*integer* _zoneId_)
** _Returns:_ *integer* _mapId_

@DeadSoon 11/10/21 02:32 PM

Quote:

Originally Posted by Calamath (Post 44913)
Maybe you can use this one. :banana:

* 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. :D


All times are GMT -6. The time now is 05:38 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI