I've really enjoyed learning about all the ACE possibilities from the discussions here, and I thought I should contribute something :)
After gifting myself a few flawless Pokemon, I wanted to see if I could pull off something a bit more elaborate, perhaps similar to LuckyTyphlosion's mew truck demo (but much simpler code-wise).
I remembered that unused trainer data for Prof. Oak exists in the game, implying that he was originally intended to be the Pokemon league champ. Why not bring that idea to life?
A PC box full of spaghetti code later, and the result is here: https://youtu.be/rtb69s56kM0
Of course, a ROM hacker can do this and more, but I like to think that my 8 year old self would have got a kick out of knowing that this "alternate ending" can be unlocked through elaborate glitching ;D
The code's not well documented, but I'll give the gist:
[li]Change Lance's room current script number to 51, effectively picking a pointer out of garbage data that happens to point to my PC box full of code[/li]
[li]The code there runs when you enter Lance's room, and performs a similar misdirection for Gary's room (and also temporarily changes rival name to "OAK" so that Lance says it)[/li]
[li]The custom code in Gary's room then modifies the map header such that the room's script pointer now points to a specific location in my PC box. I now have control of the scripting in this room.[/li]
[li]The new script (in the PC) orchestrates the events you see in the video, by doing stuff like immediately moving Gary off the map, unhiding Oak, changing Oak's position, facing direction, movement bytes etc., changing the opponent ID, and changing the map text pointers so that they point to my custom text, written byte-by-byte into the PC D:[/li]
Hopefully someone gets some use (or entertainment) out of this…