[RELz, BETA] Enhanced Music Control

Post » Sun Mar 14, 2010 2:50 am

Everything below the "Am I in a cave?" printing line will only get executed if "emcIsMusicSwitching" is something else than "0" due to the interfering "endif -- elseif" combinations at the end and beginning of each location check. I think you intended those checks to be all run one after the other, so "elseif" is definitely wrong there. If "elseif" indeed was intended to be there though, the "endif"s before each "elseif" must vanish.

As I can't make a sense of the "printc"s when the "elseif"s are intended, I think this is the script you intended:

Ah, thanks. You're right of course, my intention was for them all to be if-checks. I'd just gone a bit code-blind, seeing the code I intended to have put there instead of the code that was actually there ;)

The ".location" checks though could be done with "elseif"s, this would also speed up processing, but then at least the "Am I in a town?" line would be far out of place where it is.

I had thought to get around to writing good code after I made some more sense of the EMC controls, but then again, as I've learned from other projects, it is better to write the code as well as I can manage the first go. That whole idea that I'll come back to write it up properly later rarely comes through. I got some confusing results because I misunderstood the way that You Are Here's isForest worked, so I think I should do a player.isininterior if/else check first of all, then do if/elseif inside each of those blocks for the various locations I can detect. I am pondering a hierarchy like Location -> Time of Day -> Weather -> Activity. Where activity would be something like Explore/Battle/Trespass at least.

But, I shouldn't hijack the thread. If anyone's got good advice/ideas for how to handle this, please post them in http://www.gamesas.com/index.php?showtopic=894068.

In regards to EMC itself, I've found some oddities. When I'm creating a playlist using *.mp3, it does not always find all the mp3-files in the folder. And it seems the length of the Playlist name string is limited to 8 chars. At least, when I tried to save a script which created two playlists whose names were not distinct until the 9th char, the CS consistently crashed. But once I changed the name-strings so that they were distinct before the 9th char, there was no more problem.

Oh, and in regards to that whole string-debacle, OBSE obviously has some sort of string-handling system, but can I declare and set string-variables in my scripts? It would make the discussed code a lot easier to read and maintain.

Also, isn't there some way for one script to call another?

Sorry, I'm getting carried away with the questions again. It's just that I started scripting Oblivion only yesterday and it's kinda tricky to track down the answers to some of these questions through the wiki. Again, anyone feeling charitable and willing to help, please do post in http://www.gamesas.com/index.php?showtopic=894068.

EDIT: Typo
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Post » Sun Mar 14, 2010 1:15 am

Update about the problem with creating a playlist using *.mp3. It consistently ignores one file in the folder. i.e. if there's one file in the folder, the playlist creation will fail, if there's two, the playlist is created with one file, if there's three, created with two files, etc.
I suddenly realize I should've checked whether it always ignores the same file, or whether it's random.
However, I also realize that I should get to bed, I's gots algorithms I has to handle tomorrows.

P.S. After Drake's help, there were no other problems with the code, so I'm all set to get down to business as soon as I can get away from the more pressing business of my actual business.
User avatar
Lew.p
 
Posts: 3430
Joined: Thu Jun 07, 2007 5:31 pm

Post » Sun Mar 14, 2010 11:20 am

Just checking in to see if this plugin .dll is going to be corrected, updated, and released.
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Sun Mar 14, 2010 11:44 am

I've finally gotten to it and released an updated version that fixes many of the problems reported here. Here is the change log:

0.71 -
Fixes the problem where the Explore playlist was not randomizing.
Fixes the problem where one file is always missing from the playlists.
Fixes a problem where directories and non-files could be added to a playlist. This would not actually cause a noticable problem, but it could result in the creation of an empty playlist, which would be a problem.

Grab it at the download link on the original post.
User avatar
El Goose
 
Posts: 3368
Joined: Sun Dec 02, 2007 12:02 am

Post » Sun Mar 14, 2010 6:07 am

I've finally gotten to it and released an updated version that fixes many of the problems reported here. Here is the change log:

0.71 -
Fixes the problem where the Explore playlist was not randomizing.
Fixes the problem where one file is always missing from the playlists.
Fixes a problem where directories and non-files could be added to a playlist. This would not actually cause a noticable problem, but it could result in the creation of an empty playlist, which would be a problem.

Grab it at the download link on the original post.


WOOT!!! That was quick! TYTYTYTYTY
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Sun Mar 14, 2010 6:29 am

