Page 1 of 1
How to change custom music in events?
Posted: Sun Sep 08, 2019 5:15 pm
by SuperSpaceMan230
Im trying to make an event where the music changes in one part, but i cant change to other custom music, it just doesnt show me something to add the custom music,anyone knows how to add custom music?

Re: How to change custom music in events?
Posted: Sun Sep 08, 2019 5:34 pm
by TheNightingale
You mean changing from a custom song to another custom song via events?
Re: How to change custom music in events?
Posted: Sun Sep 08, 2019 5:43 pm
by ElectriKong
You can only have one custom music per section. You will have to replace default music with a music.ini file to use more.
Re: How to change custom music in events?
Posted: Wed Sep 11, 2019 11:18 am
by HenryRichard
You could also use Lua in SMBX2 (you'll need the PAL version) - this example code should start playing a music file called "boss-music.ogg" in player 1's section when an event called "Start Boss Music" is triggered:
Code: Select all
function onEvent(eventName)
if(eventName == "Start Boss Music") then
Audio.MusicChange(player.section, "boss-music.ogg")
end
end
If you'd like to learn more LunaLua Enjl has some good tutorials on it
here.
EDIT: I can't seem to get the code to format correctly (it's supposed to be 5 lines, not one), so it looks more complicated than it is. Sorry about that - it should still work properly though.
Re: How to change custom music in events?
Posted: Wed Sep 11, 2019 12:02 pm
by Enjl
HenryRichard wrote: ↑Wed Sep 11, 2019 11:18 am
EDIT: I can't seem to get the code to format correctly (it's supposed to be 5 lines, not one), so it looks more complicated than it is. Sorry about that - it should still work properly though.
It looks fine on the prosilver theme. The SMBX forum theme has been busted for a year or so regarding the code block. I've resorted to just not using it and ditching indenting in favour of multiple lines.
Re: How to change custom music in events?
Posted: Mon Feb 28, 2022 7:59 pm
by ExpressionlessBA747
ElectriKing wrote: ↑Sun Sep 08, 2019 5:43 pm
You can only have one custom music per section. You will have to replace default music with a music.ini file to use more.
How is this Works?
Re: How to change custom music in events?
Posted: Tue Mar 01, 2022 7:00 am
by deice
go to data/_templates and open music.ini for an example.
Re: How to change custom music in events?
Posted: Tue Mar 01, 2022 9:00 am
by ExpressionlessBA747
deice wrote: ↑Tue Mar 01, 2022 7:00 am
go to data/_templates and open music.ini for an example.
i put the file level inside or out of the file level to make it work?
Re: How to change custom music in events?
Posted: Tue Mar 01, 2022 12:14 pm
by deice
ExpressionlessBA747 wrote: ↑Tue Mar 01, 2022 9:00 am
i put the file level inside or out of the file level to make it work?
that depends. it functions the same as custom graphics, so, if you place your music.ini in your episode folder it will replace the given songs across the whole episode, whereas putting it inside a level folder will replace them just for that level.