Author Topic: How do I make a sound Add-on?  (Read 2372 times)

 I wanted to add the sound of Bullet Bill into blockland.
I have the sound as a .wav file, but what do I do from there?
Can somebody please help Me out?

Download Audacity.

you can then open other sounds from other files, and look at them in there. You can learn from it, but ill spoonfeed ya:

1. Open your .wav file in audacity

2. Cut it down to the length you want (if you need to). This can be done by clicking and dragging the part you would like to delete on the timeline

3. go to the side of the timeline with the dropdown menu and everything.

4. click the arrow that points down.

5. "Split Stereo Track"

6. Change the "left" and "right" to "mono" on both of them

7. on the second one, click the "X" button next to the drop down

8. File --> Export

9. Make sure all the spaces are filled with underscores when naming it.

10. Locate it, and you can use it!!!

He already has the sound.

In your server.cs, you have to define the datablock for the sound. The code will look something like this:
Code: [Select]
datablock AudioProfile(YourSoundData) //Replace YourSoundData with a name. One word, no spaces. For script, doesn't show ingame.
{
filename = "Add-Ons/Sound_YourSounds/sound.wav"; //Path to your sound file. Should be in your add-on's .zip file (don't include the .zip extension). I'm sure you know how paths work.
description = AudioClosest3d; //do not change
preload = false; //do not change
};

He already has the sound.

In your server.cs, you have to define the datablock for the sound. The code will look something like this:
Code: [Select]
datablock AudioProfile(YourSoundData) //Replace YourSoundData with a name. One word, no spaces. For script, doesn't show ingame.
{
filename = "Add-Ons/Sound_YourSounds/sound.wav"; //Path to your sound file. Should be in your add-on's .zip file (don't include the .zip extension). I'm sure you know how paths work.
description = AudioClosest3d; //do not change
preload = false; //do not change
};

Oh. But how do I make a .cs file? I tried doing this in notepad, but nothing played on My server. :o

Oh. But how do I make a .cs file? I tried doing this in notepad, but nothing played on My server. :o
When saving, select "All Files (*.*)" as the file type, and name it server.cs

make sure it's in the uppermost folder of the .zip (not in any folders within it)

also make sure you have a description.txt file in the add-on as well.

and of course make sure it's activated.

When saving, select "All Files (*.*)" as the file type, and name it server.cs

make sure it's in the uppermost folder of the .zip (not in any folders within it)

also make sure you have a description.txt file in the add-on as well.

and of course make sure it's activated.

Ugh, forgive Me, but I still can't do it! Could You paste the .cs code the way it should be typed in notepad? 'Cause I think I mess it up when erasing the notes You add to it! Please?

Ugh, forgive Me, but I still can't do it! Could You paste the .cs code the way it should be typed in notepad? 'Cause I think I mess it up when erasing the notes You add to it! Please?
Well, post what you have. That'll help more.

I wrote this:

datablock AudioProfile(kirra)
{
   filename = "kirra.wav";
   description = AudioClosest3d;
   preload = false;
};

"kirra.wav";

should be

"Add-Ons/(whatever your add-on's file is)/kirra.wav";

"kirra.wav";

should be

"Add-Ons/(whatever your add-on's file is)/kirra.wav";

So I did this and still nothing happens!:

datablock AudioProfile(kirra)
{
   filename = "Add-Ons/Blockland/kirra.wav";
   description = AudioClosest3d;
   preload = false;
};

The addons is in the Blockland folder which is n My Documents. I can't get it working. When I save the coding in notepad, does the Encoding have anything to do with it? Sorry for My stuggle, heh.

you know add-ons are supposed to be in .zip files right?

the path is from your blockland folder in documents.

in your add-ons folder, you should have your add-on, which is probably Sound_namehere. that's what you put there in that spot. the name of the .zip file, without the .zip.

you know add-ons are supposed to be in .zip files right?

the path is from your blockland folder in documents.

in your add-ons folder, you should have your add-on, which is probably Sound_namehere. that's what you put there in that spot. the name of the .zip file, without the .zip.

Oh! It worked now! Thank You, Otto-san, for Your help and patience! ( / ^ u^)/ :cookie: