• 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.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
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:
Expand Collapse Copy
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,752
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from drdoom76

Back
Top