I've finally gotten to it and released an updated version that fixes many of the problems reported here. Here is the change log:

0.71 -
Fixes the problem where the Explore playlist was not randomizing.
Fixes the problem where one file is always missing from the playlists.
Fixes a problem where directories and non-files could be added to a playlist. This would not actually cause a noticable problem, but it could result in the creation of an empty playlist, which would be a problem.

Grab it at the download link on the original post.


Many times thank you! :P :clap: :dancing:
(I'd give you an egg, but there's no icon for it :wacko: )
Personally, I'm not terribly interested in splitting up playlists into many tiny little categories ... that's way more complicated than it needs to be. What I would like to see is the ability to designate a unique playlist for each savegame.... I run numerous savegame profiles, and each character is quite different--and since music sets the mood and tone for gameplay, it would be nice to pick specific tracks (maybe in a separate directory, like Wryebash stores the profiles) for each PC.
But RL must always come first ... with the best of luck, we'll see you on the flip side. :) :
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Sun Mar 14, 2010 4:25 pm

Sorry this is kinda off topic but I, for some reason, cannot post normally or make my own threads and have to use fastreply so my postings and questions have become rather... parasitic, recently.

Would it be possible to divide music even further by region? Beyond just "Explore, City, Dungeon" etc.? Because I've found some music that would go nice in the snowy areas by Bruma and the Mages Tower DLC. Just curious, thanks!
User avatar
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am

Post » Sun Mar 14, 2010 2:38 pm

I've finally gotten to it and released an updated version that fixes many of the problems reported here. Here is the change log:

0.71 -
Fixes the problem where the Explore playlist was not randomizing.
Fixes the problem where one file is always missing from the playlists.
Fixes a problem where directories and non-files could be added to a playlist. This would not actually cause a noticable problem, but it could result in the creation of an empty playlist, which would be a problem.

Grab it at the download link on the original post.

Sweet! Thanks a lot for fixing what small errors there were. As a repayment, I will try my best to find something else to complain about :P
Alright, that seems unlikely. I've been using this mod for a few months now and the missing file and non-random Explore are actually the only issues I've been able to track down. It really has been a shockingly smooth ride. Far too few mods work this well: download, copy to folder, start up game and enjoy, with no conflicts or errors. :D

Sorry this is kinda off topic but I, for some reason, cannot post normally or make my own threads and have to use fastreply so my postings and questions have become rather... parasitic, recently.

You're not using any sort of script-blocker, are you?

Would it be possible to divide music even further by region? Beyond just "Explore, City, Dungeon" etc.? Because I've found some music that would go nice in the snowy areas by Bruma and the Mages Tower DLC. Just curious, thanks!

This is not exactly what I'm planning to do in my to-be(-hopefully)-completed mod http://www.gamesas.com/bgsforums/index.php?showtopic=894068&st=0, but it is similar, so I thought I'd do a bit of advertising. It's not likely to get out before christmas, due to exams up the wazoo and of course christmas itself, but the more people seem interested, the more likely it is my conscience will prod me into finishing it during the christmas holiday ;)
User avatar
HARDHEAD
 
Posts: 3499
Joined: Sun Aug 19, 2007 5:49 am

Post » Sun Mar 14, 2010 4:44 am

What I would like to see is the ability to designate a unique playlist for each savegame.... I run numerous savegame profiles, and each character is quite different--and since music sets the mood and tone for gameplay, it would be nice to pick specific tracks (maybe in a separate directory, like Wryebash stores the profiles) for each PC.


Thats an interesting idea... Well, not exactly the same as your's, but it might be just as good. A plugin that anolyses the character's stats, skills, and fame/infamy, then make a musical playlist selection based upon it. A famed knight (physically combat skilled with high strength stats) would have a glorious musical accompaniment, and an infamous necromancer would have dark and mystical musical selection (and a choir chorus in every battle track)... Stuff like that... Would be interesting to witness the music change from friendly adventurer to adventurer murderer as you played the game. xD I almost want to try and do it myself...

EDIT: And now I am. I didn't think I'd actually make a mod using my own plugin, but lo', here I go! Allready got a nice Excel spreadsheet with all the algorithms for classifying a character's class and alignment. As I planned the mod, I've also found several needed changes that EMC requires to make it all possible. Look at the end of the post to see all the planned enhancements. PS: Thanks for the inspiration daemondarque.

Only issue, I suppose, is that would be quite a change, and any other EMC powered plugin would probably be made incompatible (since it might try to restore the default playlists, or something). But, like I said, you'd probably have to handpick and choose such plugins anyways, because it is very hard to make two music plugins work together.

