Is Using LunaLua for custom music easy?

Need help with any SMBX game-related issues? Ask your questions here.
fireflower30
Dolphin
Dolphin
Posts: 83
Joined: Wed Sep 23, 2015 2:24 pm
Contact:

Is Using LunaLua for custom music easy?

Postby fireflower30 » Wed Feb 24, 2016 3:23 pm

Just want to know, I'm almost done with my crossover contest entry, and well, SMBX Problems.

Is there A lua?

HenryRichard
Birdo
Birdo
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: Is Using LunaLua for custom music easy?

Postby HenryRichard » Wed Feb 24, 2016 3:34 pm

It's easy, but The Thwomp King banned it from that contest.

HeroLinik
Boom Boom
Boom Boom
Posts: 3458
Joined: Fri Dec 20, 2013 1:28 pm
Contact:

Re: Is Using LunaLua for custom music easy?

Postby HeroLinik » Wed Feb 24, 2016 4:52 pm

You mean changing between custom music tracks? Yeah, there is a way to do it. The example given here changes the music based on a certain condition in the level.

Code: Select all

if(insert condition here) then
		Audio.SeizeStream(player.section);
		Audio.MusicOpen("music/your music here.mp3");
		Audio.MusicPlay();
end
To change back to the standard level music, use this:

Code: Select all

if(insert condition here) then
		Audio.ReleaseStream(player.section);
end

Alagirez
Boom Boom
Boom Boom
Posts: 3370
Joined: Tue Dec 02, 2014 2:28 am
Flair: Show your fangs!
Pronouns: He/Him/That wolf
Contact:

Re: Is Using LunaLua for custom music easy?

Postby Alagirez » Wed Feb 24, 2016 6:43 pm

Linik wrote:You mean changing between custom music tracks? Yeah, there is a way to do it. The example given here changes the music based on a certain condition in the level.

Code: Select all

if(insert condition here) then
		Audio.SeizeStream(player.section);
		Audio.MusicOpen("music/your music here.mp3");
		Audio.MusicPlay();
end
To change back to the standard level music, use this:

Code: Select all

if(insert condition here) then
		Audio.ReleaseStream(player.section);
end
I also need this code for MxW3. Thank you ^^
insert condition here
Q : what is a "condition" code in SMBX

underFlo
Reznor
Reznor
Posts: 4456
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Pronouns: They/She
Contact:

Re: Is Using LunaLua for custom music easy?

Postby underFlo » Thu Feb 25, 2016 2:06 am

It's essentially a variable that's either true or false. For example, let's say you wanna change the music if the Event "musicPlay" is activated:

Code: Select all

 play = false

function onLoop()
    if play then
       Audio.SeizeStream(player.section)
       Audio.MusicOpen("music/your music here.mp3")
       Audio.MusicPlay()
    end
end

function onEvent(eventname)
    if eventname == "musicPlay" then
        play = true
    end
end

fireflower30
Dolphin
Dolphin
Posts: 83
Joined: Wed Sep 23, 2015 2:24 pm
Contact:

Re: Is Using LunaLua for custom music easy?

Postby fireflower30 » Thu Feb 25, 2016 10:33 am

HenryRichard wrote:It's easy, but The Thwomp King banned it from that contest.
oh. i'll just use the standard underground music then

TheSaturnyoshi
Hoopster
Hoopster
Posts: 108
Joined: Tue Dec 01, 2015 9:46 am

Re: Is Using LunaLua for custom music easy?

Postby TheSaturnyoshi » Thu Feb 25, 2016 10:47 am

I don't see why you wouldn't be able to just use MP3s, those are available in vanilla SMBX.

TDK
Foo
Foo
Posts: 1426
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Is Using LunaLua for custom music easy?

Postby TDK » Thu Feb 25, 2016 11:02 am

TheSaturnyoshi wrote:I don't see why you wouldn't be able to just use MP3s, those are available in vanilla SMBX.
I think he wants to use more than one custom music per section which can't be done in vanilla SMBX.

timocomsmbx2345
Nipper
Nipper
Posts: 840
Joined: Sat Feb 06, 2016 1:44 pm
Contact:

Re: Is Using LunaLua for custom music easy?

Postby timocomsmbx2345 » Sat Feb 27, 2016 8:34 am

All you have to do is select custom on the level settings, but make sure your music is in your level and/or episode folder. Plus it has to be MP3 music.

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

Re: Is Using LunaLua for custom music easy?

Postby Enjl » Sat Feb 27, 2016 8:45 am

timocomsmbx2345 wrote:All you have to do is select custom on the level settings, but make sure your music is in your level and/or episode folder. Plus it has to be MP3 music.
I suggest you caaarefully reread the topic title.

timocomsmbx2345
Nipper
Nipper
Posts: 840
Joined: Sat Feb 06, 2016 1:44 pm
Contact:

Re: Is Using LunaLua for custom music easy?

Postby timocomsmbx2345 » Sat Feb 27, 2016 8:59 am

Enjl wrote:
timocomsmbx2345 wrote:All you have to do is select custom on the level settings, but make sure your music is in your level and/or episode folder. Plus it has to be MP3 music.
I suggest you caaarefully reread the topic title.
I use the legacy editor because it's easier.

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

Re: Is Using LunaLua for custom music easy?

Postby Enjl » Sat Feb 27, 2016 9:08 am

timocomsmbx2345 wrote:
Enjl wrote:
timocomsmbx2345 wrote:All you have to do is select custom on the level settings, but make sure your music is in your level and/or episode folder. Plus it has to be MP3 music.
I suggest you caaarefully reread the topic title.
I use the legacy editor because it's easier.
That's not the point of the topic.
First off, legacy editor literally breaks your levels by messing with placement order and priority.

Secondly, this topic is about how to use lunalua scripting to use multiple custom music files in the same section. There's no way to do that in vanilla.

Thirdly, legacy editor and lunalua aren't mutually exclusive.

h2643
Birdo
Birdo
Posts: 2890
Joined: Sat Dec 21, 2013 7:23 am
Contact:

Re: Is Using LunaLua for custom music easy?

Postby h2643 » Sat Feb 27, 2016 9:19 am

Also I have no idea how is it easier to use legacy editor when it's a pain in the ass to work in it. The new editor is so much better than that. Sorry for being off-topic, just had to.


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 2 guests