How to change custom music in events?

General discussion about Super Mario Bros. X.
User avatar
SuperSpaceMan230
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Nov 05, 2016 4:24 pm

How to change custom music in events?

Postby SuperSpaceMan230 » Sun Sep 08, 2019 5:15 pm

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?
Image

Image

Kirby's jam of the week


User avatar
1di_Scroll
Mouser
Mouser
Posts: 1872
Joined: Fri Apr 20, 2018 9:28 pm
Flair: C'est la vie... profitez-en!
Contact:

Re: How to change custom music in events?

Postby 1di_Scroll » Sun Sep 08, 2019 5:34 pm

You mean changing from a custom song to another custom song via events?

User avatar
Electriking
Posts: 4489
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Contact:

Re: How to change custom music in events?

Postby Electriking » 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.
SMM2 ID: JJF-P7G-FSF

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2846
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: How to change custom music in events?

Postby HenryRichard » Wed Sep 11, 2019 11:18 am

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.
Jesus is my savior.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8741
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How to change custom music in events?

Postby Enjl » Wed Sep 11, 2019 12:02 pm

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.
Ideas are useless if you can't make them real.
Image


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests