Author Topic: How do i add sounds to the game and replace old sounds?  (Read 1813 times)

Hello, im new to the blockland forums and i need some help from you people.

So i want to get started with putting my own sounds in the game, cars, jets, guns, etc. But i have no idea how to get them to be used in blockland and where to place them.  Can i get any help or tips on how to get started?



Sure! First, you need to make sure your sounds are mono, not stereo.
Second, put your sound file in a .wav or .ogg format. Ogg is for music, Wav is for everything else.
If you wish to do music, just locate your music folder under the Add-Ons directory, and place it there.
Third, figure out if you want a 2D sound, or a 3D sound. 2D sounds will play at the set volume to a client themselves so no one else will hear it, 3D is, as you probably guess, a sound played from an object, so everyone can hear it.
Fourth, package and scripting. Locate your add-ons folder, and create a new folder. Name it Sound_YourName, obviously you can put whatever you wish as "YourName." Within this file you will need to create a new .txt named "Namecheck" and put the name of the file it's in, as the text. So namecheck will have Sound_YourName in it.
Add all of your .wav sounds to this file. Then using a text editor (I use Sublime, and Notepad++ is also famous here) create a server.cs file. Within this file you will need to type something like this in:
Code: [Select]
datablock AudioProfile(Sound_1_sound)
{
filename = "./Sound_1.wav";
description = AudioClosest3d;
preload = false;
};

datablock AudioProfile(Sound_2_sound : Sound_1_sound)
{
filename = "./Sound_2.wav";
};

datablock AudioProfile(Sound_3_sound : Sound_1_sound)
{
filename = "./Sound_3.wav";
};

datablock AudioProfile(Sound_4_sound : Sound_1_sound)
{
filename = "./Sound_4.wav";
};

datablock AudioProfile(Sound_5_sound : Sound_1_sound)
{
filename = "./Sound_5.wav";
};
The "Sound_#_sound" part is what the names of your sound will appear as. Although I can recall all of the default descriptions for sound that you can input, that one is a good one to use.

Lol noedit

In order to replace old sounds, you either have to do them manually, or use some scripts to replace them. I do not recommend doing this to your game however, until you are more adept at how the system works.

Just a warning - don't put .ogg in a zip file. It screws it terribly. Caused me literally hours of frustration trying to recode one of my older projects, until I used .wav, and it worked fine.

thanks for the help guys. i will be testing out what i learned and post some sounds later