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

[Scripting Question] Add Star Animation to poke capture

  • 17
    Posts
    3
    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.
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    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.
     
  • 17
    Posts
    3
    Years
    • Seen Feb 6, 2023
    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.
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    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".
     
  • 17
    Posts
    3
    Years
    • Seen Feb 6, 2023
    still nothing

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

    does this work with PEV18.1
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    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:"
     
  • 17
    Posts
    3
    Years
    • Seen Feb 6, 2023
    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
     
  • 17
    Posts
    3
    Years
    • Seen Feb 6, 2023
    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.
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    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:

    KP7

  • 22
    Posts
    3
    Years
    • Seen Jan 14, 2022
    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