kitten40 Posted May 18, 2024 Posted May 18, 2024 Hi all. Just wondering if it's at all possible to set the Huey ADF to a specific frequency with some sort of script. I've looked at Mist and Moose but I don't see anything that readily jumps out at me, but I could have missed it. Is it even possible? Thanks for any insight you can give. Ryzen 7 5800X3D, MSI B450 Tomahawk Max, 64GB DDR4, EVGA RTX 3080Ti FTW3, (Was Reverb G2 / Now Quest 3) Fixed Wing: F18, FW190A&D, M2000, MiG21, Mosquito, P47, P51, Spitfire, Yak52, A10CII, Viggen, BF109, C.EagleII, F14, F16, F4E, F5E, FC3/4 Rotor: KA50III, Mi24, Mi8, OH58, Gazelle, UH1H Huey, Apache, CH47 Maps/Misc :Supercarrier, Combined Arms, WWII Asset Pack, Afghanistan, Caucasus, South Atlantic, Iraq, Kola, Marianas, Nevada, Persian Gulf, Sinai, Syria, The Channel
Tippis Posted May 18, 2024 Posted May 18, 2024 (edited) As in, adjusting the plane's cockpit settings on the fly? No, it's only barely possible to read those kinds of settings, and even then, only for “Player” units where they're exposed (so no “Client” in a multi-aircraft or MP setting). I think the Huey might be a bit too new, but some of the properly ancient modules support the “Prepare mission” functionality where you can set up a plane and then have all those settings saved in a file that gets included in the mission. But that's obviously a static once-at-mission-start kind of thing, even if/when it works. You might be able to circumvent it a bit with various SET COMMAND actions, and I don't think there's a scripting equivalent to that, but it is also quite limited in what it can do and how well it can be controlled. See here for some further breadcrumbs: Edited May 18, 2024 by Tippis ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
TEMPEST.114 Posted May 18, 2024 Posted May 18, 2024 (edited) Actually @kitten40 if the CLIENT is also the HOST, then it WILL work on a MP server. For clarity, when I say the client is also the host, I mean, you don't have to have any aircraft set as player, they can all be client, but if the player who is hosting the mission on their PC uses a CLIENT skilled aircraft, then yes, these commands WILL work. I thought that was obvious, but from what I've been told, it wasn't. So, yes it is possible. You just have to find the magic X number. Unfortunately it's either trial and error as they are never revealed OR you can search the forums for someone who has already found it and shared it. I think @Rudel_chw has played with this sort of stuff. If you search the forums, I think you'll find a post from the 8th of May, 2015 with a PDF of all the Huey X commands, including the ADF freq setting. ETA: It's been pointed out that you specifically asked for a scripting solution, rather than the simpler M.E. solution - which I provided because it was quicker and doesn't require scripting. It was also pointed out that I was wrong, claiming that it's possible via scripting. It is possible. However, if you do want to do this in scripting you have to use an unpublished command 'a_cockpit_perform_clickable_action' via the net.dostring_in function. E.G. net.dostring_in('mission', "_G.a_cockpit_perform_clickable_action(<PARAMS>) Where <PARAMS> is replaced by the settings and structure you'd find from reading the mission file in the .miz file with the X clickable cockpit command setup. (The command ID number, the number of the control and finally the value you want to set it to). Here's an example mission showing the scripting control of the X commands working: scriptingXCommands.miz Edited May 20, 2024 by TEMPEST.114 Clarity and fixing command / uploading mission file
Tippis Posted May 18, 2024 Posted May 18, 2024 (edited) 2 hours ago, TEMPEST.114 said: And the previous commenter was utterly incorrect. What is the scripting equivalent to SET COMMAND? As for the commands and devices themselves, as the manual states: Quote The conditions and actions of the triggers use the command numbers, which can be found in the corresponding Scripts folder of each aircraft along the path DCS\Mods\aircraft\AircraftName\Cockpit\Scripts: \Mods\aircraft\Aircraft Name\Cockpit\Scripts\command_defs.lua – command numbers; \Mods\aircraft\Aircraft Name\Cockpit\Scripts\clickabledata.lua – button command numbers; \Mods\aircraft\Aircraft Name\Cockpit\Scripts\devices.lua – device ID numbers in the cockpit. It's a bit “red string on a cork board” to connect the definitions with each other, but it's all there if you want to read and write via the X trigger commands. Edited May 18, 2024 by Tippis ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
kitten40 Posted May 18, 2024 Author Posted May 18, 2024 Thanks for the input guys. Yes I was trying a whole lot of trial and error and getting hugely frustrated which is why I thought scripting it might be easier. @TEMPEST.114 I did find the post you referenced, thanks a ton for that ! I'll still probably have to test and retest and test some more, but this will be a great base to start with. If I can manage to do what I would like to do (client lands in specified zone, adf frequency automatically switches to next beacon), I will gladly post back my solution. (I'm trying to help a "new-to-flight" friend learn the basics of navigation by instrument, without him needing to fiddle with the radios just yet) Thanks again to you both ! Ryzen 7 5800X3D, MSI B450 Tomahawk Max, 64GB DDR4, EVGA RTX 3080Ti FTW3, (Was Reverb G2 / Now Quest 3) Fixed Wing: F18, FW190A&D, M2000, MiG21, Mosquito, P47, P51, Spitfire, Yak52, A10CII, Viggen, BF109, C.EagleII, F14, F16, F4E, F5E, FC3/4 Rotor: KA50III, Mi24, Mi8, OH58, Gazelle, UH1H Huey, Apache, CH47 Maps/Misc :Supercarrier, Combined Arms, WWII Asset Pack, Afghanistan, Caucasus, South Atlantic, Iraq, Kola, Marianas, Nevada, Persian Gulf, Sinai, Syria, The Channel
TEMPEST.114 Posted May 18, 2024 Posted May 18, 2024 1 hour ago, kitten40 said: Thanks for the input guys. Yes I was trying a whole lot of trial and error and getting hugely frustrated which is why I thought scripting it might be easier. @TEMPEST.114 I did find the post you referenced, thanks a ton for that ! I'll still probably have to test and retest and test some more, but this will be a great base to start with. If I can manage to do what I would like to do (client lands in specified zone, adf frequency automatically switches to next beacon), I will gladly post back my solution. (I'm trying to help a "new-to-flight" friend learn the basics of navigation by instrument, without him needing to fiddle with the radios just yet) Thanks again to you both ! Glad you got what you needed. Sometimes the search on this site isn't great, it helps to go to google and do a site search from there. The ADF is probably the easiest radio to tune, so it might be a better idea to use this as a teachable moment to 'introduce' radios at the same time.
kitten40 Posted May 19, 2024 Author Posted May 19, 2024 12 hours ago, TEMPEST.114 said: The ADF is probably the easiest radio to tune, so it might be a better idea to use this as a teachable moment to 'introduce' radios at the same time. Couldn't agree more . And as he'll be on the ground in that scenario when tuning the radio, he won't have to worry about controlling the bird at the same time. I couldn't figure out a way to automatically tune to different bands, so I've worked around it by keeping the adf on default freq, using multiple beacons with the same freq, and just turning them on and off as needed. I'll just split the scenarios in two, and use the second part to have him do the tuning. 1 Ryzen 7 5800X3D, MSI B450 Tomahawk Max, 64GB DDR4, EVGA RTX 3080Ti FTW3, (Was Reverb G2 / Now Quest 3) Fixed Wing: F18, FW190A&D, M2000, MiG21, Mosquito, P47, P51, Spitfire, Yak52, A10CII, Viggen, BF109, C.EagleII, F14, F16, F4E, F5E, FC3/4 Rotor: KA50III, Mi24, Mi8, OH58, Gazelle, UH1H Huey, Apache, CH47 Maps/Misc :Supercarrier, Combined Arms, WWII Asset Pack, Afghanistan, Caucasus, South Atlantic, Iraq, Kola, Marianas, Nevada, Persian Gulf, Sinai, Syria, The Channel
TEMPEST.114 Posted May 20, 2024 Posted May 20, 2024 (edited) On 5/19/2024 at 10:36 AM, kitten40 said: Couldn't agree more . And as he'll be on the ground in that scenario when tuning the radio, he won't have to worry about controlling the bird at the same time. I couldn't figure out a way to automatically tune to different bands, so I've worked around it by keeping the adf on default freq, using multiple beacons with the same freq, and just turning them on and off as needed. I'll just split the scenarios in two, and use the second part to have him do the tuning. Uploaded an example mission file of the Huey with toggling the pitot heat on off - 1st via X commands in M.E. and then by scripting as described in my edited post above. I don't expect people to suddenly apologise for telling me I was wrong or for them saying it's not possible, but I've just proven it is. Edited May 20, 2024 by TEMPEST.114
kitten40 Posted May 20, 2024 Author Posted May 20, 2024 I will absolutely take a look at that. Thank you again Ryzen 7 5800X3D, MSI B450 Tomahawk Max, 64GB DDR4, EVGA RTX 3080Ti FTW3, (Was Reverb G2 / Now Quest 3) Fixed Wing: F18, FW190A&D, M2000, MiG21, Mosquito, P47, P51, Spitfire, Yak52, A10CII, Viggen, BF109, C.EagleII, F14, F16, F4E, F5E, FC3/4 Rotor: KA50III, Mi24, Mi8, OH58, Gazelle, UH1H Huey, Apache, CH47 Maps/Misc :Supercarrier, Combined Arms, WWII Asset Pack, Afghanistan, Caucasus, South Atlantic, Iraq, Kola, Marianas, Nevada, Persian Gulf, Sinai, Syria, The Channel
Tippis Posted May 20, 2024 Posted May 20, 2024 3 hours ago, TEMPEST.114 said: I don't expect people to suddenly apologise for telling me I was wrong Why would anyone apologise for something that never happened? ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
Solution TEMPEST.114 Posted May 21, 2024 Solution Posted May 21, 2024 (edited) 20 hours ago, kitten40 said: I will absolutely take a look at that. Thank you again Okay, I've written a little script that goes through all the numbers and options to determine what the correct values are; the PDF is partially correct, but as with everything, ED have changed some stuff. The ID for the ADF is now 27 and the setting of the frequency knob is now: Code 3002, Value 1 = ADF Freq Range knob to 850/1750 Code 3002, Value 0 = ADF Freq Range knob to 400/850 Code 3002, Value -1 = ADF Freq Range knob to 190/400 HOWEVER, that's where the sanity ends. The rotation of the TUNE knob is in 0.03f increments, if you try and increment it by a set amount i.e. 0.03 x 50 to get a specific frequency - it doesn't work. It's literally just a tiny turn of the knob = an increase/decrease of the current value by 0.03f. The value has a lower limit of 0.1f but no fixed upper limit, it will just get to the end at some number of 0.03f increments, depending on how 'fast' they are inputted. (FACEPALM). So there is no 'value' that directly correlates to a specific frequency, regardless of the range knob's position. They haven't even coded it that the value range is a linear scale so depending on the freq range knobs position and the difference between it's upper and lower frequency numbers, then 30 inputs of 0.03 is a different delta-value of frequency from one range band to another. It's just insane. However, if you really want to interpolate for each of the range knob positions with its corresponding different value ranges for the tuning knob then it's all possible. Just a huge PITA. I've managed to get it to set the xponder codes quickly and easily and other radios and switches from script... but the TUNE / Freq / GAIN knobs are a PITA and there is no way to know what your starting point is so that you know (from testing/counting) that n number of 0.03f steps gets you to the right frequency, because you can't 'GET' a number from the back end that means anything. You could however, run a large number of decrements first to get it to the lowest setting and then count your specific number of increments but this will have to be based on trial and error. So it is possible from scripting, but it's not trivial and you will need trial and error calculations for every frequency you want. Edited May 21, 2024 by TEMPEST.114
kitten40 Posted May 21, 2024 Author Posted May 21, 2024 Thanks for all you time and hard work @TEMPEST.114. At least I know I wasn't pulling my hair out for lack of seeing the obvious. Yes, it's definitely been a pain trying to figure this out and moving forward, I'll continue to use the workaround (of using the default freq) and in the meantime hopefully it will be easier to just teach him the radio systems and be done with it . Although from current experience, that too will be a chore . Thank you again ! 1 Ryzen 7 5800X3D, MSI B450 Tomahawk Max, 64GB DDR4, EVGA RTX 3080Ti FTW3, (Was Reverb G2 / Now Quest 3) Fixed Wing: F18, FW190A&D, M2000, MiG21, Mosquito, P47, P51, Spitfire, Yak52, A10CII, Viggen, BF109, C.EagleII, F14, F16, F4E, F5E, FC3/4 Rotor: KA50III, Mi24, Mi8, OH58, Gazelle, UH1H Huey, Apache, CH47 Maps/Misc :Supercarrier, Combined Arms, WWII Asset Pack, Afghanistan, Caucasus, South Atlantic, Iraq, Kola, Marianas, Nevada, Persian Gulf, Sinai, Syria, The Channel
TEMPEST.114 Posted May 21, 2024 Posted May 21, 2024 29 minutes ago, kitten40 said: Thanks for all you time and hard work @TEMPEST.114. At least I know I wasn't pulling my hair out for lack of seeing the obvious. Yes, it's definitely been a pain trying to figure this out and moving forward, I'll continue to use the workaround (of using the default freq) and in the meantime hopefully it will be easier to just teach him the radio systems and be done with it . Although from current experience, that too will be a chore . Thank you again ! You’re most welcome; it was an entertaining if frustrating afternoon.
Recommended Posts