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

Evolution method script check

30
Posts
10
Years
    • Seen Mar 25, 2017
    I think I wrote this wrong, since it doesn't work:

    Code:
       when 27 # LevelRain
          return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::RAINDANCE
        when 28 # LevelSun
    return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::SUNNYDAY
        when 29 # LevelSand
    return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::SANDSTORM
        when 30 # LevelStorm
    return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::LIGHTNING
        when 31 # LevelFog
    return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::FOG
        when 32 # LevelTornado
          return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::TORNADO
        when 33 # LevelHail
          return poke if pokemon.level>=level && pokemon.gender==1 && @weather==PBWeather::HAIL

    I want a Pokemon to evolve by level during a certain battle weather condition, but only if it's female. I tested this in the game and it failed to work. (I'd already changed the evoparams and all that.)
     
    64
    Posts
    10
    Years
    • Seen May 29, 2020
    At first, the code looks right. But...

    You are using @weather to refer to the weather. But the weather isn't initialised in this part of the code (attr_accessor(:weather) is missing...). Maybe, PokeBattle_Battle.weather or something would work? I'm not very good with the details, I usually just try things out. But I think you'll have to look in that direction. Initialising it in PokemonEvolution may also work, but could be more complicated.
     
    1,224
    Posts
    10
    Years
  • Try using $game_screen.weather_type==1 instead. 1 and 2 correspond to rain ( I don't know why there are two, probably one for lightning and one for the rain. Idk). 3 corresponds to Hail, 4 is sandstorm, 5 is sunny day.
     
    Last edited:

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Try using $game_screen.weather_type==1 instead. 1 and 2 correspond to rain ( I don't know why there are two, probably one for lightning and one for the rain. Idk). 3 corresponds to Hail, 4 is sandstorm, 5 is sunny day.
    This. You could also have looked at the wiki to find an example of (nearly) exactly what you were doing.

    Note that PBWeather::SUNNYDAY and similar are terms for in-battle weather only, not overworld weather. The two are separate and have different number IDs. You should use numbers and use the overworld weather, because in-battle weather doesn't exist when evolution happens - evolution only happens after the battle finishes. So basically, what you want is impossible unless you do some significant coding (which isn't worth it, really).
     
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    This. You could also have looked at the wiki to find an example of (nearly) exactly what you were doing.

    Note that PBWeather::SUNNYDAY and similar are terms for in-battle weather only, not overworld weather. The two are separate and have different number IDs. You should use numbers and use the overworld weather, because in-battle weather doesn't exist when evolution happens - evolution only happens after the battle finishes. So basically, what you want is impossible unless you do some significant coding (which isn't worth it, really).

    That explains a lot. Thanks.
     
    Back
    Top