Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Infinite Trainer-Fly from one Trainer-Fly - Page 1

Infinite Trainer-Fly from one Trainer-Fly

Posted by: luckytyphlosion
Date: 2014-11-25 18:05:08
When you use a TMTrainer item with the 50 too low, you can make a 7F battle with a (hooked) Metapod happen.
If you have the 50 in the right place, then the game thinks you're in a battle, but it won't give you an encounter, because the 50 comes before the Menu Tile.

Basically I came to the conclusion that TMTrainer items can force an encounter to appear.

I was testing with stuff at the time, and it occurred to me: What happens when you use a TMTrainer item while activating a Trainer-Fly, and a 50 Tile is on the screen?

The first time I tested it was from Saffron City to Route 8, using a special Jack movement to achieve a position to have a bush tile on the screen when the Trainer Fly activates. However, the bush tile is reloaded and becomes rock tiles, so I couldn't start the glitch again.

Then, I tried a location where I could enter it, and a 50 Tile would be on screen. A location I found was Viridian Forest from the South (and probably north) exit/entrance. I found that if you use (click use) a TMTrainer item when a Trainer Fly is activated, it will start the battle, but it won't overwrite the Battle Pokemon, even if the 50 Tile is too low. After completing the battle, however, the Trainer-Fly isn't used up, so you can repeatedly use the TMTrainer item without losing the Trainer-Fly, and get your handful of low index value Pokemon.

Alternatively, you can also use this glitch to produce infinite encounters for instaCT/LGs, without the need to continuously search for Pokemon. However this method only allows Good Cooltrainers, which means any bad Distorts can only be Lol Glitches.

[size=14pt]INSTRUCTIONS[/size]
1. Set up a Jack-Fly in Viridian Forest.
2. Fight any Trainer to activate the Trainer-Fly
3. Return to Viridian Forest through Route 2, and USE a TMTrainer item.
4. Complete the battle and repeat step 3 as many times as you want.

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: Torchickens
Date: 2014-11-26 07:03:21
Nice find. Why does actually using the item start the battle without the menu closing? I tried selecting the item and using other items including a Potion and the Coin Case but got the encounter after the menu closed.

