[RELz, BETA] Enhanced Music Control

Post » Sun Mar 14, 2010 3:59 am

thanks^ :D but I mean is more like 1 track for those specific battles (like a pair in the arena :D) I should make a 1-track only playlist?

If you have one or more situations where you just want to have one track replayed repeatedly, I'd suggest to create subfolders for each of that situations inside your custom music folder where each folder contains the desired track and assign it as a playlist.
User avatar
Lauren Denman
 
Posts: 3382
Joined: Fri Jun 16, 2006 10:29 am

Post » Sun Mar 14, 2010 4:57 am

actually there are a lot of those situations :D thanks Willi Viper
User avatar
James Baldwin
 
Posts: 3366
Joined: Tue Jun 05, 2007 11:11 am

Post » Sun Mar 14, 2010 5:05 pm

Does this work with the optional part of Musical Immersion? :)
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Sun Mar 14, 2010 10:41 am

Does this work with the optional part of Musical Immersion? :)

I didnt use MI yet but from what I've seen in the code its functional core just seems to enable/disable the music .
So, yes I suppose it does. But you'll never know if you dont try ;)
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Sun Mar 14, 2010 2:25 pm

I didnt use MI yet but from what I've seen in the code its functional core just seems to enable/disable the music .
So, yes I suppose it does. But you'll never know if you dont try ;)


But...but..my load order could get hurt! :ahhh: Heh

Thank you.
User avatar
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Sun Mar 14, 2010 3:15 pm

When creating custom mp3s for this game - is all that is required to do is to make sure the bitrate is 192?

Anything else I should pay attention to?

thanks
User avatar
vicki kitterman
 
Posts: 3494
Joined: Mon Aug 07, 2006 11:58 am

Post » Sun Mar 14, 2010 8:30 am

But...but..my load order could get hurt! :ahhh: Heh

Thank you.


It works, and well. I think when I have time I'll try making a version of Musical Immersion based on this plugin if mig doesn't get to it. No guarantees though.
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Sun Mar 14, 2010 2:29 pm

When creating custom mp3s for this game - is all that is required to do is to make sure the bitrate is 192?

Anything else I should pay attention to?

thanks


As long as the file is an mp3, it will play.
Also, I beleive other file formats will play as well when using EMC.
Just put the files in the Music folder. If WMP will play the file, you can include it in the Music folders and EMC will add them to the playlists it creates.

Although, you may want to use Audacity (Freeware) to set the sample rate of your files to 128 bit rate. Takes up less space with little to no loss of quality (generally).
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Post » Sun Mar 14, 2010 11:50 am

but even if encoded on higher quality mp3s will still be played correct?
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Sun Mar 14, 2010 4:12 am

but even if encoded on higher quality mp3s will still be played correct?


I have noticed no difference with my music files, and I have MP3's from Michikawa, LOTR soundtracks. Hero, Crouching Tiger..., House of Flying Daggers, etc... for personal use only (which I won the original CD's) and all are differing bitrates. All play fine.

-Coors916 :ninja:
User avatar
Peter P Canning
 
Posts: 3531
Joined: Tue May 22, 2007 2:44 am

Post » Sun Mar 14, 2010 3:35 am

I'll try releasing a thing , not anytime soon though. that is, if I learn what to do XD
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Sun Mar 14, 2010 1:35 pm

I would LOVE to use EMC with a mod I'm working on. To start with I was hoping to change the combat music when the player fights a specific werewolf-type enemy to a specific track, and then switch back to default Oblivion music when the fight was over. So I'm going to go over the steps I THINK I need to take, and please tell me if I am on the right track here.

First, there is only ONE song for this enemy creature, it is an mp3 and I have it stored in the following location...
Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3


