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

News New output possibilities for DCS

Discussion in 'Digital Combat Simulators (DCS)' started by RiftFlyer, Apr 28, 2017.

  1. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    I too intend to add a fan setup to my simulator, especially now that I plan to buy the I-16 module next month which is open cockpit! I'm pretty excited for that one. [​IMG]

    Way back when I first got my 6DOF sim moving I had a regular big box fan set up in front of the sim blowing wind in my face while I was flying an open cockpit biplane in P3D and I was surprised at how much it added. I tried it thinking it was a silly idea but it really was immersive.

    @Zed Could you tell me how much you paid for the kit? PM me if it's inappropriate to post it here. Depending on price I might buy from him instead of getting everything separately. I want that to be a quick project so I can move on to the G-seat!
    • Like Like x 1
    Last edited: May 30, 2019
  2. Zed

    Zed VR Simming w/Reverb Gold Contributor

    Joined:
    Apr 4, 2017
    Messages:
    1,040
    Location:
    USA
    Balance:
    5,841Coins
    Ratings:
    +1,040 / 4 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Hey Trip, I don't find the e-mail trail and it's been a couple of years so I wouldn't want to give you the wrong number. I also traded some NIXIE tubes as part of the deal. He does have a thread about them on isrtv (https://www.isrtv.com/forums/topic/23623-complete-wind-simulators-and-kitsets-for-sale/) though. There is a last post from 3/10/19 asking if he is still making them with no reply as of yet. Not sure if he is still making them or not but they are well done. But also, everything is out there to just duplicate the design if he's not still making them or if you'd just rather build it yourself. When I bought it I was just looking at motion and effects and hadn't been exposed to it before. Once I worked through and even modified the code, it was no problem. Here's the build log: https://www.isrtv.com/forums/topic/23039-my-diy-wind-simulator/
  3. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    Thanks Zed. If he doesn't turn up (or if the kit is more than I'd be willing to pay) I'll make them myself. I just don't want it to take too big a chunk out of my hobby time, the G-seat build is where I want that to go when summer is over.
  4. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,162 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    The diy wind simulator is pretty easy to build, from cheap materials
    • Agree Agree x 2
    • Like Like x 1
  5. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    So the 180 wouldn't be needed if we were using yaw rotational velocity/acceleration instead of Yaw Euler angle right?

    On that topic... well this probably isn't the place to discuss it but in the other thread... but based on the "gravity does not exist" conversation that I found very enlightening the "1" here highlights the one thing I'm sure I don't understand about the no-Euler-Angles method I want to see implemented.

    We need that -1 for gravity to give us our lateral acceleration cue when flying at high bank angles in a straight line (airshow type aerobatics, aileron rolls, four point rolls, etc.) which would roll the cockpit to simulate "gravity". But then what do we do about the -1 causing the heave axis to constantly sit at a different position from center travel when flying straight and level without messing up the same 1G accleration that we want for the situation I described above?

    I'm planning to add a fan (or fans) myself, especially for the I-16!

    Trip

    PS- About the extra outputs (gamedash and gamevibe): I hate to say it since my budget is super tight but this is actually a good solution. If people want more than nine outputs, it's available but if they are running a DIY license (I am currently) they need a paid version of SimTools to get the extra telemetry outputs which helps with development costs etc. I'm always very conflicted when I think about buying a paid version. I really want to give the money to support the project, but it would be a significant burden to my finances. One more thing to put on the credit cards won't hurt right? =D
    • Like Like x 1
    Last edited: Jun 22, 2019
  6. Zed

    Zed VR Simming w/Reverb Gold Contributor

    Joined:
    Apr 4, 2017
    Messages:
    1,040
    Location:
    USA
    Balance:
    5,841Coins
    Ratings:
    +1,040 / 4 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Hey Trip. about adding that fan... (and that's not me ;))

    [​IMG]
    • Funny Funny x 1
  7. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    Haha! That's basically what I did the very first time I got to ride my motion sim. I was flying an open cockpit biplane so I set a fan up in front of me. I did it halfway as a joke but I was surprised it really did add to the experience.
    • Like Like x 1
  8. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    744
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,907Coins
    Ratings:
    +877 / 3 / -0
    Hey guys,

    I have started a thread about an Experimental DCS plugin I have created with the generous help of @value1. Among other changes, it activates the three "Extra" slots to allow users to export any data they like :) Feel free to export "windiness" or any other parameter into SimTools for use in motion cueing. Just modifiy the Export.lua file that the plugin creates in the <Username>/SavedGames/DCS/Scripts folder.

    Have fun :thumbs

    Dirty :)
    • Like Like x 3
    • Winner Winner x 2
  9. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    Hey guys, especially @Dirty @pmvcda @hexpod @BlazinH

    I think I may have found something exciting for DCS helicopters. Looking through one of my old LUA's (I used to use BFF and SimShakerAviators) I found this, but only for helicopters:

    --LoGetHelicopterFMData()
    -- return table with fm data
    --{
    --G_factor = {x,y,z } in cockpit
    --speed = {x,y,z} center of mass ,body axis
    --acceleration= {x,y,z} center of mass ,body axis
    --angular_speed= {x,y,z} rad/s
    --angular_acceleration= {x,y,z} rad/s^2
    --yaw radians
    --pitch radians
    --roll radians
    --}

    To me that looks like it could have incredible potential. Can one of you guys try to get this "in cockpit G-Factor x,y,z" into SimTools or FlyPT? I would LOVE to play with that. Especially since helicopters are my first and truest love. =) I am having a ball with fixed wing aerobatic stuff though. Man that Yak-52 is a blast to play with!
    • Like Like x 2
  10. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    2,107
    Location:
    Portugal
    Balance:
    14,963Coins
    Ratings:
    +2,508 / 17 / -0
    My Motion Simulator:
    6DOF

    Since I have the demo, there's no helicopters, so I don't get values.

    Replace the code of acceleration in the script by this one and try when you can:
    Code:
        -- local acceleration = LoGetAccelerationUnits()
        local helidata  = LoGetHelicopterFMData()
        local acceleration = helidata.G_factor 
    • Like Like x 1
    • Winner Winner x 1
    • Informative Informative x 1
  11. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    It works, and it's too soon to say but so far it feels great! Thanks!
    • Like Like x 2
  12. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    2,107
    Location:
    Portugal
    Balance:
    14,963Coins
    Ratings:
    +2,508 / 17 / -0
    My Motion Simulator:
    6DOF
    Those G's should be what we feel in the cockpit (that's how I interpreted it).
  13. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    744
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,907Coins
    Ratings:
    +877 / 3 / -0
    Yeah! That's how I'm reading it too :) Great! Unfortunately only for helos :)

    btw. I have tested my module that converts the accelerations from CG-values to cockpit-values. Works, but I don't have it in .lua, only in my software.
  14. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    I understood it the same way, that's why I was so excited! It would seem strange for there not to be an equivalent value in DCS for fixed wing so I thought maybe we could find it if we dig deep enough.

    Someone pointed out a while back that if we could access what DCS World devs are using to animate pilots head movement due to G-forces that it would be great for driving motion sims. I was thinking about that when I saw this helicopter value.

    I'm just about to get back to sim testing and experiments after a busy weekend with family. I've got a lot to do and I work slow but I'll report on whatever I find that might be helpful.
    • Like Like x 1
  15. Zed

    Zed VR Simming w/Reverb Gold Contributor

    Joined:
    Apr 4, 2017
    Messages:
    1,040
    Location:
    USA
    Balance:
    5,841Coins
    Ratings:
    +1,040 / 4 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    OK, now to make it a little harder...

    I still haven't been able to find what I need, so will go ahead and ask.

    I was just looking for any references on how to do math in either the .lua files or in the math windows in Game Dash. Is there a manual somewhere? I looked in the SimTools manual and didn't find anything but my fu is weak if there is a Dash manual...

    What I am trying to do is an extension on doing math on airspeed with the canopy variable but I also want to combine RPM as well to make it a little more startling to use. I want to have two cases - canopy open and closed, but also add in RPM to airspeed.

    canopy open: wind = (scaled airspeed + scaled engine speed)

    canopy closed: wind = (scaled airspeed + scaled engine speed) * vent scaling factor

    This means combining two plugin variables and doing a case or switch based on canopy state.

    The effect would be something like sitting in a Texan or Tiger Moth with no wind. Start the motor and get RPM dependent wind because the canopy is open. Taxi or take off and get the air speed added in. Close the canopy, if there is one, and have the wind go way down but still be proportional to airspeed.

    Do you think it's possible? I'm thinking Game Dash won't allow combining variables so that means lua to make this work - I think.

    But I have only played with lua files doing things others have posted but I've never seen examples of math and case or switch statements. Anyone know if you can do this kind of thing to combine variables to get a final output value and switch between or multiply by 1 or 0 based on canopy state?
    • Winner Winner x 1
  16. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    744
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,907Coins
    Ratings:
    +877 / 3 / -0
    That can definitely be done directly in LUA! For anyone with a little experience in LUA it should be a matter of a few minutes to calculate a "windiness value" . In the Experimental DCS plugin you can use any of the three extra slots to export the data :)

    Cheers,...
    • Informative Informative x 2
  17. BrassEm

    BrassEm G-Seat + SFX100 Builder Gold Contributor

    Joined:
    Apr 15, 2015
    Messages:
    121
    Location:
    NE of YMML
    Balance:
    1,016Coins
    Ratings:
    +47 / 0 / -0
    My Motion Simulator:
    DC motor, AC motor, 4DOF
    G'day Zed,

    I've included my current experimental export.lua for reference where there is a tiny bit of math to calculate an exagerated sway ("lurching") on the ground. I use the export.log file created for .csv import into Excel to graph the parameters.

    It would be easier to do all the math in .lua than have to recompile the plugin for each experiment.
    https://www.lua.org/manual/5.3/manual.html#3.4.1

    I am sure there is a LoGetAircraftDrawArgumentValue(X) to cover the animation of the canopy open and closed. I believe the values 0 to 1 which would be fully opened to closed. (As per the landing gear suspension levels in the .lua) This can be verified in the DCS modelviewer where you can experiment with DrawArguement values I believe.

    Engine RPM might be not be a straight out LoGetRPM type function but part of a "LoGetEngine" function?

    You would then really on need to allocate one output to control your fan speed from your calculated final value in lua. (To Game Dash?).

    Hope this hasn't muddied the waters...

    Code:
    -------------------------------------------------------------------------------------------------------------------------------
    -- DCS Export Functions for use with XSimulator SimTools motion control software
    -- For SXF-100 Motion System and g-Seat-II Motion System.
    -- Based on original Export.lua from value1.
    -- Version 0.07
    -- Author: BrassEm
    -- 04/01/2020
    -- Take telemetry from DCS and converts it to suitable data for Simtools.
    -- Many thanks to [FSF]Ian, Frusheen(RiftFlyer), Asticher(vJaBoG32), Dirty, Andrey Filin from ED, FlyPT,
    -- yobuddy and value1 from XSimulator.
    -- It is assumed at this time that the g seat command is coming raw directly from the "accelerometers" in the aircraft.
    -- SFX-100 forces are Roll, Pitch, Heave and Surge.
    -- g-Seat-II forces in flight are Heave, Surge, Sway and Roll.
    -- ground lurching is added in to augment ground handling.
    -- Added output delay on start up to allow aircraft to settle for 4 seconds and avoid violent lurching.
    -------------------------------------------------------------------------------------------------------------------------------
    
    -- Aircraft Names and Observations.
    -- --------------------------------
    -- C-101EB
    -- F-15C
    -- F-5E-3
    -- F-86F
    -- FA-18C_hornet
    -- Hawk
    -- L-39C
    -- L-39ZA
    -- M-2000C
    -- MiG-15bis
    -- MiG-21Bis
    -- MiG-29A
    -- MiG-29S
    -- Su-25
    -- Su-25T
    -- Su-27
    -- Su-33
    -- J-11A
    -- AV8BNA
    -- A-10A
    -- A-10C
    -- AJS37
    -- Bf-109K-4
    -- FW-190D9
    -- P-51D
    -- TF-51D
    -- SpitfireLFMkIX
    -- SpitfireLFMkIXCW
    
    
    -- Globals declared here
    PI = math.pi            -- 3.1415926535897932384626433832795028841971693993751
    HPI = PI/2                -- Radians in 90°
    PI2 = PI*2                -- Radians in 360°
    r2d = 180/PI            -- Radians to Degrees
    told = 0.0            -- Last Time function called
    
    Myfunction =
    
    {
    Start=function(self)
    
        -- Output file to check values.
        default_output_file = io.open("./Export.log", "w")
        
        package.path = package.path..";.\\LuaSocket\\?.lua"
        package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
        socket = require("socket")
    
        my_init = socket.protect(function()
            -- export telemetry to SimTools
            -- Setup comms for export telemetry to SimTools. Set host1 to your second PC IP.
            -- host1 = host1 or "19.190.26.5" -- Set to 127.0.0.1 for single PC or xxx.xxx.xxx.xxx for two PC's (Set to your 2nd PC IP)
            host1 = "19.190.26.5"     -- Mine in this case. Change it to yours.
            port1 = "41230"           
            c = socket.udp ( )
            c:settimeout ( 0 )
            c:setpeername ( host1, port1 )
    
        end)
        my_init()
    end,
    
    
    AfterNextFrame=function(self)
    
        local t = LoGetModelTime()
        local timedif = 0.0
        
        timedif = t-told  -- Get frame duration
    
        -- Aircraft name
        local myInfo = LoGetSelfData()
        local CurrentAircraft = myInfo.Name
        -- Add additional telemetry values for testing purposes
        local altRad = LoGetAltitudeAboveGroundLevel()
        local TAS = LoGetTrueAirSpeed()  -- (args - 0, results - 1 (m/s))
    
        -- g Forces
        local accel = LoGetAccelerationUnits()      -- (args - 0, results - 1 (g)) The g-Force.
        
        -- From Frusheen
        local vel_v = LoGetVectorVelocity() -- (1 m/s), vel_v.x, vel_v.y, vel_v.z 
        local vel_r = LoGetAngularVelocity() -- (radians per second), vel_r.x, vel_r.y, vel_r.z    = HUD Velocity Vector
        
        -- From FlyPT
        local GearMid = LoGetAircraftDrawArgumentValue(1)   -- Front/Rear landing gear (0 to 1)
        local GearTurn = LoGetAircraftDrawArgumentValue(2)  -- Turning landing gear (0 to 1)
        local GearLeft = LoGetAircraftDrawArgumentValue(4)  -- Left landing gear (0 to 1)
        local GearRight = LoGetAircraftDrawArgumentValue(6) -- Right landing gear (0 to 1)   
        
        -- Output to SimTools
        local yaw = vel_r.y            -- Pitch > #2 in Sim Tools     - Tuning Center Output. beta plugin. Sway on ground. WAS PITCH
        local roll = vel_r.x        -- Roll > #1 in Sim Tools     - Tuning Center Output. gamma plugin. Roll on ground.
        local pitch = vel_r.z        -- Yaw > #4 in Sim Tools     - Tuning Center Output. alpha plugin. Pitch on ground. WAS YAW
        local surge = accel.x        -- Surge > #6 in Sim Tools     - Tuning Center Output. Surge plugin .
        local heave = accel.y        -- Heave > #3 in Sim Tools     - Tuning Center Output. Heave plugin.
        local sway = accel.z        -- Sway > #5 in Sim Tools     - Tuning Center Output. Sway plugin.
        local gsHeave = heave        -- Extra 1 > #7 in Sim Tools - Tuning Center Output. g-seat Heave. Was Aircraft slip. Not used.
        local gsSway = sway            -- Extra 2 > #8 in Sim Tools - Tuning Center Output. g-seat Sway. Was Aircraft lurching while on ground in roll.
        local gsSurge = surge        -- Extra 3 > #9 in Sim Tools - Tuning Center Output. g-seat Surge.  Was Aircraft lurching while on ground in pitch.
        -- Test velocity only
        local bump_surge = vel_v.x    -- Test variable. Surge bump.
        local bump_heave = vel_v.y    -- Test variable. Vertical bump.
        local bump_sway = vel_v.z    -- Test variable. Side bump.
        local lurch_scalar = 1.00    -- Ground bumpiness Scalar
                                    
        
        -- Convert Rates from radians into degrees.
        pitch = pitch*r2d
        roll = roll*r2d
        yaw = yaw*r2d
        
        pitch_lurch = pitch
        -- roll_lurch = roll
        sway_lurch = yaw
        
        -- Normalise Heave
        heave = heave-1   
        
        -- SimTools FORCES
        -- Roll
        -- Pitch
        -- Heave
        -- Yaw
        -- Sway
        -- Surge
        -- Extra1 - gsHeave - pitch_lurch
        -- Extra2 - gsSway - roll_lurch
        -- Extra3 - gsSurge - sway_lurch
    
        -- Add Aircraft lurching while on the ground.
        -- PROP aircraft have violent high g lurching.
        if CurrentAircraft == "SpitfireLFMkIX" then
            lurch_scalar = 0.2
        elseif CurrentAircraft == "SpitfireLFMkIXCW" then
                lurch_scalar = 0.2
        elseif CurrentAircraft == "P-51D" then
                lurch_scalar = 0.2
        elseif CurrentAircraft == "TF-51D" then
                lurch_scalar = 0.2
        elseif CurrentAircraft == "Bf-109K-4" then
                lurch_scalar = 0.1
        elseif CurrentAircraft == "FW-190D9" then
                lurch_scalar = 0.2
        elseif CurrentAircraft == "Yak-52" then
                lurch_scalar = 0.2
        else
                lurch_scalar = 6 -- changed from 1 to 2
                roll_scalar = 0.5 --Sway to roll.
                heave_scalar = 1.25 -- Heave on ground. 2.0
        end
        -- Add modified Lurch Code Here...
        -- ################################
        -- Blank code. Uncomment for no amplified lurch
        if (GearMid+GearLeft+GearRight) > 0 then
            -- Do On Ground lurch calculations
                pitch_lurch = pitch_lurch*lurch_scalar
                if TAS <= 15 then
                    pitch = pitch_lurch
                else
                    pitch_lurch = 0
                end
                -- roll_lurch = roll_lurch*lurch_scalar
                sway_lurch = yaw*roll_scalar
                roll =  sway_lurch
                heave = heave*heave_scalar
            else
            -- Null out Ground Lurch if in Air
            pitch_lurch = 0
            -- roll_lurch = 0
            sway_lurch = 0
        end
    
        TAS=(TAS/1) -- for graphing purposes
    
        if t >= 4.0 then
        -- Output Telemetry to Export.log file for testing purposes.
        default_output_file:write(string.format("AIRCRAFT: %s t: %.3f td: %.3f ALTRAD: %.2f TAS: %.1f PITCH: %.2f ROLL: %.2f YAW: %.2f SURGE: %.3f HEAVE: %.3f SWAY: %.3f gsHeave: %.2f gsSway: %.3f gsSurge: %.3f PITCH_LURCH: %.3f SWAY_LURCH: %.3f GEARMID: %.3f GEARLEFT: %.3f GEARRIGHT: %.3f BUMP_SURGE: %.3f BUMP_HEAVE: %.3f BUMP_SWAY: %.3f \n", CurrentAircraft, t, timedif, altRad/10, TAS, pitch, roll, yaw, surge, heave, sway, gsHeave, gsSway, gsSurge, pitch_lurch, sway_lurch, GearMid, GearLeft, GearRight, bump_surge, bump_heave, bump_sway))   
        
    
        my_send = socket.protect(function()
            if c then
                socket.try(c:send(string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", pitch, roll, yaw, surge, heave, sway, gsHeave, sway_lurch, pitch_lurch)))
            end
        end)
        end
        told = t
        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
        -- Close the output file
        if default_output_file then
            default_output_file:close()
            default_output_file = nil
        end
    end
    
    
    • Informative Informative x 2
    • Useful Useful x 1
  18. Zed

    Zed VR Simming w/Reverb Gold Contributor

    Joined:
    Apr 4, 2017
    Messages:
    1,040
    Location:
    USA
    Balance:
    5,841Coins
    Ratings:
    +1,040 / 4 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Thanks guys! I'll look into the lua manual, @BrassEm, and thank you for that code! It should have everything I need - if/then/else and the math examples. Perfect!

    And thanks @Dirty! I think if I do this right, having the wind start up with a motor and then go way down when/if a canopy opens or closes, and goes away when you shut off an engine ought to be trick. I'll report back. I want to do this in all flight sims I run that support it.
    • Like Like x 1
  19. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    675
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    3,922Coins
    Ratings:
    +330 / 6 / -0
    My Motion Simulator:
    6DOF
    Ok this looks like what you guys are talking about could be what I have to learn to do in order to find the trigger I can use for "on-ground" for the Huey.

    Keep in mind this stuff is all way over my head so if you guys can post any more links or anything to help me learn how to figure out the available LUA export values please do so!

    To date I've only used "known" values I could find via google or forum searches so this LUA manual and the model viewer concept is totally new to me. I'll let you know how it goes after I get to poke at it a bit.

    Thanks
    • Like Like x 1
  20. BrassEm

    BrassEm G-Seat + SFX100 Builder Gold Contributor

    Joined:
    Apr 15, 2015
    Messages:
    121
    Location:
    NE of YMML
    Balance:
    1,016Coins
    Ratings:
    +47 / 0 / -0
    My Motion Simulator:
    DC motor, AC motor, 4DOF
    @ Trip, I think you are looking for the skid animation on the huey. I had a quick look and found it. To load the model .edm in modelviewer you need the ab-212.edm. Sliding the 104 variable animates the skids.

    For your .lua you would need to add something like (Skidload variable name just a suggestion);

    local Skidload = LoGetAircraftDrawArgumentValue(104) -- Skid loading animation from no load (0) to max load (1) (0 to 1)

    if Skidload > 0 then
    Touching ground code....
    else
    Flying code...
    end

    I won't get to fly the huey to test it for a while yet. I am confident it will work for you.

    Skid_104.png
    • Informative Informative x 2
    Last edited: Jan 16, 2020