ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Wish List (https://www.esoui.com/forums/forumdisplay.php?f=177)
-   -   [open] GetNormalizedWorldPosition (https://www.esoui.com/forums/showthread.php?t=9471)

votan 11/09/20 03:21 AM

[open] GetNormalizedWorldPosition
 
GetNormalized(Raw)WorldPosition(worldX, worldY, worldZ)
or
GetNormalized(Raw)WorldPosition(worldX, worldY, worldZ, *nilable* mapId)
returns normalizedX, normalizedY

(Any better function name is welcome)

Use Case: In LibGPS we abuse the player waypoint to get a second reference point to calculate the current scale of world coordinates to global/universal normalized map positions.
This is used to get the TARDIS factor of dungeons (They are bigger on the inside)

As we have GetUniversallyNormalizedMapInfo now, it would make all this map ping muting obsolete.

Thank You

Shinni 11/09/20 08:52 AM

With normalized position you mean the 2d map position? I.e. this question is about converting 3d world to 2d map coordinates?
Then I'll just add the related request:
https://www.esoui.com/forums/showthread.php?t=9251
Any of the variants proposed by votan or me would help for my use-case.

votan 11/09/20 10:08 AM

Yes, that is basically the same wish.

votan 11/13/20 01:52 AM

Alternatively the TARDIS factor of a map could be part of the GetUniversallyNormalizedMapInfo function.

* GetUniversallyNormalizedMapInfo(*integer* _mapId_)
** _Returns:_ *number* _normalizedOffsetX_, *number* _normalizedOffsetZ_, *number* _normalizedWidth_, *number* _normalizedHeight_, *number* worldScaleFactor

ZOS_DanBatson 11/19/20 08:13 PM

The next major update will have GetNormalizedWorldPosition and GetRawNormalizedWorldPosition

votan 11/19/20 11:57 PM

Quote:

Originally Posted by ZOS_DanBatson (Post 42682)
The next major update will have GetNormalizedWorldPosition and GetRawNormalizedWorldPosition

Thank You,
:)

AlbinoPython 11/20/20 11:20 AM

Quote:

Originally Posted by ZOS_DanBatson (Post 42682)
The next major update will have GetNormalizedWorldPosition and GetRawNormalizedWorldPosition

:banana::banana::banana:

Shinni 11/20/20 02:06 PM

Quote:

Originally Posted by ZOS_DanBatson (Post 42682)
The next major update will have GetNormalizedWorldPosition and GetRawNormalizedWorldPosition

Thanks so much!
Quick question, will zoneId be part of the arguments or is it always relative to the current zone? Votan's request didn't specify zoneId but I thought it might be useful given that some maps display more than one zone and GetUnitWorldPosition returns zoneId, worldX, worldY, worldZ.

ZOS_DanBatson 11/24/20 10:51 AM

* GetNormalizedWorldPosition(*integer* _worldId_, *integer* _worldX_, *integer* _worldY_, *integer* _worldZ_)
** _Returns:_ *number* _normalizedX_, *number* _normalizedY_

You'll supply a world position, including the world id. So it doesn't have to be in the world you're in. However, it will be giving you the normalized position on the currently picked map. So if you want to get the normalized position for a different map, then you would need to change the map before calling this function.

sirinsidiator 11/24/20 11:04 AM

Is worldId the same as zoneId, or something new and different?

ZOS_DanBatson 11/24/20 11:00 PM

World id is not the same as zone id, nor is it new. Both have been around since the dawn of time. Some APIs use world, some use zone. Typically it depends on where the data comes from (we have WorldDefs and ZoneDefs.) Once upon an eon ago, a world could consist of multiple zones, but that was long before the game ever shipped. Now there's a one to one relationship between the world and the zone. For instance, Stonefalls is Zone id 41, World id 198.

Typically positions are world positions, which is why I used world id, but looking through the API, it seems like we usually use zone id to expose it and just get the world id from the zone in the code. So I probably need to change the new API to use zone id instead, to keep it consistent.

Baertram 11/25/20 03:20 AM

Or is there any API function to map the zoneId to worldId and the other way around?


All times are GMT -6. The time now is 03:22 PM.

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