• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] Adding SFX during battle

  • 172
    Posts
    8
    Years
    • Seen Sep 6, 2022
    I've noticed essentials doesn't have the sound effect where it plays as the pokemon's exp bar is going up after defeating a pokemon and I wanted to add that in. Anyone know how I would go about doing that? I also cant seem to find the sound effect for it anywhere if anyone happens to have it.
    it seems theres almost an endless amount of places where the game reads how much exp is applied after a battle so it would be cool if someone could point me in the right direction. any help appreciated :)
     
    You mean, in 'PokeBattle_Battle'? I added pbMEPlay. Copy your 'Pkmn level up' sound from SE Folder to ME folder and add:
    Code:
              oldtotalhp=thispoke.totalhp
              oldattack=thispoke.attack
              olddefense=thispoke.defense
              oldspeed=thispoke.speed
              oldspatk=thispoke.spatk
              oldspdef=thispoke.spdef
              if battler && battler.pokemon && @internalbattle
                battler.pokemon.changeHappiness("levelup")
              end
              thispoke.calcStats
              battler.pbUpdate(false) if battler
              @scene.pbRefresh
             [COLOR="Red"] pbMEPlay("Pkmn level up")[/COLOR]
              pbDisplayPaused(_INTL("{1} grew to Level {2}!",thispoke.name,curlevel))
              @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack,
                               olddefense,oldspeed,oldspatk,oldspdef)

    Also, to charge the bar, the Sound Effect is 'BW_exp', in Scene script:
    Code:
      def pbEXPBar(pokemon,battler,startexp,endexp,tempexp1,tempexp2)
        if battler
          @sprites["battlebox#{battler.index}"].refreshExpLevel
          exprange=(endexp-startexp)
          startexplevel=0
          endexplevel=0
          if exprange!=0
            startexplevel=(tempexp1-startexp)*192/exprange
            endexplevel=(tempexp2-startexp)*192/exprange
          end
          [COLOR="red"]pbSEPlay("BW_exp")[/COLOR]
          @sprites["battlebox#{battler.index}"].animateEXP(startexplevel,endexplevel)
          while @sprites["battlebox#{battler.index}"].animatingEXP
            pbGraphicsUpdate
            pbInputUpdate
            pbFrameUpdate
            @sprites["battlebox#{battler.index}"].update
          end
    [COLOR="Red"]      Audio.se_stop
          10.times do
            pbGraphicsUpdate
          end[/COLOR]
        end
      end
     

    Attachments

    • BW_exp.wav
      382.8 KB
    Last edited:
    You mean, in 'PokeBattle_Battle'? I added pbMEPlay. Copy your 'Pkmn level up' sound from SE Folder to ME folder and add:
    Code:
              oldtotalhp=thispoke.totalhp
              oldattack=thispoke.attack
              olddefense=thispoke.defense
              oldspeed=thispoke.speed
              oldspatk=thispoke.spatk
              oldspdef=thispoke.spdef
              if battler && battler.pokemon && @internalbattle
                battler.pokemon.changeHappiness("levelup")
              end
              thispoke.calcStats
              battler.pbUpdate(false) if battler
              @scene.pbRefresh
             [COLOR="Red"] pbMEPlay("Pkmn level up")[/COLOR]
              pbDisplayPaused(_INTL("{1} grew to Level {2}!",thispoke.name,curlevel))
              @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack,
                               olddefense,oldspeed,oldspatk,oldspdef)

    Also, to charge the bar, the Sound Effect is 'BW_exp', in Scene script:
    Code:
      def pbEXPBar(pokemon,battler,startexp,endexp,tempexp1,tempexp2)
        if battler
          @sprites["battlebox#{battler.index}"].refreshExpLevel
          exprange=(endexp-startexp)
          startexplevel=0
          endexplevel=0
          if exprange!=0
            startexplevel=(tempexp1-startexp)*192/exprange
            endexplevel=(tempexp2-startexp)*192/exprange
          end
          [COLOR="red"]pbSEPlay("BW_exp")[/COLOR]
          @sprites["battlebox#{battler.index}"].animateEXP(startexplevel,endexplevel)
          while @sprites["battlebox#{battler.index}"].animatingEXP
            pbGraphicsUpdate
            pbInputUpdate
            pbFrameUpdate
            @sprites["battlebox#{battler.index}"].update
          end
    [COLOR="Red"]      Audio.se_stop
          10.times do
            pbGraphicsUpdate
          end[/COLOR]
        end
      end

    Yeah that's exactly what I was looking for! Thanks!
     
    Back
    Top