• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

v21.1 Map Encounter Version - Selection Display V1.0

This resource pertains to version 21.1 of Pokémon Essentials.
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.

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

1699791141370.png
Credits
Dr.Doom76
Author
drdoom76
Views
1,474
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from drdoom76

Back
Top