xjiks Posted April 27, 2017 Share Posted April 27, 2017 Hi everyone, I'm trying to find a way to export the waypoints written in the DCS mission files but I can't find what format is used. I've just made a mission with the in game editor and made 4 wayponts. If I extract the miz file and read the "mission" file in notepad I get the initial coordinates of waypoint like this: ["alt"] = 9, ["alt_type"] = "BARO", ["livery_id"] = "af standard 1", ["skill"] = "Client", ["speed"] = 138.88888888889, ["type"] = "Su-25T", ["unitId"] = 1, ["psi"] = 3.1210046242644, ["y"] = 564387.05872916, ["x"] = -220531.73642658, ["name"] = "DictKey_UnitName_6", ["payload"] = How can I convert the "x" and "y" to something usable? The coordinates in this example are the coordinates of Sukhumi airport L'important n'est pas de tuer, mais de survivre. [sIGPIC][/sIGPIC] if you read this you are too curious Link to comment Share on other sites More sharing options...
Nero.ger Posted April 27, 2017 Share Posted April 27, 2017 the question is, what is your intention? and in what enviroment? Export.lua? LuaDevice? '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...
xjiks Posted April 27, 2017 Author Share Posted April 27, 2017 I want to read the file and mark the points in Google maps. There is no software interaction with dcs. I would like to grab the file from dcs temp when a mission is loaded in the game and process the file directly. Do you think it's possible to retrieve the nav points from the export? L'important n'est pas de tuer, mais de survivre. [sIGPIC][/sIGPIC] if you read this you are too curious Link to comment Share on other sites More sharing options...
Nero.ger Posted April 27, 2017 Share Posted April 27, 2017 there is a function('LoGetRoute()') in the export.lua to grad nav points but it was bugged last time i checked, but i suspect by 'export' you mean the reading the .miz file :) i know of no easy calculation outside of using lua and DCS-Functions to convert Coordinates. '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...
xjiks Posted April 27, 2017 Author Share Posted April 27, 2017 there is a function('LoGetRoute()') in the export.lua to grad nav points but it was bugged last time i checked, but i suspect by 'export' you mean the reading the .miz file :) i know of no easy calculation outside of using lua and DCS-Functions to convert Coordinates. I found comments about the LoGetRoute but it seems most people don't manage to make it work. So I don't want to spend time if the function is broken. My approach is to get the "mission" file to retreive the navigation coordinates, because actually I input them manually and alt+tab from the game to input them in google maps Also when joining a multiplayer server running a mission I've never played before, it's impossible to know the waypoints for an aircraft or on the F10 map or the briefing and that's why I intend to read the mission from the temp folder to get the waypoints data. L'important n'est pas de tuer, mais de survivre. [sIGPIC][/sIGPIC] if you read this you are too curious Link to comment Share on other sites More sharing options...
Nero.ger Posted April 27, 2017 Share Posted April 27, 2017 (edited) if i am not totaly wrong, you can see the Route of the Aircraft you are in in the Kneeboard? edit: in case someone in the future stubles across this thread in search for a lua function to convert :) Terrain = require('terrain') lat,long = Terrain.convertMetersToLatLon(meter_x,meter_z) Edited April 27, 2017 by Nero.ger '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...
xjiks Posted April 27, 2017 Author Share Posted April 27, 2017 if i am not totaly wrong, you can see the Route of the Aircraft you are in in the Kneeboard? edit: in case someone in the future stubles across this thread in search for a lua function to convert :) Terrain = require('terrain') lat,long = Terrain.convertMetersToLatLon(meter_x,meter_z) Interesting, how would you use that ? in export.lua ? does the "meter_x" and "meter_z" are the "x" and "y" from the coordinates ["x"] = -220531.73642658 ["y"] = 564387.05872916, ? 1 L'important n'est pas de tuer, mais de survivre. [sIGPIC][/sIGPIC] if you read this you are too curious Link to comment Share on other sites More sharing options...
Nero.ger Posted April 27, 2017 Share Posted April 27, 2017 while i never tested this in the export.lua, but the there is no need because {x,y,z} = LoGeoCoordinatesToLoCoordinates(longitude_degrees,latitude_degrees) can be called in the export.lua (if it works, never used it myself) 1 '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...
xjiks Posted April 27, 2017 Author Share Posted April 27, 2017 ok thanks for your help, maybe I'll go with the export.lua need time to work on this now :thumbup: L'important n'est pas de tuer, mais de survivre. [sIGPIC][/sIGPIC] if you read this you are too curious Link to comment Share on other sites More sharing options...
Nero.ger Posted April 27, 2017 Share Posted April 27, 2017 just realized it was the wrong function, it should be :) {latitude,longitude} = LoLoCoordinatesToGeoCoordinates(x,z); '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...
BR55Sevas Posted April 28, 2017 Share Posted April 28, 2017 (edited) I`m also work with ingame coordinates. I have to say dcs-gps coords has good precision, not 100% but pretty accurate. The reason as I know that basement of dcs-terrain is flat, supported by elefants and turtle, so in ideal way you have to use some calibration net to fix coords displaysment. But I have no idea how to do that. Edited April 28, 2017 by BR=55=Sevas МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl Link to comment Share on other sites More sharing options...
BR55Sevas Posted April 28, 2017 Share Posted April 28, 2017 if i am not totaly wrong, you can see the Route of the Aircraft you are in in the Kneeboard? edit: in case someone in the future stubles across this thread in search for a lua function to convert :) Terrain = require('terrain') lat,long = Terrain.convertMetersToLatLon(meter_x,meter_z) Many thanks for this! One question - does meter_x and meter_z vars returns value from terrain, or you define them some way? I mean how to get meter_z meter_x before I`ll put them into convertMetersToLatLon function? МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl Link to comment Share on other sites More sharing options...
Nero.ger Posted April 28, 2017 Share Posted April 28, 2017 (edited) depends on where you come from, you can see them on the F10 map in the upper left corner (need to change coord system with ctrl-z or y) you can get them from the MIZ file where they are called x and y(z) in LUAdevices you can call, for example local tmp_mission_route = get_mission_route() local tmp_lat local tmp_long for i = 2, #tmp_mission_route do WPT_data[i-1].m_x = tmp_mission_route[i]["x"] WPT_data[i-1].m_y = tmp_mission_route[i]["y"] WPT_data[i-1].alt = tmp_mission_route[i]["alt"] tmp_lat,tmp_long = Terrain.convertMetersToLatLon(WPT_data[i-1].m_x,WPT_data[i-1].m_y) WPT_data[i-1].lat_x = tmp_lat WPT_data[i-1].long_y = tmp_long end you can call Data_Raw = get_base_data() local self_loc_x , own_alt, self_loc_y = Data_Raw.getSelfCoordinates() to get your own coordinates (again in meters, thankfully!) while we are at it ground_alt = math.ceil(Terrain.GetHeight(x, y)) gives you the hight of a point on the terrain. why the Ceil function? because if you want to check Line of Sight to a point its better if its 90cm above the ground than exactly on the ground which is done by Terrain.isVisible(x1, alt1, y1, x2, alt2, y2), in case you are wondering :-D i think that should cover it :smartass: Edited April 28, 2017 by Nero.ger '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...
BR55Sevas Posted April 28, 2017 Share Posted April 28, 2017 Many many thanks! :thumbup: Now I know how to make ground radar for my drone. МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl Link to comment Share on other sites More sharing options...
Nero.ger Posted April 28, 2017 Share Posted April 28, 2017 Now I know how to make ground radar for my drone. my notes in front of me have by 'pure coincidence' written "Ground mapping radar" on them ;) '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...
Recommended Posts