Page 1 of 1
World Selector with Progressively Changing Music
Posted: Wed Mar 23, 2022 10:33 am
by KurttheKing
Here we go, Post 2. I've seen a world map selector in Super Mario & the Ancient Stars. How can I make one, that has different music every time I complete a world? For example, I complete the Second World, and the music gets another beat playing in the background
https://i.ytimg.com/vi/1BBoEhHOUTk/mqdefault.jpg
This is the one I found in SM & TAS
Re: World Selector with Progressively Changing Music
Posted: Wed Mar 23, 2022 12:56 pm
by deice
you'd have to keep track of completed worlds in savedata, and then use something like
jukebox.lua to check and play the correct music.
you might be able to do it in vanilla as well but you'd have to override a decent chunk of the overworld music and then make several identical copies of the world selector each with different music playing, which would be quite unwieldy and limiting (for example, all the worlds would have to be completed in a set order). if you aren't familiar with how to use lua, a decent (but potentially slightly outdated) set of tutorials can be found
here (for the basics) and
here (for the rest).
Re: World Selector with Progressively Changing Music
Posted: Wed Mar 23, 2022 3:30 pm
by KurttheKing
Yeah, I'm completely new to using Lunalua. Never once have I tried using it. I'm not much of a coder, so I wouldn't know what exactly to do. I will watch as many tutorials as I can find for help on Lunalua, but all I need to know is how to make a Jukebox change the song it plays. Shouldn't be too hard. I'll try to figure out how to keep track of savedata, that should help. I'll update if things work
Re: World Selector with Progressively Changing Music
Posted: Tue Mar 29, 2022 6:24 pm
by AlanLive2020
I'm kinda of bad at lua, but I'm assuming you could change the music via lua based on how many power stars you have by getting the value of SaveData.starCount (not sure if that's the name of the variable) and changing the music with each star you get. Not sure how to change the music with lua yet. Idk if it would work the same on the world map either. I'm guessing it would also be a bit harder to do if it's custom music.
Re: World Selector with Progressively Changing Music
Posted: Tue Mar 29, 2022 8:30 pm
by Marioman2007
AlanLive2020 wrote: ↑Tue Mar 29, 2022 6:24 pm
I'm kinda of bad at lua, but I'm assuming you could change the music via lua based on how many power stars you have by getting the value of SaveData.starCount (not sure if that's the name of the variable) and changing the music with each star you get. Not sure how to change the music with lua yet. Idk if it would work the same on the world map either. I'm guessing it would also be a bit harder to do if it's custom music.
I don't remember the star count having a SaveData variable
it uses a mem value: mem(0x00B251E0, FIELD_WORD)
also you can use jukebox.lua to lua change music
viewtopic.php?f=101&t=27445