Frictional Games Forum (read-only)
Adding music in the editor - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Adding music in the editor (/thread-20056.html)



Adding music in the editor - serbusfish - 01-26-2013

Ive just started building my first custom story, i've been looking through the wiki tutorial pages for the level editor and have learned most of the basics but I cant figure out how to include music? I checked the sounds tab but from what I can tell none of the music files are located in the sounds folder, unless ive missed them?


RE: Adding music in the editor - Statyk - 01-26-2013

Music is scripted into the map via .hps, not placed.


RE: Adding music in the editor - NaxEla - 01-26-2013

The sounds that you add in the level editor are the .snt files that are located in the "sounds" folder. They are used for ambient sounds (like bats, rain, wind, etc.). All the music is in the "music" folder and, as Statyk said above, the music is scripted into the map.

To script the music into the map, use this function in OnEnter:
PHP Code:
void PlayMusic(stringasMusicFilebool abLoopfloat afVolumefloat afFadeTimeint alPriobool abResume); 
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.


RE: Adding music in the editor - serbusfish - 01-27-2013

(01-26-2013, 09:22 AM)NaxEla Wrote: The sounds that you add in the level editor are the .snt files that are located in the "sounds" folder. They are used for ambient sounds (like bats, rain, wind, etc.). All the music is in the "music" folder and, as Statyk said above, the music is scripted into the map.

To script the music into the map, use this function in OnEnter:
PHP Code:
void PlayMusic(stringasMusicFilebool abLoopfloat afVolumefloat afFadeTimeint alPriobool abResume); 
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.

Thanks a lot dude, very helpful info. I havent done anything regarding scripting yet, im still getting used to the level editor at the moment, I plan to check out the scripting tutorials soon.


RE: Adding music in the editor - serbusfish - 01-31-2013

EDIT, never mind I was being stupid.