Frictional Games Forum (read-only)

Full Version: Adding music in the editor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
Music is scripted into the map via .hps, not placed.
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.
(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.
EDIT, never mind I was being stupid.