- 55
- Posts
- 5
- Years
- Seen yesterday
I'm pretty new to coding for pokemon essentials so the functionality is fairly limited and my code is probably a bit messy, but I tried my best.
It was mostly based off code snippets from the debugger and google-fu.
If someone has feedback for me or can improve upon it, hit me up!
Also I wasn't sure if this already existed or not, but I hope someone finds it useful. 😊
If you do find use for it, please credit me for it in your game.
Confirmed supported versions:
Pokemon Essentials 16.2, 17.2, 18, 18.1 and 18.dev (github version)
What this script does:
It adds two methods to the game that help track the current location of your roaming pokémon.
Index in this instance is the order of the pokemon in the RoamingSpecies Array as defined in the Settings script of your project.
For example, you have Entei, Suicune and Raikou defined in it. Then you would use pbcheckRoaming(1) to get Suicune's location. (arrays start counting from zero)
Why I made it:
I had trouble getting the Roaming mons to show up in the pokedex locations tab so this is a bit of a workaround.
How to install:
Create a new script above Main, name it RoamingTracker, copy the code and paste it in the empty code field.
Possible Uses:
You could for example make an NPC or Pokégear app that helps you track the roaming pokémon.
The Code:
It was mostly based off code snippets from the debugger and google-fu.
If someone has feedback for me or can improve upon it, hit me up!
Also I wasn't sure if this already existed or not, but I hope someone finds it useful. 😊
If you do find use for it, please credit me for it in your game.
Confirmed supported versions:
Pokemon Essentials 16.2, 17.2, 18, 18.1 and 18.dev (github version)
What this script does:
It adds two methods to the game that help track the current location of your roaming pokémon.
- pbcheckRoaming(index) gets the current location from a roaming Pokémon and returns the map name as a string.
- pbcheckRoamingMapno(index) does the same but instead returns the map id.
Index in this instance is the order of the pokemon in the RoamingSpecies Array as defined in the Settings script of your project.
For example, you have Entei, Suicune and Raikou defined in it. Then you would use pbcheckRoaming(1) to get Suicune's location. (arrays start counting from zero)
Why I made it:
I had trouble getting the Roaming mons to show up in the pokedex locations tab so this is a bit of a workaround.
How to install:
Create a new script above Main, name it RoamingTracker, copy the code and paste it in the empty code field.
Possible Uses:
You could for example make an NPC or Pokégear app that helps you track the roaming pokémon.
The Code:
Code:
################################################################################
# Roaming Tracker by TastyRedTomato
# Please give credits in your game, thanks!
#---------------------------------------
# These commands track the current map of the roaming pokemon
# (pbcheckRoaming(index)) returns a string with the map name
# (pbcheckRoamingMapno(index)) returns the map id as an integer
#
# index is the number of the roaming pokemon as is defined in Settings
# The first pokémon is 0, the second one is 1, and so on...
# Using a value that doesn't exist will result in an error
#
# The script returns a string containing the map the pokémon is currently on
# Note that even if a Pokémon is not roaming, the script will still return a value
# That's why it's important to still use your roaming switches or
# check for captured/dead mons
#
# the value "map not set" or zero respectively will be returned if
# the developer has cleared the data using the debug mode
#
################################################################################
def pbcheckRoaming(index) #this command returns the map name
pkmn = RoamingSpecies[index]
name = PBSpecies.getName(getID(PBSpecies,pkmn[0]))+" (Lv. #{pkmn[1]})"
curmap = $PokemonGlobal.roamPosition[index]
roamstatus = ""
if curmap
mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
roamstatus = "[#{mapinfos[curmap].name}]"
else
roamstatus = "[map not set]"
end
return roamstatus
end
def pbcheckRoamingMapno(index) #this command returns the map id
pkmn = RoamingSpecies[index]
name = PBSpecies.getName(getID(PBSpecies,pkmn[0]))+" (Lv. #{pkmn[1]})"
curmap = $PokemonGlobal.roamPosition[index]
roamstatus = 0
if curmap
mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
roamstatus = "#{curmap}".to_i
else
roamstatus = 0
end
return roamstatus
end
Last edited: