• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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
7
Years
  • Age 31
  • 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 :)
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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:
172
Posts
7
Years
  • Age 31
  • Seen Sep 6, 2022
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