This is the script that I would add to the werewolf creature (with some other checks later on to ensure the combat is with the PLAYER, but for now, I'll keep it simple)...

scn StrDpWerewolfScriptshort WolfenMusicFailedBegin OnStartCombat;*********************; Combat Music Change;*********************	if (emcPlaylistExists StrDpWolfenCombat) == 0		if (emcCreatePlaylist StrDpWolfenCombat "Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3") == 0			set WolfenMusicFailed to 1		endif	endif	if WolfenMusicFailed == 0 && emcIsMusicSwitching == 0		emcChangePlaylist 4 StrDpWolfenCombat	endifEndBegin GameMode;**********************; Combat Music Restore;**********************	if ( IsInCombat == 0 )		emcRestoreDefaultPlaylist 4	endifEnd



Would that be about right?
User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Sun Mar 14, 2010 12:54 pm

Looking back over that code, I realize I didn't actually define the playlist in there, although I did check to see if it was playing. So, would THIS achieve what I'm trying to accomplish?

scn StrDpWerewolfScriptshort WolfenMusicFailedBegin OnStartCombat;*********************; Combat Music Change;*********************	if (emcPlaylistExists StrDpWolfenCombat) == 0		if (emcCreatePlaylist StrDpWolfenCombat "Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3") == 0			set WolfenMusicFailed to 1		endif	endif	if WolfenMusicFailed == 0 && emcIsMusicSwitching == 0	emcCreatePlaylist StrDpWolfenCombat "Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3"	emcChangePlaylist 4 StrDpWolfenCombat	endifEndBegin GameMode;**********************; Combat Music Restore;**********************	if ( IsInCombat == 0 )		emcRestoreDefaultPlaylist 4	endifEnd

User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Sun Mar 14, 2010 5:08 am

One more thing, since this is combat music and I'm trying to switch out the combat music once OnBeginCombat has begun, would I need to include emcEnableBattleOverride in there? If so, where in the script should it go? Should it go After:

emcChangePlaylist 4 StrDpWolfenCombat

Or before it? And how exactly is emcEnableBattleOverride used? Would it simply be:

emcEnableBattleOverride 1

Does anyone know if HawkleyFox is still around and supporting this plugin?
User avatar
Kayleigh Mcneil
 
Posts: 3352
Joined: Thu Jun 29, 2006 7:32 am

Post » Sun Mar 14, 2010 2:18 am

One more thing, since this is combat music and I'm trying to switch out the combat music once OnBeginCombat has begun, would I need to include emcEnableBattleOverride in there? If so, where in the script should it go? Should it go After:

emcChangePlaylist 4 StrDpWolfenCombat

Or before it? And how exactly is emcEnableBattleOverride used? Would it simply be:

emcEnableBattleOverride 1

Does anyone know if HawkleyFox is still around and supporting this plugin?


I don't think he frequents the forum very much. He has always replied fairly quick when I've pm'd him. I think that would be your best shot at getting answers.
User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am

Post » Sun Mar 14, 2010 8:01 am

Thank you aellis. I shall try that.



I don't think he frequents the forum very much. He has always replied fairly quick when I've pm'd him. I think that would be your best shot at getting answers.

User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Sun Mar 14, 2010 5:37 pm

Oh my god! I thought this thread was dead. I told the forum to email me when people post on this thread, but it didn't do it, so I assumed... Well... I guess I should just not place so much trust on technology. *reads through the thread*

Okay, Straton. Trying to make a certain track play dependant on if the player is in battle with a specific creature. Thats a little tricky, as I see you realized. You'll have to change the playlist to your special music BEFORE you engage in combat, or more specifically, before EMC starts changing to the battle playlist. Right now, I believe (IE: its been a while since I worked on this and don't know for sure anymore) if a change playlist command is issued while allready in the middle of changing the music, it will only complete AFTER the last command is completed, which means you'll get an unpleasant, fade-out-fade-in-fade-out-fade-in-again cycle before your music will play. So, I would suggest turning the battle override on whenever in an area where your Wolfen creatures can spawn to prevent EMC from changing to the battle playlist immediately when a fight begins, and when your script detects a battle is starting, check to see what creatures are comming at the player, and then proceed accordingly. If the playlist needs to be changed, do it then disable the battle override and the battle music should start playing. When battle ends, restore the override and then wait for the next battle and repeat. All this will cause a slight delay in the start of the battle music, but this is probably the least painful approach.

