- 6
- Posts
- 1
- Years
- Seen Nov 6, 2023
Hey,
I'm trying to make an emerald version that is more "life-like" with day/night cycles dialog options, etc. because some things just always bothered me about the world building as a kid.
As a basis I'm using the pokemon-expansion by rh-hideout (V 1.6.2)
One of the things I want to incorporate is reusable Pokeballs. If a Pokemon frees itself I want the number of Pokeballs to stay the same. If I'm using e.g. a hyper ball and the Pokemon frees itself 3x before being caught, I don't want to use 4 balls but just 1.
I found the function that removes the Pokeball in src/item_use.c
, the script for catching a Pokemon in data/battle_scripts_2.s
, and the script for Pokemon that free themselves also in data/battle_scripts_2.s
my idea is to pass gSpecialVar_ItemId to the Escape script so that I can return the kind of Pokeball I used and not some other kind.
I guess it would look something like this:
However, I have no idea how to do that. After hours of searching, I couldn't find anyone who even tried to do it. So if anyone could help me, that would be really cool.
This is my first post, so If I missed any guidelines, please tell me. I don't wanna be the guy who makes it harder for future people to find stuff
I'm trying to make an emerald version that is more "life-like" with day/night cycles dialog options, etc. because some things just always bothered me about the world building as a kid.
As a basis I'm using the pokemon-expansion by rh-hideout (V 1.6.2)
One of the things I want to incorporate is reusable Pokeballs. If a Pokemon frees itself I want the number of Pokeballs to stay the same. If I'm using e.g. a hyper ball and the Pokemon frees itself 3x before being caught, I don't want to use 4 balls but just 1.
I found the function that removes the Pokeball in src/item_use.c
Spoiler:
Code:
switch (GetBallThrowableState())
{
case BALL_THROW_ABLE:
default:
RemoveBagItem(gSpecialVar_ItemId, 1);
, the script for catching a Pokemon in data/battle_scripts_2.s
Spoiler:
Code:
BattleScript_SuccessBallThrow::
setbyte sMON_CAUGHT, TRUE
incrementgamestat GAME_STAT_POKEMON_CAPTURES
, and the script for Pokemon that free themselves also in data/battle_scripts_2.s
Spoiler:
Code:
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
waitmessage B_WAIT_TIME_LONG
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage B_WAIT_TIME_LONG
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
my idea is to pass gSpecialVar_ItemId to the Escape script so that I can return the kind of Pokeball I used and not some other kind.
I guess it would look something like this:
Spoiler:
Code:
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
[COLOR="Lime"]+ giveitem <gSpecialVar_ItemId>, 1[/COLOR]
waitmessage B_WAIT_TIME_LONG
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage B_WAIT_TIME_LONG
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
However, I have no idea how to do that. After hours of searching, I couldn't find anyone who even tried to do it. So if anyone could help me, that would be really cool.
This is my first post, so If I missed any guidelines, please tell me. I don't wanna be the guy who makes it harder for future people to find stuff