This is pretty fun as you can get chains of Pokémon (e.g. SP 25: Gastly;  SP 19 (from Gastly): Lapras; SP 18 (from Lapras): Rhyhorn.

Edit: By the way, I found through hacking (with the codes 014F1FC4 014F20C4 015007C5) that you can have a 50 tile (arrow in Viridian Forest) ''anywhere'' on the screen, even on the last tile. Two important bytes D057 (00, wild Pokémon or Trainer) and D059 (instant encounter Pokémon) get modified again after you use (not select) the TMTRAINER item.

[img]http://i2.minus.com/iMPsPg0rZOBXf.png[/img]

However, if the TMTRAINER item set the gym leader music (D05C) or the Pokémon being hooked (D05F), the game won't set it back to a normal battle.

[img]http://i1.minus.com/idfLvfWJE2zrO.png[/img] <- Note no Metapod or Trainer, but gym music was playing and Nidoran was hooked.

Additionally, encountering regular Trainer-Fly Pokémon won't fix the broken start menu effect (BGB coordinates x=01 y=10, address:D0A0). You could get another Trainer-Fly by using the item again because the start menu is still open, but you'd have to be careful not to close it.

D05A (BGB: x=0B y=0C) may be set to a non 00 value, causing an automatic selection effect if you press B/select an item after the encounter. If this is going to  happen, place your ball in the first position because you'll be forced to use the first item when you go to the items menu in battle, which could be the TMTRAINER item, which would mess things up.

Edit 2: Well a late 50 may sort of work, but something weird happened. Route 13 has a 50 tile on the last row. I did a Jack Fly, fought a Trainer and returned to get the start menu to pop up.

When I used the TMTRAINER item I was greeted by an invisible message box even though I opened the start menu immediately after (and VRAM viewer revealed it as some glitch text), but after I kept pressing A/B I got a hooked Fearow. I caught it and it become a Ditto and the game froze (because CFC4 was an odd value; this controls good/bad CoolTrainers). I cheated to make CFC4 even and I did the second part of step 3. I got Lickitung but when I caught it, it became Ditto again.
[img]http://i2.minus.com/ikS9k4Z3P13WJ.png[/img][img]http://i5.minus.com/ih0SNvx9qcYuv.png[/img][img]http://i1.minus.com/ibdMg6nDMgzbE4.png[/img][img]http://i4.minus.com/ihp076BfsGgJu.png[/img][img]http://i1.minus.com/ixda3JpU2gTAS.png[/img][img]http://i2.minus.com/ibPpyyR7Mhdt5.png[/img][img]http://i4.minus.com/ibn6lE7fzcliKh.png[/img][img]http://i3.minus.com/iFtFeHsENKVWb.png[/img]

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: Torchickens
Date: 2014-11-26 17:21:02
I couldn't get this to work on Yellow. In Viridian Forest I just got a ball throwing animation.

This was because the TMTRAINER item changed the address CF90 (always a menu tile) to 7C. After checking what that is, I found that it controls the effect of an item (e.g. 05 makes all items act like Town Maps).

[img]http://i1.minus.com/iEeqHmmHf29AT.png[/img]

It seems like the only reason why the TMTRAINER item was forcing a battle was because selecting it (not using it) changed its effect to that of item 7C.

With item 7C you can also do an infinite Trainer-Fly, but for some reason my CFC4 value was odd when the battle started, causing a freeze after escaping. I don't know if that's due to me modifying it with memory viewer earlier, or if it's to do with 7C.

Incidentally, 7C warps me to Pallet Town when I use it in battle. Perhaps this would be useful to quickly get a quantity of 0 on item 36 (exit mat location).

This trick may work on Yellow if there's a glitch item with an effect like R/B's 7C.

Edit: Or not, because of the CFC3 corruption. We'd need a way to make it an even number (not counting arbitrary code execution because you can do 'almost anything' with that).
Edit 2: Ah, you could try this with a cave with Trainers like Mt. Moon.
Edit 3: At least one floor of Mt. Moon, Rock Tunnel and Victory Road don't count as safe areas. However, Yellow doesn't care about CFC3, you can even catch Missingno. (and Horsea I presume) with CoolTrainer anywhere (but you can't get "-" as move 1 without something like trading or the max stat experience glitch). This means that as long as there's an item like R/B 7C, doing this in Yellow may be viable.
Edit 4: Couldn't find any items that work like RB 7C.

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: luckytyphlosion
Date: 2014-11-26 22:04:16
According to the ItemDex, hex 7C is a Battle-Ender item. Does that mean the battle ender item closes the menu, which starts the battle?

EDIT: Well, I found the reason why you get the 4 h 's when you perform the Yami-Shop Glitch/Toss the TMTrainer item. If you open the menu with hex 7C, you get this:

[IMG]http://puu.sh/d7XzP/0768db0fc1.png[/img]

You also get it in battle too:
[IMG]http://puu.sh/d7XOI/a0f4e4cc95.png[/img]

For some reason, it crashes the game if you use it in an "activated battle", but not a wild battle.

Hex 7C actually does have the "Battle-Start" effect, but when I fled the battle it crashed the game, even though CFC4 (water tile) was even. I used the Pokedex item in battle to check 7C, and I found this:
[IMG]http://puu.sh/d80vk/a202f2da33.png[/img]

The ground tile four below and one left of the is odd, which explains why it's crashing.

EDIT 2: actually forget what I said about the Pokedex thing I miscounted.

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: Torchickens
Date: 2014-11-28 09:46:28
Unless I'm mistaken, hex:7C in Red/Blue is the only item that does this without the Super Glitch effect and w/o 'specific arbitrary code' (I realize this is a vague term). I probably am mistaken if you can partially manipulate the effects of items (not counting arbitrary code set ups) such as items that get their effect from the memory to act like 7C. By that I mean through simple measures such as how you need a hex:C9 to get map FE to work; not code spelled out with items.

By the way, hex:68 and hex:69 are cool items to have and use :XD:. Hex:68 messes up the graphics each time you use it. Hex:69 causes a disco effect. The effects are taken from $2002 and $2104 (which are in ROM bank 0) respectively, according to TheZZAZZGlitch's list.

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: luckytyphlosion
Date: 2014-11-28 11:18:02
Is there an easy way to find where the items run? (Location in the Disassembly)

Re: Infinite Trainer-Fly from one Trainer-Fly

Posted by: Torchickens
Date: 2014-11-28 13:39:09

Is there an easy way to find where the items run? (Location in the Disassembly)


I don't know, sorry, but the equivalent of this pointer in Yellow is 0:1E04 (found thanks to HxD and searching for matching opcodes). You can use a very simple code and don't have to bank switch because the code is in bank 0:

CD 04 1E

call 1E04

A few times the game froze for some reason, but once it started working I could get a chain of many Pokémon without a freeze.

By using ws m and having it execute this code, you can port "infinite Trainer-Fly from one Trainer-Fly" to Yellow.

You would still need your bootstrap code (stored Pokémon) though.

I tried making the map's level script pointer (D36D) point to this code, but unfortunately the level-script pointer code is only executed when the menu is closed, and you can't do this to get infinite yields.