R.MES Posted January 22, 2022 Posted January 22, 2022 What is the properly way to add a sound file in a miz file to call it in a script with "trigger.action.outSound" ? The doc says : "The sound file must be placed inside of the miz file in order to be played." But when I do that (in the root folder or in the "l10n\DEFAULT\" folder), the sound file is systematically removed by the mission editor each time it save the mission.
toutenglisse Posted January 22, 2022 Posted January 22, 2022 1 hour ago, R.MES said: ...the sound file is systematically removed by the mission editor each time it save the mission. Yes files are removed except if used in mission editor. Create a hypothetical trigger (ex: flag 777 value 1618) with all your sound files listed in actions (ex: sound to all). Long to create, I don't know other way. BTW the created trigger can then be ported to other map/mission (copy/paste the code from mission.lua).
R.MES Posted January 22, 2022 Author Posted January 22, 2022 You're right. It's a good solution to create an action that never happens. Surely the best way. Waiting for an answer, I did some tests. I manually added an entry in the mapResource file (["ResKey_Action_150"] = "Bip.ogg" for instance) and it works also but it's a bit labored ... So I will follow your advice. Thanks !
TEMPEST.114 Posted January 22, 2023 Posted January 22, 2023 I find that for images and sounds that aren't specified by a trigger action in the ME as part of the mission per se, what i do is create a single trigger with no condition that plays the sound or shows the image to an AI unit. This loads it into the mapresource / mission / dictionary stuff properly but the players never see / hear it until you want them to with your script. there really should be a 'load resource' trigger action but this will suffice...
Sedlo Posted January 22, 2023 Posted January 22, 2023 You can create a separate folder within the miz file and refer to that location that in your scripts. Allows for bulk additions of sounds, images, etc via Windows drag/drop cut/paste My Youtube Channel MY DCS MISSIONS
Chump Posted January 22, 2023 Posted January 22, 2023 10 hours ago, Elphaba said: I find that for images and sounds that aren't specified by a trigger action in the ME as part of the mission per se, what i do is create a single trigger with no condition that plays the sound or shows the image to an AI unit. This loads it into the mapresource / mission / dictionary stuff properly but the players never see / hear it until you want them to with your script. there really should be a 'load resource' trigger action but this will suffice... To keep sounds from unwanted playing during map load (used to be a MP problem), I use a ONCE trigger, with a LUA PREDICATE condition with "return false" and SOUND TO ALL. Agreed that there should be a built-in way to accomplish this.
Recommended Posts