Habu_69 Posted February 3, 2018 Posted February 3, 2018 Can anyone enlighten me, with an example perhaps, on how to use this script function? Specifically, what is the format for the GeoCoord latitude/longitude data? vec3 coord.LLtoLO(GeoCoord latitude, GeoCoord longitude , number altitude) For example, how would I convert lat/long data available from the ME map cursor position (stated in DMS or DM) to Vec3?
Grimes Posted February 4, 2018 Posted February 4, 2018 Its just a number. local point = coord.LLtoLO(44.2353252234, 32.354523456) Its degrees.minutes with minutes being a decimal number. So converting minutes and seconds to a decimal form takes some math but isn't that terrible. I think its a basic (minutes/60) and (seconds/3600) and add both values up. You can't actually get the mouse position to convert to a point, but I am assuming you mean that just for figuring out the coordinate you want to convert. Alternatively you can get it two other ways. 1. Place a unit at the coordinate and run.. Unit.getByName('whatever'):getPosition().p and that will give you the vec3 of the unit. 2. In the editor press the key combo RAlt+Y to change the coordinats used in the editor. One of the coordinate systems is the what the game uses. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Habu_69 Posted February 4, 2018 Author Posted February 4, 2018 (edited) Tx. I have been seeking this info for awhile. So in your first example D.M is 44D 23.53252234M, where the absissa (23.53252234) is minutes? Or DMS expressed all in degrees, as 44.392208706 (D). My purpose is to spawn an object at an ME map location identified by lat/long cursor position. Edited February 4, 2018 by Habu_69
Recommended Posts