Page 1 of 2
custom music
Posted: Fri Oct 30, 2015 11:35 am
by FeMaiden
I noticed some mods have custom music files in them.
like Dungeon of Venomous Vines in steam workshop
has bossfight musics from binding of isaac, from final fantasy, and other games.
the author even scripted the "final" boss battle to have traps that spawn in time with the music
I don't think I will go that far, but
how would I put a custom boss music in my mod?
what is the file format?
I guess In my bossfight activation code I would put
Code: Select all
boss_fight_1.bossfight:setMusic(filename)
but what format does it have to be? can I use an mp3 file?
is there a file size limit, like it has to be under 60 seconds or something?
I'm looking for the music files in the grimrock 2 assets, and i can't find them, however, I see a .lua file in there called "ambient_tracks"
and in there it seems to call up files with the .ogg suffix....I've never even of that suffix...
Re: custom music
Posted: Fri Oct 30, 2015 11:46 am
by Dr.Disaster
Custom music has to be 44.1kHz stereo in OGG Vorbis format.
These files are rather small so there is no need to be concered about size and i'm pretty sure there is no length limit to playtime.
Regarding choosing custom music for a boss fight Isaac already ironed this out
here.
Re: custom music
Posted: Fri Oct 30, 2015 1:06 pm
by FeMaiden
Dr.Disaster wrote:Custom music has to be 44.1kHz stereo in OGG Vorbis format.
These files are rather small so there is no need to be concered about size and i'm pretty sure there is no length limit to playtime.
Regarding choosing custom music for a boss fight Isaac already ironed this out
here.
how come, in the code isaac posted in that link, the file he defined was in .wav format?
Re: custom music
Posted: Fri Oct 30, 2015 1:11 pm
by THOM
Soundfiles have to be in WAV format for sound effects in the game. And have to be OGG files for ambientmusic.
Re: custom music
Posted: Fri Oct 30, 2015 1:23 pm
by FeMaiden
what about the "bitrate" what should that be set at?
also, the thing is that post you linked to is to define sounds in the sounds.lua
I want to define an ambient track.
I looked in the main game assets pack and theres a lua file called ambient_tracks
but in the mod assets, that file does not exist.
do I define the ambient tracks in the sounds.lua?
Re: custom music
Posted: Fri Oct 30, 2015 1:45 pm
by Dr.Disaster
Yes you do.
Isaac made that clear in his post following the one i linked to.
Re: custom music
Posted: Fri Oct 30, 2015 1:52 pm
by FeMaiden
well I put this in my sounds.lua
Code: Select all
defineAmbientTrack{
name = "boss_hassen_1",
filename = "mos_assets/sounds/boss_hassen_1.ogg",
loop = true
volume = 1,
}
and when i try to open my project it says
mod_assets/scripts/sounds.lua:9: ' } ' excpected ( to close ' { ' at line 5) near ' volume '
I dunno what i did wrong since I actually copy pasted this from the grimrock assets pack and only changed the name of the file and the file path
Re: custom music
Posted: Fri Oct 30, 2015 1:59 pm
by Dr.Disaster
Try this
Code: Select all
defineAmbientTrack{
name = "boss_hassen_1",
filename = "mod_assets/sounds/boss_hassen_1.ogg",
volume = 1,
}
Re: custom music
Posted: Fri Oct 30, 2015 1:59 pm
by FeMaiden
edit, I fixed that, there was a comma missing after loop = true.
i also fixed the typo "mod_assets"
now I can open my dungeon but when i step on the boss trigger, the editor just freezes and I have to force quit from task manager.
this happened the last time when i was trying to set images and they were in the wrong format.
did I use the wrong formatting on my ogg file?
I changed the sampling rate to 44100 hz
the audio channels to stereo
and the audio bitrate I had "no change" (i'm using an online conversion website, so this must be using the default bitrate and i don't know what it is or what i need to set it at)
oh, was I not supposed to have the "loop" there?
I thought i needed that to make the music loop
Re: custom music
Posted: Fri Oct 30, 2015 2:04 pm
by FeMaiden
I removed the "loop = true" and now it's working, thank you for being patient with me lol.
i'm gonna put a credit to each one of you guys at the end of my mod