Also, out of slight curiosity, I looked around in EMC's code and found that it would be easy to impliment a "disable/enable battle music" command. This wouldn't make it so there is no music during the battle, but just prevent Battle music from playing, so the Explore, Public, and Dungeon tracks would continue to play instead of being interupted by the combat music all the time. You could then manage when and how battle music starts playing. Would there be any interest in such functionality? EDIT: Nevermind. I added it anyways just for the hell of it all.

MORE EDIT:
Okay, so I'm developing EMC again... A little bit... Nothing hard core like before. I'm not staring at a disassembler and writing down addresses and manually tracing through code this time (thank god). But, in planning this mod of mine, I have noticed some needed enhancements that EMC requires to make complex music mods possible. These will be included in the next version of EMC:

I added the "disable/enable battle music" commands described above, just for fun (it was too easy not to do).

Another planned enhancement is a "delayed playlist swap" feature. This will allow you to queue up a playlist swap. Instead of swapping immediately, interupting the current track, and then starting up a new one, it will instead wait for the current track to stop playing before it performs a swap (provided the track is playing from the playlist that needs to be swapped). This will allow more seamless changes to the music. For instance, if you wanted to make a playlist change from a daytime playlist to a nighttime playlist, you don't neccessarily want the current track to suddenly stop playing (day to night transitions are slow anyways). It will cause a break in the atmosphere, and thats one thing music should not be responsible for!

I've added multiple path support for playlists. You can now specify more than one path a playlist can load from. This can make complex list building behaviors possible. Now you can provide several directories full of music and build lists based on complicated algorithms. This alters the CreatePlaylist command to accept a multi-path syntax in it's path parameter. I've also created an AddPathToPlaylist command so you can add new paths to existing playlists. You must already think I'm insane for offering all these enhancements! But wait! There's more! I'm throwing in a RecreatePlaylist command that will clear and rebuild a playlist based on the paths handed to it at no extra charge. Finally, the ability to alter existing playlists is yours. (Offer not valid for default playlists. Commands subject to rules and restrictions. You must be level 18 or older to download.)

