- 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:
This is from the EncounterType group:
And these are from the Overworld_WildEncounters group:
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
})
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]
})
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