doveman Posted May 7, 2014 Posted May 7, 2014 X-Plane uses what it calls datarefs for sharing instrument (and other) data and commands, all with permanent names, for actions the sim can take. A simple explanation and examples are here: http://developer.x-plane.com/2009/04/datarefs-vs-commands-i-whats-the-difference/ and the full list here: http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html With all the difficulties in DCS with editing lua files to enable exporting data and commands changing, so that people have to edit the files again to get things working that have been broken, I've been wondering if DCS wouldn't be improved and made easier to manage if it just used a similar method to X-Plane? I don't see why special export files should need to be created to make the data available for display in other programs or pit instruments/displays. In X-Plane, you can just tick the data you want enabled (or displayed on screen for testing purposes) which is so much easier. For the commands, we could have something like: dcs/ka50/autopilot/altitude_arm I figured we might need to specify the aircraft at the second level but maybe that's not necessary and just using dcs/autopilot/altitude_arm would work fine and be translated internally to the relevant switch (or ignored if the aircraft doesn't have that function). There will be some commands/datarefs that only work/apply to some aircraft but that shouldn't be a problem. I think this would not only make it easier for pit builders but also for stick owners, as it would allow for a separate app, whether official or third-party, to map stick axis/buttons to these commands, which could be a lot easier than doing it in DCS's current GUI and even if commands are added in future, the existing ones would stay the same. So once the stick config file is setup with: Button 1 = dcs/autopilot/altitude_arm Button 2 = dcs/autopilot/trim and so on, that won't be affected by any update and no-one should ever have to map all the buttons again, unless they want to change them of course. Anyway, what do people think? Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen
docfu Posted May 7, 2014 Posted May 7, 2014 I'm not sure how x-plane's system works but it would be nice to know how the places in DCS are actually programmed. It seems odd to me that a plane like the SU-25T, having 3 states for lights (On, blinking, off) would only have a single push button to toggle between them. It seems like must be an additional layer of code to make switching between them would be needed. Honestly if I knew how to program my own functions and controls into aircraft directly, I'd probably start doing that for the functions I wanted...
metalnwood Posted May 7, 2014 Posted May 7, 2014 The main difference is that DCS doesn't document and over time has not treated their data as something for other people to use. The end result of that is that things change without notice and things break. What we get from DCS is basically the same as what we can get from xplane, the difference being that plane will take more care not to screw their api to have adverse effects for 3rd parties. Their gui to setup the export does make things easier as we have all the scripts to write to achieve the same thing, otherwise as I say, the main difference is we need DCS to respect a little more that people use the export data and want some consistency with it.
Boltz Posted May 7, 2014 Posted May 7, 2014 (edited) These all exist in DCS World. You just have to know where to look. I don't use any of the joystick mapping but tap into the export.lua which allows you to control everything and read everything. DCSW uses what are called Controller IDs, Event IDs and values for input and then Argument IDs for output. I agree with metalnwood about them not documenting anything like this. I have to search through many files and folders to find what I need and often just end up looking through log files. I am slowly adding them to a document. The UFC is done and can be found at http://forums.eagle.ru/showpost.php?p=1938088&postcount=14 in the attachment. The Master Caution Light is event 404 IIRC. It's difficult to explain fully how it works and how to use it since you need to edit a lot and create an entire program (hence A2DCS.) I will document all these as well as part of the program. Everything I have found I had to make up by myself since the very little info I found on the subject seemed to work nothing like it did for me. Edit: And there's also an attachment there which shows how the interface to DCS works. That might help a you a bit. Edited May 7, 2014 by Boltz A-10C Cockpit Build Thread My YouTube Channel
doveman Posted May 7, 2014 Author Posted May 7, 2014 Yeah, it seems that ED don't take care not to change things in terms of export/input and cause problems for people who've got things setup already and another problem is that they use non-user friendly IDs, rather than easily understood datarefs/commands like X-Plane, so it would be great if they could understand the benefits of copying that approach. Of course, once we have A2DCS things will be a lot easier for those of us using Arduinos but even if ED did see the light and improve things, A2DCS would still be very much needed as an easy way to interface between DCS and Arduino and translate the signals between the two. Thanks for the attachments Boltz, they are helpful to see how DCS works at the moment. Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen
doveman Posted June 1, 2014 Author Posted June 1, 2014 Another nice thing I've found is that X-Plane always keeps any existing datarefs/commands valid, even when they add new ones for whatever reason, so existing setups don't get broken. If ED took the same approach, as well as maintaining an updated list of all the valid datarefs/commands like X-Plane does, I think it would make everyone's life a lot easier. So how about it ED? Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen
hossamzayed Posted August 31, 2015 Posted August 31, 2015 I'm really interested in setting up DCS with Arduino , could you kindly refer me to resources on that matter. I'm working on a 360 2 DOF sim cockpit and managed to get it working fine with xplane and arduino . but DCS quite delivers what I want in a sim more than x-plane and would really appreciate getting info about how to get my sim cockpit to work with DCS. though am not a pro C++ developer still learning and would appreciate if there is already a working plugin of some sort for exporting DCS (plane pitch and roll dataref) directly to arduino via UDP like x-plane. and thanks again.
Recommended Posts