User Tools

Site Tools


Sidebar

hpl2:tutorials:script:page

How to add Custom Sounds?

Hello! Stepper321 here, i'm gonna learn you how to add custom sounds, maybe some of you know already, maybe some of you don't.

Having the sounds

First you'll need the sound, you can do this by using [[http://audacity.sourceforge.net/download/|Audacity]] or [[http://www.sonycreativesoftware.com/download/trials/vegaspro|Sony Vegas]].

The sounds need to be *.ogg files, so if you got the files that are *.mp3 or *.wav or anything else, use Audacity or Sony Vegas to convert them to *.ogg files (* is the sound file.).

For my example, my file is called tutorial.ogg

Placing the sounds in the right folder

You need to go to your custom story folder and create a new folder called: “sounds” and in that folder an: “extrasounds” folder. In there you place the tutorial.ogg file.

Making the sound work in Amnesia

Create an *.txt file and name it the name of your sound (Doesn't matter what name you give it.) and open it with any Text Editor you use. I use Notepad++. I name my file tutorial.txt.

In the file, you can edit everything you will see soon to your own spefication and sound file name, since my sound file name tutorial.ogg there, if you want the files to be randomly chosen, i will that later.

<SOUNDENTITY> <SOUNDS> <Main> <Sound File=“door.ogg” /> </Main> </SOUNDS> <PROPERTIES Volume=“5” MinDistance=“1” MaxDistance=“50” Random=“0” Interval=“0” FadeEnd=“False” FadeStart=“False” Stream=“False” Loop=“False” Use3D=“false” Blockable=“False” BlockVolumeMul=“0.7” Priority=“5” /> </SOUNDENTITY>

Maybe your asking, what the hell is all this? I will explain

<SOUNDENTITY> is the start of the sound file to know what it will play, it can only have one. (Like the extra_english file you have normally in your Custom Story :))

<SOUNDS> is the sound what it will play

<Main> is the main sound it will play, i don't know if there exist other categories for that. But use it

<Sound File=“*.ogg” /> is the sound file it will play, if you add multiple sound files, it will play the sounds randomly.

<PROPERTIES> Are all the properties that will come, like MinDistance is what distance you have to be in to hear it, since 1 is the players exact size, you will hear the sound any time when in the area of 1 till the number specified in MaxDistance, i don't know exactly but 1 distance is a meter, excuse me if i'm wrong :).

Well thats it! You now created your very own sound! Use it with PlaySoundAtEntity(syntax); (check Engine scripts to know what syntax to use)

Custom Music

Custom musics are exactly the same steps as the custom sounds. But you won't need an .snt file created as long as you do it with PlayMusic(syntax); or at the credits.

Prepare your .ogg file with the same steps as the Custom Sounds.

Create a new folder called “music” and in the 'music' folder one that's called “extramusic” put it in there.

Now use PlayMusic(syntax); (check Engine scripts to know what syntax to use)

Now maybe your thinking that you could use this like a sound effect? Well no, it will override all musics that are in. So all musics will be gone.


Send suggestions for tutorials to my forum account by Personal Messaging me at this link: Stepper321's personal forum account.

hpl2/tutorials/script/page.1331925436.txt.gz · Last modified: 2012/03/16 19:17 by stepper