The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

[AB+] Music Mod Callback
Taz  [desarrollador] 11 JUN 2019 a las 11:16
Examples
I'll add some example here to give you a general idea of what it can do.
< >
Mostrando 1-4 de 4 comentarios
Taz  [desarrollador] 11 JUN 2019 a las 11:24 
Callbacks are added like so:
MMC.AddMusicCallback(MyMusicMod, function(self, trackId) -- self can be ignored. -- trackId is the track's Id number. return 0 -- You must return what track you would like to play instead, or 0 if you want to prevent the new track and continue the current one, -1 to stop all music or nil to do nothing. end, requiredTrack)
requiredTrack must be a music ID or nil. If it exists, then your callback is only triggered on that specific ID.


MMC.AddMusicCallback(MyMusicMod, function() return Music.MUSIC_CELLAR end)
Literally everything is just the cellar. You will never hear anything else.

MMC.AddMusicCallback(MyMusicMod, function() return Music.MUSIC_CELLAR end, Music.MUSIC_BASEMENT)
Replaces the basement with the cellar.

MMC.AddMusicCallback(MyMusicMod, function(self, trackId) if trackId == Music.MUSIC_BASEMENT then return Music.MUSIC_CELLAR end end)
Replaces the basement with the cellar again, using an if statement instead of a required track.
You can also make it like this:
MyMusicMod:MusicCallFn(trackId) if trackId == Music.MUSIC_BASEMENT then return Music.MUSIC_CELLAR end end MMC.AddMusicCallback(MyMusicMod, MyMusicMod.MusicCallFn)

MMC.AddMusicCallback(MyMusicMod, function() if Game():GetRoom():HasWater() then return Music.MUSIC_FLOODED_CAVES end end)
Every time there's water in the room, flooded caves music.

local mybangertuneid = Isaac.GetMusicIdByName("1 2 Oatmeal") MMC.AddMusicCallback(MyMusicMod, function() if Game():GetLevel():GetStage() == LevelStage.STAGE2_1 then return mybangertuneid end end, Music.MUSIC_ARCADE_ROOM)
If you're on the second floor, be it Basement II or Cellar II or Burning Basement II then the arcade room music is replaced with custom music.
Última edición por Taz; 30 MAY 2021 a las 2:48
Taz  [desarrollador] 13 JUN 2019 a las 6:08 
MMC.AddMusicCallback(MyMusicMod, function() return MMC.GetBossTrack() end, Music.MUSIC_JINGLE_BOSS)
The boss music starts at the VS boss screen rather than after the jingle.
Última edición por Taz; 13 JUN 2019 a las 6:08
Taz  [desarrollador] 20 JUN 2019 a las 3:44 
local myMusicMod = RegisterMod("My Music Mod",1) MMC.AddMusicCallback(myMusicMod, function() if Game():GetRoom():GetType() == RoomType.ROOM_DEFAULT then return Music.MUSIC_BASEMENT end end, Music.MUSIC_SATAN_BOSS) function playSatanMusic() local musicmgr = MMC.Manager() musicmgr:Crossfade(Music.MUSIC_SATAN_BOSS) end
MMC.Manager calls all callbacks, so whenever playSatanMusic() is called, then the music will be switched to the basement when in a normal room.
Taz  [desarrollador] 20 JUN 2019 a las 3:47 
MMC.AddMusicCallback(MyMusicMod, function() if Game():GetRoom():GetBossID() == 55 then return Music.MUSIC_HUSH_BOSS end end, Music.MUSIC_SATAN_BOSS)
Mega Satan needs a better theme than the crusty reused one he gets from Satan. How about Hush's theme?
< >
Mostrando 1-4 de 4 comentarios
Por página: 1530 50