Page 1 of 4

Add Your Own Music to Daggerfall Unity

Posted: Fri Dec 25, 2015 8:14 pm
by EpicSpellsword404
https://drive.google.com/open?id=0Bx8-- ... nhHakN6czg

Just put the script in your assets folder, attach it to an audiosource, and add the songs. Hope you like it. I highly recommend doing this with Dan Goondale's remixes.

Edit: This link will always be up to date.

Re: Add Your Own Music to Daggerfall Unity

Posted: Sun Dec 27, 2015 2:35 pm
by Nystul
nice! it is replacing the original music or extending?

Re: Add Your Own Music to Daggerfall Unity

Posted: Mon Dec 28, 2015 8:38 am
by LypyL
very cool! Keep working on it, and soon we could import music from outside the project! 8-) :D

Re: Add Your Own Music to Daggerfall Unity

Posted: Tue Dec 29, 2015 4:39 am
by Interkarma
Great work! At some point we should collaborate to allow users to replace their default MIDI songs from an external source (same concept as texture replacements).

BTW, I love Dan Goodale's remixes as well. :D

Re: Add Your Own Music to Daggerfall Unity

Posted: Wed Dec 30, 2015 12:33 am
by EpicSpellsword404
I'm not much of a scripter, I just replaced DaggerfallSongPlayer with AudioSource and sort of bludgeoned the errors to death. I probably won't add any more functionality to this. Thanks anyway.

Re: Add Your Own Music to Daggerfall Unity

Posted: Fri Jan 22, 2016 1:28 am
by EpicSpellsword404
Okay, I decided to keep working on this. I've been trying to add the ablility to load music from the resources folder so that you could potentially add music without editing any scenes. The problem is I'm using Resources.LoadAll() to load the files, but when I try to cast the array to an AudioClip[], it gives me an invalid cast exception. Removing the cast didn't work either. Does anybody know of a solution?

Code: Select all

CityDaySongs = (AudioClip[]) Resources.LoadAll ("Music/CityDaySongs");

Re: Add Your Own Music to Daggerfall Unity

Posted: Fri Jan 22, 2016 5:06 am
by Interkarma
I'm not in a position to test right now, but try something like:

Code: Select all

AudioClip[] clips = Resources.LoadAll<AudioClip>(path);
Use debugger to check that clips is actually populated (non-null, non-zero) and go from there. Let me know how you go, and I'll help if I can. :)

Re: Add Your Own Music to Daggerfall Unity

Posted: Mon Jan 25, 2016 11:41 pm
by EpicSpellsword404
Thanks a lot for the help! I appreciate it.

Alright, here it is! Just make the appropriate folders in Assets/Resources, put the music files in, and send your ears to heaven!
(weird metaphor :?)
https://drive.google.com/file/d/0Bx8--6 ... sp=sharing
Edit: Updated Link

Re: Add Your Own Music to Daggerfall Unity

Posted: Wed Jan 27, 2016 9:22 am
by LypyL
Nice! You might want to include a comment with the instructions about making the folders (it might not be obvious what you're talking about).

You should keep going and make it so it can load music files from the disk :D

Re: Add Your Own Music to Daggerfall Unity

Posted: Wed Jan 27, 2016 10:49 pm
by EpicSpellsword404
Adding comment asap. What exactly do you mean by from the disk?

Edit: Link is now up to date with rudimentary readme file.
*fanfare*