Game Development Community

Get terrain height data based on position

by Rob Segal · in Torque Game Engine · 01/23/2006 (8:50 pm) · 3 replies

Give an arbitrary point in a mission would I be able to determine the height of the terrain at said point? What I would like to do is spawn random ai players around the map but of course I want to be sure those players are not going to end up underneath the terrain. I could do this using spawn spheres and I have seen some discussion on that. What I am curious of is if you can do the same kind of thing without the aid of a spawn sphere.

#1
01/23/2006 (11:26 pm)
Someone recently posted a function that does something similar, you may want to search for the resouce/forum thread where it was posted.

There are also some low level functions that are available in the terrain system for getting the height of a particular coordinate, you could simply expose this to script via a ConsoleMethod.
#2
01/24/2006 (12:57 pm)
Perhaps the built-in script function getTerrainHeight() would be useful?
#3
01/24/2006 (1:29 pm)
Hmmm... getTerrainHeight. Damn. If that works that is sweet. Thanks for the suggestions guys I would imagine I will find my answer in one of those two routes.