Customcraft: Music and Sound Effects

Welcome to Customcraft!  For you newcomers, this is a column dedicated to item creation tips with the WoW RP add-on, Gryphonheart Items—or GHI for short.  I’ve been noticing a couple search terms have been hitting the blog as of late, so… no better time than the present to illustrate on how to add sounds effects and/or music to your items.

Basically, there are two ways to achieve this.

A: We use the ‘Sound’ right-click effect when creating an item.

B: We add it into a script.

Both methods are incredibly easy to do, so the choice is yours on what route you want to take.   Unless you’re working hardcore with LUA coding, then the Sound right-click function will get you through with what you want it to do.

Adding Sound via Right-Click Actions

The interface is pretty self-explanatory.  Just add in the sound filepath, and a delay—which is actually optional if you don’t want to.  (Delays are useful if you don’t want the sound to go off right away.)  The hardest part is actually tracking down the sound file that you want!  There are a few compilations out there that have a listing of -all- the sound files in the game thus far.

http://www.pilus.info/files/WoWsoundfiles.txt

http://www.pilus.info/files/wotlk_sounds.txt

Just find what you need, and then just copy and paste into the box.  Voila!

Adding Sound Effects via Scripts

The script for this is pretty simple.

PlaySoundFile(“SoundFilePathGoesHere.wav”)

That’s it!  I’m not pulling your leg here.  It just goes to show that some of the most simplest of things can make a huge difference, doesn’t it?

That’s all for this edition of Customcraft!  Now get out there and create!

About these ads

~ by compassstudies on October 28, 2009.

3 Responses to “Customcraft: Music and Sound Effects”

  1. Is it possible to add custom sound files? If yes, how is that done? And how do i make the sound fade? I have to be honest, i know absolutly nothing about scripting and stuff, i just need to know what to click and add where.

    • To answer your first question, you cannot add custom sound files through the above means. (Since transferring that sort of data is impossible over the WoW client.) This means you cannot add customized music and expect your script to work with any Joe-shmoe on the street using GHI.
      HOWEVER! There is a way to insert custom sounds through script. But, I recommend that this method is used only with an item that only you would use, or between a small group of friends (or people that trust you), because the only way that this is achievable is that the file exists on their machine beforehand in the correct filepath.

      You cannot use the Sound right-click option. Nor can you use the PlaySoundFile API function. What you need is the PlayMusic API function. More details about it can be found here. But basically, this function calls upon mp3 files not only located within the WoW MPQ’s, but can also call on files in you Addons folder. (Sorry, but this function does not work with .wav files.)

      The call function is very similar to the PlaySoundFile.

      PlayMusic(“SoundFilePathGoesHere.mp3”);

      For custom music, the filepath probably follow this:

      Interface\\AddOns\\FolderName\\MusicName.mp3

      (Also if you try and do this right away, like create a folder and put your music in there while your game client is active, you’ll need to restart WoW for it to take effect.)

      For your second question, you cannot fade sound used by the PlaySoundFile function. Only music that uses the PlayMusic function can be faded away via the StopMusic function.

      If your curious on how it looks like:

      StopMusic();

      Again, I stress that this only works with sound files using the PlayMusic function. It does not stop sound files using the PlaySoundFile function.

  2. Brilliant site! I’m working on a GHI gizmo and I wanted to script a loop of randomly selected sounds from a bank of sounds I’ve already chosen. In other words, each time the item is clicked, the script will allow for a number of funny random gizmo sounds (e.g. 10 sounds spread apart by a few seconds), but potentially different sounds (randomly determined) each time the item is used. The item is supposed to be somewhat puzzling and ambiguous because it makes different weird mechanized noises each time you press its buttons. Can this be done?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: