• 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] EncounterModifiers for unique battle music in 19.1

3
Posts
4
Years
    • Seen Jan 13, 2022
    NOTE: I figured out a working solution for this! See it in the comments section below!
    I've seen it recommended in several different places that if you want to change the battle music for any encounter of a specific species, you can put this:
    Code:
      Events.onWildPokemonCreate += proc { |_sender, e|
      pokemon = e[0]
        if isConst?(pokemon.species,PBSpecies,:POKEMON)
          $PokemonGlobal.nextBattleBGM="SONG.ogg"
        end
    }
    Inside the encounter modifiers section. This made it so that every time you encountered this specific wild pokemon, the battle music that plays would be unique to this single pokemon.
    However it seems that this no longer works in v19.1, due to the changes made to the PBS systems. I'm still not well versed on all of the changes made to the system, so I could really use some help here. How do I do this same thing, with the same outcome, but in essentials version 19.1?
     
    Last edited:
    3
    Posts
    4
    Years
    • Seen Jan 13, 2022
    I've actually managed to figure it out on my own, and it works perfectly! It goes like this now:
    Code:
    if pokemon.species==:NAME
        $PokemonGlobal.nextBattleBGM="UNIQUESONG.ogg"
    else
        $PokemonGlobal.nextBattleBGM="DEFAULTSONG.ogg"
      end
    }

    You can also write it like this if you want to have multiple unique songs, and use || to set multiple pokemon to the same unique song.
    Code:
    if pokemon.species==:NAME1
        $PokemonGlobal.nextBattleBGM="UNIQUESONG.ogg"
      elsif pokemon.species==:NAME2 || pokemon.species==:NAME3
        $PokemonGlobal.nextBattleBGM="DUOSONG.ogg"
      else
        $PokemonGlobal.nextBattleBGM="DEFAULTSONG.ogg"
      end
    }
     
    Back
    Top