• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Changing wild battle music (NOT SCRIPT)

  • 476
    Posts
    7
    Years
    • Seen Feb 26, 2020
    How exactly would I change which song is used in wild battles (specifically FireRed) without a script? I'm wanting to change all wild battles, as in Random Encounters, since like I said, my hack is on FireRed, and I want to reserve the Kanto wild theme for legendaries. If it makes forming soem kind of tutorial easier, I'm wanting to change Random Encounters to the RSE version of the theme.
     
    The way I'd go about this is to overwrite a song I won't use in the game with the Kanto Wild Battle theme (so that there are now two of them), and then replace the original one with the RSE theme so the game uses it by default. For the legendaries, I'd then just alter their scripts so that they use the original theme (the copy of it that was used to overwrite an unwanted song). As for doing this without changing any scripts at all, I don't know of a way without ASM (unless you were hacking Emerald of course).
     
    Last edited:
    The way I'd go about this is to overwrite a song I won't use in the game with the Kanto Wild Battle theme (so that there are now two of them), and then replace the original one with the RSE theme so the game uses it by default. For the legendaries, I'd then just alter their scripts so that they use the original theme (the copy of it that was used to overwrite an unwanted song). As for doing this without changing any scripts at all, I don't know of a way without ASM (unless you were hacking Emerald of course).

    Is the way to do it in Emerald adaptable, somehow, or how does the ASM routine work? Otherwise, wouldn't there be (in theory) literally just an ID listed somewhere that determines which song the game should use for wild battles? (in other words, a direct hex edit)
     
    You're probably right in that there's a value you can change somewhere that determines which music is played during wild battles, but I don't know where it would be.

    If nobody knows where it is, you could take an alternate approach and swap the IDs of the Kanto battle music and Hoenn battle music. You can do this by opening your ROM in sappy, noting down the table offsets of both songs, going to those locations in a hex editor and swapping the pointers you find. Now the game will play the Hoenn music in random battles. When you battle a legendary, just have your script tell the game to play the old Hoenn music ID and it will instead play the Kanto music.

    Its not perfect, but it works.
     
    You're probably right in that there's a value you can change somewhere that determines which music is played during wild battles, but I don't know where it would be.

    If nobody knows where it is, you could take an alternate approach and swap the IDs of the Kanto battle music and Hoenn battle music. You can do this by opening your ROM in sappy, noting down the table offsets of both songs, going to those locations in a hex editor and swapping the pointers you find. Now the game will play the Hoenn music in random battles. When you battle a legendary, just have your script tell the game to play the old Hoenn music ID and it will instead play the Kanto music.

    Its not perfect, but it works.

    Thanks for the idea! I hadn't considered using Sappy to work stuff out lol

    Only question I have about this method is how would I know when the pointer ends? Is there a special byte /length to look for? I haven't manually messed with pointers before.
     
    Last edited:
    Thanks for the idea! I hadn't considered using Sappy to work stuff out lol

    Only question I have about this method is how would I know when the pointer ends? Is there a special byte /length to look for? I haven't manually messed with pointers before.

    A pointer is just four bytes that tells the game that there's something at a certain point in the ROM.

    If I wanted to tell the game that there was something at 0x123456, I would separate the location into byte so it looks like this: [12] [34] [56]. Then flip the first and last bytes: [56] [34] [12]. Add '08' to the end: [56] [34] [12] [08]. Finally, put them back together and you have the pointer 56341208 that will go to 0x123456. In this case you don't need to swap the data that the pointer is linking to, just the pointers that you will find at the table offsets in sappy in a hex editor.
     
    A pointer is just four bytes that tells the game that there's something at a certain point in the ROM.

    If I wanted to tell the game that there was something at 0x123456, I would separate the location into byte so it looks like this: [12] [34] [56]. Then flip the first and last bytes: [56] [34] [12]. Add '08' to the end: [56] [34] [12] [08]. Finally, put them back together and you have the pointer 56341208 that will go to 0x123456. In this case you don't need to swap the data that the pointer is linking to, just the pointers that you will find at the table offsets in sappy in a hex editor.

    Ah, ok. I'd sen this info somewhere but didn't know it was for pointers. Thanks for all the clarification! :D Looks like this will be the easiest way to do it since I have all the FR Music IDs written down in a file somewhere, so it's easy to find them in Sappy :D :D :D
     
    Back
    Top