Anyways, looking through your code snip, you make a reasonable effort to do command failure checking, but not really enough. A playlist need only be created once, so you should not run it through more than once. Do an "emcPlaylistExists StrDpWolfenCombat" command to see if your playlist needs to be created. If it returns 0, then you should execute the emcCreatePlaylist command. Also, doesn't the OnStartCombat block only execute once? If the playlists are being switched around at the time, your music will not be played when the wolfen enters combat. Also, you should check the Wolfen's target, as its technically possible for the wolfen to be murdering innocent civilians and totally ignore the player which would still cause the music to change. It could be happening anywhere in the same cell too. The player may not even be able to hear the carnage, but still hear the music (if hes in combat).

So, those are some basic ideas and suggestions. I haven't complete mulled over everything completely but I think its all sound... Let me know if any of these ideas worked out.

I'm a little dissatisfied with the way EMC works right now. A little too complex, and some good features are still missing (or act strangely). Someday I'll probably start it over again and flesh it out better... But, until that day, I guess we'll just keep it the way it is.
User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm

Post » Sun Mar 14, 2010 6:04 pm

Thank you for the reply HawkleyFox. :)

Actually, looking at that script now I see that it NEVER would have created a new play-list (at least the way I had it set up there). It always would have returned a "1" to "if WolfenMusicFailed == 0". GAH! That's what happens when I run on too little sleep. ;

Anyway, so are you saying that I should create all of my play-lists as soon as the game is loaded up? Is there a way I can run a script every time a game is loaded? Once again I am writing with very little sleep, so if I am mis-reading or mis-stating, please forgive me. I assume we have to set up our play-lists every time a game is loaded because the play-lists are not saved with a save-game, correct?

If I am understanding everything correctly:

First, I'll need a script that runs every time the game is loaded and in that script I will need to define all of the play-lists I'll be wanting to use.

Second, I'll need to figure out a way to turn on the battle override AND change to my custom werewolf combat play-list BEFORE the player ever actually engages in combat with a werewolf. That's going to be a monster to pull off simply because you can never predict what the player might do or where they might decide to go, like suddenly changing directions to go AWAY from a combat encounter just after I've switched the music-list out and engaged the battle override. GRRRRRR. :( I'm not even sure exactly how I could do that one if I have any wandering creatures.

Third, on my werewolf's OnCombatStart I'll do the
emcChangePlaylist 4 StrDpWolfenCombat

Fourth, when the combat is over, I'll turn off the battle override and also switch back to the default Oblivion combat music with:
emcRestoreDefaultPlaylist 4

Does that sound about right?

To answer your question, "Also, doesn't the OnStartCombat block only execute once?" Yes, that is the case, unless you get far enough away from the combatant to do whatever it takes to make the engine think you both are no longer in combat, and then re-engage them once again. Obviously THEN it will execute more than once. the chances of that happening are slim, but it can happen.

"Also, you should check the Wolfen's target, as its technically possible for the wolfen to be murdering innocent civilians and totally ignore the player which would still cause the music to change. It could be happening anywhere in the same cell too. The player may not even be able to hear the carnage, but still hear the music (if hes in combat)."
Yes, I would have put a check in there to make sure the combat target was the Player. Plus, if the music type was 4, then the player would NOT hear it unless he was also in combat somewhere, right?


Anyway, please let me know if I'm on the right track here as I'd really LOVE to use this plug-in, that is, if I can figure out HOW to use it. ;)
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Sun Mar 14, 2010 4:39 am

Is it possible to add sort of a "music play-list setup" token to the Player every time a game is started or loaded? If I could do that I could then set up the play-lists that way.
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Sun Mar 14, 2010 2:25 pm

Is it possible to add sort of a "music play-list setup" token to the Player every time a game is started or loaded? If I could do that I could then set up the play-lists that way.


Well, its easy to do in a global script. :P Just make it do the checks every run... But, thats a little much... I remember that OBSE has a command that will return 1 if the game has been restarted or reloaded... But, you only have to rebuild the playlists if the game is restarted. An OnRestart code block would be useful, for certain. I suppose a system for storing the playlists with a save game would definately be appreciated in a later build of EMC. I'll have to figure out how to create references and such to keep track of it all... Never messed with script variables like that, so it might be interesting to see what happens.

