- Pokémon Essentials Version
- v21.1 ✅
Simple script that will allow the player to choose between different Versions of the current map. Useful if you have multiple versions of a map and want the player to have a way to navigate between them. Can be called from an NPC or made into an item, whichever you choose.
Currently, can be called with pbEncounterVersion but shouldn't be too hard to modify to an item, if that's what you choose.
If you need any help with anything or run into any issues, let me know. Enjoy.
Currently, can be called with pbEncounterVersion but shouldn't be too hard to modify to an item, if that's what you choose.
If you need any help with anything or run into any issues, let me know. Enjoy.
Ruby:
def pbEncounterVersion
version_available = []
map_versions = {}
current_map_id = $game_map.map_id # Get the ID of the current map.
command = -1
# Goes through encounter data for current map and displays pushes map name and version ID.
GameData::Encounter.each do |encounter|
map_id = encounter.map
version_available.push("Map: #{$game_map.name}, Version: #{encounter.version}") if map_id == current_map_id
map_versions[map_id] ||= 0
map_versions[map_id] += 1
end
version_available.push(_INTL("Cancel"))
# If only version available is "Cancel"
if version_available.length == 1
pbMessage(_INTL("No encounters found for the current map."))
# If only versions available are "Cancel" and one other.
elsif version_available.length <= 2
pbMessage(_INTL("Sorry, there's only one version of the current map."))
else
# Displays available versions for selection.
helptext = _INTL("Please select a version")
command = pbMessage(helptext, version_available, - 1)
# If "back" is selected or "Cancel" is selected.
if command < 0 || command == version_available.length - 1
pbMessage(_INTL("Check back soon."))
else
pbMessage(_INTL("Encounter Version {1} was selected.", command))
$PokemonGlobal.encounter_version = command
end
end
end
- Credits
- Dr.Doom76