gokuta

(3) Z coord ? This is what I'm trying to find out, parameter seems to be useless (is it?)

Returned value is supposed to be a height of the ground when X and Y (and Z) are specified. But well, it normally returns me height which is below the ground and also it returns a height above the ground if I'm under water (seems like it simply returns me zero). Am I using it improperly or what? It does not return me the Z coordinate of the ground.

Deji

Well, you need to check for water with 092E. If water height is higher than the ground height, the position is probably above water.

I'd think the Z coord would make the command, only return heights below it. Though -100.0 as a Z coord is known to do this job for the highest ground in this and many other commands (such as create_char).

However, one infamous problem occurring from this happens when the area of the position of the map you're trying to get the height of isn't loaded. It would work perfectly in an area in CJ's range, though. So to get the coordinates you first need to load the scene.

Keeping the scene loaded can be a bit of an issue though. If the area is not near the player, it'll just be streamed out. You specifically want the collision to stay loaded. If you know the part of the map you're getting the height of, this is completely avoidable by using LOAD_MODEL with the model IDs used to make up at that point. I have no ultimate solution (or I may have, but have forgotten the specifics) for the other, though my interest was to keep the map loaded during camera movement. On the other hand, LOAD_SCENE may work fine for you if you only nees it to get the ground height. If you want to teleport there, you have to try to make it happen without falling below the ground.

EDIT: Posting on mobile, I may be able to find a definite solution when I get back on PC.

gokuta

Thanks, Deji, some testing showed, that you were right about the Z coordinate meaning minimum height. A also tried to set area rendering for areas containing no collision data (that are far away from the player), but it didn't work out. The area was rendered for a really short time only and my code got no clue about what the correct height is :x how to properly render a distant area?