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

Script: [v17+] Roaming Icon on Map

FL

Pokémon Island Creator
2,452
Posts
13
Years
    • Seen yesterday
    screen.png

    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:
    IKWnZ7A.png

    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:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Thanks to do that for us, FL!
    Also, G.E.Z and I made these icons for others generations (Raikou, Entei, Latios and Latias made by Game Freak):
    IKWnZ7A.png


    Just give credits to us!
     
    Last edited:
    155
    Posts
    10
    Years
    • Seen Jun 11, 2021
    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.
     
    50
    Posts
    4
    Years
    • Seen Oct 17, 2023
    It works for version 16, if not, do you have any future plans to adapt it?
     
    50
    Posts
    4
    Years
    • Seen Oct 17, 2023
    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
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    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

    The class is called PokemonRegionMapScene in v16, so it ends up defining the methods in the wrong class and you can't find them when you call.
     
    220
    Posts
    9
    Years
  • 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?
     

    FL

    Pokémon Island Creator
    2,452
    Posts
    13
    Years
    • Seen yesterday
    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.
     
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    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.
     

    FL

    Pokémon Island Creator
    2,452
    Posts
    13
    Years
    • Seen yesterday
    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.
     
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    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.
     

    FL

    Pokémon Island Creator
    2,452
    Posts
    13
    Years
    • Seen yesterday
    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
     

    LegendResearcher88

    aka TheRedeemedGamer
    4
    Posts
    3
    Years
    • Seen Nov 8, 2023
    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:

    DragonN3xus

    Still looking for the One Piece
    24
    Posts
    4
    Years
  • The script doesn't seem to work in conjunction with Marin's Better Region Map, would there be any way to solve it?
     
    71
    Posts
    4
    Years
  • 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