Sérvalpilot Posted January 24, 2024 Posted January 24, 2024 (edited) I'm trying to set up a custom radio and I've run into a problem. First, declaring the radio/intercom devices in lua alone doesn't work. Using avSimplestRadio is how to make it work, but honestly I think this could be streamlined. Anyway, now I get subtitles but not the audio. Is there something I'm missing? Edited March 30, 2024 by Sérvalpilot Title changed to more accurately convey the situation.
freebirddz Posted January 28, 2024 Posted January 28, 2024 On 1/24/2024 at 7:45 PM, Sérvalpilot said: I'm trying to set up a custom radio and I've run into a problem. First, declaring the radio/intercom devices in lua alone doesn't work. Using avSimplestRadio is how to make it work, but honestly I think this could be streamlined. Anyway, now I get subtitles but not the audio. Is there something I'm missing? Custom Radio is, CPP/LUA combination, you can check A4 code for the whole self implementation. avSimplestRadio is A-29B, to use from LUA only also need to and DLL load in Entry.lua since he don't implement EFM right now.
Sérvalpilot Posted January 28, 2024 Author Posted January 28, 2024 9 hours ago, freebirddz said: Custom Radio is, CPP/LUA combination, you can check A4 code for the whole self implementation. Thanks. I took a peek at the radio section of the A-4 source code before and I got scared by the assembly and dll linking stuff. It's a shame it has to be so tricky.
freebirddz Posted January 29, 2024 Posted January 29, 2024 12 hours ago, Sérvalpilot said: Thanks. I took a peek at the radio section of the A-4 source code before and I got scared by the assembly and dll linking stuff. It's a shame it has to be so tricky. don't look at ASM, just keep eyes on CPP
Jack McCoy Posted February 18, 2024 Posted February 18, 2024 I put my flyable aircraft mod (EFM) on hold for almost a year now because I can't make the radio work. I think the only missing step is to turn the radio ON which apparently is not exposed to lua scripts. I want to scream! i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
freebirddz Posted March 26, 2024 Posted March 26, 2024 On 2/18/2024 at 11:48 PM, Jack McCoy said: I put my flyable aircraft mod (EFM) on hold for almost a year now because I can't make the radio work. I think the only missing step is to turn the radio ON which apparently is not exposed to lua scripts. I want to scream! you right, there is 2 part to make it work, C++ and LUA, the better example is A4E community MOD, you have both opensource, still simple implementation and do have some problem with IA communications, but at lease you can call ATC or Tanker
Sérvalpilot Posted March 28, 2024 Author Posted March 28, 2024 Figuring this out is quite a nightmare. If I ever get it working, I'll be sure to share my knowledge about it. Seriously, something like this should be easy to set up! 1
Sérvalpilot Posted March 30, 2024 Author Posted March 30, 2024 I made a bit more progress on the code front, I managed to get to a point where DCS crashes consistently with the same error code. For the record, according to the A-4 source code, the steps to setting it up are: Get wire from Electrical System Connect wire to radio Get communicator and then set it as current. Get a pointer to the virtual function pointer table for the inherited radio. Use this pointer to find the setElecPower function. I managed to pinpoint where it crashes. The problem is connecting the wire. Here are a couple lines from the crash log: EDCORE (Main): # C0000005 ACCESS_VIOLATION at 00007ffa9fa81ce0 00:00000000 EDCORE (Main): 0x00000000002c1ce0 (CockpitBase): cockpit::avVHF_SCR_522A::connect_electric + 0x0 I know this might be like sending a message in a bottle, but does anyone have any ideas on getting this to work? 1
Sérvalpilot Posted March 31, 2024 Author Posted March 31, 2024 I finally got it working! The last post error was me messing up things on the Lua side. I can't communicate with ground crew, however. Now I'm just cleaning things up and documenting, I might make a guide or implement it in my Basic FM project. 2
Jack McCoy Posted April 19, 2024 Posted April 19, 2024 On 3/31/2024 at 11:11 AM, Sérvalpilot said: I finally got it working! The last post error was me messing up things on the Lua side. I can't communicate with ground crew, however. Now I'm just cleaning things up and documenting, I might make a guide or implement it in my Basic FM project. Congrats! To communicate with the ground crew, I think the canopy needs to be open (and recognized as such by DCS) OR you need to set up an intercom device. From what I've seen, radios and intercom are related as "linked devices" which, to me, is yet another layer deeper in the black box... Bonne chance! i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
Sérvalpilot Posted April 25, 2024 Author Posted April 25, 2024 On 4/19/2024 at 5:13 AM, Jack McCoy said: To communicate with the ground crew, I think the canopy needs to be open (and recognized as such by DCS) OR you need to set up an intercom device. You're right. The canopy needs to be open to communicate with the ground crew. I like to imagine you literally shout at the ground crew if the engines are on! I'll try to figure out the intercom stuff.
Laz109G10 Posted January 16 Posted January 16 Can you share your lua script? I was trying the same thing for a custom mod. Trying to get the radio to work. At least to contact ATC.
Recommended Posts