FSFIan Posted October 22, 2019 Posted October 22, 2019 Hi, since some people who might find this useful will miss it if it's just mentioned in the Home Cockpits forum, I'll drop a note here. I have published a pre-release of DCS-BIOS v0.8.0 that includes a Lua Console that can help you debug your mission scripts. How to set up: Download the MSI installer and install the applicaton start the DCS-BIOS Hub using the start menu shortcut Click the icon in the system tray and click "Open web interface". A configuration page should open in your browser. Select "Setup Scripts" on the left and activate the Lua Console: This installs a file in the Scripts\Hooks directory. How to use: start the DCS-BIOS Hub Make sure "Enable Lua Console" is checked in the systray menu: This is a security precaution; anyone who can connect to the web interface of the DCS-BIOS Hub can then execute arbitrary Lua code on your machine. If you also check "Enable access over the network", the web interface will be usable from other machines on the network (point a web browser to <your-LAN-ip>:5010) -- obviously, you should only do this on a LAN that is firewalled from the public internet. Start your mission Open the web interface and click the "Lua Console" menu item. Set the "Environment" dropdown menu to "mission" Type in some Lua code, then press Ctrl+Enter to execute it and show the results. Some useful snippets to try: return list_cockpit_params() return list_indication(n) (set n to a small number; start at 0 and work your way up.) return c_flag_is_true(42) to check the status of flag 42. a_set_flag(42) to set flag 42. a_clear_flag(42) to clear flag 42. a_set_flag_value(42, 23) to set flag 42 to value 23. return a_do_script([[ trigger.action.outText(trigger.misc.getUserFlag(42), 5 , false) ]]) to show the value of flag 42 as a cockpit message local keys = {} for k, v in pairs(_G) do keys[#keys+1] = k end return keys to see what else is available. 1 1 DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Sedlo Posted October 23, 2019 Posted October 23, 2019 This looks cool! Thanks for the resource, will dig into this! My Youtube Channel MY DCS MISSIONS
Hornet81 Posted October 23, 2019 Posted October 23, 2019 Awesome! Thank you very much. That’s very useful.
Jedra Posted February 3, 2020 Posted February 3, 2020 Hi there, When I run the DCS Hub, I don't get the connectivity checkboxes. I am assuming that this is because it cannot find my DCS installation (which is a none standard location). Is there a way to tell DCS Hub where my installation is? I can connect to the Virtual Cockpit OK because of the entries into the Export.lua file, but I was just interested to see if I could get the checkboxes to work. Thanks! Processor : Intel Core i7 7800X (3.8 - 4.2 GHz) . Motherboard : ASUS TUF X299 . Memory : 16Gb DDR4 1333 . Graphics : NVIDIA GeForce RTX 2080 Super (+100 CC +700 MC) . Install : DCS on 500Gb SSD . Screen : 3440 x 1440 display with GSYNC . Control : TM Warthog HOTAS, CH Pro Pedals, Naturalpoint Track-IR . Software : VoiceAttack with VAICOM Pro, DCS BIOS
Stix_09 Posted February 21, 2020 Posted February 21, 2020 Hi there, When I run the DCS Hub, I don't get the connectivity checkboxes. I am assuming that this is because it cannot find my DCS installation (which is a none standard location). Is there a way to tell DCS Hub where my installation is? I can connect to the Virtual Cockpit OK because of the entries into the Export.lua file, but I was just interested to see if I could get the checkboxes to work. Thanks! Did not work for me in firefox, it did with chrome however (also need make sure you have firewall open to app) As per doc notes: "You should now be looking at a web browser showing the DCS-BIOS Hub web interface. If that is not the case, verify that your firewall is not blocking the DCS-BIOS Hub from listening on TCP port 5010. also there are docs here {YOUR INSTALL FOLDER}\DCS-BIOS\apps\doc open index.html
Stix_09 Posted February 21, 2020 Posted February 21, 2020 I have a different problem I have relocated my save games location onto another drive, the program is still looking for save games folder on the C: drive. (I hope that is not hard coded) Is there a config file to change this?
Sedlo Posted February 29, 2020 Posted February 29, 2020 Hey guys! I've installed DCS BIOS and seemed to have gotten things set up, but I"m getting an error when trying to run commands in the LUA console.... For example, when I try this: return list_cockpit_params() I get: <string>:1: attempt to call a non-function object stack traceback: <string>:1: in main chunk [G]: ? Any body know what I'm doing wrong? My Youtube Channel MY DCS MISSIONS
Sedlo Posted February 29, 2020 Posted February 29, 2020 I should say the above comes up when the environment is set to hub. When set to mission (as in the instructions) I get nothing. My Youtube Channel MY DCS MISSIONS
Rudel_chw Posted February 29, 2020 Posted February 29, 2020 Maybe you have your plane set to Client, try changing it to Player. For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Sedlo Posted February 29, 2020 Posted February 29, 2020 It is set to player, not sure what's going on here... My Youtube Channel MY DCS MISSIONS
Rudel_chw Posted February 29, 2020 Posted February 29, 2020 Strange, I get these for the JF-17: Parameter ID Typical Value ACCELERATION_X_W ACCELERATION_Y_W ACCELERATION_Z_W ASM_MECHINFO_BREAKCHUTE ASM_MECHINFO_CANOPYPOS ASM_MECHINFO_LEFT_AILERON ASM_MECHINFO_LEFT_MAINGEAR ASM_MECHINFO_LEFT_STAB -0,046161 ASM_MECHINFO_NOSEGEAR ASM_MECHINFO_RIGHT_AILERON ASM_MECHINFO_RIGHT_MAINGEAR ASM_MECHINFO_RIGHT_STAB -0,046161 ASM_MECHINFO_SPEEDBREAK ASM_MECHINFO_STABS -0,046161 ASM_MECHINFO_VERT_STAB ASM_RATE_PITCH 0,88461 ASM_RATE_ROLL 0,00003 ASM_RATE_YAW 0,000005 CTRL_IND_ON_OFF EFM_EXT_TANKC EFM_EXT_TANKL EFM_EXT_TANKR EFM_FUEL_LEFT 8990,2 EFM_INT_FUEL 5124,620875 EFM_PEDAL_POSITION EFM_RPM 71,632415 EFM_SLIDE EFM_STICK_PITCH EFM_STICK_ROLL EFM_T4 386,389923 EFM_TANK1 1090,296117 EFM_TANK2 1895,840817 EFM_TANK3 1069,241971 EFM_TANKL 534,620985 EFM_TANKR 534,620985 EFM_THROTTLE_POSITION EFM_TOTAL_FUEL 5124,620875 EJECTION_BLOCKED_0 EJECTION_INITIATED_0 -1 JF17_IFF_M1_INT JF17_IFF_M1_TRS JF17_IFF_M2_INT JF17_IFF_M2_TRS JF17_IFF_M3_INT JF17_IFF_M3_TRS JF17_IFF_M6_INT JF17_IFF_M6_TRS JF17_ZCP_WIPEOUT Which aircraft are you using? For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Sedlo Posted February 29, 2020 Posted February 29, 2020 Any of them... I've tried it with the Hornet, VIper and JF17. It must be that something isn't configured correctly, but I've gone over the steps several times and it seems to be correct. I have had Witchcraft working well before, and the other day I thought I'd give DCS BIOS a try. Downloaded it, it installed and updated several things on my machine. One it was ready, it just didn't work at all, no matter what I tried. I then tried witchcraft again, but in that LUA console, the formatting of the returns were all screwed up (see attached). I tried removing and reinstalling both DCS BIOS and Witchcraft but no change... DCS BIOS lua console does not seem to work, and the returns in Witchcraft LUA console is formatted all wonky. My Youtube Channel MY DCS MISSIONS
Rudel_chw Posted February 29, 2020 Posted February 29, 2020 (edited) Any of them... I've tried it with the Hornet, VIper and JF17. It must be that something isn't configured correctly ... I have had Witchcraft working well before ... ... I then tried witchcraft again ... Dont know about the Witchcraft thingy that you mention, but the software on post 1 of this thread works for me, the only issue that I had is that it forced me to return my Saved Games folder to drive C, as it didn't work with the redirected Saved Games that I had prior. Here are a couple of screens with it working on my DCS 2.5.6 This shows the elements that Indicator 2 (the HUD) has: This shows the aircraft current parameters: On my Export.Lua I have the following line, to hook with the Console: BIOS = {}; BIOS.LuaScriptDir = [[C:\Program Files\DCS-BIOS\dcs-lua\]]; BIOS.PluginDir = [[C:\Users\Eduardo\AppData\Roaming/DCS-BIOS/Plugins\]]; if lfs.attributes(BIOS.LuaScriptDir..[[bIOS.lua]]) ~= nil then dofile(BIOS.LuaScriptDir..[[bIOS.lua]]) end --[[DCS-BIOS Automatic Setup]] This is an invaluable tool when trying to edit a training mission, it's been real useful to me. Hope you can get it working on your DCS. Best regards, Eduardo Edited February 29, 2020 by Rudel_chw For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Sedlo Posted February 29, 2020 Posted February 29, 2020 OK, I have it working (kinda, sometimes)..... So here it is...> If I start DCS, open an instant action mission, select Open Web Interface from the DCS-BIOS icon and then "Enable LUA console" from there, it opens up a browser, all connections are correct and it works! I can set flags, see parameters and indciations! I can then close this mission, open up another instant action mission and it works too, on every map I have. Good so far! Now, when I open up a mission that I've created and go to get things from the DCS-BIOS lua console, nothing happens. It just returns nothing. I can't set flags, see indications, or parameters. Now, the weirder thing is, I can exit my edited mission and load up another instant action mission, but the LUA Console does not work here. It returns nothing, no flags, indications, etc... DCS-BIOS LUA Console now won't work, no matter what I do. I then have to exit DCS entirely, close DCS-BIOS and then open them both up again. Once I do, it works for the Instant Action missions, but not for any user created ones. I'm running the latest Open Beta 2.5.6, if that give any indication. Any help would be greatly appreciated! My Youtube Channel MY DCS MISSIONS
Sedlo Posted March 2, 2020 Posted March 2, 2020 OK, things have gotten better.... This is how I get it to work, mostly.... But I have to do it in the right order. I have to start DCS in admin mode. I then start DCS BIOS in admin, as well. Right click the icon in systray and "Open web interface". Then, check the enable LUA Console. This will work most of the time for me, so I'm quite happy. Thanks for the neat feature, and thanks everyone for the help! My Youtube Channel MY DCS MISSIONS
Rudel_chw Posted March 3, 2020 Posted March 3, 2020 ... This will work most of the time for me, so I'm quite happy. Thanks for the neat feature, and thanks everyone for the help! Glad you got it working .. I haven’t needed to use Admin mode, maybe it is because I don't have DCS installed on C:/program files/ :thumbup: For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
questerymj Posted April 30, 2020 Posted April 30, 2020 Hello all, I still can't get the connect successful, my save game is in drive c and the DCS world installation was move to new SSD drive in drive J. I don't know how to /where to add the code to what export.lua file. Could anyone kindly give me more detail about these? I'm really so eager to try this very-powerful tool!
davidp57 Posted May 2, 2020 Posted May 2, 2020 Looks nice, although I can't call code im my lua scripts (that are loaded via a trigger in the mission). Is this a known limitation ? Zip - VEAF :pilotfly: If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !
winghunter Posted January 13, 2022 Posted January 13, 2022 I have found these values only update in cockpit view, not in external view. Thats probably a DCS issue not a console issue return list_indication(n) DCS Web Editor - New 3D Mission Editor for DCS that runs in your browser DCS Web Viewer free browser based mission planner 4090 RTX, 13700KF, water cooled, Quest 3
TOViper Posted February 10, 2022 Posted February 10, 2022 Hello! I use DCS BIOS, and I have one question: It delivers the following output: "BASE_SENSOR_VERTICAL_ACCEL:1.671939\" How can I use this in triggers, e.g. by checking if g-forces have been too high? Visit https://www.viggen.training ...Viggen... what more can you ask for? my computer: AMD Ryzen 5600G 4.4 GHz | NVIDIA RTX 3080 10GB | 32 GB 3.2 GHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TRP | Rift CV1
Bailey Posted May 17, 2022 Posted May 17, 2022 On 2/10/2022 at 11:12 AM, TOViper said: Hello! I use DCS BIOS, and I have one question: It delivers the following output: "BASE_SENSOR_VERTICAL_ACCEL:1.671939\" How can I use this in triggers, e.g. by checking if g-forces have been too high? Check DCS Manual Page 157. X: COCKPIT PARAM IN RANGE Use BASE_SENSOR_VERTICAL_ACCEL as your param. Then fill in your min and max values. DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library | Kiowa Integrated Overlays
Nix Mills Posted August 3, 2023 Posted August 3, 2023 Thank you all for this post. I have followed all the instructions but I seem unable to actually connect to DCS. I'm getting a green light on connection to Virtual Cockpit and Systray Settings Lua Console, but no table to tick in DCS Connection even though I have added the BIOS script line to Export.lua. When attempting to execute return list_cockpit_params() in the Hub for Mission (running an Instant Mission, not from a mission from ME), I simply get the error response that it could not send snippet to DCS within 1 second. Does anyone know how to overcome this problem? Cheers Nix null null
Rudel_chw Posted August 3, 2023 Posted August 3, 2023 2 hours ago, Nix Mills said: I have followed all the instructions but I seem unable to actually connect to DCS. I'm getting a green light on connection to Virtual Cockpit and Systray Settings Lua Console, but no table to tick in DCS Connection even though I have added the BIOS script line to Export.lua. I don't use the DCS connection item, just LUA Console ... my dashboard looks like this: On the windows tray icon, I enable the "LUA Console" menu item, like this: And then on the DCS-BIOS webpage I select "Lua Console", like this: I have a default DCS-BIOS Config, like this: And on the dcs.log I see that it is enabled correctly: Don't know what else to show you, compare with my setup and see if you can spot a difference with yours. Cheers, Eduardo 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Nix Mills Posted August 3, 2023 Posted August 3, 2023 @Rudel_chwThank you so much for taking the time to write all this up, Eduardo. I can see that the missing link on mine is the hook file, which isn't there, and therefore there is no mention of it in the log file either. I'll try and reinstall and figure out why it never created a hook. 1
Rudel_chw Posted July 23, 2024 Posted July 23, 2024 Hello All, After the latest DCS Update (DCS 2.9.6.57650) the LUA Console is not working for me anymore, it starts as normal, but on the LUA console I can't do queries like return list_indication(n) ... has anyone else encountered this? is there any fix or workaround? For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Recommended Posts