Mav87th Posted March 14 Posted March 14 Hi In relation to editing Bankler's CASE1 recovery trainer i have managed to develop a script that can retrieve a named units magnetic heading from calculations off a table that has to be adjusted according to Date and theater (i used Grok to create the table for me - worked really good). The script is of course created for a carrier, but i guess it would work for any named unit. If any of you are interested i can post the script here
Minsky Posted March 14 Posted March 14 8 minutes ago, Mav87th said: a table that has to be adjusted according to Date and theater Just keep in mind that magnetic declination may vary significantly in different parts of the same map. That difference could be as big as 15-20 degrees (Kola). 1 Dima | My DCS uploads
Mav87th Posted March 14 Author Posted March 14 (edited) @Minsky exactly - hench the table that was created from lat long borders and the date the mission was to take place in. So say from -7°E to 51°E and 64°N to 76°N you get a table like this if you ask for a 1 deg resolution (which might be to fine a resolution, but it was to make sure) -- Declination grid for Kola map (-7°E to 51°E, 64°N to 76°N), 1° resolution, March 2006 local declinationGrid = { [76] = {[-7] = -4.35, [-6] = -4.25, [-5] = -4.15, [-4] = -4.05, [-3] = -3.95, [-2] = -3.85, [-1] = -3.75, [0] = -3.65, [1] = -3.55, [2] = -3.45, [3] = -3.35, [4] = -3.25, [5] = -3.15, [6] = -3.05, [7] = -2.95, [8] = -2.85, [9] = -2.75, [10] = -2.65, [11] = -2.55, [12] = -2.45, [13] = -2.35, [14] = -2.25, [15] = -2.15, [16] = -2.05, [17] = -1.95, [18] = -1.85, [19] = -1.75, [20] = -1.65, [21] = -1.55, [22] = -1.45, [23] = -1.35, [24] = -1.25, [25] = -1.15, [26] = -1.05, [27] = -0.95, [28] = -0.85, [29] = -0.75, [30] = -0.65, [31] = -0.55, [32] = -0.45, [33] = -0.35, [34] = -0.25, [35] = -0.15, [36] = -0.05, [37] = 0.05, [38] = 0.15, [39] = 0.25, [40] = 0.35, [41] = 0.45, [42] = 0.55, [43] = 0.65, [44] = 0.75, [45] = 0.85, [46] = 0.95, [47] = 1.05, [48] = 1.15, [49] = 1.25, [50] = 1.35, [51] = 1.45}, [75] = {[-7] = -4.25, [-6] = -4.15, [-5] = -4.05, [-4] = -3.95, [-3] = -3.85, [-2] = -3.75, [-1] = -3.65, [0] = -3.55, [1] = -3.45, [2] = -3.35, [3] = -3.25, [4] = -3.15, [5] = -3.05, [6] = -2.95, [7] = -2.85, [8] = -2.75, [9] = -2.65, [10] = -2.55, [11] = -2.45, [12] = -2.35, [13] = -2.25, [14] = -2.15, [15] = -2.05, [16] = -1.95, [17] = -1.85, [18] = -1.75, [19] = -1.65, [20] = -1.55, [21] = -1.45, [22] = -1.35, [23] = -1.25, [24] = -1.15, [25] = -1.05, [26] = -0.95, [27] = -0.85, [28] = -0.75, [29] = -0.65, [30] = -0.55, [31] = -0.45, [32] = -0.35, [33] = -0.25, [34] = -0.15, [35] = -0.05, [36] = 0.05, [37] = 0.15, [38] = 0.25, [39] = 0.35, [40] = 0.45, [41] = 0.55, [42] = 0.65, [43] = 0.75, [44] = 0.85, [45] = 0.95, [46] = 1.05, [47] = 1.15, [48] = 1.25, [49] = 1.35, [50] = 1.45, [51] = 1.55}, [74] = {[-7] = -4.15, [-6] = -4.05, [-5] = -3.95, [-4] = -3.85, [-3] = -3.75, [-2] = -3.65, [-1] = -3.55, [0] = -3.45, [1] = -3.35, [2] = -3.25, [3] = -3.15, [4] = -3.05, [5] = -2.95, [6] = -2.85, [7] = -2.75, [8] = -2.65, [9] = -2.55, [10] = -2.45, [11] = -2.35, [12] = -2.25, [13] = -2.15, [14] = -2.05, [15] = -1.95, [16] = -1.85, [17] = -1.75, [18] = -1.65, [19] = -1.55, [20] = -1.45, [21] = -1.35, [22] = -1.25, [23] = -1.15, [24] = -1.05, [25] = -0.95, [26] = -0.85, [27] = -0.75, [28] = -0.65, [29] = -0.55, [30] = -0.45, [31] = -0.35, [32] = -0.25, [33] = -0.15, [34] = -0.05, [35] = 0.05, [36] = 0.15, [37] = 0.25, [38] = 0.35, [39] = 0.45, [40] = 0.55, [41] = 0.65, [42] = 0.75, [43] = 0.85, [44] = 0.95, [45] = 1.05, [46] = 1.15, [47] = 1.25, [48] = 1.35, [49] = 1.45, [50] = 1.55, [51] = 1.65}, [73] = {[-7] = -4.05, [-6] = -3.95, [-5] = -3.85, [-4] = -3.75, [-3] = -3.65, [-2] = -3.55, [-1] = -3.45, [0] = -3.35, [1] = -3.25, [2] = -3.15, [3] = -3.05, [4] = -2.95, [5] = -2.85, [6] = -2.75, [7] = -2.65, [8] = -2.55, [9] = -2.45, [10] = -2.35, [11] = -2.25, [12] = -2.15, [13] = -2.05, [14] = -1.95, [15] = -1.85, [16] = -1.75, [17] = -1.65, [18] = -1.55, [19] = -1.45, [20] = -1.35, [21] = -1.25, [22] = -1.15, [23] = -1.05, [24] = -0.95, [25] = -0.85, [26] = -0.75, [27] = -0.65, [28] = -0.55, [29] = -0.45, [30] = -0.35, [31] = -0.25, [32] = -0.15, [33] = -0.05, [34] = 0.05, [35] = 0.15, [36] = 0.25, [37] = 0.35, [38] = 0.45, [39] = 0.55, [40] = 0.65, [41] = 0.75, [42] = 0.85, [43] = 0.95, [44] = 1.05, [45] = 1.15, [46] = 1.25, [47] = 1.35, [48] = 1.45, [49] = 1.55, [50] = 1.65, [51] = 1.75}, [72] = {[-7] = -3.95, [-6] = -3.85, [-5] = -3.75, [-4] = -3.65, [-3] = -3.55, [-2] = -3.45, [-1] = -3.35, [0] = -3.25, [1] = -3.15, [2] = -3.05, [3] = -2.95, [4] = -2.85, [5] = -2.75, [6] = -2.65, [7] = -2.55, [8] = -2.45, [9] = -2.35, [10] = -2.25, [11] = -2.15, [12] = -2.05, [13] = -1.95, [14] = -1.85, [15] = -1.75, [16] = -1.65, [17] = -1.55, [18] = -1.45, [19] = -1.35, [20] = -1.25, [21] = -1.15, [22] = -1.05, [23] = -0.95, [24] = -0.85, [25] = -0.75, [26] = -0.65, [27] = -0.55, [28] = -0.45, [29] = -0.35, [30] = -0.25, [31] = -0.15, [32] = -0.05, [33] = 0.05, [34] = 0.15, [35] = 0.25, [36] = 0.35, [37] = 0.45, [38] = 0.55, [39] = 0.65, [40] = 0.75, [41] = 0.85, [42] = 0.95, [43] = 1.05, [44] = 1.15, [45] = 1.25, [46] = 1.35, [47] = 1.45, [48] = 1.55, [49] = 1.65, [50] = 1.75, [51] = 1.85}, [71] = {[-7] = -3.85, [-6] = -3.75, [-5] = -3.65, [-4] = -3.55, [-3] = -3.45, [-2] = -3.35, [-1] = -3.25, [0] = -3.15, [1] = -3.05, [2] = -2.95, [3] = -2.85, [4] = -2.75, [5] = -2.65, [6] = -2.55, [7] = -2.45, [8] = -2.35, [9] = -2.25, [10] = -2.15, [11] = -2.05, [12] = -1.95, [13] = -1.85, [14] = -1.75, [15] = -1.65, [16] = -1.55, [17] = -1.45, [18] = -1.35, [19] = -1.25, [20] = -1.15, [21] = -1.05, [22] = -0.95, [23] = -0.85, [24] = -0.75, [25] = -0.65, [26] = -0.55, [27] = -0.45, [28] = -0.35, [29] = -0.25, [30] = -0.15, [31] = -0.05, [32] = 0.05, [33] = 0.15, [34] = 0.25, [35] = 0.35, [36] = 0.45, [37] = 0.55, [38] = 0.65, [39] = 0.75, [40] = 0.85, [41] = 0.95, [42] = 1.05, [43] = 1.15, [44] = 1.25, [45] = 1.35, [46] = 1.45, [47] = 1.55, [48] = 1.65, [49] = 1.75, [50] = 1.85, [51] = 1.95}, [70] = {[-7] = -3.75, [-6] = -3.65, [-5] = -3.55, [-4] = -3.45, [-3] = -3.35, [-2] = -3.25, [-1] = -3.15, [0] = -3.05, [1] = -2.95, [2] = -2.85, [3] = -2.75, [4] = -2.65, [5] = -2.55, [6] = -2.45, [7] = -2.35, [8] = -2.25, [9] = -2.15, [10] = -2.05, [11] = -1.95, [12] = -1.85, [13] = -1.75, [14] = -1.65, [15] = -1.55, [16] = -1.45, [17] = -1.35, [18] = -1.25, [19] = -1.15, [20] = -1.05, [21] = -0.95, [22] = -0.85, [23] = -0.75, [24] = -0.65, [25] = -0.55, [26] = -0.45, [27] = -0.35, [28] = -0.25, [29] = -0.15, [30] = -0.05, [31] = 0.05, [32] = 0.15, [33] = 0.25, [34] = 0.35, [35] = 0.45, [36] = 0.55, [37] = 0.65, [38] = 0.75, [39] = 0.85, [40] = 0.95, [41] = 1.05, [42] = 1.15, [43] = 1.25, [44] = 1.35, [45] = 1.45, [46] = 1.55, [47] = 1.65, [48] = 1.75, [49] = 1.85, [50] = 1.95, [51] = 2.05}, [69] = {[-7] = -3.65, [-6] = -3.55, [-5] = -3.45, [-4] = -3.35, [-3] = -3.25, [-2] = -3.15, [-1] = -3.05, [0] = -2.95, [1] = -2.85, [2] = -2.75, [3] = -2.65, [4] = -2.55, [5] = -2.45, [6] = -2.35, [7] = -2.25, [8] = -2.15, [9] = -2.05, [10] = -1.95, [11] = -1.85, [12] = -1.75, [13] = -1.65, [14] = -1.55, [15] = -1.45, [16] = -1.35, [17] = -1.25, [18] = -1.15, [19] = -1.05, [20] = -0.95, [21] = -0.85, [22] = -0.75, [23] = -0.65, [24] = -0.55, [25] = -0.45, [26] = -0.35, [27] = -0.25, [28] = -0.15, [29] = -0.05, [30] = 0.05, [31] = 0.15, [32] = 0.25, [33] = 0.35, [34] = 0.45, [35] = 0.55, [36] = 0.65, [37] = 0.75, [38] = 0.85, [39] = 0.95, [40] = 1.05, [41] = 1.15, [42] = 1.25, [43] = 1.35, [44] = 1.45, [45] = 1.55, [46] = 1.65, [47] = 1.75, [48] = 1.85, [49] = 1.95, [50] = 2.05, [51] = 2.15}, [68] = {[-7] = -3.55, [-6] = -3.45, [-5] = -3.35, [-4] = -3.25, [-3] = -3.15, [-2] = -3.05, [-1] = -2.95, [0] = -2.85, [1] = -2.75, [2] = -2.65, [3] = -2.55, [4] = -2.45, [5] = -2.35, [6] = -2.25, [7] = -2.15, [8] = -2.05, [9] = -1.95, [10] = -1.85, [11] = -1.75, [12] = -1.65, [13] = -1.55, [14] = -1.45, [15] = -1.35, [16] = -1.25, [17] = -1.15, [18] = -1.05, [19] = -0.95, [20] = -0.85, [21] = -0.75, [22] = -0.65, [23] = -0.55, [24] = -0.45, [25] = -0.35, [26] = -0.25, [27] = -0.15, [28] = -0.05, [29] = 0.05, [30] = 0.15, [31] = 0.25, [32] = 0.35, [33] = 0.45, [34] = 0.55, [35] = 0.65, [36] = 0.75, [37] = 0.85, [38] = 0.95, [39] = 1.05, [40] = 1.15, [41] = 1.25, [42] = 1.35, [43] = 1.45, [44] = 1.55, [45] = 1.65, [46] = 1.75, [47] = 1.85, [48] = 1.95, [49] = 2.05, [50] = 2.15, [51] = 2.25}, [67] = {[-7] = -3.45, [-6] = -3.35, [-5] = -3.25, [-4] = -3.15, [-3] = -3.05, [-2] = -2.95, [-1] = -2.85, [0] = -2.75, [1] = -2.65, [2] = -2.55, [3] = -2.45, [4] = -2.35, [5] = -2.25, [6] = -2.15, [7] = -2.05, [8] = -1.95, [9] = -1.85, [10] = -1.75, [11] = -1.65, [12] = -1.55, [13] = -1.45, [14] = -1.35, [15] = -1.25, [16] = -1.15, [17] = -1.05, [18] = -0.95, [19] = -0.85, [20] = -0.75, [21] = -0.65, [22] = -0.55, [23] = -0.45, [24] = -0.35, [25] = -0.25, [26] = -0.15, [27] = -0.05, [28] = 0.05, [29] = 0.15, [30] = 0.25, [31] = 0.35, [32] = 0.45, [33] = 0.55, [34] = 0.65, [35] = 0.75, [36] = 0.85, [37] = 0.95, [38] = 1.05, [39] = 1.15, [40] = 1.25, [41] = 1.35, [42] = 1.45, [43] = 1.55, [44] = 1.65, [45] = 1.75, [46] = 1.85, [47] = 1.95, [48] = 2.05, [49] = 2.15, [50] = 2.25, [51] = 2.35}, [66] = {[-7] = -3.35, [-6] = -3.25, [-5] = -3.15, [-4] = -3.05, [-3] = -2.95, [-2] = -2.85, [-1] = -2.75, [0] = -2.65, [1] = -2.55, [2] = -2.45, [3] = -2.35, [4] = -2.25, [5] = -2.15, [6] = -2.05, [7] = -1.95, [8] = -1.85, [9] = -1.75, [10] = -1.65, [11] = -1.55, [12] = -1.45, [13] = -1.35, [14] = -1.25, [15] = -1.15, [16] = -1.05, [17] = -0.95, [18] = -0.85, [19] = -0.75, [20] = -0.65, [21] = -0.55, [22] = -0.45, [23] = -0.35, [24] = -0.25, [25] = -0.15, [26] = -0.05, [27] = 0.05, [28] = 0.15, [29] = 0.25, [30] = 0.35, [31] = 0.45, [32] = 0.55, [33] = 0.65, [34] = 0.75, [35] = 0.85, [36] = 0.95, [37] = 1.05, [38] = 1.15, [39] = 1.25, [40] = 1.35, [41] = 1.45, [42] = 1.55, [43] = 1.65, [44] = 1.75, [45] = 1.85, [46] = 1.95, [47] = 2.05, [48] = 2.15, [49] = 2.25, [50] = 2.35, [51] = 2.45}, [65] = {[-7] = -3.25, [-6] = -3.15, [-5] = -3.05, [-4] = -2.95, [-3] = -2.85, [-2] = -2.75, [-1] = -2.65, [0] = -2.55, [1] = -2.45, [2] = -2.35, [3] = -2.25, [4] = -2.15, [5] = -2.05, [6] = -1.95, [7] = -1.85, [8] = -1.75, [9] = -1.65, [10] = -1.55, [11] = -1.45, [12] = -1.35, [13] = -1.25, [14] = -1.15, [15] = -1.05, [16] = -0.95, [17] = -0.85, [18] = -0.75, [19] = -0.65, [20] = -0.55, [21] = -0.45, [22] = -0.35, [23] = -0.25, [24] = -0.15, [25] = -0.05, [26] = 0.05, [27] = 0.15, [28] = 0.25, [29] = 0.35, [30] = 0.45, [31] = 0.55, [32] = 0.65, [33] = 0.75, [34] = 0.85, [35] = 0.95, [36] = 1.05, [37] = 1.15, [38] = 1.25, [39] = 1.35, [40] = 1.45, [41] = 1.55, [42] = 1.65, [43] = 1.75, [44] = 1.85, [45] = 1.95, [46] = 2.05, [47] = 2.15, [48] = 2.25, [49] = 2.35, [50] = 2.45, [51] = 2.55}, [64] = {[-7] = -3.15, [-6] = -3.05, [-5] = -2.95, [-4] = -2.85, [-3] = -2.75, [-2] = -2.65, [-1] = -2.55, [0] = -2.45, [1] = -2.35, [2] = -2.25, [3] = -2.15, [4] = -2.05, [5] = -1.95, [6] = -1.85, [7] = -1.75, [8] = -1.65, [9] = -1.55, [10] = -1.45, [11] = -1.35, [12] = -1.25, [13] = -1.15, [14] = -1.05, [15] = -0.95, [16] = -0.85, [17] = -0.75, [18] = -0.65, [19] = -0.55, [20] = -0.45, [21] = -0.35, [22] = -0.25, [23] = -0.15, [24] = -0.05, [25] = 0.05, [26] = 0.15, [27] = 0.25, [28] = 0.35, [29] = 0.45, [30] = 0.55, [31] = 0.65, [32] = 0.75, [33] = 0.85, [34] = 0.95, [35] = 1.05, [36] = 1.15, [37] = 1.25, [38] = 1.35, [39] = 1.45, [40] = 1.55, [41] = 1.65, [42] = 1.75, [43] = 1.85, [44] = 1.95, [45] = 2.05, [46] = 2.15, [47] = 2.25, [48] = 2.35, [49] = 2.45, [50] = 2.55, [51] = 2.65} } Edited March 14 by Mav87th 1
Minsky Posted March 14 Posted March 14 5 minutes ago, Mav87th said: @Minsky exactly - hench the table that was created from lat long borders and the date the mission was to take place in. Ah, great, glad you catered for that! Dima | My DCS uploads
Mav87th Posted March 14 Author Posted March 14 I may have made a lot of other mistakes in the script, so keep up the critical mindset
ops Posted March 14 Posted March 14 Hi, for Singleplayer, you can use built-in functions of DCS, e.g.: local myaw = net.dostring_in("export", "return LoGetMagneticYaw()") myaw = tonumber(myaw) * (180 / math.pi) if myaw < 0 then myaw = myaw + 360 end trigger.action.outText("magnetic yaw: " .. tostring(myaw), 5, true)
Mav87th Posted March 22 Author Posted March 22 @ops thats pretty cool and hell of a lot easier Is it giving you any units magnetic heading? (replacing myaw with the unit name?) Is there a similar functionality for MP so all clients can get the magnetic heading of a named unit?
Recommended Posts