

RiSkE
Members-
Posts
10 -
Joined
-
Last visited
-
Help Required Exporting Variables
RiSkE replied to RiSkE's topic in PC Hardware and Related Software
It should work in both. I'll check mine tonight to double-check, but I'm pretty sure that's all you need. Edit: I just checked, and mine works fine in both singleplayer and multiplayer. I'm not sure what's causing your problem. -
Help Required Exporting Variables
RiSkE replied to RiSkE's topic in PC Hardware and Related Software
No worries, PVI_Eagle. I'm glad it works. In the example that you've given above, I've created a new variable called flap_posn and assigned it the value that DCS had for the flaps. If you want to create your own variable, you can call it any string that you want. The list of available variables is in InstallDir\DCS A-10C\Scripts\Aircrafts\A-10C\Cockpit\mainpanel_init.lua For example, if you wanted to set LED5 to green when the "Gun Ready" indicator is lit in-game, and set it to red when the gun is not ready, you would do the following: Open up mainpanel_init.lua and search for "gun". You should find the line below: caution_lamp(662,SystemsSignals.flag_GUN_READY) This is setting a new variable that you can use (argument 662). Open up G940leds.lua and add the line below where I define the different variables: local gun_status = math.abs(MainPanel:get_argument_value(662)) -- Returns 1.0 (ready) or 0.0 (not ready) Where I start sending info out in my code (below d:send("DisableAutoUpdate=;") ), add the following: --Set Gun Ready Indication on LED5 if gun_status == 1 then d:send("SetLed=5g") else d:send("SetLed=5r") end When sending commands to G940leds.exe, I find the easiest command is the SetLed command. The argument sent to it (eg. 5g and 5r in the above case) is simply the LED number (5) and the colour you want it to be (o = off, r = red, a = amber, g = green). -
Help Required Exporting Variables
RiSkE replied to RiSkE's topic in PC Hardware and Related Software
My config is heavily modified now, but I'll try to point you in the right direction: Go to InstallDir\DCS A-10C\Config\Export, then in Config.lua, search for: Coroutines = {} -- global coroutines table CoroutineIndex = 0 -- global last created coroutine index Immediately below this, add: dofile("./Config/Export/G940leds.lua") CoroutineIndex = CoroutineIndex + 1 Coroutines[CoroutineIndex] = coroutine.create(g940leds_example) LoCreateCoroutineActivity(CoroutineIndex, 0, 0.1) -- start directly and run every 0.1 seconds Now you need to save the attached file (G940leds.lua) to InstallDir\DCS A-10C\Config\Export This LUA file is run every 100ms, and is made to interface with G940leds.exe. You can play with it to map just about any game variable to your LEDs. Hopefully this will fix your issue, but I haven't seen that error before and can't be sure. If you need a hand, please just let me know. G940leds.lua -
Have there been any updates on this, TigerShark?
-
That's excellent news. Thanks for letting me know, Tigershark. I can't wait!
-
I've been getting far too interested in building an A10C pit, and I've designed my own code to transfer data back and forth from any panels I build (learning the basics of Lua, C# and Arduino and re-learning Assembley in a week has been tough, but well worth the effort). Now that all of the code is done (hopefully), I'm keen to start on my first panel. I'm getting some switches in to prototype the AHCP on a breadboard this weekend, but I'm keen to build a full panel to scale. Do any of you know of a source that I can use for panel dimensions? The only dimensions that I've found so far are for the Light Control Panel (https://sites.google.com/site/thewarthogpit/panel-database/lighting-control-panel) Any assistance would be greatly appreciated. :D
-
Helios Version 1.1.132 Released - Black Shark Gauges
RiSkE replied to Gadroc's topic in PC Hardware and Related Software
Thanks, Gadroc. I was just trying to work out where to get this 'Helios' thing everyone was raving about. I can't wait to give it a go - it looks awesome! -
I'm trying to export some data from DCS A-10C to get the LEDs on my G940 to light up based on in-game status settings. So far, I've gotten three of the LEDs to mimic the status of the gear indication lights using a bit of Lua code and morg's G940LED program for BS (http://forums.eagle.ru/showthread.php?t=45895) to control the LEDs themselves. I'm having some difficulty trying to coax variables out of DCS. So far, I've worked out how to get indications from the main panel itself, but I am keen to use some of the simpler commands. A simplified section of my code is below, to give you an idea of what I'm doing now. This is a coroutine which is run every 100ms: function g940leds(t) local tNext = t local MainPanel = GetDevice(0) local c = g940socketsetup() -- Sets up a socket for morg's G940leds.exe while true do local flap_posn = math.abs(MainPanel:get_argument_value(653)) local nose_gear = math.abs(MainPanel:get_argument_value(659)) local left_gear = math.abs(MainPanel:get_argument_value(660)) local right_gear = math.abs(MainPanel:get_argument_value(661)) if nose_gear == 1 then c:send("SetLed=3g") -- Set LED 3 to be Green else c:send("SetLed=3o") -- Set LED 3 to be Off end if left_gear == 1 then c:send("SetLed=7g") -- Set LED 7 to be Green else c:send("SetLed=7o") -- Set LED 7 to be Off end if right_gear == 1 then c:send("SetLed=8g") -- Set LED 8 to be Green else c:send("SetLed=8o") -- Set LED 8 to be Off end if flap_posn < 0.05 then c:send("SetLed=4o") -- If flaps are up, Set LED 4 to be Off elseif flap_posn > 0.2 and flap_posn < 0.25 then c:send("SetLed=4g") -- If flaps are at 7°, Set LED 4 to be Green elseif flap_posn > 0.65 and flap_posn < 0.68 then c:send("SetLed=4a") -- If flaps are at 20°, Set LED 4 to be Amber else c:send("SetLed=4r") -- If flaps are in travel or abnormal, Set LED 4 to be Red end tNext = coroutine.yield(); end end This is working fine for the time being, but I have noticed that there are some other functions in Export.lua which would make it easier to get more information out of the game. Eventually, I want to build an Android application so that I can use my phone in a similar way to some of the iPhone powered panels out there, so I will want to access some more complex info in the future. A couple of examples of things that I can't use at the moment are: LoGetMechInfo() -- This seems to have a lot of data which would be extremely useful, but whenever I try to use it, Lua returns 'nil'. LoGetIndicatedAirspeed() appears to return nil. Is anyone able to advise me whether these commands are correctly working in DCS, and if so, provide some example code on how to get data out of them?
-
Never passed next mission even i won 3 times
RiSkE replied to Forza42's topic in Mission and Campaigns
Thanks for uploading the file, Viper. I purposefully didn't upload a copy, as I'm unsure of the legality of me sharing ED's Property. For future reference, is it OK to upload modified ED mission files here? -
Never passed next mission even i won 3 times
RiSkE replied to Forza42's topic in Mission and Campaigns
I'm having the exact same issue. This is in the Georgian Hammer campaign (Mission file is 'Push - 7.2'). I believe the error is in the mission configuration. The condition for Victory is 'FLAG IS TRUE(11)', however destroying the mission objective and triggering '1 ONCE (WIN)' sets 'FLAG ON (50)'. The fix, in English (not code) is: Open the Mission Editor and open the file 'C:\Program Files\Eagle Dynamics\DCS A-10C\Missions\Campaigns\en\Push - 7.2.miz' Click on 'Define mission goals' on the left Select the goal 'WIN (50, OFFLINE)' Select the condition 'FLAG IS TRUE(11)' Set a 'Flag' value of 50 Click save That should fix the file (as yet untested - I'm off to bed now, but will test it tomorrow. Can anyone confirm in the meantime that this works?) Edit: I gave this mission another go, and the fix above worked for me. I can sleep when I'm dead...