custom music

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

custom music

Post 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...
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: custom music

Post 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.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: custom music

Post 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?
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: custom music

Post by THOM »

Soundfiles have to be in WAV format for sound effects in the game. And have to be OGG files for ambientmusic.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: custom music

Post 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?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: custom music

Post by Dr.Disaster »

Yes you do.
Isaac made that clear in his post following the one i linked to.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: custom music

Post 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
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: custom music

Post by Dr.Disaster »

Try this

Code: Select all

defineAmbientTrack{
   name = "boss_hassen_1",
   filename = "mod_assets/sounds/boss_hassen_1.ogg",
   volume = 1,
}
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: custom music

Post 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
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: custom music

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