skip to content
Frictional Game Wiki
User Tools
Register
Log In
Site Tools
Search
Tools
Show page
Old revisions
Backlinks
Recent Changes
Media Manager
Sitemap
Log In
Register
>
Recent Changes
Media Manager
Sitemap
Trace:
hpl2:tutorials:script:page
<h1>How to add Custom Sounds?</h1> <div class="level1"> <p> Hello! Stepper321 (And friends) here, i'm gonna teach you how to add custom sounds! </p> </div> <h2>Having the sounds</h2> <div class="level2"> <p> First you'll need a sound-editting program, you can do this by using <a href="http://www.erightsoft.com/S6Kg1.html" class="urlextern" title="http://www.erightsoft.com/S6Kg1.html" rel="nofollow">SUPER</a> (Recommended) <a href="http://audacity.sourceforge.net/download/" class="urlextern" title="http://audacity.sourceforge.net/download/" rel="nofollow">Audacity</a> or <a href="http://www.sonycreativesoftware.com/download/trials/vegaspro" class="urlextern" title="http://www.sonycreativesoftware.com/download/trials/vegaspro" rel="nofollow">Sony Vegas</a> (Not free) </p> <p> The sounds need to be in <b>.ogg </b> format, If your soundfiles are formatted as <b>.MP3</b>, <b>.WAV</b> or anything else, you may use one of the said above programs to convert your soundfile of choice to an <b><em>.</em> ogg</b> file format. </p> <p> For my example, my script file is called <b>tutorial.txt</b>, and the sound is <b>door.ogg</b>. </p> </div> <h2>Placing the sounds in the right folder</h2> <div class="level2"> <p> 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.<br/> (<b>You can name it what ever you want.</b>) </p> </div> <h2>Making the sound work in Amnesia</h2> <div class="level2"> <p> Create a <b>.txt</b> file and name it the name of your sound's Script, open it with any Text Editor you use. I use <a href="http://wiki.frictionalgames.com/hpl2/third_party_tools/text/notepad?s[]=notepad" class="urlextern" title="http://wiki.frictionalgames.com/hpl2/third_party_tools/text/notepad?s[]=notepad" rel="nofollow">Notepad++</a>. I named my file <u><b>tutorial</b></u><b>.txt</b>. </p> <p> In the file, you can edit quite a few things, and among them is..<em>Adding your sound-file into the script!</em> And since my sound file is <u><b>door</b></u><b>.ogg</b>, It shall go to the <b>MAIN</b> section. Random soundfiles will be covered later on. </p> <pre class="code"><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> </pre><p> </p> <p> Maybe you're asking, what the hell is all of this? I will explain : </p> <p> <<b>SOUNDENTITY</b> > 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 :)) </p> <p> <<b>SOUNDS</b> > is the sound what it will play </p> <p> <<b>Main</b> > is the main sound it will play, i don't know if there exist other categories for that. But use it </p> <p> <<b>Sound File</b> =" <em>YourFileName</em>.ogg" /> is the sound file it will play, if you add multiple sound files, it will play the sounds randomly. </p> <p> <<b>PROPERTIES</b> > Are all the options you may use to decide how the sound will behave in-game, like <b>MinDistance</b> is what distance you have to be in to hear it, since 1 is the players exact size, You will hear the sound perfectly if you stand on it. Beyond that, you will be able to hear the sound until the distance specified in <b>MaxDistance</b>, I don't know exactly but I think that "1" distance is a meter, excuse me if i'm wrong :). (Probably an inch, a person 1 meter in width? <b>Needs to be confirmed</b>) </p> <p> Well thats it! You now created your very own sound! Use it with PlaySoundAtEntity(syntax) in your custom level-script; (check <a href="http://wiki.frictionalgames.com/hpl2/amnesia/script_functions" class="urlextern" title="http://wiki.frictionalgames.com/hpl2/amnesia/script_functions" rel="nofollow">Engine scripts</a> to know what syntax to use) </p> </div> <h1>Custom Music</h1> <div class="level1"> <p> 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. </p> <p> Prepare your .ogg file with the same steps as the Custom Sounds. </p> <p> Create a new folder called "music" and in the 'music' folder one that's called "extramusic" put it in there. (<b>Again, you may name it whatevas you want</b>) </p> <p> Now use <b>PlayMusic</b> (Syntex); (check <a href="http://wiki.frictionalgames.com/hpl2/amnesia/script_functions" class="urlextern" title="http://wiki.frictionalgames.com/hpl2/amnesia/script_functions" rel="nofollow">Engine scripts</a> to know what syntax to use) </p> <p> Now maybe you're thinking that you could use this <b>like</b> a sound effect? Well ; <a href="http://i0.kym-cdn.com/photos/images/original/000/262/501/be7.gif" class="urlextern" title="http://i0.kym-cdn.com/photos/images/original/000/262/501/be7.gif" rel="nofollow">NOPE</a>. Music has only two "layers" (Priorities). 0 and 1. I.E: only<b>one can play at once.</b> </p> <p> If 1 <b>is <em><u>not</u> </em> specified</b>, track 0 will play. If 1<b><em><u>is</u> </em> specified</b>, ONLY "1" will play.<br/> (You can use that to suddenly or smoothly fade-stop a track in it's place, initiate a different track for your scene, and than resume the previous track. Pretty much what happens when a grunt chases you; only that is automatic!) </p> <p> <br/> Send suggestions for tutorials to my forum account by Personal Messaging me at this link: <a href="http://www.frictionalgames.com/forum/user-17976.html" class="urlextern" title="http://www.frictionalgames.com/forum/user-17976.html" rel="nofollow">Stepper321's personal forum account</a>.<br/> <span style = "color:inherit"><span style = "font-size:8px:normal"><span style = "font-family:Arial"><span style = "background-color:inherit ">(Everything is in good will, Stepper, your guide was quite incoherent. Cheers for the initiative ~Yer wiki-friends.)</span></span></span></span> </p> </div>
hpl2/tutorials/script/page.txt
· Last modified: 2014/11/01 22:22 by
romulator
Page Tools
Show page
Old revisions
Backlinks
Export to PDF
Back to top