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
Custom sound files when interacting with objects...
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Custom sound files when interacting with objects...

Sure thing!
Ambient music is really quite simple to implement.
You don't need a .snt file for ambient music. All you need is the .ogg.
Then, in your OnStart function, add Playmusic.

Example
void OnStart()
{
PlayMusic
("[musicname + .ogg extension]", [true or false if you want it to loop], [A decimal for volume. Usually below 1, but above 0], [time until music reaches full volume], [Priority of music. Zero is highest priority], [true or false if you want it to resume if it gets interrupted (i.e, monster attack)]);
}

Taken from:

void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Plays music.

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



And have the music.ogg file in a sounds folder in your main directory for your custom story

Feel free to PM me with any more questions you may have. Smile
(This post was last modified: 09-20-2011, 05:44 PM by Obliviator27.)
09-20-2011, 05:42 PM
Find


Messages In This Thread
RE: Custom sound files when interacting with objects... - by Obliviator27 - 09-20-2011, 05:42 PM



Users browsing this thread: 1 Guest(s)