• 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.
Encounter list UI (v19+)

Resource Encounter list UI (v19+) 1.1.0

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
Do you think you could share that little bit of script? It sounds very interesting to organize them.
I wanted to try to create a method on my own, but it was not possible :(
Sure! As I said I just created an array with the proper ordering I want, and then I create an empty hash that is then populated using this array. I also have removed HeadbuttHigh because I'm not using it in my game, but you can customize the order/number of encounters as you wish. This is the initialize method for the EncounterList_Scene class btw.

Ruby:
Expand Collapse Copy
  def initialize
    @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport.z = 99999
    @sprites = {}
    mapid = $game_map.map_id
    @encounter_data = GameData::Encounter.get(mapid, $PokemonGlobal.encounter_version)
    if @encounter_data
      @encounter_tables = Marshal.load(Marshal.dump(@encounter_data.types))
      #EDIT: Create new empty hash and fill it using order array.
      order =Array.new
      order = [:Land,:LandDay,:LandNight,:HeadbuttLow,:Cave,:CaveDay,:CaveNight,:Water,:OldRod,:GoodRod,:SuperRod,:PokeRadar,:BugContest]
      @ordered_table = Hash.new
      for j in 0...order.length
        for k in 0...@encounter_tables.keys.length
            if @encounter_tables.keys[k] == order[j]
                @ordered_table[order[j]]=@encounter_tables[@encounter_tables.keys[k]]
            end
        end
      end
      @max_enc, @eLength = getMaxEncounters(@ordered_table)
    else
      @max_enc, @eLength = [1, 1]
    end
    @index = 0
  end
 

NachoSama_

Rookie
Member
Joined
Mar 5, 2021
Posts
4
Sure! As I said I just created an array with the proper ordering I want, and then I create an empty hash that is then populated using this array. I also have removed HeadbuttHigh because I'm not using it in my game, but you can customize the order/number of encounters as you wish. This is the initialize method for the EncounterList_Scene class btw.

Ruby:
Expand Collapse Copy
  def initialize
    @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport.z = 99999
    @sprites = {}
    mapid = $game_map.map_id
    @encounter_data = GameData::Encounter.get(mapid, $PokemonGlobal.encounter_version)
    if @encounter_data
      @encounter_tables = Marshal.load(Marshal.dump(@encounter_data.types))
      #EDIT: Create new empty hash and fill it using order array.
      order =Array.new
      order = [:Land,:LandDay,:LandNight,:HeadbuttLow,:Cave,:CaveDay,:CaveNight,:Water,:OldRod,:GoodRod,:SuperRod,:PokeRadar,:BugContest]
      @ordered_table = Hash.new
      for j in 0...order.length
        for k in 0...@encounter_tables.keys.length
            if @encounter_tables.keys[k] == order[j]
                @ordered_table[order[j]]=@encounter_tables[@encounter_tables.keys[k]]
            end
        end
      end
      @max_enc, @eLength = getMaxEncounters(@ordered_table)
    else
      @max_enc, @eLength = [1, 1]
    end
    @index = 0
  end
I really appreciate you sharing this!
This will be very helpful for my project.
Good luck with yours!
 
Back
Top