How to change custom music in events?

General discussion about Super Mario Bros. X.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on-topic/appropriate?
-Are you posting in the right forum/following the forum rules?
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
Scroll
Boom Boom
Boom Boom
Posts: 1766
Joined: Fri Apr 20, 2018 9:28 pm
Flair: Happy new decade
Current Project: Rosalina's Satellite (yet again)
Chat Username: Scroll#6292
Contact:

Re: How to change custom music in events?

Postby 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: 4352
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Current Project: Something
Chat Username: ElectriKing
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: 2845
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.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7709
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.
ImageImageImageImage
ImageImageImageImageImageImage


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests