diff options
-rw-r--r-- | Add-a-new-wild-Pokémon-slot.md | 112 | ||||
-rw-r--r-- | Tutorials.md | 2 | ||||
-rw-r--r-- | screenshots/wild-pokemon.png | bin | 0 -> 1817 bytes |
3 files changed, 113 insertions, 1 deletions
diff --git a/Add-a-new-wild-Pokémon-slot.md b/Add-a-new-wild-Pokémon-slot.md new file mode 100644 index 0000000..7ef1025 --- /dev/null +++ b/Add-a-new-wild-Pokémon-slot.md @@ -0,0 +1,112 @@ +This tutorial is for how to add more variety for wild Pokémon. As an example, we'll add an eighth slot for wild Pokémon in tall grass, and a fourth for wild Pokémon in water. + + +## Contents + +1. [Increase the relevant constants](#1-increase-the-relevant-constants) +2. [Add more probability slots](#2-add-more-probability-slots) +3. [Add more wild data](#3-add-more-wild-data) + + +## 1. Increase the relevant constants + +Edit [constants/pokemon_data_constants.asm](../blob/master/constants/pokemon_data_constants.asm): + +```diff +-NUM_GRASSMON EQU 7 ; data/wild/*_grass.asm table size +-NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size ++NUM_GRASSMON EQU 8 ; data/wild/*_grass.asm table size ++NUM_WATERMON EQU 4 ; data/wild/*_water.asm table size +``` + +If you've seen the [data/wild/\*.asm](../tree/master/data/wild/) files before, it should be obvious that `NUM_GRASSMON` is the number of slots for Pokémon in tall grass at a particular time of day, and `NUM_WATERMON` is for Pokémon in water at any time. + + +## 2. Add more probability slots + +Edit [data/wild/probabilities.asm](../blob/master/data/wild/probabilities.asm): + +```diff + GrassMonProbTable: ; 2a1cb + mon_prob 30, 0 ; 30% chance + mon_prob 60, 1 ; 30% chance + mon_prob 80, 2 ; 20% chance + mon_prob 90, 3 ; 10% chance +- mon_prob 95, 4 ; 5% chance +- mon_prob 99, 5 ; 4% chance +- mon_prob 100, 6 ; 1% chance ++ mon_prob 94, 4 ; 4% chance ++ mon_prob 97, 5 ; 3% chance ++ mon_prob 99, 6 ; 2% chance ++ mon_prob 100, 7 ; 1% chance + ; 2a1d9 + + WaterMonProbTable: ; 2a1d9 + mon_prob 60, 0 ; 60% chance +- mon_prob 90, 1 ; 30% chance +- mon_prob 100, 2 ; 10% chance ++ mon_prob 80, 1 ; 20% chance ++ mon_prob 95, 2 ; 15% chance ++ mon_prob 100, 3 ; 5% chance + ; 2a1df +``` + +These are just the cumulative probabilities for each possible slot. + + +## 3. Add more wild data + +This will be tedious. If you edit `NUM_GRASSMON`, you need to update the wild data for *every* map in [data/wild/johto_grass.asm](../blob/master/data/wild/johto_grass.asm) and [data/wild/kanto_grass.asm](../blob/master/data/wild/kanto_grass.asm); the same goes for `NUM_WATERMON` with [data/wild/johto_water.asm](../blob/master/data/wild/johto_water.asm) and [data/wild/kanto_water.asm](../blob/master/data/wild/kanto_water.asm). Make sure that all the quantities are correct. + +For example, we increased `NUM_GRASSMON` from 7 to 8, so here's how Route 29's wild data could change in [data/wild/johto_grass.asm](../blob/master/data/wild/johto_grass.asm): + +```diff + map_id ROUTE_29 + db 10 percent, 10 percent, 10 percent ; encounter rates: morn/day/nite + ; morn + db 2, PIDGEY + db 2, SENTRET + db 3, PIDGEY + db 3, SENTRET + db 2, RATTATA + db 3, HOPPIP + db 3, HOPPIP ++ db 3, MARILL + ; day + db 2, PIDGEY + db 2, SENTRET + db 3, PIDGEY + db 3, SENTRET + db 2, RATTATA + db 3, HOPPIP + db 3, HOPPIP ++ db 3, MARILL + ; nite + db 2, HOOTHOOT + db 2, RATTATA + db 3, HOOTHOOT + db 3, RATTATA + db 2, RATTATA + db 3, HOOTHOOT + db 3, HOOTHOOT ++ db 3, POLIWAG +``` + +And we increased `NUM_WATERMON` from 3 to 4, so here's how Cherrygrove City's wild data could change in [data/wild/johto_water.asm](../blob/master/data/wild/johto_water.asm): + +```diff + map_id CHERRYGROVE_CITY + db 6 percent ; encounter rate + db 20, TENTACOOL + db 15, TENTACOOL ++ db 20, CORSOLA + db 20, TENTACRUEL +``` + +Don't miss any tables, or you could encounter glitch Pokémon, prevent encounters completely, or cause other weird bugs. + +Anyway, that's it! As long as `NUM_GRASSMON` and `NUM_WATERMON` match the lengths of `GrassMonProbTable`, `WaterMonProbTable`, and the many individual maps' wild data tables, then you can have as many slots as you want. + + + +If you want to make more specific changes to the logic of how wild Pokémon are encountered, then study the code in [engine/overworld/wildmons.asm](../blob/master/engine/overworld/wildmons.asm) and look for where its algorithms would neeed editing. diff --git a/Tutorials.md b/Tutorials.md index 7c9a9ba..c7e539a 100644 --- a/Tutorials.md +++ b/Tutorials.md @@ -24,6 +24,7 @@ Tutorials may use diff syntax to show edits: - [Music song](Add-a-new-music-song) - [Pack pocket](Add-a-new-Pack-pocket) - [Radio channel](Add-a-new-radio-channel) +- [Wild Pokémon slot](Add-a-new-wild-Pokémon-slot) - [Fishing rod](Add-a-new-fishing-rod) **Upgrades to existing features:** @@ -53,7 +54,6 @@ Tutorials may use diff syntax to show edits: - Example map scripts (for common cases like an NPC that gives you an item) - Scene for an existing map (aka triggers; auto-running event scripts) - HM (for Rock Smash) -- 8th wild grass slot - Two more Unown forms - Evolution method (location, held item, move) - More daily and weekly events diff --git a/screenshots/wild-pokemon.png b/screenshots/wild-pokemon.png Binary files differnew file mode 100644 index 0000000..12decd0 --- /dev/null +++ b/screenshots/wild-pokemon.png |