Nero.ger Posted September 23, 2018 Share Posted September 23, 2018 (edited) as mentioned in the other thread this is the list of usefull terrain related function for the "aircraft-enviroment". Pretty sure its not a complete list. local map = get_terrain_related_data("name") --on what map am i on? --"Persian Gulf" --"Caucasus" local Terrain = require('terrain') --everything below requires Terrain --X , Z , Alt Coords are in Meters! Terrain.GetHeight(x, z) --gives you the hight of the terrain at x,z in meters -- for a LOS check is suggest adding 1m to the hight, or round up -- otherwise you might get strange results Terrain.isVisible(x1, alt1, z1, x2, alt2, z2) -- check Terrain Line of sight (ignores buildings/trees) Terrain.GetSurfaceType(x,z) -- gives you the type of terrain. -- LAND 1 -- SHALLOW_WATER 2 -- WATER 3 -- ROAD 4 -- RUNWAY 5 -- during my last test there was not landtype for Woods local tmp_lat,tmp_long = Terrain.convertMetersToLatLon(x,z) -- turns the Meters Coords system to LatLong (be aware , it returns 2 vars) local x, z = Terrain.convertLatLonToMeters(lat,long) --gets you the METERS coord system from Lat Long other examples: BasicRadar Terrain Functions BasicRWR Edited January 7, 2019 by Nero.ger Fixed error 'controlling' the Ka50 feels like a discussion with the Autopilot and trim system about the flight direction. Link to comment Share on other sites More sharing options...
cubanace Posted September 24, 2018 Share Posted September 24, 2018 as mentioned in the other thread this is the list of usefull terrain related function for the "aircraft-enviroment". Pretty sure its not a complete list. local map = get_terrain_related_data("name") --on what map am i on? --"Persian Gulf" --"Caucasus" local Terrain = require('terrain') --everything below requires Terrain --X , Z , Alt Coords are in Meters! Terrain.GetHeight(x, z) --gives you the hight of the terrain at x,z in meters -- for a LOS check is suggest adding 1m to the hight, or round up -- otherwise you might get strange results Terrain.isVisible(x1, alt1, z1, x2, alt2, z2) -- check Terrain Line of sight (ignores buildings/trees) Terrain.GetSurfaceType(x,z) -- gives you the type of terrain. -- LAND 1 -- SHALLOW_WATER 2 -- WATER 3 -- ROAD 4 -- RUNWAY 5 -- during my last test there was not landtype for Woods local tmp_lat,tmp_long = Terrain.convertMetersToLatLon(x,z) -- turns the Meters Coords system to LatLong (be aware , it returns 2 vars) local x, z = Terrain.convertLatLonToMeters(lat , long) --gets you the METERS coord system from Lat Long Thank you Nero. SU-57 Discord https://discord.gg/kVUEak6b66 Link to comment Share on other sites More sharing options...
PeaceSells Posted September 24, 2018 Share Posted September 24, 2018 As always, pretty useful stuff. Thanks a lot for sharing!! My DCS modding videos: Modules I own so far: Black Shark 2, FC3, UH-1H, M-2000C, A-10C, MiG-21, Gazelle, Nevada map Link to comment Share on other sites More sharing options...
Recommended Posts