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

Evolution method script check

  • 28
    Posts
    11
    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.)
     
    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.
     
    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:
    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).
     
    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