(Created the page; added GetHeight, GetSteepness) |
(Added the Navbox) |
||
Line 16: | Line 16: | ||
Space.Log(terrain.Terrain.GetSteepness (408/512,63/512)); | Space.Log(terrain.Terrain.GetSteepness (408/512,63/512)); | ||
''-- prints the steepness of the terrain at the global point (408,63) to the console.''}} | ''-- prints the steepness of the terrain at the global point (408,63) to the console.''}} | ||
+ | |||
+ | {{Scripting Navbox}} |
The STerrain class allows the script to work with the terrain-related data.
Gets the height at the (x,y) point. Floats x,y are given within the range from 0 to 1. If we want this script to work with global x, z coordinates, we need to divide their values by the width/length of the terrain respectively (if the terrain's bottom left corner is at the origin).
-- 1 Object Reference to the Terrain object, Name: "terrain".
local terrain = Space.Host.GetReference("terrain");
Space.Log(terrain.Terrain.GetHeight (206/512,198/512));
Gets the steepness at the (x,y) point. Floats x,y are given within the range from 0 to 1. If we want this script to work with global x, z coordinates, we need to divide their values by the width/length of the terrain respectively.
-- 1 Object Reference to the Terrain object, Name: "terrain".
local terrain = Space.Host.GetReference("terrain");
Space.Log(terrain.Terrain.GetSteepness (408/512,63/512));
|