Talk:PlaySound

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Dragoon Wraith TALK 21:59, 28 July 2006 (EDT): OK, I want to play a sound so long as X is true, how do I set that up? How long does a sound play for? Is there anyway to stop it?

As long as you've set up your sound to loop, it will play indefinitely. There's no stopSound function like Morrowind had, which is annoying. However, displaying a message or messageBox will stop the sound. So will starting a new sound. If you create a silent wav file, you can call playSound <silentSoundID> to stop the currently playing sound. Scruggs 22:18, 28 July 2006 (EDT)
Dragoon Wraith TALK 01:29, 29 July 2006 (EDT): Ah, good call! Thanks as always, scruggs!
At the moment I have it set to not loop, and I just call it every 3 seconds (the file is 3 seconds long) while it's supposed to be playing. I noticed it wasn't very consistent - is there any reason why this might not work as intended?
I came up with a script that is supposed to start another sound and stop the old one. Unfortunately, this was not too useful as when I called for another sound to play, the new one played AS well as the old one, and neither stops playing. :/ Not even when I left the worldspace, the sounds just kept playing... :( The Imperial Dragon 17:44, 29 January 2007 (EST)
You may want to try PlaySound3D. PlaySound is non-directional, so it doesn't matter where the calling object is in relation to the player. Scruggs 20:11, 29 January 2007 (EST)
Found a new way to implement this: If you use a Sound on an object Form (any Form that has Sound data in its properties) and set the 2D bit on whatever Sound Form you used (check the box next to "2D" in the Sound Form properites), when you Enable or Disable the object Form the Sound will Enable or Disable with it. To make this invisible to the Player, just use a Form with no model specified.--The Munchkin Lord 23:17, 25 February 2007 (EST)

I do not think you need to make a new form with a null nif (invisible). You only need to place the sound form in the game (via the CS drag and drop or placeatme in game) and then disable and enable it via scripting. It will look like a big read speaker in the render window but will be invisible in the game.However it would be REALLY NICE to be able to stop sounds or change the values/volume of the sounds on the fly once called by the script playsound command.User:SpookyFX