Jump to content

Export and use coordinates in mission file


xjiks

Recommended Posts

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

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

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

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

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 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

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, ?

  • Like 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

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)

  • Like 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

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

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.

 

iesH3ZAdXbE.jpg


Edited by BR=55=Sevas
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...