Frusheen Posted May 9, 2016 Posted May 9, 2016 I'm looking for some help finding some variables for a custom export.lua file for my G-Seat (link in my signature). I'm already exporting six values and the plugin has room for nine in total. The custom lua script I'm using is part of the dcs plugin created for sim tools (http://www.xsimulator.net) The current variables defined in the lua are: local pitch, bank, yaw = LoGetADIPitchBankYaw () local accel = LoGetAccelerationUnits () The problem I'm having is when flying helicopters I'm missing some forces. In a stationary pirouette in the Huey for example I have no lateral force. I think the values of the slip ball and turn coordinator would give the required values needed to apply these lateral forces to my seat. Can anyone explain how to call these two variables in the export.lua script? Do they vary between aircraft? Sorry I'm not familiar with lua and from the snooping I've done through some Helios export scripts it appears to me these variable names may differ between aircraft. Any help appreciated. __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
Capt Zeen Posted May 9, 2016 Posted May 9, 2016 (edited) for FC planes you can get the sleepball using LoGetSlipBallPosition() for the helicopters you need to use getdevice() and each plane got his own values. Examples: Mi-8 local MainPanel = GetDevice(0) local TurnNeedle = MainPanel:get_argument_value(22) local Slipball = MainPanel:get_argument_value(23) Uh-1H local MainPanel = GetDevice(0) local TurnPtr = MainPanel:get_argument_value(132) local SideSlip = MainPanel:get_argument_value(133) KA50 local MainPanel = GetDevice(0) local ADI_sideslip = MainPanel:get_argument_value( 108 ) So, if you want to do a multi-airplane export, you need to detect first, what are you flying, and then get the correct values. something like that: local myInfo = LoGetSelfData() CurrentAircraft = myInfo.Name -- this give you the name of the aircraft hope that help. .. Edited May 9, 2016 by Capt Zeen Capt_Zeen_HELIOS PROFILES_WEBSITE Capt_Zeen_Youtube Channel
Frusheen Posted May 9, 2016 Author Posted May 9, 2016 Thanks Capt Zeen, That's what I was afraid of. It's going to take some work for me to figure this out. Is there an easy way to live view and debug the output from the export script while the game is running? So I need to define two user variables and populate them based on the aircraft type being flown. Sorry if they are not the correct programming terms. I'd love to try and learn to do this myself as I'll be hoping to add the gazelle and also the bo105 in the future. The G-seat is purely for helicopters. I'll study some of your export scripts for Helios and try and get my head around it. __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
Capt Zeen Posted May 10, 2016 Posted May 10, 2016 Yes, you can inspect values while the game is running using the tool WitchCraft from [FSF]Ian http://forums.eagle.ru/showthread.php?t=126516 Width that tool you can open a console in a browser and put lua commands directly on the console, and you get the resoult. (Thanks Ian! ) Capt_Zeen_HELIOS PROFILES_WEBSITE Capt_Zeen_Youtube Channel
Frusheen Posted May 12, 2016 Author Posted May 12, 2016 (edited) Yes, you can inspect values while the game is running using the tool WitchCraft from [FSF]Ian http://forums.eagle.ru/showthread.php?t=126516 Width that tool you can open a console in a browser and put lua commands directly on the console, and you get the resoult. (Thanks Ian! ) Capt Zeen thank you so much for your help. I have zero experience programming but with your help I have written the following code snipet which is returning the values I need in the Witchcraft console. Thanks to Ian for that utility :thumbup: function AircraftType () local myInfo = LoGetSelfData() local CurrentAircraft = myInfo.Name if CurrentAircraft =="TF-51D" then local MainPanel = GetDevice(0) local Slipball = MainPanel:get_argument_value(28) return Slipball elseif CurrentAircraft == "Su-25T" then local Slipball = LoGetSlipBallPosition() return Slipball end end local User1 = AircraftType() local pitch, bank, yaw = LoGetADIPitchBankYaw() local accel = LoGetAccelerationUnits() return (string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", pitch, bank, yaw, accel.x, accel.y, accel.z, User1)) I wrote this on my laptop which does not have modules installed. If you think it looks correct I will expand it and test it on my PC where I have my full DCS install. Here is an example of the values in the returned string: 0.0847; 0.0020; 5.5755; 0.1363; 0.9817; -0.0001; 0.0018; Obviously the final version will be output over UDP. I just did it this way to test. I think these seven values should give me all I need for the G-Seat. I think the AircraftType function should be run just once at mission start! Is that correct or may it be left as is within AfterNextFrame? EDIT I should add I don't think I require the turn pointer. The slipball value should suffice Edited May 12, 2016 by Frusheen __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
Frusheen Posted May 24, 2016 Author Posted May 24, 2016 I have written an additional function to get the turn needle position but can't find the correct function call for flaming cliffs aircraft. It works fine with other modules. I have LoGetSlipBallPosition for the slipball and wonder is there an equivalent for the turn needle. Unfortunately LoGetADIPitchBankYaw returns only a turn angle which will reset after 180 degrees. I need a turn rate (-1 to 1). Can anyone help? __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
Capt Zeen Posted May 27, 2016 Posted May 27, 2016 I have written an additional function to get the turn needle position but can't find the correct function call for flaming cliffs aircraft. It works fine with other modules. I have LoGetSlipBallPosition for the slipball and wonder is there an equivalent for the turn needle. Unfortunately LoGetADIPitchBankYaw returns only a turn angle which will reset after 180 degrees. I need a turn rate (-1 to 1). Can anyone help? You can convert value ranges to the value range you need. for example: values from -180 to 180, just divide the value by 180 and you get a range from -1 to 1 Other conversions need a more complex solution, but always a very easy maths operation . hope that help. Capt_Zeen_HELIOS PROFILES_WEBSITE Capt_Zeen_Youtube Channel
FSFIan Posted May 27, 2016 Posted May 27, 2016 I think this would work for calculating the turn rate from two turn angles angle1 and angle2 measured at two different times t1 and t2: function getTurnRate(t1, angle1, t2, angle2) local delta_t = t2 - t1 local delta_angle = angle2 - angle1 if delta_angle < -180 then delta_angle = delta_angle + 360 end if delta_angle > 180 then delta_angle = delta_angle - 360 end return delta_angle / delta_t end DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Frusheen Posted May 27, 2016 Author Posted May 27, 2016 You can convert value ranges to the value range you need. for example: values from -180 to 180, just divide the value by 180 and you get a range from -1 to 1 Other conversions need a more complex solution, but always a very easy maths operation . hope that help. I had hoped to use the turn needle to output a force rather than using the roll component of the ADI. It's not the number so much as the way it acts. The ADI causes a motion platform to flip direction at 180degrees. Many had asked for a continuous force for roll instead. I've tested the turn needle on non FC aircraft and it works but unfortunately the needle acts like a pendulum and overshoots/oscillates when returning to centre so is not really suitable for a motion platform. Perhaps I will apply some smoothing to it. Again though it's a value which I can not extract at all from FC aircraft. I had hoped there was a way to call it in the export lua for these aircraft. __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
Frusheen Posted May 27, 2016 Author Posted May 27, 2016 Ian;2791739']I think this would work for calculating the turn rate from two turn angles angle1 and angle2 measured at two different times t1 and t2: function getTurnRate(t1, angle1, t2, angle2) local delta_t = t2 - t1 local delta_angle = angle2 - angle1 if delta_angle < -180 then delta_angle = delta_angle + 360 end if delta_angle > 180 then delta_angle = delta_angle - 360 end return delta_angle / delta_t end Thanks Jan. I will give that a try. __________________________________________________Win 10 64bit | i7 7700k delid @ 5.1gHz | 32Gb 3466mhz TridentZ memory | Asus ROG Apex motherboard | Asus ROG Strix 1080Ti overclocked Komodosim Cyclic | C-tek anti torque pedals and collective | Warthog stick and throttle | Oculus Rift CV1 | KW-908 Jetseat | Buttkicker with Simshaker for Aviators RiftFlyer VR G-Seat project: http://forums.eagle.ru/showthread.php?p=2733051#post2733051
bnyhwkr Posted May 30, 2016 Posted May 30, 2016 capt zeen i was wondering if the helios A-10C single monitor will still work with the 1.5 and 2.0 i cant seem to get it to work properly could you explain if you are able too i would appreciate it. thank you
Recommended Posts