Jump to content

Problem with transmitMessage (or maybe LUA in general)


Recommended Posts

Posted

Hello everybody,

 

I've just started looking into lua scripting for communications management, mostly as an experiment. I decided to start with something apparently easy as having an AI aircraft transmit a radio message via lua script. After a couple of hours, still no joy!!

 

So, this is how I set it up:

 

I loaded the audio file using a sound to country trigger (and i made sure that the file is actually inside the DEFAULT folder);

I set the player on the ramp on an F-86 (engine started and radio on 225 MHz AM);

I set the AI aircraft in-flight nearby and made sure that he's on the same freq;

I fired the script with a simple time more trigger;

 

And...nothing!

 

I also tried the same with different aircrafts... still nothing.

 

Here's the script I wrote:

 

function radio_test(unit)
   local radio_message = {
         id = 'TransmitMessage', 
         params = {
         duration = 20,
         subtitle = "alpha check to home plate",
         loop = false,
         file = "alpha check to home plate.wav",
           } 
         }
   unit:getController():setCommand(radio_message)
end  

do
radio_test(Unit.getByName("a01"))  
end

 

And I'm attaching the miz files.

 

Anybody could please tell me why it isn't working?

 

Thanks.

Radio Test - Caucasus.miz

Radio Test - NTTR.miz

Posted

Hi,

 

first, you need to add the path in sound file name :

"l10n/DEFAULT/" .. your_file_name

 

I only use .ogg sound files.... I think there's some pb with .wav files.

 

Hope that help.

 

If you want to use ATME script, a new version will come soon with advance sound management.

 

Sunski

  • Recently Browsing   0 members

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