• 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!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Evolve when poisoned

  • 20
    Posts
    10
    Years
    • Seen May 13, 2016
    Was hoping someone could help figure out the error message when I try to make an evolution of when it levels up while poisoned.
    Code:
    module PBEvolution
      Unknown           = 0 # Do not use
      Happiness         = 1
      HappinessDay      = 2
      HappinessNight    = 3
      Level             = 4
      Trade             = 5
      TradeItem         = 6
      Item              = 7
      AttackGreater     = 8
      AtkDefEqual       = 9
      DefenseGreater    = 10
      Silcoon           = 11
      Cascoon           = 12
      Ninjask           = 13
      Shedinja          = 14
      Beauty            = 15
      ItemMale          = 16
      ItemFemale        = 17
      DayHoldItem       = 18
      NightHoldItem     = 19
      HasMove           = 20
      HasInParty        = 21
      LevelMale         = 22
      LevelFemale       = 23
      Location          = 24
      TradeSpecies      = 25
      HappinessMoveType = 26
      TypeDark          = 27
      LevelRain         = 28
      LevelDay          = 29
      LevelNight        = 30
      UpsideDownLevel   = 31
      HappinessMale     = 32
      HappinessFemale   = 33
      LevelPoison       = 34
    
      EVONAMES=["Unknown",
         "Happiness","HappinessDay","HappinessNight","Level","Trade",
         "TradeItem","Item","AttackGreater","AtkDefEqual","DefenseGreater",
         "Silcoon","Cascoon","Ninjask","Shedinja","Beauty",
         "ItemMale","ItemFemale","DayHoldItem","NightHoldItem","HasMove",
         "HasInParty","LevelMale","LevelFemale","Location","TradeSpecies",
         "HappinessMoveType","TypeDark","LevelRain","LevelDay","LevelNight",
         "UpsideDownLevel","HappinessMale","HappinessFemale","LevelPoison"
      ]
    
      # 0 = no parameter
      # 1 = Positive integer
      # 2 = Item internal name
      # 3 = Move internal name
      # 4 = Species internal name
      # 5 = Type internal name
      EVOPARAM=[0,     # Unknown (do not use)
         0,0,0,1,0,    # Happiness, HappinessDay, HappinessNight, Level, Trade
         2,2,1,1,1,    # TradeItem, Item, AttackGreater, AtkDefEqual, DefenseGreater
         1,1,1,1,1,    # Silcoon, Cascoon, Ninjask, Shedinja, Beauty
         2,2,2,2,3,    # ItemMale, ItemFemale, DayHoldItem, NightHoldItem, HasMove
         4,1,1,1,4,    # HasInParty, LevelMale, LevelFemale, Location, TradeSpecies
         3,1,1,1,1,1,  # HappinessMoveType, TypeDark, LevelRain, LevelDay, LevelNight, Upsidedown Level
         0,0,0           # HappinessMale, HappinessFemale,LevelPoison
      ]
    end
    and then in the minicheck evolution I have this
    Code:
    when PBEvolution::LevelPoison
        # Add code for custom evolution type 7
        return poke if pokemon.level>=level && PBStatuses.getName(2)
    The image of the mon shows up when it levels up while poison like it's about to do the animation of evolution, but then it crashes with this error.
    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `width' for nil:NilClass

    Pokemon_Evolution:738:in `pbStartScreen'

    PItem_Items:322:in `pbChangeLevel'

    PItem_Items:320:in `pbFadeOutInWithMusic'

    PSystem_Utilities:884:in `pbFadeOutIn'

    PSystem_Utilities:884:in `pbFadeOutInWithMusic'

    PItem_Items:320:in `pbChangeLevel'

    PItem_ItemEffects:757

    PItem_ItemEffects:752:in `call'

    Event:150:in `trigger'

    PItem_Items:229:in `triggerUseOnPokemon'



    This exception was logged in

    C:\Users\Meep\Saved Games/Pokemon Essentials/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     
    Sorry, was being stupid. tried status originally and didn't work with that same error. found out was a graphical reason why and me doing PBStatuses.getName(2) was dumb.

    Was also curious if had time of why this wouldn't work even if after I added LevelEV =35 in PB Evolution and added it to the two arrays as well. Seems to be evo no matter what. It's the example from the wiki with just a variable change from trainedmon to levelev, and thought would try out to see how it works.

    when PBEvolution::LevelEV
    evtotal=0
    for i in 0...6
    evtotal+=pokemon.ev
    end
    return poke if pokemon.level>=level && evtotal>=level
    end

    Even have the pbs setup like in the example like this;
    DRAGONRAWR,LevelEV,200
     
    Well, the way you have it coded so that the EVs have to total 200 (which I assume is what you want), but also that the Pokemon has to be at level 200 (an impossibility unless you changed MAXIMUMLEVEL.)

    notice this line of code:
    Code:
    return poke if [COLOR="Red"]pokemon.level>=level &&[/COLOR] evtotal>=level

    removing the red should make it work.
     
    removed the red line but still having the same issue as when I had the redline, that it will evolve even when it doesn't have 200 or more evs.<br>
     
    Back
    Top