- Pokémon Essentials Version
- v17.2 ➖
Habitats
A B2W2-alike Habitat List for Essentials, showing players a list of explored areas and the Pokémon available in them with Pokédex and Region Map integration.
Steps to Setup
Download the linked ZIP file. Extract this and move the Habitats folder to Graphics/Pictures.
Copy and add the script Habitats.rb above main (edit with Notepad if you don't have a script editor).
Then make these changes to PScreen_RegionMap:
Then lastly, make these changes to PScreen_PokedexMain
Config
There are 3 places at the top of the file to configure Habitats.
HabitatConfig::Types
These should not change much, unless you have other non-standard encounter types to enclude. These are groups of Encounter Types to include in each Habitat.
HabitatConfig::Habitats
This is a an array with two arrays inside it. The first part is a list of Map IDs associated with the area. Please include all of them! The second is the list of Habitat Encounter types defined above. It's best not to mix Place and Grass as they use the same icon.
HabitatConfig::RegionOverride
A hash of overrides for the region map. This is for places that appear along a route, like Ice Cave in the demo project. The left hand side of the hash key is an array [regionNumber, regionMapX, regionMapY] and the right hand side is any one map from the Habitat.
To get the left hand side value quickly, press CTRL+F while on the region map view.
How to Use
Using is quite simple. Once the Trainer has been given the Pokedex, they can press F from the Pokedex List screen or on a square in the region map to view Habitat data if they have visited that area. Enjoy!
IMPORTANT: When changes have been made to the Habitat data, you'll need to add an NPC with a script command
The only way to retain the viewed data for existing saves is to run Habitats.update - but the order of Habitats must be the same as it was before, otherwise errors will occur. New Habitats can be added onto the end of the list.
Customisation
This script supports extensions with Phenomenon. To use, just uncomment the lines associated.
Each region gets a unique thumbnail. These graphics are located in Graphics/Pictures/Habitats/mapthumbRegionX.png.
A B2W2-alike Habitat List for Essentials, showing players a list of explored areas and the Pokémon available in them with Pokédex and Region Map integration.
Steps to Setup
Download the linked ZIP file. Extract this and move the Habitats folder to Graphics/Pictures.
Copy and add the script Habitats.rb above main (edit with Notepad if you don't have a script editor).
Then make these changes to PScreen_RegionMap:
UNDER this line:
Add this
ABOVE this line
Add this
Ruby:
@sprites["mapbottom"].mapdetails = pbGetMapDetails(@mapX,@mapY)
Add this
Ruby:
# HABITAT START
@sprites["habitat_button"] = IconSprite.new(Graphics.width-164, 2, @viewport)
@sprites["habitat_button"].setBitmap("Graphics/Pictures/Habitats/menu_button")
@sprites["habitat_button"].visible = $Trainer.pokedex && $Trainer.habitatData && $Trainer.habitatData.size > 0
# END
ABOVE this line
Ruby:
elsif Input.trigger?(Input::C) && mode==1 # Choosing an area to fly to
Add this
Ruby:
elsif Input.trigger?(Input::F5) && $Trainer.habitatData && $Trainer.pokedex
playerpos = (!$game_map) ? nil : pbGetMetadata($game_map.map_id,MetadataMapPosition)
if !playerpos
mapindex = 0
elsif @region>=0 && @region!=playerpos[0] && @mapdata[@region]
mapindex = @region
else
mapindex = playerpos[0]
end
if $DEBUG && Input.trigger?(Input::CTRL)
Kernel.pbMessage("Location: [#{mapindex}, #{@mapX}, #{@mapY}]")
else
find = HabitatConfig::RegionOverride.find { |key, value| key[0] == mapindex && key[1] == @mapX && key[2] == @mapY}
if find.nil?
hab = Habitats.getIndexByRegionCoords(@mapX,@mapY,mapindex,@mapdata)
else
hab = Habitats.getIndexByMapID(find[1])
end
if hab > -1
pbPlayDecisionSE
oldsprites = pbFadeOutAndHide(@sprites)
ret = -1
scene = HabitatDetailScene.new
screen = HabitatDetailScreen.new(scene)
ret = screen.pbStartScreenSingle(hab)
pbFadeInAndShow(@sprites, oldsprites)
else
pbPlayBuzzerSE
end
end
Then lastly, make these changes to PScreen_PokedexMain
UNDER these lines
Add this:
Then ABOVE these lines:
Add this:
Ruby:
@sprites["searchcursor"] = PokedexSearchSelectionSprite.new(@viewport)
@sprites["searchcursor"].visible = false
Add this:
Ruby:
# HABITAT START
@sprites["habitat_button"] = IconSprite.new(Graphics.width-58, 6, @viewport)
@sprites["habitat_button"].setBitmap("Graphics/Pictures/Habitats/menu_button")
@sprites["habitat_button"].visible = $Trainer.habitatData && $Trainer.habitatData.size > 0
# END
Then ABOVE these lines:
Ruby:
elsif Input.trigger?(Input::C)
if $Trainer.seen[@sprites["pokedex"].species]
Add this:
Ruby:
elsif Input.trigger?(Input::F5) && $Trainer.habitatData && $Trainer.habitatData.size > 0
pbLoadHabitatList
Config
There are 3 places at the top of the file to configure Habitats.
HabitatConfig::Types
These should not change much, unless you have other non-standard encounter types to enclude. These are groups of Encounter Types to include in each Habitat.
HabitatConfig::Habitats
Code:
[[49,50], [:grass,:surf,:fish]]
HabitatConfig::RegionOverride
Code:
[0,15,6] => 34, # Ice Cave
To get the left hand side value quickly, press CTRL+F while on the region map view.
How to Use
Using is quite simple. Once the Trainer has been given the Pokedex, they can press F from the Pokedex List screen or on a square in the region map to view Habitat data if they have visited that area. Enjoy!
IMPORTANT: When changes have been made to the Habitat data, you'll need to add an NPC with a script command
Habitats.setup
for existing saves. This will refresh all the Habitats data, but reset the 'viewed' status for Habitats that have been viewed.The only way to retain the viewed data for existing saves is to run Habitats.update - but the order of Habitats must be the same as it was before, otherwise errors will occur. New Habitats can be added onto the end of the list.
Customisation
This script supports extensions with Phenomenon. To use, just uncomment the lines associated.
Each region gets a unique thumbnail. These graphics are located in Graphics/Pictures/Habitats/mapthumbRegionX.png.
- Credits
- Credit must be given if used.
Please credit Boonzeet.