I think Setsuei will thank me for this, especially for the last one. Looking at his proposed mod (http://www.gamesas.com/bgsforums/index.php?showtopic=894068&st=0), without the capability to modify lists or use multiple paths, he'd probably need over a hundred individual playlists to perform the complex things he wanted to accomplish. Now, a "front buffer/back buffer" system can be used that will reduce the amount of lists required substantially (at the cost of a slightly more complex script). In the planning of my Character Based Music System mod, I found I would need a total of 180 playlists to do what I wanted. Yeah... No... With the ability to modify playlists, it was compressed down to 12 (6 playlists per buffer).

Anyways, regarding that mod of mine, I'll make a formal announcement about it when I think its ready. I just hope there will be content providers who will support it.

This became a huge post... Sorry, but I'm not gonna double post.
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am

Post » Sun Mar 14, 2010 3:21 pm

This is one of those mods that you really really wish was being developed and used more fully. I do anyway.

Another one is: http://www.tesnexus.com/downloads/file.php?id=17050

Frostcrag Reborn seems to utilize this. That is a start.
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Sun Mar 14, 2010 4:50 pm

A bug report - An interesting one at the least. Whenever you lower your music volume to a value below 10/15 ( or mute it ), there's a performance during menuMode. I know it sounds funny, but I'd confirmed it.
User avatar
abi
 
Posts: 3405
Joined: Sat Nov 11, 2006 7:17 am

Post » Sun Mar 14, 2010 4:30 am

What do you mean by performance in menu mode? Performance drop? Performance of music. Details please.

I've been having this weird bug where just going into my inventory (tab) is causing a ctd. Perhaps related.

thanks
User avatar
Lavender Brown
 
Posts: 3448
Joined: Tue Jul 25, 2006 9:37 am

Post » Sun Mar 14, 2010 3:17 pm

What do you mean by performance in menu mode? Performance drop? Performance of music. Details please.

I've been having this weird bug where just going into my inventory (tab) is causing a ctd. Perhaps related.

thanks

Whoops ... looks like I missed a few words. I was going to say performance hit. For instance, from a framerate of 40, it drops to < 20 FPS as soon as I enter menuMode.
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Sun Mar 14, 2010 11:13 am

OK when you say menu mode - do you mean game menu or inventory?

When you say 10/15 what does that mean in terms of the slider bars? Is this only master volume?

Are you talking about the most current version of this? I got mine from Frostcrag Reborn 3.0.1.

I guess I need to test this too.

thanks
User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Sun Mar 14, 2010 12:34 pm

OK when you say menu mode - do you mean game menu or inventory?

When you say 10/15 what does that mean in terms of the slider bars? Is this only master volume?

Are you talking about the most current version of this? I got mine from Frostcrag Reborn 3.0.1.

. When I say http://cs.elderscrolls.com/constwiki/index.php/MenuMode, I meant all menus ( when game time doesn't pass | except maybe the Pause menu [Esc] ). More so when in dialog.
. Talking about the Music volume slider, alone.
. The latest version there is - 0.72

I don't use it anymore, because of this.
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Sun Mar 14, 2010 2:41 pm

Well I've not been able to replicate the menu drop in FPS. Took the music volume down to 10 and did many menu things.

Still getting occasional ctds on accessing tab/inventory though - and that happens no matter music level and more so when outdoors.
User avatar
Tessa Mullins
 
Posts: 3354
Joined: Mon Oct 22, 2007 5:17 am

Post » Sun Mar 14, 2010 4:30 am

hawkleyfox you're the best :D this mod is so good :D
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Sun Mar 14, 2010 10:42 am

which commands do you have to use to make a certain music play in an interior when you enter and to resume default playlist when you exit?
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Sun Mar 14, 2010 3:36 am

which commands do you have to use to make a certain music play in an interior when you enter and to resume default playlist when you exit?

maybe this snipped from 'Frostcrag Reborn' helps
for details check the EMC readme/doc
if player.GetInCell FRAvalon  == 1	if bPlayCustom < 1 || GetGameLoaded == 1		if [b]emcCreatePlaylist "avalon" "data\music\frostcrag\*.*"[/b]			[b]emcChangePlaylist 2  "avalon"[/b]			set bPlayCustom to 1			set bPlayDefault to 0		else			[b]emcRestoreDefaultPlaylist  2[/b]		endif	endifelse	if bPlayDefault < 1		[b]emcRestoreDefaultPlaylist  -1[/b]		set bPlayCustom to 0		set bPlayDefault to 1	endifendif

User avatar
Gwen
 
Posts: 3367
Joined: Sun Apr 01, 2007 3:34 am

Post » Sun Mar 14, 2010 11:49 am

this : *.* is the song title?

and do I attach this to a door? or I have to place it somewhere else?
User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Sun Mar 14, 2010 5:42 am

this : *.* is the song title?

and do I attach this to a door? or I have to place it somewhere else?


*.* is all the songs you have in the directory.
If you want a specific song, and only that song to play, you want to use the http://cs.elderscrolls.com/constwiki/index.php/StreamMusic.

StreamMusic and EMC are scripted functions. You do not attach to anything.

Your script will need to check whether the PC is in the particular area or building or cave or whereever you want the specific playlist or song to begin.
A modders resource - http://tesnexus.com/downloads/file.php?id=18160 is needed.
User avatar
LuCY sCoTT
 
Posts: 3410
Joined: Sun Feb 04, 2007 8:29 am

Post » Sun Mar 14, 2010 1:51 pm

Awesome mod! Thank you for it.
User avatar
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm

Post » Sun Mar 14, 2010 6:38 am

I thought I could attach the script to play the music to the door so that as soon as you activate it the music starts playing.

isn't streammusic bugged?

I also want to add specific battle music to specific battles, any insight on how I could do that?
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Sun Mar 14, 2010 12:38 pm

I thought I could attach the script to play the music to the door so that as soon as you activate it the music starts playing.
If you use EMC you dont need to watch door usages. Just scan if the player is in the cell (see script snippet above).
If you go for StreamMusic, well thats another story :(

isn't streammusic bugged?
So to speak.
Enabling a custom track seems to work pretty well though. The big problem is to disable it (needs *some* workaround) or to switch to a different custom track in a consistent way ("almost" impossible).

I also want to add specific battle music to specific battles, any insight on how I could do that?
Should not be a problem with EMC:
According to the 'EMC Command List.txt' all you need is define a playlist for your desired battle tracks and set the extended music type to the respective value before the playlist call ;)
User avatar
Racheal Robertson
 
Posts: 3370
Joined: Thu Aug 16, 2007 6:03 pm

Post » Sun Mar 14, 2010 2:12 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?
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

PreviousNext

Return to IV - Oblivion