• 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.
  • 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Move that changes user and target's stats

  • 37
    Posts
    8
    Years
    • Seen Jan 21, 2021
    I'm trying to script a move that raises the user's Atk, lowers Spe, and lowers the foe's Atk (based on a pufferfish inflating). The following script works with the move set to "AllFoes" in the PBS, but causes the animation to occur on the opponent's side, which I'd like to change to the user's side. I'm able to do this by changing the PBS to "AllBattlers" but this also lowers the user's Atk (I could make the Atk increase 2 to offset this but that's starting to get rather ugly / excessive). Unless there's a way to shift the location of the animation (maybe something to do with ShowAnim?) I'm thinking I need to make the move class into one targeting the user primarily (i.e. PokeBattle_StatUpMove) and then add the second def effect for lowering the opponent's Atk afterward, but attempts at this have been causing errors. How would I go about scripting this? Here's what I'm working with so far:
    Code:
    class PokeBattle_Move_303 < PokeBattle_TargetStatDownMove
      def initialize(battle,move)
        super
        @statDown = [PBStats::ATTACK,1]
      end
    
      def pbEffectGeneral(user)
        if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
          user.pbRaiseStatStage(PBStats::ATTACK,1,user)
        end
        showAnim = true
        if user.pbCanLowerStatStage?(PBStats::SPEED,user,self)
          if user.pbLowerStatStage(PBStats::SPEED,1,user,showAnim)
            showAnim = true
          end
        end
      end
    end
     
    Try changing the animation in the animation editor.
     
    Try changing the animation in the animation editor.

    Good idea. So I've made a new animation for the move in question, and named it "Move:BLOAT" in accordance with the format the other unique moves seem to have, but when used in battle the new animation doesn't show up. I exported the .anm file into the root folder and used an internal SE - the animation only involves the user expanding. What else do I need to do in order for the animation to show up in-game?

    EDIT: Working now; not sure why though.
     
    Last edited:
    Back
    Top