Jump to content

Add a sound file to be used by trigger.action.outSound


Recommended Posts

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.

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 !

 

Link to comment
Share on other sites

  • 11 months later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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