Advertiser Content

Pokeemerald Battle Engine Upgrade Page 3

Started by DizzyEgg February 4th, 2019 4:30 AM
  • 10234 views
  • 63 replies

DizzyEgg

Age 22
Male
Poland
Seen 5 Days Ago
Posted 4 Weeks Ago
784 posts
5.6 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 5 Days Ago
Posted 4 Weeks Ago
784 posts
5.6 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 5 Days Ago
Posted 4 Weeks Ago
784 posts
5.6 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 1 Hour Ago
Posted 4 Days Ago
419 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 5 Days Ago
Posted 4 Weeks Ago
784 posts
5.6 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 2 Days Ago
Posted August 5th, 2019
1 posts
235 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 5 Days Ago
Posted 4 Weeks Ago
784 posts
5.6 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 1 Week Ago
Posted 4 Weeks Ago
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 1 Day Ago
Posted 1 Week 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 1 Week Ago
Posted 2 Weeks Ago
6 posts
129 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.
Advertiser Content