Fandom

Pokémon Essentials Wiki

[Solution available] Copycat Move Infinite Loop

  • The move Copycat works by repeating the last move used in battle (basically like Mirror Move). Essentials stores the last move used in battle in a single variable that gets overwritten every time a move is made (if I'm understanding it correctly). The issue is that if Copycat is used twice in a row, it will cause an endless loop.

    Basically the code for Copycat checks whatever the last move is. If the move is not listed in a blacklist array in the code for Copycat, and there is a last move used, the move executes the effect of the last move used.

    The problem is that Copycat and Mirror Move are not listed in Copycat's blacklist, thus it's possible to initiate an infinite loop by using two of these moves in a row. Copycat will see that Copycat was the last move and will try to initiate the effect of Copycat, which will see that Copycat was the last move and will try to initiate the effect of Copycat, etc. in an infinite recursion.

    To solve this, I added the function codes of Copycat and Mirror Move to Copycat's blacklist array. If you want to solve this for yourself, go into the script section PokeBattle_MoveEffects down to the class PokeBattle_Move_0AF (around line 4534), and change the blacklist array from

       blacklist=[
          0x69,    # Transform
          0x71,    # Counter
          0x72,    # Mirror Coat
          0x73,    # Metal Burst
          0x9C,    # Helping Hand
          0xAA,    # Detect, Protect
          0xAD,    # Feint
          0xB2,    # Snatch
          0xE7,    # Destiny Bond
          0xE8,    # Endure
          0xEC,    # Circle Throw, Dragon Tail
          0xF1,    # Covet, Thief
          0xF2,    # Switcheroo, Trick
          0xF3,    # Bestow
          0x115,   # Focus Punch
          0x117,   # Follow Me, Rage Powder
          0x158    # Belch
       ]
    

    To:

       blacklist=[
          0x69,    # Transform
          0x71,    # Counter
          0x72,    # Mirror Coat
          0x73,    # Metal Burst
          0x9C,    # Helping Hand
          0xAA,    # Detect, Protect
          0xAD,    # Feint
          0xB2,    # Snatch
          0xE7,    # Destiny Bond
          0xE8,    # Endure
          0xEC,    # Circle Throw, Dragon Tail
          0xF1,    # Covet, Thief
          0xF2,    # Switcheroo, Trick
          0xF3,    # Bestow
          0x115,   # Focus Punch
          0x117,   # Follow Me, Rage Powder
          0x158,   # Belch
          0xAF,    # Copycat, to prevent endless loop
          0xAE     # Mirror Move
       ]
    

    This may also be a problem for Mirror Move, but its effect is slightly different, so I don't understand it quite as well.

      Loading editor
    • I will fix it soon

        Loading editor
    • 157.55.39.94
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.