• 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.
  • Apologies if you've had troubles connecting to the site, you may need a VPN to access it. Staff are also facing issues connecting, so if it's urgent please message Cat on-site or through Discord directly.
  • Hey Guest, staff applications are open! If you are interested in becoming a forum staff member and/or Discord staff member, please apply through this Google Form before April 2! You can also message Cat with any questions.
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,956
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from drdoom76

Back
Top