• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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!)

I apologize if this is too big of an ask, but I'm a novice when it comes to resolving merge conflicts, and would appreciate any guidance on these. These occurred when incorporating this into DizzyEgg's stuff. I've included my thoughts on each, to explain where my logic takes me. I guess it's not really important to explain, but I want to show a good effort that I'm trying to learn.

In
Code:
wild_encounter.c

Spoiler:


In
Code:
wild_encounter.h

Spoiler:


In
Code:
pokemon.c
Spoiler:


In
Code:
pokemon.h

Spoiler:


In
Code:
global.h

Spoiler:


Finally, in
Code:
build.yml

Spoiler:


Aside from these, there were a couple (namely
Code:
battle_message.c
and
Code:
battle_main.c
where I think the solution was just to replace the old code with the new code.

Anyway, I would appreciate any guidance on these, as well as any further explanation for what the code does and why it conflicts.
 

No problem! It is sometimes tough to determine what code to keep. From what I can tell:
  • wild_encounter.c - keep both parts of the conflict
  • wild_encounter.h - keep both parts of the conflit
  • pokemon.c - this one is tricky because you need parts of both. I just pushed an update to the dexnav branch to handle the shiny charm, so if you pull again you would want to keep the stuff with FlagGet(FLAG_CHINY_CREATION) only.
  • pokemon.h - RHH changed how hidden abilities work - I've just updated the branch to handle this as well
  • global.h - you want to keep dexNavSearchLevels and dexNavChain, so the bottom part of the conflicts :)
  • build.yml - To be honest I have no idea, but I would see what that file looks like in pret and choose whatever conflict matches their repo

Hope this helps!
 
Can you create a dexnav patch cuz it is so much difficult for me to implement in my Rom I have found firered patch but can't find emerald so please give me dex nav patch for emerald
You might have confused decomp romhacking with binary romhacking. You don't "patch" roms when working with decomps
EDIT: Oops someone already posted a response before i posted haha
 
Does it require a lot of edits to make DexNav accessible from PokeNav instead of the start menu?
I don't wanna bother anyone with doing this for me, but I doubt I have enough proficiency in C ('cuz I don't have any :P) to be able to implement this all on my own.
So, what things should be changed?
 
Does it require a lot of edits to make DexNav accessible from PokeNav instead of the start menu?
I don't wanna bother anyone with doing this for me, but I doubt I have enough proficiency in C ('cuz I don't have any :P) to be able to implement this all on my own.
So, what things should be changed?

Adding a new pokenav tab would be difficult, replacing an existing tab would be easier, but still challenging. I can help with the latter, having done that in Pokemon Voyager myself. Feel free to contact me on discord (same username) if you want :)
 
Just a question ghoulslash, I got the newer version of pokeemerald, and merge your following branches by this order:
saveblock -> dexnav -> item_dec

And the save ALWAYS gets corrupted, any tips on that ?
 
Last edited:
[
[*]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.

Hi Ghoul - when determining the size needed for the saveblock, how does this count pokemon? For example, I've pulled in the RHH Pokemon Expansion, but I only plan on having 400 mons in the dex (but leaving the rest in the code). Would it require 1 byte for each of the ~900 mons in the PokemonExpansion, or would it only track the 400 that were declared in the dex? Or is it basing it off what's been set up in wild encounters only, and thus using even less space?

EDIT: Answered on the discord! Thanks.
 
Last edited:
Could you please post the answer here as well as it is valuable information.
I'd also like to know how it is calculated.

EDIT: Answered on the discord! Thanks.

In the struct SaveBlock1 you got u8 dexNavSearchLevels[NUM_SPECIES]; which means that for each species you need one Byte.
You also have to consider whether or not you internally consider forms as their own species because then they also take a Byte each.

Thanks to SBird and ghoulslash for the answer.
 
Last edited:
When compiling I kept getting errors like this "src/battle_util.c: In function `GetBattlerFriendshipScore':
src/battle_util.c:2075: structure has no member named `flags'". Usually the line has a .flags.
 
When compiling I kept getting errors like this "src/battle_util.c: In function `GetBattlerFriendshipScore':
src/battle_util.c:2075: structure has no member named `flags'". Usually the line has a .flags.
Sounds like a bad merge of the feature in a project using the expansion, completely unrelated to the DexNav itself.
The GetBattlerFriendshipScore uses species flags, which are declared in the SpeciesInfo struct at include/pokemon.h, so make sure the variable is present there.
https://github.com/rh-hideout/pokeemerald-expansion/blob/upcoming/include/pokemon.h#L334
 
how to enable detector mode?
[*]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.
If you check the code changes this feature branch makes, you'll see that FLAG_SYS_DETECTOR_MODE is a regular script flag.
You can set it wherever you want. A script the Player is always bound to activate in their playthrough, EventScript_ResetAllMapFlags which is a script that triggers whenever you pick New Game, etc.
 
Back
Top