• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] New Encounter Type not working

  • 2
    Posts
    3
    Years
    • Seen Mar 24, 2022
    I made a new encounter type, and it isn't working for some reason. It keeps using the Land encounter set instead of the one I gave it. Can someone tell me what I did wrong?
    Here's my code for reference:

    These are from the TerrainTag group:
    Code:
    attr_reader :darkgrass_wild_encounters
    Code:
    @land_wild_encounters = hash[:land_darkgrass_encounters] || false
    Code:
    GameData::TerrainTag.register({
      :id => :DarkGrass,
      :id_number => 17,
      :battle_environment => :TallGrass,
      :shows_grass_rustle     => true,
      :darkgrass_wild_encounters => true,
      :double_wild_encounters => true
    })
    This is from the EncounterType group:
    Code:
    GameData::EncounterType.register({
      :id => :DarkGrass,
      :type => :darkgrass,
      :trigger_chance => 21,
      :old_slots      => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
    })
    And these are from the Overworld_WildEncounters group:
    Code:
    def has_darkgrass_encounters?
        GameData::EncounterType.each do |enc_type|
          next if ![:darkgrass].include?(enc_type.type)
          return true if has_encounter_type?(enc_type.id)
          end
        return false
      end
    Code:
    def encounter_possible_here?
        return true if $PokemonGlobal.surfing
        terrain_tag = $game_map.terrain_tag($game_player.x, $game_player.y)
        return false if terrain_tag.ice
        return true if has_cave_encounters?   # i.e. this map is a cave
        return true if has_land_encounters? && terrain_tag.land_wild_encounters
        return true if has_darkgrass_encounters? && terrain_tag.darkgrass_wild_encounters
        return false
      end
    Code:
          if has_darkgrass_encounters? && $game_map.terrain_tag($game_player.x, $game_player.y).darkgrass_wild_encounters
            ret = find_valid_encounter_type_for_time(:DarkGrass, time) if !ret
          end
     
    Back
    Top