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"
"EncounterType"
"Overworld_WildEncounters"
"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