The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

[AB+] Music Mod Callback
Taz  [pengembang] 11 Jun 2019 @ 11:16am
Examples
I'll add some example here to give you a general idea of what it can do.
< >
Menampilkan 1-4 dari 4 komentar
Taz  [pengembang] 11 Jun 2019 @ 11:24am 
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.
Terakhir diedit oleh Taz; 30 Mei 2021 @ 2:48am
Taz  [pengembang] 13 Jun 2019 @ 6:08am 
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.
Terakhir diedit oleh Taz; 13 Jun 2019 @ 6:08am
Taz  [pengembang] 20 Jun 2019 @ 3:44am 
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  [pengembang] 20 Jun 2019 @ 3:47am 
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?
< >
Menampilkan 1-4 dari 4 komentar
Per halaman: 1530 50