• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
8
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.
     
    296
    Posts
    9
    Years
  • 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
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    Thanks for the answer!
    But sadly it doesn't work.
    The default wild battle theme is still being played.
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    Spoiler:
     
    296
    Posts
    9
    Years
  • 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
     

    Diverscope

    Pardon me
    152
    Posts
    11
    Years
  • Why are you making this so unnecessary complicate? Just use the Event command "Change Battle BGM" right before the battle starts.
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    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.
     
    296
    Posts
    9
    Years
  • 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).
     

    Diverscope

    Pardon me
    152
    Posts
    11
    Years
  • 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.
     
    2
    Posts
    1
    Years
    • Seen Feb 29, 2024
    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.
     
    Back
    Top