Jump to content

Recommended Posts

Posted (edited)

can anyone tell me why this script doesn't play the sound?

 

-- ding.lua

trigger.action.outText("ding", 2)
trigger.action.outSound('ding.wav')

 

i know its running because is see the text 'ding'

 

it works just fine if i use SOUND_TO_ALL but doesn't work from a script for some reason.

 

i've included the files, i place ding.wav (inside the zip) in Sounds and the lua in Scripts,

 

thx steve

 

BTW, i just tried it with a .ogg file and same result

ding.lua

soundtest.miz

Screen_160111_094949.thumb.jpg.8fe1988e0c38db6519d4611d82a0933d.jpg

Screen_160111_094815.thumb.jpg.e9dd851c4f8501309edd907de4eaa476.jpg

ding.zip

Edited by steve2112

My kit: i7-4790K@4GHz / 8GB - GTX 980ti + rift CV1 - X52 pro - Multi Keyboard Remapper - 2DOF motion sim (in development)

Posted (edited)
What if you place the sound file in scripts also?

 

no, nothing.

 

i check the log file too, no sign of a problem there.

 

is it just me maybe or does anyone else see this problem?

 

thx

Edited by steve2112

My kit: i7-4790K@4GHz / 8GB - GTX 980ti + rift CV1 - X52 pro - Multi Keyboard Remapper - 2DOF motion sim (in development)

Posted

The safest way is to have a trigger setup to play the sound that never actually triggers so the file will be guaranteed to be saved in the miz. Otherwise files that are added to the mission that have no reference will be removed. For example Mission Start> Time More> Play Sound. From there any script set to play the sound file should work. Although you might need add 'l10n/DEFAULT/' as that is the actual file path within the miz for where teh file is located.

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
The safest way is to have a trigger setup to play the sound that never actually triggers so the file will be guaranteed to be saved in the miz. Otherwise files that are added to the mission that have no reference will be removed. For example Mission Start> Time More> Play Sound. From there any script set to play the sound file should work. Although you might need add 'l10n/DEFAULT/' as that is the actual file path within the miz for where teh file is located.

 

thanks for the tip, i thought it was something like that because i have noticed that sounds that used to be in the trigger, when i move them to a script, sometimes they play, but ones that have never been in a trigger, they never play

My kit: i7-4790K@4GHz / 8GB - GTX 980ti + rift CV1 - X52 pro - Multi Keyboard Remapper - 2DOF motion sim (in development)

  • Recently Browsing   0 members

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