• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - 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.

[Scripting Question] [17.2] Detecting if the player has a species in the pc, and getting its position/manipulating and editing it.

  • 465
    Posts
    8
    Years
    • Seen Jun 17, 2024
    So, i plan to re-order my national dex, to get it out the way, but to not completely break it for old saves, i want to have something check if the species id is say 722-800 in the party or box, and change that species to 762-840, i know this is easy to do in the party iirc, but not sure of a way for the pc, i know you can get the pokemons species from the box and position, but not more than that.

    so is there a way to do that? like im assuming "for box in" etc. then "for position in" etc. and if box and positions species.id >=722 & <= 800 then id + 40?

    unsure here, if i can get pointers for party as i know its a bit funky, but its like $trainer.party[number].species or smth.

    might have just answered it myself but felt i'd be best to ask!
     
    I somehow stumbled across the solution much faster than i thought, so if anyone else is curious;
    to find a specific species in the party and change it to a specific species;
    Code:
    for i in 0...$Trainer.party.length
     if $Trainer.party[i]!=nil &&  $Trainer.party[i].species==133
       $Trainer.party[i].species=134
     end
    end
    Then to change all species (can use the above check for species but using > and <)
    Code:
    for i in 0...$Trainer.party.length
     if $Trainer.party[i]!=nil
       $Trainer.party[i].species+=1
     end
    end
    Then the same thing for storage
    Code:
    for box in 0...29 #or max storage count
     for position in 0...29
       if $PokemonStorage[position][box]!=nil
         $PokemonStorage[position][box].species+=1
       end
     end
    end
    should be able to use the species check too for box just using the same things used to change it.
    (tested changing a single pokemon, my entire party and an entire box)
     
    Back
    Top