Jump to content

Recommended Posts

Posted

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.

 

Posted
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).

Posted

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 !

 

  • 11 months later...
Posted

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...

Posted
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.

  • Recently Browsing   0 members

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