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

[Scripting Question] Help me with Pokemon Evolution!

KokoNekoGirl

𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
6
Posts
4
Years
    • she/her
    • Seen Oct 5, 2020
    So I'm new to scripting (I only rlly have experience with bits of java with my computer programing class) so i tried to find tutorials to help me. I want to add two evolution ways: one by levelling up a pokemon during a sandstorm (Named Dusteon), and one by having a pokemon level up while holding a specific held item (many more eeveelutions). I followed one tutorial, and I went over to the Pokemon_Evolution scripting and changed custom 1 and custom 2 to:
    LevelSandstorm = 31
    HoldItem = 32


    I then scrolled down and changed values, this is what it looked like:

    1,2,1,1,1 # LevelSandstorm, HoldItem, Custom 2-5

    I scrolled further down and wrote this code (where it told me to put it):

    when PBEvolution::LevelSandstorm
    if pokemon.level>=level
    if $game_screen && (PBFieldWeather==PBFieldWeather::Sandstorm || PBWeather==PBWeather::SANDSTORM);


    when PBEvolution::HoldItem
    if ((pokemon.item==level) &&((isConst?(pokemon.species,PBSpecies,:IGNEON)) || (isConst?(pokemon.species,PBSpecies,:AIREON))|| (isConst?(pokemon.species,PBSpecies,:CORRUPTEON))|| (isConst?(pokemon.species,PBSpecies,:MARBELLEON)) || (isConst?(pokemon.species,PBSpecies,:BERYLLEON)));


    I even added this part a bit lower just to be sure:

    when PBEvolution::HoldItem
    return poke if level==item && ((isConst?(pokemon.species,PBSpecies,:IGNEON) || (isConst?(pokemon.species,PBSpecies,:AIREON)|| (isConst?(pokemon.species,PBSpecies,:CORRUPTEON)|| (isConst?(pokemon.species,PBSpecies,:MARBELLEON) || (isConst?(pokemon.species,PBSpecies,:BERYLLEON)));

    However, I keep getting script errors. The program we use in class specifies what is wrong with the code (ie: Unknown variables, incorrect use of data types, etc), however idk exactly what script errors mean? I don't even know what these variables or commands mean ;w; Can somemone help me through this?
     

    KokoNekoGirl

    𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
    6
    Posts
    4
    Years
    • she/her
    • Seen Oct 5, 2020
    **Oopes, the "smiles" are just : S but no space
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    It might help people answer if you use code tags to preserve the indentation of your code when you post, and put the error messages here too (and point out which line numbers they correspond to in your code, if they do).
     
    Last edited:

    KokoNekoGirl

    𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
    6
    Posts
    4
    Years
    • she/her
    • Seen Oct 5, 2020
    line 33
    HTML:
    LevelSandstorm = 31
    line34
    HTML:
    HoldItem = 32

    line 62
    HTML:
    1,2,1,1,1 # LevelSandstorm, HoldItem, Custom 2-5

    line 219
    HTML:
    when PBEvolution::LevelSandstorm
    line 220
    HTML:
    if pokemon.level>=level
    line 221
    HTML:
    if $game_screen && (PBFieldWeather==PBFieldWeather::Sandstorm || PBWeather==PBWeather::SANDSTORM);
    line 922
    HTML:
    when PBEvolution::HoldItem
    line 923
    HTML:
    if ((pokemon.item==level) &&((isConst?(pokemon.species,PBSpecies,:IGNEON)) || (isConst?(pokemon.species,PBSpecies,:AIREON))|| (isConst?(pokemon.species,PBSpecies,:CORRUPTEON))|| (isConst?(pokemon.species,PBSpecies,:MARBELLEON)) || (isConst?(pokemon.species,PBSpecies,:BERYLLEON)));

    I also forgot:

    line 39
    HTML:
    EVONAMES=["Unknown",
    line 40
    HTML:
    "Happiness","HappinessDay","HappinessNight","Level","Trade",
    line 41
    HTML:
    "TradeItem","Item","AttackGreater","AtkDefEqual","DefenseGreater",
    line 42
    HTML:
    "Silcoon","Cascoon","Ninjask","Shedinja","Beauty",
    line 43
    HTML:
    "ItemMale","ItemFemale","DayHoldItem","NightHoldItem","HasMove",
    line 44
    HTML:
    "HasInParty","LevelMale","LevelFemale","Location","TradeSpecies",
    line 45
    HTML:
    "LevelDay","LevelNight","LevelDarkInParty","LevelRain","HappinessMoveType",
    line 46
    HTML:
    "LevelSandstorm","HoldItem","Custom3","Custom4","Custom5"

    The error was happening at 922. it also still happened without the ; at the end. Does that help?
     
    Last edited:

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Hi,

    Essentials/RMXP by itself is telling you exactly what line causes the error in it's error message and what kind of error it is. If you could show us this message it would make it easier for us to help you
     

    KokoNekoGirl

    𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
    6
    Posts
    4
    Years
    • she/her
    • Seen Oct 5, 2020
    ok i updated the original post. I got the item one to work, just the sandstorm giving me problems
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    The sandstorm evo method is very similar to the already implemented rain evo, so that would be a great place to start.
    Code:
    when PBEvolution::LevelRain
        if pokemon.level>=level
          if $game_screen && ($game_screen.weather==PBFieldWeather::Rain ||
                              $game_screen.weather==PBFieldWeather::HeavyRain ||
                              $game_screen.weather==PBFieldWeather::Storm)
            return poke
          end
        end

    Now we don't need to worry about PBWeather, because that's for in battle weather, and pokemon can't evolve in battle.
    Code:
    when PBEvolution::LevelSandstorm
        if pokemon.level>=level
          if $game_screen && ($game_screen.weather==PBFieldWeather::Sandstorm)
            return poke
          end
        end
    That'll do the trick. There's a lot to learn from the default scripts, so it's a good idea to always give a quick look at stuff that's similar to what you want.
    CTRL + SHIFT + F lets you search all script sections at once, making tracking down what you are looking for way easier!
     

    KokoNekoGirl

    𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
    6
    Posts
    4
    Years
    • she/her
    • Seen Oct 5, 2020
    Ah! Thanks for the tip! I was trying to base the level sandstorm off the level rain, however i'm still getting the same error as before :'3 Idk why my post reverted to the original, i thought i edited it. anyways, https: //imgur. com/a/3Jj3MGD these are the errors
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    Oh no, I am so sorry, looks like the LevelRain evo method is also wrong. $game_screen.weather is what we call to switch the weather. We want $game_screen.weather_type

    So sorry.
     

    KokoNekoGirl

    𝕂𝕠𝕜𝕠𝕋𝕙? ???ℕ𝕖𝕜𝕠𝔾? ?𝕣𝕝
    6
    Posts
    4
    Years
    • she/her
    • Seen Oct 5, 2020
    Oh it's fine!! IT WORKED HORRAYYY :'33 now to just add all the pokemon now! tysm!
     
    Back
    Top