• 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 Conquest 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.

[Scripting Question] New Encounter Type Help 21.1

  • 17
    Posts
    56
    Days
    • Seen Apr 16, 2025
    I'm trying to create a mountain grass tile but I'm a smooth brain neanderthal. I can get it to spawn creatures from the land and cave lists pretty easily but as far as making it its own independent tile, I can't figure it out. Also, when I have it working as a cave tile alongside a land tile, the cave tile spawn will bleed into the land spawns, but the land spawns don't bleed into the cave spawns. Not sure if I'm on the right track or making things worse lol. I just want to educate myself. I can make it work as is, but I really don't like all this guess and check and trying to piece things together through tutorials from older versions. I want to actually understand it. These are all the changes I've made so far but I don't know what I'm missing because I'm too new to know to look there. I've only got like 340 hours logged in the last month. I really don't understand very much about scripting yet. I want to change that and start contributing. I appreciate any tips and tricks given. Thank you.

    "TerrainTag"
    GameData::TerrainTag.register({
    :id => :mtngrass,
    :id_number => 25,
    :mtngrass_wild_encounters => true,
    :shows_grass_rustle => true,
    :battle_environment => :Rock
    })

    "EncounterType"
    GameData::EncounterType.register({
    :id => :mtngrass,
    :type => :mtngrass,
    :trigger_chance => 21
    })

    "Overworld_WildEncounters"
    def has_mtngrass_encounters?
    GameData::EncounterType.each do |enc_type|
    return true if enc_type.type == :mtngrass && has_encounter_type?(enc_type.id)
    end
    return false
    end


    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_mtngrass_encounters? && terrain_tag.mtngrass_wild_encounters
    return false
    end


    def encounter_type
    time = pbGetTimeNow
    ret = nil
    if $PokemonGlobal.surfing
    ret = find_valid_encounter_type_for_time(:Water, time)
    else # Land/Cave (can have both in the same map)
    if has_land_encounters? && $game_map.terrain_tag($game_player.x, $game_player.y).land_wild_encounters
    ret = :BugContest if pbInBugContest? && has_encounter_type?(:BugContest)
    ret = find_valid_encounter_type_for_time(:Land, time) if !ret
    end
    if !ret && has_cave_encounters?
    ret = find_valid_encounter_type_for_time(:Cave, time)
    end
    if !ret && has_mtngrass_encounters?
    ret = find_valid_encounter_type_for_time(:mtngrass, time)
    end
    end
    return ret
    end
     
    Back
    Top