• 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!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Add Star Animation to poke capture

  • 17
    Posts
    4
    Years
    • Seen Feb 6, 2023
    Trying to add the star animation to successful capture

    in: PokeBattle_Animations

    def ballCaptureSuccess(ball,delay,ballX,ballY)
    ball.setSE(delay,"Battle catch click")
    pbStarAniCaptureSuccess(ballX,ballY)
    ball.moveTone(delay,4,Tone.new(-64,-64,-64,128))
    end


    in: PField_Field

    def pbStarAniCaptureSuccess(ball_x,ball_y)
    $scene.spriteset.addUserAnimation(BALL_CAPTURE_ID,ball_x,ball_y,true,1)
    end

    alternativly I'v tried this:

    in: PokeBattle_Animations

    def ballCaptureSuccess(ball,delay,ballX,ballY)
    ball.setSE(delay,"Battle catch click")
    $scene.spriteset.addUserAnimation(BALL_CAPTURE_ID,ball_x,ball_y,true,1)
    ball.moveTone(delay,4,Tone.new(-64,-64,-64,128))
    end

    Im getting the same error for both.

    undifined method addUserAnimation

    not sure how to fix or where or why its wrong any help would be welcome.
     
    Maybe you'd rather work in the class:
    Code:
    class PokeballThrowCaptureAnimation < PokeBattle_Animation
    and in the function:
    Code:
      def createProcesses
    By the end, below the lines:
    Code:
          # Pokémon was caught
          ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    add this:
    Code:
          @battler.battle.pbCommonAnimation("CaptureStars", @battler)
    assuming your animation is called "Common:CaptureStars" in the Animation Editor.
     
    so its just not working

    I Have this

    # Pokémon was caught
    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("StarCatch", @battler)

    ive also tried:

    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("Star_Catch", @battler)

    in the database under the tab animations i have an animation called StarCatch that uses the sprite animation sheet Star_catch

    both simply do nothing. any suggestions where im going wrong.
     
    both simply do nothing. any suggestions where im going wrong.

    If you use the function "pbCommonAnimation("StarCatch", @battler)", then the animation should be called "Common:StarCatch" in the animation editor, not just "StarCatch".
     
    still nothing

    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("Common:StarCatch", @battler)

    does this work with PEV18.1
     
    still nothing

    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("Common:StarCatch", @battler)

    does this work with PEV18.1

    You're going to try every combination but the right XD
    If the animation is called "Common:StarCatch", then the line should be:
    Code:
     @battler.battle.pbCommonAnimation("StarCatch", @battler) # NO "Common:"
     
    ok however I'm still getting nothing
    have tried:

    # Pokémon was caught
    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("Common:StarCatch", @battler) which I now know is wrong

    in databas animation is called: Common:StarCatch

    in class PokeballThrowCaptureAnimation < PokeBattle_Animation

    # Pokémon was caught
    ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
    @battler.battle.pbCommonAnimation("StarCatch", @battler)

    still nothing
     
    Does the Common animation need to be set up as a battle animation in the battle animation editor, because the way i was doing it was using the xp animation editor in the datbase and was going to do it the same way as the grass animation happens.
     
    Does the Common animation need to be set up as a battle animation in the battle animation editor, because the way i was doing it was using the xp animation editor in the datbase and was going to do it the same way as the grass animation happens.

    In the Animation editor in Pokémon Essentials.
    Open the Menu > Debug > Information Editors > Battle Animations Editor.





    EDIT: In fact I made a mistake. Remove the line I told you to put, it activates too early.
    You should do something in the file PokeBattle_BattleCommon, in the function:
    Code:
      def pbThrowPokeBall(idxBattler,ball,rareness=nil,showPlayer=false)
    below the line:
    Code:
          pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pkmn.name))
    paste this:
    Code:
          pbCommonAnimation("StarCatch", battler)
     
    Last edited:
    Would you be willing to tell me where you got the star image for your animation? I can't seem to find anything
     
    Back
    Top