• 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.

[Other Question] how to add SFX to battle HUD? Essentials 18.1

56
Posts
5
Years
  • is there any way to add sound effects to the battle HUD as it loads in? like, the "ding"s of the pokeballs sliding into place and the "whoosh" of the line sliding in?
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    is there any way to add sound effects to the battle HUD as it loads in? like, the "ding"s of the pokeballs sliding into place and the "whoosh" of the line sliding in?

    Basically you want the function:
    Code:
    def pbSEPlay(param,volume=nil,pitch=nil)
    which plays a sound effect (an MP3 / WAV file that is in the Audio/SE folder).

    The ball sliding animation is in class:
    Code:
    class LineupAppearAnimation
    in particular you'll want to check out the function:
    Code:
      def createBall(idxBall,delay,dir)
    and add the pbSEPlay call in it.

    Hope that helps!

    EDIT: also, you'll need to find the sound effects yourself. What I do is look for Youtube videos with the sound I want, use a Youtube-to-MP3 converter, and extract what I want with Audacity.
     
    Last edited:
    56
    Posts
    5
    Years
  • def createBall(idxBall,delay,dir)
    # Choose ball's graphic
    idxParty = getPartyIndexFromBallIndex(idxBall)
    graphicFilename = "Graphics/Pictures/Battle/icon_ball_empty"
    if idxParty>=0 && idxParty<@party.length && @party[idxParty]
    if !@party[idxParty].able?
    graphicFilename = "Graphics/Pictures/Battle/icon_ball_faint"
    elsif @party[idxParty].status!=PBStatuses::NONE
    graphicFilename = "Graphics/Pictures/Battle/icon_ball_status"
    else
    graphicFilename = "Graphics/Pictures/Battle/icon_ball"
    end
    end
    # Set up ball sprite
    ball = addSprite(@sprites["partyBall_#{@side}_#{idxBall}"])
    ball.setVisible(delay,true)
    ball.setName(delay,graphicFilename)
    ball.setDelta(delay,dir*Graphics.width/2,0)
    ball.moveDelta(delay,8,-dir*Graphics.width/2,0)
    def pbSEPlay(Mining reveal.ogg,volume=100,pitch=100) <------------------------------ Here is the sound effect
    end
    end

    Sorry for super lateness, I kinda gave up for a bit since no one responded lol. It says syntax error when I boot up the game, why? I'll experiment, may end up solving it on my own. I'm using a mining sound effect for the dings btw

    Also, do you know where the line code is? I'd like to put a sound for that too
     
    56
    Posts
    5
    Years
  • Ok, I figured out that I needed to remove the Def, and i got it kinda working? But the sound only plays right at the beginning of the animation, instead of playing a ding when each pokeball slides into place. What can I do now?
     
    Back
    Top