-
Posts
10 -
Joined
-
Last visited
-
I'm working on a CH-47 mission and am wondering, is it possible to have a JTAC or some other asset (or trigger) illuminate an LZ with an IR pointer? With logistics becoming a larger part of the game I want to be able to do this, as well as have ground units use an IZLID to signal with a lasso or setup IR chem lights to mark an LZ with a NATO Y, etc.
-
Mike Force Team started following Bearmat
-
This should add the leading 0's: function ExportScript.PILOT_HSI_BEARING_POINTER(mainPanelDevice) -- Bearmat local bearing_value = mainPanelDevice:get_argument_value(670) * 360 local formatted_bearing = string.format("%03.0f", bearing_value) ExportScript.Tools.SendData(export_ids.PILOT_HSI_BEARING_POINTER, formatted_bearing) end
-
Two things: 1. If possible, how do I get the export values to update faster? Is it possible to just make specific values update faster, rather than all? I think this would help me judge the accuracy of the rad alt export better. EDIT: Moved the ID to HighImportance and this seems to have done the trick. 2. Here is the rad alt script. Please check it out and let me know how it's working. It appears to be within a few feet for me in my limited testing so far: function ExportScript.RADAR_ALTITUDE(mainPanelDevice) local radar_altitude_value = mainPanelDevice:get_argument_value(73) local altitude_table = { {0.0000, 0}, {0.0155, 0}, -- on ground {0.1681, 50}, {0.2220, 100}, -- average between 0.2080 and 0.2220 {0.2950, 150}, {0.3682, 200}, -- new value {0.4597, 300}, {0.5705, 500}, -- new value {0.6933, 1000}, -- average between 0.6933 and 0.7145 {0.7733, 1500}, {0.8159, 2000}, -- average between 0.8159 and 0.8224 {0.9011, 3000}, -- average between 0.9011 and 0.9630 {0.9839, 5000} } local function interpolate(value, table) for i = 1, #table - 1 do if value >= table[i][1] and value <= table[i + 1][1] then local ratio = (value - table[i][1]) / (table[i + 1][1] - table[i][1]) return table[i][2] + ratio * (table[i + 1][2] - table[i][2]) end end return 0 -- return 0 if value is out of bounds end local radar_altitude_feet = interpolate(radar_altitude_value, altitude_table) local formatted_radar_altitude = string.format("%d", radar_altitude_feet) ExportScript.Tools.SendData(export_ids.RADAR_ALTITUDE, formatted_radar_altitude) end
-
Hello. Just wanted to let you know this is working well for me too. I appreciate it very much. I don't know anything about scripting but have been working on a few simple exports with the help of a little backwards engineering and LUA God. They seem to be working fine for me. If anyone is interested in checking them out: function ExportScript.PILOT_HSI_BEARING_POINTER(mainPanelDevice) local bearing_value = mainPanelDevice:get_argument_value(670) * 360 local formatted_bearing = string.format("%.0f", bearing_value) ExportScript.Tools.SendData(export_ids.PILOT_HSI_BEARING_POINTER, formatted_bearing) end function ExportScript.LEFT_ENGINE_RPM(mainPanelDevice) local rpm_value = mainPanelDevice:get_argument_value(299) * 100 local formatted_rpm = string.format("%.0f", rpm_value) ExportScript.Tools.SendData(export_ids.LEFT_ENGINE_RPM, formatted_rpm) end function ExportScript.RIGHT_ENGINE_RPM(mainPanelDevice) local rpm_value = mainPanelDevice:get_argument_value(300) * 100 local formatted_rpm = string.format("%.0f", rpm_value) ExportScript.Tools.SendData(export_ids.RIGHT_ENGINE_RPM, formatted_rpm) end function ExportScript.VSI_INDICATION(mainPanelDevice) local vsi_value = mainPanelDevice:get_argument_value(90) local vsi_fpm = vsi_value * 6000 local formatted_vsi = string.format("%d", vsi_fpm) ExportScript.Tools.SendData(export_ids.VSI_INDICATION, formatted_vsi) end function ExportScript.AOA_INDEXER(mainPanelDevice) local aoa_value = mainPanelDevice:get_argument_value(70) local aoa_units = aoa_value * 30 local formatted_aoa = string.format("%d", aoa_units) ExportScript.Tools.SendData(export_ids.AOA_INDEXER, formatted_aoa) end Also working on the rad alt. The math is a little off and I think it has more to do with some offsets between the raw values and eye-balling the needle value. If anyone has any idea on how to get these as close as possible, I would appreciate it.