• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Custom Feature Question] Keeping stat changes when switching out and then back in.

  • 15
    Posts
    4
    Years
    • Seen Nov 1, 2020
    Hello, I'm new to coding and was wondering if there's anyway keeping stat changes when switching out and then back in? Answers would be very much appreciated.
     
    I think I know how to do that, but I didn't test this out. If you search for 'if !batonpass', which is under 'def pbInitEffects(batonpass)' in the Pokebattle_Battler script, delete the lines of code below that are bolded:
    Code:
        if !batonpass
          # These effects are retained if Baton Pass is used
    [B]      @stages[PBStats::ATTACK]   = 0
          @stages[PBStats::DEFENSE]  = 0
          @stages[PBStats::SPEED]    = 0
          @stages[PBStats::SPATK]    = 0
          @stages[PBStats::SPDEF]    = 0
          @stages[PBStats::EVASION]  = 0
          @stages[PBStats::ACCURACY] = 0[/B]
          @lastMoveUsedSketch        = -1
          @effects[PBEffects::AquaRing]    = false
     
    I think I know how to do that, but I didn't test this out. If you search for 'if !batonpass', which is under 'def pbInitEffects(batonpass)' in the Pokebattle_Battler script, delete the lines of code below that are bolded:
    Code:
        if !batonpass
          # These effects are retained if Baton Pass is used
    [B]      @stages[PBStats::ATTACK]   = 0
          @stages[PBStats::DEFENSE]  = 0
          @stages[PBStats::SPEED]    = 0
          @stages[PBStats::SPATK]    = 0
          @stages[PBStats::SPDEF]    = 0
          @stages[PBStats::EVASION]  = 0
          @stages[PBStats::ACCURACY] = 0[/B]
          @lastMoveUsedSketch        = -1
          @effects[PBEffects::AquaRing]    = false

    Just to confirm, because I'm stupid. You want me to delete this part.
     
    Just to confirm, because I'm stupid. You want me to delete this part.

    Actually, now that I'm thinking about it, you probably should move (cut and paste) the part in bold to another part. If you scroll up a little from the section of code I showed, you'll see 'def pbInitPermanentEffects'. Underneath that, you will find this line of code: '@effects[PBEffects::WishMaker] = -1'. Move the code in bold from above to below that line and make sure you delete it under 'if !batonpass'.
     
    Actually, now that I'm thinking about it, you probably should move (cut and paste) the part in bold to another part. If you scroll up a little from the section of code I showed, you'll see 'def pbInitPermanentEffects'. Underneath that, you will find this line of code: '@effects[PBEffects::WishMaker] = -1'. Move the code in bold from above to below that line and make sure you delete it under 'if !batonpass'.

    I think this worked, thank you for the help!
     
    It really didn't work. There's no facility for a Pokémon to remember any applied battle effect when it's switched out, so using any existing code will not make it do so.

    Those permanent effects apply to whichever Pokémon replaced the one you switched out (and more generally, any Pokémon in that position on the battlefield), so the Pokémon you switched out isn't remembering anything; the replacement Pokémon is just inheriting its stat stages even without the magic of Baton Pass.
     
    It really didn't work. There's no facility for a Pokémon to remember any applied battle effect when it's switched out, so using any existing code will not make it do so.

    Those permanent effects apply to whichever Pokémon replaced the one you switched out (and more generally, any Pokémon in that position on the battlefield), so the Pokémon you switched out isn't remembering anything; the replacement Pokémon is just inheriting its stat stages even without the magic of Baton Pass.

    Oh alright then, my bad.
     
    Back
    Top