• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • 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] Modifying the Cave encounters

  • 1
    Posts
    1
    Years
    • Seen Sep 30, 2024
    Hello!

    I've been slowly developing my first game and i'm running into an obstacle. I'm designing a route with a grass path and a beach path, the idea being that on the grass path you'd get tall grass encounters and on the beach path cave-style encounters. The problem is now that setting up Cave encounters for the map means they trigger everywhere that isn't a tall grass tile.
    I believe I've found the part in the Essentials Script Editor that dictates how encounters are generated, in Overworld_WildEncounters.
    # Returns whether the player's current location allows wild encounters to
    # trigger upon taking a step.
    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 false
    end
    Now I'd like to know if it's possible to modify that bit of code so Cave encounters only trigger on rock/sand tiles.
     
    +1 not because I have a solution but because I would also like a good answer for this.

    You can always go oldschool and just copy paste a bunch of events on the sand that trigger a random wild battle when the player steps on them.
     
    I think a better solution to this would be to go to the tileset, copy-paste an existing ground tile, set up that tile to be a separate value for encounter category (database > script editor > [[ hardcoded data ]] > TerrainTag). I'm not sure if this would work, but it might be worth trying.

    A far easier solution would be to do as above. Set up an event that triggers by player touch. Start the event command line with rolling a variable for a number. If the outcome is A~B, nothing happens. If the outcome is C~D, initiate a wild battle with one of the possible encounters. If the outcome is E~F, initiate a wild battle with a second possible encounter. Repeat for however many different species you want to be encounterable on the beach as a fake cave encounter.
     
    Back
    Top