Advertiser Content

Pokeemerald Battle Engine Upgrade Page 3

Started by DizzyEgg February 4th, 2019 4:30 AM
  • 11495 views
  • 68 replies

DizzyEgg

Age 22
Male
Poland
Seen 21 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Does this mean you will do a merge guide at some point for your branches?
At some point...yes, for now Lunos' explanation should suffice https://www.pokecommunity.com/showpost.php?p=10029240&postcount=36

DizzyEgg

Age 22
Male
Poland
Seen 21 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Anyone?
You edit the table here. https://github.com/DizzyEggg/pokeemerald/blob/battle_engine_v2/src/battle_message.c#L3546

The fields go: trainer id(use constants from constants/opponents.h), and 3 pointers to strings, they're displayed when last mon is brought out, when last mon is at low hp and when first pokemon is down respectively. If you want a trainer to have only 1 or two messages, instead of a pointer just put 0 or NULL there.

I noticed that there is a debug menu included with the engine. how would I go about using it? I assume I can open it as USE_BATTLE_DEBUG is forced true in battle_debug.h, I'm just confused as to how.
Press SELECT or START when choosing battle action(run/fight/pokemon/bag). When there, use L/R buttons to change between battlers.

DizzyEgg

Age 22
Male
Poland
Seen 21 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
I noticed that ability number stored as single bit.

Is it on purpose or I can tweak it into two? To read hidden ability.
Yes, if you want to have more than two abilities, you should change it to two or more bits.

nemesish

Azure Trainer

Lima, Perú
Seen 12 Hours Ago
Posted 5 Days Ago
420 posts
11.7 Years
2 questions:
1- where are the items stored? I found a file but it doesn't have the new items, only the old ones.
2- can I edit the mart items with this?
Games I support:

Pokemon Reborn - Pokemon Rejuvenation - Pokemon Zeta/Omicron/Insurgence

Hacks I support:
Fire Red Nameless - Emerald Omega - Fire Red 251+ - Theta Emerald EX - Snowy White

DizzyEgg

Age 22
Male
Poland
Seen 21 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
2 questions:
1- where are the items stored? I found a file but it doesn't have the new items, only the old ones.
2- can I edit the mart items with this?
1. The item effects are defined in constants/hold_effects.h. The actual items are not present in the battle engine, you need to either add the new items yourself or use my item expansion repo that has all of them.
2. No, this is a project strictly for battles. My item expansion repo has all the items tho, and you can edit mart items with that.

This engine does not provision for the SpDef boost Rock types gain during Sandstorm, nor does it flag Blizzard as 100% accurate during Hail.
Fixed both.
Seen 1 Week Ago
Posted August 5th, 2019
1 posts
261 Days
Hi, a couple of questions.
Still new to decomp so apologies if the answers are obvious.

1: Are primal reversions or wish mega evolution currently included in the engine?
2: How feasable would it be to have different weather setting abilities set either temp or permanent weather. As an example; Allow Groudon to make permanent droughts but Ninetales/Torcoal only produce the 5-8 turn Drought like in Gen6 and beyond.

DizzyEgg

Age 22
Male
Poland
Seen 21 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Hi, a couple of questions.
Still new to decomp so apologies if the answers are obvious.

1: Are primal reversions or wish mega evolution currently included in the engine?
2: How feasable would it be to have different weather setting abilities set either temp or permanent weather. As an example; Allow Groudon to make permanent droughts but Ninetales/Torcoal only produce the 5-8 turn Drought like in Gen6 and beyond.
1. No, so far ony mega evo is coded.
2. Pretty easy, each weather has two flags WEATHER_X and WEATHER_X_PERMAMENT, so it's a matter of checking a pokemon species and if it's groudon set it to be permament, otherwise use regular 5-8 turns weather.

Jeesh

The Emerald Rights Activist.

Male
Seen 2 Days Ago
Posted August 25th, 2019
53 posts
3 Years
Is there like a Discord for disassembly, Pokeemerald and related stuff or...

I have a few questions and I also just want to see who else does this stuff on the daily rn
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.
Seen 2 Weeks Ago
Posted 4 Weeks Ago
38 posts
13.3 Years
It seems when I used this everything worked great but it glitches the Double Trainer Battle with Steven at Moss Deep in the Space Station. I imagine this has something to do with the 'custom battles' scripts. Any way to make sure this doesn't happen?

EDIT: Sorry realized I was using the old version of the battle engine here: https://www.pokecommunity.com/showthread.php?t=374338

Still if anyone knows how to change the backsprite in this battle or could help at all to fix this in my rom hack would be greatly appreciated. . .
Seen September 11th, 2019
Posted September 5th, 2019
6 posts
154 Days
Mid-Battle Trainer Messages


How do they work:
1) In your decomp, navigate to src/battle_messages.c, then search for the following structure inside it:



Underneath it, you will find this:



Which is apparently nonsensical giving what the structure above is supposed to do.
This is because that is just a test line: It is there only to make you understand how the structure should work.
Honestly I found it to be more confusing than anything the first time I saw it, so let's just delete the sTrainerSlides content for now.

Now, imagine you've got a brand new Trainer you've just implemented in your decomp, (I'll use my Zinnia as an example), and you want to give it some cool mid-battle messages. Nothing simpler!
Navigate above until you find the strings of the mid-battle messages, it's better if you create the messages where the other messages end, so find:



And add your messages underneath it. The TrainerSlide struct by default needs the trainerId + 3 messages, where the messages are:
  1. The message that triggers when the Trainer only has one Pokemon left.
  2. The message that triggers when the last Pokemon of the Trainer has Low HP left.
  3. The message that triggers when the first Pokemon of the Trainer faints.

So we'll do as it follows:

2) we create the messages:


