Frictional Games Forum (read-only)
how to add music when I start my CS? - 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: how to add music when I start my CS? (/thread-16126.html)



how to add music when I start my CS? - Demondays1 - 06-14-2012

I was wondering, I tried looking at the scripts but I am just not doing it correctly?

This is what I have:


void OnStart()
{
StopMusic(60, 1);
PlayMusic("brandon2.ogg", false, 1, 0, 10, false);

}

And yes, I do have my brandon2.ogg in the music folder.


What StopMusic does:

afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop


What PlayMusic does:

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 - highest, 1 - lower, etc


RE: how to add music when I start my CS? - Adny - 06-14-2012

Int alPrio is so way too high. try replacing the 10 with a 0 or 1. The lower the number, the higher the priority, meaning it has a higher priority to be played (ie if you have other sounds with a higher priority, they will play instead of your music.)

Hope that helps Big Grin


RE: how to add music when I start my CS? - Demondays1 - 06-14-2012

(06-14-2012, 04:25 AM)andyrockin123 Wrote: Int alPrio is so way too high. try replacing the 10 with a 0 or 1. The lower the number, the higher the priority, meaning it has a higher priority to be played (ie if you have other sounds with a higher priority, they will play instead of your music.)

Hope that helps Big Grin
Changed it a bit, here is how it is:



void OnStart()
{
PlayMusic("brandon2.ogg", false, 0.5f, 0.5f, 0, false);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(5.0f, 0);
}

I have the .ogg and .snt still not working.


RE: how to add music when I start my CS? - Adny - 06-14-2012

hmm, what software did you use to make/convert your .ogg? (also, .snt is not necessary for the playmusic function)


RE: how to add music when I start my CS? - Demondays1 - 06-14-2012

(06-14-2012, 05:01 AM)andyrockin123 Wrote: hmm, what software did you use to make/convert your .ogg? (also, .snt is not necessary for the playmusic function)
I didnt convert it, I just changed the .Mp3 extension to .Ogg


RE: how to add music when I start my CS? - Adny - 06-14-2012

As in renaming it? That seems to be the problem right there. Sadly, simply renaming it won't work; personally, I use Audacity, a free sound editor:

http://audacity.sourceforge.net/


Simply open the program then drag & drop your original mp3 file into it. Next, click file > export. Before choosing where to save it, make sure you have "Save as type:" set to "Ogg Vorbis Files". After letting it export properly, you will have a fully functional .ogg to use in Amnesia. If you have any further questions, feel free to ask or pm me.

Hope that helped Tongue