User Tools

Site Tools


hpl2:tutorials:script:page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:script:page [2012/03/16 19:18]
stepper [Having the sounds]
hpl2:tutorials:script:page [2014/11/01 22:22] (current)
romulator [Making the sound work in Amnesia] Removed some php code.
Line 2: Line 2:
  
  
-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.+Hello! Stepper321 ​(And friends) ​here, i'm gonna teach you how to add custom sounds!
  
  
Line 8: Line 8:
  
  
-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]] ​+First you'll need sound-editting program, you can do this by using [[http://​www.erightsoft.com/​S6Kg1.html|SUPER]] (Recommended) ​[[http://​audacity.sourceforge.net/​download/​|Audacity]] or [[http://​www.sonycreativesoftware.com/​download/​trials/​vegaspro|Sony Vegas]] ​(Not free)
  
  
-The sounds need to be<​nowiki> ​*</​nowiki>​.ogg filesso if you got the files that are<​nowiki> ​*</​nowiki>​.mp3 or<​nowiki> ​*</​nowiki>​.wav or anything else, use Audacity or Sony Vegas to convert ​them to<​nowiki> ​*</nowiki>.ogg files (<​nowiki>​*</​nowiki>​ is the sound file.).+The sounds need to be in **.ogg ** formatIf your soundfiles ​are formatted as **.MP3**, **.WAV** or anything else, you may use one of the said above programs ​to convert ​your soundfile of choice ​to an **//.// ogg*file format.
  
  
-For my example, my file is called tutorial.ogg+For my example, my script ​file is called ​**tutorial.txt**, and the sound is **door.ogg**.
  
 ===== Placing the sounds in the right folder ===== ===== 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. +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.\\  
- +(**You can name it what ever you want.**)
 ===== Making the sound work in Amnesia ===== ===== Making the sound work in Amnesia =====
  
 +Create a **.txt** file and name it the name of your sound'​s Script, open it with any Text Editor you use. I use [[http://​wiki.frictionalgames.com/​hpl2/​third_party_tools/​text/​notepad?​s[]=notepad|Notepad++]]. I named my file __**tutorial**__**.txt**.
  
- ​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 useI use Notepad++I name my file tutorial.txt.+In the file, you can edit quite a few things, and among them is..//Adding your sound-file into the script!// And since my sound file is __**door**__**.ogg**,​ It shall go to the **MAIN** sectionRandom soundfiles will be covered later on. 
 +<​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>​ 
 +</​code>​
  
 +Maybe you're asking, what the hell is all of this? I will explain :
  
-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** > is the start of the sound file to know what it will playit can only have one. (Like the extra_english file you have normally in your Custom Story :))
  
 +<​**SOUNDS** > is the sound what it will play
  
-<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>​+<**Main** is the main sound it will play, i don't know if there exist other categories for thatBut use it
  
 +<**Sound File** =" //​YourFileName//​.ogg"​ /> is the sound file it will play, if you add multiple sound files, it will play the sounds randomly.
  
-Maybe your asking, what the hell is all this? I will explain +<**PROPERTIES** ​Are all the options ​you may use to decide how the sound will behave in-game, 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 perfectly if you stand on it. Beyond that, you will be able to hear the sound until the distance ​specified in **MaxDistance**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? **Needs ​to be confirmed**)
- +
- +
-<SOUNDENTITYis 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="<​nowiki>​*</​nowiki>​.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, ​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)+
  
 +Well thats it! You now created your very own sound! Use it with PlaySoundAtEntity(syntax) in your custom level-script;​ (check [[http://​wiki.frictionalgames.com/​hpl2/​amnesia/​script_functions|Engine scripts]] to know what syntax to use)
  
 ====== Custom Music ====== ====== Custom Music ======
Line 64: Line 60:
  
  
-Create a new folder called "​music"​ and in the '​music'​ folder one that's called "​extramusic"​ put it in there.+Create a new folder called "​music"​ and in the '​music'​ folder one that's called "​extramusic"​ put it in there. ​(**Again, you may name it whatevas you want**) 
 + 
 + 
 +Now use **PlayMusic** (Syntex); (check [[http://​wiki.frictionalgames.com/​hpl2/​amnesia/​script_functions|Engine scripts]] to know what syntax to use)
  
  
-Now use PlayMusic(syntax); (check Engine scripts to know what syntax to use)+Now maybe you're thinking that you could use this **like** a sound effect? Well [[http://​i0.kym-cdn.com/​photos/​images/​original/​000/​262/​501/​be7.gif|NOPE]]. Music has only two "​layers" ​(Priorities). 0 and 1. I.E: only**one can play at once.** ​
  
  
-Now maybe your thinking that you could use this like a sound effect? Well noit will override all musics that are inSo all musics ​will be gone.+If 1 **is //__not__ // specified**track 0 will playIf 1**//__is__ // specified**,​ ONLY "​1" ​will play.\\  
 +(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!)
  
  
 \\  \\ 
-Send suggestions for tutorials to my forum account by Personal Messaging me at this link: [[http://​www.frictionalgames.com/​forum/​user-17976.html|Stepper321'​s personal forum account]].+Send suggestions for tutorials to my forum account by Personal Messaging me at this link: [[http://​www.frictionalgames.com/​forum/​user-17976.html|Stepper321'​s personal forum account]].\\  
 +<font 8px:​normal/​Arial;;​inherit;;​inherit >​(Everything is in good will, Stepper, your guide was quite incoherent. Cheers for the initiative ~Yer wiki-friends.)</​font>​
  
hpl2/tutorials/script/page.1331925496.txt.gz · Last modified: 2012/03/16 19:18 by stepper