• 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] About the basics of Git and starting a project with the Pokeemerald-expansion

118
Posts
4
Years
  • Hey, is there any way to update a repository? Like, I'm working out of a PokeEmerald Expansion that's maybe a month old. Do you know if there's a good way to get a new version of that base without simply making a separate, updated repository and copying my files over? Hopefully, I'm making sense here.

    EDIT: Sorry, I can't read :(
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hey, is there any way to update a repository? Like, I'm working out of a PokeEmerald Expansion that's maybe a month old. Do you know if there's a good way to get a new version of that base without simply making a separate, updated repository and copying my files over? Hopefully, I'm making sense here.
    2) But now, what happens when/if we want to pull any updates from the battle_engine, the item_expansion or the pokemon_expansion?
    To address that, we'll track the original repository via git remote.
    That way we'll have our own home for our project in GitHub, and we'll also be able to pull stuff from any of the branches at will.

    We'll do this by using:
    Code:
    git remote add keyword link_to_the_repository

    "keyword" will be the word of our choice that will act as the shortcut to RHH's Pokeemerald Repository.
    "link_to_the_repository" will be the URL to it.

    In other words, something like...
    Code:
    git remote add rhh https://github.com/rh-hideout/pokeemerald-expansion

    That way, we could do git pull rhh battle_engine and stuff like that whenever we wanted.​
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Quick heads up, the Gen. 8 species data has been finally implemented in the pokemon_expansion branch.
    There's something important that I need to point out though. The src/data/pokemon/evolution.h file, which is where species evolutions are implemented, currently makes use of items that are not implemented even in the item_expansion branch. Items that are naturally used by the newly inserted species to evolve.

    Because of that, you can't just globally uncomment the stuff in that file by using Ctrl+H like I mention in the main post right now.
    Sorry for the inconvenience.

    EDIT: The same goes for src/data/pokemon/level_up_learnsets.h, since moves that are currently not incorporated into the battle_engine are used for various level up learnsets for the new species.
    Again, I apologize for the inconvenience.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Added 2 new merge conflicts solutions to the main post; one is in include/constants/moves.h and the other one's in src/data/pokemon/abilities.h.
    In both instances, the solution is to grab them from the battle_engine branch.
     
    45
    Posts
    6
    Years
    • Seen today
    editing this because my wording was confusing.

    essentially i'm trying to follow your guide but when i get to the step where i have to make a commit i get
    git add *
    warning: could not open directory 'agbcc/': Permission denied
    error: open("include/global.h"): Permission denied
    error: unable to index file include/global.h
    fatal: updating files failed
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • editing this because my wording was confusing.

    essentially i'm trying to follow your guide but when i get to the step where i have to make a commit i get
    Are you using a user account on Windows? An account without admin. privileges?
    Permission denied implies a problem with your user permissions, but as I haven't come across it myself, there isn't much I can tell you about it.
     
    22
    Posts
    14
    Years
    • Seen Oct 27, 2023
    Hello, Im attempting to start a new project and when attempting to merge the battle_engine branch with my vanilla project I've set up I got a couple of conflicts that weren't listed on the main post, specifically in battle_controller_link_opponent.c, battle_controller_link_partner.c, battle_controller_player.c, battle_controller_player_partner.c, battle_controller_recorded_opponent.c, battle_controller_recorded_player.c, battle_controller_link_safari.c, and battle_controller_wally.c. A lot of these seemed to just organize BufferCommands in each file, but some files had functions like this:

    Code:
    static void LinkOpponentHandleSetUnkVar(void)
    {
        gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
        LinkOpponentBufferExecCompleted();
    }

    And when attempting build the project, I get stopped at gBattleBufferA being the culprit, according to Cygwin.
    Here's an image:
    bmWgRpn.png


    According to the merge in GitHub Desktop, gBattleBufferA is declared in include/battle.h, where it gets removed, but there is a bufferA function that gets added elsewhere. Should I change each instance of gBattleBufferA to bufferA?

    EDIT:

    After playing with it, I discovered that you had to kind of merge the original function from the vanilla project, and the one from battle_engine:

    Code:
    static void LinkOpponentHandleSetUnkVar(void)
    {
        gUnusedControllerStruct.unk = gBattleResources->bufferA[gActiveBattler][1];
        LinkOpponentBufferExecCompleted();
    }
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • "Vanilla project" makes me think you're talking about a project created using a clean copy of Pokeemerald.
    If so, that's not comprehended by this tutorial and by extension it's off-topic for this thread.

    I explicitly tell the user to clone RHH's repository and switch to the battle_engine branch right away for a reason. Merges with upstream for the feature branches are handled on RHH's behalf every once in a while to ease things up for the user, who simply needs to git pull them normally.
     
    22
    Posts
    14
    Years
    • Seen Oct 27, 2023
    Ah, I see. I was jumping from the How to build tutorial to here. My bad, a lot of this is still a little foreign to me.
     

    pokemonmasteraaron

    The blind Pokémon Master!
    323
    Posts
    13
    Years
  • Hi!

    After following this tutorial, I ran into 1 additional merge conflict involving egg_moves.h I assumed we'd just go with pokemon_expansion's egg_moves.h.

    Anyway, that may not be relevant, I'm getting this error:
    src/pokemon.c:7689: syntax error before `0'
    The line reads: 0_1 = 4;

    Upon researching this, the line from the battle engine which we should presumably be using is structPtr->field_0_1 = 4;
    This is really really weird. Why did that randomly vanish?
    Also this still leaves a syntax error, the error now reading:
    src/pokemon.c:7689: syntax error before `->'

    Anyway it looks to me like a git bug or something?
    I am using an old version of git for windows.
    I will try to do this again when I can work up the courage. Until then, do you know why this happened?
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hi!

    After following this tutorial, I ran into 1 additional merge conflict involving egg_moves.h I assumed we'd just go with pokemon_expansion's egg_moves.h.

    Anyway, that may not be relevant, I'm getting this error:
    src/pokemon.c:7689: syntax error before `0'
    The line reads: 0_1 = 4;

    Upon researching this, the line from the battle engine which we should presumably be using is structPtr->field_0_1 = 4;
    This is really really weird. Why did that randomly vanish?
    Also this still leaves a syntax error, the error now reading:
    src/pokemon.c:7689: syntax error before `->'

    Anyway it looks to me like a git bug or something?
    I am using an old version of git for windows.
    I will try to do this again when I can work up the courage. Until then, do you know why this happened?
    Merging the branches right now seems to be rather problematic, there's an ongoing PR to solve certain label differences in the PE that cause compilation errors in a branch with the BE.

    That being said, I can't tell you anything about your merge conflict in src/pokemon.c due to the lack of information. What I can tell you is that the function where structPtr->field_0_1 = 4; appears (sub_806F2AC) looks exactly the same across all 3 feature branches and also vanilla Pokeemerald.

    In any case, conflicts unrelated to the process of merging the feature branches by following the tutorial presented in this thread and are naturally off-topic.
    On top of that, not only I don't use a GUI for Git myself, I don't make a single mention of it in the main post of this thread either.
     

    pokemonmasteraaron

    The blind Pokémon Master!
    323
    Posts
    13
    Years
  • Edit: Did it again and I must have had a copy paste error last go round. Everything worked this time except for the move label thing which I had no idea what you meant by, but now I totally do. To anyone reading this, don't be scared, you just have to replace MOVE_FAINT_ATTACK with MOVE_FEINT_ATTACK, MOVE_VICE_GRIP with MOVE_VISE_GRIP, MOVE_HI_JUMP_KICK with MOVE_HIGH_JUMP_KICK and MOVE_SMELLING_SALT with MOVE_SMELLING_SALTS. These subs should be in both the levelup header and the egg_moves header. It appears I was right to go with the pokemon_expansion version of this file, fill free to correct me if this is bad advice! I'm now off to try the last find / replace step again as last time around it resulted in 0 changes.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Edit: Did it again and I must have had a copy paste error last go round. Everything worked this time except for the move label thing which I had no idea what you meant by, but now I totally do. To anyone reading this, don't be scared, you just have to replace MOVE_FAINT_ATTACK with MOVE_FEINT_ATTACK, MOVE_VICE_GRIP with MOVE_VISE_GRIP, MOVE_HI_JUMP_KICK with MOVE_HIGH_JUMP_KICK and MOVE_SMELLING_SALT with MOVE_SMELLING_SALTS. These subs should be in both the levelup header and the egg_moves header. It appears I was right to go with the pokemon_expansion version of this file, fill free to correct me if this is bad advice! I'm now off to try the last find / replace step again as last time around it resulted in 0 changes.
    Those are the exact label differences I was talking about, and they were fixed about 2 hours ago when this PR got merged.
     

    pokemonmasteraaron

    The blind Pokémon Master!
    323
    Posts
    13
    Years
  • Oh, very nice! Still, I'm glad I figured it out on my own, for a confidence boost if nothing else! Is the fact that step 9 of your guide isn't working for me a problem or is it an out of date step? Neither the src/data/pokemon/evolution.h nor the src/data/pokemon/base_stats.h file have /* or */ seemingly anywhere in the file, so there's nothing to find / replace.

    Thanks for all your help, both in writing the guide and keeping up with the topic! I'm sure in doing so you are enabling a lot of new hacks to get developed!
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Oh, very nice! Still, I'm glad I figured it out on my own, for a confidence boost if nothing else! Is the fact that step 9 of your guide isn't working for me a problem or is it an out of date step? Neither the src/data/pokemon/evolution.h nor the src/data/pokemon/base_stats.h file have /* or */ seemingly anywhere in the file, so there's nothing to find / replace.

    Thanks for all your help, both in writing the guide and keeping up with the topic! I'm sure in doing so you are enabling a lot of new hacks to get developed!
    Ah, I guess I should update those sections.
    When RHH took over the development for the feature branches, AsparagusEduardo came up with this handy idea of having preprocessor directives to define the existence of each feature branch, so when a project has all 3 of them they all play their part normally without having the user uncomment stuff to make things work.

    It's been a while now, but this treatment was given to certain files, like for example the base_stats.h file of the pokemon_expansion branch, where every ability introduced in Gen. 4 is only being used if the BATTLE_ENGINE directive is present and every item introduced in the same time frame is only used if the ITEM_EXPANSION directive is present.
    Recently, SBird applied the same idea to the evolutions.h file, defining each item the PE makes use of for an evolution in the branch's pokemon_config.h file, if the ITEM_EXPANSION directive is not present.
    Coupled with the fact that all the moves from the BE are already defined there for compatibility reasons, everything was safely uncommented in the evolution.h.

    Thank you for bringing this up. I will update the main post right away.

    EDIT: Done. I got rid of the former 9th step, and I also included the merge conflict in src/data/pokemon/egg_moves.h too.
     
    Last edited:
    6
    Posts
    4
    Years
    • Seen Oct 1, 2021
    Hey guys, first of all thanks for your great work!

    I m currently trying to get this to work and I encountered some problems:

    1. #include "weather.h" needs to be added to pokemon.c i think

    2. after solving 1. this comes up: (https://prnt.sc/wvtyko)

    I tried commenting out everything concerning unowns, but it seems to go deeper.
    Somehow including pokemon.h is not sufficient for the code to reach some of the functions defined in pokemon.c .
    Sadly my understanding of C is not good enough to find out why :(

    3. after commenting out unown specific code: (https://prnt.sc/wvw2n4)
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hey guys, first of all thanks for your great work!

    I m currently trying to get this to work and I encountered some problems:

    1. #include "weather.h" needs to be added to pokemon.c i think
    There's a new merge conflict in src/pokemon.c when merging in the pokemon_expansion.
    I just edited the main post mentioning it.
    2. after solving 1. this comes up: (https://prnt.sc/wvtyko)

    I tried commenting out everything concerning unowns, but it seems to go deeper.
    Somehow including pokemon.h is not sufficient for the code to reach some of the functions defined in pokemon.c .
    Sadly my understanding of C is not good enough to find out why :(

    3. after commenting out unown specific code: (https://prnt.sc/wvw2n4)
    Your other errors sound like a merge gone wrong situation.

    There isn't much that I can tell you other than to retry.
    Assuming you just tried to merge in the PE, you can just use git reset --hard to reset to the latest commit in your repository (which should be the one in which the IE got merged in your project, though you can use git log to check that properly), and then use git pull rhh pokemon_expansion.
    Once you've done that, simply solve the merge conflicts as stated in the main post.
     
    Last edited:
    6
    Posts
    4
    Years
    • Seen Oct 1, 2021
    Thanks for the fast answer, tried it two more times, now it seems to work :) calling make after the initial clone and after each completed merge seemed to help.
     
    6
    Posts
    5
    Years
    • Seen Oct 2, 2021
    Hi followed the tutorial was on the last piece and ran into this issue
    KjttJT5


    When i pulled the final branch in i got this warning message. I went through and fixed all conflicts using the tutorial but now it won't let me commit because it says I am still merging?

    Anyone know why?
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hi followed the tutorial was on the last piece and ran into this issue
    KjttJT5.png


    When i pulled the final branch in i got this warning message. I went through and fixed all conflicts using the tutorial but now it won't let me commit because it says I am still merging?

    Anyone know why?
    You linked your picture incorrectly.

    As for the errors, merge.renameLimit is a Git config, meaning the correct way to use it is git config merge.renameLimit <amount>.
    With that being said, is there a chance you forgot to git add *? That's the first reason I could think for git commit not to work.
     
    Back
    Top