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. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    I'll take a look into it tomorrow.

    I'm sure we will get it to work :)

    Dirty
    • Like Like x 1
  2. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Can you check if you have this...

    ---------------------------------------------------------------------------------------------------
    -- Experimental Export plugin for SimTools V2.3 (created by Value1, modified by Dirty)
    -- Version 0.03
    ---------------------------------------------------------------------------------------------------


    Myfunction =
    {
    Start=function(self)
    package.path = package.path..";.\\LuaSocket\\?.lua"
    package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
    socket = require("socket")

    my_init = socket.protect(function()
    -- export telemetry to SimTools
    host1 = host1 or "127.0.0.1"
    port1 = port1 or 41230
    c = socket.udp ( )
    c:settimeout ( 0 )
    c:setpeername ( host1, port1 )
    end)
    my_init()
    end,


    AfterNextFrame=function(self)
    --Euler Angles
    local mySelf = LoGetSelfData()
    local Yaw = mySelf.Heading
    local Pitch = mySelf.Pitch
    local Bank = mySelf.Bank
    local accel = LoGetAccelerationUnits()
    local omega = LoGetAngularVelocity()

    --Air Data
    local IAS = LoGetIndicatedAirSpeed()
    local AOA = LoGetAngleOfAttack();

    --Weight On Wheels
    local LeftGear = LoGetAircraftDrawArgumentValue(6)
    local NoseGear = LoGetAircraftDrawArgumentValue(1)
    local RightGear = LoGetAircraftDrawArgumentValue(4)

    local WOW = 0 --WOW = Weight On Wheels
    if (LeftGear > 0 or NoseGear > 0 or RightGear > 0)
    then
    WOW = 1
    else
    WOW = 0
    end

    --change exported values when on ground
    if (WOW == 1) then
    accel.x = accel.x * 1.00
    accel.y = accel.y * 1.00
    accel.z = accel.z * 1.00
    end


    --send data via UDP
    my_send = socket.protect(function()
    if c then
    socket.try(c:send(string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", omega.x, omega.y, omega.z, accel.x, accel.y, accel.z, WOW,IAS,AOA)))

    end
    end)
    my_send()

    end,


    Stop=function(self)
    my_close = socket.protect(function()
    if c then
    c:close()
    end
    end)
    my_close()
    end
    }


    -- =============
    -- Overload
    -- =============

    -- Works once just before mission start.
    do
    local PrevLuaExportStart=LuaExportStart
    LuaExportStart=function()
    Myfunction:Start()
    if PrevLuaExportStart then
    PrevLuaExportStart()
    end
    end
    end

    -- Works just after every simulation frame.
    do
    local PrevLuaExportAfterNextFrame=LuaExportAfterNextFrame
    LuaExportAfterNextFrame=function()
    Myfunction:AfterNextFrame()
    if PrevLuaExportAfterNextFrame then
    PrevLuaExportAfterNextFrame()
    end
    end
    end

    -- Works once just after mission stop.
    do
    local PrevLuaExportStop=LuaExportStop
    LuaExportStop=function()
    Myfunction:Stop()
    if PrevLuaExportStop then
    PrevLuaExportStop()
    end
    end
    end


    ...code in your Export.lua file? You should find it in C:\Users\[your name]\Saved Games\DCS\Scripts\Export.lua

    And can you also check if version 0.02 works? link here
  3. gbdesai

    gbdesai New Member Gold Contributor

    Joined:
    May 28, 2019
    Messages:
    23
    Balance:
    84Coins
    Ratings:
    +7 / 0 / -0
    I'll check first thing in the morning. Not home right now. Thanks for working on this! Also quick question. For the normal plugin I used the anti-roll option along with smoothness, washout and gain.

    Do I need to get rid of those advanced settings when I get this plugin working?

    G
  4. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    As far as I know, the anti-roll function is obsolete with this experimental plugin. After all it is the very reason I did this modification.

    The smoothing/washout should still be applied. Exactly which filter depends on whether you use SimTools or FlyPT. In the latter I'd use a LP(HP) on Roll and Pitch.

    Dirty :)
  5. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Btw, is anyone else having trouble with v0.03?
  6. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,920Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    Didn't get to test, last night turned into a total Cluster____. Computer kept locking up, files getting corrupted...... something I've been using has been causing problems, either that or the old Samsung 840 Evo Windows is installed on might finally be going bad.

    Found out one thing that cost me hours last night was one of the zip ties holding down my motion compensation wand was depressing the grip button.... 30 second fix after hours of troubleshooting.... argh.

    Finally got everything straightened out just in time to get ready for bed. Hopefully I'll be able to do some testing tonight or tomorrow but I have family obligations the next few days so no guarantees.
  7. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    I'll give this a try today. Not sure how much help I can be, I'm clueless with how the software interfaces with my motion rig. I'm currently using a prosimu T1000 3DOF with simtools pro. I was using a modified export.lua to smooth out the loop effect, and was never able to get any yaw working for DCS. I'll check back later, thank you for the effort!

    I fly the AV8 exclusively
  8. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    So I installed the plugin and patched it after removing the old patch. I'm getting a violent roll reversal in rolls, and about 3/4 of the way through a loop. Still no yaw.

    This is in the AV8 with a prosimu T1000 3 DOF

    Contents of my export.lua:

    ---------------------------------------------------------------------------------------------------
    -- Export plugin for SimTools V3
    -- Version 1.0
    -- Export start
    ---------------------------------------------------------------------------------------------------
    Myfunction =
    {
    Start=function(self)
    package.path = package.path..";.\\LuaSocket\\?.lua"
    package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
    socket = require("socket")
    my_init = socket.protect(function()
    -- export telemetry to SimTools
    host1 = host1 or "127.0.0.1"
    port1 = port1 or 41230
    c = socket.udp ( )
    c:settimeout ( 0 )
    c:setpeername ( host1, port1 )
    -- c:send ( "Hello Wolrd!" )
    -- c1 = socket.try(socket.connect(host1, port1)) -- connect to the listener socket
    -- c1:setoption("tcp-nodelay",true) -- set immediate transmission mode
    -- c1:settimeout(.01)
    end)
    my_init()
    end,
    AfterNextFrame=function(self)
    local altRad = LoGetAltitudeAboveGroundLevel()
    local pitch, bank, yaw = LoGetADIPitchBankYaw()
    local accel = LoGetAccelerationUnits()
    -- reduce forces on ground
    -- if altRad < 3 then
    -- accel.x = accel.x * 0.25
    -- accel.y = accel.y * 0.25
    -- accel.z = accel.z * 0.25
    -- end
    my_send = socket.protect(function()
    if c then
    -- socket.try(c1:send(string.format("%.3f; %.3f; %.3f; %.3f; %.3f; %.3f;\n", pitch*1000.0, bank*1000.0, yaw*1000.0, accel.x*1000.0, accel.y*1000.0, accel.z*1000.0)))
    socket.try(c:send(string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", pitch, bank, yaw, accel.x, accel.y, accel.z)))
    end
    end)
    my_send()
    end,
    Stop=function(self)
    my_close = socket.protect(function()
    if c then
    c:close()
    end
    end)
    my_close()
    end
    }
    -- =============
    -- Overload
    -- =============
    -- Works once just before mission start.
    do
    local PrevLuaExportStart=LuaExportStart
    LuaExportStart=function()
    Myfunction:Start()
    if PrevLuaExportStart then
    PrevLuaExportStart()
    end
    end
    end
    -- Works just after every simulation frame.
    do
    local PrevLuaExportAfterNextFrame=LuaExportAfterNextFrame
    LuaExportAfterNextFrame=function()
    Myfunction:AfterNextFrame()
    if PrevLuaExportAfterNextFrame then
    PrevLuaExportAfterNextFrame()
    end
    end
    end
    -- Works once just after mission stop.
    do
    local PrevLuaExportStop=LuaExportStop
    LuaExportStop=function()
    Myfunction:Stop()
    if PrevLuaExportStop then
    PrevLuaExportStop()
    end
    end
    end
    local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua')
    dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]])

    Attached Files:

    • 1.png
      1.png
      File size:
      197.5 KB
      Views:
      525
    • 2.png
      2.png
      File size:
      205.9 KB
      Views:
      408
    • 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,826Coins
    Ratings:
    +859 / 2 / -0

    That's the old (conventional) Export.lua! Download v0.03 (first post), unpatch the game and then repatch with the latest plugin.

    Tell me how it went, I'm happy to help anytime and I'm curious to know why things go wrong sometimes :)

    Dirty :)
    • Like Like x 1
    • Agree Agree x 1
  10. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    Thank you for the reply. So I'm closing Game Manager and Engine after unpatching. Opening Plugin Updater and adding v.03 and it adds sucessfully. Open Game Manager and patch, select directory, and it keeps patching to the old version. I even deleted export.lua completely and it still creates a new one with the old version. What am I missing here?
  11. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    After some messing around, I'm having the same trouble as gbdesai. Removed everything related to the old plugin, tried re-installing the v.03 plugin several times. Get a message asking if the plugin was installed incorrectly. No DCS plugin showing in game manager list. Old plugin installs just fine. Simtools 2.4.0 pro.
  12. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    Ok I manually applied the plugin, by unzipping the .dl file to my plugins directory and putting the export.lua into my saved games/dcs/scripts. It works! In the air, the AV8 feels amazing, much better than the old plugin and I have yaw! I air started for the test, and on landing got some really crazy shaking and yawing, even after stopping completely. Any ideas for fixing that? I'd also like to increase the yaw effect. Export.lua and simtools setting below.

    This will be much better for helicopters and such, it is so much better than the old plugin when in the hover. Thank you again for the effort.

    Attached Files:

    • 1.png
      1.png
      File size:
      214.3 KB
      Views:
      414
    • 2.png
      2.png
      File size:
      210.3 KB
      Views:
      435
    • 3.png
      3.png
      File size:
      204.6 KB
      Views:
      442
    • 4.png
      4.png
      File size:
      170.3 KB
      Views:
      409
    Last edited: Jul 23, 2019
  13. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    118
    Location:
    New Jersey USA
    Balance:
    750Coins
    Ratings:
    +30 / 1 / -0
    My Motion Simulator:
    3DOF
    Ok all sorted! The ground multipliers in the default export were *1000! Dropped them to 1, and it's running perfectly. Seriously guys I can't thank you enough!
    • Like Like x 2
    • Winner Winner x 1
  14. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Thank you! That's great to hear.
    • Like Like x 1
    • Agree Agree x 1
  15. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Yes, that was it! I was just about to write this to you when I got your post. :grin:grin

    I did this *1000 factor to check if the OnGround detection worked properly and to see if the gain was applied properly. Guess I didn't remove it before compiling the plugin and it found it's way into v0.03 :blush

    I will correct it before the weekend. As a quick fix you can manually change those values back to "1.0" like @Moe Colontonio did.

    IMG_1425.jpeg
    • Funny Funny x 1
  16. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    I will try to find out why some people have trouble installing it. Or why the previous plugins Export.lua file keeps re-appearing.

    @value1 , somewhere in the plugin code it said: "Name of plugin, must be unique". Could it be that it causes an unresolvable ambiguity between the original plugin and my modification if I don't rename this?

    Dirty :)
    • Like Like x 1
  17. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,462Coins
    Ratings:
    +3,318 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    @yobuddy Can you clarify this? (Private Const _GameName As String = "DCS" 'GameName (Must Be Unique!) - the displayed Name.)
  18. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    OK, I gave it a try to simply rename the plugin without really knowing what it would do internally :)
    Initially, I got a few errors, but I think I was able to fix them manually.

    You can download v0.04 here.

    The plugin should now show as "DCSx" (x for eXperimental) in SimTools and I'm hoping that this will lead to the plugin no longer interfering with the original plugin. We'll see... :) Let me know if it still does, and also if you run into other issues.

    Dirty :)
    • Like Like x 4
  19. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    It seems, when I install this plugin AFTER the original plugin, SimTools will show two plugins in the list in GameManager. Unfortunately BOTH are now named "DCSx" :confused: but in the file location (C:/Users/[YourName]/AppData/Local/SimTools/GamePlugins) it only has the plugin installed last

    I was hoping for people to be able to have both selectable, but as of now, I would not recommend doing that. Maybe there is a way, but I wouldn't know how to do that.

    Until then, my recommendation is to...
    1. Remove original patch in GameManager
    2. Check C:/Users/[YourName]/AppData/Local/SimTools/GamePlugins to be sure there is no DCS_GamePlugin.dll
    3. Open PluginUpdater and install the experimental DCS Plugin (DCSx)
    4. Open GameManager and patch DCS for motion.

    Dirty:)
    • Like Like x 1
    • Informative Informative x 1
  20. gbdesai

    gbdesai New Member Gold Contributor

    Joined:
    May 28, 2019
    Messages:
    23
    Balance:
    84Coins
    Ratings:
    +7 / 0 / -0
    Oh wow, this sounds promising. I just got home from a business trip will be trying tonight. Maybe manual install of the DLL with the export.lua file will.fix the install issue.