- 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.
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.
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.# 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