• 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] Capture/Battle Combos

180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
Hi! Sometime ago, when I graduated from a Whack a Hack! RGSS scripting school, I made a Catch Combo system for Essentials. And now, I ported it to pokeemerald! (big codes are put in spoilers for easier access and navigation through the page)
This version of the Catch Combo System includes:
  1. Chain a Pokémon, with 30 as the maximum chain possible
  2. Shiny Pokémon appear more often with the level of the chain!
  3. A message box appears at the end of a Wild Battle when the chain is 3 or bigger, so it could appear and be noticed for all players
  4. When a different Pokémon appears, you can run away and the chain continues!
  5. Catching OR defeating the same Pokémon you did before will continue the chain
To do list:
  1. Modify the encounter tables when going forward in the chain
  2. Modify the IV's of the Pokemon (probably gonna add it tomorrow)
  3. Make the chained Pokémon appear more often with the level of the chain
  4. Make (a) special Pokémon sometimes appear at higher chain levels
The first thing you need to do is go to "src/battle_setup.c" and add this lines:
Code:
extern const u8 ChainNumber[]; 
extern const u8 AddChain[];
Below "static const u8 *GetTrainerCantBattleSpeech(void);"
Once we do that, we replace the whole "static void CB2_EndWildBattle(void)" definition with this one:
Spoiler:
Then, we add this variables in "include/constants/vars.h"
VAR_CHAIN
and
VAR_SPECIESCHAINED

We then go to src/pokemon.c and we replace the whole "
this if we don't have the Eggg item expansion and battle engine
Spoiler:
But if we do have them, we replace it with this one:
Spoiler:
Then, we go to "data/scripts/" and we create there an archive named "chain.inc", and inside we add this;
Code:
ChainNumber::
	addvar VAR_CHAIN, 1
	buffernumberstring 0, VAR_CHAIN
	msgbox TextoCool, 2
	end
	
TextoCool::
	.string "Chain Level: {STR_VAR_1}\n chained :{STR_VAR_2}.$"
	
AddChain::
	addvar VAR_CHAIN, 1
	end
And we have to define it on "data/event_scripts.s", adding this at the end:
.include "data/scripts/chain.inc"

And with that, we have it all done. If I missed something or if there's a way to improve the code, let me know!
 
Last edited:
20
Posts
8
Years
  • Age 41
  • Seen Nov 9, 2022
...
Then, we add this variables in "include/constants/vars.h"
VAR_CHAIN
and
VAR_SPECIESCHAINED

...

Can you be more specific? how does one add it?

...

We then go to src/pokemon.c and we replace the whole "
this if we don't have the Eggg item expansion and battle engine
Spoiler:
...

Why do you turn the dynamic values (USE_RANDOM_IVS, MAX_IV_MASK; seen below) with static values (quoted) in src/pokemon.c?

Spoiler:

The values are effectively identical. Are your edits from a previous pret/pokeemerald commit?

Then, we move on to "include/strings.h" and we add this at the end:
extern const u8 gText_Chain[];
And we define it on "src/strings.c"
const u8 gText_Chain[] = _("Cadena: {STR_VAR_1}, de {STR_VAR_1}.");

Does not appear to be used. All of your text appears to be in "data/scripts/chain.inc"
 
Last edited by a moderator:
180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
Can you be more specific? how does one add it?
You add them just like any other var, you go to include/constants/vars.h, replacing an old, unused var (theres ton of them) with those (just the name)

Why do you turn the dynamic values (USE_RANDOM_IVS, MAX_IV_MASK; seen below) with static values (quoted) in src/pokemon.c?
It appears that i was using an old copy. I also know i was going for better IV's the better the chain was, but i dont really remember why the code in that part looks like that.
Does not appear to be used. All of your text appears to be in "data/scripts/chain.inc"
That's simple. I forgot to delete it from the tutorial. Soon I'll update this, and I'll try to make it easier to access and use, I'll also make a repo so i can follow it.
 
Back
Top