• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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!
  • 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.

Editing the Pokédex

  • 16
    Posts
    11
    Years
    • Seen Dec 21, 2019
    Hi,
    I'm working on my first game and I'm trying to edit the pokedex in such a way so you can not only check if you own a pokemon, but also can check if you currently own a pokemon (so all the pokemon in your boxes and your party). All pokemon that you've traded, released or evolved are currently marked as "owned" even if you don't own one at the moment. For those who remember, this was in Stadium 2 also: htt p://imgu r.com/jddCPKN (remove spaces as I'm not allowed yet to post links)

    So I want
    -a normal red/white pokeball if you have that species in your boxes/party
    -a grey pokeball if you once have onwed that species
    -a white box if you only have seen that species

    I've edited this on the PokemonPokedex script:

    This:
    Spoiler:

    I've changed into this:

    Spoiler:

    (I know it only checks the boxes and not the party, but I'll do that later)

    and this:
    Spoiler:

    into this:
    Spoiler:

    Offcourse I've also placed the right images in the right folders.

    When I try to test it, it gives no error, but when I open the Pokédex the game crashes.
    No error or error log, just not responding.

    Any idea what I've done wrong?
    Any help is appriciated
    P.S. sorry if my English isn't good, it's not my first language.
     
    • Like
    Reactions: FL
    Code:
    while hasinbox==false
    for i in 0...$PokemonStorage.maxBoxes
    for j in 0...$PokemonStorage.maxPokemon(i)
    hasinbox=($PokemonStorage[i][j]==species)
    end
    end
    end

    This is creating an endless loop for you. You don't even need the while here.

    Code:
    for i in 0...$PokemonStorage.maxBoxes
    for j in 0...$PokemonStorage.maxPokemon(i)
    if $PokemonStorage[i][j]==species
    hasinbox=true
    end
    end
    end
     
    Thanks,
    I've changed my it and now it doesn't crash, but it only show's me a grey pokeball even when I've that species in my computer.
     
    $PokemonStorage[j] is a PokeBattle_Pokemon object. You're trying to compare it to a number, which is obviously never going to be the same. Use if $PokemonStorage[j] && $PokemonStorage[j]==species instead.
     
    To be honest, I don't really understand why $PokemonStorage[j]"has to be put infront, but it works now exactly as I'd like it.
    (I only had to change it into: $PokemonStorage[j] && $PokemonStorage[j].species==species)
    So thank you mej71 and Maruno, my problem is solved.
     
    Code:
    for i in 0...$PokemonStorage.maxBoxes
      for j in 0...$PokemonStorage.maxPokemon(i)
        if $PokemonStorage[i][j]==species
          hasinbox=true
        end
      end
    end
    I really suggest you to use a 'break' line after 'hasinbox=true', since there's no meaning for continuing searching something that you already found. I also suggest for creating a boolean array with all species that you have in the box rather than checking the ENTIRE box storage for every single line. You earn a lot in performance.
     
    Back
    Top