Jump to content

New StreamDeck Plugin


Recommended Posts

On 6/27/2022 at 11:10 AM, Montykoro said:

Hello there! first sorry for my bad English! 

I made some experiments and tweaks based on previos works found in this forums and i got working on Stream Deck the A4 🙂

Its a proof of concept but the panel works. The panel is working on DCS interface:

https://github.com/enertial/streamdeck-dcs-interface (great job!!!)

And

https://github.com/asherao/DCS-ExportScripts (Epic Idea!!!)

 

After the install of the DCS interface use the ExportScript and point to the 

Subir a foro.PNG

on the "save" folder not the game 🙂 

 

No need to change the folder when playing or use another panels.

 

In the next weeks i will update the Streamdeck profile.

 

 

Subir a foro 3.PNG

Subir a foro 2.PNG

 

Do you still have the Ed modules in the choice menu? I dont.

Link to comment
Share on other sites

1 hour ago, Montykoro said:

Sorry im not familiar on the "ed"acronimun,  care to explain for me?

 

Thanks!

Sorry. Eagle Dynamics. The official aircraft sold by Eagle Dynamics for DCS. 

Link to comment
Share on other sites

25 minutes ago, Bailey said:

Sorry. Eagle Dynamics. The official aircraft sold by Eagle Dynamics for DCS. 

Same Here, when i point the "A4"the EA modules are not present BUT Comms and panels work fine. 

I have this VERY VERY VEY ALPHA panel working , maybe someone want to try.

USAGE:

1.- https://github.com/enertial/streamdeck-dcs-interface 

2.- https://github.com/asherao/DCS-ExportScripts 

3.- Att Profile.

 

A4.streamDeckProfile

Link to comment
Share on other sites

Working on a flap mode and angle readout for the harrier. For some reason in my function when I add this if/then/else it crashes the export. I don't know why. I THINK I'm doing it correctly. If I change the local flap_mode variable to equal a constant it works just fine.

function ExportScript.FlapAngleMode(mainPanelDevice)
	--Flap Mode
	local flap_mode 
	if mainPanelDevice:get_argument_value(454) = 1 then
		flap_mode = "CRUISE"
	elseif mainPanelDevice:get_argument_value(454) = 0.5 then
		flap_mode = "AUTO"
	elseif mainPanelDevice:get_argument_value(454) = 0 then
		flap_mode = "STOL"
	end
	--Flap Angle
	local flap1 = string.format("%1.0f",mainPanelDevice:get_argument_value(455) * 10)
	local flap2 = string.format("%1.0f",mainPanelDevice:get_argument_value(456) * 10)

	ExportScript.Tools.SendData(5000, "FLP ANGL" ..  "\n" .. flap1 .. flap2 .. "\n" .. flap_mode )
end

 


Edited by bones1014
updated code with comments
Link to comment
Share on other sites

2 hours ago, bones1014 said:

Working on a flap mode and angle readout for the harrier. For some reason in my function when I add this if/then/else it crashes the export. I don't know why. I THINK I'm doing it correctly. If I change the local flap_mode variable to equal a constant it works just fine.

function ExportScript.FlapAngleMode(mainPanelDevice)
	--Flap Mode
	local flap_mode 
	if mainPanelDevice:get_argument_value(454) = 1 then
		flap_mode = "CRUISE"
	elseif mainPanelDevice:get_argument_value(454) = 0.5 then
		flap_mode = "AUTO"
	elseif mainPanelDevice:get_argument_value(454) = 0 then
		flap_mode = "STOL"
	end
	--Flap Angle
	local flap1 = string.format("%1.0f",mainPanelDevice:get_argument_value(455) * 10)
	local flap2 = string.format("%1.0f",mainPanelDevice:get_argument_value(456) * 10)

	ExportScript.Tools.SendData(5000, "FLP ANGL" ..  "\n" .. flap1 .. flap2 .. "\n" .. flap_mode )
end

 

 

Try == instead of =.

Also, I would suggest making greater than and less than ranges due to transitions and the possibility the animation stops at something like 0.500001. If you want to keep the equals then make the last elseif  an else to prevent crashing the script in the event that it does not match any of the values, which will happen unless the animation is instantaneous. 

example: https://github.com/asherao/DCS-ExportScripts/blob/a51fffbdac7adc6bfd8468461301c78cc4b6db08/Scripts/DCS-ExportScript/ExportsModules/F-16C_50.lua#L1047


Edited by Bailey
  • Like 1
Link to comment
Share on other sites

