Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds battle frontier conversion script #5040

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

AlexOn1ine
Copy link
Collaborator

@AlexOn1ine AlexOn1ine commented Jul 26, 2024

Fixes #5006

Adds script to go along with #4313

@AlexOn1ine
Copy link
Collaborator Author

psf reviewed the pr an error when running the script but I can't reproduce. We are both on linux
image

@Bassoonian Bassoonian added this to the 1.9.0 milestone Jul 27, 2024
@pkmnsnfrn
Copy link
Collaborator

pkmnsnfrn commented Jul 27, 2024

Testing Process

  1. Switch to master
  2. Download script to migration_scripts/
  3. Make script executable and run script
Original File Post Migration File
https://raw.githubusercontent.com/rh-hideout/pokeemerald-expansion/upcoming/src/data/battle_frontier/battle_tent.h https://hastebin.com/share/zojaqelogo
https://raw.githubusercontent.com/rh-hideout/pokeemerald-expansion/upcoming/src/data/battle_frontier/battle_frontier_mons.h https://hastebin.com/share/ihamitorow

Diff

diff --git a/src/data/battle_frontier/battle_tent.h b/src/data/battle_frontier/battle_tent.h
index 4ee203ea90..e3296afb9a 100644
--- a/src/data/battle_frontier/battle_tent.h
+++ b/src/data/battle_frontier/battle_tent.h
@@ -792,7 +792,7 @@ const struct TrainerMon gSlateportBattleTentMons[NUM_SLATEPORT_TENT_MONS] =
         .species = SPECIES_WAILMER,
         .moves = {MOVE_ROLLOUT, MOVE_GROWL, MOVE_WHIRLPOOL, MOVE_WATER_PULSE},
         .heldItem = ITEM_SITRUS_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
         .nature = NATURE_MODEST
     },
     [SLATEPORT_TENT_MON_MARILL_1] = {
@@ -834,7 +834,7 @@ const struct TrainerMon gSlateportBattleTentMons[NUM_SLATEPORT_TENT_MONS] =
         .species = SPECIES_LOTAD,
         .moves = {MOVE_SYNTHESIS, MOVE_NATURE_POWER, MOVE_RAIN_DANCE, MOVE_MEGA_DRAIN},
         .heldItem = ITEM_MYSTIC_WATER,
-        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
         .nature = NATURE_DOCILE
     },
     [SLATEPORT_TENT_MON_SEEDOT] = {
@@ -1156,7 +1156,7 @@ const struct TrainerMon gSlateportBattleTentMons[NUM_SLATEPORT_TENT_MONS] =
         .species = SPECIES_SANDSHREW,
         .moves = {MOVE_SLASH, MOVE_SAND_ATTACK, MOVE_SAND_TOMB, MOVE_DEFENSE_CURL},
         .heldItem = ITEM_SOFT_SAND,
-        .ev = NULL,
+        .evSpread = 0,
         .nature = NATURE_HARDY
     },
     [SLATEPORT_TENT_MON_SWALOT] = {
@@ -2048,7 +2048,7 @@ const struct TrainerMon gVerdanturfBattleTentMons[NUM_VERDANTURF_TENT_MONS] =
         .species = SPECIES_PELIPPER,
         .moves = {MOVE_WING_ATTACK, MOVE_MIST, MOVE_AGILITY, MOVE_PROTECT},
         .heldItem = ITEM_FIGY_BERRY,
-        .ev = NULL,
+        .evSpread = 0,
         .nature = NATURE_BRAVE
     },
     [VERDANTURF_TENT_MON_LOUDRED] = {

If this diff is expected, I'll go ahead and merge!

@Bassoonian
Copy link
Collaborator

If this diff is expected, I'll go ahead and merge!

If it is, it means that there was an issue in the original conversion and that this changed file should be commited, too

@pkmnsnfrn
Copy link
Collaborator

If this diff is expected, I'll go ahead and merge!

If it is, it means that there was an issue in the original conversion and that this changed file should be commited, too

Alex said its not expected via Discord

@AlexOn1ine AlexOn1ine force-pushed the battle_frontier_script branch from 922b536 to 4038c78 Compare July 30, 2024 13:41
@AlexOn1ine
Copy link
Collaborator Author

ready for review again. I didn't fix the 0/Null difference because I don't think it is important but should be good otherwise.

@pkmnsnfrn
Copy link
Collaborator

pkmnsnfrn commented Jul 30, 2024

Process

Run this from the root folder of master.

wget https://github.com/rh-hideout/pokeemerald-expansion/raw/4038c781e26ada8767241786a64bc157d44303fc/migration_scripts/1.9/battle_frontier_convert_parties.py -O migration_scripts/battle.py ;
python3 migration_scripts/battle_frontier_convert_parties.py ;
chmod +x migration_scripts/battle.py ;
python3 migration_scripts/battle.py ;
git add src/data/battle_frontier/ ;
git commit -m "make changes" ;
git diff upcoming..master -- src/data/battle_frontier > diff.txt

Result

diff --git a/src/data/battle_frontier/battle_frontier_mons.h b/src/data/battle_frontier/battle_frontier_mons.h
index 7299e78a03..e83a25e829 100644
--- a/src/data/battle_frontier/battle_frontier_mons.h
+++ b/src/data/battle_frontier/battle_frontier_mons.h
@@ -2804,7 +2804,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_LUDICOLO,
         .moves = {MOVE_SURF, MOVE_RAIN_DANCE, MOVE_THUNDER_PUNCH, MOVE_FIRE_PUNCH},
         .heldItem = ITEM_SHELL_BELL,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_QUIET
     },
     [FRONTIER_MON_HYPNO_1] = {
@@ -2853,7 +2853,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_ELECTABUZZ,
         .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_BRICK_BREAK, MOVE_LIGHT_SCREEN},
         .heldItem = ITEM_CHERI_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_RELAXED
     },
     [FRONTIER_MON_TAUROS_1] = {
@@ -2909,7 +2909,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_MAGMAR,
         .moves = {MOVE_FLAMETHROWER, MOVE_SMOKESCREEN, MOVE_BRICK_BREAK, MOVE_BARRIER},
         .heldItem = ITEM_RAWST_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_RELAXED
     },
     [FRONTIER_MON_CRADILY_1] = {
@@ -3245,7 +3245,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_MILOTIC,
         .moves = {MOVE_HYDRO_PUMP, MOVE_ICY_WIND, MOVE_RECOVER, MOVE_MIRROR_COAT},
         .heldItem = ITEM_LUM_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_MODEST
     },
     [FRONTIER_MON_ARCANINE_1] = {
@@ -3714,7 +3714,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_TENTACRUEL,
         .moves = {MOVE_TOXIC, MOVE_GIGA_DRAIN, MOVE_CONFUSE_RAY, MOVE_SURF},
         .heldItem = ITEM_LEFTOVERS,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_HARDY
     },
     [FRONTIER_MON_AERODACTYL_2] = {
@@ -5870,7 +5870,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_REGICE,
         .moves = {MOVE_EARTHQUAKE, MOVE_ICE_BEAM, MOVE_CURSE, MOVE_COUNTER},
         .heldItem = ITEM_LEFTOVERS,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_BRAVE
     },
     [FRONTIER_MON_REGICE_6] = {
diff --git a/src/data/battle_frontier/battle_tent.h b/src/data/battle_frontier/battle_tent.h
index 4ee203ea90..18cb185f45 100644
--- a/src/data/battle_frontier/battle_tent.h
+++ b/src/data/battle_frontier/battle_tent.h
@@ -1156,7 +1156,7 @@ const struct TrainerMon gSlateportBattleTentMons[NUM_SLATEPORT_TENT_MONS] =
         .species = SPECIES_SANDSHREW,
         .moves = {MOVE_SLASH, MOVE_SAND_ATTACK, MOVE_SAND_TOMB, MOVE_DEFENSE_CURL},
         .heldItem = ITEM_SOFT_SAND,
-        .ev = NULL,
+        .evSpread = 0,
         .nature = NATURE_HARDY
     },
     [SLATEPORT_TENT_MON_SWALOT] = {
@@ -2048,7 +2048,7 @@ const struct TrainerMon gVerdanturfBattleTentMons[NUM_VERDANTURF_TENT_MONS] =
         .species = SPECIES_PELIPPER,
         .moves = {MOVE_WING_ATTACK, MOVE_MIST, MOVE_AGILITY, MOVE_PROTECT},
         .heldItem = ITEM_FIGY_BERRY,
-        .ev = NULL,
+        .evSpread = 0,
         .nature = NATURE_BRAVE
     },
     [VERDANTURF_TENT_MON_LOUDRED] = {

@AlexOn1ine
Copy link
Collaborator Author

damn it. Will fix later. Sorry

@pkmnsnfrn
Copy link
Collaborator

Updated comment if you want to replicate my test

@AlexOn1ine
Copy link
Collaborator Author

Should be fixed. The script fixes a couple of mons in battle_frontier_mons that had incorrect evSpreads

@pkmnsnfrn
Copy link
Collaborator

diff --git a/src/data/battle_frontier/battle_frontier_mons.h b/src/data/battle_frontier/battle_frontier_mons.h
index 7299e78a03..e83a25e829 100644
--- a/src/data/battle_frontier/battle_frontier_mons.h
+++ b/src/data/battle_frontier/battle_frontier_mons.h
@@ -2804,7 +2804,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_LUDICOLO,
         .moves = {MOVE_SURF, MOVE_RAIN_DANCE, MOVE_THUNDER_PUNCH, MOVE_FIRE_PUNCH},
         .heldItem = ITEM_SHELL_BELL,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_QUIET
     },
     [FRONTIER_MON_HYPNO_1] = {
@@ -2853,7 +2853,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_ELECTABUZZ,
         .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_BRICK_BREAK, MOVE_LIGHT_SCREEN},
         .heldItem = ITEM_CHERI_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_RELAXED
     },
     [FRONTIER_MON_TAUROS_1] = {
@@ -2909,7 +2909,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_MAGMAR,
         .moves = {MOVE_FLAMETHROWER, MOVE_SMOKESCREEN, MOVE_BRICK_BREAK, MOVE_BARRIER},
         .heldItem = ITEM_RAWST_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_RELAXED
     },
     [FRONTIER_MON_CRADILY_1] = {
@@ -3245,7 +3245,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_MILOTIC,
         .moves = {MOVE_HYDRO_PUMP, MOVE_ICY_WIND, MOVE_RECOVER, MOVE_MIRROR_COAT},
         .heldItem = ITEM_LUM_BERRY,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_MODEST
     },
     [FRONTIER_MON_ARCANINE_1] = {
@@ -3714,7 +3714,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_TENTACRUEL,
         .moves = {MOVE_TOXIC, MOVE_GIGA_DRAIN, MOVE_CONFUSE_RAY, MOVE_SURF},
         .heldItem = ITEM_LEFTOVERS,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_HARDY
     },
     [FRONTIER_MON_AERODACTYL_2] = {
@@ -5870,7 +5870,7 @@ const struct TrainerMon gBattleFrontierMons[NUM_FRONTIER_MONS] =
         .species = SPECIES_REGICE,
         .moves = {MOVE_EARTHQUAKE, MOVE_ICE_BEAM, MOVE_CURSE, MOVE_COUNTER},
         .heldItem = ITEM_LEFTOVERS,
-        .ev = TRAINER_PARTY_EVS(170, 170, 0, 0, 170, 0),
+        .ev = TRAINER_PARTY_EVS(170, 0, 170, 0, 170, 0),
         .nature = NATURE_BRAVE
     },
     [FRONTIER_MON_REGICE_6] = {

@AlexOn1ine
Copy link
Collaborator Author

You could verify it by comparing the replacement but this should be correct. They were previously wrong.

@pkmnsnfrn
Copy link
Collaborator

Ah, interesting, didn't understand the implications of your comment. Restating to make sure I understnand

  1. The battle_frontier_mons that is currently on upcoming is wrong.
  2. This PR adds the correct battle_frontier_mons and a migration script

I can confirm that the migration script converts to an exact copy of the new file you added.

if that's all corrected and expected, I will merge.

@AlexOn1ine
Copy link
Collaborator Author

1. The `battle_frontier_mons` that is currently on `upcoming` is wrong.
2. This PR adds the correct `battle_frontier_mons` and a migration script

yes this is my assumption but as a reviewer you should verify if I am correct. Meaning you should check if the evSpread that is being converted converts to the correct values.

@pkmnsnfrn
Copy link
Collaborator

I have spotcheked the few mons that are changed in this PR and they seem to be correct. However, your comment made me realize that 5a986c6 wasn't properly checked in this way - I have no way of knowing that the any version of upcoming is correct.

If that's the case, then I should do some better testing. I think 10% is reasonable, but that means comparing 92~ mons against other data to see if they match, which I'm happy to do, but won't happen for a few days.

@AlexOn1ine
Copy link
Collaborator Author

I have spotcheked the few mons that are changed in this PR and they seem to be correct. However, your comment made me realize that 5a986c6 wasn't properly checked in this way - I have no way of knowing that the any version of upcoming is correct.

If that's the case, then I should do some better testing. I think 10% is reasonable, but that means comparing 92~ mons against other data to see if they match, which I'm happy to do, but won't happen for a few days.

no, you don't need to check everything. I'm pretty certain it should be correct otherwise

@pkmnsnfrn pkmnsnfrn merged commit 3b9ea5b into rh-hideout:upcoming Jul 31, 2024
1 check passed
@AlexOn1ine AlexOn1ine deleted the battle_frontier_script branch November 21, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants