• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[17.2] B2W2 Style Habitat List

Boonzeet

Pokémon Secrets of the Ages Developer
188
Posts
15
Years
  • Habitats
    DE6bn2a.png
    1avVdct.png
    4H1odnO.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 this 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:
    Spoiler:


    Then lastly, make these changes to PScreen_PokedexMain
    Spoiler:


    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]]
    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
    Code:
    [0,15,6] => 34,    # Ice Cave
    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 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.

    Credit must be given if used.

    Possible Bugs

    Some users are reporting "Incorrect kRGB chunk" errors. This appears to be an error in older versions of RGSS DLL and RMXP handling PNG files. Please post your error log from C:/Users/{your username}/Saved Games/{your project}/errorlog.txt so I can see more detail if this does occur.
     
    Last edited:
    226
    Posts
    8
    Years
    • Seen Jul 19, 2023
    Hey, thank you for this!

    Two quick remarks:
    - Line 53 of the main script (#EncounterTypes::PhenomenonGrass) should be commented out if you're not using Phenomena;
    - Folder "Habitats" in Pictures should be renamed to "Habitat"
     

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • Hey, thank you for this!

    Two quick remarks:
    - Line 53 of the main script (#EncounterTypes::PhenomenonGrass) should be commented out if you're not using Phenomena;
    - Folder "Habitats" in Pictures should be renamed to "Habitat"
    Neither of these need doing anymore - I uploaded an outdated script.

    All references have been fixed and the Phenomenon line commented out. Sorry for the mistake!
     
    465
    Posts
    7
    Years
    • Seen yesterday
    this is a fantastic script and recreation; so one minor bug or issue, is if i add more habitat types, the habitat list doesnt stop at 3 or if i dont define all of them in color it crashes.

    anyway to stop it on each habitat at the 3 as you have it? besides that it works fantastic, i do get incorrect kGRD (something along the lines of that) but thats just how i probably copied it across, and probably not on your side (first time i've ever encountered it besides on my own custom stuff)
     

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • this is a fantastic script and recreation; so one minor bug or issue, is if i add more habitat types, the habitat list doesnt stop at 3 or if i dont define all of them in color it crashes.

    anyway to stop it on each habitat at the 3 as you have it? besides that it works fantastic, i do get incorrect kGRD (something along the lines of that) but thats just how i probably copied it across, and probably not on your side (first time i've ever encountered it besides on my own custom stuff)

    The script is only configured to support 3 habitat types at once. If you need more, you'll need to make some scripting changes. What do you mean by define them in color?

    On the kGRD, I've never encountered this. I've just tested this on a fresh version of Essentials and it's fine - are you using 17.2 and legit RMXP, and what other scripts do you have?


    i'm getting "incorrect kGRD chunk index value" errors

    I've never seen this issue with RMXP before. Where are you getting these errors, and how did you copy the script across? What version of RMXP are you using?

    BOTH USERS: Please upload your error log file if you have one as this is not a standard Essentials or Ruby error.
    This will be located at C:\Users\{your username}\Saved Games\{your game}\errorlog.txt
     
    Last edited:
    44
    Posts
    6
    Years
    • Seen Jul 13, 2021
    Hi! Is there a way to make this compatible with Marins Better Region Map? And how would I make it so that you have to talk to an event to open the Habitat Menu, instead of doing it through the dex?

    Found out how to do the last part actually!
    Seems to work fairly well so far even with the Better Region Map thing.
    Havent tested it through the dex or the region map directly, but thats fine, as I wanted to use it through an event from the start. :)
     
    Last edited:

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • Hi! Is there a way to make this compatible with Marins Better Region Map? And how would I make it so that you have to talk to an event to open the Habitat Menu, instead of doing it through the dex?

    Found out how to do the last part actually!
    Seems to work fairly well so far even with the Better Region Map thing.
    Havent tested it through the dex or the region map directly, but thats fine, as I wanted to use it through an event from the start. :)

    It *should* work with Marin's map, let me know if you encounter any issues with it. It should be fairly easy to tweak it to work otherwise.

    I think you've said you've already solved it, but any script tag calling pbLoadHabitatList will work!
     
    220
    Posts
    9
    Years
  • i'm getting "incorrect kGRD chunk index value" errors too like zeak. My rpg maker xp v102 and essentials v17.2. And i don't have any script that messes with the Dex, but, i have advance dex by FL, but i don't think that they are "clashing with each other".
     
    465
    Posts
    7
    Years
    • Seen yesterday
    The script is only configured to support 3 habitat types at once. If you need more, you'll need to make some scripting changes. What do you mean by define them in color?]

    Hmm thought so, the colour was about the boxes on the habitat screen but i figured a fix;
    in "def drawItem(index, count, rect)"
    Code:
    HabitatConfig::TypeOrder.each do |n|
    Under that i added;
    Code:
    next if n==:
    then any of my added types with || after each one. worked like a charm.

    also in regard to kRGD (along those lines) its down to the files colors and only happens on the ones you've got set to a certain amount (the background, habitat icons etc.) simply just making a new file without color limitations fixes it. probably has an issue with zips too, only ideas though.
     
    Last edited:

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • Hmm thought so, and its not exactly color but the bit where it changes the habitat tile color based on the type (on the habitat list under the ! and pokeballs) if not defined there its crashes but clearly not the bug here. (in "def drawEncounterIcon(i, type, encounter, rect)") Mid righting this i figured a fix;
    in "def drawItem(index, count, rect)"
    Code:
    HabitatConfig::TypeOrder.each do |n|
    Under that i added;
    Code:
    break if n==:
    then any of my added types with || after each one. worked like a charm.

    also in regard to kRGD (along those lines) its down to the files colors and only happens on the ones you've got set to a certain amount (the background, habitat icons etc.) simply just making a new file without color limitations fixes it. probably has an issue with zips too, only ideas though.

    Instead of doing this, just add your custom types to HabitatConfig::TypeOrder
     

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • 465
    Posts
    7
    Years
    • Seen yesterday
    Instead of doing this, just add your custom types to HabitatConfig::TypeOrder

    Strange they were already there which is what i thought was breaking it (i did edit my message but you had posted, i changed break to next just incase any after that i wanted to show they wouldnt) it works fine like this.

    Did ask it in the past post (ill remove it from it since i dont wanna repeat myself) in the town map/region some sections wont show (map extras) or even with fly wont let you until you've been there, the script seems to just show all so is there a way to hide areas until say a switch or a new metadata is on?
     

    Boonzeet

    Pokémon Secrets of the Ages Developer
    188
    Posts
    15
    Years
  • in the town map/region some sections wont show (map extras) or even with fly wont let you until you've been there, the script seems to just show all so is there a way to hide areas until say a switch or a new metadata is on?
    This is the same behaviour as Gen 5 - Habitats are only visible once one map belonging to the habitat has been visited. The determining code for this is in two places: self.getHabitatList for the Pokedex and self.getIndexByRegionCoords for the region map. The first script filters out options for the menu list based on 'Habitat.visited?' and the second returns -1 (not found) index for region map if the maps aren't visited. Feel free to add if statements instead.
     
    150
    Posts
    8
    Years
    • Seen Jul 13, 2023
    i already use it for 16.2; minus finding where to put it in the pokedex the rest is all compatible.

    I've made enough edits to this script that I'm having trouble figuring out where to put it.
    Where did you put the Pokedex section on 16.2? I tried putting it below @sprites["searchbg"].visible=false in the PScreen_Pokedex section, but I'm not sure that's the right place.
     
    Back
    Top