1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Experimental DCS Plugin ready for testing

Discussion in 'Digital Combat Simulators (DCS)' started by Dirty, Jun 28, 2019.

  1. Icebeat

    Icebeat New Member Gold Contributor

    Joined:
    Feb 21, 2020
    Messages:
    10
    Balance:
    - 61Coins
    Ratings:
    +1 / 0 / -0
    why in hooks? my Export.lua is in DCSopenbeta/Scripts/ but nothing xsim related in hooks
  2. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    OH,....

    that's definitely worth investigating! I will have to install the openbeta to reproduce the bug.
  3. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    There are two plugins for DCS:

    There's the original plugin by @value1 . And there's my plugin.

    I called my plugin "experimental", because I wanted to try out a few things and wanted to clearly distiguish it from the original plugin. "Alternative plugin" would probably have been the better name :)

    The original plugin (not mine!) uses Export.lua in the scripts folder. That's a simple and OK method if you are using only a single DCS add-on, but since many DCS users have multiple add-ons running, that file might already be in use by another add-on. It is possible to use that one file for multiple add-ons, but integrating two scripts into one is very prone to error unless you know at least a little Lua programming.

    My plugin uses its own independent script which no longer interferes with any other add-ons. This script resides in...
    • Stable branch: ".../SavedGames/DCS/Scripts/Hooks"
    • Open beta branch: ".../SavedGames/DCS.openbeta/Scripts/Hooks"
    ...and if you patched DCS via the plugin manager, it should have created those folders for you.


    Here's where things sometimes go wrong:
    • If you had the original plugin installed, unpatch DCS before you re-patch it using the experimental plugin. You can keep both plugins installed in SimTools, but you should only ever have one of them patch DCS.
    • During plugin installation you are asked to specify a DCS folder. This must be "[username]/SavedGames/DCS...." (where you have all your user data), NOT the DCS game folder(where you installed the game).

    I will install the openbeta branch trying to reproduce the bug, but you please check that you have the plugin installed properly and that DCS is patched.

    Cheers,....

    Drity :-D
    • Like Like x 1
    Last edited: May 11, 2021
  4. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    So, I have installed the open beta branch (btw, nice new clouds!!) and it seems to work just fine. I would've been very surprised if that update had broken the export script.

    upload_2021-5-11_12-26-54.png

    But no worries, if you are willing to check a few points for me, we will 100% get this working. I promise.

    1st point:
    Can you please do the patching process again and then check if there is an export script in "...[username]\Saved Games\DCS.openbeta\Scripts\Hooks". Even better if you could post a screenshot of that folder.
    • Friendly Friendly x 1
  5. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Has anyone managed to get the Spitfire working? I can get the IAS figures in GameDash but nothing for the axes?
  6. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Just noticed that the default P51 gives the same thing, so nothing in the Output Testing Virtual Axis. I also have scripts for DCS-BIOS and SimShaker installed, so thought that may be part of the problem. I removed them from the Scripts directory and stopped DCSBios but no change...
  7. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    The more I look at it (and I have been working on this all day :eek: ) the more I can see the plugin installation is not working properly. This in spite of the patch saying it has done so successfully. I cannot see the DCSx graphic (I can see the other patches like MSFS and X-Plane) and I cannot see the IAS, AOA etc in the Tunung Centre.
    The SimTools Hook lua is in scripts/hooks folder but the Export.lua in Scripts contains no reference to it at all, only to Simshaker and DCSBios.
    Any ideas at this stage will be gratefully accepted!
  8. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    The Export.lua is not relevant for this plugin anymore. Only the file in the Hooks folder.

    But no worries, if you are willing to check a few points for me, we will 100% get this working. I promise.

    1st point:
    Can you please do the patching process again and then check if there is an export script in "...[username]\Saved Games\DCS(.openbeta)\Scripts\Hooks". Even better if you could post a screenshot of that folder.
    • Like Like x 1
  9. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    Do you have DCS or DCS.openbeta installed? Or both?

    Also, can you check in "...[username]\Saved Games\DCS(.openbeta)\Logs\DCS.log" if you find the following entry:
    "INFO Starting motion data export. Export script v0.10"

    If that log file is already full to the extent that you can barely find anything, then just delete the content and next time youstart DCS it will re-populate the log file.
  10. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Many thanks Dirty!
    This is what the Game Manager looks like after I have patched the game (plugin zip file dropped into Plugin Updater, then game patched using Game Manager.
    I only have one version of DCSWorld being the beta.
    These are the files in the Hooks folder:
    upload_2021-12-30_20-6-4.png

    This is the successfully patched game screenshot:
    upload_2021-12-30_20-9-57.png

    Now, the dcs.log file did NOT have "INFO Starting motion data export. Export script v0.10" in it.

    Much appreciate your having a look!
  11. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    @Dirty just cleared the log file and ran DCS again. Lo and behold, something happening now..!
    upload_2021-12-30_20-31-57.png

    I then also rechecked the log file and found this line:
    "2021-12-30 20:22:01.041 INFO SimTools: Starting motion data export. Export script v0.10"
    I still cannot see the proper descriptions or data for Extra 1,2,and 3 and the logo still does not appear, so there may yet be something amiss. Progress however!
  12. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Also very happy to report that the basic data seems to be coming through for the Spitfire too!

    upload_2021-12-30_20-39-2.png
  13. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Here's another interesting one I thought I could share; here we have SimTools, the DCS Spitfire, DCS Bios and Simshaker all running with data still coming through to the Simtools tuning center.
    But not for the extras...?
    ( I am particularly interested in IAS and RPM on the Spitfire, if I can get them running I can get rid of DCS Bios as I only use it for speed force feedback on the stick and rudders now and would like to run wind on a combination of IAS and RPM or just RPM.)

    upload_2021-12-30_20-53-16.png
  14. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    Ahhhh,... we're making progress :)

    Deleting the log file should not have made a difference, but I mentioned it in case you had trouble finding the line. If that INFO message shows in DSC.log, then at least the export script is running :)

    IIRC, having no data in the Extra 1-3 slots (slot_GE_07 ...08 ...09) is normal. By default, only the six "main" slots are filled. Check the export script to see details here:
    Screenshot 2021-12-30 at 22.24.40.png

    You can fill the other slots with any data you like. If you like IAS, you can see that the variable "IAS" is assigned a value in this section of the export script:
    Screenshot 2021-12-30 at 22.31.00.png
    All you have to do is put that variable in one of the slots like so:
    Screenshot 2021-12-30 at 22.32.55.png

    RPM is available for export somewhere as well,... I think it is aircraft specific data, so you will have to know the argument number to ask for if you want RPM returned.

    I think it was @MarkusB or @Zed who wrote a function for "Windiness" and I think it contained the aircraft RPM. Maybe one of them can post here how to get RPM.
    • Like Like x 1
    Last edited: Dec 30, 2021
  15. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    I think I remember that this "Windiness()" function even included the canopy-value so that it closely represented how much wind is present in the cockpit.... very nice to play around with back then!
    • Like Like x 1
  16. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Many thanks @Dirty ! Also thank you for the great work and support on this plugin!
    I will try that and report back here on how that goes.
    I am doing a pneumatic GForce seat, so I suspect I only need the accelerations for that, not roll, pitch or yaw?
    Am I correct in assuming that the accelerations translate as follows:
    Longitudinal to surge,
    Vertical to heave and
    Lateral to sway?
    So that if for example the aircraft pitches forward (bunts) and you experience negative g it equates to negative vertical acceleration? Does one then still need the Pitch data when using your plugin?
  17. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    If you have a pitch channel, then it "should" display pitch rate (after a highpass filter and two lowpass filters) as well as longitudinal acceleration (after 3rd order LP filter). These two signals are in superposition. Both are displayed. That's the theory at least....

    In the end, play around and try stuff out!

    ---------------------------------------------------------------------

    Here are two functions I found that may give you RPM:
    • local RPM = LoGetAircraftDrawArgumentValue(x)
    ...or...
    • MainPanel = GetDevice(0)
      local RPM = MainPanel:get_argument_value(x)
    You will have to know the value of x, but there are only ~100 values,.... you may give this a try. See if you can find it.
    • Winner Winner x 1
  18. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Thanks again @Dirty!
    Will do and will report back here on findings.
  19. RJ Stausebach

    RJ Stausebach Member Gold Contributor

    Joined:
    Jul 9, 2017
    Messages:
    49
    Location:
    Ireland
    Balance:
    297Coins
    Ratings:
    +12 / 0 / -0
    My Motion Simulator:
    Arduino
    Hi @Dirty, another day trying various options but not getting the RPM.
    The value for the Spitfire RPM is 37 from other posts by @Zed
    As soon as there is an error in the LUA code it does not provide any feedback. Thus I could see that
    "local RPM = LoGetAircraftDrawArgumentValue(37)" does not work, neither does
    "MainPanel = GetDevice(0)
    local RPM = MainPanel:get_argument_value(37)"



    upload_2021-12-31_17-36-25.png

    This is the code currently. I just dont know how it should be inserted or whether the number is correct.
    @Zed would appreciate some input if you can?

  20. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,825Coins
    Ratings:
    +859 / 2 / -0
    Sorry, my mistake :)

    Try "local RPM = Export.LoGetAircraftDrawArgumentValue(37)". You need this "Export" prefix, because the script calls that function from outside the Export.lua.

    That should do it. I can't try it out myself, I'm drunk on a new years party :cheers

    Happy new year!!!!
    • Like Like x 1