20 hours ago, Bailey said:
Try == instead of =.
Also, I would suggest making greater than and less than ranges due to transitions and the possibility the animation stops at something like 0.500001. If you want to keep the equals then make the last elseif  an else to prevent crashing the script in the event that it does not match any of the values, which will happen unless the animation is instantaneous. 
example: https://github.com/asherao/DCS-ExportScripts/blob/a51fffbdac7adc6bfd8468461301c78cc4b6db08/Scripts/DCS-ExportScript/ExportsModules/F-16C_50.lua#L1047

Thanks for the tip. The == fixed it. stupid little stuff ruins everything! lol

Sent from my SM-G781U using Tapatalk
 


Edited by bones1014
  • Like 1
Link to comment
Share on other sites

Has anyone try to export data from the MFD I was trying to make it work but it keeps changing display ID. I tried on JF-17 center upper MFD for SMS only. 

local cmfcd1 = ExportScript.Tools.split(list_indication(9), "%c")
return cmfcd1

 

Link to comment
Share on other sites

13 minutes ago, jonny415 said:

Has anyone try to export data from the MFD I was trying to make it work but it keeps changing display ID. I tried on JF-17 center upper MFD for SMS only. 

local cmfcd1 = ExportScript.Tools.split(list_indication(9), "%c")
return cmfcd1

 

Ctyler has a series about this. Goes through how to do it live.
https://www.youtube.com/channel/UC5SLT0j3UK88FxeGzCM9tFw

Edit: Ohhhhh, MFD, nut UFC. my bad. Similar concepts apply. It is possible. I have seen it be done for the apache.


Edited by Bailey
Link to comment
Share on other sites

@MontykoroIn the streamdeck plugin, the DCS Lookup button gives a blank page but the DCS Comms button gives a fully populated list. I imported your profile however and it seems to work. Yes I did point the streamdeck plugin to the SavedGames/DCSopenbeta folderand restarted the streamdeck software. And yes there is an A-4E-C.lua file in Saved Games\DCS.openbeta\Scripts\DCS-ExportScript folder.

The log does not show any abnormality:

 

ExportScript Version: 1.2.1
23:46:17:208 : Create UDPSender
23:46:17:208 : Create UDPListner
23:46:17:210 : File Path: C:\Users\Stefan\Saved Games\DCS.openbeta\Scripts\DCS-ExportScript\ExportsModules\A-4E-C.lua
23:46:17:211 : File 'C:\Users\Stefan\Saved Games\DCS.openbeta\Scripts\DCS-ExportScript\ExportsModules\A-4E-C.lua' loaded
23:46:17:211 : Version:
23:46:17:211 : Config: 1.2.1
23:46:17:211 : Maps: 1.2.1
23:46:17:211 : Tools: 1.2.1
23:46:17:211 : A4EC: 1.2.1
23:46:17:211 : genericRadio: 1.2.1
23:46:17:211 : ExportScript: 1.2.1
23:46:17:211 : Detected Map: CaucasusBase
23:46:31:199 : reset dcs ikarus


 

How did you get the DCS Lookup button to populate a list?


Edited by skypickle

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

1 minute ago, jonny415 said:

@Bailey Yes, I was managed to get the display I wanted but it changes value when I click it won't display the value after 

You will have to figure out if you can parse the data and assign the variables accordingly. If you paste some code samples I may be able to let you know if it could be possible.

Link to comment
Share on other sites

13 minutes ago, Bailey said:

You will have to figure out if you can parse the data and assign the variables accordingly. If you paste some code samples I may be able to let you know if it could be possible.

Ok, its gonna be tough. Here is a part of the result for the center list_indication(9).

[129] = "#366#",
    [130] = "D",
    [131] = "C",
    [132] = "L",
    [133] = "T",
    [134] = "}",
    [135] = "-----------------------------------------",
    [136] = "LOWER_BASE",
    [137] = "",
    [138] = "-----------------------------------------",
    [139] = "{44889089-C0E9-498c-A18F-3764597EB420}",
    [140] = "",
    [141] = "-----------------------------------------",
    [142] = "UPPER_BASE",
    [143] = "",
    [144] = "-----------------------------------------",
    [145] = "LOWER_BASE",
    [146] = "",
    [147] = "children are {",
    [148] = "-----------------------------------------",
    [149] = "osb_txt_1",
    [150] = "EPI1",
    [151] = "-----------------------------------------",
    [152] = "osb_txt_2",
    [153] = "EPI2",
    [154] = "-----------------------------------------",
    [155] = "osb_txt_3",
    [156] = "RTN",
    [157] = "-----------------------------------------",
    [158] = "osb_txt_4",
    [159] = "AFD",
    [160] = "-----------------------------------------",
    [161] = "osb_txt_5",
    [162] = "SMS",
    [163] = "}",

