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

I Think I broke Pokerus

Rayd12smitty

Shadow Maker
645
Posts
12
Years
    • Seen Feb 21, 2016
    Help Me Again PokeCommunity. I just realized I did something that messed up Pokerus. Whenever I try to view a pokemon's summary or finish a battle I get a Pokerus error. I am getting a finish battle error too, but that can wait. Here are the errors. Does anyone know whats wrong?

    This is the error from the summary screen
    Spoiler:


    And when I defeat a wild pokemon this comes up

    Spoiler:


    Any help would be appreciated
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Does the def pokerusStage appear in your script section PokeBattle_Pokemon? If not, it should.
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    Does the def pokerusStage appear in your script section PokeBattle_Pokemon? If not, it should.

    I don't know how that would have gotten deleted. It does not. For some reason I can't download anything right now though. Could you post the def pokerusStage part of the script for me to insert, and where does it go
     
    34
    Posts
    14
    Years
  • Line 296, under
    Code:
    # Reduces the time remaining for this Pokemon's Pokérus (if infected).
      def lowerPokerusCount
        return if self.pokerusStage!=1
        @pokerus-=1
      end

    add in
    Code:
    # Returns the Pokérus infection stage for this Pokemon.
      def pokerusStage
        return 0 if !@pokerus || @pokerus==0        # Not infected
        return 2 if @pokerus>0 && (@pokerus%16)==0  # Cured
        return 1                                    # Infected
      end
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    Line 296, under
    Code:
    # Reduces the time remaining for this Pokemon's Pokérus (if infected).
      def lowerPokerusCount
        return if self.pokerusStage!=1
        @pokerus-=1
      end

    add in
    Code:
    # Returns the Pokérus infection stage for this Pokemon.
      def pokerusStage
        return 0 if !@pokerus || @pokerus==0        # Not infected
        return 2 if @pokerus>0 && (@pokerus%16)==0  # Cured
        return 1                                    # Infected
      end


    Thank you so much. It turns out i was missing both of those. Everything is working good now. Thanks
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    You'll also be missing this def, then:

    Code:
      def givePokerus(strain=0)
        return if self.pokerusStage==2 # Can't re-infect a cured Pokémon
        if strain<=0 || strain>=16
          strain=1+rand(15)
        end
        time=1+(strain%4)
        @pokerus=time
        @pokerus|=strain<<4
      end
    I can only presume you've tried upgrading your project (in the wrong way), and failed to upgrade that script section.
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    Probably. I tried putting in a new script that didn't end up working right. I must have done something when I took it out. Thanks, and where does this def go
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    The same place as the other two.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    It doesn't matter. The methods just need to be in there somewhere.
     
    Back
    Top