There is alot of stuff I would like to do differently. But, I'll think about it the next time something draws me back to Oblivion. There is allways some mod that draws me back to this game that I have just got to try, its inevitable.
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Sun Mar 14, 2010 9:18 am

Thanks again HawkleyFox. :)

One last question:

Will i need to do a check for "emcIsMusicSwitching == 0" again before I switch the combat music back to Oblivion default (emcRestoreDefaultPlaylist 4) after the combat is over?

And if so, if emcIsMusicSwitching DID equal 1, then what would be the best way to ensure that it did indeed restore the music to default? Could I just put a condition in that continually checked for emcIsMusicSwitching to equal zero to finally restore the music to default?
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Sun Mar 14, 2010 9:37 am

Oh heck, one more question. Sorry. :(

Do you need to check for emcIsMusicSwitching == 0 before CREATING the play-list or CHANGING the play-list? I'd assume it would be before CHANGING the play-list, but assuming things has gotten me in trouble before. ;)
User avatar
Raymond J. Ramirez
 
Posts: 3390
Joined: Sun Oct 14, 2007 8:28 am

Post » Sun Mar 14, 2010 10:41 am

Okay, last one for the night. Does this look like it would work?

scn StrDpWerewolfScriptref EnemyTargetshort MusicHasSwitchedshort WolfenMusicFailedBegin OnLoad;***************************************************; BEGIN Music Playlist Setup;***************************************************	set MusicHasSwitched to 0	if ( emcPlaylistExists StrDpWolfenCombatMUS == 0 )			if (emcCreatePlaylist StrDpWolfenCombatMUS "Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3") == 0				set WolfenMusicFailed to 1			endif	endif	if ( WolfenMusicFailed == 0 && emcIsMusicSwitching == 0 )		emcCreatePlaylist StrDpWolfenCombatMUS "Data\Music\StrDeepMusic\Wolfen\WolfenCombat.mp3"	endifEndBegin OnStartCombat;***************************************************; BEGIN Music Playlist Changing;***************************************************	set EnemyTarget to GetCombatTarget	if ( EnemyTarget == player )		if ( MusicHasSwitched == 0)			if ( emcIsMusicSwitching == 0 )				set MusicHasSwitched to 1				emcEnableBattleOverride				emcChangePlaylist 4 StrDpWolfenCombatMUS			endif		endif	endifEndBegin GameMode	if ( IsInCombat == 0 );***************************************************; BEGIN Music Playlist Restore;***************************************************		if ( MusicHasSwitched == 1)			if ( emcIsMusicSwitching == 0 )				set MusicHasSwitched to 0				emcRestoreDefaultPlaylist 4				emcDisableBattleOverride			endif		endif	endifEnd


Does that look about right? And/or have I overlooked anything or left anything out or used any of the functions in the wrong way? Obviously this script would be attached to the creature. ;) Also, for the RestoreDefaultPlaylist portion of the code I'm working under the impression that a creature or NPC no longer considers itself IsInCombat == 1 once it is dead.
User avatar
Kim Kay
 
Posts: 3427
Joined: Fri Oct 13, 2006 10:45 am

Post » Sun Mar 14, 2010 4:09 pm

Well, I just tried to enter that script in the construction set and it did not seem to like it. ;) In fact, upon trying to save the script it crashes the editor every time.

I think this idea is a bit over my head, so I think I'm going to give up on it. But I do want to say thank you for trying to help me out. :D
User avatar
lolli
 
Posts: 3485
Joined: Mon Jan 01, 2007 10:42 am

Post » Sun Mar 14, 2010 4:40 am

Well, I just tried to enter that script in the construction set and it did not seem to like it. ;) In fact, upon trying to save the script it crashes the editor every time.

I think this idea is a bit over my head, so I think I'm going to give up on it. But I do want to say thank you for trying to help me out. :D


Are you using the OBSE loader for the CS? I think the correct shortcut is "obse_loader.exe -editor". I normally launch the CS from Wrye Bash, so I don't know for sure.
You probably know this, but if not, you do now. Scripts with OBSE functions and commands will not save in the CS unless the loader is used.
User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am

PreviousNext

Return to IV - Oblivion