Add Your Own Music to Daggerfall Unity

Show off your mod creations or just a work in progress.
User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Add Your Own Music to Daggerfall Unity

Post by EpicSpellsword404 » Fri Dec 25, 2015 8:14 pm

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.
Last edited by EpicSpellsword404 on Sat May 14, 2016 7:25 pm, edited 3 times in total.

User avatar
Nystul
Posts: 1384
Joined: Mon Mar 23, 2015 8:31 am

Re: Add Your Own Music to Daggerfall Unity

Post by Nystul » Sun Dec 27, 2015 2:35 pm

nice! it is replacing the original music or extending?

User avatar
LypyL
Posts: 514
Joined: Sun Mar 22, 2015 3:48 am

Re: Add Your Own Music to Daggerfall Unity

Post by LypyL » Mon Dec 28, 2015 8:38 am

very cool! Keep working on it, and soon we could import music from outside the project! 8-) :D

User avatar
Interkarma
Posts: 4893
Joined: Sun Mar 22, 2015 1:51 am

Re: Add Your Own Music to Daggerfall Unity

Post by Interkarma » Tue Dec 29, 2015 4:39 am

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

User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Re: Add Your Own Music to Daggerfall Unity

Post by EpicSpellsword404 » Wed Dec 30, 2015 12:33 am

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.

User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Re: Add Your Own Music to Daggerfall Unity

Post by EpicSpellsword404 » Fri Jan 22, 2016 1:28 am

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");

User avatar
Interkarma
Posts: 4893
Joined: Sun Mar 22, 2015 1:51 am

Re: Add Your Own Music to Daggerfall Unity

Post by Interkarma » Fri Jan 22, 2016 5:06 am

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. :)

User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Re: Add Your Own Music to Daggerfall Unity

Post by EpicSpellsword404 » Mon Jan 25, 2016 11:41 pm

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
Last edited by EpicSpellsword404 on Sun May 08, 2016 11:02 pm, edited 3 times in total.

User avatar
LypyL
Posts: 514
Joined: Sun Mar 22, 2015 3:48 am

Re: Add Your Own Music to Daggerfall Unity

Post by LypyL » Wed Jan 27, 2016 9:22 am

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

User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Re: Add Your Own Music to Daggerfall Unity

Post by EpicSpellsword404 » Wed Jan 27, 2016 10:49 pm

Adding comment asap. What exactly do you mean by from the disk?

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

Post Reply