• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Script: [v17+] Roaming Icon on Map

FL

Pokémon Island Creator
  • 2,544
    Posts
    14
    Years
    • Seen yesterday
    [PokeCommunity.com] [v17+] Roaming Icon on Map

    Displays icons on map for roaming pokémon.

    Link

    Tested on Essentials v19.1, v20.1 and v21.1. More versions on link (v17-18). If this script isn't working on latest Essentials version, please inform on this thread.

    Samples
    Sample image made by WolfPP and Grand Emperor of Zelron:
    [PokeCommunity.com] [v17+] Roaming Icon on Map

    Formatted for Essentials: Grand Emperor of Zelron's files | WolfPP's files.

    Sample files for Ho-Oh, Lugia, Xerneas, Yveltal, Volcanion and Marshadow made by wrigty12.

    Enamorus by WolfPP.
     
    Last edited:
    I just tried this out in my game, and unfortunately, it didn't work. I don't think these are compatible with Marin's Better Region Map.
     
    It works for version 16, if not, do you have any future plans to adapt it?
     
    I tried it on 16 and 17, it only goes on 17. When you do all the same steps, 16 does not recognize drawRoamingPosition.

    Great job
     
    Thx for this script, it works vry nice. But there is an issue, it doesn't have support for games that have more than one region. I have 4 regions on my fangame and i can see icons from other regions at the same time in one town map. So how can i fix this little issue?
     
    Thx for this script, it works vry nice. But there is an issue, it doesn't have support for games that have more than one region. I have 4 regions on my fangame and i can see icons from other regions at the same time in one town map. So how can i fix this little issue?
    Good catch! I updated the script with the fix.
     
    I have an issue, were the icon disappears from the map, after I encounterd the Pokémon once. Anyone knows, why?
    I'm using Essentials v17.2.
     
    I have an issue, were the icon disappears from the map, after I encounterd the Pokémon once. Anyone knows, why?
    I'm using Essentials v17.2.
    Because the value on $PokemonGlobal.roamPokemon array converts from a boolean into a PokeBattle_Pokemon after first encounter and the script isn't handling this.

    Fixed! Just replace the script.
     
    One of my test players gets this error, when he's opening the map:

    Pokémon XXX
    ---------------------------
    Script 'RoamingIcon' line 22: NoMethodError occurred.

    undefined method `[]' for nil:NilClass
    ---------------------------
    OK
    ---------------------------

    Whats interesting is, that I dont get this error at all, but he does.
     
    One of my test players gets this error, when he's opening the map:

    Pokémon XXX
    ---------------------------
    Script 'RoamingIcon' line 22: NoMethodError occurred.

    undefined method `[]' for nil:NilClass
    ---------------------------
    OK
    ---------------------------

    Whats interesting is, that I dont get this error at all, but he does.
    I don't know how to reproduce this bug, so I don't know how to fix it properly. Try adding the line:

    Code:
    next if !RoamingSpecies || !RoamingSpecies[roamPos[0]] || !roamPos || !$PokemonGlobal.roamPokemon

    after line

    Code:
    for roamPos in $PokemonGlobal.roamPosition
     
    Does this work for v18.1?

    EDIT: Nevermind. I got it to work. Awesome! I'm glad I found this. Thanks for making this script!
     
    Last edited:
    The script doesn't seem to work in conjunction with Marin's Better Region Map, would there be any way to solve it?
     
    The script doesn't seem to work in conjunction with Marin's Better Region Map, would there be any way to solve it?

    I'm working on it, but I haven't made a big progress. I tried to paste this before def initialize:

    Code:
    def drawRoamingPosition(mapindex)
        mapindex = $game_map ? pbGetMetadata($game_map.map_id, MetadataMapPosition) : nil
        for roamPos in $PokemonGlobal.roamPosition
          roamingData = RoamingSpecies[roamPos[0]]
          active = $game_switches[roamingData[2]] && (
            $PokemonGlobal.roamPokemon.size <= roamPos[0] || 
            $PokemonGlobal.roamPokemon[roamPos[0]]!=true
          )
          next if !active
          species=getID(PBSpecies,roamingData[0])
          next if !species || species<=0
          pokepos = $game_map ? pbGetMetadata(roamPos[1],MetadataMapPosition) : nil 
          next if mapindex[0]!=pokepos[0]
          x = pokepos[1]
          y = pokepos[2]
        sqwidth = PokemonRegionMap_Scene::SQUAREWIDTH
        sqheight = PokemonRegionMap_Scene::SQUAREHEIGHT
          @sprites["roaming#{species}"] = IconSprite.new(0,0,@viewport)
          @sprites["roaming#{species}"].setBitmap(getRoamingIcon(species))
          @sprites["roaming#{species}"].x = -sqwidth/2+(x*sqwidth)+ 240
          @sprites["roaming#{species}"].y = -sqheight/2+(y*sqheight)+ 187.5
        end
      end
      
      def getRoamingIcon(species)
        return nil if !species
        fileName = sprintf("Graphics/Pictures/mapPokemon%03d", species)
        ret = pbResolveBitmap(fileName)
        if !ret
          fileName = "Graphics/Pictures/mapPokemon000"
          ret = pbResolveBitmap(fileName)
        end
        return ret
      end

    Then on initialize I added this:

    Code:
    mapindex = 0

    And under:
    Code:
    gender = $Trainer.gender.to_digits(3)

    Pasted this:
    Code:
    drawRoamingPosition(mapindex)

    As I said, I added on the beginning of the class, so maybe changing the position you place everything makes it work.

    For now, the map doesn't crash and still shows everything but the roaming icon, so if someone can help me on what I have to change it would be very helpful :D
     
    Back
    Top