Difference between revisions of "Playing custom background music"

m
→‎Better Music System (BMS): Spelling correction
imported>Jaime74
m
imported>Syscrusher
m (→‎Better Music System (BMS): Spelling correction)
 
(6 intermediate revisions by 2 users not shown)
Line 8: Line 8:
This article deals with the issue that arises whenever users have either of the following music extensions installed, because they overrule StreamMusic and thus make its usage unreliable:
This article deals with the issue that arises whenever users have either of the following music extensions installed, because they overrule StreamMusic and thus make its usage unreliable:
*[[:Category:SoundCommands|Sound Commands]] (short: SC) by Scanti
*[[:Category:SoundCommands|Sound Commands]] (short: SC) by Scanti
*[http://www.tesnexus.com/downloads/file.php?id=19772| Enhanced Music and Control] (short: EMC) by HawkleyFox
*[http://www.nexusmods.com/oblivion/mods/19772/ Enhanced Music and Control] (short: EMC) by HawkleyFox
*[http://www.tesnexus.com/downloads/file.php?id=26892| Better Music System] (short: BMS) by side777
*[http://www.nexusmods.com/oblivion/mods/26892/ Better Music System] (short: BMS) by side777


This tutorial summarizes briefly, in the first part, how to play custom tracks with each of these three extensions. This doesn't go deep into the details, because all of this is already documented in other articles (links included).
This tutorial summarizes briefly, in the first part, how to play custom tracks with each of these three extensions. This doesn't go deep into the details, because all of this is already documented in other articles (links included).
Line 18: Line 18:
===StreamMusic===
===StreamMusic===
StreamMusic is Oblivion's vanilla function for playing custom background music. It is known to have a lot of limitations, but it's still the only way to stream music on all user systems that don't use [[OBSE]] and don't have any of the other extensions installed. If you don't want to force users of your mods to install one of those extensions, you should always enable your mods to play music with this vanilla function, if necessary.
StreamMusic is Oblivion's vanilla function for playing custom background music. It is known to have a lot of limitations, but it's still the only way to stream music on all user systems that don't use [[OBSE]] and don't have any of the other extensions installed. If you don't want to force users of your mods to install one of those extensions, you should always enable your mods to play music with this vanilla function, if necessary.
Using StreamSound is quite simple, e.g.
Using StreamMusic is quite simple, e.g.
  SteamSound "Data\Music\YourPlaylist\*.*"
  StreamMusic "Data\Music\YourPlaylist\*.*"
will randomly pick one track from within the ''YourPlaylist'' subfolder (which we can consider a "playlist") and immediately start streaming it.
will randomly pick one track from within the ''YourPlaylist'' subfolder (which we can consider a "playlist") and immediately start streaming it.


Line 36: Line 36:
===Enhanced Music and Controls (EMC)===
===Enhanced Music and Controls (EMC)===
This is another plugin for [[OBSE]], which comes with an even more comfortable set of sound functions. It goes beyond SoundCommands' possibilities by providing methods to define and play ''playlists'' with script functions.  
This is another plugin for [[OBSE]], which comes with an even more comfortable set of sound functions. It goes beyond SoundCommands' possibilities by providing methods to define and play ''playlists'' with script functions.  
As Better Music System (see below) is based on the older EMC, most users will problably have it installed simply because they use BMS. I.e. EMC is always present implicitely when someone uses BMS.
As Better Music System (see below) is based on the older EMC, most users will problably have it installed simply because they use BMS. I.e. EMC is always present implicitly when someone uses BMS.


Note that EMC commands overrule any attempt to play music ''either'' via SoundCommands ''or'' via StreamMusic!
Note that EMC commands overrule any attempt to play music ''either'' via SoundCommands ''or'' via StreamMusic!
Line 46: Line 46:
While it uses core EMC functions to play music, it seems to take precedence over any attempt to play music with EMC code from within other mods!  
While it uses core EMC functions to play music, it seems to take precedence over any attempt to play music with EMC code from within other mods!  


This means, implicitely, that it blocks all of the other methods listed above!
This means, implicitly, that it blocks all of the other methods listed above!


In other words: If you want to start custom background music tracks by simply writing StreamMusic, SC or EMC code, this won't work whenever the user uses BMS!  
In other words: If you want to start custom background music tracks by simply writing StreamMusic, SC or EMC code, this won't work whenever the user uses BMS!  
Line 58: Line 58:
* that these methods interfere with each other, one taking precedence over others
* that these methods interfere with each other, one taking precedence over others


Hence, if you are developing a mod that should play specific music (e.g. inside a specific cell), you cannot rely on the one or the other method without forcing the users to either ''install'' or ''uninstall'' certain music extensions! This would have big impact on the acceptance of your mod, so you need to write some more script code to detect whih plugins are installed in the user's environment, and then use the most appropriate method to play your music.
Hence, if you are developing a mod that should play specific music (e.g. inside a specific cell), you cannot rely on the one or the other method without forcing the users to either ''install'' or ''uninstall'' certain music extensions! This would have big impact on the acceptance of your mod, so you need to write some more script code to detect which plugins are installed in the user's environment, and then use the most appropriate method to play your music.


The code below shows an example of how to do this.
The code below shows an example of how to do this.
Line 67: Line 67:
#Your mod defines a cell called ''YourCell'', in which your custom music should automatically be played on entering
#Your mod defines a cell called ''YourCell'', in which your custom music should automatically be played on entering
#All music tracks for this cell-specific playlist are located under ''Data\Music\YourPlaylist''
#All music tracks for this cell-specific playlist are located under ''Data\Music\YourPlaylist''
#There's only 1 track to be playes (''YourTrack.mp3'')
#There's only 1 track to be played (''YourTrack.mp3'')


This script is still quite yomplex, and it already covers some very special situations. A more detailed explanation will follow...
This script is still quite complex, and it already covers some very special situations. A more detailed explanation will follow...


  ScriptName YourModQuestScript
  ScriptName YourModQuestScript
Line 156: Line 156:
   endif
   endif
  end ; end of gameMode block
  end ; end of gameMode block
 
==See also==
==See also==
*[[StreamMusic]]
*[[StreamMusic]]
Anonymous user