Jump to content

bones1014

Members
  • Posts

    648
  • Joined

  • Last visited

Posts posted by bones1014

  1. Tried making a keybind for putting on the helmet but it doesn't work. Removed and changed it a different combo with no change.

    *EDIT*
    The names of the keybinds are swapped. The ones that says put helmet on actually removes it.

  2. I added a TACAN command status light option to the TACAN channel export. I made it export 10073. I'll work on one for the Comm Command light too.  Should be done here shortly.

    *EDIT*
    I guess the UHF hasn't been completed yet so the comm command light will have to wait.

    function ExportScript.TACAN_channels(mainPanelDevice)
        -- PILOT
        local ones = mainPanelDevice:get_argument_value(643)
        local tens = mainPanelDevice:get_argument_value(644)
        local hundreds = mainPanelDevice:get_argument_value(645)
        local mode = mainPanelDevice:get_argument_value(656) > 0.5 and "Y" or "X"
    
        local _, tens_decimal = math.modf(tens)
        if tens_decimal > 0.91 then tens_decimal = 0 end
        --tacan command indicator
        local tacan_command 
        if mainPanelDevice:get_argument_value(170) > 0 then tacan_command = "" 
            else tacan_command = "" 
        end
        ExportScript.Tools.SendData(export_ids.PILOT_TACAN_FREQ_CMD_LGHT, string.format("%.0f%.0f%.0f%s", hundreds * 10, tens_decimal * 10, ones * 10, mode) .. 
                                    "\n" .. tacan_command)
        ExportScript.Tools.SendData(export_ids.PILOT_TACAN_FREQUENCY,
            string.format("%.0f%.0f%.0f%s", hundreds * 10, tens_decimal * 10, ones * 10, mode))
    
        -- WSO
        local ones = mainPanelDevice:get_argument_value(650)
        local tens = mainPanelDevice:get_argument_value(651)
        local hundreds = mainPanelDevice:get_argument_value(652)
        local mode = mainPanelDevice:get_argument_value(660) > 0.5 and "Y" or "X"
    
        local _, tens_decimal = math.modf(tens)
        if tens_decimal > 0.91 then tens_decimal = 0 end
    
        
        ExportScript.Tools.SendData(export_ids.WSO_TACAN_FREQUENCY,
            string.format("%.0f%.0f%.0f%s", hundreds * 10, tens_decimal * 10, ones * 10, mode))
    end

    nullnull

    image.png

    image.png

    • Like 3
  3. Just now, Yogi_25 said:

    Hello,

    Awesome work here, congratulations.

    About the barometric altimeter, I added some code that works great for me. I did a pull request yesterday, just in case.

    function ExportScript.ALT_indicator(mainPanelDevice)
    	local ones = mainPanelDevice:get_argument_value(91) * 100
    	local hundreds = round(mainPanelDevice:get_argument_value(92) * 10)
    	local thousands = round(mainPanelDevice:get_argument_value(93) * 10)
    	local tenthousands = round(mainPanelDevice:get_argument_value(94) * 10)
        local ALT = tenthousands * 10000 + thousands * 1000 + hundreds *100 + ones
    	ExportScript.Tools.SendData(export_ids.BARO_ALT,string.format("%05.0f", ALT))	
    end

    I see that in the last merge the arguments for the altimeter were changed from "%.1f" to "%.3f", is there a specific reason ?

    I checked both codes and they worked OK for me, but I'm curious since this implies more computing with 3 digit outputs.

    It was changed because between 7k and 8k feet the altimeter was showing 6k. It seems to be working in the newest version of the export lua. Download it and try to see if it's working for you.

  4. Just added a pilot's fuel readout. I updated my GitHub repository @Bailey

     

    function ExportScript.Pilot_Fuel_Readout(mainPanelDevice)
        local tens = string.format("%d", mainPanelDevice:get_argument_value(719) * 10)
        local hundreds = string.format("%d", mainPanelDevice:get_argument_value(720) * 10)
        local thousands = string.format("%d", mainPanelDevice:get_argument_value(721) * 10)
        local tensofthousands = string.format("%d", mainPanelDevice:get_argument_value(722) * 10)
        ExportScript.Tools.SendData(export_ids.PILOT_FUEL_READOUT,
        string.format("FUEL\n" .. tensofthousands .. thousands .. hundreds .. tens .. "\nx10"))
    end

     

    image.png

    • Like 1
  5. function ExportScript.HSI(mainPanelDevice)
        -- Pilot HSI Course Roller
        local pilotCourseSet_ones = string.format("%d", mainPanelDevice:get_argument_value(674) * 10)
        local pilotCourseSet_tens = string.format("%d", mainPanelDevice:get_argument_value(675) * 10)
        local pilotCourseSet_hundreds = string.format("%d", mainPanelDevice:get_argument_value(676) * 10)
    
        local bearing_value = mainPanelDevice:get_argument_value(670) * 360 --bearmat
        local formatted_bearing = string.format("%.0f", bearing_value) --bearmat
        ExportScript.Tools.SendData(export_ids.PILOT_HSI_COURSE_WINDOW,
            string.format("HSI\n" .. pilotCourseSet_hundreds .. pilotCourseSet_tens .. pilotCourseSet_ones .. "\nCRS\n" .. formatted_bearing))
        --[[ExportScript.Tools.SendData(export_ids.PILOT_HSI_COURSE_WINDOW,
            string.format(pilotCourseSet_hundreds .. pilotCourseSet_tens .. pilotCourseSet_ones))]]

    @Bailey @Bearmat the course needle defaults to your current heading when you're in NAV COMP mode and is user set in TAC and VOR/ILS mode. With the combined tile it would be a breeze to match your current course with what is either automatically or manually set with the course set knob. I'm going to combine them if you don't mind. 🙂null

    image.png

    • Like 1
    • Thanks 1
  6. 1 hour ago, Bailey said:

    Yes. So slightly different 

    Got it. Thanks. (Where are these lights in the cockpit anyways!?) Awesome and creative visual implementation. 

    I think you can change the selected station by pressing the button but there isn't an indicator for empty vs mounted except for the sparrows. The sparrow lights go out as each weapon is launched.

    image.png

    • Thanks 1
  7. 8 hours ago, Bailey said:

    Thanks to @bones1014 and @Bearmat, we have some new exports!

    https://github.com/asherao/DCS-ExportScripts/blob/master/Scripts/DCS-ExportScript/ExportsModules/F-4E-45MC.lua
    (Use the download raw file button near the top of the code)

    PILOT_GEAR_IND                 = 10060,
    PILOT_ALTIMETER                = 10061,
    MISSILE_LIGHTS                 = 10062,
    PILOT_RADAR_ALTITUDE           = 10063,
    PILOT_HSI_BEARING_POINTER      = 10064, -- WIP
    LEFT_ENGINE_RPM                = 10065,
    RIGHT_ENGINE_RPM               = 10066,
    VSI_INDICATION                 = 10067,
    AOA_INDEXER                    = 10068,

    Thank you! Excellent works to the both of them!
    (Bearmat, can you put leading 0's on the HSI?)
    (bones1014, are you able to show if a heater is loaded and unfired?)

     

    I don't think that you can do that. I'm going purely off the indicator lights which only shows active heater. It appears that the missiles always fire in a certain order so the pilot would just have to remember what he has left based on the lights.
     

  8. I created a missile status tile. Uses export 10062. Red for sidewinders and green for sparrows. file I added contains all of @Bailey's content plus what I've added.

    function ExportScript.Missile_Lights(mainPanelDevice)
       local heat_left, heat_ml, heat_mr, heat_right, radar_tl, radar_tr, radar_bl, radar_br
        if mainPanelDevice:get_argument_value(284) < 0.8 then heat_left = "" 
            else heat_left =""
       end
       if mainPanelDevice:get_argument_value(285) < 0.8 then heat_ml = ""
            else heat_ml = ""
       end
       if mainPanelDevice:get_argument_value(286) < 0.8 then heat_mr = ""
            else heat_mr = ""
        end
        if mainPanelDevice:get_argument_value(287) < 0.8 then heat_right = ""
            else heat_right = ""
        end
        if mainPanelDevice:get_argument_value(288) < 0.8 then radar_tl = ""
            else radar_tl = ""
        end
        if mainPanelDevice:get_argument_value(289) < 0.8 then radar_bl = ""
            else radar_bl = ""
        end
        if mainPanelDevice:get_argument_value(290) < 0.8 then radar_tr = ""
            else radar_tr = ""
        end
        if mainPanelDevice:get_argument_value(291) < 0.8 then radar_br = ""
            else radar_br = ""
        end
        local missile_lights = "MSSL STAT" .. "\n" ..
                                         "" .. radar_tl .. "  " ..  radar_tr .. "\n" ..
                                    heat_left .. heat_ml .. "  " .. heat_mr .. heat_right .. "\n" ..
                                            "" .. radar_bl .. "  " .. radar_br
        ExportScript.Tools.SendData(export_ids.MISSILE_LIGHTS, missile_lights)
    end

     

     

    F-4E-45MC.lua

  9. On 5/27/2024 at 11:43 PM, Bailey said:

    This one works in practice. I think it may need some fine tuning due to the bounciness of the cockpit gear indicators. There are times where ingame both left and right gears show as in transit with the hash marks, but on the SD one icon is red and the other is yellow.

    I removed the float calculation on the thousands argument. Can you see if that works for you too?

    how did you remove the floating calc?

  10. On 5/27/2024 at 11:43 PM, Bailey said:

    This one works in practice. I think it may need some fine tuning due to the bounciness of the cockpit gear indicators. There are times where ingame both left and right gears show as in transit with the hash marks, but on the SD one icon is red and the other is yellow.

    I removed the float calculation on the thousands argument. Can you see if that works for you too?

    I just got back into the cockpit this evening. I see the problem at 7k feet. I'll try your change and see what happens.

    • Like 3
  11. 8 hours ago, Bailey said:

    This one works in practice. I think it may need some fine tuning due to the bounciness of the cockpit gear indicators. There are times where ingame both left and right gears show as in transit with the hash marks, but on the SD one icon is red and the other is yellow.

    I wonder if changing the if statement to use not equal to (~=) the top and bottom values. I did see the bounciness.

  12. trying to work on the pilot's altimeter. here's what I have so far. It's not working quite right yet. I'm getting extra digits when the needle gets close to rolling over at each thousand feet.
    **EDIT

    got it working a little better. right now it rolls the 1000's to the next number too quickly at the top.

    **EDIT #2

    I think I got it working correctly. Please test it. I'll push it up through github. if anyone knows how to add a thousands separator please do.

    function ExportScript.Pilot_Altimeter(mainPanelDevice)
    	local altitudeWindowReadout_value1 = string.format("%.f",mainPanelDevice:get_argument_value(92) * 10) --hundreds
    	local altitudeWindowReadout_value2 = string.format("%.f",math.floor(mainPanelDevice:get_argument_value(93) * 10)) --thousands
    	local altitudeWindowReadout_value3 = string.format("%.f",mainPanelDevice:get_argument_value(94) * 10) --tenthousands
    	local altitudeWindowReadout_needle = string.format("%.f",mainPanelDevice:get_argument_value(91) * 1000) --needle
    	
    	--this fixes the extra "10" problem
    	if mainPanelDevice:get_argument_value(92) * 10 < 10 then--altitudeWindowReadout_value1 == "10" then
    		altitudeWindowReadout_value1 = "0"
    	end
    	if altitudeWindowReadout_value2 == "10" then
    		altitudeWindowReadout_value2 = "0"
    	end
    	if altitudeWindowReadout_value3 == "10" then
    		altitudeWindowReadout_value3 = "0"
    	end
    	if altitudeWindowReadout_needle == "10" then
    		altitudeWindowReadout_needle = "0"
    	end
    	--this is for the hash part
    	if altitudeWindowReadout_value1 == "0" then
    		altitudeWindowReadout_value1 = ""
    	end
    	
    	-- this is to fill the blank space when the needle is below 100
    	if #altitudeWindowReadout_needle == 1 then
    		altitudeWindowReadout_needle = string.format("00" .. altitudeWindowReadout_needle)
    	end
    	if #altitudeWindowReadout_needle == 2 then
    		altitudeWindowReadout_needle = string.format("0" .. altitudeWindowReadout_needle)
    	end
    	
    	--[[ExportScript.Tools.SendData(44261, altitudeWindowReadout_value1 .. " ft") --test values
        ExportScript.Tools.SendData(44262, altitudeWindowReadout_value2 .. " ft") --test values
    	ExportScript.Tools.SendData(44263, altitudeWindowReadout_value3 .. " ft") --test values
    	ExportScript.Tools.SendData(44264, altitudeWindowReadout_needle .. " ft") --test values
        ExportScript.Tools.SendData(44265, string.format("%.f",mainPanelDevice:get_argument_value(92) * 10) .. " ft") --test values
        ExportScript.Tools.SendData(44266, string.format("%2.d",mainPanelDevice:get_argument_value(93) * 10) .. " ft") --test values
    	ExportScript.Tools.SendData(44267, string.format("%.f",mainPanelDevice:get_argument_value(94) * 10) .. " ft") --test values
    	ExportScript.Tools.SendData(44268, string.format("%.f",mainPanelDevice:get_argument_value(91) * 1000) .. " ft") --test values]]
    	
    	--value 3 isnt needed bc it is taken over by the needle
    	local altitudeWindowReadout_total = string.format(altitudeWindowReadout_value3 .. altitudeWindowReadout_value2 .. altitudeWindowReadout_value1 .. altitudeWindowReadout_needle)
    	--remove leading zeros
    	altitudeWindowReadout_total = altitudeWindowReadout_total:match("0*(%d+)") --https://stackoverflow.com/questions/34331633/remove-leading-zeroes-in-lua-string
    	local altMsl_f4e_ft  = altitudeWindowReadout_total .. "\nFT" 
    
        ExportScript.Tools.SendData(export_ids.PILOT_ALTIMETER, altMsl_f4e_ft)
        --[[ExportScript.Tools.SendData(export_ids.PILOT_needle, altitudeWindowReadout_needle) --test
        ExportScript.Tools.SendData(export_ids.PILOT_hundreds, altitudeWindowReadout_value1) --test
        ExportScript.Tools.SendData(export_ids.PILOT_thousands, altitudeWindowReadout_value2) --test
        ExportScript.Tools.SendData(export_ids.PILOT_tenthousands, altitude

     

  13. 43 minutes ago, Bailey said:

    I didn't see a pull request. I have seen your fork updated with what you were talking about. Hmmm, I may have accidently canceled yours while I was having trouble with mine thinking that I was canceling my own. Oops! Submit again and I'll take a look.

    I just sent up a change to add the pilot's landing gear indicators

    function ExportScript.Pilot_Gear_Status(mainPanelDevice)
        local left, nose, right
        
        if mainPanelDevice:get_argument_value(52) < 0.5 then 
                left = "🔴" 
            elseif mainPanelDevice:get_argument_value(52) > 0.1 and mainPanelDevice:get_argument_value(52) < 0.9 then
                left = "🟡"
            else
                left = "🟢" 
        end
        
        if mainPanelDevice:get_argument_value(51) < 0.5 then 
                nose = "🔴" 
            elseif mainPanelDevice:get_argument_value(51) > 0.1 and mainPanelDevice:get_argument_value(51) < 0.9 then
                nose = "🟡"
            else
                nose = "🟢" 
        end
        
        if mainPanelDevice:get_argument_value(50) < 0.5 then 
                right = "🔴" 
            elseif mainPanelDevice:get_argument_value(50) > 0.1 and mainPanelDevice:get_argument_value(50) < 0.9 then
                right = "🟡"
            else
                right = "🟢" 
        end
        
        local All_Gear = "LND GEAR\n" .. nose .. "\n" .. left .. " " .. right
        ExportScript.Tools.SendData(export_ids.PILOT_GEAR_IND, All_Gear)
    end

     

    • Like 2
  14. 12 hours ago, sobe said:

    I have managed to import the F4E profile and associated lua file and to my shock, it worked.  The True Air Speed button seems to be correct and corresponds with the game.  However, I tried to find the true air speed listing in the ID lookup and could not find it.  I tried to use it as a model to try to get the radar altitude and while I found several device IDs for the radar altitude, I could not find anything that deals with the actual attitude.  What am I doing wrong?

     

    It won't be in the searchable list as it's not in the airplane game files. You'll have to look at the export lua itself and find the custom IDs that have been added. I had started on the pilot altitude and submitted a commit to the GitHub but it wasn't accepted.

    • Like 1
×
×
  • Create New...