Jump to content

Recommended Posts

Posted

Hi guys,

 

anyone know of a way to get the current number of chaff and flares on a given aircraft? I can't see anything. I found this below but its rather cryptic and not sure it means anything.

 

LoGetSnares = {chaff,flare}

 

Ken.

Posted

Found the answer

 

Hi guys,

 

turns out it is pretty simple to get the chaff and flare count.

 

   local CM = LoGetSnares()
   default_output_file:write(string.format("Chaff count = %d \n",CM.chaff))
   default_output_file:write(string.format("Flare count = %d \n",CM.flare))

Of course you could push this out to external app via UDP or whatever you want.

 

I intend to use this for the counter measure panels to write to an LCD via probably an Arduino board.

 

Ken.

  • Like 2
Posted

Hehe, you may call it simple but you way ahead of me. How/where sid you found the extract command for the chaffs & flares? Is there a 'complete' list of existing ones ?

- - - -

Posted

Hi Gus,

 

yeah it's simple now.. but simple was not the right word when working it out. No documentation around this unfortunately.

 

I installed cygwin and ran the Unix commands "strings" and "grep" over every file in the DCS folder looking for references of "chaff" and "flare".

 

In the original export.lua (it's about 39KB) there is a section towards the end that has the code:

 

LoGetSnares               =   {chaff,flare}

 

Then through a bit of trial and error with that function I found out that it returns a table. If you put the code from original post into the processafternextframe function of Export.lua it just constantly sends you the chaff and flare count. Tested it by dropping chaff and it decrements along with what the cockpit was telling me.

 

So for the CMSP panel. Pretty much everything is a known state from start except how many chaff and flares. My intention is just track when the switches or buttons are used on the panel and update both the sim and my own values driving the LCD display. You can also get the error/damage state of the counter measures and ECM gear so you can put the correct error message on or shutdown the display/panel if the sim is reporting your counter measures are out.

 

I think with this I can avoid either exporting the display and chewing up another monitor port or using OCR. But will see. Will be cutting and engraving the panel soon so will report on how it works out. Definitely going with the Arduino for driving the LCD as I have more experience coding and working with Arduino.

 

Ken.

Posted

Hi Gus,

 

also - unfortunately I couldn't find a complete listing of functions (spent a lot of time looking :)). I use "strings" and "grep" a lot when trying to solve a particular problem. If I find any others I will post them up. I should probably start a thread for my cockpit build.

 

Ken.

  • 7 years later...
Posted
On 9/21/2013 at 1:09 AM, Levinsky said:

Found the answer

 

Hi guys,

 

turns out it is pretty simple to get the chaff and flare count.

 

 


   local CM = LoGetSnares()
   default_output_file:write(string.format("Chaff count = %d \n",CM.chaff))
   default_output_file:write(string.format("Flare count = %d \n",CM.flare))
 
 

Of course you could push this out to external app via UDP or whatever you want.

 

I intend to use this for the counter measure panels to write to an LCD via probably an Arduino board.

 

Ken.

Thank you. I used 
 

local chaffNumber = Export.LoGetSnares().chaff
local flareNumber = Export.LoGetSnares().flare
WAIFU2.log(chaffNumber)
WAIFU2.log(flareNumber)

and it worked.

  • Recently Browsing   0 members

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