Quote: "height difference between moves = destination height - current height
slope of a line = y/x
so figure how steep you want the limit, store the slope calculation as a constant. (cause that number doesn't need to ever change)
If the height difference is greater than the slope allowed, don't move.
This method is more dependent on how faster you're moving. Moving very slowly, you can most likely still climb steep hills. So its not a great method, but computationally easier than processing the vectors all the time.
"
I second it all. Though I have some words to say about it.
The "moving slow problem" can be solved by not calculating the height difference between destination and current height, but using a set distance in the direction the player will move instead of the destination height.
Besides that, the command
intersect object(Object, x1#, y1#, z1#, x2#, y2#, z2#) will give you the exact distance of the intersection point to the coords of x1#,y1#,z1#. If you take y1# = 0.0 and y2# a point above the terrain, then that means that the distance# = height# of the terrain.
It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.