• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
[v17+] Roaming Icon on Map

Resource [v17+] Roaming Icon on Map 1.1.3

@-FL- Hello, I installed this script according to the instructions in the Ruby source file, and am getting this error upon opening the region map via the PokeGear:
Ruby:
Expand Collapse Copy
undefined method `[]' for nil:NilClass
The error tells me it's pointing to the usage of draw_roaming_position(mapindex), which I find odd.
Any reason why this isn't working?
Essentials Version 21.1
 
@-FL- Hello, I installed this script according to the instructions in the Ruby source file, and am getting this error upon opening the region map via the PokeGear:
Ruby:
Expand Collapse Copy
undefined method `[]' for nil:NilClass
The error tells me it's pointing to the usage of draw_roaming_position(mapindex), which I find odd.
Any reason why this isn't working?
Essentials Version 21.1
I tested right here in v21.1 and I can't reproduce this bug. Recheck the instructions (images places and line position), if issue remains, test in a vanilla Essentials. If the error doesn't happen, maybe some plugin is affecting it.
 
I tested right here in v21.1 and I can't reproduce this bug. Recheck the instructions (images places and line position), if issue remains, test in a vanilla Essentials. If the error doesn't happen, maybe some plugin is affecting it.
Hey, sorry for the late reply! I tested in Vanilla Essentials and it does work, as expected.
I tested in a backup copy of my game, which does have plugins, and it worked right off the bat.
I tested it now in the current copy of the game, which is about a month newer with no additional plugins, and it does work on a NEW save file/new game. It does NOT work if I continue with the current save file I am using to debug/playtest

The entire error is the following:

Code:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

Backtrace:
UI_RoamingPokes:34:in `block in draw_roaming_position'
UI_RoamingPokes:33:in `each'
UI_RoamingPokes:33:in `draw_roaming_position'
UI_RegionMap:133:in `pbStartScene'
UI_RegionMap:342:in `pbStartScreen'
UI_Pokegear:168:in `block (2 levels) in <main>'
MessageConfig:575:in `pbFadeOutIn'
UI_Pokegear:165:in `block in <main>'
UI_Pokegear:151:in `block in pbStartScreen'
UI_Pokegear:145:in `loop'

Any clue at all as to why that's happening? It's not a huge issue but it does make debugging a tad more tedious.
 
- reply -
well, it's always recommended to not get attached to your save files, and it's always recommended to start new saves for changes or additions to make effects on the game. you don't need the same save for everything.
also, the game won't update its scripts already loaded on the save, so starning a new one forces it to load any changed you have made.
 
well, it's always recommended to not get attached to your save files, and it's always recommended to start new saves for changes or additions to make effects on the game. you don't need the same save for everything.
also, the game won't update its scripts already loaded on the save, so starning a new one forces it to load any changed you have made.
I agree starting a new save is usually the way to go when dealing with adding new plugins! I just find it so bizarre that it works on an older version of my game, loading the exact same save file, but won't work on the newer version with said save file. This is the only plugin/script change I've done that has not liked continuing with the old save file.
 
Hey, sorry for the late reply! I tested in Vanilla Essentials and it does work, as expected.
I tested in a backup copy of my game, which does have plugins, and it worked right off the bat.
I tested it now in the current copy of the game, which is about a month newer with no additional plugins, and it does work on a NEW save file/new game. It does NOT work if I continue with the current save file I am using to debug/playtest

The entire error is the following:

Code:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `[]' for nil:NilClass

Backtrace:
UI_RoamingPokes:34:in `block in draw_roaming_position'
UI_RoamingPokes:33:in `each'
UI_RoamingPokes:33:in `draw_roaming_position'
UI_RegionMap:133:in `pbStartScene'
UI_RegionMap:342:in `pbStartScreen'
UI_Pokegear:168:in `block (2 levels) in <main>'
MessageConfig:575:in `pbFadeOutIn'
UI_Pokegear:165:in `block in <main>'
UI_Pokegear:151:in `block in pbStartScreen'
UI_Pokegear:145:in `loop'

Any clue at all as to why that's happening? It's not a huge issue but it does make debugging a tad more tedious.
This gonna be a little tricky to solve since I can't replicate the issue here and I don't know what is causing it, so I can't do several tests.

Try changing code

Code:
Expand Collapse Copy
      active = $game_switches[Settings::ROAMING_SPECIES[roam_pos[0]][2]] && (
        $PokemonGlobal.roamPokemon.size <= roam_pos[0] ||
        $PokemonGlobal.roamPokemon[roam_pos[0]]!=true
      )

to

Code:
Expand Collapse Copy
      active = roam_pos && roam_pos[0] && Settings::ROAMING_SPECIES[roam_pos[0]][2] && $game_switches[Settings::ROAMING_SPECIES[roam_pos[0]][2]] && (
        $PokemonGlobal.roamPokemon.size <= roam_pos[0] ||
        $PokemonGlobal.roamPokemon[roam_pos[0]]!=true
      )

well, it's always recommended to not get attached to your save files, and it's always recommended to start new saves for changes or additions to make effects on the game. you don't need the same save for everything.
Not by me.

This is a trend by scripters, but most of save issues are very easy to fix.

Barring some special cases where supporting old saves are very trickier, I support old saves and I even took some decisions to keep save compatibility.

Same with supporting older Essentials.
 
Back
Top