Originally Posted by awfuldead
what about GetUnitWorldPosition('player') ?
|
Thank! This function does return the Z coordinate in some strange integer units, but that's not a problem. It is even stranger how this quantity behaves. For example, it changes when moving on a horizontal surface (for example, on water). When descending from the portal of Artaeum to the water, it first decreases from 133k to 126k, and then begins to grow again and at the water level is the same 133k. This is already a problem. I checked the code and there is nowhere to go wrong.
Lua Code:
local _, worldX, worldY, worldZ = GetUnitWorldPosition("player")
d("X: "..worldX)
d("Y: "..worldY)
d("Z: "..worldZ)
Originally Posted by Sharlikran
If you get the Z position then keep in mind that is the 3D position. For example say your 2D position is 100,100 the 3D position might be 1000, 1000, 2000. Use Lib3D to do conversions if needed.
|
Thank you, I am aware of this. And I'm already using Lib3d to transform coordinates to a more convenient form.
Unfortunately in this game it is not possible to get an unambiguous transformation from 2D coordinates to 3D. There are bridges over the ravines, cliffs can hang over the surface. A person can stand at the top, or maybe at the bottom and have the same 2D coordinate. For an unambiguous transformation, three coordinates are needed. Yes, they can be in other units, they can be in a different basis, even if in a non-orthogonal system. But still there should be three of them.
Lib3D has a
GetFirstPersonRenderSpacePosition function that returns the 3D position of the point of view. It would suit me, but it doesn't work on the mount. And this is very important. Why do you need a GPS navigator with which you can only walk? In addition, when called, it gives an error.