Jump to content

Recommended Posts

Posted

Hi,

I have a few LUA sound questions which I haven;t found the answers to, maybe somoen can shed some light?

 

for 'outSoundForGroup' to work I understand the audio file needs to be included in the .miz file, how do you go about including audio in a miz file? and also then I can only use he script in that .miz (or copies of it)?

 

Also is there a way to play sound for a unit rather than group?

 

and finally any way to control the volume?

 

thanks!

Posted

The easiest way to include a sound file is to just make a trigger that uses it. For example...

Mission Start>Time more than x> Sound to All('whatever').

 

This way the sound file is "attached" to the mission via triggers and won't even be played by the trigger due to the condition being impossible to occur.

 

 

No sound or message to unit currently. Though there is a feature request for it to be added.

 

Can't control the volume directly. I think one of the sound options in game has overall control of the volume but I'm not sure which one. It is mostly up you to make a audio file with an appropriate volume level.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Hi Tic-Tac,

 

I'm not sure this helps at all but it's another avenue to explore......I have used the ATME core script and within that i made a module that included sounds played to a specific player that would only be heard by them. I could of course have made it play to all if i had wanted to.

 

It is activated via the F10 menu when a player declares a mayday:

 

-- Function for F10 menu "Spawn Crash Rescue Team"
local F10SpawnCommand
F10SpawnCommand = function(args)      
   local player = args[1]

-- ATME.C_Group.getByName :
   -- Return ATME.C_Group instance with name "origin", or  
-- nil if doesn't exist when that function is called

   local group = ATME.C_Group.getByName("Batumi Crash Rescue")
   player:soundOnce('mayday.ogg')
ATME.displayForAll(" ... " .. player:getPseudo() .."...I have a MAYDAY Call the Crash Fire Rescue just in case " .. ATME.getTheatre() .. " ....... " , 20)

 

The complete script can be found here if you want to dissect and test its feasibility for your needs: https://forums.eagle.ru/showthread.php?t=181503. It also works perfectly well in multiplayer and plays nicely alongside MIST and CTLD scripting.

 

I hope this helps.

Callsign: NAKED

My YouTube Channel

 

[sIGPIC][/sIGPIC]

Posted

Thank you both for the info on ATME, certainly something I will take a look at.

 

Does anyone know if I am correct in my assumption that outSoundForGroup will only play one .wav file at a time? any way to overlap slightly to get a smooth looping effect?

Posted

Correct only one sound can be played at a time. If new sound starts to play it will stop the one that was playing previously. If you are using scripting you can time when audio files play more precisely. If you are using just triggers a 1 second interval is the closest you can get.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted (edited)

Hi,

 

@Tic-tac : Does anyone know if I am correct in my assumption that outSoundForGroup will only play one .wav file at a time? any way to overlap slightly to get a smooth looping effect?

 

 

As Grimes said, yes, you can only play one sound file with DCS lua functions. But in my experience, I never success playing .wav sound files. No problem with .ogg files.

 

So basicaly, you have to manage your play list with DCS lua functions.

 

ATME may help you to play a list of sound files but you have to know and set a duration. Actually, no event is sent by DCS at the end of play. If you change a playlist while ATME use it, then you can do smooth change or immediate change. For a smooth change, that will be done at the end of the current sound file. The basic time is 1second

 

For example, see and hear (of course) the begin of the ATM global presentation video

. The sound is the original one in the mission.

 

 

Sunski

Edited by sunski34
  • Recently Browsing   0 members

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