Jump to content

Getting trigger.action.radioTransmissio to work


Recommended Posts

Posted

Anyone getting the function trigger.action.radioTransmission to work? It is not exactly rocket science, but I just don't get it.

 

Here is my code, the sound file is packed into the .miz file:

 

local PilotVec3 = Unit.getByName("Pilot"):getPoint()
trigger.action.radioTransmission("BeaconNear.wav", PilotVec3, 1, true, 61000, 1000) 

 

I get no result in the Huey. If I set up the transmission as a trigger in the ME, it works though. Unfortunately a trigger is no option for me at the moment, as the position of the transmission needs to be randomizable.

  • 2 weeks later...
Posted (edited)
Anyone getting the function trigger.action.radioTransmission to work? It is not exactly rocket science, but I just don't get it.

 

Here is my code, the sound file is packed into the .miz file:

 

local PilotVec3 = Unit.getByName("Pilot"):getPoint()
trigger.action.radioTransmission("BeaconNear.wav", PilotVec3, 1, true, 61000, 1000) 

 

I get no result in the Huey. If I set up the transmission as a trigger in the ME, it works though. Unfortunately a trigger is no option for me at the moment, as the position of the transmission needs to be randomizable.

 

Good news is, I figured out why you can't get it to work. You must use a NINE digit radio freq, such as 124000000. Just like they are in the UHF, VHF_AM, and VHF_FM "settings.lua" files.

 

Bad news is, using trigger.action.radioTransmission, you will only hear audio the first 3 times you use it in a mission. After that, no sound. I've tried numerous combinations of how it's triggered, time between etc, but every .miz has the same "three-times-and-done" issue.

 

If anyone is able to get more than 3 radio messages to work, let me know. (edit: not "looping" but repetitive single transmissions, like radio calls)

Edited by Joyride
Posted

Awesome, thanks so much!

 

I can't believe how I could miss that, it even says in the wiki to use Hz. And I even remember playing around with different magnitudes :)

 

I didn't yet test it with multiple different radio transmissions, but it works fine with repeating the same command multiple times (running the command repeatedly so clients joining late will also hear it).

Posted

I didn't yet test it with multiple different radio transmissions, but it works fine with repeating the same command multiple times (running the command repeatedly so clients joining late will also hear it).

 

You are talking about "looping" right? ie: loop boolean = true? Didn't try that, but let me know if you can get a single transmission to work more than 3 times (being triggered each time, not looping).

Posted

Also, I noticed it only worked if loading the audio file via a "dummy" trigger vs. just dropping the .wav or .ogg into the .miz file manually.

Posted
No I actually meant running the script every 10 seconds, which works on my end.

 

Can you share the file? Would love to see what's different if that works. So it's not the script you used above...?

trigger.action.radioTransmission("BeaconNear.wav", PilotVec3, 1, true, 61000, 1000)

Posted

Here is the test mission which I threw together yesterday in a couple of seconds. The above code is repeated by a recurring trigger.

 

I also dropped in the wav file manually. In order for that to work, I noticed that the mission file cannot be open in the editor at the same time.

  • 2 months later...
Posted (edited)

Any resolution on this? Having the same issue, 3 and done? I have a few side missions going on and wanted the other flights to be able to hear the transmissions via UHF of the other action going on. No matter what I do, I cannot get more than 3 single transmission to play on a given FREQ.

Edited by Ranger79
  • 2 months later...
  • 1 month later...
Posted

Ranger, sorry I missed this a few months ago. Been back in the saddle a bit working on some new miz stuff, and yes this was reported as a bug a while back - but unfortunately no progress that I can speak of.

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...