• 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!
  • 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] Trying to Track Roaming Pokemon

  • 143
    Posts
    11
    Years
    • Seen Jun 11, 2021
    I'm aware that roaming legendaries can be frustrating, so I figured I'd add this feature to make them a little more bearable. Basically, I want the active legendaries to be viewed on the map whenever their switch is active and their view to go away upon capture or defeat. Not only that, but I'd also like the icons to be different to identify each legendary depending on their species. I've tried to code this myself, but it didn't work out too well.

    This code was added in PScreen_RegionMap around line 154:
    Code:
    curmap=$PokemonGlobal.roamPosition[i]
        @sprites["roamer"]=IconSprite.new(0,0,@viewport)
        @sprites["roamer"].setBitmap(pbPokemonHeadFile($Trainer.trainertype))
        @sprites["roamer"].x=-SQUAREWIDTH/2+(@mapX*SQUAREWIDTH)+(Graphics.width-@sprites["map"].bitmap.width)/2
        @sprites["roamer"].y=-SQUAREHEIGHT/2+(@mapY*SQUAREHEIGHT)+(Graphics.height-@sprites["map"].bitmap.height)/2

    And this method was added in PSystem_Utilities under the method pbPlayerHeadFile:
    Code:
    def pbPokemonHeadFile(species)
      species=getID(PBSpecies,RoamingSpecies[i][0])
      return nil if !species
      bitmapFileName=sprintf("Graphics/Pictures/mapPokemon%s",getConstantName(PBSpecies,species)) rescue nil
      if !pbResolveBitmap(bitmapFileName)
        bitmapFileName=sprintf("Graphics/Pictures/mapPokemon001")
      end
      return bitmapFileName
    end
     
    Back
    Top