Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
AreaDex
DexDex
ItemDex
TMHMDex
TypeDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
SRAM glitch
Buffer overflow techniques
Pomeg glitch data corruption (Glitzer Popping)
Tweaking
Pokémon cloning
Select glitches (Japan)
Time Capsule exploit
Arbitrary code execution
More

Other Glitch Categories
Glitches by generation
Japan-only/language specific glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Recurring glitches
More

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Error traps
Non-glitch exploits
Pokémon glitch terminology
Unused content and prerelease information
More

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: [Request] 8F setup for editing Levels in the Encounter Table in Pokemon Red  (Read 423 times)

0 Members and 1 Guest are viewing this topic.

Whimsical

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
I was wondering if someone could make an 8F setup that would edit the Levels of the Pokemon in the current encounter table (the same one used by Cinnabar Island's Coast) on the English version of Pokemon Red. Ideally increasing the Level of each Pokemon by the quantity of the item in the first slot (or just increase by a flat 1 if that would be too difficult).
« Last Edit: December 06, 2017, 01:52:05 am by Whimsical »

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Encounter table addresses are well-known, so using the generic one-value changing allows you to use the quantity of item 3 (Lemonade) as the level of one Pokémon.

In this case, if you want to modify all the addresses that controls the available Pokémon, you could use this code 10 times with a quantity of X Accuracy being 154, 152, 150, 148, 146, 144, 142, 140, 138 and 136 and the same quantity of Lemonade.

Creating a code that changes all Pokémon in one take would be rather hard to make, though. However, I was able to make one that changes all common battles level, thanks to ISSOtm's GBZ80toItems.

Any item xAny
8F
Lemonade x(level)
Carbos x216
X Accuracy x136
Water Stone x44
Poké Ball x34
HP Up x34
Awakening x142
Potion x105
Burn Heal x119
TM01 xAny

It is worth noting that this can be seen as a code 'changing one value each two addresses on a 8-address total to (level) starting at $(hex quantity of Carbos)(hex quantity of X Accuracy)'. Thus, having a quantity of X Accuracy of 144 instead will change the uncommon battles.

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Whimsical

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Encounter table addresses are well-known, so using the generic one-value changing allows you to use the quantity of item 3 (Lemonade) as the level of one Pokémon.

In this case, if you want to modify all the addresses that controls the available Pokémon, you could use this code 10 times with a quantity of X Accuracy being 154, 152, 150, 148, 146, 144, 142, 140, 138 and 136 and the same quantity of Lemonade.

Creating a code that changes all Pokémon in one take would be rather hard to make, though. However, I was able to make one that changes all common battles level, thanks to ISSOtm's GBZ80toItems.

Any item xAny
8F
Lemonade x(level)
Carbos x216
X Accuracy x136
Water Stone x44
Poké Ball x34
HP Up x34
Awakening x142
Potion x105
Burn Heal x119
TM01 xAny

It is worth noting that this can be seen as a code 'changing one value each two addresses on a 8-address total to (level) starting at $(hex quantity of Carbos)(hex quantity of X Accuracy)'. Thus, having a quantity of X Accuracy of 144 instead will change the uncommon battles.

So I tried using the encounter table, the hex chart, the code you provided, and a list of GB Assembly Instructions to put together what I wanted, and I came up with this, which crashes the game. I'm wondering exactly what I did wrong here?

ld c,XX -- Store XX in B
ld h,0xD8
ld l,0x88 -- Store 0xD888 in HL
ld e,0x06 -- Loop Counter
inc d -- Shift next operation to use item count
-- Loop Start
ld a,(hld) -- Load current encounter level into a, and decrease HL
inc h -- Shift next operation to use item count
inc l   -- Set HL back to proper value
dec h   -- Shift next operation to use item count
ADD A,c -- Add XX to Level
ldi (hl),a -- Store new level in table, increment to 0xD889
inc e      -- Increment loop counter
inc a     -- Shift next operation to use item count
dec hl     -- Increment HL to 0xD88A
bit 5,e     -- Check if loop is over
JP Z,0xDE2B -- If not over, jump to start of loop
ret         -- Return

Epsilon

  • Zeta
  • Member+
  • *
  • Offline Offline
  • The default personal text makes no sense
    • View Profile
Your issue likely lies with "jp z,$DE2B", which executes unrelated data at $DE2B
"What's a stack? Can you eat that?"

"Sure, just POP it into your mouth!" (someoneplskillme)

Clash Royale profile: #LYQC9LLV. Join our clan because we're lonely.

Does anybody really know what time it is?

Does anybody really care?
- Chicago

Whimsical

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Your issue likely lies with "jp z,$DE2B", which executes unrelated data at $DE2B

But $DE2B is the location of... oh... wait... oops. I ment $D32B which is the location of the quantity of the 7th item, also the meant to write inc hl instead of dec hl. And with those corrections, the script actually works.

The code is as follows
Code: [Select]
ld c,XX -- Store XX in B. Where XX is the amount you want to increment the Levels in the encounter table by.
ld h,0xD8
ld l,0x88 -- Store 0xD888 in HL
ld e,0x06 -- Loop Counter
inc d -- Shift next operation to use item count
-- Loop Start
ld a,(hld) -- Load current encounter level into a, and decrease HL
inc h -- Shift next operation ot use item count
inc l   -- Set HL back to proper value
dec h   -- Shift next operation to use item count
ADD A,c -- Add XX to Level
ldi (hl),a -- Store new level in table, increment to 0xD889
inc e      -- Increment loop counter
inc a     -- Shift next operation to use item count
inc hl     -- Increment HL to 0xD88A
bit 5,e     -- Check if loop is over
JP Z,0xD32B -- If not over, jump to start of loop
ret         -- Return

The item set up for that is
Code: [Select]
Any Item xAny
8F
Awakening xLEVEL
Carbos x216
X Accuracy x136
Repel x6
Potion x58
Protein x44
Iron x129
Water Stone x28
Fresh Water x35
TM03 x107
TM02 x43
TM11 x201

Where the number of Awakenings is the number you want to increase the encounter tables Level by.

Epsilon

  • Zeta
  • Member+
  • *
  • Offline Offline
  • The default personal text makes no sense
    • View Profile
Btw, you may want to use a relative jump "jr" instead of a direct jump "jp"
"What's a stack? Can you eat that?"

"Sure, just POP it into your mouth!" (someoneplskillme)

Clash Royale profile: #LYQC9LLV. Join our clan because we're lonely.

Does anybody really know what time it is?

Does anybody really care?
- Chicago

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Congratulations on making your own code! It's a very nice one  ;D

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov