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

[Pokeemerald] DexNav (with Detector Mode!)

239
Posts
8
Years
    • Seen Apr 15, 2024
    [Pokeemerald] DexNav & Detector Mode

    This adds a simplified DexNav including search and detector modes into pokeemerald. Open the GUI to view your pokedex progress on the current map and search for a specific pokemon, or if the detector mode is enabled, hidden pokemon may pop up out of the grass as you pass!

    I've also added a creeping feature! If you are in search mode (from either manual or detection) and hold A, the player will walk at a slow speed. You must creep towards the rustling grass/cave dust/water ripple within 2 tiles, or the pokemon will flee! The distinction is best shown in the grass search mode GIF below.

    DexNav Search Mode:
    DexNav (with Detector Mode!)
    DexNav (with Detector Mode!)
    DexNav (with Detector Mode!)


    Detector Mode: Hidden Wild Encounters
    DexNav (with Detector Mode!)


    Here is the repo. Details on adding the branch to your project at the bottom of the post.

    Important Info:
    • A dexNavSearchLevels field has been added to saveblock1. It requires a byte per pokemon, so by default there is not enough space in any saveblock for such a large structure. See this post for freeing up some space
    • Press START at any time to cancel a search. I wish I could have fit this on the search window, but space was scarce


    Customizable Options: include/dexnav.h
    • DEXNAV_TIMEOUT - number of seconds until the pokemon will flee
    • SNEAKING_PROXIMITY - the player must be walking or creeping within this number of tiles. Running/Biking will cause the pokemon to flee
    • CREEPING_PROXIMITY - the player must be creeping within this number of tiles or the pokemon will flee
    • MAX_PROXIMITY - if the player moves this number of tiles away, the hidden pokemon will run away
    • HIDDEN_MON_STEP_COUNT - number of steps until a hidden pokemon may appear
    • HIDDEN_MON_SEARCH_RATE - percent chance of any hidden pokemon appearing after X steps
    • HIDDEN_MON_PROBABILTY - probability of the detected pokemon being hidden-exclusive
    • Search Bonus Probabilities - see dexnav wiki


    GUI/Search Mode Info:
    • The GUI is by default added to the start menu when FLAG_SYS_DEXNAV_GET is set. No poketools submenus or anything. Run DexNavGuiInit with a callback argument to access from elsewhere.
    • In the GUI, press "R" on a pokemon to register it to VAR_DEXNAV_SPECIES. Pressing "R" in the overworld will then perform a search for that species, if they are to be found on the map
    • FLAG_SYS_DEXNAV_SEARCH is set when searching is in progress. You do NOT need to manually toggle this flag
    • A Pokeball icon will appear in the corner of each GUI environment when you have caught all of the unique species in the area
    • You can search for a pokemon when you've seen it in any battle. More bonuses are possible when the species is caught, however.
    • Search levels increment after any encounter, capping at 255.


    Detector Mode Info:
    • The three species at the bottom of the GUI are for hidden pokemon. These are map specific.
    • Adding hidden mons:
      Spoiler:
    • Detector mode is inaccessible until FLAG_SYS_DETECTOR_MODE is manually set. Until then, ?? icons will appear on the GUI even if the hidden pokemon species has been seen/caught.
    • VAR_DEXNAV_STEP_COUNTER is a step counter for finding hidden species. You do not need to manually access this variable
    • Detector mode will only work if there is hidden_mons data on the map, even though detector mode works with the regular encounter data. This is to prevent any extra CPU usage on maps we don't want them on, as there can sometimes be a brief lag while searching (you can change if (++attempts > 20) in TryFindHiddenPokemon if this is a problem)
    • An exclamation mark appears inside the search icon window if the detected pokemon is a hidden-exclusive pokemon

    Other Info:
    • DexNav Chaining - using either detector mode or search mode to either kill or capture species increases the chain value. The current chain is shown in the bottom right of the search window. It increases the chances of the hidden pokemon being shiny.

    How To Add:
    • git remote add ghoul https://github.com/ghoulslash/pokeemerald
    • git pull ghoul dexnav
    • sort out any merge conflicts:
      Spoiler:

    Known Bugs:
    • None yet. Please post or message me on discord (ghoulslash#3839) with any concerns

    Credits:
    • CFRU dexnav gui source
    • FBI/Blah for original dexnav code (an extremely impressive feature for the time it was created in)
     
    Last edited:
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    Incredible work! Works like a charm in a quick test, gonna have a closer look tomorrow. And thanks for sharing!
     
    10
    Posts
    9
    Years
    • Seen Jul 4, 2023
    Do I add this straight into cd pokeemerald and is this compatible with DizzyEggs Project?
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    Do I add this straight into cd pokeemerald and is this compatible with DizzyEggs Project?

    It is compatible, yes. There might be some merge conflicts but nothing major.

    And you should be doing the "git remote add", "git pull" from your pokeemerald directory.
     
    10
    Posts
    9
    Years
    • Seen Jul 4, 2023
    error: Your local changes to the following files would be overwritten by merge:
    data/event_scripts.s
    src/battle_setup.c
    src/party_menu.c
    Please commit your changes or stash them before you merge.
    Aborting
    I keep getting this error. Am I forgetting to do something? Also sorry about the questions this is my first time using decomp.
     
    49
    Posts
    5
    Years
    • Seen Dec 27, 2023
    you made changes to the files listed and before beeing able to pull someone elses changes you have to commit your local one.
    Code:
     git commit -m "your description goes here"
     
    50
    Posts
    6
    Years
    • Seen Oct 20, 2023
    ghoulslash

    You are nothing short of awesome. I like most of the features you create. Very impressive!
     
    45
    Posts
    6
    Years
    • Seen today
    Would you be able to go into more detail with the conflict merges with DizzyEgg's engine? I've been trying to set this up with my repository for a while but keep getting errors.
     
    199
    Posts
    14
    Years
    • Seen Jul 6, 2022
    Is it possible to make it compatible with Land Night Encounters?
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    Would you be able to go into more detail with the conflict merges with DizzyEgg's engine? I've been trying to set this up with my repository for a while but keep getting errors.

    What errors specifically? You may have some conflicts but I don't think they are too complicated.


    Is it possible to make it compatible with Land Night Encounters?
    It's certainly possible, I know AsparagusEduardo did it for their hack. Unfortunately it's not on a separate branch. but the implementation should be easy enough. You basically want to swap out the encounter data based on the time of day. Eg. at this part of the code and here for hidden mon, as well as in GetEncounterLevelFromMapData. Basically anywhere that references gWildMonHeaders. Hope this helps!
     

    Dvsein

    Dark Tyranitar
    5
    Posts
    3
    Years
  • I use the DizzyEgg's engine and this is my error while compiling. Excuse my English, I use a translator. If you could help me it would be great, thanks.

    Spoiler:

    Pd: the dizzyegg engine was working before I put in the new dexnav

    <3
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • src/battle_anim_water.c: In function `AnimTask_CreateSurfWave':
    src/battle_anim_water.c:1012: `B_NEW_SURF_PARTICLE_PALETTE' undeclared (first use in this function)
    First things first, make sure that B_NEW_SURF_PARTICLE_PALETTE is present in include/constants/battle_config.h.
    Secondly, make sure that the preprocessor directive that defines the battle_engine branch in your project is present at include/global.h.
    At the same time, make sure that include/global.h is being included in your src/battle_anim_water.c file. It should be right at the top of the file.
     
    Last edited:

    Dvsein

    Dark Tyranitar
    5
    Posts
    3
    Years
  • First things first, make sure that `B_NEW_SURF_PARTICLE_PALETTE` is present in `include/constants/battle_config.h`.
    Secondly, make sure that the preprocessor directive that defines the battle_engine branch in your project is present at include/global.h.
    At the same time, make sure that include/global.h is being included in your src/battle_anim_water.c file. It should be right at the top of the file.

    I made sure that `B_NEW_SURF_PARTICLE_PALETTE` was and is there.

    The second point I did not understand, if you could explain me by inbox it would be great (in Spanish <3 please) and the third point, I also made sure and if it is.

    spanish:
    Spoiler:


    EDIT:
    Spoiler:


    NEW EDIT:

    This is the error now
    Spoiler:


    hehe <3

    Thanks you so much!
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • The second point I did not understand, if you could explain me by inbox it would be great (in Spanish <3 please)
    English: I rather leave my responses here, in case they can be useful to anyone else at some point.
    Basically, just make sure that the BATTLE_ENGINE constant is defined in include/global.h.

    Spanish: Preferiria dejar mis respuestas por aquí, en caso de que le puedan servir a alguien más.
    Basicamente, asegurate de tener la constante BATTLE_ENGINE definida en include/global.h.
    Lo unico que toque habian sido los MERGE, que sale el >>>>>>HEAD, ========, y el otro con muchos caracteres, sera que me equivoque ahí como para empezar todo de cero? :(
    English: I mean, it is possible you solved a merge conflict incorrectly, yeah. It's hard to tell if that's the case though, since there's just not enough information to determine it.
    Spanish: Pues, si es posible que hayas resolvido un conflicto de fusión incorrectamente, sí. Es dificil decir si ese es el caso pero, ya que no hay suficiente información para determinarlo.
    This is the error now
    Spoiler:
    English: Check the Lines 30 and 39 of your src/battle_anim_water.c, and compare them with Ghoulslash's, to see if you spot any differences.
    Alternatively, check the declarations of the AnimSmallBubblePair and AnimWaterPulseBubble functions which can be found in include/battle_anim.h.

    Spanish: Chequea las Lineas 30 y 39 de tu src/battle_anim_water.c, y comparalas con las de Ghoulslash, para ver si puedes notar alguna diferencia.
    Alternativamente, chequea las declaraciones de las funciones AnimSmallBubblePair y AnimWaterPulseBubble que las puedes encontrar en include/battle_anim.h.
     
    Last edited:
    5
    Posts
    3
    Years
    • Seen Aug 25, 2021
    A few questions:
    • Is the function for making the player walk slower when creeping missing? I noticed that gPlayerAvatar.creeping is only ever used twice: src/dexnav.c:847 (setting creeping to true), and src/dexnav.c:1067 (checking if player is creeping when within proximity)
    • How (and where) do i add hidden pokemon to each route?
    • I'm using this with pokeemerald-expansion; can I simply replace instances of gBaseStats[species].abilityHidden with gBaseStats[species].abilities[2]?
    Thanks!
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    A few questions:
    • Is the function for making the player walk slower when creeping missing? I noticed that gPlayerAvatar.creeping is only ever used twice: src/dexnav.c:847 (setting creeping to true), and src/dexnav.c:1067 (checking if player is creeping when within proximity)
    • How (and where) do i add hidden pokemon to each route?
    • I'm using this with pokeemerald-expansion; can I simply replace instances of gBaseStats[species].abilityHidden with gBaseStats[species].abilities[2]?
    Thanks!

    • You're right that is missing. I had redone the branch a couple months back for a cleaner history and forgot to add that. I've pushed pushed the relevant code.
    • The main post describes how to add hidden pokemon in detail
    • yes, you should be able to replace abilityHidden with abilities[2]. good catch
     
    5
    Posts
    3
    Years
    • Seen Aug 25, 2021
    Is TryFindHiddenPokemon supposed to be used for generating hidden wild encounters? I'm not getting any hidden encounters even after adding hidden pokemon to the maps, and that function doesn't seem to be called from anywhere, and I am not sure where I should call it. (here is a snippet of my wild_encounters.json, in case I've added the hidden pokemon wrongly)

    Also I get this weird bug when exiting the route.
    DexNav (with Detector Mode!)

    Seems to be purely visual as it doesn't look like it affects anything else, but I have no idea what is causing it.
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    Is TryFindHiddenPokemon supposed to be used for generating hidden wild encounters? I'm not getting any hidden encounters even after adding hidden pokemon to the maps, and that function doesn't seem to be called from anywhere, and I am not sure where I should call it. (here is a snippet of my wild_encounters.json, in case I've added the hidden pokemon wrongly)

    Also I get this weird bug when exiting the route.
    DexNav (with Detector Mode!)

    Seems to be purely visual as it doesn't look like it affects anything else, but I have no idea what is causing it.

    Just fixed that map-crossing bug (or rather, added back the function I forgot to push originally :p)

    TryFindHiddenPokemon is the correct function. Make sure that you have the flag, "FLAG_SYS_DETECTOR_MODE", set in game, too
     
    5
    Posts
    3
    Years
    • Seen Aug 25, 2021
    Where should I call TryFindHiddenPokemon? Would TryStartStepBasedScript be appropriate?

    Also, noticed that to add hidden pokemon, apart from the steps in the main post, you would also need to modify wild_encounters.json.txt to recognize the new "hidden_mons" field added, since I don't think porymap handles this step automatically:
    Spoiler:
     
    Back
    Top