• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll 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.

Custom BGM for Specific Pokemon

  • 46
    Posts
    14
    Years
    • Age 30
    • Seen Jul 2, 2018
    Hey guys,

    I've been racking my brain for ages and I just can't figure out where I'm going wrong.

    In the PField_Battles script, I've been trying to set a specific Pokemon to have a different battle BGM, upon research I found this:

    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::RAYQUAZA) then
    $PokemonGlobal.nextBattleBGM=("Audio/BGM/YourTheme")
    else
    $PokemonGlobal.nextBattleBGM=nil
    end

    but even following it exactly to the T, writing it out exactly etc just doesn't seem to change anything.

    My code is:

    Code:
    pbSet(variable,1)
        if(species==PBSpecies::MEWZARD) then
          $PokemonGlobal.nextBattleBGM=("Battle Totem Pokemon")
        else
          $PokemonGlobal.nextBattleBGM  = nil
          end
        $PokemonGlobal.nextBattleME   = nil
        $PokemonGlobal.nextBattleBack = nil
        return true
      end

    So overall I'm not sure if I'm missing something super obvious or it just isn't working for some reason. All the Pokemon and the Music names are properly defined where they should be, so it can't be that. If anyone is able to offer my some help or point me in the right direction it'd be greatly appreciated :D
     
    Code:
    pbSet(variable,1)
        if(species==PBSpecies::MEWZARD) then
          $PokemonGlobal.nextBattleBGM=("Battle Totem Pokemon")
        else
          $PokemonGlobal.nextBattleBGM  = nil
          end
        $PokemonGlobal.nextBattleME   = nil
        $PokemonGlobal.nextBattleBack = nil
        return true
      end

    I think your issue lies in this line
    Code:
          $PokemonGlobal.nextBattleBGM=("Battle Totem Pokemon")
    RMXP / RGSS sometimes has issues recognizing file names with spaces. So it's better to name it like "Battle-Totem-Pokemon"
    Another thing might be that you might need to set the file path just like in the example you showed.
     
    I think your issue lies in this line
    Code:
          $PokemonGlobal.nextBattleBGM=("Battle Totem Pokemon")
    RMXP / RGSS sometimes has issues recognizing file names with spaces. So it's better to name it like "Battle-Totem-Pokemon"
    Another thing might be that you might need to set the file path just like in the example you showed.

    Hey, I tried to set the file path, changing the name to both Battle-Totem-Pokemon and BattleTotemPokemon but it still only plays the normal battle theme :/
     
    So where is the code located at?
    Like what script section and what comes before and what comes after it
     
    It's located here in the script section:
    [PokeCommunity.com] Custom BGM for Specific Pokemon


    after it is PField_Encounters

    The whole code for that section is

    Code:
    #===============================================================================
    # Start a single wild battle
    #===============================================================================
    def pbWildBattle(species,level,variable=nil,canescape=true,canlose=false)
      if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
        if $Trainer.pokemonCount>0
          Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
        end
        pbSet(variable,1)
        if(species==PBSpecies::MEWZARD) then
    $PokemonGlobal.nextBattleBGM=("Battle-Totem-Pokemon")
    else
    $PokemonGlobal.nextBattleBGM=nil
    end
        $PokemonGlobal.nextBattleME   = nil
        $PokemonGlobal.nextBattleBack = nil
        return true
      end
      if species.is_a?(String) || species.is_a?(Symbol)
        species = getID(PBSpecies,species)
      end
      handled = [nil]
      Events.onWildBattleOverride.trigger(nil,species,level,handled)
      return handled[0] if handled[0]!=nil
      currentlevels = []
      for i in $Trainer.party
        currentlevels.push(i.level)
      end
      genwildpoke = pbGenerateWildPokemon(species,level)
      Events.onStartBattle.trigger(nil,genwildpoke)
      scene = pbNewBattleScene
      battle = PokeBattle_Battle.new(scene,$Trainer.party,[genwildpoke],$Trainer,nil)
      battle.internalbattle = true
      battle.cantescape     = !canescape
      pbPrepareBattle(battle)
      decision = 0
      pbBattleAnimation(pbGetWildBattleBGM(species),0,[genwildpoke]) {
        pbSceneStandby {
          decision = battle.pbStartBattle(canlose)
        }
        pbAfterBattle(decision,canlose)
      }
      Input.update
      pbSet(variable,decision)
      Events.onWildBattleEnd.trigger(nil,species,level,decision)
      return (decision!=2)
    end
     
    Last edited:
    Back
    Top