For example, if you see "osb_txt_5" you know that the next value will be what is contained within. On the other hand, look at [129]. The text for that is vertical. Good luck. Take a look at the Mi24, F16, or apache export luas for some assistance on how I parsed file. https://github.com/asherao/DCS-ExportScripts/blob/a51fffbdac7adc6bfd8468461301c78cc4b6db08/Scripts/DCS-ExportScript/ExportsModules/AH-64D_BLK_II.lua#L788
 


Edited by Bailey
Link to comment
Share on other sites

20 hours ago, hasole said:

Does anyone have chaff, flare and gun count working for the F-14 Tomcat?

I use this for flare and chaff. Didn't make one for gun count since that's displayed on your HUD anyway.
 

function ExportScript.Chaff_Counter(mainPanelDevice)
--export RIO Chaff Counter
	local chaff_10 = string.format("%.f",mainPanelDevice:get_argument_value(392) * 10)
	local chaff_1 = string.format("%.f",mainPanelDevice:get_argument_value(393) * 10)

	ExportScript.Tools.SendData(3009, "CHAFF" .. "\n" .. chaff_10 .. chaff_1)
end
	
function ExportScript.Flare_Counter(mainPanelDevice)
--export RIO Flare Counter
	local flare_10 = string.format("%.f",mainPanelDevice:get_argument_value(394) * 10)
	local flare_1 = string.format("%.f",mainPanelDevice:get_argument_value(395) * 10)

	ExportScript.Tools.SendData(3010, "FLARE" .. "\n" .. flare_10 .. flare_1)
end

 


Edited by bones1014
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

4 hours ago, bones1014 said:

I use this for flare and chaff. Didn't make one for gun count since that's displayed on your HUD anyway.
 

function ExportScript.Chaff_Counter(mainPanelDevice)
--export RIO Chaff Counter
	local chaff_10 = string.format("%.f",mainPanelDevice:get_argument_value(392) * 10)
	local chaff_1 = string.format("%.f",mainPanelDevice:get_argument_value(393) * 10)

	ExportScript.Tools.SendData(3009, "CHAFF" .. "\n" .. chaff_10 .. chaff_1)
end
	
function ExportScript.Flare_Counter(mainPanelDevice)
--export RIO Flare Counter
	local flare_10 = string.format("%.f",mainPanelDevice:get_argument_value(394) * 10)
	local flare_1 = string.format("%.f",mainPanelDevice:get_argument_value(395) * 10)

	ExportScript.Tools.SendData(3010, "FLARE" .. "\n" .. flare_10 .. flare_1)
end

 

 

Thanks for that. What have you set the button as in the stream deck app?

Link to comment
Share on other sites

@Bailey As you have been working on a streamdeck profile for the UH 60, I noticed something interesting when trying to bind switches for the battery and the APU to buttons on the streamdeck. They make the appropriate clicky sounds and the switches in cockpit move when I press the buttons on the streamdeck-=-but nothing happens.

 

If you activate the battery by clicking on the switch in the cockpit-you hear some systems come on.

If you turn on the APU by clicking the switch in the cockpit-same thing you hear it come on

Did you find this?

 

Also, assigning any streamdeck buttons to the AM radio causes DCS to disconnect from streamdeck requiring it to be relaunched. Are you finding any similar irregularities?

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

3 hours ago, skypickle said:

@Bailey As you have been working on a streamdeck profile for the UH 60, I noticed something interesting when trying to bind switches for the battery and the APU to buttons on the streamdeck. They make the appropriate clicky sounds and the switches in cockpit move when I press the buttons on the streamdeck-=-but nothing happens.

 

If you activate the battery by clicking on the switch in the cockpit-you hear some systems come on.

If you turn on the APU by clicking the switch in the cockpit-same thing you hear it come on

Did you find this?

 

Also, assigning any streamdeck buttons to the AM radio causes DCS to disconnect from streamdeck requiring it to be relaunched. Are you finding any similar irregularities?

I had stopped working on the UH60 profile. There is a person in their official discord who has continued to develop the profile. 

Yes, I also noticed the battery and apu issue. Long story short, it’s due to those systems being within the FM and they do not read the arg of the switch. They read the click action or the keybind. Use a hotkey Tile on the StreamDeck to work around the issue. 

I have not heard about the AM radio issue. Seems quite odd. 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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