Pindrought Posted May 23, 2016 Posted May 23, 2016 I know programs like HeliOS have the ability to somehow get data from the game like when switches are toggled, system failures, etc. Does anyone have any good links to resources for how exactly people are accomplishing this? I was going to try and develop some ipad apps to connect to the pc and display some cockpit visuals with buttons which would transmit the data back to the pc, but the issue i'm having is I can't even figure out how to properly get cockpit data on the pc. I was going to do ReadProcessMemory calls but I feel like this will be inefficient calling it every 100ms and also I would have to update every offset for when the game gets updated which would be too time consuming and unrealistic per update. I saw some people were saying you can read the data using udp transmission, but I couldn't find any clear examples of something as simple as reading if the engine was turned on in a SU-25T. I really wanted to try to make this on the ipad or some form of tablet instead of just using HeliOS because I feel like it would be a lot more efficient (not require a NASA cpu/gpu) and not require the multiple monitors that helios requires. If anyone has any links to any helpful resources i'd really appreciate it. Just really looking for the most basic possible way to read a single cockpit control value.
FSFIan Posted May 23, 2016 Posted May 23, 2016 (edited) DCS: World will look for a file called Export.lua in the user profile (%USERPROFILE%\Saved Games\DCS\Scripts\Export.lua) and run it. That file can define callback functions that run at specific times. The Export.lua script has access to various functions that can query and manipulate the cockpit. In general, FC3 aircraft have less information available than modules with a clickable cockpit. Since it's arbitrary Lua code, you can open a network socket to communicate with external software. To learn more about Export.lua, you can read the original developer post documenting Export.lua on the internet archive (refers to outdated location of the Export.lua file) read the source code of Export.lua files for other software (Helios, DCS-BIOS, etc). In particular, pay attention to how they store the previous callback functions and make sure to run them as well. You should also minimize your use of global variables and ensure that any global variable you use has a name that is unique to your script. That avoids conflict with other Export.lua scripts. use my DCS Witchcraft project to interactively play around with the functions available through Export.lua (see the comments in WitchcraftExport.lua in addition to the README for setup instructions) Edited May 23, 2016 by [FSF]Ian DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Pindrought Posted May 23, 2016 Author Posted May 23, 2016 Ian;2787199']DCS: World will look for a file called Export.lua in the user profile (%USERPROFILE%\Saved Games\DCS\Scripts\Export.lua) and run it. That file can define callback functions that run at specific times. The Export.lua script has access to various functions that can query and manipulate the cockpit. In general, FC3 aircraft have less information available than modules with a clickable cockpit. Since it's arbitrary Lua code, you can open a network socket to communicate with external software. To learn more about Export.lua, you can read the original developer post documenting Export.lua on the internet archive (refers to outdated location of the Export.lua file) read the source code of Export.lua files for other software (Helios, DCS-BIOS, etc). In particular, pay attention to how they store the previous callback functions and make sure to run them as well. You should also minimize your use of global variables and ensure that any global variable you use has a name that is unique to your script. That avoids conflict with other Export.lua scripts. use my DCS Witchcraft project to interactively play around with the functions available through Export.lua (see the comments in WitchcraftExport.lua in addition to the README for setup instructions) Thank you so much Ian this is exactly the type of thing I was looking for. Will look into this.
hansangb Posted May 23, 2016 Posted May 23, 2016 You can also go through this thread: http://forums.eagle.ru/showpost.php?p=2749163&postcount=31 He uses export.lua among other things to build external feedback loop. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
Recommended Posts