Jump to content

Recommended Posts

Posted

I recently wanted to add a sound feature to my scripts. It isnt too hard to do, since there is a function for that available. However, this function takes as argument the name of the sound file in the .miz.

 

How do i include a file into the miz?

 

If i play it once using a trigger (actually, i dont even have to use the trigger, it just have to be there) but this solution doesnt seem like it should be? Isnt there a better way to include a file into the mission file?

[sIGPIC][/sIGPIC]

Posted

.miz files are basically a zip file. Try opening it up with 7zip or winrar. Simply add the sound file in that way, or associate the sound file with a trigger and use the mission editor to add the sound.

 

Sadly we can't play sound files from the DCS sounds directory... I really wish we could, but we can't.

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
.miz files are basically a zip file. Try opening it up with 7zip or winrar. Simply add the sound file in that way, or associate the sound file with a trigger and use the mission editor to add the sound.

 

Sadly we can't play sound files from the DCS sounds directory... I really wish we could, but we can't.

 

Wouldnt DCS remove the file again once i save the mission after i have added the file to the miz using a zip program?

[sIGPIC][/sIGPIC]

Posted (edited)

If you edit and save the zip and then subsequently open and save the miz in the ME then your files won't be included I don't think unless the Dev has changed this recently.

 

A solution is to:

 

Just place any trigger along the lines of

 

ONCE -> FLAG IS TRUE 1 -> SOUND TO ALL filename1, SOUND TO ALL fielname2 etc

 

..and obviously remember to never set flag 1 to true. All of the sound files will then automatically be included in your mission and accessable by your lua scripts.

Edited by Druid_

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Posted
Just place any trigger along the lines of

 

ONCE -> FLAG IS TRUE 1 -> SOUND TO ALL filename1, SOUND TO ALL fielname2 etc

 

..and obviously remember to never set flag 1 to true. All of the sound files will then automatically be included in your mission and accessable by your lua scripts.

 

Actually, to use less CPU cycles and make it easier for me i could do it that way:

MISSION START -> FLAG IS TRUE 1 AND FLAG IS FALSE 1 -> SOUND TO ALL ...

 

This way i dont have to remember anything and the condition is only checked once.

[sIGPIC][/sIGPIC]

Posted

that'll work

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

  • 1 year later...
Posted

Sorry for the thread resurrection, but I had the same problem and was about to create a new thread when I found this one.

 

I'm sure when I started fiddling with playing sounds via Lua some two weeks ago, when I used WinRar to inject sound files into the mission, the sound files were gone after I saved the mission in the ME. I had to use some kind of dummy trigger to reliably include the sounds into the mission.

 

Now I tried to reproduce the problem but everything went fine. This time, I made sure the mission was NOT open in the ME when I injected the sound files, so maybe that's all there is to it.

  • Recently Browsing   0 members

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