Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding music in the editor
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
Adding music in the editor

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?

01-26-2013, 03:35 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Adding music in the editor

Music is scripted into the map via .hps, not placed.
01-26-2013, 07:22 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: Adding music in the editor

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: (Select All)
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.

In Ruins [WIP]
01-26-2013, 09:22 AM
Find
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#4
RE: Adding music in the editor

(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: (Select All)
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.

01-27-2013, 03:36 AM
Find
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#5
RE: Adding music in the editor

EDIT, never mind I was being stupid.

(This post was last modified: 01-31-2013, 01:55 AM by serbusfish.)
01-31-2013, 01:38 AM
Find




Users browsing this thread: 1 Guest(s)