3) We assign them in the array:


Note: If you don't need one or more of those triggers, you can do as it follows:
For example, If you only want the Trainer to speak when It has got one pokemon left, but not when it is low or after the first Pokemon of the trainer faints,
you can just set the unwanted fields to NULL or 0. Like this:


Now let's see how a complete message setup looks in-game!

First Pokemon Down: https://i.imgur.com/D5MhGKe.png
Last Pokemon: https://i.imgur.com/C60Cobf.png
Last Pokemon has Low HP: https://i.imgur.com/xBIqqNB.png

Done!

How to add more triggers:

Todo! I'll update this message when I got time.
Seen 20 Hours Ago
Posted 1 Day Ago
3 posts
17 Days
1) git clone *can't post links*
2) cd pokeemerald
3) git pull origin battle_engine_v2
4) git pull origin pokemon_expansion
5) Fix merge conflicts as I show in *can't post links*
I'm kinda new to Git and still learning so please bear with me. For me, the moment I have done step 3, there are merges that need attention before I can move on to step 4, none of which are the merges mentioned in step 5. If I skip step 1 and 2 and directly clone the battle_engine_v2 branch, then pull in the pokemon_expansion branch, I once again get a whole list of merges that need attention, none of which are the ones addressed in step 5.

I've read through the basics of the Git documentation and I think I understand the concepts of cloning, pulling, merging etc. but as far as merging goes, it tells you how but not why. Why do we fix those particular merge conflicts that aren't even listed as conflicts and not any of the others? How does one know which files need special attention and which ones don't? Clearly some people here just understand how without needing to be told, like the person that wrote this small guide. So there must be something obvious that I'm missing here. Any help?

Buffel Saft

Male
Seen 5 Hours Ago
Posted 5 Hours Ago
575 posts
6.1 Years
I'm kinda new to Git and still learning so please bear with me. For me, the moment I have done step 3, there are merges that need attention before I can move on to step 4, none of which are the merges mentioned in step 5. If I skip step 1 and 2 and directly clone the battle_engine_v2 branch, then pull in the pokemon_expansion branch, I once again get a whole list of merges that need attention, none of which are the ones addressed in step 5.

I've read through the basics of the Git documentation and I think I understand the concepts of cloning, pulling, merging etc. but as far as merging goes, it tells you how but not why. Why do we fix those particular merge conflicts that aren't even listed as conflicts and not any of the others? How does one know which files need special attention and which ones don't? Clearly some people here just understand how without needing to be told, like the person that wrote this small guide. So there must be something obvious that I'm missing here. Any help?
Presumably what's happening here is Egg's repos have been updated since Lunos wrote that guide, so now there are a different set of merge conflicts to resolve. When you're merging you'll always need to resolve all the conflicts for a successful merge; you can't pick and choose which ones need resolving and which ones don't. Conflicts happen when you have differences between two versions of a file and git can't figure out which version it should keep, so it asks you to decide instead. Usually it's pretty straightforward to figure out which changes you want to keep, but if you get stuck you can always ask here or over on pret's discord.
Seen 20 Hours Ago
Posted 1 Day Ago
3 posts
17 Days
Thank you. Yeah, it's obvious that when it comes to merging the base pokeemerald and battle engine upgrade, that it would basically just be a case of overwriting everything with the battle engine content. It's when it comes to merging the battle engine upgrade with the other modified content that I'm not sure where I would begin yet.

Is there any good reason that there isn't one unified 'Gen 7 Upgrade' branch anywhere? Is it to get people to learn how to use Git? Because I imagine that 99.9% of people that use this would want to use it with the other modifications too. I know that Git is supposed to be the superior way forward but it almost feels like the whole thing was just quicker and simpler when it involved patchers. At least if there was one unified branch, people could spend more time modding Pokemon Emerald and less time figuring out how to use Git.

Buffel Saft

Male
Seen 5 Hours Ago
Posted 5 Hours Ago
575 posts
6.1 Years
Thank you. Yeah, it's obvious that when it comes to merging the base pokeemerald and battle engine upgrade, that it would basically just be a case of overwriting everything with the battle engine content. It's when it comes to merging the battle engine upgrade with the other modified content that I'm not sure where I would begin yet.

Is there any good reason that there isn't one unified 'Gen 7 Upgrade' branch anywhere? Is it to get people to learn how to use Git? Because I imagine that 99.9% of people that use this would want to use it with the other modifications too. I know that Git is supposed to be the superior way forward but it almost feels like the whole thing was just quicker and simpler when it involved patchers. At least if there was one unified branch, people could spend more time modding Pokemon Emerald and less time figuring out how to use Git.
For the most part you can let the battle engine's changes take priority unless it's changing something related to Pokemon or item data. If you're familiar with C a quick skim through the conflicting code usually makes it clear which change to keep.

There are a couple of reasons I can think of to keep these as separate branches; it makes squashing bugs easier if each branch can be tested separately, and it's a lot easier to merge the branches than it is to separate them. There's at least one hack around that uses the battle engine without the Pokemon expansion. Initial set up with patches was definitely easier, but maintaining them is a nightmare compared to having proper version control with git. It's well worth learning to use it just so you don't need to have a folder of backups, and can revert bad changes with a single command or click.
Seen 20 Hours Ago
Posted 1 Day Ago
3 posts
17 Days
Thanks again for the info. I was hoping to use this as an exercise to learn C. I'm no stranger to tinkering with code but wouldn't call myself a coder, yet. This isn't the only C related project that I want to play with though so I think I'm going to actually look for an online course first, then come back here.

I just want to say that this is frikken amazing guys. Years ago when I first started 'modding' this game with a hex editor on my phone, I never thought it would reach the point where basically the whole game has been cracked wide open like this.
Advertiser Content