• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Scripting Question] Change Wild Pokemon Encounter Battle Music for specific pokemon

  • 79
    Posts
    9
    Years
    • Seen Jan 17, 2017
    So I want the battle music to change when I encounter
    a specific pokemon for example "Ho Oh".
    Don't know if thats already implemented in vanilla essentials.
     
    I gave a similar answer, while ago.

    In PokemonField script section, about at line 1000, in def pbWildBattle, when the script say "$PokemonGlobal.nextBattleBGM=nil", you can make a little variation by replacing it with (RAYQUAZA is a little example):

    if(species==PBSpecies::HOOH) then
    $PokemonGlobal.nextBattleBGM=("Audio/BGM/YourTheme")
    else
    $PokemonGlobal.nextBattleBGM=nil
    end
     
    Thanks for the answer!
    But sadly it doesn't work.
    The default wild battle theme is still being played.
     
    Spoiler:
     
    Spoiler:
    Restore the previous code, by deleting my lines of code.
    Then, in def pbGetWildBattleBGM(species) after the first block of condition, add this
    Code:
      if(species==PBSpecies::HOOH)
        return pbStringToAudioFile("VsHOOH.ogg")
      end

    Whenever you want to add other BGMs, you have to add an "elsif" condition with your species. For example:

    Code:
      if(species==PBSpecies::HOOH)
        return pbStringToAudioFile("VsHOOH.ogg")
      elsif(species==PBSpecies::LUGIA)
        return pbStringToAudioFile("VsLUGIA.ogg")
      elsif(species==PBSpecies::CELEBI)
        return pbStringToAudioFile("VsCELEBI.ogg")
      end
     
    Thank you Folle64!
    That works perfectly.
    And yeah if I would talk to an event and had a specific encounter i could use the change battle bgm event command or "$PokemonGlobal.nextBattleBGM="FILENAME".
    But Im talking about a wild encounter in grass.
    Theres not only for example ho oh. Ho-Oh's battle theme on a wild Rattata? Nope.
     
    Why are you making this so unnecessary complicate? Just use the Event command "Change Battle BGM" right before the battle starts.
    Because, if there are more battles with the same Pokémon (e.g a second chance to catch it), it's more efficent. I don't know anything about Letrax's project and I'm trying to give him the best solution (of course from my point of view).
     
    Because, if there are more battles with the same Pokémon (e.g a second chance to catch it), it's more efficent. I don't know anything about Letrax's project and I'm trying to give him the best solution (of course from my point of view).

    Well, that might be true, but if we are speaking about legendaries like ho-oh, there will be rarely a situation where you need more than one or two battles. My suggestion is just for the sake of updating Essentials, because later you don't have to re-insert the code again.

    But of course, if we talking about regular encounters, then your solution is way better.
     
    Hi guys !

    How can I do it with current version (20.1) please ? I'm so lost with script who I just understand a little.
     
    Try using this
    $PokemonGlobal.nextBattleBGM=
    "ORAS 109 Battle! (Wild Pokemon)"
    this is my example for the Latios encounter.
     
    Back
    Top