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 »

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: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Add Your Own Music to Daggerfall Unity

Post by Nystul »

nice! it is replacing the original music or extending?

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

Re: Add Your Own Music to Daggerfall Unity

Post by LypyL »

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

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

Re: Add Your Own Music to Daggerfall Unity

Post 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

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

Re: Add Your Own Music to Daggerfall Unity

Post 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.

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

Re: Add Your Own Music to Daggerfall Unity

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

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

Re: Add Your Own Music to Daggerfall Unity

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

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

Re: Add Your Own Music to Daggerfall Unity

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

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

Re: Add Your Own Music to Daggerfall Unity

Post 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

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

Re: Add Your Own Music to Daggerfall Unity

Post 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*

Post Reply