• 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!
  • 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] Help with Evolution Method involving Happiness + Stat comparison

  • 37
    Posts
    8
    Years
    • Seen Jan 21, 2021
    Basically I thought I should be able to combine the basic Happiness method with the Hitmonchan / Lee method, just that it's higher Atk vs SpA here, but either I keep getting errors that begin with the '>=', or nothing happens upon levelup. Here's the closest I've gotten so far:

    Code:
    PBEvolution.register(:AtkGreaterHappy, { 
      "minimumLevel"  => 1,   # Needs any level up
      "parameterType" => nil,
      "levelUpCheck"  => proc { |pkmn, parameter|    
        if pkmn.happiness >= 220
          next pkmn.level >= parameter && pkmn.attack > pkmn.spatk
        end
      }
    })

    I also tried:
    Code:
    PBEvolution.register(:AtkGreaterHappy, {  
      "minimumLevel"  => 1,   # Needs any level up
      "parameterType" => nil,
      "levelUpCheck"  => proc { |pkmn, parameter|
        next pkmn.happiness >= 220 && pkmn.attack > pkmn.spatk
      }
    })

    Do I need to the define the parameter maybe?
     
    Code:
    PBEvolution.register(:AtkGreaterHappy, {  
      "minimumLevel"  => 1,   # Needs any level up
      "parameterType" => nil,
      "levelUpCheck"  => proc { |pkmn, parameter|
        next pkmn.happiness >= 220 && pkmn.level >= parameter && pkmn.attack > pkmn.spatk
      }
    })
    This should work, assuming of course you've defined the AtkGreaterHappy constant at the top. If it doesn't, can you please post the actual error message?
     
    Code:
    PBEvolution.register(:AtkGreaterHappy, {  
      "minimumLevel"  => 1,   # Needs any level up
      "parameterType" => nil,
      "levelUpCheck"  => proc { |pkmn, parameter|
        next pkmn.happiness >= 220 && pkmn.level >= parameter && pkmn.attack > pkmn.spatk
      }
    })
    This should work, assuming of course you've defined the AtkGreaterHappy constant at the top. If it doesn't, can you please post the actual error message?

    Got it now, thank you. I think the issue may have been that I was using the double commas in the PBS that normal Happiness evolution methods have and / or I didn't specify the level there.
     
    Back
    Top