• 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.
Resource icon

v19 Dark Grass Like in Black and White Games 1

This resource pertains to version 19 of Pokémon Essentials.
So this doesn't work in the same way. V 19 is MUCH easier to do.

Remember to have your 1) secondary BGM at the ready, 2) secondary grass tileset, 3) you know to assign the terrain value to the tile via the debug editor

In v19 making new terrain types is actually a lot easier because now we can assign properties directly into the terrain tag itself, rather than creating like 5 different methods that checks for the the terrain and gives it their associated properties. But it can be a little trickier when you're working with EncTypes. Audio is roughly the same, apart from a terrain tag call name change.


Step 1:
in
Class:TerrainTag

add a new attr reader; it can be any name, but to save yourself from headaches I recommend you name it
attr_reader :dgrass_wild_encounters

in def intialize
add a hash that ideally matches your new variable, declare it as a bool and set its default value to false
@dgrass_wild_encounters = hash[:dgrass_wild_encounters] || false

find your Tall Grass

GameData::TerrainTag.register({
:id => :TallGrass,
:id_number => 10,
:deep_bush => true,
:land_wild_encounters => true,
:double_wild_encounters => true,
:battle_environment => :TallGrass,
:must_walk => true
})
copy/paste it. update its id number to something that is unused (best practice is to set it to lowest unused, which is 17 in vanilla essentials)
remove the :must_walk and replace :land_wild_encounters => true with your new :dgrass_wild_encounters => true

Step 2)

Go to EncounterType
and make a new encounter type by copypasting Land

GameData::EncounterType.register({
:id => :LandMorning,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})

place it after LandNight for ease of placement in your Encounter data and replace :id with DarkGrass and :type with :darkgrass.

NOTE: :darkgrass is the id of the Encounter type and :DarkGrass is the name of the encounter type the game reads from your encounter.txt file

If you want PokeRadar to activate in darkgrass replace this with:

# Returns whether land-like encounters have been defined for the current map
# (ignoring the Bug Catching Contest one).
# Applies only to encounters triggered by moving around.
def has_normal_land_encounters?
GameData::EncounterType.each do |enc_type|
return true if enc_type.type == :land || :darkgrass && has_encounter_type?(enc_type.id)
end
return false
end


tuck your :dark grass in def has_land_encounters? . This method determines that your encounter will be triggered by walking over specified tiles.
# Returns whether land-like encounters have been defined for the current map.
# Applies only to encounters triggered by moving around.
def has_land_encounters?
GameData::EncounterType.each do |enc_type|
next if ![:land, :contest, :darkgrass].include?(enc_type.type)
return true if has_encounter_type?(enc_type.id)
end
return false
end

then in def encounter_possible_here does what the method says and is a bool check on whether it is possible to generate encounters
# 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 || has_land_encounters? && terrain_tag.dgrass_wild_encounter
return false
end

after the OR evaluation you need to repeat the first check since it has to take :darkgrass from the array and checks your encounter data if it exists. You'll need to repeat the check here for every single new type of encounter grass you add.

finally this is the code that generates the encounter. notis the all caps after the ret = :DarkGrass is because it is now looking for the name of the encounter in your encounters.txt file. If you want to make each encounter time based, then add in the line ret = find_valid_encounter_type_for_time(:DarkGrass, time) if !ret, but you'd need to make a new enc type for each type of time encounter. HOWEVER, you do not need to do the last step every time if you assign the :darkgrass id to each of the timed encounters.
# Returns the encounter method that the current encounter should be generated
# from, depending on the player's current location.
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 has_land_encounters? && $game_map.terrain_tag($game_player.x, $game_player.y).dgrass_wild_encounters
ret = :DarkGrass
end
if !ret && has_cave_encounters?
ret = find_valid_encounter_type_for_time(:Cave, time)
end
end
return ret
end

3) Same as in v17.2 but actually a lot easier. go to Utilities_BattleAudio

and insert this chunk of code:
if !ret && $game_map && GameData::TerrainTag.try_get($game_player.terrain_tag).dgrass_wild_encounters== true
ret = pbStringToAudioFile("name of your wild battle theme here")
end
on line 9
Back
Top